echo " Initialization"
echo " --bootsplash=<theme> Force bootsplash using <theme>"
echo " --gensplash=<theme> Force gensplash using <theme>"
+ echo " --gensplash-res=<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"
echo " --cachedir=<dir> Override the default cache location"
echo " --tempdir=<dir> 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=<tbz2> File to output a .tar.bz2'd kernel and initrd:"
echo " No modules outside of the initrd will be"
echo " included..."
echo " --modulespackage=<tbz2> File to output a .tar.bz2'd modules after the callbacks have run"
echo " --kerncache=<tbz2> 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=<dir> directory structure to include in the initramfs"
- echo " Only available on 2.6 kernels that dont use bootsplash"
-
-
+ echo " --initramfs-overlay=<dir>"
+ echo " Directory structure to include in the initramfs,"
+ echo " only available on 2.6 kernels that don't use bootsplash"
}
usage() {
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"
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
[ -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
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...
# 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
${NEW_ROOT}/mnt/cdrom/cdupdate.sh
if [ "$?" != '0' ]
then
+ splash 'verbose'
bad_msg "FAILED TO EXECUTE cdupdate.sh"
run_shell
fi
. /etc/initrd.defaults
. /etc/initrd.scripts
+splash() {
+ return 0
+}
+[ -e /etc/initrd.splash ] && . /etc/initrd.splash
+
# Clean input/output
-exec >/dev/console </dev/console 2>&1
+exec >${CONSOLE} <${CONSOLE} 2>&1
if [ "$$" != '1' ]
then
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
done
cp /dev/null ${NEW_ROOT}/dev
cp /dev/console ${NEW_ROOT}/dev
+ cp /dev/tty1 ${NEW_ROOT}/dev
sdelay
bootstrapCD
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}
umount /proc || echo '*: Failed to unmount the initrd /proc!'
echo -n '.'
- exec <dev/console >dev/console 2>&1
+ exec <${CONSOLE} >${CONSOLE} 2>&1
echo '.'
# Cleanup initramfs in the background
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
# 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
# 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.
-.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
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.
\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
configuration. If \fB\-\-no-gensplash\fR is specified, then
gensplash is disabled.
.TP
+\fB\-\-gensplash-res=\fR<resolutions>
+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<file>
+Use <file> for the linuxrc instead of the genkernel linuxrc.
.PP
.BR Internals
.TP
File to output a .tar.bz2'd modules after the callbacks have run
.TP
\fB\-\-kerncache=\fR<tbz2>
-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<tbz2>
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<dir>
-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
\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.
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"
#
# Console Utilities
#
-# CONFIG_CHVT is not set
+CONFIG_CHVT=y
CONFIG_CLEAR=y
# CONFIG_DEALLOCVT is not set
CONFIG_DUMPKMAP=y
#
# Console Utilities
#
-# CONFIG_CHVT is not set
+CONFIG_CHVT=y
CONFIG_CLEAR=y
# CONFIG_DEALLOCVT is not set
CONFIG_DUMPKMAP=y