Gentoo Archives: gentoo-commits

From: "Mike Frysinger (vapier)" <vapier@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] gentoo-x86 commit in sys-apps/baselayout: ChangeLog baselayout-1.12.10-r5.ebuild
Date: Wed, 26 Sep 2007 01:06:10
Message-Id: E1IaLDe-0005S3-Cs@stork.gentoo.org
1 vapier 07/09/26 00:57:38
2
3 Modified: ChangeLog
4 Added: baselayout-1.12.10-r5.ebuild
5 Log:
6 Add workaround for net.eth0 going AFK during upgrade to baselayout-2.
7 (Portage version: 2.1.3.9)
8
9 Revision Changes Path
10 1.438 sys-apps/baselayout/ChangeLog
11
12 file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/sys-apps/baselayout/ChangeLog?rev=1.438&view=markup
13 plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/sys-apps/baselayout/ChangeLog?rev=1.438&content-type=text/plain
14 diff : http://sources.gentoo.org/viewcvs.py/gentoo-x86/sys-apps/baselayout/ChangeLog?r1=1.437&r2=1.438
15
16 Index: ChangeLog
17 ===================================================================
18 RCS file: /var/cvsroot/gentoo-x86/sys-apps/baselayout/ChangeLog,v
19 retrieving revision 1.437
20 retrieving revision 1.438
21 diff -u -r1.437 -r1.438
22 --- ChangeLog 24 Sep 2007 13:50:52 -0000 1.437
23 +++ ChangeLog 26 Sep 2007 00:57:37 -0000 1.438
24 @@ -1,10 +1,16 @@
25 # ChangeLog for sys-apps/baselayout
26 # Copyright 1999-2007 Gentoo Foundation; Distributed under the GPL v2
27 -# $Header: /var/cvsroot/gentoo-x86/sys-apps/baselayout/ChangeLog,v 1.437 2007/09/24 13:50:52 vapier Exp $
28 +# $Header: /var/cvsroot/gentoo-x86/sys-apps/baselayout/ChangeLog,v 1.438 2007/09/26 00:57:37 vapier Exp $
29
30 # See the rc-scripts ChangeLog in subversion for release info:
31 # http://sources.gentoo.org/viewcvs.py/*checkout*/baselayout/trunk/ChangeLog
32
33 +*baselayout-1.12.10-r5 (26 Sep 2007)
34 +
35 + 26 Sep 2007; Mike Frysinger <vapier@g.o>
36 + +baselayout-1.12.10-r5.ebuild:
37 + Add workaround for net.eth0 going AFK during upgrade to baselayout-2.
38 +
39 24 Sep 2007; Mike Frysinger <vapier@g.o>
40 baselayout-2.0.0_rc4-r1.ebuild:
41 Add a warning check for users with blank passwords in /etc/shadow.
42
43
44
45 1.1 sys-apps/baselayout/baselayout-1.12.10-r5.ebuild
46
47 file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/sys-apps/baselayout/baselayout-1.12.10-r5.ebuild?rev=1.1&view=markup
48 plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/sys-apps/baselayout/baselayout-1.12.10-r5.ebuild?rev=1.1&content-type=text/plain
49
50 Index: baselayout-1.12.10-r5.ebuild
51 ===================================================================
52 # Copyright 1999-2007 Gentoo Foundation
53 # Distributed under the terms of the GNU General Public License v2
54 # $Header: /var/cvsroot/gentoo-x86/sys-apps/baselayout/baselayout-1.12.10-r5.ebuild,v 1.1 2007/09/26 00:57:37 vapier Exp $
55
56 inherit flag-o-matic eutils toolchain-funcs multilib
57
58 DESCRIPTION="Filesystem baselayout and init scripts"
59 HOMEPAGE="http://www.gentoo.org/"
60 SRC_URI="mirror://gentoo/${P}.tar.bz2
61 http://dev.gentoo.org/~uberlord/baselayout/${P}.tar.bz2
62 http://dev.gentoo.org/~azarah/baselayout/${P}.tar.bz2
63 http://dev.gentoo.org/~vapier/dist/${P}.tar.bz2"
64
65 LICENSE="GPL-2"
66 SLOT="0"
67 KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86"
68 IUSE="bootstrap build static unicode"
69
70 # This version of baselayout needs gawk in /bin, but as we do not have
71 # a c++ compiler during bootstrap, we cannot depend on it if "bootstrap"
72 # or "build" are in USE.
73 # We need to block old dhcpcd versions as they are no longer in system
74 # but may not be in users world file either. See bug #143885
75 RDEPEND="virtual/init
76 !build? ( !bootstrap? (
77 sys-apps/mktemp
78 >=sys-libs/readline-5.0-r1
79 >=app-shells/bash-3.1_p7
80 >=sys-apps/coreutils-5.2.1
81 ) )
82 !<net-misc/dhcpcd-2.0.0"
83 DEPEND="virtual/os-headers
84 >=sys-apps/portage-2.0.51"
85 PDEPEND="!build? ( !bootstrap? ( >=sys-apps/module-init-tools-3.2.2-r3 ) )"
86 PROVIDE="virtual/baselayout"
87
88 src_unpack() {
89 unpack ${A}
90 cd "${S}"
91
92 epatch "${FILESDIR}/${PN}-1.12.9-wireless-deprecate.patch"
93 epatch "${FILESDIR}/${P}-svn2690.patch"
94 rm -f man/modules-update.8
95 sed -i 's:modules-update:update-modules:' init.d/modules
96
97 # Setup unicode defaults for silly unicode users
98 if use unicode ; then
99 sed -i -e '/^UNICODE=/s:no:yes:' etc/rc.conf
100 fi
101
102 # Tweak arch-specific details
103 cd "${S}"
104
105 case $(tc-arch) in
106 sparc)
107 # Disable interactive boot on sparc due to stty calls, #104067
108 sed -i -e '/^RC_INTERACTIVE=/s:yes:no:' etc/conf.d/rc || die
109 ;;
110 esac
111
112 # Use correct path to filefuncs.so on multilib systems
113 sed -i -e "s:/lib/rcscripts:/$(get_libdir)/rcscripts:" \
114 ${S}/src/awk/{cachedepends,genenviron}.awk || die
115 }
116
117 src_compile() {
118 local libdir="lib"
119
120 use static && append-ldflags -static
121
122 [[ ${SYMLINK_LIB} == "yes" ]] && libdir=$(get_abi_LIBDIR "${DEFAULT_ABI}")
123
124 make -C "${S}"/src \
125 CC="$(tc-getCC)" \
126 LD="$(tc-getCC) ${LDFLAGS}" \
127 CFLAGS="${CFLAGS}" \
128 LIBDIR="${libdir}" || die
129 }
130
131 # ${PATH} should include where to get MAKEDEV when calling this
132 # function
133 create_dev_nodes() {
134 case $(tc-arch) in
135 # amd64 must use generic-i386 because amd64/x86_64 does not have
136 # a generic option at this time, and the default 'generic' ends
137 # up erroring out, because MAKEDEV internally doesn't know what
138 # to use
139 arm*) suffix=-arm ;;
140 alpha) suffix=-alpha ;;
141 amd64) suffix=-i386 ;;
142 hppa) suffix=-hppa ;;
143 ia64) suffix=-ia64 ;;
144 m68k) suffix=-m68k ;;
145 mips*) suffix=-mips ;;
146 ppc*) suffix=-powerpc ;;
147 s390*) suffix=-s390 ;;
148 sh*) suffix=-sh ;;
149 sparc*) suffix=-sparc ;;
150 x86) suffix=-i386 ;;
151 esac
152
153 einfo "Using generic${suffix} to make $(tc-arch) device nodes..."
154 MAKEDEV generic${suffix}
155 MAKEDEV sg scd rtc hde hdf hdg hdh input audio video
156 }
157
158 # This is a temporary workaround until bug 9849 is completely solved
159 # in portage. We need to create the directories so they're available
160 # during src_install, but when src_install is finished, call unkdir
161 # to remove any empty directories instead of leaving them around.
162 kdir() {
163 typeset -a args
164 typeset d
165
166 # Create the directories for the remainder of src_install, and
167 # remember how to create the directories later.
168 for d in "$@"; do
169 if [[ $d == /* ]]; then
170 install -d "${args[@]}" "${D}/${d}"
171 cat >> "${D}/usr/share/baselayout/mkdirs.sh" <<EOF
172 if [ ! -d "\${ROOT}/${d}" ] ; then \\
173 install -d ${args[@]} "\${ROOT}/${d}" 2>/dev/null \\
174 || ewarn " can't create ${d}"
175 touch "\${ROOT}/${d}/.keep" 2>/dev/null \\
176 || ewarn " can't create ${d}/.keep"
177 fi
178 EOF
179 else
180 args=("${args[@]}" "${d}")
181 fi
182 done
183 }
184
185 # Continued from kdir above... This function removes any empty
186 # directories as a temporary workaround for bug 9849. The directories
187 # (and .keep files) are re-created in pkg_postinst, which means they
188 # aren't listed in CONTENTS, unfortunately.
189 unkdir() {
190 einfo "Running unkdir to workaround bug 9849"
191 find "${D}" -depth -type d -exec rmdir {} \; 2>/dev/null
192 if [[ $? == 127 ]]; then
193 ewarn "Problem running unkdir: find command not found"
194 fi
195 }
196
197 # Same as kdir above, but for symlinks #103618
198 ksym() {
199 echo "[[ ! -e ${ROOT}/$2 ]] && { ln -s '$1' '${ROOT}/$2' &> /dev/null || ewarn ' unable to symlink $2 to $1' ; }" \
200 >> "${D}"/usr/share/baselayout/mklinks.sh
201 }
202
203 src_install() {
204 local dir libdirs libdirs_env rcscripts_dir
205
206 # This directory is to stash away things that will be used in
207 # pkg_postinst; it's needed first for kdir to function
208 dodir /usr/share/baselayout
209
210 # Jeremy Huddleston <eradicator@g.o>
211 # For multilib, we want to make sure that all our multilibdirs exist
212 # and make lib even if it's not listed as one (like on amd64/ppc64
213 # which sometimes has lib32/lib64 instead of lib/lib64).
214 # lib should NOT be a symlink to one of the other libdirs.
215 # Old systems with symlinks won't be affected by this change, as the
216 # symlinks already exist and won't get removed, but new systems will
217 # be setup properly.
218 #
219 # I'll be making a script to convert existing systems from symlink to
220 # nosymlink and putting it in /usr/portage/scripts.
221 libdirs=$(get_all_libdirs)
222 : ${libdirs:=lib} # it isn't that we don't trust multilib.eclass...
223
224 # This should be /lib/rcscripts, but we have to support old profiles too.
225 if [[ ${SYMLINK_LIB} == "yes" ]]; then
226 rcscripts_dir="/$(get_abi_LIBDIR ${DEFAULT_ABI})/rcscripts"
227 else
228 rcscripts_dir="/lib/rcscripts"
229 fi
230
231 einfo "Creating directories..."
232 kdir /usr
233 kdir /usr/local
234 kdir /boot
235 kdir /dev
236 kdir /dev/pts
237 kdir /dev/shm
238 kdir /etc/conf.d
239 kdir /etc/cron.daily
240 kdir /etc/cron.hourly
241 kdir /etc/cron.monthly
242 kdir /etc/cron.weekly
243 kdir /etc/env.d
244 dodir /etc/init.d # .keep file might mess up init.d stuff
245 kdir /etc/modules.autoload.d
246 kdir /etc/modules.d
247 kdir /etc/opt
248 kdir /home
249 kdir ${rcscripts_dir}
250 kdir ${rcscripts_dir}/awk
251 kdir ${rcscripts_dir}/sh
252 kdir ${rcscripts_dir}/net
253 # Only install /mnt stuff at bootstrap time #88835 / #90022
254 if use build ; then
255 kdir /mnt
256 kdir -m 0700 /mnt/cdrom
257 kdir -m 0700 /mnt/floppy
258 fi
259 kdir /opt
260 kdir -o root -g uucp -m0775 /var/lock
261 kdir /proc
262 kdir -m 0700 /root
263 kdir /sbin
264 kdir /sys # for 2.6 kernels
265 kdir /usr/bin
266 kdir /usr/include
267 kdir /usr/include/asm
268 kdir /usr/include/linux
269 kdir /usr/local/bin
270 kdir /usr/local/games
271 kdir /usr/local/sbin
272 kdir /usr/local/share
273 kdir /usr/local/share/doc
274 kdir /usr/local/share/man
275 kdir /usr/local/src
276 kdir ${PORTDIR}
277 kdir /usr/sbin
278 kdir /usr/share/doc
279 kdir /usr/share/info
280 kdir /usr/share/man
281 kdir /usr/share/misc
282 kdir /usr/src
283 kdir -m 1777 /tmp
284 kdir /var
285 dodir /var/db/pkg # .keep file messes up Portage
286 kdir /var/lib/misc
287 kdir /var/lock/subsys
288 kdir /var/log/news
289 kdir /var/run
290 kdir /var/spool
291 kdir /var/state
292 kdir -m 1777 /var/tmp
293
294 for dir in ${libdirs}; do
295 libdirs_env=${libdirs_env:+$libdirs_env:}/${dir}:/usr/${dir}:/usr/local/${dir}
296 [[ ${dir} == "lib" && ${SYMLINK_LIB} == "yes" ]] && continue
297 kdir /${dir}
298 kdir /usr/${dir}
299 kdir /usr/local/${dir}
300 done
301
302 # Ugly compatibility with stupid ebuilds and old profiles symlinks
303 if [[ ${SYMLINK_LIB} == "yes" ]] ; then
304 rm -r "${D}"/{lib,usr/lib,usr/local/lib} &> /dev/null
305 ksym $(get_abi_LIBDIR ${DEFAULT_ABI}) /lib
306 ksym $(get_abi_LIBDIR ${DEFAULT_ABI}) /usr/lib
307 ksym $(get_abi_LIBDIR ${DEFAULT_ABI}) /usr/local/lib
308 fi
309
310 # FHS compatibility symlinks stuff
311 ksym /var/tmp /usr/tmp
312 ksym share/man /usr/local/man
313
314 #
315 # Setup files in /etc
316 #
317 insopts -m0644
318 insinto /etc
319 doins -r "${S}"/etc/*
320 fperms 0640 /etc/sysctl.conf
321
322 # Install some files to /usr/share/baselayout instead of /etc to keep from
323 # (1) overwriting the user's settings, (2) screwing things up when
324 # attempting to merge files, (3) accidentally packaging up personal files
325 # with quickpkg
326 fperms 0600 /etc/shadow
327 mv "${D}"/etc/{passwd,shadow,group,fstab,hosts,issue.devfix} "${D}"/usr/share/baselayout
328
329 # doinitd doesnt respect symlinks
330 dodir /etc/init.d
331 cp -P "${S}"/init.d/* "${D}"/etc/init.d/ || die "doinitd"
332 #doinitd "${S}"/init.d/* || die "doinitd"
333 doconfd "${S}"/etc/conf.d/* || die "doconfd"
334 doenvd "${S}"/etc/env.d/* || die "doenvd"
335 insinto /etc/modules.autoload.d
336 doins "${S}"/etc/modules.autoload.d/*
337 insinto /etc/modules.d
338 doins "${S}"/etc/modules.d/*
339
340 # Special-case uglyness... For people updating from lib32 -> lib amd64
341 # profiles, keep lib32 in the search path while it's around
342 if has_multilib_profile && [ -d /lib32 -o -d /usr/lib32 ] && ! hasq lib32 ${libdirs}; then
343 libdirs_env="${libdirs_env}:/lib32:/usr/lib32:/usr/local/lib32"
344 fi
345
346 # List all the multilib libdirs in /etc/env/04multilib (only if they're
347 # actually different from the normal
348 if has_multilib_profile || [[ $(get_libdir) != "lib" || -n ${CONF_MULTILIBDIR} ]]; then
349 echo "LDPATH=\"${libdirs_env}\"" > 04multilib
350 doenvd 04multilib
351 fi
352
353 # As of baselayout-1.10-1-r1, sysvinit is its own package again, and
354 # provides the inittab itself
355 rm -f "${D}"/etc/inittab
356
357 # Stash the rc-lists for use during pkg_postinst
358 cp -r "${S}"/rc-lists "${D}"/usr/share/baselayout
359
360 # rc-scripts version for testing of features that *should* be present
361 echo "Gentoo Base System release ${PV}" > ${D}/etc/gentoo-release
362
363 #
364 # Setup files related to /dev
365 #
366 into /
367 dosbin "${S}"/sbin/MAKEDEV
368 dosym ../../sbin/MAKEDEV /usr/sbin/MAKEDEV
369 dosym ../sbin/MAKEDEV /dev/MAKEDEV
370
371 #
372 # Setup files in /bin
373 #
374 cd "${S}"/bin
375 dobin rc-status
376
377 #
378 # Setup files in /sbin
379 #
380 cd "${S}"/sbin
381 into /
382 dosbin rc rc-update
383 dosym rc-update /sbin/update-rc
384 # These moved from /etc/init.d/ to /sbin to help newb systems
385 # from breaking
386 dosbin runscript.sh functions.sh
387
388 # Compat symlinks between /etc/init.d and /sbin
389 # (some stuff have hardcoded paths)
390 dosym ../../sbin/depscan.sh /etc/init.d/depscan.sh
391 dosym ../../sbin/runscript.sh /etc/init.d/runscript.sh
392 dosym ../../sbin/functions.sh /etc/init.d/functions.sh
393
394 #
395 # Setup files in /lib/rcscripts
396 # These are support files for other things in baselayout that needn't be
397 # under CONFIG_PROTECTed /etc
398 #
399 cd "${S}"/sbin
400 exeinto ${rcscripts_dir}/sh
401 doexe rc-services.sh rc-daemon.sh rc-help.sh
402
403 # We can only install new, fast awk versions of scripts
404 # if 'build' or 'bootstrap' is not in USE. This will
405 # change if we have sys-apps/gawk-3.1.1-r1 or later in
406 # the build image ...
407 if ! use build; then
408 # This is for new depscan.sh and env-update.sh
409 # written in awk
410 cd "${S}"/sbin
411 into /
412 dosbin depscan.sh
413 dosbin env-update.sh
414 insinto ${rcscripts_dir}/awk
415 doins "${S}"/src/awk/*.awk
416 fi
417
418 # Original design had these in /etc/net.modules.d but that is too
419 # problematic with CONFIG_PROTECT
420 dodir ${rcscripts_dir}
421 cp -pPR "${S}"/lib/rcscripts/net ${D}${rcscripts_dir}
422 chown -R root:0 ${D}${rcscripts_dir}
423
424 #
425 # Install baselayout documentation
426 #
427 if ! use build ; then
428 doman "${S}"/man/*.*
429 docinto /
430 dodoc ${FILESDIR}/copyright
431 dodoc "${S}"/ChangeLog
432 fi
433
434 #
435 # Install baselayout utilities
436 #
437 local libdir="lib"
438 [[ ${SYMLINK_LIB} == "yes" ]] && libdir=$(get_abi_LIBDIR "${DEFAULT_ABI}")
439
440 cd "${S}"/src
441 make DESTDIR="${D}" LIBDIR="${libdir}" install || die
442
443 # Hack to fix bug 9849, continued in pkg_postinst
444 unkdir
445 }
446
447 # Support function for remapping old wireless dns vars
448 remap_dns_vars() {
449 local f="$1"
450
451 if [[ -f ${ROOT}/etc/conf.d/${f} ]]; then
452 sed -e 's/\<domain_/dns_domain_/g' \
453 -e 's/\<mac_domain_/mac_dns_domain_/g' \
454 -e 's/\<nameservers_/dns_servers_/g' \
455 -e 's/\<mac_nameservers_/mac_dns_servers_/g' \
456 -e 's/\<searchdomains_/dns_search_domains_/g' \
457 -e 's/\<mac_searchdomains_/mac_dns_search_domains_/g' \
458 ${ROOT}/etc/conf.d/${f} > ${D}/etc/conf.d/${f}
459 fi
460 }
461
462 pkg_preinst() {
463 # When downgrading from 1.13 we need to erase net.lo as it's a symlink
464 # and it's about to become a file - this is fatal in /etc
465 [[ -L "${ROOT}"etc/init.d/net.lo ]] && rm -f "${ROOT}"etc/init.d/net.lo
466
467 # Reincarnate dirs from kdir/unkdir (hack for bug 9849)
468 # This needs to be in pkg_preinst() rather than pkg_postinst() as
469 # portage may create some dirs/files that'll screw us up (like /usr/lib/debug)
470 einfo "Creating directories and .keep files."
471 einfo "Some of these might fail if they're read-only mounted"
472 einfo "filesystems, for example /dev or /proc. That's okay!"
473 source "${D}"/usr/share/baselayout/mkdirs.sh
474 source "${D}"/usr/share/baselayout/mklinks.sh
475 echo
476
477 if [[ -f ${ROOT}/etc/modules.autoload && \
478 ! -d ${ROOT}/etc/modules.autoload.d ]]; then
479 mkdir -p ${ROOT}/etc/modules.autoload.d
480 mv -f ${ROOT}/etc/modules.autoload \
481 ${ROOT}/etc/modules.autoload.d/kernel-2.4
482 ln -snf modules.autoload.d/kernel-2.4 ${ROOT}/etc/modules.autoload
483 fi
484
485 # Change some vars introduced in baselayout-1.11.0 before we go stable
486 # The new names make more sense and allow nis_domain
487 # for use in baselayout-1.12.0
488 remap_dns_vars net
489 remap_dns_vars wireless
490 }
491
492 pkg_postinst() {
493 local x y
494
495 # Create /boot/boot symlink in pkg_postinst because sometimes
496 # /boot is a FAT filesystem. When that is the case, then the
497 # symlink will fail. Consequently, if we create it in
498 # src_install, then merge will fail. AFAIK there is no point to
499 # this symlink except for misconfigured grubs. See bug 50108
500 # (05 May 2004 agriffis)
501 ln -sn . "${ROOT}"/boot/boot 2>/dev/null
502
503 # For the bootstrap scenario with an empty /dev, let's fill the
504 # sucker with generic crude ... some day we should think about
505 # slimming this way down as we've moved on to udev/devfs
506 if use build ; then
507 if [[ ! -e ${ROOT}/dev/.devfsd && ! -e ${ROOT}/dev/.udev ]] ; then
508 echo
509 einfo "Making device node tarball (this could take a couple minutes)"
510 cd "${ROOT}"/dev || die
511 PATH=${ROOT}/sbin:${PATH} create_dev_nodes
512 fi
513 fi
514
515 # Set up default runlevel symlinks
516 # This used to be done in src_install but required knowledge of ${ROOT},
517 # which meant that it was effectively broken for binary installs.
518 if [[ -z $(/bin/ls "${ROOT}"/etc/runlevels 2>/dev/null) ]]; then
519 for x in boot default nonetwork single; do
520 einfo "Creating default runlevel symlinks for ${x}"
521 mkdir -p "${ROOT}"/etc/runlevels/${x}
522 for y in $(<"${ROOT}"/usr/share/baselayout/rc-lists/${x}); do
523 if [[ ! -e ${ROOT}/etc/init.d/${y} ]]; then
524 ewarn "init.d/${y} not found -- ignoring"
525 else
526 ln -sfn /etc/init.d/${y} \
527 "${ROOT}"/etc/runlevels/${x}/${y}
528 fi
529 done
530 done
531 fi
532
533 # Create /etc/hosts in pkg_postinst so we don't overwrite an
534 # existing file during bootstrap
535 if [[ ! -e ${ROOT}/etc/hosts ]]; then
536 cp ${ROOT}/usr/share/baselayout/hosts ${ROOT}/etc
537 fi
538
539 # Touching /etc/passwd and /etc/shadow after install can be fatal, as many
540 # new users do not update them properly... see src_install() for why they
541 # are in /usr/share/baselayout/
542 for x in passwd shadow group fstab ; do
543 if [[ -e ${ROOT}/etc/${x} ]] ; then
544 touch "${ROOT}/etc/${x}"
545 else
546 cp "${ROOT}/usr/share/baselayout/${x}" "${ROOT}/etc/${x}"
547 fi
548 done
549
550 # Under what circumstances would mtab be a symlink? It would be
551 # nice if there were an explanatory comment here
552 if [[ -L ${ROOT}/etc/mtab ]]; then
553 rm -f "${ROOT}/etc/mtab"
554 if [[ ${ROOT} == / ]]; then
555 cp /proc/mounts "${ROOT}/etc/mtab"
556 else
557 touch "${ROOT}/etc/mtab"
558 fi
559 fi
560
561 # We should only install empty files if these files don't already exist.
562 [[ -e ${ROOT}/var/log/lastlog ]] || \
563 touch "${ROOT}/var/log/lastlog"
564 [[ -e ${ROOT}/var/run/utmp ]] || \
565 install -m 0664 -g utmp /dev/null "${ROOT}/var/run/utmp"
566 [[ -e ${ROOT}/var/log/wtmp ]] || \
567 install -m 0664 -g utmp /dev/null "${ROOT}/var/log/wtmp"
568
569 # Reload init to fix unmounting problems of / on next reboot.
570 # This is really needed, as without the new version of init cause init
571 # not to quit properly on reboot, and causes a fsck of / on next reboot.
572 if [[ ${ROOT} == / ]] && ! use build && ! use bootstrap; then
573 # Regenerate init.d dependency tree
574 /sbin/depscan.sh --update &>/dev/null
575 else
576 rm -f ${ROOT}/etc/modules.conf
577 fi
578
579 # This is also written in src_install (so it's in CONTENTS), but
580 # write it here so that the new version is immediately in the file
581 # (without waiting for the user to do etc-update)
582 rm -f ${ROOT}/etc/._cfg????_gentoo-release
583 echo "Gentoo Base System release ${PV}" > ${ROOT}/etc/gentoo-release
584
585 echo
586 einfo "Please be sure to update all pending '._cfg*' files in /etc,"
587 einfo "else things might break at your next reboot! You can use 'etc-update'"
588 einfo "to accomplish this:"
589 einfo
590 einfo " # etc-update"
591 echo
592
593 for f in ${ROOT}etc/init.d/net.* ; do
594 [[ -L ${f} || ${f} == "${ROOT}etc/init.d/net.lo" ]] && continue
595 echo
596 einfo "WARNING: You have older net.* files in ${ROOT}etc/init.d/"
597 einfo "They need to be converted to symlinks to net.lo. If you haven't"
598 einfo "made personal changes to those files, you can update with the"
599 einfo "following command:"
600 einfo
601 einfo " /bin/ls ${ROOT}etc/init.d/net.* | grep -v '/net.lo$' | xargs -n1 ln -sfvn net.lo"
602 echo
603 break
604 done
605
606 if sed -e 's/#.*//' ${ROOT}/etc/conf.d/{net,wireless} 2>/dev/null \
607 | egrep -q '\<(domain|nameservers|searchdomains)_' ; then
608 echo
609 ewarn "You have deprecated variables in ${ROOT}/etc/conf.d/net"
610 ewarn "or ${ROOT}/etc/conf.d/wireless"
611 ewarn
612 ewarn "domain_* -> dns_domain_*"
613 ewarn "nameservers_* -> dns_servers_*"
614 ewarn "searchdomains_* -> dns_search_domains_*"
615 ewarn
616 ewarn "They have been converted for you - ensure that you"
617 ewarn "update them via 'etc-update'"
618 echo
619 fi
620
621 if sed -e 's/#.*//' ${ROOT}/etc/conf.d/net 2>/dev/null \
622 | egrep -q '\<(iface_|gateway=|ifconfig_|aliases_|broadcasts_|netmasks_|inet6_|ipaddr_|iproute_)'; then
623 echo
624 ewarn "You are using deprecated variables in ${ROOT}/etc/conf.d/net"
625 ewarn
626 ewarn "You are advised to review the new configuration variables as"
627 ewarn "found in ${ROOT}/etc/conf.d/net.example as there is no"
628 ewarn "guarantee that they will work in future versions."
629 echo
630 fi
631
632 # Remove old stuff that may cause problems.
633 if [[ -e "${ROOT}"/etc/env.d/01hostname ]] ; then
634 rm -f "${ROOT}"/etc/env.d/01hostname
635 fi
636 if [[ -e "${ROOT}"/etc/init.d/domainname ]] ; then
637 rm -f "${ROOT}"/etc/init.d/domainname
638 rm -f "${ROOT}"/etc/runlevels/*/domainname
639 ewarn "The domainname init script has been removed in this version."
640 ewarn "Consult ${ROOT}/etc/conf.d/net.example for details about how"
641 ewarn "to apply dns/nis information to the loopback interface."
642 fi
643 }
644
645 pkg_prerm() {
646 # Older baselayout installed a net.eth0 link by default
647 # which means during an upgrade, that link gets lost
648 if has_version '=sys-apps/baselayout-2*' && [[ -L ${ROOT}/etc/init.d/net.eth0 ]] ; then
649 readlink "${ROOT}"/etc/init.d/net.eth0 > "${T}"/carry-the-0
650 else
651 rm -f "${T}"/carry-the-0
652 fi
653 }
654
655 pkg_postrm() {
656 # Older baselayout installed a net.eth0 link by default
657 # which means during an upgrade, that link gets lost
658 if has_version '=sys-apps/baselayout-2*' &&
659 [[ ! -e ${ROOT}/etc/init.d/net.eth0 ]] &&
660 [[ -e ${T}/carry-the-0 ]]
661 then
662 ln -s $(<"${T}"/carry-the-0) "${ROOT}"/etc/init.d/net.eth0
663 fi
664 }
665
666
667
668 --
669 gentoo-commits@g.o mailing list