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