From ee861a17268a54a17b3b321d9a1ff82ed547e606 Mon Sep 17 00:00:00 2001 From: Patrick J Volkerding Date: Tue, 26 Apr 2022 19:45:46 +0000 Subject: Tue Apr 26 19:45:46 UTC 2022 a/mkinitrd-1.4.11-x86_64-29.txz: Rebuilt. Support mounting additional partitions from the initrd - useful for anyone still stuck with a separated /usr. ;-) Thanks to PiterPunk. Ensure that the target directory exists before trying to copy a module into it (workaround for coreutils 9.1 behavior change). ap/vim-8.2.4830-x86_64-1.txz: Upgraded. l/SDL2-2.0.22-x86_64-1.txz: Upgraded. l/elfutils-0.187-x86_64-1.txz: Upgraded. l/fluidsynth-2.2.7-x86_64-1.txz: Upgraded. n/gnupg2-2.2.35-x86_64-1.txz: Upgraded. xap/vim-gvim-8.2.4830-x86_64-1.txz: Upgraded. xap/xpdf-4.04-x86_64-1.txz: Upgraded. --- source/a/mkinitrd/mkinitrd | 23 ++++++++++++++++++++--- 1 file changed, 20 insertions(+), 3 deletions(-) (limited to 'source/a/mkinitrd/mkinitrd') diff --git a/source/a/mkinitrd/mkinitrd b/source/a/mkinitrd/mkinitrd index 3c90f06bd..75d7ced66 100644 --- a/source/a/mkinitrd/mkinitrd +++ b/source/a/mkinitrd/mkinitrd @@ -57,6 +57,9 @@ # to add libargon2 and libgcc_s for cryptsetup LUKS2 support; add # jfs and xfs repair tools to initrd if those filesystems are used; # fixes and enhancements to docs +# Modified by Piter Punk 25 April 2022 +# Add support to specify additional filesystems to be mounted by +# initrd. Useful for those that have a separated '/usr' MKINITRD_VERSION=1.4.11 @@ -127,8 +130,11 @@ initrd, and the script is easy to modify. Be creative. :-) -B Add /sbin/btrfs to enable scanning for a root filesystem that is part of a Btrfs multi-device filesystem. -M Add the files in /etc/modprobe.d/ and /lib/modprobe.d/ to the initrd - -P Prepend the output image with the microcode CPIO archive given in arguments. + -P Prepend the output image with the microcode CPIO archive given in + arguments. -R Add support for RAID partitions + -MNT Additional filesystems to be mounted by initrd. Multiple mount + entries can be specified in a list separated by colon (:). -V Display version number A simple example: Build an initrd for a reiserfs root partition: @@ -428,8 +434,11 @@ while [ ! -z "$1" ]; do exit 1 fi shift 2 - ;; - + ;; + -MNT) + MOUNT_LIST="$2" + shift 2 + ;; -R) RAID=1 shift @@ -664,6 +673,14 @@ if [ ! -z "$CRYPT" -o ! -z "$LVM" ]; then $SOURCE_TREE/lib/udev/rules.d/95-dm-initrd.rules fi +# If there is additional filesystems to be mounted, copy their configuration +# from system's /etc/fstab: +if [ ! -z "$MOUNT_LIST" ]; then + for MOUNT_POINT in $(echo $MOUNT_LIST | tr : \ ); do + grep '^[^#[:space:]]\+[[:space:]]\+'$MOUNT_POINT'[[:space:]]' /etc/fstab + done > $SOURCE_TREE/addfstab +fi + # Make module directories: for kver in $(echo ${KERNEL_VERSION} | tr ':' '\n') ; do if [ ! -d $SOURCE_TREE/lib/modules/$kver ]; then -- cgit v1.2.3-65-gdbad