# Copyright 2006-2008 Gentoo Foundation; Distributed under the GPL v2
# $Header: $
+ 14 Feb 2008; Chris Gianelloni <wolf31o2@gentoo.org> gen_compile.sh,
+ gen_determineargs.sh, gen_funcs.sh, gen_initramfs.sh, gen_initrd.sh,
+ generic/initrd.defaults, generic/initrd.scripts, generic/linuxrc,
+ genkernel, genkernel.8, genkernel.conf:
+ Removing DEVFS support from genkernel since we don't support 2.4 kernels
+ anymore. This is 3.4.10_pre2.
+
14 Feb 2008; Chris Gianelloni <wolf31o2@gentoo.org>
generic/initrd.scripts:
Added a line to make sure we remove image.squashfs as well as the other loop
fi
}
-compile_devfsd() {
- local ARGS
- if [ ! -f "${DEVFSD_BINCACHE}" ]
- then
- [ ! -f "${DEVFSD_SRCTAR}" ] &&
- gen_die "Could not find devfsd source tarball: ${DEVFSD_SRCTAR}"
- cd "${TEMP}"
- rm -rf "${DEVFSD_DIR}"
- /bin/tar -jxpf "${DEVFSD_SRCTAR}"
- [ ! -d "${DEVFSD_DIR}" ] &&
- gen_die "Devfsd directory ${DEVFSD_DIR} invalid"
- cd "${DEVFSD_DIR}"
-
- print_info 1 'devfsd: >> Compiling...'
- compile_generic 'LDFLAGS=-static' utils
-
- print_info 1 ' >> Copying to cache...'
- [ -f "${TEMP}/${DEVFSD_DIR}/devfsd" ] || gen_die 'The devfsd executable does not exist after the compilation of devfsd!'
- strip "${TEMP}/${DEVFSD_DIR}/devfsd" || gen_die 'Could not strip devfsd!'
- bzip2 "${TEMP}/${DEVFSD_DIR}/devfsd" || gen_die 'Compression of devfsd failed!'
- [ -f "${TEMP}/${DEVFSD_DIR}/devfsd.bz2" ] || gen_die 'Could not find compressed devfsd.bz2 binary!'
- mv "${TEMP}/${DEVFSD_DIR}/devfsd.bz2" "${DEVFSD_BINCACHE}" || gen_die 'Could not move compressed binary to the package cache!'
-
- cd "${TEMP}"
- rm -rf "${DEVFSD_DIR}" > /dev/null
- fi
-}
-
compile_device_mapper() {
if [ ! -f "${DEVICE_MAPPER_BINCACHE}" ]
then
set_config_with_override 1 EVMS CMD_EVMS
set_config_with_override 1 DMRAID CMD_DMRAID
set_config_with_override 1 BUSYBOX CMD_BUSYBOX "yes"
- set_config_with_override 1 DEVFS CMD_UNDEFINED_CMD "no"
-
set_config_with_override 1 DISKLABEL CMD_DISKLABEL
set_config_with_override 1 LUKS CMD_LUKS
set_config_with_override 1 MDADM CMD_MDADM
CACHE_DIR=`arch_replace "${CACHE_DIR}"`
BUSYBOX_BINCACHE=`cache_replace "${BUSYBOX_BINCACHE}"`
- DEVFSD_BINCACHE=`cache_replace "${DEVFSD_BINCACHE}"`
- DEVFSD_CONF_BINCACHE=`cache_replace "${DEVFSD_CONF_BINCACHE}"`
DEVICE_MAPPER_BINCACHE=`cache_replace "${DEVICE_MAPPER_BINCACHE}"`
LVM_BINCACHE=`cache_replace "${LVM_BINCACHE}"`
DMRAID_BINCACHE=`cache_replace "${DMRAID_BINCACHE}"`
fi
if [ -e '/dev/loop0' -o -e '/dev/loop/0' -a ${PIPESTATUS[1]} ]
then
- # We found devfs or standard dev loop device, assume
- # loop is compiled into the kernel or the module is loaded
+ # We found a standard dev loop device, assume loop is compiled into the
+ # kernel or the module is loaded
return 0
else
return 1
append_data 'base_layout'
append_data 'auxilary'
append_data 'busybox' "${BUSYBOX}"
-# append_data 'devfs' "${DEVFS}"
append_data 'lvm' "${LVM}"
append_data 'dmraid' "${DMRAID}"
append_data 'evms' "${EVMS}"
echo "/dev/ram0 / ext2 defaults 0 0" > ${TEMP}/initrd-temp/etc/fstab
echo "proc /proc proc defaults 0 0" >> ${TEMP}/initrd-temp/etc/fstab
- if [ "${NODEVFSD}" = '' ]
- then
- echo "REGISTER .* MKOLDCOMPAT" > ${TEMP}/initrd-temp/etc/devfsd.conf
- echo "UNREGISTER .* RMOLDCOMPAT" >> ${TEMP}/initrd-temp/etc/devfsd.conf
- echo "REGISTER .* MKNEWCOMPAT" >> ${TEMP}/initrd-temp/etc/devfsd.conf
- echo "UNREGISTER .* RMNEWCOMPAT" >> ${TEMP}/initrd-temp/etc/devfsd.conf
- fi
-
# SGI LiveCDs need the following binary (no better place for it than here)
# getdvhoff is a DEPEND of genkernel, so it *should* exist
if [ ${BUILD_INITRAMFS} -eq '1' ]
gen_die 'Could not extract busybox bincache!'
chmod +x "${TEMP}/initrd-temp/bin/busybox"
- # devfsd
- if [ "${KERN_24}" -eq '1' ]
- then
- cp "${DEVFSD_BINCACHE}" "${TEMP}/initrd-temp/bin/devfsd.bz2" || gen_die 'Could not copy devfsd executable from bincache!'
- bunzip2 "${TEMP}/initrd-temp/bin/devfsd.bz2" || gen_die 'Could not uncompress devfsd!'
- chmod +x "${TEMP}/initrd-temp/bin/devfsd"
- fi
-
# DMRAID
if [ "${DMRAID}" -eq '1' ]
then
PATH="/usr/sbin:/usr/bin:/sbin:/bin"
-# Default to the udev device manager
-USE_UDEV_NORMAL='1'
-
# Insert ctrl character
# ctrl-V then esc will print ^[
# ctrl-V then ctrl-shift-m will print ^M
mount_sysfs() {
if [ "${KV_2_6_OR_GREATER}" ]
then
- # Udev is semi-broken on non /sys sysfs mount points.
mount -t sysfs /sys /sys >/dev/null 2>&1
ret=$?
-
- # sysfs mount failed .. udev wont work fall back to devfs if available
- [ "$ret" -eq '0' ] || USE_UDEV_NORMAL=0
+ [ "$ret" -eq '0' ] || bad_msg "Failed to mount /sys!"
fi
}
findnfsmount() {
-
if [ "${IP}" != '' ] || busybox udhcpc -R rootpath -n -s /bin/udhcpc.scripts
then
[ -e /rootpath ] && NFSROOT=`cat /rootpath`
fi
}
-kill_devfsd() {
- killall devfsd > /dev/null 2>&1
-}
-
check_loop() {
if [ "${LOOP}" = '' -o ! -e "mnt/cdrom/${LOOP}" ]
then
}
setup_hotplug() {
- # Check udev is available...
- if [ "${KV_2_6_OR_GREATER}" -a "${USE_UDEV_NORMAL}" != '0' ]
- then
- USE_UDEV_NORMAL=1
- else
- USE_UDEV_NORMAL=0
- fi
-
- if [ "${USE_UDEV_NORMAL}" = '1' ]
+ if [ "${KV_2_6_OR_GREATER}" ]
then
- # catch udev hotplug events
echo /sbin/mdev > /proc/sys/kernel/hotplug
fi
}
-start_dev_mgr() {
- # Check udev is available...
- if [ "${KV_2_6_OR_GREATER}" -a "${USE_UDEV_NORMAL}" != '0' ]
- then
- USE_UDEV_NORMAL=1
- else
- USE_UDEV_NORMAL=0
- fi
+check_slowusb() {
+ [ "${DO_slowusb}" ] || \
+ for dir in /sys/bus/usb/drivers/usb-storage/*
+ do
+ [ -d "${dir}" ] && FORCE_slowusb="1"
+ done
+}
- if [ "${USE_UDEV_NORMAL}" = '1' ]
+start_dev_mgr() {
+ if [ "${KV_2_6_OR_GREATER}" ]
then
cd /sys
[ "${DO_slowusb}" ] && sleep 10
- kill_devfsd
+ check_slowusb
+ [ "${FORCE_slowusb}" ] && sleep 10
good_msg 'Activating mdev'
runmdev
- [ "${DO_slowusb}" ] && sleep 20
+ [ "${DO_slowusb}" ] || \
+ [ "${FORCE_slowusb}" ] && sleep 20
cd /
- else
- good_msg 'Activating devfs'
- mount -t devfs devfs /dev 2>/dev/null
- devfsd /dev -np
fi
}
cmdline_hwopts() {
# Scan CMDLINE for any "doscsi" or "noscsi"-type arguments
-
local FOUND
local TMP_HWOPTS
# Delay if needed for USB hardware
sdelay
-# Start udev/devfs
+# Start device manager
start_dev_mgr
# Setup md device nodes if they dont exist
# Let Init scripts know that we booted from CD
export CDBOOT
CDBOOT=1
+ check_slowusb
if [ "${DO_slowusb}" ] || [ "${FORCE_slowusb}" ]
then
sleep 10
fi
echo -ne "${BOLD}.${NORMAL}"
- if /tmp/.initrd/bin/[ "${USE_DEVFS_NORMAL}" = '1' -a "${CDROOT}" = 0 ]
- then
- umount /tmp/.initrd/proc || echo '*: Failed to unmount the initrd /proc!'
- mount -n --move /tmp/.initrd/dev dev || echo '*: Failed to move over the /dev tree!'
- rm -rf /tmp/.initrd/dev || echo '*: Failed to remove the initrd /dev!'
- elif /tmp/.initrd/bin/[ "${USE_UDEV_NORMAL}" = '1' ]
- then
- /tmp/.initrd/bin/[ -e /tmp/.initrd/dev/fd ] && rm /tmp/.initrd/dev/fd
- /tmp/.initrd/bin/[ -e /tmp/.initrd/dev/stdin ] && rm /tmp/.initrd/dev/stdin
- /tmp/.initrd/bin/[ -e /tmp/.initrd/dev/stdout ] && rm /tmp/.initrd/dev/stdout
- /tmp/.initrd/bin/[ -e /tmp/.initrd/dev/stderr ] && rm /tmp/.initrd/dev/stderr
- /tmp/.initrd/bin/[ -e /tmp/.initrd/dev/core ] && rm /tmp/.initrd/dev/core
- umount /tmp/.initrd/dev || echo '*: Failed to unmount the initrd /dev!'
- umount /tmp/.initrd/proc || echo '*: Failed to unmount the initrd /proc!'
- umount /tmp/.initrd/sys || echo '*: Failed to unmount the initrd /sys!'
- elif /tmp/.initrd/bin/[ "${CDROOT}" -eq 1 ]
- then
- umount /tmp/.initrd/proc || echo "*: Failed to unmount the initrd /proc!"
- umount /dev 2>/dev/null
- mount -n --move /tmp/.initrd/dev dev 2>/dev/null
- rm -rf /tmp/.initrd/dev || echo '*: Failed to remove the initrd /dev!'
-
- umount /sys 2>/dev/null
- umount /tmp/.initrd/sys 2>/dev/null
- fi
+ /tmp/.initrd/bin/[ -e /tmp/.initrd/dev/fd ] && rm /tmp/.initrd/dev/fd
+ /tmp/.initrd/bin/[ -e /tmp/.initrd/dev/stdin ] && rm /tmp/.initrd/dev/stdin
+ /tmp/.initrd/bin/[ -e /tmp/.initrd/dev/stdout ] && rm /tmp/.initrd/dev/stdout
+ /tmp/.initrd/bin/[ -e /tmp/.initrd/dev/stderr ] && rm /tmp/.initrd/dev/stderr
+ /tmp/.initrd/bin/[ -e /tmp/.initrd/dev/core ] && rm /tmp/.initrd/dev/core
+ umount /tmp/.initrd/dev || echo '*: Failed to unmount the initrd /dev!'
+ umount /tmp/.initrd/proc || echo '*: Failed to unmount the initrd /proc!'
+ umount /tmp/.initrd/sys || echo '*: Failed to unmount the initrd /sys!'
echo -ne "${BOLD}.${NORMAL}"
# /usr/src/linux/Documentation/initrd.txt:
#!/bin/bash
PATH="${PATH}:/sbin:/usr/sbin"
-GK_V='3.4.10_pre1'
+GK_V='3.4.10_pre2'
# Set the default for TMPDIR. May be modified by genkernel.conf or the
# --tempdir command line option.
then
[ "${DISKLABEL}" -eq '1' ] && compile_e2fsprogs
- if [ "${KERN_24}" -eq '1' ]
- then
- compile_devfsd
- fi
-
if [ "${KERN_24}" != '1' ]
then
if [ "${BUSYBOX}" -eq '1' ]
system.
.RE
.TP
-\fB\-\-no-udev\fR
-Force devfs on 2.6 series kernels. Not recommended or supported.
-.TP
\fB\-\-static\fR
This builds a monolithic kernel without any modules on any initial ramdisks.
.TP
BUSYBOX_DIR="busybox-${BUSYBOX_VER}"
BUSYBOX_BINCACHE="%%CACHE%%/busybox-${BUSYBOX_VER}-%%ARCH%%.tar.bz2"
-DEVFSD_VER="1.3.25-dietlibc-kernel25"
-DEVFSD_SRCTAR="${GK_SHARE}/pkg/devfsd-${DEVFSD_VER}.tar.bz2"
-DEVFSD_DIR="devfsd"
-DEVFSD_BINCACHE="%%CACHE%%/devfsd-${DEVFSD_VER}-%%ARCH%%.bz2"
-DEVFSD_CONF_BINCACHE="%%CACHE%%/devfsd-conf-${DIETLIBC_VER}-%%ARCH%%.bz2"
-
DEVICE_MAPPER_VER="VERSION_DMAP"
DEVICE_MAPPER_DIR="device-mapper.${DEVICE_MAPPER_VER}"
DEVICE_MAPPER_SRCTAR="${GK_SHARE}/pkg/device-mapper.${DEVICE_MAPPER_VER}.tgz"