2019-01-23 23:02:34 +01:00
|
|
|
#!/bin/sh
|
|
|
|
#BLURB="Generate /boot/initrd.gz for the generic kernel"
|
|
|
|
|
2019-03-03 23:03:39 +01:00
|
|
|
# Start with the version for vmlinuz-generic-smp:
|
|
|
|
KERNEL_SYMLINK="boot/vmlinuz-generic-smp"
|
|
|
|
if [ -L $KERNEL_SYMLINK ]; then
|
|
|
|
KERNEL_VERSION_LIST=$(strings $KERNEL_SYMLINK | grep '([^ ]*@[^ ]*) #' | cut -f1 -d' ')
|
2019-01-23 23:02:34 +01:00
|
|
|
fi
|
|
|
|
|
2019-03-03 23:03:39 +01:00
|
|
|
# Next add the version for vmlinuz-generic:
|
2019-01-26 05:15:08 +01:00
|
|
|
KERNEL_SYMLINK="boot/vmlinuz-generic"
|
|
|
|
if [ -L $KERNEL_SYMLINK ]; then
|
2019-03-03 23:03:39 +01:00
|
|
|
if [ -z $KERNEL_VERSION_LIST ]; then
|
|
|
|
KERNEL_VERSION_LIST=$(strings $KERNEL_SYMLINK | grep '([^ ]*@[^ ]*) #' | cut -f1 -d' ')
|
2019-01-26 05:15:08 +01:00
|
|
|
else
|
2019-03-03 23:03:39 +01:00
|
|
|
KERNEL_VERSION_LIST="$KERNEL_VERSION_LIST:$(strings $KERNEL_SYMLINK | grep '([^ ]*@[^ ]*) #' | cut -f1 -d' ')"
|
2019-01-26 05:15:08 +01:00
|
|
|
fi
|
2019-01-23 23:02:34 +01:00
|
|
|
fi
|
|
|
|
|
2019-03-03 23:03:39 +01:00
|
|
|
# Proper plural(s):
|
|
|
|
if echo $KERNEL_VERSION_LIST | grep -q : ; then
|
|
|
|
KERNEL=kernels
|
|
|
|
else
|
|
|
|
KERNEL=kernel
|
|
|
|
fi
|
|
|
|
|
|
|
|
# Generate the initrd:
|
|
|
|
if [ ! -z $KERNEL_VERSION_LIST ]; then
|
|
|
|
dialog --title "GENERATING INITIAL RAMDISK" --infobox \
|
|
|
|
"Generating an initial ramdisk for use with the $KERNEL_VERSION_LIST generic \
|
|
|
|
${KERNEL}. The initial ramdisk contains kernel modules needed to mount the \
|
2019-01-23 23:02:34 +01:00
|
|
|
root partition, and must be regenerated whenever the kernel is updated. To \
|
|
|
|
regenerate the initrd, select this setup script from within pkgtool, or run \
|
|
|
|
'geninitrd' which will produce an initial ramdisk (/boot/initrd.gz) for the \
|
2019-03-03 23:03:39 +01:00
|
|
|
installed generic ${KERNEL}." 9 68
|
|
|
|
chroot . /usr/share/mkinitrd/mkinitrd_command_generator.sh -k $KERNEL_VERSION_LIST | chroot . bash 1> /dev/null 2> /dev/null
|
2019-01-23 23:02:34 +01:00
|
|
|
fi
|