From: John P. Davis Date: Thu, 10 Jun 2004 15:55:11 +0000 (+0000) Subject: code for livecd rc stuff X-Git-Tag: CATALYST_2_0_6_916~983 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=7a5d8fad952053add7069b92e7a2db93e50c7581;p=catalyst.git code for livecd rc stuff git-svn-id: svn+ssh://svn.gentoo.org/var/svnroot/catalyst/trunk@390 d1e1f19c-881f-0410-ab34-b69fee027534 --- diff --git a/ChangeLog b/ChangeLog index edc4d329..4a23849a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,6 +1,16 @@ # ChangeLog for gentoo/src/catalyst # Copyright 2002-2004 Gentoo Technologies, Inc.; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo/src/catalyst/ChangeLog,v 1.60 2004/06/08 04:07:34 zhen Exp $ +# $Header: /var/cvsroot/gentoo/src/catalyst/ChangeLog,v 1.61 2004/06/10 15:55:11 zhen Exp $ + + 10 Jun 2004; John Davis + livecd/runscript-support/kmerge.sh, + livecd/runscript-support/livecdfs-update.sh, + livecd/runscript-support/post-kmerge.sh, + livecd/runscript-support/pre-kmerge.sh: + two new functions for livecd-stage2: livecd/rcadd and livecd/rcdel. these two + functions control what scripts are added to their respective runlevels. This + option would be specified like so in the spec file: livecd/rcadd: + metalog:default foo:boot. the syntax is the same for livecd/rcdel. 08 Jun 2004; John Davis modules/builder.py, modules/catalyst_support.py, modules/livecd_stage2_target.py: diff --git a/livecd/runscript-support/kmerge.sh b/livecd/runscript-support/kmerge.sh index 3fe4be9d..b71647cc 100755 --- a/livecd/runscript-support/kmerge.sh +++ b/livecd/runscript-support/kmerge.sh @@ -1,7 +1,7 @@ #!/bin/bash # Copyright 1999-2004 Gentoo Technologies, Inc. # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo/src/catalyst/livecd/runscript-support/Attic/kmerge.sh,v 1.5 2004/05/22 05:51:06 zhen Exp $ +# $Header: /var/cvsroot/gentoo/src/catalyst/livecd/runscript-support/Attic/kmerge.sh,v 1.6 2004/06/10 15:55:11 zhen Exp $ die() { echo "$1" @@ -20,13 +20,13 @@ rm -f /usr/src/linux rm /etc/localtime ln -s /usr/share/zoneinfo/UTC /etc/localtime -[ -e /var/tmp/${clst_kname}.use ] && export USE="$( cat /var/tmp/${clst_kname}.use )" || unset USE -[ -e /var/tmp/${clst_kname}.gk_kernargs ] && source /var/tmp/${clst_kname}.gk_kernargs +[ -e "/var/tmp/${clst_kname}.use" ] && export USE="$( cat /var/tmp/${clst_kname}.use )" || unset USE +[ -e "/var/tmp/${clst_kname}.gk_kernargs" ] && source /var/tmp/${clst_kname}.gk_kernargs # Don't use pkgcache here, as the kernel source may get emerge with different USE variables # (and thus different patches enabled/disabled.) Also, there's no real benefit in using the # pkgcache for kernel source ebuilds. -emerge ${clst_ksource} || exit 1 +emerge "${clst_ksource}" || exit 1 [ ! -e /usr/src/linux ] && die "Can't find required directory /usr/src/linux" #if catalyst has set NULL_VALUE, extraversion wasn't specified so we skip this part @@ -57,7 +57,7 @@ fi ${genkernel} #now we merge any kernel-dependent packages -if [ -e /var/tmp/${clst_kname}.packages ] +if [ -e "/var/tmp/${clst_kname}.packages" ] then for x in $( cat /var/tmp/${clst_kname}.packages ) do diff --git a/livecd/runscript-support/livecdfs-update.sh b/livecd/runscript-support/livecdfs-update.sh index ce558a41..08147ab9 100755 --- a/livecd/runscript-support/livecdfs-update.sh +++ b/livecd/runscript-support/livecdfs-update.sh @@ -1,7 +1,7 @@ #!/bin/bash # Copyright 1999-2004 Gentoo Technologies, Inc. # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo/src/catalyst/livecd/runscript-support/Attic/livecdfs-update.sh,v 1.4 2004/06/04 14:24:53 zhen Exp $ +# $Header: /var/cvsroot/gentoo/src/catalyst/livecd/runscript-support/Attic/livecdfs-update.sh,v 1.5 2004/06/10 15:55:11 zhen Exp $ /usr/sbin/env-update source /etc/profile @@ -9,23 +9,44 @@ source /etc/profile if [ -e /etc/sshd/sshd_config ] then #allow root logins to the livecd by default - sed -e "s/^#PermitRootLogin\ yes/PermitRootLogin\ yes/" /etc/ssh/sshd_config > /etc/ssh/sshd_config1 - mv /etc/ssh/sshd_config1 /etc/ssh/sshd_config + sed -i "s/^#PermitRootLogin\ yes/PermitRootLogin\ yes/" /etc/ssh/sshd_config + #mv /etc/ssh/sshd_config1 /etc/ssh/sshd_config fi # fix /etc/issue for mingetty and friends echo "This is \n.gentoo (\s \m \r) \t" > /etc/issue - -rc-update del iptables default -rc-update del netmount default -#rc-update add hotplug default -#rc-update add kudzu default -rc-update add autoconfig default -rc-update del keymaps -rc-update del consolefont -rc-update add metalog default -rc-update add modules default -[ -e /etc/init.d/bootsplash ] && rc-update add bootsplash default + +if [ -n "${clst_livecd_rcadd}" ] || [ -n "${clst_livecd_rcdel}" ] +then + if [ -n "${clst_livecd_rcadd}" ] + then + for x in ${clst_livecd_rcadd} + do + rc-update add "${x%%:*}" "${x##*:}" + done + fi + + if [ -n "${clst_livecd_rcdel}" ] + then + for x in ${clst_livecd_rcdel} + do + rc-update del "${x%%:*}" "${x##*:}" + done + fi + +else + # use the defaults if nothing else is specified + rc-update del iptables default + rc-update del netmount default + #rc-update add hotplug default + #rc-update add kudzu default + rc-update add autoconfig default + rc-update del keymaps + rc-update del consolefont + rc-update add metalog default + rc-update add modules default + [ -e /etc/init.d/bootsplash ] && rc-update add bootsplash default +fi rm -rf /etc/localtime cp /usr/share/zoneinfo/GMT /etc/localtime @@ -62,14 +83,15 @@ then fi # setup bootsplash (if called for) -if [ -n ${clst_livecd_bootsplash} ] +if [ -n "${clst_livecd_bootsplash}" ] then - if [ -d /etc/bootsplash/${clst_livecd_bootsplash} ] + if [ -d "/etc/bootsplash/${clst_livecd_bootsplash}" ] then sed -i 's/BOOTSPLASH_THEME=\"gentoo\"/\"${clst_livecd_bootsplash}\"/' /etc/conf.d/bootsplash rm /etc/bootsplash/default - ln -s /etc/bootsplash/${clst_livecd_bootsplash} /etc/bootsplash/default + ln -s "/etc/bootsplash/${clst_livecd_bootsplash}" /etc/bootsplash/default else + echo "Error, cannot setup bootsplash theme ${clst_livecd_bootsplash}" exit 1 fi fi diff --git a/livecd/runscript-support/post-kmerge.sh b/livecd/runscript-support/post-kmerge.sh index 22d28f59..b067c1af 100755 --- a/livecd/runscript-support/post-kmerge.sh +++ b/livecd/runscript-support/post-kmerge.sh @@ -1,7 +1,7 @@ #!/bin/bash # Copyright 1999-2004 Gentoo Technologies, Inc. # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo/src/catalyst/livecd/runscript-support/Attic/post-kmerge.sh,v 1.1 2004/05/12 21:18:50 zhen Exp $ +# $Header: /var/cvsroot/gentoo/src/catalyst/livecd/runscript-support/Attic/post-kmerge.sh,v 1.2 2004/06/10 15:55:11 zhen Exp $ /usr/sbin/env-update source /etc/profile diff --git a/livecd/runscript-support/pre-kmerge.sh b/livecd/runscript-support/pre-kmerge.sh index 946d392c..6fadff03 100755 --- a/livecd/runscript-support/pre-kmerge.sh +++ b/livecd/runscript-support/pre-kmerge.sh @@ -1,7 +1,7 @@ #!/bin/bash # Copyright 1999-2004 Gentoo Technologies, Inc. # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo/src/catalyst/livecd/runscript-support/Attic/pre-kmerge.sh,v 1.1 2004/05/12 21:18:50 zhen Exp $ +# $Header: /var/cvsroot/gentoo/src/catalyst/livecd/runscript-support/Attic/pre-kmerge.sh,v 1.2 2004/06/10 15:55:11 zhen Exp $ /usr/sbin/env-update source /etc/profile