- If you want Bootsplash, you MUST have VESAFB enabled for 2.6,
other framebuffers won't work. You MUST also enable
"video mode selection support" and "Framebuffer Console support"
+ - From gentoo-dev-sources-2.6.8 and above, bootsplash has been replaced
+ with gensplash. Gensplash has the same kernel configuration requirements
+ as bootsplash, but works properly with any framebuffer device.
- To build a kernel with Genkernel you must have
"Block devices->Loopback device support"
"Block devices->RAM disk support"
echo " --oldconfig Implies --no-clean and runs a 'make oldconfig'"
echo " --bootsplash Install bootsplash support to the initrd"
echo " --no-bootsplash Do not use bootsplash"
+ echo " --gensplash Install gensplash support into bzImage"
+ echo " --no-gensplash Do not use gensplash"
echo " --install Install the kernel after building"
echo " --no-install Do not install the kernel after building"
echo " --no-initrdmodules Don't copy any modules to the initrd"
- echo " --udev Add in udev support."
+ echo " --udev Enables udev support in your initrd"
+ echo " --no-udev Remove udev support."
echo " --callback=<...> Run the specified arguments after"
echo " the kernel and modules have been"
echo " compiled."
+ echo " --postconf=<...> Run the specified arguments after"
+ echo " the kernel has been configured."
echo " Kernel settings"
echo " --kerneldir=<dir> Location of the kernel sources"
echo " --kernel-config=<file> Kernel configuration file to use for compilation"
echo " --no-mountboot Don't mount /boot automatically"
echo " Initialization"
echo " --bootsplash=<theme> Force bootsplash using <theme>."
+ echo " --gensplash=<theme> Force gensplash using <theme>."
echo " --do-keymap-auto Forces keymap selection at boot."
echo " --no-lvm2 Don't add in LVM2 support."
- echo " --bootloader=grub Add new kernel to GRUB configuration"
+ echo " --bootloader=grub Add new kernel to GRUB configuration"
echo " Internals"
echo " --arch-override=<arch> Force to arch instead of autodetect"
echo " --cachedir=<dir> Override the default cache location"
;;
--bootsplash=*)
CMD_BOOTSPLASH=1
+ CMD_GENSPLASH=0
BOOTSPLASH_THEME=`parse_opt "$*"`
print_info 2 "CMD_BOOTSPLASH: $CMD_BOOTSPLASH"
+ print_info 2 "CMD_GENSPLASH: $CMD_GENSPLASH"
print_info 2 "BOOTSPLASH_THEME: $BOOTSPLASH_THEME"
;;
--bootsplash)
CMD_BOOTSPLASH=1
+ CMD_GENSPLASH=0
print_info 2 "CMD_BOOTSPLASH: $CMD_BOOTSPLASH"
+ print_info 2 "CMD_GENSPLASH: $CMD_GENSPLASH"
;;
--no-bootsplash)
CMD_BOOTSPLASH=0
print_info 2 "CMD_BOOTSPLASH: $CMD_BOOTSPLASH"
;;
+ --gensplash=*)
+ CMD_GENSPLASH=1
+ CMD_BOOTSPLASH=0
+ GENSPLASH_THEME=`parse_opt "$*"`
+ print_info 2 "CMD_GENSPLASH: $CMD_GENSPLASH"
+ print_info 2 "GENSPLASH_THEME: $GENSPLASH_THEME"
+ print_info 2 "CMD_BOOTSPLASH: $CMD_BOOTSPLASH"
+ ;;
+ --gensplash)
+ CMD_GENSPLASH=1
+ CMD_BOOTSPLASH=0
+ GENSPLASH_THEME='default'
+ print_info 2 "CMD_GENSPLASH: $CMD_GENSPLASH"
+ print_info 2 "CMD_BOOTSPLASH: $CMD_BOOTSPLASH"
+ ;;
+ --no-gensplash)
+ CMD_GENSPLASH=0
+ print_info 2 "CMD_GENSPLASH: $CMD_GENSPLASH"
+ ;;
--install)
CMD_NOINSTALL=0
print_info 2 "CMD_NOINSTALL: $CMD_NOINSTALL"
CMD_UDEV=1
print_info 2 "CMD_UDEV: $CMD_UDEV"
;;
+ --no-udev)
+ CMD_UDEV=0
+ print_info 2 "CMD_UDEV: $CMD_UDEV"
+ ;;
--callback*)
CMD_CALLBACK=`parse_opt "$*"`
print_info 2 "CMD_CALLBACK: $CMD_CALLBACK/$*"
;;
+ --postconf*)
+ CMD_POSTCONF=`parse_opt "$*"`
+ print_info 2 "CMD_POSTCONF: $CMD_POSTCONF/$*"
+ ;;
--tempdir*)
TEMP=`parse_opt "$*"`
print_info 2 "TEMP: $TEMP"
}
compile_module_init_tools() {
+ # I've disabled dietlibc support for the time being since the
+ # version we use misses a few needed system calls.
+
local ARGS
if [ ! -f "${MODULE_INIT_TOOLS_BINCACHE}" ]
then
cd "${MODULE_INIT_TOOLS_DIR}"
print_info 1 'module-init-tools: >> Configuring'
- if [ "${USE_DIETLIBC}" -eq '1' ]
- then
- extract_dietlibc_bincache
- OLD_CC="${UTILS_CC}"
- UTILS_CC="${TEMP}/diet/bin/diet ${UTILS_CC}"
- fi
+# if [ "${USE_DIETLIBC}" -eq '1' ]
+# then
+# extract_dietlibc_bincache
+# OLD_CC="${UTILS_CC}"
+# UTILS_CC="${TEMP}/diet/bin/diet ${UTILS_CC}"
+# fi
export_utils_args
./configure >> ${DEBUGFILE} 2>&1 ||
print_info 1 ' >> Compiling...'
compile_generic "all" utils
- if [ "${USE_DIETLIBC}" -eq '1' ]
- then
- clean_dietlibc_bincache
- UTILS_CC="${OLD_CC}"
- fi
+# if [ "${USE_DIETLIBC}" -eq '1' ]
+# then
+# clean_dietlibc_bincache
+# UTILS_CC="${OLD_CC}"
+# fi
print_info 1 ' >> Copying to cache...'
[ -f "${TEMP}/${MODULE_INIT_TOOLS_DIR}/insmod.static" ] ||
BOOTSPLASH=0
fi
+ if [ "${CMD_GENSPLASH}" != '' ]
+ then
+ GENSPLASH=${CMD_GENSPLASH}
+ fi
+
+ if isTrue ${GENSPLASH}
+ then
+ GENSPLASH=1
+ else
+ GENSPLASH=0
+ fi
+
if isTrue ${COMPRESS_INITRD}
then
COMPRESS_INITRD=1
if isTrue "${CMD_UDEV}"
then
UDEV=1
+ DEVFS=0
else
UDEV=0
+ DEVFS=1
fi
}
group="$(echo $group_modules | cut -d_ -f2 | tr "[:upper:]" "[:lower:]")"
echo -n "${group} " >> "${TEMP}/initrd-temp/etc/initrd.defaults"
done
- echo "\"" >> "${TEMP}/initrd-temp/etc/initrd.defaults"
+ echo '"' >> "${TEMP}/initrd-temp/etc/initrd.defaults"
if [ -f "${GK_SHARE}/${ARCH}/modprobe" ]
then
# Only sections that are in by default or those that
# are not module groups need to be defined here...
-HWOPTS="usb firewire keymap cache lvm2"
-MY_HWOPTS="usb firewire lvm2"
+HWOPTS='usb firewire keymap cache lvm2'
+MY_HWOPTS='usb firewire lvm2'
QUIET=1
ROOT_LINKS='bin sbin lib lib64 boot usr opt'
REAL_ROOT=''
CDROOT=0
+CDROOT_DEV=''
do
echo -e "${GOOD}>>${NORMAL} Attempting to mount CD:- ${x}"
mount -r ${x} /newroot/mnt/cdrom > /dev/null 2>&1
- if [ "$?" = "0" ]
+
+ if [ "$?" = '0' ]
then
REAL_ROOT="${x}"
break
+
+ ## FIXME: I need a proper identifier present on all LiveCDs to work across
+ ## all architectures.
+
+# # Check for a LiveCD
+# if [ -e /newroot/mnt/cdrom/.gentoo_LiveCD ]
+# then
+# REAL_ROOT="${x}"
+# break
+# else
+# umount /newroot/mnt/cdrom
+# fi
fi
done
if [ "${REAL_ROOT}" != "" ]
then
- echo -e "${GOOD}>>${NORMAL} CD medium found on $1"
+ echo -e "${GOOD}>>${NORMAL} CD medium found on ${x}"
fi
fi
}
# using information from /sys, and only those
# devices (since other are not needed for boot).
+ # We also do VC's for keymap support.
+
for x in block/*
do
export DEVPATH="/${x}"
fi
done
done
+ for x in class/tty
+ do
+ export DEVPATH="/${x}"
+ /sbin/udev class
+
+ for y in ${x}/*
+ do
+ if [ -f "${y}/dev" ]
+ then
+ export DEVPATH="/${y}"
+ /sbin/udev class
+ fi
+ done
+ done
+
cd /
unset -v ACTION DEVPATH UDEV_NO_SLEEP
CDROOT=1
REAL_ROOT=''
;;
+ cdroot\=*)
+ CDROOT=1
+ CDROOT_DEV=`parse_opt "${x}"`
+ REAL_ROOT=''
+ ;;
devfs)
USE_DEVFS_NORMAL=1
+ USE_UDEV_NORMAL=0
;;
nodevfs)
USE_DEVFS_NORMAL=0
;;
udev)
USE_UDEV_NORMAL=1
+ USE_DEVFS_NORMAL=0
;;
noudev)
USE_UDEV_NORMAL=0
real_init\=*)
REAL_INIT=`parse_opt "${x}"`
;;
+ scandelay)
+ SDELAY=10
+ ;;
*)
;;
esac
done
+[ -e /proc/scsi/scsi ] && echo 'scsi add-single-device 0 0 0 0' > /proc/scsi/scsi
+
# Scan CMDLINE for any "doscsi" or "noscsi"-type arguments
for x in $HWOPTS
do
for y in $CMDLINE
do
- if [ "$y" = "do${x}" ]
+ if [ "${y}" = "do${x}" ]
then
MY_HWOPTS="${MY_HWOPTS} $x"
- elif [ "$y" = "no${x}" ]
+ elif [ "${y}" = "no${x}" ]
then
- MY_HWOPTS="`echo ${MY_HWOPTS} | sed -e 's/${x}//g' -`"
+ MY_HWOPTS="`echo ${MY_HWOPTS} | sed -e \"s/${x}//g\" -`"
fi
done
done
chooseKeymap() {
echo -e "${GOOD}>>${NORMAL}${BOLD} Loading keymaps...${NORMAL}"
cat /lib/keymaps/keymapList
- read -p '<< Load keymap: ' keymap
+ read -t 10 -p '<< Load keymap (Enter for default): ' keymap
if [ -e /lib/keymaps/${keymap}.map ]
then
echo -e "${GOOD}>>${NORMAL}${BOLD} Loading the ''${keymap}'' keymap...${NORMAL}"
loadkmap < /lib/keymaps/${keymap}.map
elif [ "$keymap" = '' ]
then
- echo -e "${GOOD}>>${NORMAL}${BOLD} Loading default US keymap...${NORMAL}"
- loadkmap < /lib/keymaps/us.map
+ echo -e "${GOOD}>>${NORMAL}${BOLD} Keeping default keymap...${NORMAL}"
else
echo -e "${BAD}!! ${NORMAL}${BOLD}Sorry, but keymap ''${keymap}'' is invalid!${NORMAL}"
chooseKeymap
fi
}
-[ "${DO_keymap}" ] && chooseKeymap
echo -e "${GOOD}>>${NORMAL}${BOLD} Mounting filesystems${NORMAL}"
# Check udev is on...
-[ "${KMAJOR}" -ge 2 ] && USE_UDEV_SUPPORT=1
-[ "${KMAJOR}" -eq 2 -a "${KMINOR}" -ge '6' ] && USE_UDEV_SUPPORT=1
-[ "${USE_UDEV_SUPPORT}" -eq '1' -a -f /sbin/udev -a "${USE_UDEV_NORMAL}" -ne 0 ] && USE_UDEV_NORMAL=1
-
-# Disable udev support if /dev is already mounted as devfs
-[ -e /dev/.devfsd ] && USE_UDEV_NORMAL=0
+# [ "${KMAJOR}" -ge 2 ] && USE_UDEV_SUPPORT=1
+# [ "${KMAJOR}" -eq 2 -a "${KMINOR}" -ge '6' -a ! "${USE_UDEV_SUPPORT}" -eq '0' ] && USE_UDEV_SUPPORT=1
+[ "${USE_UDEV_NORMAL}" -eq '1' -a ! -x /sbin/udev ] && USE_UDEV_NORMAL=0
# If using 2.4 and udev; back off...
[ "${KMAJOR}" -eq 2 -a "${KMINOR}" -lt '6' -a "${USE_UDEV_NORMAL}" -eq 1 ] &&
USE_UDEV_NORMAL=0
+# Disable devfs if we want udev...
+[ -e /dev/.devfsd -a "${USE_UDEV_NORMAL}" -eq 1 ] && echo '>> Enabling devfsd in favour of udev; use "nodevfs" if this is not intended...' && USE_UDEV_NORMAL=0
+
mkdir /newroot
if [ "${CDROOT}" -eq '1' ]
then
if [ "${USE_UDEV_NORMAL}" -eq '1' ]
then
# Udev is semi-broken on non /sys sysfs mount points.
- mount -t sysfs sys /sys 2> /dev/null
- mount -t sysfs sys /newroot/sys 2> /dev/null
+ mount -t sysfs none /sys
[ "$?" -eq '0' ] || USE_UDEV_NORMAL=0
fi
if [ "${USE_UDEV_NORMAL}" -eq '1' ]
then
cd /sys
+ kill_devfsd
runUdev
mv /dev/* /newroot/dev
else
then
mount -t devfs devfs /newroot/dev
devfsd /newroot/dev -np
- sleep 1
+ if [ -n "${SDELAY}" ]; then
+ sleep ${SDELAY}
+ else
+ sleep 1
+ fi
fi
fi
- findcdmount /newroot/dev/cdroms/*
+ if [ "${CDROOT_DEV}" = '' ]
+ then
+ findcdmount /newroot/dev/cdroms/*
+
+ # Not in /dev/cdroms: try /dev/ide/cd
+ [ "${REAL_ROOT}" = '' ] && findcdmount /newroot/dev/ide/cd/*
+ [ "${REAL_ROOT}" = '' ] && findcdmount /newroot/dev/sr0
+ else
+ # Device specified on command line
+ findcdmount /newroot/${CDROOT_DEV}
+ fi
- # Not in /dev/cdroms: try /dev/ide/cd
- [ "${REAL_ROOT}" = '' ] && findcdmount /newroot/dev/ide/cd/*
if [ "${REAL_ROOT}" = '' ]
then
# Undo stuff
fi
fi
+if [ "${DO_keymap}" ]
+then
+ if [ ! -e /dev/vc/0 ]
+ then
+ DEVBIND=1
+ mount -o bind /newroot/dev /dev
+ fi
+ chooseKeymap
+ [ "${DEVBIND}" -eq '1' ] && umount /dev
+fi
+
+# FIX: indent me in one $CDROOT -eq '0'
+
# Try to mount sysfs, and if it fails, do not use udev
if [ "${USE_UDEV_NORMAL}" -eq '1' -a "${CDROOT}" -eq '0' ]
then
- mount -t sysfs sys /sys 2> /dev/null
+ mount -t sysfs none /sys
[ "$?" -eq '0' ] || USE_UDEV_NORMAL=0
fi
elif [ "${CDROOT}" -eq '1' ]
then
umount /tmp/.initrd/proc || echo "*: Failed to unmount the initrd /proc!"
- umount /dev > /dev/null 2>&1
- mount -n --move /tmp/.initrd/dev dev || echo '*: Failed to move over the /dev tree!'
+ umount /dev 2>/dev/null
+ mount -n --move /tmp/.initrd/dev dev 2>/dev/null
rm /tmp/.initrd/dev -rf || '*: Failed to remove the initrd /dev!'
+
+ umount /sys 2>/dev/null
+ umount /tmp/.initrd/sys 2>/dev/null
fi
echo -n '.'
#!/bin/bash
# Genkernel v3
-GK_V='3.0.2g'
+GK_V='3.1.0b'
TEMP='/var/tmp/genkernel'
TODEBUGCACHE=1 # Until an error occurs or DEBUGFILE is fully qualified.
# Make deps
compile_dep
+ # Make prepare [2.6]
+ [ "${VER}" -gt '2' ] || [ "${VER}" -eq '2' -a "${PAT}" -ge '6' ] && compile_generic prepare kernel
+
+ # Run postconf
+ if [ "${CMD_POSTCONF}" != '' ]
+ then
+ print_info 1 '' 1 0
+ print_info 1 "Preparing to run postconf: \"${CMD_POSTCONF}\"" 0
+
+ CALLBACK_ESCAPE=0
+ CALLBACK_COUNT=0
+
+ trap "CALLBACK_ESCAPE=1" TERM KILL INT QUIT ABRT
+ while [[ ${CALLBACK_ESCAPE} -eq 0 && ${CALLBACK_COUNT} -lt 5 ]]
+ do
+ sleep 1; echo -n '.';
+ let CALLBACK_COUNT=${CALLBACK_COUNT}+1
+ done
+
+ if [ "${CALLBACK_ESCAPE}" -eq 0 ]
+ then
+ echo
+ echo
+ eval ${CMD_POSTCONF} | tee -a ${DEBUGFILE}
+ echo
+ print_info 1 "<<< Postconf callback exit status: ${PIPESTATUS[0]}"
+ else
+ echo
+ print_info 1 '>>> Postconf cancelled...'
+ fi
+ trap - TERM KILL INT QUIT ABRT
+ print_info 1 '' 1 0
+ fi
+
+ if [ "${GENSPLASH}" -eq '1' ]
+ then
+ if [ -x /sbin/splash ]
+ then
+ [ -z "${GENSPLASH_THEME}" ] && [ -e /etc/conf.d/splash ] && source /etc/conf.d/splash
+ [ -z "${GENSPLASH_THEME}" ] && GENSPLASH_THEME=default
+ print_info 1 " >> Installing gensplash [ using the ${GENSPLASH_THEME} theme ]..."
+ sed -i 's:$(obj)/gen_init_cpio $(initramfs-y) FORCE:$(if $(shell [ ! -f $(obj)/initramfs_data.cpio ] && echo '1' ), $(obj)/gen_init_cpio $(initramfs-y)):' ${KERNEL_DIR}/usr/Makefile
+ splash_geninitramfs -g ${KERNEL_DIR}/usr/initramfs_data.cpio.gz ${GENSPLASH_THEME}
+ gunzip ${KERNEL_DIR}/usr/initramfs_data.cpio.gz
+ else
+ print_warning 1 ' >> No splash detected; skipping!'
+ fi
+ fi
+
# Compile kernel
compile_kernel
fi
compile_devfsd
- [ "${VER}" -lt '2' ] || [ "${VER}" -eq '2' -a "${PAT}" -lt '6' -a "${UDEV}" -eq '1' ] && UDEV=0 && print_info 1 'udev: Target is a 2.4 kernel, support disabled.'
- [ "${VER}" -gt '2' ] || [ "${VER}" -eq '2' -a "${PAT}" -ge '6' ] && UDEV=1 && print_info 1 'udev: Target is a 2.6 kernel, support enabled.'
+ #UDEV=0
+ #[ "${VER}" -gt '2' ] || [ "${VER}" -eq '2' -a "${PAT}" -ge '6' -a "${NOUDEV}" -eq '0' ] && UDEV=1 && print_info 1 'udev: Target is a 2.6 kernel, support enabled.'
[ "${UDEV}" -eq '1' ] && compile_udev
# Create initrd
MODUTILS_DIR="modutils-${MODUTILS_VER}"
MODUTILS_BINCACHE="%%CACHE%%/insmod-%%ARCH%%-static-2.4.bz2"
-DIETLIBC_VER="0.26"
+DIETLIBC_VER="0.27"
DIETLIBC_SRCTAR="${GK_SHARE}/pkg/dietlibc-${DIETLIBC_VER}.tar.bz2"
DIETLIBC_DIR="dietlibc-${DIETLIBC_VER}"
DIETLIBC_BINCACHE="%%CACHE%%/dietlibc-${DIETLIBC_VER}-%%ARCH%%.tar.bz2"
DEVFSD_BINCACHE="%%CACHE%%/devfsd-${DEVFSD_VER}-%%ARCH%%.bz2"
DEVFSD_CONF_BINCACHE="%%CACHE%%/devfsd-conf-${DIETLIBC_VER}-%%ARCH%%.bz2"
-UDEV_VER="030"
+UDEV_VER="039"
UDEV_DIR="udev-${UDEV_VER}"
UDEV_SRCTAR="${GK_SHARE}/pkg/udev-${UDEV_VER}.tar.bz2"
UDEV_BINCACHE="%%CACHE%%/udev-${UDEV_VER}-%%ARCH%%.tar.bz2"
+++ /dev/null
---- busybox-1.00-pre2/shell/ash.c.orig 2003-08-24 16:31:08.000000000 -0700
-+++ busybox-1.00-pre2/shell/ash.c 2003-08-24 16:32:41.000000000 -0700
-@@ -543,6 +543,28 @@
- static int parsenleft; /* copy of parsefile->nleft */
- static int parselleft; /* copy of parsefile->lleft */
-
-+struct strpush {
-+ struct strpush *prev; /* preceding string on stack */
-+ char *prevstring;
-+ int prevnleft;
-+#ifdef CONFIG_ASH_ALIAS
-+ struct alias *ap; /* if push was associated with an alias */
-+#endif
-+ char *string; /* remember the string since it may change */
-+};
-+
-+struct parsefile {
-+ struct parsefile *prev; /* preceding file on stack */
-+ int linno; /* current line */
-+ int fd; /* file descriptor (or -1 if string) */
-+ int nleft; /* number of chars left in this line */
-+ int lleft; /* number of chars left in this buffer */
-+ char *nextc; /* next char in buffer */
-+ char *buf; /* input buffer */
-+ struct strpush *strpush; /* for pushing strings at this level */
-+ struct strpush basestrpush; /* so pushing one is fast */
-+};
-+
- /* next character in input buffer */
- static char *parsenextc; /* copy of parsefile->nextc */
- static struct parsefile basepf; /* top level input file */
-@@ -1577,28 +1599,6 @@
-
- static int loopnest; /* current loop nesting level */
-
--struct strpush {
-- struct strpush *prev; /* preceding string on stack */
-- char *prevstring;
-- int prevnleft;
--#ifdef CONFIG_ASH_ALIAS
-- struct alias *ap; /* if push was associated with an alias */
--#endif
-- char *string; /* remember the string since it may change */
--};
--
--struct parsefile {
-- struct parsefile *prev; /* preceding file on stack */
-- int linno; /* current line */
-- int fd; /* file descriptor (or -1 if string) */
-- int nleft; /* number of chars left in this line */
-- int lleft; /* number of chars left in this buffer */
-- char *nextc; /* next char in buffer */
-- char *buf; /* input buffer */
-- struct strpush *strpush; /* for pushing strings at this level */
-- struct strpush basestrpush; /* so pushing one is fast */
--};
--
- /*
- * The parsefile structure pointed to by the global variable parsefile
- * contains information about the current file being read.
MODULES_FIREWIRE="ieee1394 ohci1394 sbp2"
MODULES_ATARAID="ataraid pdcraid hptraid"
-MODULES_PCMCIA="pcmcia_core i82365 yenta_socket ds ide-cs"
-MODULES_USB="ehci-hcd uhci usb-ohci hid usb-storage"
+MODULES_PCMCIA="pcmcia_core yenta_socket i82365 ds ide-cs"
+MODULES_USB="ehci-hcd uhci usb-ohci hid usb-storage uchi-hcd ohci-hcd usbhid"