slackware-current/source/a/mkinitrd/setup.01.mkinitrd
Patrick J Volkerding 06728159b3 Sat Sep 14 18:15:34 UTC 2024
a/mkinitrd-1.4.11-x86_64-36.txz:  Rebuilt.
  setup.01.mkinitrd (aka geninitrd): Set GENINITRD_SILENT to anything to
  generate the initrd silently.
l/iso-codes-4.17.0-noarch-1.txz:  Upgraded.
l/libarchive-3.7.5-x86_64-1.txz:  Upgraded.
  This update fixes the following security issues:
  fix multiple vulnerabilities identified by SAST (#2251, #2256)
  cpio: ignore out-of-range gid/uid/size/ino and harden AFIO parsing (#2258)
  lzop: prevent integer overflow (#2174)
  rar4: protect copy_from_lzss_window_to_unp() (#2172, CVE-2024-20696)
  rar4: fix CVE-2024-26256 (#2269)
  rar4: fix OOB in delta and audio filter (#2148, #2149)
  rar4: fix out of boundary access with large files (#2179)
  rar4: add boundary checks to rgb filter (#2210)
  rar4: fix OOB access with unicode filenames (#2203)
  rar5: clear 'data ready' cache on window buffer reallocs (#2265)
  rpm: calculate huge header sizes correctly (#2158)
  unzip: unify EOF handling (#2175)
  util: fix out of boundary access in mktemp functions (#2160)
  uu: stop processing if lines are too long (#2168)
  For more information, see:
    https://www.cve.org/CVERecord?id=CVE-2024-20696
    https://www.cve.org/CVERecord?id=CVE-2024-26256
  (* Security fix *)
l/python-hatch-vcs-0.4.0-x86_64-1.txz:  Added.
  This is needed to build urllib3-2.2.3.
l/python-idna-3.9-x86_64-1.txz:  Upgraded.
l/python-urllib3-2.2.3-x86_64-1.txz:  Upgraded.
n/bind-9.20.1-x86_64-1.txz:  Upgraded.
xap/xlockmore-5.79-x86_64-1.txz:  Upgraded.
2024-09-14 20:58:45 +02:00

53 lines
1.9 KiB
Bash

#!/bin/sh
#BLURB="Generate /boot/initrd.gz for the generic kernel"
# Load defaults:
if [ -r etc/default/geninitrd ]; then
. etc/default/geninitrd
fi
if [ -z "$KERNEL_SYMLINK" ]; then
KERNEL_SYMLINK="boot/vmlinuz-generic"
elif [ "$(echo $KERNEL_SYMLINK | cut -b 1)" = "/" ]; then # trim to make a relative path
KERNEL_SYMLINK="$(echo $KERNEL_SYMLINK | cut -b 2-)"
fi
# Find the kernel version:
if [ -r $KERNEL_SYMLINK ]; then
KERNEL_VERSION=$(strings $KERNEL_SYMLINK | grep '([^ ]*@[^ ]*) #' | cut -f1 -d' ')
fi
# Assume the kernel "name" aka flavor is just the second part of the symlink name:
KERNEL_NAME="$(echo $KERNEL_SYMLINK | rev | cut -f 1 -d - | rev)"
# Sometimes mkinitrd_command_generator.sh does not detect LVM properly. Until I
# get to the bottom of that, it's safer to just always include LVM support.
LVM_OPTION="-L"
# Generate the initrd:
if [ ! -z $KERNEL_VERSION ]; then
if [ -z "$GENINITRD_SILENT" ]; then
dialog --title "GENERATING INITIAL RAMDISK" --infobox \
"Generating an initial ramdisk for use with the $KERNEL_VERSION kernel. \
The initial ramdisk contains kernel modules needed to mount the \
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 \
installed kernel." 8 70
fi
chroot . /usr/share/mkinitrd/mkinitrd_command_generator.sh -k $KERNEL_VERSION -a "$LVM_OPTION -o /boot/initrd-${KERNEL_VERSION}-${KERNEL_NAME}.img" | chroot . bash 1> /dev/null 2> /dev/null
fi
if [ "$GENINITRD_NAMED_SYMLINK" = "true" ]; then
( cd boot
rm -f initrd-${KERNEL_NAME}.img
ln -sf initrd-${KERNEL_VERSION}-${KERNEL_NAME}.img initrd-${KERNEL_NAME}.img
)
fi
if [ "$GENINITRD_INITRD_GZ_SYMLINK" = "true" ]; then
( cd boot
rm -f initrd.gz
ln -sf initrd-${KERNEL_VERSION}-${KERNEL_NAME}.img initrd.gz
)
fi