diff options
-rw-r--r-- | ChangeLog | 24 | ||||
-rw-r--r-- | ChangeLog.vserver | 4 | ||||
-rwxr-xr-x | sbin/rc-update | 49 | ||||
-rw-r--r-- | src/consoletype.c | 2 |
4 files changed, 56 insertions, 23 deletions
@@ -1,6 +1,30 @@ # ChangeLog for Gentoo System Intialization ("rc") scripts # Copyright 1999-2005 Gentoo Foundation; Distributed under the GPLv2 + 07 Oct 2005; Roy Marples <uberlord@gentoo.org>: + + Fix some vlan/bridge/tap/neplugd/ifplugd interdependencies #107406. + + 06 Oct 2005; Mike Frysinger <vapier@gentoo.org>: + + Tweak clock start/stop display to be clearer about behavior #105681. + + 06 Oct 2005; Roy Marples <uberlord@gentoo.org>: + + Fixup IPv6 documentation and support, #108143. + + 02 Oct 2005; Mike Frysinger <vapier@gentoo.org>: + + Add support for ROOT to rc-update script. + + 01 Oct 2005; Mike Frysinger <vapier@gentoo.org>: + + Add support for running some features of rc-update as non-root. + Patch by RiverRat #107775. + + Drop -a and keep -y from the forced fsck since -a and -y can't be used at + the same time #107812. + 23 Sep 2005; Mike Frysinger <vapier@gentoo.org>: Add a note to conf.d/clock for people who dual boot with Windows. diff --git a/ChangeLog.vserver b/ChangeLog.vserver index ba92b15..6c28ee0 100644 --- a/ChangeLog.vserver +++ b/ChangeLog.vserver @@ -1,6 +1,10 @@ # ChangeLog for Gentoo System Intialization ("rc") scripts # Copyright 1999-2005 Gentoo Foundation; Distributed under the GPLv2 + 07 Oct 2005; Christian Heim <phreak@gentoo.org> src/consoletype.c, ChangeLog, + sbin/rc-update: + Refreshing baselayout-vserver with revision 1560 from baselayout. + 28 Sep 2005; Christian Heim <phreak@gentoo.org> +src/mount: Adding kir's proc mounting utility, which should save us from util-linux and its mass of dependencies. diff --git a/sbin/rc-update b/sbin/rc-update index 62b2d06..90c0b7a 100755 --- a/sbin/rc-update +++ b/sbin/rc-update @@ -1,12 +1,8 @@ #!/bin/bash -# Copyright 1999-2004 Gentoo Foundation +# Copyright 1999-2005 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 source /sbin/functions.sh -if [[ ${EUID} -ne 0 ]] ; then - eerror "$0: must be root." - exit 1 -fi usage() { cat << FOO @@ -40,35 +36,34 @@ add() { local myscript= if [[ $# -lt 3 ]] ; then - eerror "${0}: at least two arguments expected after \"$1\"." + eerror "$0: at least two arguments expected after \"$1\"." exit 1 fi shift myscript="$1" - if [[ ! -e /etc/init.d/${myscript} ]] ; then - eerror "$0: /etc/init.d/${myscript} not found; aborting." + if [[ ! -e ${ROOT}/etc/init.d/${myscript} ]] ; then + eerror "$0: '${ROOT}/etc/init.d/${myscript}' not found; aborting." exit 1 fi shift for x in $* ; do - if [[ ! -e /etc/runlevels/${x} ]] ; then + if [[ ! -e ${ROOT}/etc/runlevels/${x} ]] ; then ewarn "runlevel ${x} not found; skipping" continue fi - if [[ -L /etc/runlevels/${x}/${myscript} ]] ; then + if [[ -L ${ROOT}/etc/runlevels/${x}/${myscript} ]] ; then ewarn "${myscript} already installed in runlevel ${x}; skipping" continue fi - if [[ ! -x /etc/init.d/${myscript} ]] ; then + if [[ ! -x ${ROOT}/etc/init.d/${myscript} ]] ; then ewarn "${myscript} not executable; skipping" continue fi - ln -snf "/etc/init.d/${myscript}" "/etc/runlevels/${x}/${myscript}" + ln -snf "/etc/init.d/${myscript}" "${ROOT}/etc/runlevels/${x}/${myscript}" if [[ $? -ne 0 ]] ; then eerror "$0: failed to add ${myscript} to ${x}." exit 1 fi - regen=1 einfo "${myscript} added to runlevel ${x}" done } @@ -87,15 +82,14 @@ del() { myscript=$1 shift if [[ $# -eq 0 ]] ; then - mylevels=$(cd /etc/runlevels/; ls) + mylevels=$(cd "${ROOT}"/etc/runlevels/; ls) else mylevels="$*" fi remlevels="" for x in ${mylevels} ; do - if [[ -L /etc/runlevels/${x}/${myscript} ]] ; then - regen=1 - rm -f "/etc/runlevels/${x}/${myscript}" + if [[ -L ${ROOT}/etc/runlevels/${x}/${myscript} ]] ; then + rm -f "${ROOT}/etc/runlevels/${x}/${myscript}" remlevels="${remlevels} ${x}" fi done @@ -114,17 +108,17 @@ show() { shift if [[ $# -eq 0 ]] ; then - mylevels=$(cd /etc/runlevels/; ls) + mylevels=$(cd "${ROOT}"/etc/runlevels/; ls) else mylevels="$*" fi - myscripts=$(cd /etc/init.d; ls) + myscripts=$(cd "${ROOT}"/etc/init.d; ls) for x in ${myscripts} ; do if [[ ${x%%.sh} = "${x}" ]] ; then printf "%20s | " ${x:0:19} for y in ${mylevels} ; do - if [[ -L /etc/runlevels/${y}/${x} ]] ; then + if [[ -L ${ROOT}/etc/runlevels/${y}/${x} ]] ; then echo -n "${y} " else printf "%${#y}s " " " @@ -135,18 +129,30 @@ show() { done } +check_is_root() { + if [[ ${EUID} -ne 0 ]] ; then + eerror "$0: must be root." + exit 1 + fi +} + if [[ $# -lt 1 ]] ; then usage exit 1 fi -regen=0 +if [[ -n ${ROOT} ]] ; then + [[ ${ROOT:0-1} == "/" ]] && export ROOT=${ROOT:0:${#ROOT}-1} + einfo "Working with files in root ${ROOT} ..." +fi case "$1" in add|-a) + check_is_root add "$@" ;; del|delete|-d) + check_is_root del "$@" ;; show|-s) @@ -158,5 +164,4 @@ case "$1" in ;; esac - # vim:ts=4 diff --git a/src/consoletype.c b/src/consoletype.c index 5e5c45c..87dbf07 100644 --- a/src/consoletype.c +++ b/src/consoletype.c @@ -16,7 +16,6 @@ int main(int argc, char *argv[]) { - unsigned char twelve = 12; int maj; struct stat sb; @@ -24,6 +23,7 @@ int main(int argc, char *argv[]) maj = major(sb.st_rdev); if (maj != 3 && (maj < 136 || maj > 143)) { #if defined(__linux__) + unsigned char twelve = 12; if (ioctl (0, TIOCLINUX, &twelve) < 0) { printf("serial\n"); return 1; |