From 914dc2a93780485084eff0ea419a57d70f25b6da Mon Sep 17 00:00:00 2001 From: Tim Yamin Date: Fri, 8 Jul 2005 22:36:36 +0000 Subject: [PATCH] >> 3.2.0. Add spock's gensplash fixes, fix initrd startup 'find: ...' errors. git-svn-id: svn+ssh://svn.gentoo.org/var/svnroot/genkernel/trunk@241 67a159dc-881f-0410-a524-ba9dfbe2cb84 --- gen_cmdline.sh | 20 ++++++++++------- gen_initramfs.sh | 17 +++++++++++++- generic/initrd.defaults | 1 + generic/initrd.scripts | 2 ++ generic/linuxrc | 30 +++++++++++++++++++------ genkernel | 3 ++- genkernel.8 | 50 ++++++++++++++++++++++------------------- genkernel.conf | 2 +- x86/busy-config | 2 +- x86_64/busy-config | 2 +- 10 files changed, 86 insertions(+), 43 deletions(-) diff --git a/gen_cmdline.sh b/gen_cmdline.sh index 09b2df2..12d281f 100755 --- a/gen_cmdline.sh +++ b/gen_cmdline.sh @@ -62,9 +62,10 @@ longusage() { echo " Initialization" echo " --bootsplash= Force bootsplash using " echo " --gensplash= Force gensplash using " + echo " --gensplash-res= Select gensplash resolutions" echo " --do-keymap-auto Forces keymap selection at boot" echo " --evms2 Include EVMS2 support" - echo " --> 'emerge evms' in the host operating system first" + echo " --> 'emerge evms' in the host operating system first" echo " --lvm2 Include LVM2 support" echo " --unionfs Include UNIONFS support" echo " --dmraid Include DMRAID support" @@ -75,22 +76,21 @@ longusage() { echo " --cachedir= Override the default cache location" echo " --tempdir= Location of Genkernel's temporary directory" echo " Output Settings" - echo " --kernname=<...> tag the kernel and initrd with a name" - echo " if not defined the option defaults to genkernel" + echo " --kernname=<...> Tag the kernel and initrd with a name:" + echo " If not defined the option defaults to 'genkernel'" echo " --minkernpackage= File to output a .tar.bz2'd kernel and initrd:" echo " No modules outside of the initrd will be" echo " included..." echo " --modulespackage= File to output a .tar.bz2'd modules after the callbacks have run" echo " --kerncache= File to output a .tar.bz2'd kernel," echo " contents of /lib/modules/ and the kernel config" - echo " NOTE: This is created before the callbacks are run," + echo " NOTE: This is created before the callbacks are run!" echo " --no-kernel-sources This option is only valid if kerncache is defined" echo " If there is a valid kerncache no checks will be made" echo " against a kernel source tree" - echo " --initramfs-overlay= directory structure to include in the initramfs" - echo " Only available on 2.6 kernels that dont use bootsplash" - - + echo " --initramfs-overlay=" + echo " Directory structure to include in the initramfs," + echo " only available on 2.6 kernels that don't use bootsplash" } usage() { @@ -292,6 +292,10 @@ parse_cmdline() { CMD_GENSPLASH=0 print_info 2 "CMD_GENSPLASH: $CMD_GENSPLASH" ;; + --gensplash-res=*) + GENSPLASH_RES=`parse opt "$*"` + print info 2 "GENSPLASH_RES: $GENSPLASH_RES" + ;; --install) CMD_NOINSTALL=0 print_info 2 "CMD_NOINSTALL: $CMD_NOINSTALL" diff --git a/gen_initramfs.sh b/gen_initramfs.sh index 77cc2cc..bd52559 100644 --- a/gen_initramfs.sh +++ b/gen_initramfs.sh @@ -32,6 +32,7 @@ create_base_layout_cpio() { cd ${TEMP}/initramfs-base-temp/dev mknod -m 660 console c 5 1 mknod -m 660 null c 1 3 + mknod -m 600 tty1 c 4 1 cd "${TEMP}/initramfs-base-temp/" find . -print | cpio --quiet -o -H newc | gzip -9 > ${CACHE_DIR}/cpio/initramfs-base-layout.cpio.gz rm -rf "${TEMP}/initramfs-base-temp" > /dev/null @@ -250,7 +251,21 @@ create_gensplash(){ [ -z "${GENSPLASH_THEME}" ] && GENSPLASH_THEME=default print_info 1 " >> Installing gensplash [ using the ${GENSPLASH_THEME} theme ]..." cd / - splash_geninitramfs -g ${CACHE_DIR}/cpio/initramfs-splash-${KV}.cpio.gz ${GENSPLASH_THEME} + local tmp="" + [ -n "${GENSPLASH_RES}" ] && tmp="-r ${GENSPLASH_RES}" + splash_geninitramfs -g ${CACHE_DIR}/cpio/initramfs-splash-${KV}.cpio.gz ${tmp} ${GENSPLASH_THEME} + if [ -e "/usr/share/splashutils/initrd.splash" ]; then + if [ -d "${TEMP}/initramfs-gensplash-temp" ] + then + rm -r "${TEMP}/initramfs-gensplash-temp/" + fi + mkdir -p "${TEMP}/initramfs-gensplash-temp/etc" + cd "${TEMP}/initramfs-gensplash-temp/" + gunzip -c ${CACHE_DIR}/cpio/initramfs-splash-${KV}.cpio.gz | cpio -idm --quiet -H newc + cp "/usr/share/splashutils/initrd.splash" "${TEMP}/initramfs-gensplash-temp/etc" + find . -print | cpio --quiet -o -H newc | gzip -9 > ${CACHE_DIR}/cpio/initramfs-splash-${KV}.cpio.gz + rm -r "${TEMP}/initramfs-gensplash-temp/" + fi else print_warning 1 ' >> No splash detected; skipping!' fi diff --git a/generic/initrd.defaults b/generic/initrd.defaults index 462be63..6ab71ba 100644 --- a/generic/initrd.defaults +++ b/generic/initrd.defaults @@ -74,6 +74,7 @@ REAL_ROOT='' CDROOT=0 CDROOT_DEV='' NEW_ROOT="/newroot" +CONSOLE="/dev/console" # Only sections that are in by default or those that # are not module groups need to be defined here... diff --git a/generic/initrd.scripts b/generic/initrd.scripts index 783a553..2209669 100644 --- a/generic/initrd.scripts +++ b/generic/initrd.scripts @@ -207,6 +207,7 @@ test_success() { # If last command failed send error message and fall back to a shell if [ "$?" != '0' ] then + splash 'verbose' bad_msg 'Failed to $1; failing back to the shell...' run_shell fi @@ -477,6 +478,7 @@ cdupdate() { ${NEW_ROOT}/mnt/cdrom/cdupdate.sh if [ "$?" != '0' ] then + splash 'verbose' bad_msg "FAILED TO EXECUTE cdupdate.sh" run_shell fi diff --git a/generic/linuxrc b/generic/linuxrc index 1715966..a47c21c 100644 --- a/generic/linuxrc +++ b/generic/linuxrc @@ -6,8 +6,13 @@ . /etc/initrd.defaults . /etc/initrd.scripts +splash() { + return 0 +} +[ -e /etc/initrd.splash ] && . /etc/initrd.splash + # Clean input/output -exec >/dev/console &1 +exec >${CONSOLE} <${CONSOLE} 2>&1 if [ "$$" != '1' ] then @@ -133,9 +138,17 @@ do MLIST="`echo ${MLIST} | sed -e \"s/,/ /\"`" export MLIST ;; + + # Redirect output to a specific tty + CONSOLE\=*) + CONSOLE=`parse_opt "${x}"` + exec >${CONSOLE} <${CONSOLE} 2>&1 + ;; esac done +splash 'init' + detect_sbp2_devices cmdline_hwopts @@ -196,6 +209,7 @@ then done cp /dev/null ${NEW_ROOT}/dev cp /dev/console ${NEW_ROOT}/dev + cp /dev/tty1 ${NEW_ROOT}/dev sdelay bootstrapCD @@ -530,6 +544,7 @@ EOF elif [ "$0" = '/init' ] then [ ! -e /${CHROOT}/dev/console ] && mknod /${CHROOT}/dev/console c 5 1 + [ ! -e /${CHROOT}/dev/tty1 ] && mknod /${CHROOT}/dev/tty1 c 4 1 echo -ne "${GOOD}>>${NORMAL}${BOLD} Booting (initramfs)..." cd ${CHROOT} @@ -540,7 +555,7 @@ then umount /proc || echo '*: Failed to unmount the initrd /proc!' echo -n '.' - exec dev/console 2>&1 + exec <${CONSOLE} >${CONSOLE} 2>&1 echo '.' # Cleanup initramfs in the background @@ -563,17 +578,16 @@ then INITRAMFS_FILES=`echo ${INITRAMFS_FILES}|sed -e "s|newroot||g"` for i in ${INITRAMFS_FILES} do - for j in `/bin/busybox find /$i` + for j in `/bin/busybox find /$i 2>/dev/null` do - #/bin/busybox echo "$j" if /bin/busybox [ ! -d "$j" -a "$j" != "/bin/busybox" ] then /bin/busybox rm "$j" fi done - for j in `/bin/busybox find /$i` + for j in `/bin/busybox find /$i 2>/dev/null` do - if /bin/busybox [ -d ${j} -a "${j}" != "/bin" ] + if /bin/busybox [ -d "${j}" -a "${j}" != "/bin" -a "${j}" != "/dev" ] then /bin/busybox rm -r "$j" fi @@ -582,13 +596,15 @@ then # End initramfs cleanup # Start the real root init - (/bin/busybox sleep 2;/bin/busybox rm /bin/busybox) & + (/bin/busybox sleep 3; /bin/busybox rm /dev -r; /bin/busybox rm /bin/busybox) & exec /bin/busybox chroot . /bin/sh <<- EOF exec /sbin/init ${REAL_INIT} EOF fi +splash 'verbose' + echo 'A fatal error has probably occured since /sbin/init did not' echo 'boot correctly. Trying to open a shell...' echo diff --git a/genkernel b/genkernel index c27a4bb..2312d46 100755 --- a/genkernel +++ b/genkernel @@ -2,7 +2,8 @@ # Genkernel v3 PATH="/bin:/usr/bin:/sbin:/usr/sbin" -GK_V='3.2.0_pre14' +GK_V='3.2.0' + TEMP='/var/tmp/genkernel' TODEBUGCACHE=1 # Until an error occurs or DEBUGFILE is fully qualified. diff --git a/genkernel.8 b/genkernel.8 index f525f7f..5585f97 100644 --- a/genkernel.8 +++ b/genkernel.8 @@ -1,4 +1,4 @@ -.TH GENKERNEL "8" "June 2005" "genkernel 3.2.0" "Gentoo Linux" +.TH GENKERNEL "8" "July 2005" "genkernel 3.2.0" "Gentoo Linux" .SH NAME genkernel \- the Gentoo Linux automatic kernel compiler. .SH SYNOPSIS @@ -23,13 +23,17 @@ This would produce a kernel, asking you what how to configure it to your desire, leaving alone any existing compiled object files, enabling bootsplash support but not installing anything. .SH ACTIONS -An action tells Genkernel what you want it to do - the following +An action tells genkernel what you want it to do - the following actions are supported: .PP .I \fBall\fR .RS Build all steps - the kernel, modules, and the initrd. .RE +.I \fBbzImage\fR +.RS +Build only the kernel. +.RE .I \fBkernel\fR .RS Build only the kernel and the modules. @@ -107,9 +111,6 @@ Implies \fB\-\-no\-clean\fR, and thus \fB\-\-no\-mrproper\fR, running a \fB\-\-callback=\fR<...> Run the specified arguments in the current environment after the kernel and modules have been compiled. -.TP -\fB\-\-udev\fR -Add in udev support to the initrd. .PP .BR Kernel \ Locations .TP @@ -169,14 +170,27 @@ rather than the default theme specified in your gensplash configuration. If \fB\-\-no-gensplash\fR is specified, then gensplash is disabled. .TP +\fB\-\-gensplash-res=\fR +Optionally select gensplash resolutions to include. +.TP +\fB\-\-evms2\fR +Add in EVMS2 support from static binaries if they exist on the system: +you should run "emerge evms2" first. +.TP \fB\-\-lvm2\fR .RS Add in LVM2 support from static binaries if they exist on the system, or compile static LVM2 binaries if static ones do not exist. .RE .TP -\fB\-\-no\-evms2\fR -Don't add in EVMS2 support if it is available on the system. +\fB\-\-unionfs\fR +Add unionfs support. +.TP +\fB\-\-dmraid\fR +Add DMRAID support. +.TP +\fB\-\-linuxrc=\fR +Use for the linuxrc instead of the genkernel linuxrc. .PP .BR Internals .TP @@ -203,16 +217,16 @@ initrd will be included... File to output a .tar.bz2'd modules after the callbacks have run .TP \fB\-\-kerncache=\fR -File to output a .tar.bz2'd kernel, contents of /lib/modules/ and the kernel config -NOTE: This is created before the callbacks are run," +File to output a .tar.bz2'd kernel, contents of /lib/modules/ and the kernel config. +\fBNOTE\fR: This is created before the callbacks are run. .TP \fB\-\-no\-kernel\-sources=\fR This option is only valid if kerncache is defined If there is a valid kerncache no checks will be made -against a kernel source tree +against a kernel source tree. .TP \fB\-\-initramfs\-overlay=\fR -Directory structure to inject into the initramfs +Directory structure to inject into the initramfs. Only available on 2.6 kernels that don't use bootsplash; use a CPIO archive as a parameter. .SH INITRD OPTIONS @@ -222,18 +236,8 @@ bootloader, which the initrd scripts would recognize. \fBreal_root=\fR<...> Specifies the device node of the root filesystem to mount. .TP -\fBdevfs\fR -.RS -Turns on devfs support. -.RE -.TP -\fBnodevfs\fR -Turns off devfs support. -.TP -\fBnoudev\fR -.RS -Turns off udev support. -.RE +\fBdodmraid=\fR<...> +Passes arguments to dmraid on bootup. .TP \fBreal_init=\fR<...> Passes arguments to init on bootup. diff --git a/genkernel.conf b/genkernel.conf index f9ad233..8955c40 100755 --- a/genkernel.conf +++ b/genkernel.conf @@ -90,7 +90,7 @@ DEVFSD_DIR="devfsd" DEVFSD_BINCACHE="%%CACHE%%/devfsd-${DEVFSD_VER}-%%ARCH%%.bz2" DEVFSD_CONF_BINCACHE="%%CACHE%%/devfsd-conf-${DIETLIBC_VER}-%%ARCH%%.bz2" -UDEV_VER="058" +UDEV_VER="054" UDEV_DIR="udev-${UDEV_VER}" UDEV_SRCTAR="${GK_SHARE}/pkg/udev-${UDEV_VER}.tar.bz2" UDEV_BINCACHE="%%CACHE%%/udev-${UDEV_VER}-%%ARCH%%.tar.bz2" diff --git a/x86/busy-config b/x86/busy-config index e3c1bb9..7bcc066 100644 --- a/x86/busy-config +++ b/x86/busy-config @@ -158,7 +158,7 @@ CONFIG_FEATURE_HUMAN_READABLE=y # # Console Utilities # -# CONFIG_CHVT is not set +CONFIG_CHVT=y CONFIG_CLEAR=y # CONFIG_DEALLOCVT is not set CONFIG_DUMPKMAP=y diff --git a/x86_64/busy-config b/x86_64/busy-config index e3c1bb9..7bcc066 100644 --- a/x86_64/busy-config +++ b/x86_64/busy-config @@ -158,7 +158,7 @@ CONFIG_FEATURE_HUMAN_READABLE=y # # Console Utilities # -# CONFIG_CHVT is not set +CONFIG_CHVT=y CONFIG_CLEAR=y # CONFIG_DEALLOCVT is not set CONFIG_DUMPKMAP=y -- 2.26.2