[packages/geninitrd] up to 12818

atler atler at pld-linux.org
Mon Nov 7 00:37:56 CET 2022


commit 585ddd27c6a0ba8ea45214afb397f8e320c57b66
Author: Jan Palus <atler at pld-linux.org>
Date:   Mon Nov 7 00:37:32 2022 +0100

    up to 12818

 geninitrd-git.patch | 611 ----------------------------------------------------
 geninitrd.spec      |  12 +-
 2 files changed, 5 insertions(+), 618 deletions(-)
---
diff --git a/geninitrd.spec b/geninitrd.spec
index 8900321..8f5a3e3 100644
--- a/geninitrd.spec
+++ b/geninitrd.spec
@@ -1,15 +1,14 @@
 Summary:	Creates an initial ramdisk image for preloading modules
 Summary(pl.UTF-8):	Narzędzie do tworzenia inicjalnego ramdysku używanego przy starcie systemu
 Name:		geninitrd
-Version:	12787
-Release:	10
+Version:	12818
+Release:	1
 License:	GPL
 Group:		Applications/System
 Source0:	%{name}-%{version}.tar.gz
-# Source0-md5:	35b12ef61ee1e29692d67afd94731697
-Patch0:		%{name}-git.patch
-Patch1:		%{name}-static-dev.patch
-Patch2:		%{name}-posix-sh.patch
+# Source0-md5:	2ad3c37b949fb84c30b2724db30ff0d9
+Patch0:		%{name}-static-dev.patch
+Patch1:		%{name}-posix-sh.patch
 URL:		http://git.pld-linux.org/?p=projects/geninitrd.git
 BuildRequires:	xmlto >= 0:0.0.18-1
 Requires:	/usr/bin/ldd
@@ -84,7 +83,6 @@ bieżących informacji zawartych w /etc/modules.conf.
 %setup -q
 %patch0 -p1
 %patch1 -p1
-%patch2 -p1
 
 %build
 %{__make}
diff --git a/geninitrd-git.patch b/geninitrd-git.patch
deleted file mode 100644
index beb8906..0000000
--- a/geninitrd-git.patch
+++ /dev/null
@@ -1,611 +0,0 @@
-commit 33cc4751b8f80fc3b800928b9ad93866b2569915
-Author: Arkadiusz Miśkiewicz <arekm at maven.pl>
-Date:   Tue Dec 18 14:33:12 2018 +0100
-
-    Install blkid in /sbin because udevd expects it to be there.
-
-diff --git a/geninitrd b/geninitrd
-index a79b9c3..118333c 100755
---- a/geninitrd
-+++ b/geninitrd
-@@ -1530,7 +1530,7 @@ chmod a+rx "$RCFILE"
- ln -s linuxrc $DESTDIR/init
- 
- # create dirs that we really need
--inst_d /{lib,bin,etc,dev{,/pts,/shm},loopfs,var,proc,run,sys,tmp}
-+inst_d /{lib,bin,sbin,etc,dev{,/pts,/shm},loopfs,var,proc,run,sys,tmp}
- 
- modules_install "$MODULES"
- 
-diff --git a/mod-blkid.sh b/mod-blkid.sh
-index 8ee2a48..92df9ae 100644
---- a/mod-blkid.sh
-+++ b/mod-blkid.sh
-@@ -22,12 +22,12 @@ initrd_gen_blkid() {
- 	fi
- 	verbose "Adding BLKID support to initrd"
- 
--	inst_exec $blkid /bin/blkid
-+	inst_exec $blkid /sbin/blkid
- 	initrd_gen_devices
- 	add_linuxrc <<-'EOF'
- 		# if built with blkid change ROOT=LABEL=something into ROOT=/dev/device parsed by blkid
- 		if [ "${ROOT##LABEL=}" != "${ROOT}" -o "${ROOT##UUID=}" != "${ROOT}" ]; then
--			blkid="$(/bin/blkid -t $ROOT -o device -l)"
-+			blkid="$(/sbin/blkid -t $ROOT -o device -l)"
- 			if [ -n "$blkid" ]; then
- 				ROOT=$blkid
- 			fi
-
-commit dc5ca733ed6fe57dfa39d4598a6586069e41d0b0
-Author: Arkadiusz Miśkiewicz <arekm at maven.pl>
-Date:   Tue Dec 18 14:34:38 2018 +0100
-
-    Install mdadm in /sbin because udevd expects it to be there.
-
-diff --git a/mod-md.sh b/mod-md.sh
-index 2b6f587..a358517 100644
---- a/mod-md.sh
-+++ b/mod-md.sh
-@@ -133,7 +133,7 @@ initrd_gen_md() {
- 	fi
- 	verbose "Setting up mdadm..."
- 
--	inst_exec $mdadm /bin/mdadm
-+	inst_exec $mdadm /sbin/mdadm
- 
- 	echo "DEVICE partitions containers" >> "$DESTDIR/etc/mdadm.conf"
- 
-@@ -181,7 +181,7 @@ initrd_gen_md() {
- 
- 	echo "wait_for_files $cr_dev_list" | add_linuxrc
- 	add_linuxrc <<-'EOF'
--	mdadm --assemble --scan
-+	/sbin/mdadm --assemble --scan
- 
- 	if [ "$DEBUGINITRD" ]; then
- 		[ -e /proc/mdstat ] && echo "/proc/mdstat contents:" && cat /proc/mdstat
-
-commit 3d81f1cd0bc557ad9a1f157b403f0396866c648c
-Author: Arkadiusz Miśkiewicz <arekm at maven.pl>
-Date:   Tue Dec 18 14:38:55 2018 +0100
-
-    udevd uses ata_id and scsi_id, so install these.
-
-diff --git a/mod-udev.sh b/mod-udev.sh
-index 422ef3e..a2491ee 100644
---- a/mod-udev.sh
-+++ b/mod-udev.sh
-@@ -41,9 +41,11 @@ setup_mod_udev() {
- initrd_gen_udev() {
- 	verbose "Setting up udev..."
- 
--	inst_d /sbin /etc/udev
-+	inst_d /sbin /etc/udev /lib/udev
- 	inst_exec $udevd /sbin/udevd
- 	inst_exec $udevadm /sbin/udevadm
-+	inst_exec /lib/udev/ata_id  /lib/udev/ata_id
-+	inst_exec /lib/udev/scsi_id /lib/udev/scsi_id
- 	inst /etc/udev/udev.conf /etc/udev/udev.conf
- 	# standard udev rules
- 	inst_rules 50-udev-default.rules 60-persistent-storage.rules 61-persistent-storage-edd.rules 80-drivers.rules 95-udev-late.rules \
-
-commit 21ad0f7980ce6a0135e4a3c37a94472ed4f1320c
-Author: Arkadiusz Miśkiewicz <arekm at maven.pl>
-Date:   Tue Dec 18 14:43:20 2018 +0100
-
-    Use existing mechanism for installing udev apps but install regular variants, too if initrd-variants don't exist.
-
-diff --git a/mod-udev.sh b/mod-udev.sh
-index a2491ee..87f4b68 100644
---- a/mod-udev.sh
-+++ b/mod-udev.sh
-@@ -44,8 +44,6 @@ initrd_gen_udev() {
- 	inst_d /sbin /etc/udev /lib/udev
- 	inst_exec $udevd /sbin/udevd
- 	inst_exec $udevadm /sbin/udevadm
--	inst_exec /lib/udev/ata_id  /lib/udev/ata_id
--	inst_exec /lib/udev/scsi_id /lib/udev/scsi_id
- 	inst /etc/udev/udev.conf /etc/udev/udev.conf
- 	# standard udev rules
- 	inst_rules 50-udev-default.rules 60-persistent-storage.rules 61-persistent-storage-edd.rules 80-drivers.rules 95-udev-late.rules \
-@@ -57,6 +55,8 @@ initrd_gen_udev() {
- 	for e in ata_id cdrom_id collect firmware scsi_id v4l_id; do
- 		if [ -e "$initrd_dir/udev/$e" ]; then
- 			inst_exec $initrd_dir/udev/$e /lib/udev/$e
-+		elif [ -e "/lib/udev/$e" ]; then
-+			inst_exec /lib/udev/$e /lib/udev/$e
- 		fi
- 	done
- 
-
-commit ad5033d7e704edaf52f2be18d4aa98c378179ede
-Author: Arkadiusz Miśkiewicz <arekm at maven.pl>
-Date:   Fri Jan 25 20:38:24 2019 +0100
-
-    Timeout here is not a good idea. rootfs cannot be mounted and kernel oopses due to that.
-
-diff --git a/mod-luks.sh b/mod-luks.sh
-index ff877f7..ffe87cb 100644
---- a/mod-luks.sh
-+++ b/mod-luks.sh
-@@ -162,7 +162,7 @@ luks_crypttab() {
- 			done
- 			IFS="$old_IFS"
- 
--			verbose "+ cryptsetup --timeout=120 ${keyfile:+-d $keyfile} open $crypttab_opt '$src' '$dst'"
-+			verbose "+ cryptsetup ${keyfile:+-d $keyfile} open $crypttab_opt '$src' '$dst'"
- 			add_linuxrc <<-EOF
- 			debugshell
- 
-@@ -189,7 +189,7 @@ luks_crypttab() {
- 				crypt_status=\$(cryptsetup \$cryptsetup_opt status '$dst')
- 				if [ "\${crypt_status%%is inactive*}" != "\$crypt_status" ]; then
- 					# is inactive
--					cryptsetup \$cryptsetup_opt ${keyfile:+-d $keyfile} --timeout 120 open $crypttab_opt "\$luksdev" '$dst' <&1
-+					cryptsetup \$cryptsetup_opt ${keyfile:+-d $keyfile} open $crypttab_opt "\$luksdev" '$dst' <&1
- 				fi
- 			fi
- 
-
-commit b565e95c147bea4e68e4ccf5ad19906d51d2375b
-Author: Arkadiusz Miśkiewicz <arekm at maven.pl>
-Date:   Wed May 15 21:04:45 2019 +0200
-
-    Prepend cpu microcode to initrd image, so kernel will pick it up when LILO is in use.
-
-diff --git a/geninitrd b/geninitrd
-index 118333c..b5d405a 100755
---- a/geninitrd
-+++ b/geninitrd
-@@ -17,6 +17,7 @@ PROGRAM=${0##*/}
- # list of geninitrd modules which need setup routine after commandline args parsing
- GENINITRD_MODS=""
- COMPRESS=yes
-+LILO_MICROCODE=yes
- STRIP=/usr/bin/strip
- target=""
- kernel=""
-@@ -1186,6 +1187,16 @@ compress_image() {
- 	mv -f "$tmp" "$target"
- }
- 
-+# prepend file to image
-+prepend_file_to_image() {
-+	local file="$1" target="$2" tmp
-+	tmp=$(mktemp "$target".XXXXXX) || die "mktemp failed"
-+
-+	cat "$file" "$target" > "$tmp" || return $?
-+
-+	mv -f "$tmp" "$target"
-+}
-+
- if [ -r /etc/sysconfig/geninitrd ]; then
- 	. /etc/sysconfig/geninitrd
- fi
-@@ -1801,6 +1812,14 @@ else
- 	cp -a "$IMAGE" "$target"
- fi
- 
-+# microcode support for lilo
-+if ! is_no "$LILO_MICROCODE"; then
-+	if [ -x /sbin/lilo -a -f "/boot/intel-ucode.img" ]; then
-+		verbose "Prepending $target with microcode image /boot/intel-ucode.img for LILO"
-+		prepend_file_to_image "/boot/intel-ucode.img" "$target"
-+	fi
-+fi
-+
- # XXX. check if bootsplash can output data to tmp dir not directly to initramfs image.
- initrd_gen_bootsplash "$target"
- 
-diff --git a/geninitrd.sysconfig b/geninitrd.sysconfig
-index ccf177c..1268324 100644
---- a/geninitrd.sysconfig
-+++ b/geninitrd.sysconfig
-@@ -18,6 +18,9 @@
- # Default is to use initramfs for >= 2.5.0.
- #INITRDFS=initramfs
- 
-+# Should we prepend cpu microcode when lilo is installed
-+#LILO_MICROCODE=no
-+
- ## Use udev to create /dev?
- USE_UDEV=yes
- 
-
-commit 662fd5a3adac2080640fa4eacd34d72504526175
-Author: Arkadiusz Miśkiewicz <arekm at maven.pl>
-Date:   Mon Jul 15 19:59:46 2019 +0200
-
-    Another way for findings usb keyboard drivers that works on newer kernels.
-
-diff --git a/mod-usbkbd.sh b/mod-usbkbd.sh
-index 0dd0d20..ff8f442 100644
---- a/mod-usbkbd.sh
-+++ b/mod-usbkbd.sh
-@@ -10,6 +10,23 @@ find_modules_usbkbd() {
- 
- 	local modules i module bInterfaceClass bInterfaceProtocol
- 
-+        for i in /sys/bus/usb/devices/*-*:*; do
-+                # standard usb keyboards
-+                if [ -f $i/bInterfaceClass -a -f $i/bInterfaceProtocol ]; then
-+                        bInterfaceClass=$(cat $i/bInterfaceClass)
-+                        bInterfaceProtocol=$(cat $i/bInterfaceProtocol)
-+                        if [ "$bInterfaceClass" = "03" -a "$bInterfaceProtocol" = "01" ]; then
-+                                module=$(readlink $i/driver/module)
-+                                module=$(basename $module)
-+
-+                                if [ -n "$module" ]; then
-+                                        verbose "Found USB Keyboard driver: $module"
-+                                        modules="$modules $module"
-+                                fi
-+                        fi
-+                fi
-+        done
-+
- 	for i in /sys/class/input/input*; do
- 		# standard usb keyboards
- 		if [ -f $i/device/bInterfaceClass -a -f $i/device/bInterfaceProtocol ]; then
-
-commit 4de5a3333e772ad198381f157c014e452e42c129
-Author: Elan Ruusamäe <glen at pld-linux.org>
-Date:   Mon Jul 15 23:56:58 2019 +0300
-
-    fix indent
-
-diff --git a/mod-usbkbd.sh b/mod-usbkbd.sh
-index ff8f442..35543b7 100644
---- a/mod-usbkbd.sh
-+++ b/mod-usbkbd.sh
-@@ -10,22 +10,22 @@ find_modules_usbkbd() {
- 
- 	local modules i module bInterfaceClass bInterfaceProtocol
- 
--        for i in /sys/bus/usb/devices/*-*:*; do
--                # standard usb keyboards
--                if [ -f $i/bInterfaceClass -a -f $i/bInterfaceProtocol ]; then
--                        bInterfaceClass=$(cat $i/bInterfaceClass)
--                        bInterfaceProtocol=$(cat $i/bInterfaceProtocol)
--                        if [ "$bInterfaceClass" = "03" -a "$bInterfaceProtocol" = "01" ]; then
--                                module=$(readlink $i/driver/module)
--                                module=$(basename $module)
-+	for i in /sys/bus/usb/devices/*-*:*; do
-+		# standard usb keyboards
-+		if [ -f $i/bInterfaceClass -a -f $i/bInterfaceProtocol ]; then
-+			bInterfaceClass=$(cat $i/bInterfaceClass)
-+			bInterfaceProtocol=$(cat $i/bInterfaceProtocol)
-+			if [ "$bInterfaceClass" = "03" -a "$bInterfaceProtocol" = "01" ]; then
-+				module=$(readlink $i/driver/module)
-+				module=$(basename $module)
- 
--                                if [ -n "$module" ]; then
--                                        verbose "Found USB Keyboard driver: $module"
--                                        modules="$modules $module"
--                                fi
--                        fi
--                fi
--        done
-+				if [ -n "$module" ]; then
-+					verbose "Found USB Keyboard driver: $module"
-+					modules="$modules $module"
-+				fi
-+			fi
-+		fi
-+	done
- 
- 	for i in /sys/class/input/input*; do
- 		# standard usb keyboards
-
-commit 04b32086569a126d5d6f9bd0ad1b0db9f142f50e
-Author: Arkadiusz Miśkiewicz <arekm at maven.pl>
-Date:   Sun Jul 21 21:04:05 2019 +0200
-
-    Try to detect a need for nvme driver. If you know better method then share with us.
-
-diff --git a/geninitrd b/geninitrd
-index b5d405a..05e290a 100755
---- a/geninitrd
-+++ b/geninitrd
-@@ -673,6 +673,11 @@ find_modules_for_devpath() {
- 		return
- 	fi
- 
-+	if [[ "$devpath" == /dev/nvme* ]]; then
-+		find_module "nvme"
-+		return
-+	fi
-+
- 	if [[ "$devpath" == /dev/bcache* ]]; then
- 		find_modules_bcache "$devpath"
- 		return
-
-commit 43d2f37d89034a2e409bb4f66cca1a64b12130b8
-Author: Arkadiusz Miśkiewicz <arekm at maven.pl>
-Date:   Mon Nov 25 20:15:24 2019 +0100
-
-    Accept d/D symbols, too (ffffffff825ca52c D __initramfs_start) as noticed in recent 4.19.85-1 kernel.
-
-diff --git a/geninitrd b/geninitrd
-index 05e290a..052f553 100755
---- a/geninitrd
-+++ b/geninitrd
-@@ -1097,7 +1097,7 @@ sym_exists() {
- 		return 1
- 	fi
- 
--	awk -vc=1 -vsymbol="$symbol" '($2 == "T" || $2 == "t") && $3 == symbol {c = 0} END {exit c}' $mapfile
-+	awk -vc=1 -vsymbol="$symbol" '(tolower($2) == "t" || tolower($2) == "d") && $3 == symbol {c = 0} END {exit c}' $mapfile
- }
- 
- # find best compressor (or forced one) for initrd
-
-commit b4c7f62cc3963af683b69092fb2f44076d5e3bb3
-Author: Arkadiusz Miśkiewicz <arekm at maven.pl>
-Date:   Tue Feb 4 22:28:16 2020 +0100
-
-    glibc 2.31 ldd prints 'not a dynamic executable' on stderr, so silence it.
-
-diff --git a/geninitrd b/geninitrd
-index 052f553..e9832ef 100755
---- a/geninitrd
-+++ b/geninitrd
-@@ -551,7 +551,7 @@ inst_exec() {
- 		esac
- 
- 
--		libs=$(ldd "$obj" | awk '/statically|linux-(gate|vdso)\.so/{next} NF == 2 {print $1} /=/{print $3}' | sort -u)
-+		libs=$(ldd "$obj" 2> /dev/null | awk '/statically|linux-(gate|vdso)\.so/{next} NF == 2 {print $1} /=/{print $3}' | sort -u)
- 		for lib in $libs $libs_additional; do
- 			libdir=$(cd $(dirname "$lib"); pwd)
- 			if [ ! -f "$DESTDIR/$lib" ]; then
-@@ -566,7 +566,7 @@ inst_exec() {
- 	for _lib in $(get_libdir LIBDIR); do
- 		if [ -f $DESTDIR/$_lib/libc.so.0 ]; then
- 			lib=$DESTDIR/$_lib/libc.so.0
--			lib=$(ldd "$lib" | awk '/statically|linux-(gate|vdso)\.so/{next} NF == 2 {print $1} /=/{print $3}' | sort -u)
-+			lib=$(ldd "$lib" 2> /dev/null | awk '/statically|linux-(gate|vdso)\.so/{next} NF == 2 {print $1} /=/{print $3}' | sort -u)
- 			libdir=$(cd $(dirname "$lib"); pwd)
- 			if [ ! -e $DESTDIR$libdir ]; then
- 				libdir=$(dirname "$libdir")
-
-commit b6efb8e39496d74852f353e5142d5cb076d7540f
-Author: Arkadiusz Miśkiewicz <arekm at maven.pl>
-Date:   Thu Feb 6 17:34:03 2020 +0100
-
-    Move /run mount to newroot. Always mount run for easier transition to /run hierarchy later.
-
-diff --git a/geninitrd b/geninitrd
-index e9832ef..7f5495f 100755
---- a/geninitrd
-+++ b/geninitrd
-@@ -288,8 +288,7 @@ umount_all() {
- 
- 	if is_yes "$run_mounted"; then
- 		add_linuxrc <<-EOF
--		mount --bind /run /newroot/run
--		umount /run
-+		mount -n --move /run /newroot/run
- 		EOF
- 		run_mounted=no
- 	fi
-@@ -1653,6 +1652,7 @@ EOF
- 
- # mount early
- mount_tmp
-+mount_run
- 
- modules_add_linuxrc $MODULES
- 
-
-commit 4335c9501bcb9780d486af197354af2ccb1eae89
-Author: Jan Palus <atler at pld-linux.org>
-Date:   Thu Nov 12 11:46:39 2020 +0100
-
-    don't try to expand pci devices if pci bus is missing
-
-diff --git a/functions b/functions
-index 9015cc3..3a52190 100644
---- a/functions
-+++ b/functions
-@@ -209,10 +209,12 @@ find_modules_by_class_kmod() {
- 		return
- 	fi
- 
--	for i in $(grep -li "^0x${req_class}" /sys/devices/pci*/*/class); do
--		j=$(dirname $i)
--		modaliases="$modaliases $(cat $j/modalias)"
--	done
-+	if ls /sys/devices | grep -q '^pci'; then
-+		for i in $(grep -li "^0x${req_class}" /sys/devices/pci*/*/class); do
-+			j=$(dirname $i)
-+			modaliases="$modaliases $(cat $j/modalias)"
-+		done
-+	fi
- 
- 	if [ -z "$modaliases" ]; then
- 		return
-
-commit 152a5bf18b37b825a9b6677153aa5af54df94d7b
-Author: Arkadiusz Miśkiewicz <arekm at maven.pl>
-Date:   Sat Dec 26 01:03:50 2020 +0100
-
-    - swsusp support from mis at pld-linux
-
-diff --git a/Makefile b/Makefile
-index 1994b97..a9039b1 100644
---- a/Makefile
-+++ b/Makefile
-@@ -1,7 +1,7 @@
- # when making release, make sure you do it as RELEASE document describes
- NAME		:= geninitrd
- VERSION		:= $(shell test -d .git && git describe --tags || echo git)
--MODS		:= ide luks multipath dmraid lvm md blkid udev tuxonice suspend fbsplash condecor bootsplash uvesafb nfs sata scsi usbkbd bcache
-+MODS		:= ide luks multipath dmraid lvm md blkid udev tuxonice suspend swsusp fbsplash condecor bootsplash uvesafb nfs sata scsi usbkbd bcache
- FILES_MODS  := $(MODS:%=mod-%.sh)
- FILES_ADDON := extract-ikconfig
- FILES_UDEV  := 01-ignore.rules 59-persistent-storage.rules 61-persistent-storage.rules 11-dm.rules
-diff --git a/geninitrd b/geninitrd
-index 7f5495f..ea7d438 100755
---- a/geninitrd
-+++ b/geninitrd
-@@ -1209,7 +1209,7 @@ if [ ! -f /proc/mounts ]; then
- 	warn "/proc filesystem not mounted, may cause wrong results or failure."
- fi
- 
--geninitrd_load_mods ide luks multipath dmraid lvm md blkid udev tuxonice suspend fbsplash condecor bootsplash uvesafb nfs sata scsi usbkbd bcache
-+geninitrd_load_mods ide luks multipath dmraid lvm md blkid udev swsusp tuxonice suspend fbsplash condecor bootsplash uvesafb nfs sata scsi usbkbd bcache
- 
- while [ $# -gt 0 ]; do
- 	case $1 in
-@@ -1245,6 +1245,9 @@ while [ $# -gt 0 ]; do
- 	--without-fbcondecor)
- 		FB_CON_DECOR=no
- 		;;
-+	--without-swsusp)
-+		USE_SWSUSP=no
-+		;;
- 	--with-suspend)
- 		USE_SUSPEND=yes
- 		;;
-@@ -1508,6 +1511,10 @@ if is_yes "$USE_SUSPEND"; then
- 	find_modules_suspend
- fi
- 
-+if is_yes "$USE_SWSUSP"; then
-+	find_modules_swsusp
-+fi
-+
- find_root "$fstab" || exit
- verbose "Using $rootdev as device for rootfs"
- 
-@@ -1703,6 +1710,7 @@ initrd_gen_stop_uvesafb
- # resume after killing local processes
- initrd_gen_tuxonice
- initrd_gen_suspend
-+initrd_gen_swsusp
- 
- # clean up env
- add_linuxrc <<-'EOF'
-diff --git a/mod-swsusp.sh b/mod-swsusp.sh
-new file mode 100644
-index 0000000..d6ade58
---- /dev/null
-+++ b/mod-swsusp.sh
-@@ -0,0 +1,74 @@
-+#!/bin/sh
-+# geninitrd mod: swsusp
-+#
-+USE_SWSUSP=${USE_SWSUSP:-yes}
-+
-+# resume device
-+swap_dev=""
-+
-+# setup geninitrd module
-+# @access	public
-+setup_mod_swsusp() {
-+    	if ! is_yes "$USE_SWSUSP"; then
-+		return
-+	fi
-+
-+	swap_dev="$(awk '/^\/dev\// { print $1 }' /proc/swaps | head -1)"
-+	if [ -z "$swap_dev" ]; then
-+	    warn "Cannot determine swap device. You may try add specific device to kernel command line"
-+	else
-+	    verbose "swsusp: will try to resume from swap device $swap_dev"
-+	fi
-+}
-+
-+# find modules for for swsusp
-+# @access	public
-+find_modules_swsusp() {
-+    	swap_dev="$(awk '/^\/dev\// { print $1 }' /proc/swaps | head -1)"
-+
-+	# save state
-+	local vgvolumes=$LVM_VGVOLUMES
-+	find_modules_for_devpath $swap_dev
-+
-+	# check for saved state, differenciate between rootfs VG
-+	if [ "$LVM_VGVOLUMES" != "$vgvolumes" ]; then
-+		# add swap device to LVM_SUSPENDVG
-+		LVM_SUSPENDVG="$LVM_SUSPENDVG $LVM_VGVOLUMES"
-+		LVM_VGVOLUMES=$vgvolumes
-+		verbose "swap device is on LVM"
-+	fi
-+}
-+
-+# generate initrd fragment
-+# @access	public
-+initrd_gen_swsusp() {
-+	if ! is_yes "$USE_SWSUSP"; then
-+		return
-+	fi
-+
-+	verbose "Setting up swsusp..."
-+
-+	mkdir -p $DESTDIR${swap_dev%/*}
-+	inst $swap_dev $swap_dev
-+
-+        mount_dev
-+	mount_sys
-+        echo "swap_dev=$swap_dev" | add_linuxrc
-+
-+	add_linuxrc <<-'EOF'
-+	resume=no
-+	for arg in $CMDLINE; do
-+		if [ "${arg##resume=/dev/}" != "${arg}" ]; then
-+			swap_dev=${arg##resume=}
-+			resume=yes
-+		elif [ "${arg##resume=}" != "${arg}" ]; then
-+			resume=${arg##resume=}
-+		fi
-+	done
-+
-+	if [ "$resume" = "yes" ] && [ -n "$swap_dev" ]; then
-+	        echo "Resuming from $swap_dev..."
-+		echo "$swap_dev" > /sys/power/resume
-+	fi
-+	EOF
-+}
-
-commit 55248df65f545d53bb1cfb56edcf5a699a45f52f
-Author: Arkadiusz Miśkiewicz <arekm at maven.pl>
-Date:   Sat Dec 26 01:04:09 2020 +0100
-
-    Disable swsusp support when swap device not found.
-
-diff --git a/mod-swsusp.sh b/mod-swsusp.sh
-index d6ade58..9224536 100644
---- a/mod-swsusp.sh
-+++ b/mod-swsusp.sh
-@@ -15,7 +15,8 @@ setup_mod_swsusp() {
- 
- 	swap_dev="$(awk '/^\/dev\// { print $1 }' /proc/swaps | head -1)"
- 	if [ -z "$swap_dev" ]; then
--	    warn "Cannot determine swap device. You may try add specific device to kernel command line"
-+	    warn "Cannot determine swap device. You may try add specific device to kernel command line. Disabling swsusp support."
-+	    USE_SWSUSP=no
- 	else
- 	    verbose "swsusp: will try to resume from swap device $swap_dev"
- 	fi
-commit 640d6c7b308f0c0535ab0da05797847b2fcbfe69
-Author: Arkadiusz Miśkiewicz <arekm at maven.pl>
-Date:   Sun Aug 22 19:13:09 2021 +0200
-
-    AES/CBC can be built-in (and in PLD 5.13 kernel CBC is built-in).
-
-diff --git a/mod-luks.sh b/mod-luks.sh
-index ffe87cb..25dea8c 100644
---- a/mod-luks.sh
-+++ b/mod-luks.sh
-@@ -65,8 +65,8 @@ find_modules_luks() {
- 	find_module "dm-crypt"
- 
- 	# TODO: autodetect
--	find_module "aes"
--	find_module "cbc"
-+	find_module "-aes"
-+	find_module "-cbc"
- 	find_module "-af-alg"
- 	find_module "-algif_hash"
- 	find_module "-algif_skcipher"
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/geninitrd.git/commitdiff/585ddd27c6a0ba8ea45214afb397f8e320c57b66



More information about the pld-cvs-commit mailing list