# based on mkinitrd from RedHat Linux
#
-GENINITRD_RCSID='$Revision$ $Date:: $'
-R=${GENINITRD_RCSID#* *}; VERSION=${R%% *}
+VERSION='devel'
PROGRAM=${0##*/}
. /etc/rc.d/init.d/functions
# setup geninitrd modules
geninitrd_setup_mods() {
- local mod rcsid
+ local mod
for mod in $GENINITRD_MODS; do
- eval rcsid=$(echo \$$mod | LC_ALL=C tr '[a-z]' '[A-Z]')_RCSID
- debug "# $rcsid (mod-$mod)"
+ debug "# $mod"
# some mods want init
if type setup_mod_$mod > /dev/null; then
initrd_gen_setrootdev() {
verbose "Adding rootfs finding based on kernel cmdline root= option support."
busybox_applet ls
- debug "Current /proc/partitions:\n$(sed -e 's,^,> ,' /proc/partitions)"
+ debug "Current /proc/partitions:\n$(sed -e 's,^,| ,' /proc/partitions)"
add_linuxrc <<-'EOF'
if [ "${ROOT##/dev/}" != "${ROOT}" ]; then
rootnr="$(busybox awk -v rootnode="${ROOT##/dev/}" '$4 == rootnode { print 256 * $1 + $2 }' /proc/partitions)"
kernel_version=$(echo "$kernel" | awk -F. '{gsub(/[_-].*/, "", $0); print sprintf("%03d%03d",$1,$2)}')
kernel_version_long=$(echo "$kernel" | awk -F. '{gsub(/[_-].*/, "", $0); print sprintf("%03d%03d%03d",$1,$2,$3)}')
-verbose "# $GENINITRD_RCSID (geninitrd)"
+verbose "# geninitrd $VERSION"
debug "Using _lib: $_lib"
debug "Using initrd_dir: $initrd_dir"
add_linuxrc <<EOF
#!/bin/sh
-# initrd generated
+# initrd generated by geninitrd/$VERSION
# on $(LC_ALL=C date)
-# by $GENINITRD_RCSID
EOF
mount_proc
initrd_gen_fbsplash
initrd_gen_fbcondecor
-debug "Current /linuxrc:\n$(sed -e 's,^,> ,' $DESTDIR/linuxrc)"
+debug "Current /linuxrc:\n$(sed -e 's,^,| ,' $DESTDIR/linuxrc)"
IMAGE=$(mktemp -t initrd.img-XXXXXX) || die "mktemp failed"