-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
-MD5 63063133efc82df82db512614030ba19 baselayout-1.9.4-r6.ebuild 16993
-MD5 3d736b28ab78424e033c1ca3a4956cbf baselayout-1.11.13-r1.ebuild 18610
MD5 2cc57e0e74e24f5e52e85cbdf10d3068 baselayout-1.12.0_pre8-r2.ebuild 18865
-MD5 3369923cc7c91fc9519e1bbb6f40cb71 ChangeLog 62704
-MD5 10e1b8881d42750dd6e8e7cf343ea999 baselayout-1.12.0_pre7-r1.ebuild 18852
-MD5 ff608e6800fc96bfde6ae7fa09c37b56 baselayout-1.11.13.ebuild 18604
-MD5 451f8ce496238c2fd0fa9fa2852ad16c baselayout-1.9.4-r7.ebuild 17999
-MD5 7d6f28f70034d87817939d447d40d39e baselayout-1.11.11-r3.ebuild 18759
MD5 e02bb32cac91dad28d3c05b731b37b04 metadata.xml 385
-MD5 4e7b0fb1a5daa54e4f8de4637b447fcd baselayout-1.11.12-r4.ebuild 19260
-MD5 a08355653536117877945359de784f6b files/baselayout-1.11.10-iwconfig.patch 724
-MD5 ba767b33145b4614cf9b760516c51895 files/digest-baselayout-1.11.12-r4 70
-MD5 dd7fbce62822fed1595f11078e23aa32 files/baselayout-1.8.6.13-r1-gcc2.patch 443
-MD5 cac88e2e2f73778a4a4e79447d857c64 files/baselayout-1.11.12-swapon-quiet.patch 899
-MD5 f971d810119eb7f33deba5e540cab2e1 files/baselayout-1.11.12-is-net-fs.patch 903
+MD5 10e1b8881d42750dd6e8e7cf343ea999 baselayout-1.12.0_pre7-r1.ebuild 18852
+MD5 3d736b28ab78424e033c1ca3a4956cbf baselayout-1.11.13-r1.ebuild 18610
+MD5 3369923cc7c91fc9519e1bbb6f40cb71 ChangeLog 62704
+MD5 645ee27aa823d5fb836b8f160326201e files/baselayout-1.12.0_pre8-whitelist-fixes.patch 1236
MD5 0f24c65f92bca9e5131d6ebd4ad6cfa0 files/digest-baselayout-1.12.0_pre8-r2 75
-MD5 6ec416bfd1097d350c09e78949a736b8 files/rc-scripts-1.6.9-ifconfig.patch 266
-MD5 e76b5eb42575a2c72397f4691f8e7826 files/baselayout-1.11.12-volume-order-etc-update.patch 628
-MD5 c530e98487e43a7bbbb779450f8dd94e files/baselayout-1.11.12-quote-EDITOR.patch 374
-MD5 7c0cd50e4ac1dc062f5e6ab578e95659 files/copyright 2099
-MD5 f96ffe6b44684809b8ec0e4450093f59 files/baselayout-1.11.10-iwconfig-2.patch 925
-MD5 d69d18485e6cfc948d9f39b2b766a406 files/digest-baselayout-1.9.4-r6 134
-MD5 08ade596f939beaf9f7b3657c5811593 files/rc-scripts-1.6.9-checkfs-lvm.patch 579
-MD5 2d89f41d8e2a27bb9c413ce38c5c95fb files/baselayout-1.11.12-profile.patch 1847
-MD5 50816019be7cc03120fa58d075eb07f7 files/sysvinit-2.84-selinux1.patch 3612
-MD5 333c983dc00cb352f4725cacc0378fea files/baselayout-1.11.10-bridge.patch 3547
-MD5 67882892030fed7383fe01d89f9539bd files/baselayout-1.11.12-runscript-boot.patch 670
-MD5 d69d18485e6cfc948d9f39b2b766a406 files/digest-baselayout-1.9.4-r7 134
-MD5 8dae78310577f3fb14c58704d529feb3 files/digest-baselayout-1.11.13 70
-MD5 8dae78310577f3fb14c58704d529feb3 files/digest-baselayout-1.11.13-r1 70
MD5 caf4f58ffd12206e0cdf22834afceb4f files/baselayout-1.12.0_pre8-usr-remount-ro.patch 502
-MD5 ee24c3f2b233c4b4bb286e3fa8c833ed files/baselayout-1.11.12-exec-dev.patch 545
-MD5 645ee27aa823d5fb836b8f160326201e files/baselayout-1.12.0_pre8-whitelist-fixes.patch 1236
-MD5 df9f21385df40467a0bff0b3d1e5285f files/baselayout-1.11.10-selinux-udev.patch 413
-MD5 8e94b4b8d22e16ea03fa08dd0475170a files/baselayout-1.12.0_pre7-ifconfig.patch 1327
-MD5 6d37e93641eee6754b93dde3324ae23b files/baselayout-1.11.11-wpa_supplicant.patch 1223
-MD5 d50ca91cbb58c7528a60ddf5bb172956 files/sysvinit-2.84-selinux.patch 3206
-MD5 126200ae85bdf0ef43de75411f71aaa8 files/rc-scripts-1.6.9-domainname.patch 380
-MD5 50ccc6f432f5e941daec74f31f2d2a53 files/digest-baselayout-1.11.11-r3 70
-MD5 7b2f5e48c4d9056df539620299c20641 files/rc-scripts-1.4.16-splash.patch 11251
-MD5 8ab5b01cfcad4c79d822ff31296000be files/baselayout-1.11.12-ifconfig-cidr.patch 1740
-MD5 87842ac605d85289eba63ac1c2e16142 files/baselayout-1.11.10-wireless.patch 3215
+MD5 8dae78310577f3fb14c58704d529feb3 files/digest-baselayout-1.11.13-r1 70
MD5 6d5643e0857fc0f32f026e33d453c0c8 files/digest-baselayout-1.12.0_pre7-r1 75
+MD5 8e94b4b8d22e16ea03fa08dd0475170a files/baselayout-1.12.0_pre7-ifconfig.patch 1327
+MD5 7c0cd50e4ac1dc062f5e6ab578e95659 files/copyright 2099
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2 (GNU/Linux)
-iD8DBQFDGy1R1ZcsMnZjRyIRAnHYAKCzzcix9FG3QXGrtREUsrR7lAWVJgCdG1fI
-KYjJpgfUNzC0os6FgHoTqhU=
-=rsLx
+iD8DBQFDG0xxgIKl8Uu19MoRAmXfAJ9ncltuaW+okY6nRZBlr/BXLwFOqwCeKEBB
+dODtSH/4fSpU8bs7lqO3eKg=
+=9/GH
-----END PGP SIGNATURE-----
+++ /dev/null
-# Copyright 1999-2005 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/sys-apps/baselayout/baselayout-1.11.11-r3.ebuild,v 1.6 2005/05/30 02:55:12 solar Exp $
-
-inherit flag-o-matic eutils toolchain-funcs multilib
-
-SV=1.6.11 # rc-scripts version
-SVREV= # rc-scripts rev
-
-S="${WORKDIR}/rc-scripts-${SV}${SVREV}"
-DESCRIPTION="Filesystem baselayout and init scripts"
-HOMEPAGE="http://www.gentoo.org/"
-SRC_URI="mirror://gentoo/rc-scripts-${SV}${SVREV}.tar.bz2
- http://dev.gentoo.org/~vapier/dist/rc-scripts-${SV}${SVREV}.tar.bz2"
-
-LICENSE="GPL-2"
-SLOT="0"
-KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86"
-IUSE="bootstrap build static"
-
-# This version of baselayout needs gawk in /bin, but as we do not have
-# a c++ compiler during bootstrap, we cannot depend on it if "bootstrap"
-# or "build" are in USE.
-RDEPEND=">=sys-apps/sysvinit-2.84
- !build? ( !bootstrap? (
- >=sys-libs/readline-5.0-r1
- >=app-shells/bash-3.0-r10
- >=sys-apps/coreutils-5.2.1
- ) )"
-DEPEND="virtual/os-headers"
-PROVIDE="virtual/baselayout"
-
-src_unpack() {
- unpack ${A}
- cd ${S}
-
- # Moved to sys-apps/util-linux
- rm -f etc/conf.d/crypto-loop init.d/crypto-loop
- # Moved to app-shells/bash
- rm -f etc/skel/.bash*
- # Moved to appropriate packages
- rm -r etc/pam.d
-
- # Support wpa_supplicant-0.4.0 and hopefully fix an obscure iwconfig bug
- epatch ${FILESDIR}/${P}-wpa_supplicant.patch
-
- # Fix Sparc specific stuff
- if [[ $(tc-arch) == "sparc" ]] ; then
- sed -i -e 's:KEYMAP="us":KEYMAP="sunkeymap":' ${S}/etc/rc.conf || die
- fi
-}
-
-src_compile() {
- use static && append-ldflags -static
-
- make -C ${S}/src CC="$(tc-getCC)" LD="$(tc-getCC) ${LDFLAGS}" \
- CFLAGS="${CFLAGS}" || die
-}
-
-# ${PATH} should include where to get MAKEDEV when calling this
-# function
-create_dev_nodes() {
- case ${ARCH} in
- # amd64 must use generic-i386 because amd64/x86_64 does not have
- # a generic option at this time, and the default 'generic' ends
- # up erroring out, because MAKEDEV internally doesn't know what
- # to use
- arm) suffix=-arm ;;
- alpha) suffix=-alpha ;;
- amd64) suffix=-i386 ;;
- hppa) suffix=-hppa ;;
- ia64) suffix=-ia64 ;;
- m68k) suffix=-m68k ;;
- mips) suffix=-mips ;;
- ppc*) suffix=-powerpc ;;
- s390) suffix=-s390 ;;
- sparc*) suffix=-sparc ;;
- x86) suffix=-i386 ;;
- esac
-
- einfo "Using generic${suffix} to make ${ARCH} device nodes..."
- MAKEDEV generic${suffix}
- MAKEDEV sg scd rtc hde hdf hdg hdh input audio video
-}
-
-# This is a temporary workaround until bug 9849 is completely solved
-# in portage. We need to create the directories so they're available
-# during src_install, but when src_install is finished, call unkdir
-# to remove any empty directories instead of leaving them around.
-kdir() {
- typeset -a args
- typeset d
-
- # Create the directories for the remainder of src_install, and
- # remember how to create the directories later.
- for d in "$@"; do
- if [[ $d == /* ]]; then
- install -d "${args[@]}" "${D}/${d}"
- cat >> "${D}/usr/share/baselayout/mkdirs.sh" <<EOF
-install -d ${args[@]} "\${ROOT}/${d}" 2>/dev/null \\
- || ewarn " can't create ${d}"
-touch "\${ROOT}/${d}/.keep" 2>/dev/null \\
- || ewarn " can't create ${d}/.keep"
-EOF
- else
- args=("${args[@]}" "${d}")
- fi
- done
-}
-
-# Continued from kdir above... This function removes any empty
-# directories as a temporary workaround for bug 9849. The directories
-# (and .keep files) are re-created in pkg_postinst, which means they
-# aren't listed in CONTENTS, unfortunately.
-unkdir() {
- einfo "Running unkdir to workaround bug 9849"
- find ${D} -depth -type d -exec rmdir {} \; 2>/dev/null
- if [[ $? == 127 ]]; then
- ewarn "Problem running unkdir: find command not found"
- fi
-}
-
-src_install() {
- local dir libdirs libdirs_env rcscripts_dir
-
- # This directory is to stash away things that will be used in
- # pkg_postinst; it's needed first for kdir to function
- dodir /usr/share/baselayout
-
- # Jeremy Huddleston <eradicator@gentoo.org>
- # For multilib, we want to make sure that all our multilibdirs exist
- # and make lib even if it's not listed as one (like on amd64/ppc64
- # which sometimes has lib32/lib64 instead of lib/lib64).
- # lib should NOT be a symlink to one of the other libdirs.
- # Old systems with symlinks won't be affected by this change, as the
- # symlinks already exist and won't get removed, but new systems will
- # be setup properly.
- #
- # I'll be making a script to convert existing systems from symlink to
- # nosymlink and putting it in /usr/portage/scripts.
- libdirs=$(get_all_libdirs)
- : ${libdirs:=lib} # it isn't that we don't trust multilib.eclass...
-
- # This should be /lib/rcscripts, but we have to support old profiles too.
- if [[ ${SYMLINK_LIB} == "yes" ]]; then
- rcscripts_dir="/$(get_abi_LIBDIR ${DEFAULT_ABI})/rcscripts"
- else
- rcscripts_dir="/lib/rcscripts"
- fi
-
- einfo "Creating directories..."
- kdir /usr
- kdir /usr/local
- kdir /boot
- kdir /dev
- kdir /dev/pts
- kdir /dev/shm
- kdir /etc/conf.d
- kdir /etc/cron.daily
- kdir /etc/cron.hourly
- kdir /etc/cron.monthly
- kdir /etc/cron.weekly
- kdir /etc/env.d
- dodir /etc/init.d # .keep file might mess up init.d stuff
- kdir /etc/modules.autoload.d
- kdir /etc/modules.d
- kdir /etc/opt
- kdir /home
- kdir /lib/dev-state
- kdir /lib/udev-state
- kdir ${rcscripts_dir}
- kdir ${rcscripts_dir}/awk
- kdir ${rcscripts_dir}/sh
- kdir ${rcscripts_dir}/net.modules.d
- kdir ${rcscripts_dir}/net.modules.d/helpers.d
- kdir /mnt
- # Only install floppy and cdrom when first installing - fixes 88835
- if use build ; then
- kdir -m 0700 /mnt/cdrom
- kdir -m 0700 /mnt/floppy
- fi
- kdir /opt
- kdir -o root -g uucp -m0755 /var/lock
- kdir /proc
- kdir -m 0700 /root
- kdir /sbin
- kdir /sys # for 2.6 kernels
- kdir /usr/bin
- kdir /usr/include
- kdir /usr/include/asm
- kdir /usr/include/linux
- kdir /usr/local/bin
- kdir /usr/local/games
- kdir /usr/local/sbin
- kdir /usr/local/share
- kdir /usr/local/share/doc
- kdir /usr/local/share/man
- kdir /usr/local/src
- kdir /usr/portage
- kdir /usr/sbin
- kdir /usr/share/doc
- kdir /usr/share/info
- kdir /usr/share/man
- kdir /usr/share/misc
- kdir /usr/src
- kdir -m 1777 /tmp
- kdir /var
- dodir /var/db/pkg # .keep file messes up Portage
- kdir /var/lib/misc
- kdir /var/lock/subsys
- kdir /var/log/news
- kdir /var/run
- kdir /var/spool
- kdir /var/state
- kdir -m 1777 /var/tmp
-
- for dir in ${libdirs}; do
- libdirs_env=${libdirs_env:+$libdirs_env:}/${dir}:/usr/${dir}:/usr/local/${dir}
- [[ ${dir} == "lib" && ${SYMLINK_LIB} == "yes" ]] && continue
- kdir /${dir}
- kdir /usr/${dir}
- kdir /usr/local/${dir}
- done
-
- # Ugly compatibility with stupid ebuilds and old profiles symlinks
- if [[ ${SYMLINK_LIB} == "yes" ]] ; then
- rm -r "${D}"/{lib,usr/lib,usr/local/lib} &> /dev/null
- dosym $(get_abi_LIBDIR ${DEFAULT_ABI}) /lib
- dosym $(get_abi_LIBDIR ${DEFAULT_ABI}) /usr/lib
- dosym $(get_abi_LIBDIR ${DEFAULT_ABI}) /usr/local/lib
- fi
-
- # FHS compatibility symlinks stuff
- dosym /var/tmp /usr/tmp
- dosym share/man /usr/local/man
-
- #
- # Setup files in /etc
- #
- insopts -m0644
- insinto /etc
- doins -r "${S}"/etc/*
- fperms 0640 /etc/sysctl.conf
-
- # Install some files to /usr/share/baselayout instead of /etc to keep from
- # (1) overwriting the user's settings, (2) screwing things up when
- # attempting to merge files, (3) accidentally packaging up personal files
- # with quickpkg
- fperms 0600 /etc/shadow
- mv ${D}/etc/{passwd,shadow,group,fstab,hosts,issue.devfix} ${D}/usr/share/baselayout
-
- cp -P ${S}/init.d/* ${D}/etc/init.d
- chmod a+x ${D}/etc/init.d/*
- insinto /etc/conf.d
- doins ${S}/etc/conf.d/*
- insinto /etc/env.d
- doins ${S}/etc/env.d/*
- insinto /etc/modules.autoload.d
- doins ${S}/etc/modules.autoload.d/*
- insinto /etc/modules.d
- doins ${S}/etc/modules.d/*
- insinto /etc/skel
- find ${S}/etc/skel -maxdepth 1 -type f -print0 | xargs --null doins
-
- # Special-case uglyness... For people updating from lib32 -> lib amd64
- # profiles, keep lib32 in the search path while it's around
- if has_multilib_profile && [ -d /lib32 -o -d /usr/lib32 ] && ! hasq lib32 ${libdirs}; then
- libdirs_env="${libdirs_env}:/lib32:/usr/lib32:/usr/local/lib32"
- fi
-
- # List all the multilib libdirs in /etc/env/04multilib (only if they're
- # actually different from the normal
- if has_multilib_profile || [[ $(get_libdir) != "lib" || -n ${CONF_MULTILIBDIR} ]]; then
- echo "LDPATH=\"${libdirs_env}\"" > ${D}/etc/env.d/04multilib
- fi
-
- # As of baselayout-1.10-1-r1, sysvinit is its own package again, and
- # provides the inittab itself
- rm -f "${D}"/etc/inittab
-
- # Stash the rc-lists for use during pkg_postinst
- cp -r "${S}"/rc-lists "${D}"/usr/share/baselayout
-
- # uclibc doesn't need nsswitch.conf... added by solar
- use elibc_uclibc && rm -f ${D}/etc/nsswitch.conf
-
- # rc-scripts version for testing of features that *should* be present
- echo "Gentoo Base System version ${SV}" > ${D}/etc/gentoo-release
-
- #
- # Setup files related to /dev
- #
- into /
- dosbin ${S}/sbin/MAKEDEV
- dosym ../../sbin/MAKEDEV /usr/sbin/MAKEDEV
- dosym ../sbin/MAKEDEV /dev/MAKEDEV
-
- #
- # Setup files in /bin
- #
- cd ${S}/bin
- dobin rc-status
-
- #
- # Setup files in /sbin
- #
- cd ${S}/sbin
- into /
- dosbin rc rc-update
- # Need this in /sbin, as it could be run before
- # /usr is mounted.
- dosbin modules-update
- # Compat symlinks until I can get things synced.
- dosym modules-update /sbin/update-modules
- dosym ../../sbin/modules-update /usr/sbin/update-modules
- # These moved from /etc/init.d/ to /sbin to help newb systems
- # from breaking
- dosbin runscript.sh functions.sh
-
- # Compat symlinks between /etc/init.d and /sbin
- # (some stuff have hardcoded paths)
- dosym ../../sbin/depscan.sh /etc/init.d/depscan.sh
- dosym ../../sbin/runscript.sh /etc/init.d/runscript.sh
- dosym ../../sbin/functions.sh /etc/init.d/functions.sh
-
- #
- # Setup files in /lib/rcscripts
- # These are support files for other things in baselayout that needn't be
- # under CONFIG_PROTECTed /etc
- #
- cd ${S}/sbin
- exeinto ${rcscripts_dir}/sh
- doexe rc-services.sh rc-daemon.sh rc-help.sh
-
- # We can only install new, fast awk versions of scripts
- # if 'build' or 'bootstrap' is not in USE. This will
- # change if we have sys-apps/gawk-3.1.1-r1 or later in
- # the build image ...
- if ! use build; then
- # This is for new depscan.sh and env-update.sh
- # written in awk
- cd ${S}/sbin
- into /
- dosbin depscan.sh
- dosbin env-update.sh
- insinto ${rcscripts_dir}/awk
- doins ${S}/src/awk/*.awk
- fi
-
- # Original design had these in /etc/net.modules.d but that is too
- # problematic with CONFIG_PROTECT
- dodir ${rcscripts_dir}
- cp -a ${S}/lib/rcscripts/net.modules.d ${D}${rcscripts_dir}
- chown -R root:root ${D}${rcscripts_dir}
-
- #
- # Install baselayout documentation
- #
- if ! use build ; then
- doman ${S}/man/*.*
- docinto /
- dodoc ${FILESDIR}/copyright
- dodoc ${S}/ChangeLog
- fi
-
- #
- # Install baselayout utilities
- #
- cd ${S}/src
- make DESTDIR="${D}" install || die
-
- # Hack to fix bug 9849, continued in pkg_postinst
- unkdir
-}
-
-# Support function for remapping old wireless dns vars
-remap_dns_vars() {
- local f="$1"
-
- if [[ -f ${ROOT}/etc/conf.d/${f} ]]; then
- sed -e 's/\<domain_/dns_domain_/g' \
- -e 's/\<mac_domain_/mac_dns_domain_/g' \
- -e 's/\<nameservers_/dns_servers_/g' \
- -e 's/\<mac_nameservers_/mac_dns_servers_/g' \
- -e 's/\<searchdomains_/dns_search_domains_/g' \
- -e 's/\<mac_searchdomains_/mac_dns_search_domains_/g' \
- ${ROOT}/etc/conf.d/${f} > ${IMAGE}/etc/conf.d/${f}
- fi
-}
-
-pkg_preinst() {
- if [[ -f ${ROOT}/etc/modules.autoload && \
- ! -d ${ROOT}/etc/modules.autoload.d ]]; then
- mkdir -p ${ROOT}/etc/modules.autoload.d
- mv -f ${ROOT}/etc/modules.autoload \
- ${ROOT}/etc/modules.autoload.d/kernel-2.4
- ln -snf modules.autoload.d/kernel-2.4 ${ROOT}/etc/modules.autoload
- fi
-
- # Change some vars introduced in baselayout-1.11.0 before we go stable
- # The new names make more sense and allow nis_domain
- # for use in baselayout-1.12.0
- remap_dns_vars net
- remap_dns_vars wireless
-}
-
-pkg_postinst() {
- local x y
-
- # Reincarnate dirs from kdir/unkdir (hack for bug 9849)
- einfo "Creating directories and .keep files."
- einfo "Some of these might fail if they're read-only mounted"
- einfo "filesystems, for example /dev or /proc. That's okay!"
- source ${ROOT}/usr/share/baselayout/mkdirs.sh
-
- # This could be done in src_install, which would have the benefit of
- # (1) devices.tar.bz2 would show up in CONTENTS
- # (2) binary installations would be faster... just untar the devices tarball
- # instead of needing to run MAKEDEV
- # However the most common cases are that people are either updating
- # baselayout or installing from scratch. In the installation case, it's no
- # different to have here instead of src_install. In the update case, we
- # save a couple minutes time by refraining from building the unnecessary
- # tarball.
- if [[ ! -f "${ROOT}/lib/udev-state/devices.tar.bz2" ]]; then
- # Create a directory in which to work
- x=$(emktemp -d ${ROOT}/tmp/devnodes.XXXXXXXXX) \
- && cd "${x}" || die 'mktemp failed'
-
- # Create temp device nodes
- echo
- einfo "Making device node tarball (this could take a couple minutes)"
- PATH=${ROOT}/sbin:${PATH} create_dev_nodes
-
- # Now create tarball that can also be used for udev.
- # Need GNU tar for -j so call it by absolute path.
- /bin/tar cjlpf "${ROOT}/lib/udev-state/devices.tar.bz2" *
- rm -r *
- cd ..
- rmdir "${x}"
- fi
-
- # We don't want to create devices if this is not a bootstrap and devfs
- # is used, as this was the cause for all the devfs problems we had
- if use build || use bootstrap; then
- if [[ ! -e "${ROOT}/dev/.devfsd" && ! -e "${ROOT}/dev/.udev" ]]; then
- einfo "Populating /dev with device nodes..."
- cd ${ROOT}/dev || die
- /bin/tar xjpf "${ROOT}/lib/udev-state/devices.tar.bz2" || die
- fi
- fi
-
- # Create /boot/boot symlink in pkg_postinst because sometimes
- # /boot is a FAT filesystem. When that is the case, then the
- # symlink will fail. Consequently, if we create it in
- # src_install, then merge will fail. AFAIK there is no point to
- # this symlink except for misconfigured grubs. See bug 50108
- # (05 May 2004 agriffis)
- ln -sn . ${ROOT}/boot/boot 2>/dev/null
-
- # Set up default runlevel symlinks
- # This used to be done in src_install but required knowledge of ${ROOT},
- # which meant that it was effectively broken for binary installs.
- if [[ -z $(/bin/ls ${ROOT}/etc/runlevels 2>/dev/null) ]]; then
- for x in boot default nonetwork single; do
- einfo "Creating default runlevel symlinks for ${x}"
- mkdir -p ${ROOT}/etc/runlevels/${x}
- for y in $(<${ROOT}/usr/share/baselayout/rc-lists/${x}); do
- if [[ ! -e ${ROOT}/etc/init.d/${y} ]]; then
- ewarn "init.d/${y} not found -- ignoring"
- else
- ln -sfn ${ROOT}/etc/init.d/${y} \
- ${ROOT}/etc/runlevels/${x}/${y}
- fi
- done
- done
- fi
-
- # Create /etc/hosts in pkg_postinst so we don't overwrite an
- # existing file during bootstrap
- if [[ ! -e ${ROOT}/etc/hosts ]]; then
- cp ${ROOT}/usr/share/baselayout/hosts ${ROOT}/etc
- fi
-
- # Touching /etc/passwd and /etc/shadow after install can be fatal, as many
- # new users do not update them properly... see src_install() for why they
- # are in /usr/share/baselayout/
- for x in passwd shadow group fstab ; do
- if [[ -e ${ROOT}/etc/${x} ]] ; then
- touch "${ROOT}/etc/${x}"
- else
- cp "${ROOT}/usr/share/baselayout/${x}" "${ROOT}/etc/${x}"
- fi
- done
-
- # Under what circumstances would mtab be a symlink? It would be
- # nice if there were an explanatory comment here
- if [[ -L ${ROOT}/etc/mtab ]]; then
- rm -f "${ROOT}/etc/mtab"
- if [[ ${ROOT} == / ]]; then
- cp /proc/mounts "${ROOT}/etc/mtab"
- else
- touch "${ROOT}/etc/mtab"
- fi
- fi
-
- # We should only install empty files if these files don't already exist.
- [[ -e ${ROOT}/var/log/lastlog ]] || \
- touch "${ROOT}/var/log/lastlog"
- [[ -e ${ROOT}/var/run/utmp ]] || \
- install -m 0664 -g utmp /dev/null "${ROOT}/var/run/utmp"
- [[ -e ${ROOT}/var/log/wtmp ]] || \
- install -m 0664 -g utmp /dev/null "${ROOT}/var/log/wtmp"
-
- # Reload init to fix unmounting problems of / on next reboot.
- # This is really needed, as without the new version of init cause init
- # not to quit properly on reboot, and causes a fsck of / on next reboot.
- if [[ ${ROOT} == / ]] && ! use build && ! use bootstrap; then
- # Regenerate init.d dependency tree
- /sbin/depscan.sh &>/dev/null
-
- # Regenerate /etc/modules.conf, else it will fail at next boot
- einfo "Updating module dependencies..."
- /sbin/modules-update force &>/dev/null
- else
- rm -f ${ROOT}/etc/modules.conf
- fi
-
- # Enable shadow groups (we need ROOT=/ here, as grpconv only
- # operate on / ...).
- if [[ ${ROOT} == / && \
- ! -f /etc/gshadow && -x /usr/sbin/grpck && -x /usr/sbin/grpconv ]]
- then
- if /usr/sbin/grpck -r &>/dev/null; then
- /usr/sbin/grpconv
- else
- echo
- ewarn "Running 'grpck' returned errors. Please run it by hand, and then"
- ewarn "run 'grpconv' afterwards!"
- echo
- fi
- fi
-
- # This is also written in src_install (so it's in CONTENTS), but
- # write it here so that the new version is immediately in the file
- # (without waiting for the user to do etc-update)
- rm -f ${ROOT}/etc/._cfg????_gentoo-release
- echo "Gentoo Base System version ${SV}" > ${ROOT}/etc/gentoo-release
-
- echo
- einfo "Please be sure to update all pending '._cfg*' files in /etc,"
- einfo "else things might break at your next reboot! You can use 'etc-update'"
- einfo "to accomplish this:"
- einfo
- einfo " # etc-update"
- echo
-
- for f in /etc/init.d/net.eth*; do
- [[ -L ${f} ]] && continue
- echo
- einfo "WARNING: You have older net.eth* files in ${ROOT}/etc/init.d/"
- einfo "They need to be converted to symlinks to net.lo. If you haven't"
- einfo "made personal changes to those files, you can update with the"
- einfo "following command:"
- einfo
- einfo " # /bin/ls /etc/init.d/net.eth* | xargs -n1 ln -sfvn net.lo"
- echo
- break
- done
-
- if sed -e 's/#.*//' ${ROOT}/etc/conf.d/{net,wireless} 2>/dev/null \
- | egrep -q '\<(domain|nameservers|searchdomains)_' ; then
- echo
- ewarn "You have depreciated variables in ${ROOT}/etc/conf.d/net"
- ewarn "or ${ROOT}/etc/conf.d/wireless"
- ewarn
- ewarn "domain_* -> dns_domain_*"
- ewarn "nameservers_* -> dns_servers_*"
- ewarn "searchdomains_* -> dns_search_domains_*"
- ewarn
- ewarn "They have been converted for you - ensure that you"
- ewarn "update them via 'etc-update'"
- echo
- fi
-
- if sed -e 's/#.*//' ${ROOT}/etc/conf.d/net 2>/dev/null \
- | egrep -q '\<(ifconfig|aliases|broadcasts|netmasks|inet6|ipaddr|iproute)_'; then
- echo
- ewarn "You are using deprecated variables in ${ROOT}/etc/conf.d/net"
- ewarn
- ewarn "You are advised to review the new configuration variables as"
- ewarn "found in ${ROOT}/etc/conf.d/net.example as there is no"
- ewarn "guarantee that they will work in future versions."
- echo
- fi
-
-}
+++ /dev/null
-# Copyright 1999-2005 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/sys-apps/baselayout/baselayout-1.11.12-r4.ebuild,v 1.10 2005/07/10 18:19:06 dostrow Exp $
-
-inherit flag-o-matic eutils toolchain-funcs multilib
-
-SV=1.6.12 # rc-scripts version
-SVREV= # rc-scripts rev
-
-S="${WORKDIR}/rc-scripts-${SV}${SVREV}"
-DESCRIPTION="Filesystem baselayout and init scripts"
-HOMEPAGE="http://www.gentoo.org/"
-SRC_URI="mirror://gentoo/rc-scripts-${SV}${SVREV}.tar.bz2
- http://dev.gentoo.org/~vapier/dist/rc-scripts-${SV}${SVREV}.tar.bz2"
-
-LICENSE="GPL-2"
-SLOT="0"
-KEYWORDS="alpha amd64 arm hppa ia64 m68k mips ppc ppc64 s390 sh sparc x86"
-IUSE="bootstrap build static unicode"
-
-# This version of baselayout needs gawk in /bin, but as we do not have
-# a c++ compiler during bootstrap, we cannot depend on it if "bootstrap"
-# or "build" are in USE.
-RDEPEND=">=sys-apps/sysvinit-2.84
- !build? ( !bootstrap? (
- >=sys-libs/readline-5.0-r1
- >=app-shells/bash-3.0-r10
- >=sys-apps/coreutils-5.2.1
- ) )"
-DEPEND="virtual/os-headers"
-PROVIDE="virtual/baselayout"
-
-src_unpack() {
- unpack ${A}
- cd "${S}"
-
- # Mount /dev with -o exec #92921
- epatch "${FILESDIR}"/${P}-exec-dev.patch
- # Make sure initial swapon is quiet #93143
- epatch "${FILESDIR}"/${P}-swapon-quiet.patch
- # Ensure ifconfig works with CIDR addresses #93237
- epatch "${FILESDIR}"/${P}-ifconfig-cidr.patch
- # Ensure runscript.sh reports the net.* script when used in boot runlevel
- # fixes #91534
- epatch "${FILESDIR}"/${P}-runscript-boot.patch
- # Fix is_net_fs to work with what has been mounted, not what will be
- epatch "${FILESDIR}"/${P}-is-net-fs.patch
- # Remove bashisms from /etc/profile
- epatch "${FILESDIR}"/${P}-profile.patch
- # Help people who don't `etc-update` properly
- epatch "${FILESDIR}"/${P}-volume-order-etc-update.patch
- # Make sure we quote the EDITOR var
- epatch "${FILESDIR}"/${P}-quote-EDITOR.patch
- # Been moved to cryptfs
- rm -f etc/conf.d/cryptfs
- # Moved to ppp package
- rm -r etc/ppp
-
- # setup unicode defaults for silly unicode users
- if use unicode ; then
- sed -i -e '/^UNICODE=/s:no:yes:' etc/rc.conf
- fi
-
- # Tweak arch-specific details
- cd "${S}"
-
- case $(tc-arch) in
- sparc)
- sed -i -e '/^KEYMAP=/s:us:sunkeymap:' etc/conf.d/keymaps || die
- ;;
- esac
-}
-
-src_compile() {
- use static && append-ldflags -static
-
- make -C ${S}/src CC="$(tc-getCC)" LD="$(tc-getCC) ${LDFLAGS}" \
- CFLAGS="${CFLAGS}" || die
-}
-
-# ${PATH} should include where to get MAKEDEV when calling this
-# function
-create_dev_nodes() {
- case ${ARCH} in
- # amd64 must use generic-i386 because amd64/x86_64 does not have
- # a generic option at this time, and the default 'generic' ends
- # up erroring out, because MAKEDEV internally doesn't know what
- # to use
- arm) suffix=-arm ;;
- alpha) suffix=-alpha ;;
- amd64) suffix=-i386 ;;
- hppa) suffix=-hppa ;;
- ia64) suffix=-ia64 ;;
- m68k) suffix=-m68k ;;
- mips) suffix=-mips ;;
- ppc*) suffix=-powerpc ;;
- s390) suffix=-s390 ;;
- sparc*) suffix=-sparc ;;
- x86) suffix=-i386 ;;
- esac
-
- einfo "Using generic${suffix} to make ${ARCH} device nodes..."
- MAKEDEV generic${suffix}
- MAKEDEV sg scd rtc hde hdf hdg hdh input audio video
-}
-
-# This is a temporary workaround until bug 9849 is completely solved
-# in portage. We need to create the directories so they're available
-# during src_install, but when src_install is finished, call unkdir
-# to remove any empty directories instead of leaving them around.
-kdir() {
- typeset -a args
- typeset d
-
- # Create the directories for the remainder of src_install, and
- # remember how to create the directories later.
- for d in "$@"; do
- if [[ $d == /* ]]; then
- install -d "${args[@]}" "${D}/${d}"
- cat >> "${D}/usr/share/baselayout/mkdirs.sh" <<EOF
-install -d ${args[@]} "\${ROOT}/${d}" 2>/dev/null \\
- || ewarn " can't create ${d}"
-touch "\${ROOT}/${d}/.keep" 2>/dev/null \\
- || ewarn " can't create ${d}/.keep"
-EOF
- else
- args=("${args[@]}" "${d}")
- fi
- done
-}
-
-# Continued from kdir above... This function removes any empty
-# directories as a temporary workaround for bug 9849. The directories
-# (and .keep files) are re-created in pkg_postinst, which means they
-# aren't listed in CONTENTS, unfortunately.
-unkdir() {
- einfo "Running unkdir to workaround bug 9849"
- find ${D} -depth -type d -exec rmdir {} \; 2>/dev/null
- if [[ $? == 127 ]]; then
- ewarn "Problem running unkdir: find command not found"
- fi
-}
-
-src_install() {
- local dir libdirs libdirs_env rcscripts_dir
-
- # This directory is to stash away things that will be used in
- # pkg_postinst; it's needed first for kdir to function
- dodir /usr/share/baselayout
-
- # Jeremy Huddleston <eradicator@gentoo.org>
- # For multilib, we want to make sure that all our multilibdirs exist
- # and make lib even if it's not listed as one (like on amd64/ppc64
- # which sometimes has lib32/lib64 instead of lib/lib64).
- # lib should NOT be a symlink to one of the other libdirs.
- # Old systems with symlinks won't be affected by this change, as the
- # symlinks already exist and won't get removed, but new systems will
- # be setup properly.
- #
- # I'll be making a script to convert existing systems from symlink to
- # nosymlink and putting it in /usr/portage/scripts.
- libdirs=$(get_all_libdirs)
- : ${libdirs:=lib} # it isn't that we don't trust multilib.eclass...
-
- # This should be /lib/rcscripts, but we have to support old profiles too.
- if [[ ${SYMLINK_LIB} == "yes" ]]; then
- rcscripts_dir="/$(get_abi_LIBDIR ${DEFAULT_ABI})/rcscripts"
- else
- rcscripts_dir="/lib/rcscripts"
- fi
-
- einfo "Creating directories..."
- kdir /usr
- kdir /usr/local
- kdir /boot
- kdir /dev
- kdir /dev/pts
- kdir /dev/shm
- kdir /etc/conf.d
- kdir /etc/cron.daily
- kdir /etc/cron.hourly
- kdir /etc/cron.monthly
- kdir /etc/cron.weekly
- kdir /etc/env.d
- dodir /etc/init.d # .keep file might mess up init.d stuff
- kdir /etc/modules.autoload.d
- kdir /etc/modules.d
- kdir /etc/opt
- kdir /home
- kdir /lib/dev-state
- kdir /lib/udev-state
- kdir ${rcscripts_dir}
- kdir ${rcscripts_dir}/awk
- kdir ${rcscripts_dir}/sh
- kdir ${rcscripts_dir}/net.modules.d
- kdir ${rcscripts_dir}/net.modules.d/helpers.d
- # Only install /mnt stuff at bootstrap time #88835 / #90022
- if use build ; then
- kdir /mnt
- kdir -m 0700 /mnt/cdrom
- kdir -m 0700 /mnt/floppy
- fi
- kdir /opt
- kdir -o root -g uucp -m0775 /var/lock
- kdir /proc
- kdir -m 0700 /root
- kdir /sbin
- kdir /sys # for 2.6 kernels
- kdir /usr/bin
- kdir /usr/include
- kdir /usr/include/asm
- kdir /usr/include/linux
- kdir /usr/local/bin
- kdir /usr/local/games
- kdir /usr/local/sbin
- kdir /usr/local/share
- kdir /usr/local/share/doc
- kdir /usr/local/share/man
- kdir /usr/local/src
- kdir ${PORTDIR}
- kdir /usr/sbin
- kdir /usr/share/doc
- kdir /usr/share/info
- kdir /usr/share/man
- kdir /usr/share/misc
- kdir /usr/src
- kdir -m 1777 /tmp
- kdir /var
- dodir /var/db/pkg # .keep file messes up Portage
- kdir /var/lib/misc
- kdir /var/lock/subsys
- kdir /var/log/news
- kdir /var/run
- kdir /var/spool
- kdir /var/state
- kdir -m 1777 /var/tmp
-
- for dir in ${libdirs}; do
- libdirs_env=${libdirs_env:+$libdirs_env:}/${dir}:/usr/${dir}:/usr/local/${dir}
- [[ ${dir} == "lib" && ${SYMLINK_LIB} == "yes" ]] && continue
- kdir /${dir}
- kdir /usr/${dir}
- kdir /usr/local/${dir}
- done
-
- # Ugly compatibility with stupid ebuilds and old profiles symlinks
- if [[ ${SYMLINK_LIB} == "yes" ]] ; then
- rm -r "${D}"/{lib,usr/lib,usr/local/lib} &> /dev/null
- dosym $(get_abi_LIBDIR ${DEFAULT_ABI}) /lib
- dosym $(get_abi_LIBDIR ${DEFAULT_ABI}) /usr/lib
- dosym $(get_abi_LIBDIR ${DEFAULT_ABI}) /usr/local/lib
- fi
-
- # FHS compatibility symlinks stuff
- dosym /var/tmp /usr/tmp
- dosym share/man /usr/local/man
-
- #
- # Setup files in /etc
- #
- insopts -m0644
- insinto /etc
- doins -r "${S}"/etc/*
- fperms 0640 /etc/sysctl.conf
-
- # Install some files to /usr/share/baselayout instead of /etc to keep from
- # (1) overwriting the user's settings, (2) screwing things up when
- # attempting to merge files, (3) accidentally packaging up personal files
- # with quickpkg
- fperms 0600 /etc/shadow
- mv ${D}/etc/{passwd,shadow,group,fstab,hosts,issue.devfix} ${D}/usr/share/baselayout
-
- cp -P ${S}/init.d/* ${D}/etc/init.d
- chmod a+x ${D}/etc/init.d/*
- insinto /etc/conf.d
- doins ${S}/etc/conf.d/*
- insinto /etc/env.d
- doins ${S}/etc/env.d/*
- insinto /etc/modules.autoload.d
- doins ${S}/etc/modules.autoload.d/*
- insinto /etc/modules.d
- doins ${S}/etc/modules.d/*
-
- # Special-case uglyness... For people updating from lib32 -> lib amd64
- # profiles, keep lib32 in the search path while it's around
- if has_multilib_profile && [ -d /lib32 -o -d /usr/lib32 ] && ! hasq lib32 ${libdirs}; then
- libdirs_env="${libdirs_env}:/lib32:/usr/lib32:/usr/local/lib32"
- fi
-
- # List all the multilib libdirs in /etc/env/04multilib (only if they're
- # actually different from the normal
- if has_multilib_profile || [[ $(get_libdir) != "lib" || -n ${CONF_MULTILIBDIR} ]]; then
- echo "LDPATH=\"${libdirs_env}\"" > ${D}/etc/env.d/04multilib
- fi
-
- # As of baselayout-1.10-1-r1, sysvinit is its own package again, and
- # provides the inittab itself
- rm -f "${D}"/etc/inittab
-
- # Stash the rc-lists for use during pkg_postinst
- cp -r "${S}"/rc-lists "${D}"/usr/share/baselayout
-
- # rc-scripts version for testing of features that *should* be present
- echo "Gentoo Base System version ${SV}" > ${D}/etc/gentoo-release
-
- #
- # Setup files related to /dev
- #
- into /
- dosbin ${S}/sbin/MAKEDEV
- dosym ../../sbin/MAKEDEV /usr/sbin/MAKEDEV
- dosym ../sbin/MAKEDEV /dev/MAKEDEV
-
- #
- # Setup files in /bin
- #
- cd ${S}/bin
- dobin rc-status
-
- #
- # Setup files in /sbin
- #
- cd ${S}/sbin
- into /
- dosbin rc rc-update
- # Need this in /sbin, as it could be run before
- # /usr is mounted.
- dosbin modules-update
- # Compat symlinks until I can get things synced.
- dosym modules-update /sbin/update-modules
- dosym ../../sbin/modules-update /usr/sbin/update-modules
- # These moved from /etc/init.d/ to /sbin to help newb systems
- # from breaking
- dosbin runscript.sh functions.sh
-
- # Compat symlinks between /etc/init.d and /sbin
- # (some stuff have hardcoded paths)
- dosym ../../sbin/depscan.sh /etc/init.d/depscan.sh
- dosym ../../sbin/runscript.sh /etc/init.d/runscript.sh
- dosym ../../sbin/functions.sh /etc/init.d/functions.sh
-
- #
- # Setup files in /lib/rcscripts
- # These are support files for other things in baselayout that needn't be
- # under CONFIG_PROTECTed /etc
- #
- cd ${S}/sbin
- exeinto ${rcscripts_dir}/sh
- doexe rc-services.sh rc-daemon.sh rc-help.sh
-
- # We can only install new, fast awk versions of scripts
- # if 'build' or 'bootstrap' is not in USE. This will
- # change if we have sys-apps/gawk-3.1.1-r1 or later in
- # the build image ...
- if ! use build; then
- # This is for new depscan.sh and env-update.sh
- # written in awk
- cd ${S}/sbin
- into /
- dosbin depscan.sh
- dosbin env-update.sh
- insinto ${rcscripts_dir}/awk
- doins ${S}/src/awk/*.awk
- fi
-
- # Original design had these in /etc/net.modules.d but that is too
- # problematic with CONFIG_PROTECT
- dodir ${rcscripts_dir}
- cp -a ${S}/lib/rcscripts/net.modules.d ${D}${rcscripts_dir}
- chown -R root:root ${D}${rcscripts_dir}
-
- #
- # Install baselayout documentation
- #
- if ! use build ; then
- doman ${S}/man/*.*
- docinto /
- dodoc ${FILESDIR}/copyright
- dodoc ${S}/ChangeLog
- fi
-
- #
- # Install baselayout utilities
- #
- cd ${S}/src
- make DESTDIR="${D}" install || die
-
- # Hack to fix bug 9849, continued in pkg_postinst
- unkdir
-}
-
-# Support function for remapping old wireless dns vars
-remap_dns_vars() {
- local f="$1"
-
- if [[ -f ${ROOT}/etc/conf.d/${f} ]]; then
- sed -e 's/\<domain_/dns_domain_/g' \
- -e 's/\<mac_domain_/mac_dns_domain_/g' \
- -e 's/\<nameservers_/dns_servers_/g' \
- -e 's/\<mac_nameservers_/mac_dns_servers_/g' \
- -e 's/\<searchdomains_/dns_search_domains_/g' \
- -e 's/\<mac_searchdomains_/mac_dns_search_domains_/g' \
- ${ROOT}/etc/conf.d/${f} > ${IMAGE}/etc/conf.d/${f}
- fi
-}
-
-pkg_preinst() {
- if [[ -f ${ROOT}/etc/modules.autoload && \
- ! -d ${ROOT}/etc/modules.autoload.d ]]; then
- mkdir -p ${ROOT}/etc/modules.autoload.d
- mv -f ${ROOT}/etc/modules.autoload \
- ${ROOT}/etc/modules.autoload.d/kernel-2.4
- ln -snf modules.autoload.d/kernel-2.4 ${ROOT}/etc/modules.autoload
- fi
-
- # Change some vars introduced in baselayout-1.11.0 before we go stable
- # The new names make more sense and allow nis_domain
- # for use in baselayout-1.12.0
- remap_dns_vars net
- remap_dns_vars wireless
-}
-
-pkg_postinst() {
- local x y
-
- # Reincarnate dirs from kdir/unkdir (hack for bug 9849)
- einfo "Creating directories and .keep files."
- einfo "Some of these might fail if they're read-only mounted"
- einfo "filesystems, for example /dev or /proc. That's okay!"
- source ${ROOT}/usr/share/baselayout/mkdirs.sh
-
- # This could be done in src_install, which would have the benefit of
- # (1) devices.tar.bz2 would show up in CONTENTS
- # (2) binary installations would be faster... just untar the devices tarball
- # instead of needing to run MAKEDEV
- # However the most common cases are that people are either updating
- # baselayout or installing from scratch. In the installation case, it's no
- # different to have here instead of src_install. In the update case, we
- # save a couple minutes time by refraining from building the unnecessary
- # tarball.
- if [[ ! -f "${ROOT}/lib/udev-state/devices.tar.bz2" ]]; then
- # Create a directory in which to work
- x=$(emktemp -d ${ROOT}/tmp/devnodes.XXXXXXXXX) \
- && cd "${x}" || die 'mktemp failed'
-
- # Create temp device nodes
- echo
- einfo "Making device node tarball (this could take a couple minutes)"
- PATH=${ROOT}/sbin:${PATH} create_dev_nodes
-
- # Now create tarball that can also be used for udev.
- # Need GNU tar for -j so call it by absolute path.
- /bin/tar cjlpf "${ROOT}/lib/udev-state/devices.tar.bz2" *
- rm -r *
- cd ..
- rmdir "${x}"
- fi
-
- # We don't want to create devices if this is not a bootstrap and devfs
- # is used, as this was the cause for all the devfs problems we had
- if use build || use bootstrap; then
- if [[ ! -e "${ROOT}/dev/.devfsd" && ! -e "${ROOT}/dev/.udev" ]]; then
- einfo "Populating /dev with device nodes..."
- cd ${ROOT}/dev || die
- /bin/tar xjpf "${ROOT}/lib/udev-state/devices.tar.bz2" || die
- fi
- fi
-
- # Create /boot/boot symlink in pkg_postinst because sometimes
- # /boot is a FAT filesystem. When that is the case, then the
- # symlink will fail. Consequently, if we create it in
- # src_install, then merge will fail. AFAIK there is no point to
- # this symlink except for misconfigured grubs. See bug 50108
- # (05 May 2004 agriffis)
- ln -sn . ${ROOT}/boot/boot 2>/dev/null
-
- # Set up default runlevel symlinks
- # This used to be done in src_install but required knowledge of ${ROOT},
- # which meant that it was effectively broken for binary installs.
- if [[ -z $(/bin/ls ${ROOT}/etc/runlevels 2>/dev/null) ]]; then
- for x in boot default nonetwork single; do
- einfo "Creating default runlevel symlinks for ${x}"
- mkdir -p ${ROOT}/etc/runlevels/${x}
- for y in $(<${ROOT}/usr/share/baselayout/rc-lists/${x}); do
- if [[ ! -e ${ROOT}/etc/init.d/${y} ]]; then
- ewarn "init.d/${y} not found -- ignoring"
- else
- ln -sfn ${ROOT}/etc/init.d/${y} \
- ${ROOT}/etc/runlevels/${x}/${y}
- fi
- done
- done
- fi
-
- # Create /etc/hosts in pkg_postinst so we don't overwrite an
- # existing file during bootstrap
- if [[ ! -e ${ROOT}/etc/hosts ]]; then
- cp ${ROOT}/usr/share/baselayout/hosts ${ROOT}/etc
- fi
-
- # Touching /etc/passwd and /etc/shadow after install can be fatal, as many
- # new users do not update them properly... see src_install() for why they
- # are in /usr/share/baselayout/
- for x in passwd shadow group fstab ; do
- if [[ -e ${ROOT}/etc/${x} ]] ; then
- touch "${ROOT}/etc/${x}"
- else
- cp "${ROOT}/usr/share/baselayout/${x}" "${ROOT}/etc/${x}"
- fi
- done
-
- # Under what circumstances would mtab be a symlink? It would be
- # nice if there were an explanatory comment here
- if [[ -L ${ROOT}/etc/mtab ]]; then
- rm -f "${ROOT}/etc/mtab"
- if [[ ${ROOT} == / ]]; then
- cp /proc/mounts "${ROOT}/etc/mtab"
- else
- touch "${ROOT}/etc/mtab"
- fi
- fi
-
- # We should only install empty files if these files don't already exist.
- [[ -e ${ROOT}/var/log/lastlog ]] || \
- touch "${ROOT}/var/log/lastlog"
- [[ -e ${ROOT}/var/run/utmp ]] || \
- install -m 0664 -g utmp /dev/null "${ROOT}/var/run/utmp"
- [[ -e ${ROOT}/var/log/wtmp ]] || \
- install -m 0664 -g utmp /dev/null "${ROOT}/var/log/wtmp"
-
- # Reload init to fix unmounting problems of / on next reboot.
- # This is really needed, as without the new version of init cause init
- # not to quit properly on reboot, and causes a fsck of / on next reboot.
- if [[ ${ROOT} == / ]] && ! use build && ! use bootstrap; then
- # Regenerate init.d dependency tree
- /sbin/depscan.sh &>/dev/null
-
- # Regenerate /etc/modules.conf, else it will fail at next boot
- einfo "Updating module dependencies..."
- /sbin/modules-update force &>/dev/null
- else
- rm -f ${ROOT}/etc/modules.conf
- fi
-
- # Enable shadow groups (we need ROOT=/ here, as grpconv only
- # operate on / ...).
- if [[ ${ROOT} == / && \
- ! -f /etc/gshadow && -x /usr/sbin/grpck && -x /usr/sbin/grpconv ]]
- then
- if /usr/sbin/grpck -r &>/dev/null; then
- /usr/sbin/grpconv
- else
- echo
- ewarn "Running 'grpck' returned errors. Please run it by hand, and then"
- ewarn "run 'grpconv' afterwards!"
- echo
- fi
- fi
-
- # This is also written in src_install (so it's in CONTENTS), but
- # write it here so that the new version is immediately in the file
- # (without waiting for the user to do etc-update)
- rm -f ${ROOT}/etc/._cfg????_gentoo-release
- echo "Gentoo Base System version ${SV}" > ${ROOT}/etc/gentoo-release
-
- echo
- einfo "Please be sure to update all pending '._cfg*' files in /etc,"
- einfo "else things might break at your next reboot! You can use 'etc-update'"
- einfo "to accomplish this:"
- einfo
- einfo " # etc-update"
- echo
-
- for f in /etc/init.d/net.eth*; do
- [[ -L ${f} ]] && continue
- echo
- einfo "WARNING: You have older net.eth* files in ${ROOT}/etc/init.d/"
- einfo "They need to be converted to symlinks to net.lo. If you haven't"
- einfo "made personal changes to those files, you can update with the"
- einfo "following command:"
- einfo
- einfo " # /bin/ls /etc/init.d/net.eth* | xargs -n1 ln -sfvn net.lo"
- echo
- break
- done
-
- if sed -e 's/#.*//' ${ROOT}/etc/conf.d/{net,wireless} 2>/dev/null \
- | egrep -q '\<(domain|nameservers|searchdomains)_' ; then
- echo
- ewarn "You have depreciated variables in ${ROOT}/etc/conf.d/net"
- ewarn "or ${ROOT}/etc/conf.d/wireless"
- ewarn
- ewarn "domain_* -> dns_domain_*"
- ewarn "nameservers_* -> dns_servers_*"
- ewarn "searchdomains_* -> dns_search_domains_*"
- ewarn
- ewarn "They have been converted for you - ensure that you"
- ewarn "update them via 'etc-update'"
- echo
- fi
-
- if sed -e 's/#.*//' ${ROOT}/etc/conf.d/net 2>/dev/null \
- | egrep -q '\<(ifconfig|aliases|broadcasts|netmasks|inet6|ipaddr|iproute)_'; then
- echo
- ewarn "You are using deprecated variables in ${ROOT}/etc/conf.d/net"
- ewarn
- ewarn "You are advised to review the new configuration variables as"
- ewarn "found in ${ROOT}/etc/conf.d/net.example as there is no"
- ewarn "guarantee that they will work in future versions."
- echo
- fi
-}
+++ /dev/null
-# Copyright 1999-2005 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/sys-apps/baselayout/baselayout-1.11.13.ebuild,v 1.4 2005/07/22 22:00:36 vapier Exp $
-
-inherit flag-o-matic eutils toolchain-funcs multilib
-
-SV=1.6.13 # rc-scripts version
-SVREV= # rc-scripts rev
-
-S="${WORKDIR}/rc-scripts-${SV}${SVREV}"
-DESCRIPTION="Filesystem baselayout and init scripts"
-HOMEPAGE="http://www.gentoo.org/"
-SRC_URI="mirror://gentoo/rc-scripts-${SV}${SVREV}.tar.bz2
- http://dev.gentoo.org/~azarah/${PN}/rc-scripts-${SV}${SVREV}.tar.bz2
- http://dev.gentoo.org/~vapier/dist/rc-scripts-${SV}${SVREV}.tar.bz2"
-
-LICENSE="GPL-2"
-SLOT="0"
-KEYWORDS="alpha amd64 arm hppa ia64 m68k mips ppc ppc64 s390 sh sparc x86"
-IUSE="bootstrap build static unicode"
-
-# This version of baselayout needs gawk in /bin, but as we do not have
-# a c++ compiler during bootstrap, we cannot depend on it if "bootstrap"
-# or "build" are in USE.
-RDEPEND=">=sys-apps/sysvinit-2.84
- !build? ( !bootstrap? (
- >=sys-libs/readline-5.0-r1
- >=app-shells/bash-3.0-r10
- >=sys-apps/coreutils-5.2.1
- ) )"
-DEPEND="virtual/os-headers
- >=sys-apps/portage-2.0.51"
-PROVIDE="virtual/baselayout"
-
-src_unpack() {
- unpack ${A}
- cd "${S}"
-
- # Setup unicode defaults for silly unicode users
- if use unicode ; then
- sed -i -e '/^UNICODE=/s:no:yes:' etc/rc.conf
- fi
-
- # Tweak arch-specific details
- cd "${S}"
-
- case $(tc-arch) in
- sparc)
- sed -i -e '/^KEYMAP=/s:us:sunkeymap:' etc/conf.d/keymaps || die
- ;;
- esac
-}
-
-src_compile() {
- use static && append-ldflags -static
-
- make -C "${S}"/src CC="$(tc-getCC)" LD="$(tc-getCC) ${LDFLAGS}" \
- CFLAGS="${CFLAGS}" || die
-}
-
-# ${PATH} should include where to get MAKEDEV when calling this
-# function
-create_dev_nodes() {
- case $(tc-arch) in
- # amd64 must use generic-i386 because amd64/x86_64 does not have
- # a generic option at this time, and the default 'generic' ends
- # up erroring out, because MAKEDEV internally doesn't know what
- # to use
- arm) suffix=-arm ;;
- alpha) suffix=-alpha ;;
- amd64) suffix=-i386 ;;
- hppa) suffix=-hppa ;;
- ia64) suffix=-ia64 ;;
- m68k) suffix=-m68k ;;
- mips) suffix=-mips ;;
- ppc*) suffix=-powerpc ;;
- s390) suffix=-s390 ;;
- sparc*) suffix=-sparc ;;
- x86) suffix=-i386 ;;
- esac
-
- einfo "Using generic${suffix} to make $(tc-arch) device nodes..."
- MAKEDEV generic${suffix}
- MAKEDEV sg scd rtc hde hdf hdg hdh input audio video
-}
-
-# This is a temporary workaround until bug 9849 is completely solved
-# in portage. We need to create the directories so they're available
-# during src_install, but when src_install is finished, call unkdir
-# to remove any empty directories instead of leaving them around.
-kdir() {
- typeset -a args
- typeset d
-
- # Create the directories for the remainder of src_install, and
- # remember how to create the directories later.
- for d in "$@"; do
- if [[ $d == /* ]]; then
- install -d "${args[@]}" "${D}/${d}"
- cat >> "${D}/usr/share/baselayout/mkdirs.sh" <<EOF
-install -d ${args[@]} "\${ROOT}/${d}" 2>/dev/null \\
- || ewarn " can't create ${d}"
-touch "\${ROOT}/${d}/.keep" 2>/dev/null \\
- || ewarn " can't create ${d}/.keep"
-EOF
- else
- args=("${args[@]}" "${d}")
- fi
- done
-}
-
-# Continued from kdir above... This function removes any empty
-# directories as a temporary workaround for bug 9849. The directories
-# (and .keep files) are re-created in pkg_postinst, which means they
-# aren't listed in CONTENTS, unfortunately.
-unkdir() {
- einfo "Running unkdir to workaround bug 9849"
- find ${D} -depth -type d -exec rmdir {} \; 2>/dev/null
- if [[ $? == 127 ]]; then
- ewarn "Problem running unkdir: find command not found"
- fi
-}
-
-src_install() {
- local dir libdirs libdirs_env rcscripts_dir
-
- # This directory is to stash away things that will be used in
- # pkg_postinst; it's needed first for kdir to function
- dodir /usr/share/baselayout
-
- # Jeremy Huddleston <eradicator@gentoo.org>
- # For multilib, we want to make sure that all our multilibdirs exist
- # and make lib even if it's not listed as one (like on amd64/ppc64
- # which sometimes has lib32/lib64 instead of lib/lib64).
- # lib should NOT be a symlink to one of the other libdirs.
- # Old systems with symlinks won't be affected by this change, as the
- # symlinks already exist and won't get removed, but new systems will
- # be setup properly.
- #
- # I'll be making a script to convert existing systems from symlink to
- # nosymlink and putting it in /usr/portage/scripts.
- libdirs=$(get_all_libdirs)
- : ${libdirs:=lib} # it isn't that we don't trust multilib.eclass...
-
- # This should be /lib/rcscripts, but we have to support old profiles too.
- if [[ ${SYMLINK_LIB} == "yes" ]]; then
- rcscripts_dir="/$(get_abi_LIBDIR ${DEFAULT_ABI})/rcscripts"
- else
- rcscripts_dir="/lib/rcscripts"
- fi
-
- einfo "Creating directories..."
- kdir /usr
- kdir /usr/local
- kdir /boot
- kdir /dev
- kdir /dev/pts
- kdir /dev/shm
- kdir /etc/conf.d
- kdir /etc/cron.daily
- kdir /etc/cron.hourly
- kdir /etc/cron.monthly
- kdir /etc/cron.weekly
- kdir /etc/env.d
- dodir /etc/init.d # .keep file might mess up init.d stuff
- kdir /etc/modules.autoload.d
- kdir /etc/modules.d
- kdir /etc/opt
- kdir /home
- kdir /lib/dev-state
- kdir /lib/udev-state
- kdir ${rcscripts_dir}
- kdir ${rcscripts_dir}/awk
- kdir ${rcscripts_dir}/sh
- kdir ${rcscripts_dir}/net.modules.d
- kdir ${rcscripts_dir}/net.modules.d/helpers.d
- # Only install /mnt stuff at bootstrap time #88835 / #90022
- if use build ; then
- kdir /mnt
- kdir -m 0700 /mnt/cdrom
- kdir -m 0700 /mnt/floppy
- fi
- kdir /opt
- kdir -o root -g uucp -m0775 /var/lock
- kdir /proc
- kdir -m 0700 /root
- kdir /sbin
- kdir /sys # for 2.6 kernels
- kdir /usr/bin
- kdir /usr/include
- kdir /usr/include/asm
- kdir /usr/include/linux
- kdir /usr/local/bin
- kdir /usr/local/games
- kdir /usr/local/sbin
- kdir /usr/local/share
- kdir /usr/local/share/doc
- kdir /usr/local/share/man
- kdir /usr/local/src
- kdir ${PORTDIR}
- kdir /usr/sbin
- kdir /usr/share/doc
- kdir /usr/share/info
- kdir /usr/share/man
- kdir /usr/share/misc
- kdir /usr/src
- kdir -m 1777 /tmp
- kdir /var
- dodir /var/db/pkg # .keep file messes up Portage
- kdir /var/lib/misc
- kdir /var/lock/subsys
- kdir /var/log/news
- kdir /var/run
- kdir /var/spool
- kdir /var/state
- kdir -m 1777 /var/tmp
-
- for dir in ${libdirs}; do
- libdirs_env=${libdirs_env:+$libdirs_env:}/${dir}:/usr/${dir}:/usr/local/${dir}
- [[ ${dir} == "lib" && ${SYMLINK_LIB} == "yes" ]] && continue
- kdir /${dir}
- kdir /usr/${dir}
- kdir /usr/local/${dir}
- done
-
- # Ugly compatibility with stupid ebuilds and old profiles symlinks
- if [[ ${SYMLINK_LIB} == "yes" ]] ; then
- rm -r "${D}"/{lib,usr/lib,usr/local/lib} &> /dev/null
- dosym $(get_abi_LIBDIR ${DEFAULT_ABI}) /lib
- dosym $(get_abi_LIBDIR ${DEFAULT_ABI}) /usr/lib
- dosym $(get_abi_LIBDIR ${DEFAULT_ABI}) /usr/local/lib
- fi
-
- # FHS compatibility symlinks stuff
- dosym /var/tmp /usr/tmp
- dosym share/man /usr/local/man
-
- #
- # Setup files in /etc
- #
- insopts -m0644
- insinto /etc
- doins -r "${S}"/etc/*
- fperms 0640 /etc/sysctl.conf
-
- # Install some files to /usr/share/baselayout instead of /etc to keep from
- # (1) overwriting the user's settings, (2) screwing things up when
- # attempting to merge files, (3) accidentally packaging up personal files
- # with quickpkg
- fperms 0600 /etc/shadow
- mv "${D}"/etc/{passwd,shadow,group,fstab,hosts,issue.devfix} "${D}"/usr/share/baselayout
-
- # doinitd doesnt respect symlinks
- dodir /etc/init.d
- cp -P "${S}"/init.d/* "${D}"/etc/init.d/ || die "doinitd"
- #doinitd "${S}"/init.d/* || die "doinitd"
- doconfd "${S}"/etc/conf.d/* || die "doconfd"
- doenvd "${S}"/etc/env.d/* || die "doenvd"
- insinto /etc/modules.autoload.d
- doins "${S}"/etc/modules.autoload.d/*
- insinto /etc/modules.d
- doins "${S}"/etc/modules.d/*
-
- # Special-case uglyness... For people updating from lib32 -> lib amd64
- # profiles, keep lib32 in the search path while it's around
- if has_multilib_profile && [ -d /lib32 -o -d /usr/lib32 ] && ! hasq lib32 ${libdirs}; then
- libdirs_env="${libdirs_env}:/lib32:/usr/lib32:/usr/local/lib32"
- fi
-
- # List all the multilib libdirs in /etc/env/04multilib (only if they're
- # actually different from the normal
- if has_multilib_profile || [[ $(get_libdir) != "lib" || -n ${CONF_MULTILIBDIR} ]]; then
- echo "LDPATH=\"${libdirs_env}\"" > ${D}/etc/env.d/04multilib
- fi
-
- # As of baselayout-1.10-1-r1, sysvinit is its own package again, and
- # provides the inittab itself
- rm -f "${D}"/etc/inittab
-
- # Stash the rc-lists for use during pkg_postinst
- cp -r "${S}"/rc-lists "${D}"/usr/share/baselayout
-
- # rc-scripts version for testing of features that *should* be present
- echo "Gentoo Base System version ${SV}" > ${D}/etc/gentoo-release
-
- #
- # Setup files related to /dev
- #
- into /
- dosbin "${S}"/sbin/MAKEDEV
- dosym ../../sbin/MAKEDEV /usr/sbin/MAKEDEV
- dosym ../sbin/MAKEDEV /dev/MAKEDEV
-
- #
- # Setup files in /bin
- #
- cd "${S}"/bin
- dobin rc-status
-
- #
- # Setup files in /sbin
- #
- cd "${S}"/sbin
- into /
- dosbin rc rc-update
- # Need this in /sbin, as it could be run before
- # /usr is mounted.
- dosbin modules-update
- # Compat symlinks until I can get things synced.
- dosym modules-update /sbin/update-modules
- dosym ../../sbin/modules-update /usr/sbin/update-modules
- # These moved from /etc/init.d/ to /sbin to help newb systems
- # from breaking
- dosbin runscript.sh functions.sh
-
- # Compat symlinks between /etc/init.d and /sbin
- # (some stuff have hardcoded paths)
- dosym ../../sbin/depscan.sh /etc/init.d/depscan.sh
- dosym ../../sbin/runscript.sh /etc/init.d/runscript.sh
- dosym ../../sbin/functions.sh /etc/init.d/functions.sh
-
- #
- # Setup files in /lib/rcscripts
- # These are support files for other things in baselayout that needn't be
- # under CONFIG_PROTECTed /etc
- #
- cd "${S}"/sbin
- exeinto ${rcscripts_dir}/sh
- doexe rc-services.sh rc-daemon.sh rc-help.sh
-
- # We can only install new, fast awk versions of scripts
- # if 'build' or 'bootstrap' is not in USE. This will
- # change if we have sys-apps/gawk-3.1.1-r1 or later in
- # the build image ...
- if ! use build; then
- # This is for new depscan.sh and env-update.sh
- # written in awk
- cd "${S}"/sbin
- into /
- dosbin depscan.sh
- dosbin env-update.sh
- insinto ${rcscripts_dir}/awk
- doins "${S}"/src/awk/*.awk
- fi
-
- # Original design had these in /etc/net.modules.d but that is too
- # problematic with CONFIG_PROTECT
- dodir ${rcscripts_dir}
- cp -a "${S}"/lib/rcscripts/net.modules.d ${D}${rcscripts_dir}
- chown -R root:root ${D}${rcscripts_dir}
-
- #
- # Install baselayout documentation
- #
- if ! use build ; then
- doman "${S}"/man/*.*
- docinto /
- dodoc ${FILESDIR}/copyright
- dodoc "${S}"/ChangeLog
- fi
-
- #
- # Install baselayout utilities
- #
- cd "${S}"/src
- make DESTDIR="${D}" install || die
-
- # Hack to fix bug 9849, continued in pkg_postinst
- unkdir
-}
-
-# Support function for remapping old wireless dns vars
-remap_dns_vars() {
- local f="$1"
-
- if [[ -f ${ROOT}/etc/conf.d/${f} ]]; then
- sed -e 's/\<domain_/dns_domain_/g' \
- -e 's/\<mac_domain_/mac_dns_domain_/g' \
- -e 's/\<nameservers_/dns_servers_/g' \
- -e 's/\<mac_nameservers_/mac_dns_servers_/g' \
- -e 's/\<searchdomains_/dns_search_domains_/g' \
- -e 's/\<mac_searchdomains_/mac_dns_search_domains_/g' \
- ${ROOT}/etc/conf.d/${f} > ${IMAGE}/etc/conf.d/${f}
- fi
-}
-
-pkg_preinst() {
- if [[ -f ${ROOT}/etc/modules.autoload && \
- ! -d ${ROOT}/etc/modules.autoload.d ]]; then
- mkdir -p ${ROOT}/etc/modules.autoload.d
- mv -f ${ROOT}/etc/modules.autoload \
- ${ROOT}/etc/modules.autoload.d/kernel-2.4
- ln -snf modules.autoload.d/kernel-2.4 ${ROOT}/etc/modules.autoload
- fi
-
- # Change some vars introduced in baselayout-1.11.0 before we go stable
- # The new names make more sense and allow nis_domain
- # for use in baselayout-1.12.0
- remap_dns_vars net
- remap_dns_vars wireless
-}
-
-pkg_postinst() {
- local x y
-
- # Reincarnate dirs from kdir/unkdir (hack for bug 9849)
- einfo "Creating directories and .keep files."
- einfo "Some of these might fail if they're read-only mounted"
- einfo "filesystems, for example /dev or /proc. That's okay!"
- source ${ROOT}/usr/share/baselayout/mkdirs.sh
-
- # This could be done in src_install, which would have the benefit of
- # (1) devices.tar.bz2 would show up in CONTENTS
- # (2) binary installations would be faster... just untar the devices tarball
- # instead of needing to run MAKEDEV
- # However the most common cases are that people are either updating
- # baselayout or installing from scratch. In the installation case, it's no
- # different to have here instead of src_install. In the update case, we
- # save a couple minutes time by refraining from building the unnecessary
- # tarball.
- if [[ ! -f "${ROOT}/lib/udev-state/devices.tar.bz2" ]]; then
- # Create a directory in which to work
- x=$(emktemp -d ${ROOT}/tmp/devnodes.XXXXXXXXX) \
- && cd "${x}" || die 'mktemp failed'
-
- # Create temp device nodes
- echo
- einfo "Making device node tarball (this could take a couple minutes)"
- PATH=${ROOT}/sbin:${PATH} create_dev_nodes
-
- # Now create tarball that can also be used for udev.
- # Need GNU tar for -j so call it by absolute path.
- /bin/tar cjlpf "${ROOT}/lib/udev-state/devices.tar.bz2" *
- rm -r *
- cd ..
- rmdir "${x}"
- fi
-
- # We don't want to create devices if this is not a bootstrap and devfs
- # is used, as this was the cause for all the devfs problems we had
- if use build || use bootstrap; then
- if [[ ! -e "${ROOT}/dev/.devfsd" && ! -e "${ROOT}/dev/.udev" ]]; then
- einfo "Populating /dev with device nodes..."
- cd ${ROOT}/dev || die
- /bin/tar xjpf "${ROOT}/lib/udev-state/devices.tar.bz2" || die
- fi
- fi
-
- # Create /boot/boot symlink in pkg_postinst because sometimes
- # /boot is a FAT filesystem. When that is the case, then the
- # symlink will fail. Consequently, if we create it in
- # src_install, then merge will fail. AFAIK there is no point to
- # this symlink except for misconfigured grubs. See bug 50108
- # (05 May 2004 agriffis)
- ln -sn . ${ROOT}/boot/boot 2>/dev/null
-
- # Set up default runlevel symlinks
- # This used to be done in src_install but required knowledge of ${ROOT},
- # which meant that it was effectively broken for binary installs.
- if [[ -z $(/bin/ls ${ROOT}/etc/runlevels 2>/dev/null) ]]; then
- for x in boot default nonetwork single; do
- einfo "Creating default runlevel symlinks for ${x}"
- mkdir -p ${ROOT}/etc/runlevels/${x}
- for y in $(<${ROOT}/usr/share/baselayout/rc-lists/${x}); do
- if [[ ! -e ${ROOT}/etc/init.d/${y} ]]; then
- ewarn "init.d/${y} not found -- ignoring"
- else
- ln -sfn ${ROOT}/etc/init.d/${y} \
- ${ROOT}/etc/runlevels/${x}/${y}
- fi
- done
- done
- fi
-
- # Create /etc/hosts in pkg_postinst so we don't overwrite an
- # existing file during bootstrap
- if [[ ! -e ${ROOT}/etc/hosts ]]; then
- cp ${ROOT}/usr/share/baselayout/hosts ${ROOT}/etc
- fi
-
- # Touching /etc/passwd and /etc/shadow after install can be fatal, as many
- # new users do not update them properly... see src_install() for why they
- # are in /usr/share/baselayout/
- for x in passwd shadow group fstab ; do
- if [[ -e ${ROOT}/etc/${x} ]] ; then
- touch "${ROOT}/etc/${x}"
- else
- cp "${ROOT}/usr/share/baselayout/${x}" "${ROOT}/etc/${x}"
- fi
- done
-
- # Under what circumstances would mtab be a symlink? It would be
- # nice if there were an explanatory comment here
- if [[ -L ${ROOT}/etc/mtab ]]; then
- rm -f "${ROOT}/etc/mtab"
- if [[ ${ROOT} == / ]]; then
- cp /proc/mounts "${ROOT}/etc/mtab"
- else
- touch "${ROOT}/etc/mtab"
- fi
- fi
-
- # We should only install empty files if these files don't already exist.
- [[ -e ${ROOT}/var/log/lastlog ]] || \
- touch "${ROOT}/var/log/lastlog"
- [[ -e ${ROOT}/var/run/utmp ]] || \
- install -m 0664 -g utmp /dev/null "${ROOT}/var/run/utmp"
- [[ -e ${ROOT}/var/log/wtmp ]] || \
- install -m 0664 -g utmp /dev/null "${ROOT}/var/log/wtmp"
-
- # Reload init to fix unmounting problems of / on next reboot.
- # This is really needed, as without the new version of init cause init
- # not to quit properly on reboot, and causes a fsck of / on next reboot.
- if [[ ${ROOT} == / ]] && ! use build && ! use bootstrap; then
- # Regenerate init.d dependency tree
- /sbin/depscan.sh &>/dev/null
-
- # Regenerate /etc/modules.conf, else it will fail at next boot
- einfo "Updating module dependencies..."
- /sbin/modules-update force &>/dev/null
- else
- rm -f ${ROOT}/etc/modules.conf
- fi
-
- # Enable shadow groups (we need ROOT=/ here, as grpconv only
- # operate on / ...).
- if [[ ${ROOT} == / && \
- ! -f /etc/gshadow && -x /usr/sbin/grpck && -x /usr/sbin/grpconv ]]
- then
- if /usr/sbin/grpck -r &>/dev/null; then
- /usr/sbin/grpconv
- else
- echo
- ewarn "Running 'grpck' returned errors. Please run it by hand, and then"
- ewarn "run 'grpconv' afterwards!"
- echo
- fi
- fi
-
- # This is also written in src_install (so it's in CONTENTS), but
- # write it here so that the new version is immediately in the file
- # (without waiting for the user to do etc-update)
- rm -f ${ROOT}/etc/._cfg????_gentoo-release
- echo "Gentoo Base System version ${SV}" > ${ROOT}/etc/gentoo-release
-
- echo
- einfo "Please be sure to update all pending '._cfg*' files in /etc,"
- einfo "else things might break at your next reboot! You can use 'etc-update'"
- einfo "to accomplish this:"
- einfo
- einfo " # etc-update"
- echo
-
- for f in /etc/init.d/net.eth*; do
- [[ -L ${f} ]] && continue
- echo
- einfo "WARNING: You have older net.eth* files in ${ROOT}/etc/init.d/"
- einfo "They need to be converted to symlinks to net.lo. If you haven't"
- einfo "made personal changes to those files, you can update with the"
- einfo "following command:"
- einfo
- einfo " # /bin/ls /etc/init.d/net.eth* | xargs -n1 ln -sfvn net.lo"
- echo
- break
- done
-
- if sed -e 's/#.*//' ${ROOT}/etc/conf.d/{net,wireless} 2>/dev/null \
- | egrep -q '\<(domain|nameservers|searchdomains)_' ; then
- echo
- ewarn "You have depreciated variables in ${ROOT}/etc/conf.d/net"
- ewarn "or ${ROOT}/etc/conf.d/wireless"
- ewarn
- ewarn "domain_* -> dns_domain_*"
- ewarn "nameservers_* -> dns_servers_*"
- ewarn "searchdomains_* -> dns_search_domains_*"
- ewarn
- ewarn "They have been converted for you - ensure that you"
- ewarn "update them via 'etc-update'"
- echo
- fi
-
- if sed -e 's/#.*//' ${ROOT}/etc/conf.d/net 2>/dev/null \
- | egrep -q '\<(ifconfig|aliases|broadcasts|netmasks|inet6|ipaddr|iproute)_'; then
- echo
- ewarn "You are using deprecated variables in ${ROOT}/etc/conf.d/net"
- ewarn
- ewarn "You are advised to review the new configuration variables as"
- ewarn "found in ${ROOT}/etc/conf.d/net.example as there is no"
- ewarn "guarantee that they will work in future versions."
- echo
- fi
-}
+++ /dev/null
-# Copyright 1999-2005 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/sys-apps/baselayout/baselayout-1.9.4-r6.ebuild,v 1.12 2005/05/30 02:55:12 solar Exp $
-
-inherit flag-o-matic eutils toolchain-funcs
-
-SV=1.4.16 # rc-scripts version
-SVREV= # rc-scripts rev
-SVIV=2.84 # sysvinit version
-
-S="${WORKDIR}/rc-scripts-${SV}${SVREV}"
-S2="${WORKDIR}/sysvinit-${SVIV}"
-DESCRIPTION="Base layout for Gentoo Linux (incl. initscripts and sysvinit)"
-HOMEPAGE="http://www.gentoo.org/"
-SRC_URI="ftp://ftp.cistron.nl/pub/people/miquels/software/sysvinit-${SVIV}.tar.gz
- ftp://sunsite.unc.edu/pub/Linux/system/daemons/init/sysvinit-${SVIV}.tar.gz
- mirror://gentoo/rc-scripts-${SV}${SVREV}.tar.bz2"
-
-LICENSE="GPL-2"
-SLOT="0"
-KEYWORDS="amd64 x86 ppc sparc mips alpha arm hppa ia64 ppc64 s390 sh"
-IUSE="bootstrap build static selinux ibm"
-
-# This version of baselayout needs gawk in /bin, but as we do not have
-# a c++ compiler during bootstrap, we cannot depend on it if "bootstrap"
-# or "build" are in USE.
-RDEPEND="!sys-apps/sysvinit
- !build? ( !bootstrap? (
- >=sys-apps/gawk-3.1.1-r2
- >=sys-apps/util-linux-2.11z-r6
- ) )
- selinux? ( sys-libs/libselinux )"
-DEPEND="virtual/os-headers
- selinux? ( sys-libs/libselinux )"
-
-PROVIDE="virtual/baselayout"
-
-src_unpack() {
- unpack ${A}
-
- # Let glibc handle nscd #43076
- rm ${S}/init.d/nscd
-
- # Patch rc-scripts to bring splash stuff up to snuff until 1.11.x is
- # available (not soon enough for 2004.3)
- cd ${S}
- epatch ${FILESDIR}/rc-scripts-1.4.16-splash.patch
-
- #
- # Baselayout setup
- #
- cd ${S}/etc
-
- # Fix Sparc specific stuff
- if [[ ${ARCH} == sparc ]]; then
- sed -i -e 's:KEYMAP="us":KEYMAP="sunkeymap":' rc.conf || die
- fi
-
- # Add serial console for arches that typically have it
- case ${ARCH} in
- sparc|mips|hppa|alpha|ia64|ppc64)
- sed -i -e \
- 's"# TERMINALS"# SERIAL CONSOLE\nc0:12345:respawn:/sbin/agetty 9600 ttyS0 vt100\n\n# TERMINALS"' \
- inittab || die
- ;;
- esac
-
- # Add hvc console skeleton for ibm ppc64 types
- if [ ${ARCH} == "ppc64" ]; then
- if use ibm; then
- sed -i \
- -e 's"# TERMINALS"#HVC CONSOLE\n#hvc:12345:respawn:/sbin/agetty -nl /bin/bashlogin 9600 hvc0 vt220 \n\n# TERMINALS"' \
- inittab || die
- fi
- fi
-
- #
- # sysvinit setup
- #
- if ! use build; then
- cd ${S2}/src
-
- # Selinux patch for sysvinit
- if use selinux; then
- if has_version '>=sys-libs/libselinux-1.6'; then
- epatch ${FILESDIR}/sysvinit-${SVIV}-selinux1.patch
- else
- epatch ${FILESDIR}/sysvinit-${SVIV}-selinux.patch
- fi
- fi
- fi
-}
-
-src_compile() {
- use static && append-ldflags -static
-
- echo "${ROOT}" > ${T}/ROOT
-
- einfo "Building utilities..."
- make -C ${S}/src CC="$(tc-getCC)" LD="$(tc-getCC) ${LDFLAGS}" \
- CFLAGS="${CFLAGS}" || die "problem compiling utilities"
-
- if ! use build; then
- einfo "Building sysvinit..."
- # Note: The LCRYPT define below overrides the test in
- # sysvinit's Makefile. This is because sulogin must be linked
- # to libcrypt in any case, but when building stage2 in
- # catalyst, /usr/lib/libcrypt.a isn't available. In truth
- # this doesn't change how sulogin is built since ld would use
- # the shared obj by default anyway! The other option is to
- # refrain from building sulogin, but that isn't a good option.
- # (09 Jul 2004 agriffis)
- emake -C ${S2}/src CC="$(tc-getCC)" LD="$(tc-getCC)" \
- LDFLAGS="${LDFLAGS}" CFLAGS="${CFLAGS} -D_GNU_SOURCE" \
- LCRYPT="-lcrypt" || die "problem compiling sysvinit"
- else
- einfo "Not building sysvinit because USE=build"
- fi
-}
-
-# ${PATH} should include where to get MAKEDEV when calling this
-# function
-create_dev_nodes() {
- case ${ARCH} in
- # amd64 must use generic-i386 because amd64/x86_64 does not have
- # a generic option at this time, and the default 'generic' ends
- # up erroring out, because MAKEDEV internally doesn't know what
- # to use
- amd64) suffix=-i386 ;;
- x86) suffix=-i386 ;;
- ppc*) suffix=-powerpc ;;
- alpha) suffix=-alpha ;;
- ia64) suffix=-ia64 ;;
- sparc*) suffix=-sparc ;;
- mips) suffix=-mips ;;
- arm) suffix=-arm ;;
- hppa) suffix=-hppa ;;
- esac
-
- einfo "Using generic${suffix} to make ${ARCH} device nodes..."
- MAKEDEV generic${suffix}
- MAKEDEV sg scd rtc hde hdf hdg hdh input audio video
-}
-
-# This is a temporary workaround until bug 9849 is completely solved
-# in portage. We need to create the directories so they're available
-# during src_install, but when src_install is finished, call unkdir
-# to remove any empty directories instead of leaving them around.
-kdir() {
- typeset -a args
- typeset d
-
- # Create the directories for the remainder of src_install, and
- # remember how to create the directories later.
- for d in "$@"; do
- if [[ $d == /* ]]; then
- install -d "${args[@]}" "${D}/${d}"
- cat >> "${D}/usr/share/baselayout/mkdirs.sh" <<EOF
-install -d ${args[@]} "\${ROOT}/${d}" 2>/dev/null \\
- || ewarn " can't create ${d}"
-touch "\${ROOT}/${d}/.keep" 2>/dev/null \\
- || ewarn " can't create ${d}/.keep"
-EOF
- else
- args=("${args[@]}" "${d}")
- fi
- done
-}
-
-# Continued from kdir above... This function removes any empty
-# directories as a temporary workaround for bug 9849. The directories
-# (and .keep files) are re-created in pkg_postinst, which means they
-# aren't listed in CONTENTS, unfortunately.
-unkdir() {
- einfo "Running unkdir to workaround bug 9849"
- find ${D} -depth -type d -exec rmdir {} \; 2>/dev/null
- if [[ $? == 127 ]]; then
- ewarn "Problem running unkdir: find command not found"
- fi
-}
-
-src_install() {
- local foo bar
-
- # ROOT is purged from the environment prior to calling
- # src_install. Good thing we saved it in a temporary file.
- # Otherwise ROOT will be NULL, which hopefully is correct!
- # (I don't know why it was in the environment in the first
- # place... could have just used a shell variable?)
- if [[ -f ${T}/ROOT ]]; then
- ROOT=$(cat ${T}/ROOT)
- fi
-
- # This directory is to stash away things that will be used in
- # pkg_postinst
- dodir /usr/share/baselayout
-
- einfo "Creating directories..."
- kdir /boot
- kdir /dev
- kdir /dev/pts
- kdir /dev/shm
- kdir /etc/conf.d
- kdir /etc/cron.daily
- kdir /etc/cron.hourly
- kdir /etc/cron.monthly
- kdir /etc/cron.weekly
- kdir /etc/env.d
- kdir /etc/modules.autoload.d
- kdir /etc/modules.d
- kdir /etc/opt
- kdir /home
- kdir /lib
- kdir /lib/dev-state
- kdir /lib/udev-state
- kdir /mnt
- kdir -m 0700 /mnt/cdrom
- kdir -m 0700 /mnt/floppy
- kdir /opt
- kdir -o root -g uucp -m0775 /var/lock
- kdir /proc
- kdir -m 0700 /root
- kdir /sbin
- kdir /sys # needed for 2.6 kernels, fixes bug 52703
- kdir /usr
- kdir /usr/bin
- kdir /usr/include
- kdir /usr/include/asm
- kdir /usr/include/linux
- kdir /usr/lib
- kdir /usr/local/bin
- kdir /usr/local/games
- kdir /usr/local/lib
- kdir /usr/local/sbin
- kdir /usr/local/share
- kdir /usr/local/share/doc
- kdir /usr/local/share/man
- kdir /usr/local/src
- kdir /usr/portage
- kdir /usr/sbin
- kdir /usr/share/doc
- kdir /usr/share/info
- kdir /usr/share/man
- kdir /usr/share/misc
- kdir /usr/src
- kdir /usr/X11R6/include/GL
- kdir /usr/X11R6/include/X11
- kdir /usr/X11R6/lib
- kdir /usr/X11R6/lib
- kdir /usr/X11R6/man
- kdir /usr/X11R6/share
- kdir -m 1777 /tmp
- kdir /var
- kdir /var/lib/misc
- kdir /var/lock/subsys
- kdir /var/log/news
- kdir /var/run
- kdir /var/spool
- kdir /var/state
- kdir -m 1777 /var/tmp
-
- dodir /etc/init.d # .keep file might mess up init.d stuff
- dodir /var/db/pkg # .keep file messes up Portage when looking in /var/db/pkg
-
- # Symlinks so that LSB compliant apps work
- # /lib64 is especially required since its the default place for ld.so
- if [[ ${ARCH} == amd64 || ${ARCH} == ppc64 ]]; then
- dosym lib /lib64
- dosym lib /usr/lib64
- dosym lib /usr/X11R6/lib64
- fi
-
- # FHS compatibility symlinks stuff
- dosym ../var/tmp /usr/tmp
- dosym share/man /usr/man
- dosym share/doc /usr/doc
- dosym share/info /usr/info
- dosym ../../share/info /usr/X11R6/share/info
- dosym ../X11R6/include/X11 /usr/include/X11
- dosym ../X11R6/include/GL /usr/include/GL
- dosym ../X11R6/lib/X11 /usr/lib/X11
- dosym share/man /usr/local/man
- dosym share/doc /usr/local/doc
-
- #
- # Setup files in /etc
- #
- dosym ../proc/filesystems /etc/filesystems
-
- insopts -m0644
- insinto /etc
- find ${S}/etc -type f -maxdepth 1 -print0 | xargs --null doins
-
- fperms 0600 /etc/shadow
-
- exeinto /etc/init.d
- doexe ${S}/init.d/*
- insinto /etc/conf.d
- doins ${S}/etc/conf.d/*
- insinto /etc/env.d
- doins ${S}/etc/env.d/*
- insinto /etc/modules.autoload.d
- doins ${S}/etc/modules.autoload.d/*
- insinto /etc/modules.d
- doins ${S}/etc/modules.d/*
- insinto /etc/skel
- find ${S}/etc/skel -type f -maxdepth 1 -print0 | xargs --null doins
-
- rm -f ${D}/etc/{conf,init}.d/net.ppp* # now ships with net-dialup/ppp
-
- # Set up default runlevel symlinks
- if [[ ${ROOT} != / ]]; then
- for foo in default boot nonetwork single; do
- kdir /etc/runlevels/${foo}
- for bar in $(cat ${S}/rc-lists/${foo}); do
- [[ -e ${S}/init.d/${bar} ]] && \
- dosym /etc/init.d/${bar} /etc/runlevels/${foo}/${bar}
- done
- done
- fi
-
- # We do not want to overwrite the user's settings during
- # bootstrap; put this somewhere for safekeeping until pkg_postinst
- mv ${D}/etc/hosts ${D}/usr/share/baselayout
-
- # rc-scripts version for testing of features that *should* be present
- echo "Gentoo Base System version ${SV}" > ${D}/etc/gentoo-release
-
- #
- # Setup files related to /dev
- #
- into /
- dosbin ${S}/sbin/MAKEDEV
- dosym ../../sbin/MAKEDEV /usr/sbin/MAKEDEV
- dosym ../sbin/MAKEDEV /dev/MAKEDEV
-
- if use build || use bootstrap || \
- [[ ! -f "${ROOT}/lib/udev-state/devices.tar.bz2" ]]; then
- # Ok, create temp device nodes
- mkdir -p "${T}/udev-$$"
- cd "${T}/udev-$$"
- echo
- einfo "Making device nodes (this could take a minute or so...)"
- PATH="${D}/sbin:${PATH}" create_dev_nodes
-
- # Now create tarball that can also be used for udev.
- # Need GNU tar for -j so call it by absolute path.
- /bin/tar -cjlpf "${T}/devices-$$.tar.bz2" *
- insinto /lib/udev-state
- newins "${T}/devices-$$.tar.bz2" devices.tar.bz2
- fi
-
- #
- # Setup files in /bin
- #
- cd ${S}/bin
- dobin rc-status
-
- #
- # Setup files in /sbin
- #
- cd ${S}/sbin
- into /
- dosbin rc rc-update
- # Need this in /sbin, as it could be run before
- # /usr is mounted.
- dosbin modules-update
- # Compat symlinks until I can get things synced.
- dosym modules-update /sbin/update-modules
- dosym ../../sbin/modules-update /usr/sbin/update-modules
- # These moved from /etc/init.d/ to /sbin to help newb systems
- # from breaking
- dosbin runscript.sh functions.sh
-
- # Compat symlinks between /etc/init.d and /sbin
- # (some stuff have hardcoded paths)
- dosym ../../sbin/depscan.sh /etc/init.d/depscan.sh
- dosym ../../sbin/runscript.sh /etc/init.d/runscript.sh
- dosym ../../sbin/functions.sh /etc/init.d/functions.sh
-
- #
- # Setup files in /lib/rcsripts/sh
- #
- cd ${S}/sbin
- exeinto /lib/rcscripts/sh
- doexe rc-services.sh rc-daemon.sh rc-help.sh
-
- # We can only install new, fast awk versions of scripts
- # if 'build' or 'bootstrap' is not in USE. This will
- # change if we have sys-apps/gawk-3.1.1-r1 or later in
- # the build image ...
- if ! use build; then
- # This is for new depscan.sh and env-update.sh
- # written in awk
- cd ${S}/sbin
- into /
- dosbin depscan.sh
- dosbin env-update.sh
- insinto /lib/rcscripts/awk
- doins ${S}/src/awk/*.awk
- fi
-
- #
- # Install baselayout documentation
- #
- if ! use build ; then
- doman ${S}/man/*.*
- docinto /
- dodoc ${FILESDIR}/copyright
- dodoc ${S}/ChangeLog
- fi
-
- #
- # Install baselayout utilities
- #
- cd ${S}/src
- einfo "Installing utilities..."
- make DESTDIR="${D}" install || die "problem installing utilities"
-
- #
- # Install sysvinit
- #
- if ! use build; then
- cd ${S2}/src
- einfo "Installing sysvinit..."
- into /
- dosbin init halt killall5 runlevel shutdown sulogin
- dosym init /sbin/telinit
- dobin last mesg utmpdump wall
- dosym killall5 /sbin/pidof
- dosym halt /sbin/reboot
- dosym halt /sbin/poweroff
- dosym last /bin/lastb
- insinto /usr/include
- doins initreq.h
- # sysvinit docs
- cd ${S2}
- doman man/*.[1-9]
- docinto sysvinit-${SVIV}
- dodoc COPYRIGHT README doc/*
- fi
-
- use elibc_uclibc && rm -f ${D}/etc/nsswitch.conf
-
- # Hack to fix bug 9849, continued in pkg_postinst
- unkdir
-}
-
-pkg_preinst() {
- if [[ -f ${ROOT}/etc/modules.autoload && \
- ! -d ${ROOT}/etc/modules.autoload.d ]]; then
- mkdir -p ${ROOT}/etc/modules.autoload.d
- mv -f ${ROOT}/etc/modules.autoload \
- ${ROOT}/etc/modules.autoload.d/kernel-2.4
- ln -snf modules.autoload.d/kernel-2.4 ${ROOT}/etc/modules.autoload
- fi
-
- if [[ -f "${ROOT}/lib/udev-state/devices.tar.bz2" &&
- -e "${ROOT}/dev/.udev" ]]; then
- mv -f "${ROOT}/lib/udev-state/devices.tar.bz2" \
- "${ROOT}/lib/udev-state/devices.tar.bz2.current"
- fi
-}
-
-pkg_postinst() {
- local x
-
- # Reincarnate dirs from kdir/unkdir (hack for bug 9849)
- einfo "Creating directories and .keep files."
- einfo "Some of these might fail if they're read-only mounted"
- einfo "filesystems, for example /dev or /proc. That's okay!"
- source ${ROOT}/usr/share/baselayout/mkdirs.sh
-
- if [[ -f "${ROOT}/lib/udev-state/devices.tar.bz2.current" ]]; then
- # Rather use our current device tarball ... this was saved off
- # in pkg_preinst
- mv -f "${ROOT}/lib/udev-state/devices.tar.bz2.current" \
- "${ROOT}/lib/udev-state/devices.tar.bz2"
- else
- # Make sure our tarball does not get removed; update the
- # timestamp so that it doesn't match CONTENTS
- touch "${ROOT}/lib/udev-state/devices.tar.bz2"
- fi
-
- # We don't want to create devices if this is not a bootstrap and devfs
- # is used, as this was the cause for all the devfs problems we had
- if use build || use bootstrap; then
- if [[ ! -e "${ROOT}/dev/.devfsd" && ! -e "${ROOT}/dev/.udev" ]]; then
- einfo "Populating /dev with device nodes..."
- cd ${ROOT}/dev
- if [ -f "${ROOT}/lib/udev-state/devices.tar.bz2" ]; then
- tar -jxpf "${ROOT}/lib/udev-state/devices.tar.bz2" || die
- else
- # devices.tar.bz2 will not exist with binary packages ...
- PATH="${ROOT}/sbin:${PATH}" create_dev_nodes
- fi
- fi
- fi
-
- # Create /boot/boot symlink in pkg_postinst because sometimes
- # /boot is a FAT filesystem. When that is the case, then the
- # symlink will fail. Consequently, if we create it in
- # src_install, then merge will fail. AFAIK there is no point to
- # this symlink except for misconfigured grubs. See bug 50108
- # (05 May 2004 agriffis)
- ln -sn . ${ROOT}/boot/boot 2>/dev/null
-
- # Create /etc/hosts in pkg_postinst so we don't overwrite an
- # existing file during bootstrap
- if [[ ! -e ${ROOT}/etc/hosts ]]; then
- cp ${ROOT}/usr/share/baselayout/hosts ${ROOT}/etc
- fi
-
- # Under what circumstances would mtab be a symlink? It would be
- # nice if there were an explanatory comment here
- if [[ -L ${ROOT}/etc/mtab ]]; then
- rm -f "${ROOT}/etc/mtab"
- if [[ ${ROOT} == / ]]; then
- cp /proc/mounts "${ROOT}/etc/mtab"
- else
- touch "${ROOT}/etc/mtab"
- fi
- fi
-
- # We should only install empty files if these files don't already exist.
- [[ -e ${ROOT}/var/log/lastlog ]] || \
- touch "${ROOT}/var/log/lastlog"
- [[ -e ${ROOT}/var/run/utmp ]] || \
- install -m 0664 -g utmp /dev/null "${ROOT}/var/run/utmp"
- [[ -e ${ROOT}/var/log/wtmp ]] || \
- install -m 0664 -g utmp /dev/null "${ROOT}/var/log/wtmp"
-
- # Touching /etc/passwd and /etc/shadow after install can be fatal, as many
- # new users do not update them properly. thus remove all ._cfg files if
- # we are not busy with a bootstrap.
- if ! use build && ! use bootstrap; then
- einfo "Removing invalid backup copies of critical config files..."
- rm -f "${ROOT}"/etc/._cfg????_{passwd,shadow}
- fi
-
- # Reload init to fix unmounting problems of / on next reboot.
- # This is really needed, as without the new version of init cause init
- # not to quit properly on reboot, and causes a fsck of / on next reboot.
- if [[ ${ROOT} == / ]] && ! use build && ! use bootstrap; then
- # Do not return an error if this fails
- /sbin/init U &>/dev/null
-
- # Regenerate init.d dependency tree
- /sbin/depscan.sh &>/dev/null
-
- # Regenerate /etc/modules.conf, else it will fail at next boot
- einfo "Updating module dependencies..."
- /sbin/modules-update force &>/dev/null
- else
- rm -f ${ROOT}/etc/modules.conf
- fi
-
- # Enable shadow groups (we need ROOT=/ here, as grpconv only
- # operate on / ...).
- if [[ ${ROOT} == / && \
- ! -f /etc/gshadow && -x /usr/sbin/grpck && -x /usr/sbin/grpconv ]]
- then
- if /usr/sbin/grpck -r &>/dev/null; then
- /usr/sbin/grpconv
- else
- echo
- ewarn "Running 'grpck' returned errors. Please run it by hand, and then"
- ewarn "run 'grpconv' afterwards!"
- echo
- fi
- fi
-
- # This is also written in src_install (so it's in CONTENTS), but
- # write it here so that the new version is immediately in the file
- # (without waiting for the user to do etc-update)
- rm -f ${ROOT}/etc/._cfg????_gentoo-release
- echo "Gentoo Base System version ${SV}" > ${ROOT}/etc/gentoo-release
-
- echo
- einfo "Please be sure to update all pending '._cfg*' files in /etc,"
- einfo "else things might break at your next reboot! You can use 'etc-update'"
- einfo "to accomplish this:"
- einfo
- einfo " # etc-update"
- echo
-}
+++ /dev/null
-# Copyright 1999-2005 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/sys-apps/baselayout/baselayout-1.9.4-r7.ebuild,v 1.6 2005/05/30 02:55:12 solar Exp $
-
-inherit flag-o-matic eutils toolchain-funcs multilib
-
-SV=1.4.16 # rc-scripts version
-SVREV= # rc-scripts rev
-SVIV=2.84 # sysvinit version
-
-S="${WORKDIR}/rc-scripts-${SV}${SVREV}"
-S2="${WORKDIR}/sysvinit-${SVIV}"
-DESCRIPTION="Base layout for Gentoo Linux (incl. initscripts and sysvinit)"
-HOMEPAGE="http://www.gentoo.org/"
-SRC_URI="ftp://ftp.cistron.nl/pub/people/miquels/software/sysvinit-${SVIV}.tar.gz
- ftp://sunsite.unc.edu/pub/Linux/system/daemons/init/sysvinit-${SVIV}.tar.gz
- mirror://gentoo/rc-scripts-${SV}${SVREV}.tar.bz2"
-
-LICENSE="GPL-2"
-SLOT="0"
-KEYWORDS="amd64"
-IUSE="bootstrap build static selinux"
-
-# This version of baselayout needs gawk in /bin, but as we do not have
-# a c++ compiler during bootstrap, we cannot depend on it if "bootstrap"
-# or "build" are in USE.
-RDEPEND="!sys-apps/sysvinit
- !build? ( !bootstrap? (
- >=sys-apps/gawk-3.1.1-r2
- >=sys-apps/util-linux-2.11z-r6
- ) )
- selinux? ( sys-libs/libselinux )"
-DEPEND="virtual/os-headers
- selinux? ( sys-libs/libselinux )"
-
-PROVIDE="virtual/baselayout"
-
-src_unpack() {
- unpack ${A}
-
- # Let glibc handle nscd #43076
- rm ${S}/init.d/nscd
-
- # Patch rc-scripts to bring splash stuff up to snuff until 1.11.x is
- # available (not soon enough for 2004.3)
- cd ${S}
- epatch ${FILESDIR}/rc-scripts-1.4.16-splash.patch
-
- #
- # Baselayout setup
- #
- cd ${S}/etc
-
- # Fix Sparc specific stuff
- if [[ ${ARCH} == sparc ]]; then
- sed -i -e 's:KEYMAP="us":KEYMAP="sunkeymap":' rc.conf || die
- fi
-
- # Add serial console for arches that typically have it
- case ${ARCH} in
- sparc|mips|hppa|alpha|ia64)
- sed -i -e \
- 's"# TERMINALS"# SERIAL CONSOLE\nc0:12345:respawn:/sbin/agetty 9600 ttyS0 vt100\n\n# TERMINALS"' \
- inittab || die
- ;;
- esac
-
- #
- # sysvinit setup
- #
- if ! use build; then
- cd ${S2}/src
-
- # Selinux patch for sysvinit
- if use selinux; then
- if has_version '>=sys-libs/libselinux-1.6'; then
- epatch ${FILESDIR}/sysvinit-${SVIV}-selinux1.patch
- else
- epatch ${FILESDIR}/sysvinit-${SVIV}-selinux.patch
- fi
- fi
- fi
-}
-
-src_compile() {
- use static && append-ldflags -static
-
- echo "${ROOT}" > ${T}/ROOT
-
- einfo "Building utilities..."
- make -C ${S}/src CC="$(tc-getCC)" LD="$(tc-getCC) ${LDFLAGS}" \
- CFLAGS="${CFLAGS}" || die "problem compiling utilities"
-
- if ! use build; then
- einfo "Building sysvinit..."
- # Note: The LCRYPT define below overrides the test in
- # sysvinit's Makefile. This is because sulogin must be linked
- # to libcrypt in any case, but when building stage2 in
- # catalyst, /usr/lib/libcrypt.a isn't available. In truth
- # this doesn't change how sulogin is built since ld would use
- # the shared obj by default anyway! The other option is to
- # refrain from building sulogin, but that isn't a good option.
- # (09 Jul 2004 agriffis)
- emake -C ${S2}/src CC="$(tc-getCC)" LD="$(tc-getCC)" \
- LDFLAGS="${LDFLAGS}" CFLAGS="${CFLAGS} -D_GNU_SOURCE" \
- LCRYPT="-lcrypt" || die "problem compiling sysvinit"
- else
- einfo "Not building sysvinit because USE=build"
- fi
-}
-
-# ${PATH} should include where to get MAKEDEV when calling this
-# function
-create_dev_nodes() {
- case ${ARCH} in
- # amd64 must use generic-i386 because amd64/x86_64 does not have
- # a generic option at this time, and the default 'generic' ends
- # up erroring out, because MAKEDEV internally doesn't know what
- # to use
- amd64) suffix=-i386 ;;
- x86) suffix=-i386 ;;
- ppc*) suffix=-powerpc ;;
- alpha) suffix=-alpha ;;
- ia64) suffix=-ia64 ;;
- sparc*) suffix=-sparc ;;
- mips) suffix=-mips ;;
- arm) suffix=-arm ;;
- hppa) suffix=-hppa ;;
- esac
-
- einfo "Using generic${suffix} to make ${ARCH} device nodes..."
- MAKEDEV generic${suffix}
- MAKEDEV sg scd rtc hde hdf hdg hdh input audio video
-}
-
-# This is a temporary workaround until bug 9849 is completely solved
-# in portage. We need to create the directories so they're available
-# during src_install, but when src_install is finished, call unkdir
-# to remove any empty directories instead of leaving them around.
-kdir() {
- typeset -a args
- typeset d
-
- # Create the directories for the remainder of src_install, and
- # remember how to create the directories later.
- for d in "$@"; do
- if [[ $d == /* ]]; then
- install -d "${args[@]}" "${D}/${d}"
- cat >> "${D}/usr/share/baselayout/mkdirs.sh" <<EOF
-install -d ${args[@]} "\${ROOT}/${d}" 2>/dev/null \\
- || ewarn " can't create ${d}"
-touch "\${ROOT}/${d}/.keep" 2>/dev/null \\
- || ewarn " can't create ${d}/.keep"
-EOF
- else
- args=("${args[@]}" "${d}")
- fi
- done
-}
-
-# Continued from kdir above... This function removes any empty
-# directories as a temporary workaround for bug 9849. The directories
-# (and .keep files) are re-created in pkg_postinst, which means they
-# aren't listed in CONTENTS, unfortunately.
-unkdir() {
- einfo "Running unkdir to workaround bug 9849"
- find ${D} -depth -type d -exec rmdir {} \; 2>/dev/null
- if [[ $? == 127 ]]; then
- ewarn "Problem running unkdir: find command not found"
- fi
-}
-
-src_install() {
- local foo bar dir libdirs libdirs_env rcscripts_dir
-
- # ROOT is purged from the environment prior to calling
- # src_install. Good thing we saved it in a temporary file.
- # Otherwise ROOT will be NULL, which hopefully is correct!
- # (I don't know why it was in the environment in the first
- # place... could have just used a shell variable?)
- if [[ -f ${T}/ROOT ]]; then
- ROOT=$(cat ${T}/ROOT)
- fi
-
- # This directory is to stash away things that will be used in
- # pkg_postinst
- dodir /usr/share/baselayout
-
- # Jeremy Huddleston <eradicator@gentoo.org>
- # For multilib, we want to make sure that all our multilibdirs exist
- # and make lib even if it's not listed as one (like on amd64/ppc64
- # which sometimes has lib32/lib64 instead of lib/lib64).
- # lib should NOT be a symlink to one of the other libdirs.
- # Old systems with symlinks won't be affected by this change, as the
- # symlinks already exist and won't get removed, but new systems will
- # be setup properly.
- #
- # I'll be making a script to convert existing systems from symlink to
- # nosymlink and putting it in /usr/portage/scripts.
- libdirs=$(get_all_libdirs)
- : ${libdirs:=lib} # it isn't that we don't trust multilib.eclass...
-
- if [ "${SYMLINK_LIB}" = "yes" ]; then
- rcscripts_dir="/$(get_abi_LIBDIR ${DEFAULT_ABI})/rcscripts"
- else
- rcscripts_dir="/lib/rcscripts"
- fi
-
- einfo "Creating directories..."
- kdir /boot
- kdir /dev
- kdir /dev/pts
- kdir /dev/shm
- kdir /etc/conf.d
- kdir /etc/cron.daily
- kdir /etc/cron.hourly
- kdir /etc/cron.monthly
- kdir /etc/cron.weekly
- kdir /etc/env.d
- kdir /etc/modules.autoload.d
- kdir /etc/modules.d
- kdir /etc/opt
- kdir /home
- kdir /lib
- kdir /lib/dev-state
- kdir /lib/udev-state
- kdir /mnt
- kdir -m 0700 /mnt/cdrom
- kdir -m 0700 /mnt/floppy
- kdir /opt
- kdir -o root -g uucp -m0775 /var/lock
- kdir /proc
- kdir -m 0700 /root
- kdir /sbin
- kdir /sys # needed for 2.6 kernels, fixes bug 52703
- kdir /usr
- kdir /usr/bin
- kdir /usr/include
- kdir /usr/include/asm
- kdir /usr/include/linux
- kdir /usr/local/bin
- kdir /usr/local/games
- kdir /usr/local/sbin
- kdir /usr/local/share
- kdir /usr/local/share/doc
- kdir /usr/local/share/man
- kdir /usr/local/src
- kdir /usr/portage
- kdir /usr/sbin
- kdir /usr/share/doc
- kdir /usr/share/info
- kdir /usr/share/man
- kdir /usr/share/misc
- kdir /usr/src
- kdir /usr/X11R6/include/GL
- kdir /usr/X11R6/include/X11
- kdir /usr/X11R6/man
- kdir /usr/X11R6/share
- kdir -m 1777 /tmp
- kdir /var
- kdir /var/lib/misc
- kdir /var/lock/subsys
- kdir /var/log/news
- kdir /var/run
- kdir /var/spool
- kdir /var/state
- kdir -m 1777 /var/tmp
-
- dodir /etc/init.d # .keep file might mess up init.d stuff
- dodir /var/db/pkg # .keep file messes up Portage when looking in /var/db/pkg
-
- for dir in ${libdirs}; do
- libdirs_env="${libdirs_env:+$libdirs_env:}/${dir}:/usr/${dir}:/usr/local/${dir}"
- [ "${dir}" = "lib" -a "${SYMLINK_LIB}" = "yes" ] && continue
- kdir /${dir}
- kdir /usr/${dir}
- kdir /usr/local/${dir}
- kdir /usr/X11R6/${dir}
- done
-
- # Ugly compatibility with stupid ebuilds and old profiles symlinks
- if [ "${SYMLINK_LIB}" = "yes" ]; then
- rm -rf ${D}/lib ${D}/usr/lib ${D}/usr/local/lib ${D}/usr/X11R6/lib
- dosym $(get_abi_LIBDIR ${DEFAULT_ABI}) /lib
- dosym $(get_abi_LIBDIR ${DEFAULT_ABI}) /usr/lib
- dosym $(get_abi_LIBDIR ${DEFAULT_ABI}) /usr/local/lib
- dosym $(get_abi_LIBDIR ${DEFAULT_ABI}) /usr/X11R6/lib
- fi
-
- # FHS compatibility symlinks stuff
- dosym ../var/tmp /usr/tmp
- dosym share/man /usr/man
- dosym share/doc /usr/doc
- dosym share/info /usr/info
- dosym ../../share/info /usr/X11R6/share/info
- dosym ../X11R6/include/X11 /usr/include/X11
- dosym ../X11R6/include/GL /usr/include/GL
- dosym ../X11R6/lib/X11 /usr/lib/X11
- dosym share/man /usr/local/man
- dosym share/doc /usr/local/doc
-
- #
- # Setup files in /etc
- #
- dosym ../proc/filesystems /etc/filesystems
-
- insopts -m0644
- insinto /etc
- find ${S}/etc -type f -maxdepth 1 -print0 | xargs --null doins
-
- fperms 0600 /etc/shadow
-
- exeinto /etc/init.d
- doexe ${S}/init.d/*
- insinto /etc/conf.d
- doins ${S}/etc/conf.d/*
- insinto /etc/env.d
- doins ${S}/etc/env.d/*
- insinto /etc/modules.autoload.d
- doins ${S}/etc/modules.autoload.d/*
- insinto /etc/modules.d
- doins ${S}/etc/modules.d/*
- insinto /etc/skel
- find ${S}/etc/skel -type f -maxdepth 1 -print0 | xargs --null doins
-
- # List all the multilib libdirs in /etc/env/04multilib
- echo "LDPATH=\"${libdirs_env}\"" > ${D}/etc/env.d/04multilib
-
- rm -f ${D}/etc/{conf,init}.d/net.ppp* # now ships with net-dialup/ppp
-
- # Set up default runlevel symlinks
- if [[ ${ROOT} != / ]]; then
- for foo in default boot nonetwork single; do
- kdir /etc/runlevels/${foo}
- for bar in $(cat ${S}/rc-lists/${foo}); do
- [[ -e ${S}/init.d/${bar} ]] && \
- dosym /etc/init.d/${bar} /etc/runlevels/${foo}/${bar}
- done
- done
- fi
-
- # We do not want to overwrite the user's settings during
- # bootstrap; put this somewhere for safekeeping until pkg_postinst
- mv ${D}/etc/hosts ${D}/usr/share/baselayout
-
- # rc-scripts version for testing of features that *should* be present
- echo "Gentoo Base System version ${SV}" > ${D}/etc/gentoo-release
-
- #
- # Setup files related to /dev
- #
- into /
- dosbin ${S}/sbin/MAKEDEV
- dosym ../../sbin/MAKEDEV /usr/sbin/MAKEDEV
- dosym ../sbin/MAKEDEV /dev/MAKEDEV
-
- if use build || use bootstrap || \
- [[ ! -f "${ROOT}/lib/udev-state/devices.tar.bz2" ]]; then
- # Ok, create temp device nodes
- mkdir -p "${T}/udev-$$"
- cd "${T}/udev-$$"
- echo
- einfo "Making device nodes (this could take a minute or so...)"
- PATH="${D}/sbin:${PATH}" create_dev_nodes
-
- # Now create tarball that can also be used for udev.
- # Need GNU tar for -j so call it by absolute path.
- /bin/tar -cjlpf "${T}/devices-$$.tar.bz2" *
- insinto /lib/udev-state
- newins "${T}/devices-$$.tar.bz2" devices.tar.bz2
- fi
-
- #
- # Setup files in /bin
- #
- cd ${S}/bin
- dobin rc-status
-
- #
- # Setup files in /sbin
- #
- cd ${S}/sbin
- into /
- dosbin rc rc-update
- # Need this in /sbin, as it could be run before
- # /usr is mounted.
- dosbin modules-update
- # Compat symlinks until I can get things synced.
- dosym modules-update /sbin/update-modules
- dosym ../../sbin/modules-update /usr/sbin/update-modules
- # These moved from /etc/init.d/ to /sbin to help newb systems
- # from breaking
- dosbin runscript.sh functions.sh
-
- # Compat symlinks between /etc/init.d and /sbin
- # (some stuff have hardcoded paths)
- dosym ../../sbin/depscan.sh /etc/init.d/depscan.sh
- dosym ../../sbin/runscript.sh /etc/init.d/runscript.sh
- dosym ../../sbin/functions.sh /etc/init.d/functions.sh
-
- #
- # Setup files in /lib/rcsripts/sh
- #
- cd ${S}/sbin
- exeinto ${rcscripts_dir}/sh
- doexe rc-services.sh rc-daemon.sh rc-help.sh
-
- # We can only install new, fast awk versions of scripts
- # if 'build' or 'bootstrap' is not in USE. This will
- # change if we have sys-apps/gawk-3.1.1-r1 or later in
- # the build image ...
- if ! use build; then
- # This is for new depscan.sh and env-update.sh
- # written in awk
- cd ${S}/sbin
- into /
- dosbin depscan.sh
- dosbin env-update.sh
- insinto ${rcscripts_dir}/awk
- doins ${S}/src/awk/*.awk
- fi
-
- #
- # Install baselayout documentation
- #
- if ! use build ; then
- doman ${S}/man/*.*
- docinto /
- dodoc ${FILESDIR}/copyright
- dodoc ${S}/ChangeLog
- fi
-
- #
- # Install baselayout utilities
- #
- cd ${S}/src
- einfo "Installing utilities..."
- make DESTDIR="${D}" install || die "problem installing utilities"
-
- #
- # Install sysvinit
- #
- if ! use build; then
- cd ${S2}/src
- einfo "Installing sysvinit..."
- into /
- dosbin init halt killall5 runlevel shutdown sulogin
- dosym init /sbin/telinit
- dobin last mesg utmpdump wall
- dosym killall5 /sbin/pidof
- dosym halt /sbin/reboot
- dosym halt /sbin/poweroff
- dosym last /bin/lastb
- insinto /usr/include
- doins initreq.h
- # sysvinit docs
- cd ${S2}
- doman man/*.[1-9]
- docinto sysvinit-${SVIV}
- dodoc COPYRIGHT README doc/*
- fi
-
- use elibc_uclibc && rm -f ${D}/etc/nsswitch.conf
-
- # Hack to fix bug 9849, continued in pkg_postinst
- unkdir
-}
-
-pkg_preinst() {
- if [[ -f ${ROOT}/etc/modules.autoload && \
- ! -d ${ROOT}/etc/modules.autoload.d ]]; then
- mkdir -p ${ROOT}/etc/modules.autoload.d
- mv -f ${ROOT}/etc/modules.autoload \
- ${ROOT}/etc/modules.autoload.d/kernel-2.4
- ln -snf modules.autoload.d/kernel-2.4 ${ROOT}/etc/modules.autoload
- fi
-
- if [[ -f "${ROOT}/lib/udev-state/devices.tar.bz2" &&
- -e "${ROOT}/dev/.udev" ]]; then
- mv -f "${ROOT}/lib/udev-state/devices.tar.bz2" \
- "${ROOT}/lib/udev-state/devices.tar.bz2.current"
- fi
-}
-
-pkg_postinst() {
- local x
-
- # Reincarnate dirs from kdir/unkdir (hack for bug 9849)
- einfo "Creating directories and .keep files."
- einfo "Some of these might fail if they're read-only mounted"
- einfo "filesystems, for example /dev or /proc. That's okay!"
- source ${ROOT}/usr/share/baselayout/mkdirs.sh
-
- if [[ -f "${ROOT}/lib/udev-state/devices.tar.bz2.current" ]]; then
- # Rather use our current device tarball ... this was saved off
- # in pkg_preinst
- mv -f "${ROOT}/lib/udev-state/devices.tar.bz2.current" \
- "${ROOT}/lib/udev-state/devices.tar.bz2"
- else
- # Make sure our tarball does not get removed; update the
- # timestamp so that it doesn't match CONTENTS
- touch "${ROOT}/lib/udev-state/devices.tar.bz2"
- fi
-
- # We don't want to create devices if this is not a bootstrap and devfs
- # is used, as this was the cause for all the devfs problems we had
- if use build || use bootstrap; then
- if [[ ! -e "${ROOT}/dev/.devfsd" && ! -e "${ROOT}/dev/.udev" ]]; then
- einfo "Populating /dev with device nodes..."
- cd ${ROOT}/dev
- if [ -f "${ROOT}/lib/udev-state/devices.tar.bz2" ]; then
- tar -jxpf "${ROOT}/lib/udev-state/devices.tar.bz2" || die
- else
- # devices.tar.bz2 will not exist with binary packages ...
- PATH="${ROOT}/sbin:${PATH}" create_dev_nodes
- fi
- fi
- fi
-
- # Create /boot/boot symlink in pkg_postinst because sometimes
- # /boot is a FAT filesystem. When that is the case, then the
- # symlink will fail. Consequently, if we create it in
- # src_install, then merge will fail. AFAIK there is no point to
- # this symlink except for misconfigured grubs. See bug 50108
- # (05 May 2004 agriffis)
- ln -sn . ${ROOT}/boot/boot 2>/dev/null
-
- # Create /etc/hosts in pkg_postinst so we don't overwrite an
- # existing file during bootstrap
- if [[ ! -e ${ROOT}/etc/hosts ]]; then
- cp ${ROOT}/usr/share/baselayout/hosts ${ROOT}/etc
- fi
-
- # Under what circumstances would mtab be a symlink? It would be
- # nice if there were an explanatory comment here
- if [[ -L ${ROOT}/etc/mtab ]]; then
- rm -f "${ROOT}/etc/mtab"
- if [[ ${ROOT} == / ]]; then
- cp /proc/mounts "${ROOT}/etc/mtab"
- else
- touch "${ROOT}/etc/mtab"
- fi
- fi
-
- # We should only install empty files if these files don't already exist.
- [[ -e ${ROOT}/var/log/lastlog ]] || \
- touch "${ROOT}/var/log/lastlog"
- [[ -e ${ROOT}/var/run/utmp ]] || \
- install -m 0664 -g utmp /dev/null "${ROOT}/var/run/utmp"
- [[ -e ${ROOT}/var/log/wtmp ]] || \
- install -m 0664 -g utmp /dev/null "${ROOT}/var/log/wtmp"
-
- # Touching /etc/passwd and /etc/shadow after install can be fatal, as many
- # new users do not update them properly. thus remove all ._cfg files if
- # we are not busy with a bootstrap.
- if ! use build && ! use bootstrap; then
- einfo "Removing invalid backup copies of critical config files..."
- rm -f "${ROOT}"/etc/._cfg????_{passwd,shadow}
- fi
-
- # Reload init to fix unmounting problems of / on next reboot.
- # This is really needed, as without the new version of init cause init
- # not to quit properly on reboot, and causes a fsck of / on next reboot.
- if [[ ${ROOT} == / ]] && ! use build && ! use bootstrap; then
- # Do not return an error if this fails
- /sbin/init U &>/dev/null
-
- # Regenerate init.d dependency tree
- /sbin/depscan.sh &>/dev/null
-
- # Regenerate /etc/modules.conf, else it will fail at next boot
- einfo "Updating module dependencies..."
- /sbin/modules-update force &>/dev/null
- else
- rm -f ${ROOT}/etc/modules.conf
- fi
-
- # Enable shadow groups (we need ROOT=/ here, as grpconv only
- # operate on / ...).
- if [[ ${ROOT} == / && \
- ! -f /etc/gshadow && -x /usr/sbin/grpck && -x /usr/sbin/grpconv ]]
- then
- if /usr/sbin/grpck -r &>/dev/null; then
- /usr/sbin/grpconv
- else
- echo
- ewarn "Running 'grpck' returned errors. Please run it by hand, and then"
- ewarn "run 'grpconv' afterwards!"
- echo
- fi
- fi
-
- # This is also written in src_install (so it's in CONTENTS), but
- # write it here so that the new version is immediately in the file
- # (without waiting for the user to do etc-update)
- rm -f ${ROOT}/etc/._cfg????_gentoo-release
- echo "Gentoo Base System version ${SV}" > ${ROOT}/etc/gentoo-release
-
- echo
- einfo "Please be sure to update all pending '._cfg*' files in /etc,"
- einfo "else things might break at your next reboot! You can use 'etc-update'"
- einfo "to accomplish this:"
- einfo
- einfo " # etc-update"
- echo
-}
+++ /dev/null
-Index: lib/rcscripts/net.modules.d/bridge
-===================================================================
-RCS file: /var/cvsroot/gentoo-src/rc-scripts/net-scripts/net.modules.d/bridge,v
-retrieving revision 1.9.4.7
-diff -u -B -r1.9.4.7 bridge
---- lib/rcscripts/net.modules.d/bridge 8 Mar 2005 16:07:30 -0000 1.9.4.7
-+++ lib/rcscripts/net.modules.d/bridge 23 Mar 2005 13:11:04 -0000
-@@ -113,20 +113,20 @@
- for i in ${ports}; do
- interface_exists ${i} && continue
- eerror "interface ${i} does not exist"
-- bridge_stop ${iface} &>/dev/null
- return 1
- done
-
- for i in ${ports}; do
- ebegin "${i}"
-- e=$( brctl addif ${iface} ${i} 2>&1 \
-- && interface_del_addresses ${i} \
-- && interface_set_flag ${i} promisc true \
-- && interface_up ${i} )
-+ interface_set_flag ${i} promisc true
-+ interface_up ${i}
-+ e=$( brctl addif ${iface} ${i} 2>&1 )
- if [[ -n ${e} ]]; then
- eend 1 "${e}"
-+ interface_set_flag ${i} promisc false
- return 1
- fi
-+ eend 0
- done
- eoutdent
-
-@@ -150,7 +150,6 @@
- eindent
- for i in ${ports}; do
- ebegin "Removing port ${i}"
-- interface_down ${i}
- interface_set_flag ${i} promisc false
- brctl delif ${iface} ${i} &>${devnull}
- eend $?
-Index: lib/rcscripts/net.modules.d/ifconfig
-===================================================================
-RCS file: /var/cvsroot/gentoo-src/rc-scripts/net-scripts/net.modules.d/ifconfig,v
-retrieving revision 1.21.4.7
-diff -u -B -r1.21.4.7 ifconfig
---- lib/rcscripts/net.modules.d/ifconfig 31 Jan 2005 11:17:29 -0000 1.21.4.7
-+++ lib/rcscripts/net.modules.d/ifconfig 23 Mar 2005 13:11:04 -0000
-@@ -150,6 +150,9 @@
- # We don't remove addresses from aliases
- [[ ${iface} == *:* ]] && return 0
-
-+ # If the interface doesn't exist, don't try and delete
-+ ifconfig_exists ${iface} || return 0
-+
- # iproute2 can add many addresses to an iface unlike ifconfig ...
- # iproute2 added addresses cause problems for ifconfig
- # as we delete an address, a new one appears, so we have to
-Index: lib/rcscripts/net.modules.d/iwconfig
-===================================================================
-RCS file: /var/cvsroot/gentoo-src/rc-scripts/net-scripts/net.modules.d/iwconfig,v
-retrieving revision 1.7.2.17
-diff -u -B -r1.7.2.17 iwconfig
---- lib/rcscripts/net.modules.d/iwconfig 21 Mar 2005 16:06:04 -0000 1.7.2.17
-+++ lib/rcscripts/net.modules.d/iwconfig 23 Mar 2005 13:11:05 -0000
-@@ -889,7 +889,10 @@
- # Configures ESSID variable
- # Always returns 0
- iwconfig_pre_stop() {
-- ESSID=$( iwconfig_get_essid ${1} )
-- ESSIDVAR=${ESSID//[![:word:]]/_}
-+ unset ESSID ESSIDVAR
-+ if iwconfig_check_extensions $1 ; then
-+ ESSID=$( iwconfig_get_essid $1 )
-+ ESSIDVAR=${ESSID//[![:word:]]/_}
-+ fi
- return 0
- }
-Index: lib/rcscripts/net.modules.d/wpa_supplicant
-===================================================================
-RCS file: /var/cvsroot/gentoo-src/rc-scripts/net-scripts/net.modules.d/wpa_supplicant,v
-retrieving revision 1.2.2.12
-diff -u -B -r1.2.2.12 wpa_supplicant
---- lib/rcscripts/net.modules.d/wpa_supplicant 4 Mar 2005 08:00:25 -0000 1.2.2.12
-+++ lib/rcscripts/net.modules.d/wpa_supplicant 23 Mar 2005 13:11:05 -0000
-@@ -217,6 +217,19 @@
- return 0
- }
-
-+# bool wpa_supplicant_pre_stop(char *iface)
-+#
-+# Configures ESSID variable
-+# Always returns 0
-+wpa_supplicant_pre_stop() {
-+ unset ESSID ESSIDVAR
-+ if wpa_supplicant_check_extensions $1 ; then
-+ ESSID=$( iwconfig_get_essid $1 )
-+ ESSIDVAR=${ESSID//[![:word:]]/_}
-+ fi
-+ return 0
-+}
-+
- # bool wpa_supplicant_post_stop(char *iface)
- #
- # Stops wpa_supplicant on an interface
+++ /dev/null
-diff -u -B -r1.7.2.15 iwconfig
---- 1/lib/rcscripts/net.modules.d/iwconfig 13 Mar 2005 19:03:21 -0000
-+++ 2/lib/rcscripts/net.modules.d/iwconfig 14 Mar 2005 16:49:14 -0000
-@@ -217,11 +217,8 @@
- fi
- fi
-
-- # Attempt to default the key to [1]
-- iwconfig ${iface} key [1] 2>/dev/null
--
- key=$( iwconfig_get_wep_key )
-- e=$( eval "iwconfig ${iface} key [1] key ${key} 2>&1" )
-+ e=$( eval "iwconfig ${iface} key ${key} 2>&1" )
- if [[ -n ${e} && ${key} != off ]]; then
- ewarn "${iface} does not support setting keys"
- ewarn "or the parameter \"mac_key_${ESSIDVAR}\" or \"key_${ESSIDVAR}\" is incorrect"
-@@ -344,9 +341,6 @@
- vewarn "\"${dessid}\" is not WEP enabled - ignoring setting"
- fi
-
-- # Attempt to default the key to [1]
-- iwconfig ${iface} key [1] 2>/dev/null
--
- e=$( eval "iwconfig ${iface} key ${key} 2>&1" )
- if [[ -n ${e} && ${key} != off ]]; then
- ewarn "${iface} does not support setting keys"
+++ /dev/null
-Index: iwconfig
-===================================================================
-RCS file: /var/cvsroot/gentoo-src/rc-scripts/net-scripts/net.modules.d/iwconfig,v
-retrieving revision 1.7.2.14
-diff -u -B -r1.7.2.14 iwconfig
---- 1/lib/rcscripts/net.modules.d/iwconfig 9 Mar 2005 22:20:53 -0000 1.7.2.14
-+++ 2/lib/rcscripts/net.modules.d/iwconfig 13 Mar 2005 19:00:09 -0000
-@@ -692,7 +692,7 @@
- iwconfig ${iface} frag off &>/dev/null
- iwconfig ${iface} power off &>/dev/null
- iwconfig ${iface} txpower auto &>/dev/null
-- iwconfig ${iface} key off [1] &>/dev/nul
-+ iwconfig ${iface} key off [1] &>/dev/null
-
- # We need to set the essid to any as some drivers won't
- # scan correctly if they are already set to an ESSID
+++ /dev/null
---- sbin/rc
-+++ sbin/rc
-@@ -264,6 +259,11 @@
- fi
- eend $?
-
-+ # Selinux lovin; /selinux should be mounted by selinux-patched init
-+ if [[ -x /sbin/restorecon ]] && [[ -c /selinux/null ]] ; then
-+ restorecon /dev &> /selinux/null
-+ fi
-+
- # Actually get udev rolling
- ebegin "Configuring system to use udev"
- if [[ ${RC_DEVICE_TARBALL} = "yes" ]] && [[ -s /lib/udev-state/devices.tar.bz2 ]]
+++ /dev/null
-Index: etc/conf.d/wireless.example
-===================================================================
-RCS file: /var/cvsroot/gentoo-src/rc-scripts/net-scripts/conf.d/wireless.example,v
-retrieving revision 1.11.2.4
-diff -u -B -r1.11.2.4 wireless.example
---- etc/conf.d/wireless.example 4 Feb 2005 10:33:29 -0000 1.11.2.4
-+++ etc/conf.d/wireless.example 1 Apr 2005 16:51:45 -0000
-@@ -244,27 +244,6 @@
- # since there's nothing to do if it indicates failure.
-
- #preassociate() {
--##############################################################################
--# ADVANCED CONFIGURATION
--#
--# Four functions can be defined which will be called surrounding the
--# start/stop operations. The functions are called with the interface
--# name first so that one function can control multiple adapters.
--#
--# The return values for the preup and predown functions should be 0
--# (success) to indicate that configuration or deconfiguration of the
--# interface can continue. If preup returns a non-zero value, then
--# interface configuration will be aborted. If predown returns a
--# non-zero value, then the interface will not be allowed to continue
--# deconfiguration.
--#
--# The return values for the postup and postdown functions are ignored
--# since there's nothing to do if they indicate failure.
--#
--# ${ESSID} is set to the exact ESSID of the AP you're connecting to
--# ${ESSIDVAR} is ${ESSID} converted to variable name bash allows
--
--#preassociate() {
- # # The below adds two configuration variables leap_user_ESSID
- # # and leap_pass_ESSID. When they are both confiugred for the ESSID
- # # being connected to then we run the CISCO LEAP script
-Index: lib/rcscripts/net.modules.d/iwconfig
-===================================================================
-RCS file: /var/cvsroot/gentoo-src/rc-scripts/net-scripts/net.modules.d/iwconfig,v
-retrieving revision 1.7.2.18
-diff -u -B -r1.7.2.18 iwconfig
---- lib/rcscripts/net.modules.d/iwconfig 23 Mar 2005 14:39:11 -0000 1.7.2.18
-+++ lib/rcscripts/net.modules.d/iwconfig 1 Apr 2005 16:51:46 -0000
-@@ -883,16 +883,3 @@
- interface_down ${iface}
- return 1
- }
--
--# bool iwconfig_pre_stop(char *iface)
--#
--# Configures ESSID variable
--# Always returns 0
--iwconfig_pre_stop() {
-- unset ESSID ESSIDVAR
-- if iwconfig_check_extensions $1 ; then
-- ESSID=$( iwconfig_get_essid $1 )
-- ESSIDVAR=${ESSID//[![:word:]]/_}
-- fi
-- return 0
--}
-Index: lib/rcscripts/net.modules.d/wpa_supplicant
-===================================================================
-RCS file: /var/cvsroot/gentoo-src/rc-scripts/net-scripts/net.modules.d/wpa_supplicant,v
-retrieving revision 1.2.2.13
-diff -u -B -r1.2.2.13 wpa_supplicant
---- lib/rcscripts/net.modules.d/wpa_supplicant 23 Mar 2005 14:39:11 -0000 1.2.2.13
-+++ lib/rcscripts/net.modules.d/wpa_supplicant 1 Apr 2005 16:51:46 -0000
-@@ -217,19 +217,6 @@
- return 0
- }
-
--# bool wpa_supplicant_pre_stop(char *iface)
--#
--# Configures ESSID variable
--# Always returns 0
--wpa_supplicant_pre_stop() {
-- unset ESSID ESSIDVAR
-- if wpa_supplicant_check_extensions $1 ; then
-- ESSID=$( iwconfig_get_essid $1 )
-- ESSIDVAR=${ESSID//[![:word:]]/_}
-- fi
-- return 0
--}
--
- # bool wpa_supplicant_post_stop(char *iface)
- #
- # Stops wpa_supplicant on an interface
+++ /dev/null
-diff -u net.modules.d/iwconfig /local/rc-scripts-stable/net-scripts/net.modules.d/iwconfig
---- net.modules.d/iwconfig 2005-04-08 19:16:13.000000000 +0100
-+++ lib/rcscripts/net.modules.d/iwconfig 2005-04-26 22:41:40.000000000 +0100
-@@ -442,6 +442,10 @@
- x=${x:-auto}
- [[ ${mode} != ${x} ]] && iwconfig ${iface} mode ${x} &>/dev/null
-
-+ # HUP the interface as some drivers/cards need it
-+ interface_down ${iface}
-+ interface_up ${iface}
-+
- if [[ -z ${scan} ]]; then
- ewarn "${iface} does not support scanning"
- eval x=\"\$\{adhoc_essid_${ifvar}\}\"
-diff -u net.modules.d/wpa_supplicant /local/rc-scripts-stable/net-scripts/net.modules.d/wpa_supplicant
---- net.modules.d/wpa_supplicant 2005-04-14 18:52:31.000000000 +0100
-+++ lib/rcscripts/net.modules.d/wpa_supplicant 2005-04-26 22:41:40.000000000 +0100
-@@ -102,7 +102,7 @@
- local -a status=( "$( wpa_cli -i${1} status | awk -F= '/^key_mgmt|^wpa_state|^EAP state/ { print "\""$2"\"" }' )" )
-
- case ${status[0]} in
-- "NONE" ) [[ ${status[1]} == "ASSOCIATED" ]] ;;
-+ "NONE" ) [[ ${status[1]} == "ASSOCIATED" || ${status[1]} == "COMPLETED" ]] ;;
- "IEEE 802.1X (no WPA)") [[ ${status[2]} == "SUCCESS" ]] ;;
- *) [[ ${status[1]} == "COMPLETED" ]] ;;
- esac
+++ /dev/null
-Fix by Lachlan Pease.
-
-http://bugs.gentoo.org/92921
-
-Index: sbin/rc
-===================================================================
-RCS file: /var/cvsroot/gentoo-src/rc-scripts/sbin/rc,v
-retrieving revision 1.104.2.14
-diff -u -r1.104.2.14 rc
---- sbin/rc
-+++ sbin/rc
-@@ -260,7 +260,8 @@
- else
- mntcmd="ramfs"
- fi
-- try mount -n -t ${mntcmd} udev /dev -o noexec,nosuid,mode=0755
-+ # many video drivers require exec access in /dev #92921
-+ try mount -n -t ${mntcmd} udev /dev -o exec,nosuid,mode=0755
- fi
- eend $?
-
+++ /dev/null
---- lib/rcscripts/net.modules.d/ifconfig 23 Mar 2005 14:39:11 -0000
-+++ lib/rcscripts/net.modules.d/ifconfig 24 May 2005 14:33:00 -0000
-@@ -318,6 +318,12 @@
- # Support iproute2 style config where possible
- config=( "${config[@]//brd/broadcast}" )
- config=( "${config[@]//peer/pointtopoint}" )
-+
-+ local cidr="${config[0]##*/}" ip="${config[0]%%/*}"
-+ if [[ -n ${cidr} && ${cidr} != ${ip} ]]; then
-+ local netmask=$( cidr2netmask "${cidr}" )
-+ config[0]="${ip} netmask ${netmask}"
-+ fi
- fi
-
- ifconfig ${iface} ${config[@]} &>${devnull}
---- etc/conf.d/wireless.example 19 Apr 2005 16:28:46 -0000 1.11.2.6
-+++ etc/conf.d/wireless.example 25 May 2005 09:16:05 -0000
-@@ -27,9 +27,10 @@
- # becomes
- # #key_My_NET="s:passkey"
- # Notice that the space has changed to an underscore - do the same with all
--# characters not in a-z A-Z (english alphabet) 0-9.
-+# characters not in a-z A-Z (english alphabet) 0-9. This only applies to
-+# variables and not values.
- #
--# Any ESSID's in quotes like essid_eth0="My NET" may need to be escaped
-+# Any ESSID's in values like essid_eth0="My NET" may need to be escaped
- # This means placing the character \ before the character
- # \" need to be escaped for example
- # So if your ESSID is
-@@ -39,6 +40,11 @@
- # for example
- # #essid_eth0="My\"\\NET"
- #
-+# So using the above we can use
-+# #dns_domain_My____NET="My\"\\NET"
-+# which is an invalid dns domain, but shows the how to use the variable
-+# structure
-+#
- # As a final note, most users will just need to set the following options
- # key_ESSID1="s:yourkeyhere enc open" # s: means a text key
- # key_ESSID2="aaaa-bbbb-cccc-dd" # no s: means a hex key
+++ /dev/null
---- sbin/functions.sh 2005-05-15 21:00:31.000000000 +0100
-+++ sbin/functions.sh 2005-05-27 15:54:57.000000000 +0100
-@@ -597,7 +597,7 @@
- # Network filesystems list for common use in rc-scripts.
- # This variable is used in is_net_fs and other places such as
- # localmount.
--NET_FS_LIST="afs cifs coda ncpfs nfs nfs4 shfs smbfs"
-+NET_FS_LIST="afs cifs coda gfs ncpfs nfs nfs4 shfs smbfs"
-
- # bool is_net_fs(path)
- #
-@@ -606,7 +606,13 @@
- # EXAMPLE: if is_net_fs / ; then ...
- #
- is_net_fs() {
-- local fstype=$(mount -o remount -fv "$1" | awk '{print $(NF-1)}')
-+ local fstype
-+ # /proc/mounts is always accurate but may not always be available
-+ if [[ -e /proc/mounts ]]; then
-+ fstype=$( sed -n -e '/^rootfs/!s:.* '"$1"' \([^ ]*\).*:\1:p' /proc/mounts )
-+ else
-+ fstype=$( mount | sed -n -e 's:.* on '"$1"' type \([^ ]*\).*:\1:p' )
-+ fi
- [[ " ${NET_FS_LIST} " == *" ${fstype} "* ]]
- return $?
- }
+++ /dev/null
---- etc/profile 2005-04-29 04:34:01.000000000 +0100
-+++ etc/profile 2005-05-20 23:06:12.000000000 +0100
-@@ -1,7 +1,7 @@
-
- # Load environment settings from profile.env, which is created by
- # env-update from the files in /etc/env.d
--if [[ -e /etc/profile.env ]] ; then
-+if [ -e /etc/profile.env ] ; then
- . /etc/profile.env
- fi
-
-@@ -21,7 +21,7 @@
- # It is intentional in the following line to use || instead of -o.
- # This way the evaluation can be short-circuited and calling whoami is
- # avoided.
--if [[ "$EUID" == 0 ]] || [[ "$USER" == "root" ]] ; then
-+if [ "$EUID" = "0" ] || [ "$USER" = "root" ] ; then
- PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:${ROOTPATH}"
- else
- PATH="/usr/local/bin:/usr/bin:/bin:${PATH}"
-@@ -30,15 +30,15 @@
- unset ROOTPATH
-
- # Extract the value of EDITOR
--[[ -z $EDITOR ]] && EDITOR=$(. /etc/rc.conf 2>/dev/null; echo $EDITOR)
--[[ -z $EDITOR ]] && EDITOR="/bin/nano"
-+[ -z $EDITOR ] && EDITOR="`. /etc/rc.conf 2>/dev/null; echo $EDITOR`"
-+[ -z $EDITOR ] && EDITOR="/bin/nano"
- export EDITOR
-
--if [[ -n ${BASH_VERSION} ]] ; then
-+if [ -n "${BASH_VERSION}" ] ; then
- # Newer bash ebuilds include /etc/bash/bashrc which will setup PS1
- # including color. We leave out color here because not all
- # terminals support it.
-- if [[ -f /etc/bash/bashrc ]] ; then
-+ if [ -f /etc/bash/bashrc ] ; then
- # Bash login shells run only /etc/profile
- # Bash non-login shells run only /etc/bash/bashrc
- # Since we want to run /etc/bash/bashrc regardless, we source it
-@@ -54,5 +54,5 @@
- # Setup a bland default prompt. Since this prompt should be useable
- # on color and non-color terminals, as well as shells that don't
- # understand sequences such as \h, don't put anything special in it.
-- PS1="$(whoami)@$(uname -n | cut -f1 -d.) \$ "
-+ PS1="`whoami`@`uname -n | cut -f1 -d.` \$ "
- fi
+++ /dev/null
---- etc/profile
-+++ etc/profile
-@@ -30,8 +30,8 @@
- unset ROOTPATH
-
- # Extract the value of EDITOR
--[ -z $EDITOR ] && EDITOR="`. /etc/rc.conf 2>/dev/null; echo $EDITOR`"
--[ -z $EDITOR ] && EDITOR="/bin/nano"
-+[ -z "$EDITOR" ] && EDITOR="`. /etc/rc.conf 2>/dev/null; echo $EDITOR`"
-+[ -z "$EDITOR" ] && EDITOR="/bin/nano"
- export EDITOR
-
- if [ -n "${BASH_VERSION}" ] ; then
+++ /dev/null
-Index: sbin/runscript.sh
-===================================================================
-RCS file: /var/cvsroot/gentoo-src/rc-scripts/sbin/runscript.sh,v
-retrieving revision 1.44.2.10
-diff -u -B -r1.44.2.10 runscript.sh
---- sbin/runscript.sh 17 May 2005 00:40:41 -0000 1.44.2.10
-+++ sbin/runscript.sh 26 May 2005 13:07:46 -0000
-@@ -45,7 +45,7 @@
- # has completed
- if [[ ${NETSERVICE} == "yes" && ${IFACE} != "lo" ]] ; then
- if [[ -z ${mylevel} || ${mylevel} == ${BOOTLEVEL} ]] ; then
-- eerror "$0: cannot start until the runlevel "${BOOTLEVEL}" has completed"
-+ eerror "${myservice}: cannot start until the runlevel ${BOOTLEVEL} has completed"
- exit 1
- fi
- fi
+++ /dev/null
-Index: sbin/rc
-===================================================================
-RCS file: /var/cvsroot/gentoo-src/rc-scripts/sbin/rc,v
-retrieving revision 1.104.2.15
-diff -u -r1.104.2.15 rc
---- sbin/rc
-+++ sbin/rc
-@@ -374,11 +374,12 @@
- fi
- fi
-
-- # Swap needs to be activated *after* devfs has been mounted and *after*
-- # devfsd has been started, so that the fstab can be properly parsed
-- # and only if the server/Gentoo box is initialized ...
-+ # Swap needs to be activated *after* /dev has been fully setup so that
-+ # the fstab can be properly parsed. This first pass we send to /dev/null
-+ # in case the user has swap points setup on different partitions. We
-+ # will run swapon again in localmount and that one will report errors.
- ebegin "Activating (possible) swap"
-- /sbin/swapon -a
-+ /sbin/swapon -a >& /dev/null
- eend 0
-
- # Set the console loglevel to 1 for a cleaner boot
+++ /dev/null
-A small patch to work around cases where people did not properly `etc-update`.
-This is not meant to be kept around for long, just to ease stable upgrades.
-
-This should be dropped once we've been stable for a while.
-
---- sbin/functions.sh
-+++ sbin/functions.sh
-@@ -681,7 +681,7 @@
- start_volumes() {
- local x=
-
-- for x in ${RC_VOLUME_ORDER}; do
-+ for x in ${RC_VOLUME_ORDER-raid evms lvm dm}; do
- start_addon "${x}"
- done
-
-@@ -705,7 +705,7 @@
- stop_volumes() {
- local x=
-
-- for x in $(reverse_list ${RC_VOLUME_ORDER}); do
-+ for x in $(reverse_list ${RC_VOLUME_ORDER-raid evms lvm dm}); do
- stop_addon "${x}"
- done
-
+++ /dev/null
-diff -Naur rc-scripts-1.4.3.13p1.orig/src/runscript.c rc-scripts-1.4.3.13p1/src/runscript.c
---- rc-scripts-1.4.3.13p1.orig/src/runscript.c 2004-02-09 13:40:44.000000000 -0500
-+++ rc-scripts-1.4.3.13p1/src/runscript.c 2004-02-27 09:17:06.000000000 -0500
-@@ -16,9 +16,9 @@
-
- int main(int argc, char **argv) {
- char *myargs[32];
-+ void *lib_handle;
- int new = 1;
- myargs[0] = "runscript";
-- void *lib_handle;
-
- /* if (argc < 3)
- exit(1);
+++ /dev/null
-MD5 674a1585df45a6a7a5aed7a50e520422 rc-scripts-1.6.11.tar.bz2 159309
+++ /dev/null
-MD5 9c1c54759b484145d81ee614a4e4c71e rc-scripts-1.6.12.tar.bz2 156571
+++ /dev/null
-MD5 0ec4cdbd7d430e1fdf82840a083863ff rc-scripts-1.6.13.tar.bz2 156148
+++ /dev/null
-MD5 6ae4a8237a7e298097239e76eb7aff60 sysvinit-2.84.tar.gz 91488
-MD5 50a4484b06a87dce5e69b49da8715ed5 rc-scripts-1.4.16.tar.bz2 110599
+++ /dev/null
-MD5 6ae4a8237a7e298097239e76eb7aff60 sysvinit-2.84.tar.gz 91488
-MD5 50a4484b06a87dce5e69b49da8715ed5 rc-scripts-1.4.16.tar.bz2 110599
+++ /dev/null
-diff -Naur rc-scripts-1.4.16/sbin/functions.sh rc-scripts-1.4.16-splash/sbin/functions.sh
---- rc-scripts-1.4.16/sbin/functions.sh 2004-05-21 17:22:12.000000000 +0200
-+++ rc-scripts-1.4.16-splash/sbin/functions.sh 2004-10-13 22:55:09.272082704 +0200
-@@ -41,6 +41,17 @@
- # Override defaults with user settings ...
- [ -f /etc/conf.d/rc ] && source /etc/conf.d/rc
-
-+# void splash(...)
-+#
-+# Notify bootsplash/splashutils/gensplash/whatever about
-+# important events.
-+#
-+splash() {
-+ return 0
-+}
-+
-+# This will override the splash() function...
-+[ -f /sbin/splash-functions.sh ] && source /sbin/splash-functions.sh
-
- # void get_bootconfig()
- #
-@@ -114,213 +125,6 @@
- return 0
- }
-
--#
--# void splash_init (void)
--#
--splash_init() {
-- pb_init=0
-- pb_count=0
-- pb_scripts=0
-- pb_rate=0
--
-- if [ ! -x /sbin/splash ] || \
-- [ -e /proc/version -a ! -e /proc/splash ]
-- then
-- return 0
-- fi
--
-- if [ -f /etc/conf.d/bootsplash.conf ]
-- then
-- . /etc/conf.d/bootsplash.conf
-- if [ -n "${PROGRESS_SYSINIT_RATE}" ]
-- then
-- rate=$((65535*${PROGRESS_SYSINIT_RATE}/100))
-- fi
-- fi
--
-- if [ "${RUNLEVEL}" = "S" ]
-- then
-- pb_scripts=5
-- pb_rate=16383
-- [ -n "${rate}" ] && pb_rate="${rate}"
-- fi
--
-- export pb_init pb_count pb_scripts pb_rate
--}
--
--#
--# void splash_calc (void)
--#
--splash_calc() {
-- pb_runs=($(dolisting "/etc/runlevels/${SOFTLEVEL}/"))
-- pb_runb=($(dolisting "/etc/runlevels/${BOOTLEVEL}/"))
-- pb_scripts=${#pb_runs[*]}
-- pb_boot=${#pb_runb[*]}
--
-- [ ! -e /proc/splash -o ! -x /sbin/splash ] && return 0
--
-- if [ -f /etc/conf.d/bootsplash.conf ]
-- then
-- . /etc/conf.d/bootsplash.conf
--
-- if [ -n "${PROGRESS_SYSINIT_RATE}" ]
-- then
-- init_rate=$((65535*${PROGRESS_SYSINIT_RATE}/100))
-- fi
--
-- if [ -n "${PROGRESS_BOOT_RATE}" ]
-- then
-- boot_rate=$((65535*${PROGRESS_BOOT_RATE}/100))
-- fi
-- fi
--
-- # In runlevel boot we have 5 already started scripts
-- #
-- if [ "${RUNLEVEL}" = "S" -a "${SOFTLEVEL}" = "boot" ]
-- then
-- pb_started=($(dolisting "${svcdir}/started/"))
-- pb_scripts=$((${pb_boot} - ${#pb_started[*]}))
-- pb_init=16383
-- pb_rate=26213
-- pb_count=0
-- if [ -n "${init_rate}" -a -n "${boot_rate}" ]
-- then
-- pb_init="${init_rate}"
-- pb_rate=$((${init_rate} + ${boot_rate}))
-- fi
-- elif [ "${SOFTLEVEL}" = "reboot" -o "${SOFTLEVEL}" = "shutdown" ]
-- then
-- pb_started=($(dolisting "${svcdir}/started/"))
-- pb_scripts=${#pb_started[*]}
-- pb_rate=65534
-- else
-- pb_init=26213
-- pb_rate=65534
-- if [ -n "${init_rate}" -a -n "${boot_rate}" ]
-- then
-- pb_init=$((${init_rate} + ${boot_rate}))
-- fi
-- fi
--
-- echo "pb_init=${pb_init}" > "${svcdir}/progress"
-- echo "pb_rate=${pb_rate}" >> "${svcdir}/progress"
-- echo "pb_count=${pb_count}" >> "${svcdir}/progress"
-- echo "pb_scripts=${pb_scripts}" >> "${svcdir}/progress"
--}
--
--#
--# void splash_update (char *fsstate, char *myscript, char *action)
--#
--splash_update() {
-- local fsstate="$1"
-- local myscript="$2"
-- local action="$3"
--
-- [ ! -e /proc/splash -o ! -x /sbin/splash ] && return 0
--
-- if [ "${fsstate}" = "inline" ]
-- then
-- /sbin/splash "${myscript}" "${action}"
-- pb_count=$((${pb_count} + 1))
--
-- # Only needed for splash_debug()
-- pb_execed="${pb_execed} ${myscript:-inline}"
-- else
-- # Update only runlevel scripts, no dependancies (only true for startup)
-- if [ ! -L "${svcdir}/softscripts/${myscript}" ]
-- then
-- [ "${SOFTLEVEL}" != "reboot" -a \
-- "${SOFTLEVEL}" != "shutdown" ] && return
-- fi
-- # Source the current progress bar state
-- [ -f "${svcdir}/progress" ] && source "${svcdir}/progress"
--
-- # Do not update an already executed script
-- for x in ${pb_execed}
-- do
-- [ "${x}" = "${myscript}" ] && return
-- done
--
-- /sbin/splash "${myscript}" "${action}"
-- pb_count=$((${pb_count} + 1))
--
-- echo "pb_init=${pb_init}" > "${svcdir}/progress"
-- echo "pb_rate=${pb_rate}" >> "${svcdir}/progress"
-- echo "pb_count=${pb_count}" >> "${svcdir}/progress"
-- echo "pb_scripts=${pb_scripts}" >> "${svcdir}/progress"
-- echo "pb_execed=\"${pb_execed} ${myscript}\"" >> "${svcdir}/progress"
-- fi
--}
--
--#
--# void splash_debug (char *softlevel)
--#
--splash_debug() {
-- local softlevel="$1"
--
-- [ ! -e /proc/splash -o ! -x /sbin/splash ] && return 0
--
-- if [ -f /etc/conf.d/bootsplash.conf ]
-- then
-- source /etc/conf.d/bootsplash.conf
--
-- [ "${BOOTSPLASH_DEBUG}" = "yes" -a -n "${softlevel}" ] || return
--
-- if [ -f "${svcdir}/progress" ]
-- then
-- cat "${svcdir}/progress" > "/var/log/bootsplash.${softlevel}"
-- else
-- echo "pb_init=${pb_init}" > "/var/log/bootsplash.${softlevel}"
-- echo "pb_rate=${pb_rate}" >> "/var/log/bootsplash.${softlevel}"
-- echo "pb_count=${pb_count}" >> "/var/log/bootsplash.${softlevel}"
-- echo "pb_scripts=${pb_scripts}" >> "/var/log/bootsplash.${softlevel}"
-- echo "pb_execed=\"${pb_execed}\"" >> "/var/log/bootsplash.${softlevel}"
-- fi
-- fi
--}
--
--update_splash_wrappers() {
-- if [ -x /sbin/splash ] && \
-- ([ ! -e /proc/version ] || \
-- [ -e /proc/version -a -e /proc/splash ])
-- then
-- rc_splash() {
-- /sbin/splash $*
-- }
-- rc_splash_init() {
-- splash_init $*
-- }
-- rc_splash_calc() {
-- splash_calc $*
-- }
-- rc_splash_update() {
-- splash_update $*
-- }
-- rc_splash_debug() {
-- splash_debug $*
-- }
-- else
-- rc_splash() {
-- return 0
-- }
-- rc_splash_init() {
-- return 0
-- }
-- rc_splash_calc() {
-- return 0
-- }
-- rc_splash_update() {
-- return 0
-- }
-- rc_splash_debug() {
-- return 0
-- }
-- fi
--
-- export rc_splash rc_splash_init rc_splash_calc \
-- rc_splash_update rc_splash_debug
--}
--
- # void esyslog(char* priority, char* tag, char* message)
- #
- # use the system logger to log a message
-@@ -769,7 +573,6 @@
- setup_defaultlevels
- fi
-
-- update_splash_wrappers
- else
- # Should we use colors ?
- if [ "${*/depend}" = "$*" ]
-diff -Naur rc-scripts-1.4.16/sbin/rc rc-scripts-1.4.16-splash/sbin/rc
---- rc-scripts-1.4.16/sbin/rc 2004-04-26 00:31:48.000000000 +0200
-+++ rc-scripts-1.4.16-splash/sbin/rc 2004-10-13 22:47:57.094783640 +0200
-@@ -22,13 +22,7 @@
- retval=$?
- if [ "${retval}" -ne 0 ]
- then
-- # Progressbar begin
-- if [ -c /dev/null ]; then
-- rc_splash "stop" &>/dev/null &
-- else
-- rc_splash "stop" &
-- fi
-- # Progressbar end
-+ splash "critical" &
-
- echo -e "${ENDCOL}${NORMAL}[${BAD} oops ${NORMAL}]"
- echo
-@@ -60,6 +54,7 @@
- then
- if ! mkdir -p "$1" &>/dev/null
- then
-+ splash "critical" &
- echo
- eerror "For Gentoo Linux to function properly, \"$1\" need to exist."
- eerror "Please mount your root partition read/write, and execute:"
-@@ -119,10 +114,6 @@
- # Save $1
- argv1="$1"
-
--# Progressbar begin
--rc_splash_init
--# Progressbar end
--
- # First time boot stuff goes here. Note that 'sysinit' is an internal runlevel
- # used to bring up local filesystems, and should not be started with /sbin/rc
- # directly ...
-@@ -282,12 +273,6 @@
- fi
- fi
-
-- # Update splash wrappers.
-- update_splash_wrappers
-- # Progressbar begin
-- rc_splash "text"
-- # Progressbar end
--
- if [ -x /sbin/irqbalance -a "$(get_KV)" -ge "$(KV_to_int '2.5.0')" ]
- then
- ebegin "Starting irqbalance"
-@@ -366,20 +351,17 @@
- # defaults.
- get_critical_services
-
-+ splash "rc_init" "${argv1}"
-+
- # We do not want to break compatibility, so we do not fully integrate
- # these into /sbin/rc, but rather start them by hand ...
- for x in ${CRITICAL_SERVICES}
- do
-- # Progressbar begin
-- rc_splash_update "inline" "${x}" "start"
-- # Progressbar end
-+ splash "svc_start" "${x}"
-
- if ! start_critical_service "${x}"
- then
-- # Progressbar begin
-- rc_splash "stop" &> /dev/null &
-- # Progressbar end
--
-+ splash "critical" &> /dev/null &
- echo
- eerror "One of more critical startup scripts failed to start!"
- eerror "Please correct this, and reboot ..."
-@@ -390,7 +372,10 @@
- einfo "Rebooting"
- /sbin/reboot -f
- fi
-+
-+ splash "svc_started" "${x}" "0"
- done
-+
- # Check that $svcdir exists ...
- check_statedir "${svcdir}"
-
-@@ -426,19 +411,10 @@
- mark_service_started "${x}"
- done
- )
--fi # Sysinit ends here
--
--# Update splash wrappers.
--update_splash_wrappers
--
--if [ "${RUNLEVEL}" = "S" -a "${argv1}" = "sysinit" ]
--then
-- # Progressbar begin
-- rc_splash_debug "${argv1}"
-- # Progressbar end
- exit 0
-+fi # Sysinit ends here
-
--elif [ "${RUNLEVEL}" = "S" -a "${argv1}" = "boot" ]
-+if [ "${RUNLEVEL}" = "S" -a "${argv1}" = "boot" ]
- then
- setup_defaultlevels
-
-@@ -492,10 +468,6 @@
- echo "${SOFTLEVEL}" > "${svcdir}/softlevel"
- fi
-
--# Progressbar begin
--rc_splash_calc
--# Progressbar end
--
- # For keeping a list of services that fails during boot/halt
- if [ ! -d "${svcdir}/failed" ]
- then
-@@ -504,6 +476,8 @@
- rm -rf "${svcdir}"/failed/*
- fi
-
-+splash "rc_init" "${argv1}"
-+
- if [ "${SOFTLEVEL}" = "reboot" -o "${SOFTLEVEL}" = "shutdown" ]
- then
- myscripts=
-@@ -686,10 +660,6 @@
- if [ "${SOFTLEVEL}" = "reboot" -o "${SOFTLEVEL}" = "shutdown" ]
- then
- source /sbin/functions.sh
--
-- # Progressbar begin
-- rc_splash_debug "${SOFTLEVEL}"
-- # Progressbar end
-
- # Make sure that our $svcdir are clean for next reboot ...
- rm -rf "${svcdir}"/*
-@@ -776,9 +746,6 @@
- # If we were in the boot runlevel, it is done now ...
- [ -n "${BOOT}" ] && unset BOOT
-
--# Progressbar begin
--rc_splash_debug "${SOFTLEVEL}"
--# Progressbar end
--
-+splash "rc_exit"
-
- # vim:ts=4
-diff -Naur rc-scripts-1.4.16/sbin/rc-services.sh rc-scripts-1.4.16-splash/sbin/rc-services.sh
---- rc-scripts-1.4.16/sbin/rc-services.sh 2004-05-04 04:36:12.000000000 +0200
-+++ rc-scripts-1.4.16-splash/sbin/rc-services.sh 2004-10-13 22:50:54.664788896 +0200
-@@ -402,17 +402,22 @@
- # Start 'service' if it is not already running.
- #
- start_service() {
-- [ -z "$1" ] && return 1
-+ local retval=0
-
-+ [ -z "$1" ] && return 1
-+
- if ! service_started "$1"
- then
-+ splash "svc_start" "$1"
- if is_fake_service "$1" "${SOFTLEVEL}"
- then
- mark_service_started "$1"
-+ splash "svc_started" "$1" "0"
- else
- (. /sbin/runscript.sh "/etc/init.d/$1" start)
--
-- return $?
-+ retval="$?"
-+ splash "svc_started" "$1" "${retval}"
-+ return "${retval}"
- fi
- fi
-
-@@ -424,30 +429,34 @@
- # Stop 'service' if it is not already running.
- #
- stop_service() {
-+ local retval=0
- [ -z "$1" ] && return 1
-
- if service_started "$1"
- then
-+ splash "svc_stop" "$1"
-+
- if is_runlevel_stop
- then
- if is_fake_service "$1" "${OLDSOFTLEVEL}"
- then
- mark_service_stopped "$1"
--
-+ splash "svc_stopped" "$1" "0"
- return 0
- fi
- else
- if is_fake_service "$1" "${SOFTLEVEL}"
- then
- mark_service_stopped "$1"
--
-+ splash "svc_stopped" "$1" "0"
- return 0
- fi
- fi
-
- (. /sbin/runscript.sh "/etc/init.d/$1" stop)
--
-- return $?
-+ retval="$?"
-+ splash "svc_stopped" "$1" "${retval}"
-+ return "${retval}"
- fi
-
- return 0
-diff -Naur rc-scripts-1.4.16/sbin/runscript.sh rc-scripts-1.4.16-splash/sbin/runscript.sh
---- rc-scripts-1.4.16/sbin/runscript.sh 2004-05-05 23:11:31.000000000 +0200
-+++ rc-scripts-1.4.16-splash/sbin/runscript.sh 2004-10-13 22:51:31.221231472 +0200
-@@ -453,11 +453,9 @@
- case "${arg}" in
- stop)
- svc_stop
-- rc_splash_update "live" "${myservice}" "stop"
- ;;
- start)
- svc_start
-- rc_splash_update "live" "${myservice}" "start"
- ;;
- needsme|ineed|usesme|iuse|broken)
- list_depend_trace "${arg}"
+++ /dev/null
-Index: init.d/checkfs
-===================================================================
-RCS file: /var/cvsroot/gentoo-src/rc-scripts/init.d/checkfs,v
-retrieving revision 1.43
-diff -u -r1.43 checkfs
---- init.d/checkfs
-+++ init.d/checkfs
-@@ -149,7 +149,7 @@
- # to /etc/modules.autoload if needed
-
- if [[ -z ${CDBOOT} && -x /sbin/vgscan ]] && \
-- [[ -d /proc/lvm || -n $(grep -qo device-mapper /proc/misc) ]]
-+ [[ -d /proc/lvm || -n $(grep -o device-mapper /proc/misc) ]]
- then
- ebegin "Setting up the Logical Volume Manager"
- #still echo stderr for debugging
+++ /dev/null
-Index: init.d/domainname
-===================================================================
-RCS file: /var/cvsroot/gentoo-src/rc-scripts/init.d/domainname,v
-retrieving revision 1.8.4.1
-diff -U0 -r1.8.4.1 domainname
---- init.d/domainname
-+++ init.d/domainname
-@@ -50 +50 @@
-- && resolv=${resolv}"$'\n'"domain ${DNSDOMAIN} \
-+ && resolv="${resolv}"$'\n'"domain ${DNSDOMAIN}" \
+++ /dev/null
---- lib/rcscripts/net.modules.d/ifconfig
-+++ lib/rcscripts/net.modules.d/ifconfig
-@@ -317,7 +317,6 @@
- config=( "${config[@]//peer/pointtopoint}" )
- fi
-
-- ewarn "ifconfig ${iface} ${config[@]}"
- ifconfig ${iface} ${config[@]} &>${devnull}
- eend $?
- return $?
+++ /dev/null
---- sysvinit-2.85/src/init.c.selinux 2003-11-10 14:56:40.687719862 -0500
-+++ sysvinit-2.85/src/init.c 2003-11-10 14:56:55.856964055 -0500
-@@ -78,6 +78,78 @@
- sigemptyset(&sa.sa_mask); \
- sigaction(sig, &sa, NULL); \
- } while(0)
-+#ifdef WITH_SELINUX
-+#include <sys/mman.h>
-+#include <selinux/selinux.h>
-+#include <sys/mount.h>
-+
-+static int load_policy(int *enforce)
-+{
-+ int fd=-1,ret=-1;
-+ int rc=0;
-+ struct stat sb;
-+ void *map;
-+ char policy_file[PATH_MAX];
-+ int policy_version=0;
-+
-+ log(L_VB, "Loading security policy\n");
-+ if (mount("none", SELINUXMNT, "selinuxfs", 0, 0) < 0) {
-+ if (errno == ENODEV) {
-+ log(L_VB, "SELinux not supported by kernel: %s\n",SELINUXMNT,strerror(errno));
-+ }
-+ else {
-+ log(L_VB, "Failed to mount %s: %s\n",SELINUXMNT,strerror(errno));
-+ return ret;
-+ }
-+ return ret; /* Never gets here */
-+ }
-+
-+ policy_version=security_policyvers();
-+ if (policy_version < 0) {
-+ log(L_VB, "Can't get policy version: %s\n", strerror(errno));
-+ goto UMOUNT;
-+ }
-+
-+ rc=security_getenforce();
-+ if (rc < 0) {
-+ log(L_VB, "Can't get SELinux enforcement flag: %s\n", strerror(errno));
-+ goto UMOUNT;
-+ }
-+ *enforce=rc;
-+
-+ snprintf(policy_file,sizeof(policy_file),"%s.%d",SELINUXPOLICY,policy_version);
-+ fd = open(policy_file, O_RDONLY);
-+ if (fd < 0) {
-+ log(L_VB, "Can't open '%s': %s\n",
-+ policy_file, strerror(errno));
-+ goto UMOUNT;
-+ }
-+
-+ if (fstat(fd, &sb) < 0) {
-+ log(L_VB, "Can't stat '%s': %s\n",
-+ policy_file, strerror(errno));
-+ goto UMOUNT;
-+ }
-+
-+ map = mmap(NULL, sb.st_size, PROT_READ, MAP_SHARED, fd, 0);
-+ if (map == MAP_FAILED) {
-+ log(L_VB, "Can't map '%s': %s\n",
-+ policy_file, strerror(errno));
-+ goto UMOUNT;
-+ }
-+ ret=security_load_policy(map, sb.st_size);
-+ if (ret < 0) {
-+ log(L_VB, "security_load_policy failed\n");
-+ }
-+
-+ UMOUNT:
-+ umount(SELINUXMNT);
-+ if ( fd >= 0) {
-+ close(fd);
-+ }
-+ return(ret);
-+}
-+#endif
-
- /* Version information */
- char *Version = "@(#) init " VERSION " " DATE " miquels@cistron.nl";
-@@ -2576,6 +2648,20 @@
- maxproclen += strlen(argv[f]) + 1;
- }
-
-+#ifdef WITH_SELINUX
-+ if (getenv("SELINUX_INIT") == NULL) {
-+ putenv("SELINUX_INIT=YES");
-+ int enforce=0;
-+ if (load_policy(&enforce) == 0 ) {
-+ execv(myname, argv);
-+ } else {
-+ if (enforce)
-+ /* SELinux in enforcing mode but load_policy failed */
-+ exit(1);
-+ }
-+ }
-+#endif
-+
- /* Start booting. */
- argv0 = argv[0];
- argv[1] = NULL;
---- sysvinit-2.85/src/Makefile.selinux 2003-11-10 14:56:40.430749605 -0500
-+++ sysvinit-2.85/src/Makefile 2003-11-10 14:56:40.725715464 -0500
-@@ -32,7 +32,7 @@
- all: $(PROGS)
-
- init: init.o init_utmp.o
-- $(CC) $(LDFLAGS) $(STATIC) -o $@ init.o init_utmp.o
-+ $(CC) $(LDFLAGS) $(STATIC) -o $@ init.o init_utmp.o -lselinux
-
- halt: halt.o ifdown.o hddown.o utmp.o reboot.h
- $(CC) $(LDFLAGS) -o $@ halt.o ifdown.o hddown.o utmp.o
-@@ -62,7 +62,7 @@
- $(CC) $(LDFLAGS) -o $@ bootlogd.o
-
- init.o: init.c init.h set.h reboot.h
-- $(CC) -c $(CFLAGS) init.c
-+ $(CC) -c $(CFLAGS) -DWITH_SELINUX init.c
-
- utmp.o: utmp.c init.h
- $(CC) -c $(CFLAGS) utmp.c
+++ /dev/null
---- sysvinit-2.85/src/init.c.selinux 2004-02-10 14:34:18.454593535 -0500
-+++ sysvinit-2.85/src/init.c 2004-02-10 14:37:27.947014932 -0500
-@@ -78,6 +78,87 @@
- sigemptyset(&sa.sa_mask); \
- sigaction(sig, &sa, NULL); \
- } while(0)
-+#ifdef WITH_SELINUX
-+#include <sys/mman.h>
-+#include <selinux/selinux.h>
-+#include <sys/mount.h>
-+
-+static int load_policy(int *enforce)
-+{
-+ int fd=-1,ret=-1;
-+ int rc=0;
-+ struct stat sb;
-+ void *map;
-+ char policy_file[PATH_MAX];
-+ int policy_version=0;
-+ extern char *selinux_mnt;
-+
-+ log(L_VB, "Loading security policy\n");
-+ if (mount("none", "/selinux/", "selinuxfs", 0, 0) < 0) {
-+ if (errno == ENODEV) {
-+ log(L_VB, "SELinux not supported by kernel: %s\n","/selinux/",strerror(errno));
-+ }
-+ else {
-+ log(L_VB, "Failed to mount %s: %s\n","/selinux/",strerror(errno));
-+ return ret;
-+ }
-+ return ret; /* Never gets here */
-+ }
-+
-+ selinux_mnt = "/selinux/"; /* set manually since we mounted it */
-+
-+ policy_version=security_policyvers();
-+ if (policy_version < 0) {
-+ log(L_VB, "Can't get policy version: %s\n", strerror(errno));
-+ goto UMOUNT;
-+ }
-+
-+ rc=security_getenforce();
-+ if (rc < 0) {
-+ log(L_VB, "Can't get SELinux enforcement flag: %s\n", strerror(errno));
-+ goto UMOUNT;
-+ }
-+ *enforce=rc;
-+
-+ snprintf(policy_file,sizeof(policy_file),"%s.%d","/etc/security/selinux/policy",policy_version);
-+ fd = open(policy_file, O_RDONLY);
-+ if (fd < 0) {
-+ /* Check previous version to see if old policy is available
-+ */
-+ snprintf(policy_file,sizeof(policy_file),"%s.%d","/etc/security/selinux/policy",policy_version-1);
-+ fd = open(policy_file, O_RDONLY);
-+ if (fd < 0) {
-+ log(L_VB, "Can't open '%s.%d': %s\n",
-+ "/etc/security/selinux/policy",policy_version,strerror(errno));
-+ goto UMOUNT;
-+ }
-+ }
-+
-+ if (fstat(fd, &sb) < 0) {
-+ log(L_VB, "Can't stat '%s': %s\n",
-+ policy_file, strerror(errno));
-+ goto UMOUNT;
-+ }
-+
-+ map = mmap(NULL, sb.st_size, PROT_READ, MAP_SHARED, fd, 0);
-+ if (map == MAP_FAILED) {
-+ log(L_VB, "Can't map '%s': %s\n",
-+ policy_file, strerror(errno));
-+ goto UMOUNT;
-+ }
-+ ret=security_load_policy(map, sb.st_size);
-+ if (ret < 0) {
-+ log(L_VB, "security_load_policy failed\n");
-+ }
-+
-+ UMOUNT:
-+ /*umount("/selinux/"); */
-+ if ( fd >= 0) {
-+ close(fd);
-+ }
-+ return(ret);
-+}
-+#endif
-
- /* Version information */
- char *Version = "@(#) init " VERSION " " DATE " miquels@cistron.nl";
-@@ -2576,6 +2657,20 @@
- maxproclen += strlen(argv[f]) + 1;
- }
-
-+#ifdef WITH_SELINUX
-+ if (getenv("SELINUX_INIT") == NULL) {
-+ putenv("SELINUX_INIT=YES");
-+ int enforce=0;
-+ if (load_policy(&enforce) == 0 ) {
-+ execv(myname, argv);
-+ } else {
-+ if (enforce)
-+ /* SELinux in enforcing mode but load_policy failed */
-+ exit(1);
-+ }
-+ }
-+#endif
-+
- /* Start booting. */
- argv0 = argv[0];
- argv[1] = NULL;
---- sysvinit-2.85/src/Makefile.selinux 2004-02-10 14:34:18.413598203 -0500
-+++ sysvinit-2.85/src/Makefile 2004-02-10 14:34:18.552582377 -0500
-@@ -32,7 +32,7 @@
- all: $(PROGS)
-
- init: init.o init_utmp.o
-- $(CC) $(LDFLAGS) $(STATIC) -o $@ init.o init_utmp.o
-+ $(CC) $(LDFLAGS) $(STATIC) -o $@ init.o init_utmp.o -lselinux
-
- halt: halt.o ifdown.o hddown.o utmp.o reboot.h
- $(CC) $(LDFLAGS) -o $@ halt.o ifdown.o hddown.o utmp.o
-@@ -62,7 +62,7 @@
- $(CC) $(LDFLAGS) -o $@ bootlogd.o
-
- init.o: init.c init.h set.h reboot.h
-- $(CC) -c $(CFLAGS) init.c
-+ $(CC) -c $(CFLAGS) -DWITH_SELINUX init.c
-
- utmp.o: utmp.c init.h
- $(CC) -c $(CFLAGS) utmp.c