From ac71482f8b6821148c5670ddbbb1423d6c53a1ea Mon Sep 17 00:00:00 2001 From: "John P. Davis" Date: Wed, 29 Sep 2004 01:32:51 +0000 Subject: [PATCH] udev support for livecds and a new fsscript example git-svn-id: svn+ssh://svn.gentoo.org/var/svnroot/catalyst/trunk@440 d1e1f19c-881f-0410-ab34-b69fee027534 --- ChangeLog | 8 +++++- TODO | 4 +-- examples/fsscript.sh.example | 7 +++++ examples/livecd-stage2_template.spec | 12 ++++++++ livecd/runscript-support/kmerge.sh | 43 ++++++++++++++++------------ livecd/runscript/x86-archscript.sh | 8 +++++- modules/livecd_stage2_target.py | 4 +-- 7 files changed, 60 insertions(+), 26 deletions(-) create mode 100644 examples/fsscript.sh.example diff --git a/ChangeLog b/ChangeLog index 6f9c3c61..2caa1684 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,6 +1,12 @@ # 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.84 2004/09/16 05:53:50 zhen Exp $ +# $Header: /var/cvsroot/gentoo/src/catalyst/ChangeLog,v 1.85 2004/09/29 01:32:50 zhen Exp $ + + 28 Sep 2004; John Davis TODO, + +examples/fsscript.sh.example, examples/livecd-stage2_template.spec, + livecd/runscript/x86-archscript.sh, livecd/runscript-support/kmerge.sh, + modules/livecd_stage2_target.py: + udev support for livecds 16 Sep 2004; John Davis modules/catalyst_support.py, +targets/livecd-stage2/unmerge.sh: diff --git a/TODO b/TODO index 73ca715c..86e4013c 100644 --- a/TODO +++ b/TODO @@ -1,7 +1,5 @@ # Copyright 1999-2004 Gentoo Technologies, Inc. # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo/src/catalyst/Attic/TODO,v 1.8 2004/07/11 21:31:40 zhen Exp $ - -catalyst man page +# $Header: /var/cvsroot/gentoo/src/catalyst/Attic/TODO,v 1.9 2004/09/29 01:32:50 zhen Exp $ Fix the hardcoded arch information in modules/generic_stage_target.py diff --git a/examples/fsscript.sh.example b/examples/fsscript.sh.example new file mode 100644 index 00000000..1d40cf4b --- /dev/null +++ b/examples/fsscript.sh.example @@ -0,0 +1,7 @@ +#!/bin/bash + +# This is an example fsscript for use with the livecd-stage2 target (key livecd/fsscript) +# Basically, this file is copied to the livecd rootfs at livecd creation time and then run + +# Example, I want to add specific nameservers to the LiveCD's resolv.conf: +echo "192.168.0.1" >> /etc/resolv.conf diff --git a/examples/livecd-stage2_template.spec b/examples/livecd-stage2_template.spec index b70c575f..12c17fb2 100644 --- a/examples/livecd-stage2_template.spec +++ b/examples/livecd-stage2_template.spec @@ -82,6 +82,18 @@ livecd/cdtar: /usr/lib/catalyst/livecd/cdtar/isolinux-2.08-memtest86-cdtar.tar.b # livecd-stage1. #livecd/bootsplash: livecd-2004.1 +# list of services to add to the specified runlevel +#livecd/rcadd: mkxf86config:default alsasound:boot + +# list of services to delete from the specified runlevel +#livecd/rcdel: net.eth0:boot + +# xinitrc to use on the livecd +#livecd/xinitrc: /tmp/livecd_xinitrc + +# directory that is to be overlayed on the livecd rootfs (the booted fs) +#livecd/root_overlay: /tmp/livecd-root-overlay + # let catalyst know how many kernels to build, and what their names are boot/kernel: gentoo smp diff --git a/livecd/runscript-support/kmerge.sh b/livecd/runscript-support/kmerge.sh index 20a9f86b..0a11660a 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.9 2004/09/08 15:58:12 zhen Exp $ +# $Header: /var/cvsroot/gentoo/src/catalyst/livecd/runscript-support/Attic/kmerge.sh,v 1.10 2004/09/29 01:32:51 zhen Exp $ die() { echo "$1" @@ -9,27 +9,32 @@ die() { } build_kernel() { + # default genkernel args + GK_ARGS="${clst_livecd_gk_mainargs} \ + ${clst_livecd_gk_kernargs} \ + --kerneldir=/usr/src/linux \ + --kernel-config=/var/tmp/${clst_kname}.config \ + --minkernpackage=/usr/portage/packages/gk_binaries/${clst_kname}-${clst_version_stamp}.tar.bz2 all" + + # extra genkernel options that we have to test for if [ -n "${clst_livecd_bootsplash}" ] then - genkernel --bootsplash=${clst_livecd_bootsplash} \ - --callback="emerge ${clst_kernel_merge}" ${clst_livecd_gk_mainargs} \ - ${clst_livecd_gk_kernargs} --kerneldir=/usr/src/linux \ - --kernel-config=/var/tmp/${clst_kname}.config \ - --minkernpackage=/usr/portage/packages/gk_binaries/${clst_kname}-${clst_version_stamp}.tar.bz2 all \ - || exit 1 - - tar cjpf /usr/portage/packages/gk_binaries/${1}-modules-${clst_version_stamp}.tar.bz2 \ - /lib/modules/"${1}" || die "Could not package kernel modules, exiting" - else - genkernel --callback="emerge ${clst_kernel_merge}" \ - ${clst_livecd_gk_mainargs} ${clst_livecd_gk_kernargs} \ - --kerneldir=/usr/src/linux --kernel-config=/var/tmp/${clst_kname}.config \ - --minkernpackage=/usr/portage/packages/gk_binaries/${clst_kname}-${clst_version_stamp}.tar.bz2 all \ - || exit 1 - - tar cjpf /usr/portage/packages/gk_binaries/${1}-modules-${clst_version_stamp}.tar.bz2 \ - /lib/modules/"${1}" || die "Could not package kernel modules, exiting" + GK_ARGS="${GK_ARGS} --bootsplash=${clst_livecd_bootsplash}" fi + + if [ "${clst_livecd_devmanager}" == "udev" ] + then + GK_ARGS="${GK_ARGS} --udev" + fi + + # build with genkernel using the set options + # callback is put here to avoid escaping issues + genkernel ${GK_ARGS} --callback="emerge ${clst_kernel_merge}" || exit 1 + + # pack up the modules for resuming + tar cjpf /usr/portage/packages/gk_binaries/${1}-modules-${clst_version_stamp}.tar.bz2 \ + /lib/modules/"${1}" || die "Could not package kernel modules, exiting" + } # Script to build each kernel, kernel-related packages diff --git a/livecd/runscript/x86-archscript.sh b/livecd/runscript/x86-archscript.sh index 9746fbd9..3dab4f49 100644 --- a/livecd/runscript/x86-archscript.sh +++ b/livecd/runscript/x86-archscript.sh @@ -1,6 +1,6 @@ # 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/Attic/x86-archscript.sh,v 1.9 2004/09/08 15:58:12 zhen Exp $ +# $Header: /var/cvsroot/gentoo/src/catalyst/livecd/runscript/Attic/x86-archscript.sh,v 1.10 2004/09/29 01:32:51 zhen Exp $ case $1 in kernel) @@ -59,6 +59,12 @@ case $1 in echo "F1 kernels.msg" >> ${icfg} echo "F2 help.msg" >> ${icfg} + # figure out what device manager we are using and handle it accordingly + if [ ${clst_livecd_devmanager} == "udev" ] + then + cmdline_opts="${cmdline_opts} udev nodevfs" + fi + echo "Available kernels:" > ${kmsg} cp ${clst_sharedir}/livecd/files/x86-help.msg ${hmsg} diff --git a/modules/livecd_stage2_target.py b/modules/livecd_stage2_target.py index 79d2c281..1230a907 100644 --- a/modules/livecd_stage2_target.py +++ b/modules/livecd_stage2_target.py @@ -1,6 +1,6 @@ # Distributed under the GNU General Public License version 2 # Copyright 2003-2004 Gentoo Technologies, Inc. -# $Header: /var/cvsroot/gentoo/src/catalyst/modules/livecd_stage2_target.py,v 1.20 2004/09/07 14:04:24 zhen Exp $ +# $Header: /var/cvsroot/gentoo/src/catalyst/modules/livecd_stage2_target.py,v 1.21 2004/09/29 01:32:51 zhen Exp $ """ Builder class for a LiveCD stage2 build. @@ -38,7 +38,7 @@ class livecd_stage2_target(generic_stage_target): "livecd/unmerge","livecd/iso","livecd/gk_mainargs","livecd/type",\ "livecd/motd","livecd/overlay","livecd/modblacklist","livecd/bootsplash",\ "livecd/rcadd","livecd/rcdel","livecd/fsscript","livecd/xinitrc",\ - "livecd/root_overlay"]) + "livecd/root_overlay","livecd/devmanager"]) generic_stage_target.__init__(self,spec,addlargs) file_locate(self.settings, ["livecd/cdtar","livecd/archscript","livecd/runscript"]) -- 2.26.2