From 095118be90c8cb169733ba276b9c01c6fa19c1bb Mon Sep 17 00:00:00 2001 From: Fierelier Date: Wed, 17 Aug 2022 07:16:59 +0200 Subject: [PATCH] Add mod: legacy-initramfs --- modlists/legacy | 1 + mods/legacy-initramfs/data/chroot | 4 ++++ .../etc/initramfs-tools/conf.d/00-legacy-initramfs | 2 ++ mods/legacy-initramfs/data/etc/live/boot/00-legacy | 5 +++++ mods/legacy-initramfs/data/usr/bin/wdvn-cat | 2 ++ .../data/usr/local/bin/update-initramfs | 12 ++++++++++++ 6 files changed, 26 insertions(+) create mode 100644 modlists/legacy create mode 100755 mods/legacy-initramfs/data/chroot create mode 100644 mods/legacy-initramfs/data/etc/initramfs-tools/conf.d/00-legacy-initramfs create mode 100644 mods/legacy-initramfs/data/etc/live/boot/00-legacy create mode 100755 mods/legacy-initramfs/data/usr/bin/wdvn-cat create mode 100755 mods/legacy-initramfs/data/usr/local/bin/update-initramfs diff --git a/modlists/legacy b/modlists/legacy new file mode 100644 index 0000000..4febc1c --- /dev/null +++ b/modlists/legacy @@ -0,0 +1 @@ +legacy-initramfs \ No newline at end of file diff --git a/mods/legacy-initramfs/data/chroot b/mods/legacy-initramfs/data/chroot new file mode 100755 index 0000000..6709bbd --- /dev/null +++ b/mods/legacy-initramfs/data/chroot @@ -0,0 +1,4 @@ +#!/bin/bash +set -e +apt -y install findutils file xz-utils +update-initramfs -u \ No newline at end of file diff --git a/mods/legacy-initramfs/data/etc/initramfs-tools/conf.d/00-legacy-initramfs b/mods/legacy-initramfs/data/etc/initramfs-tools/conf.d/00-legacy-initramfs new file mode 100644 index 0000000..de32d0e --- /dev/null +++ b/mods/legacy-initramfs/data/etc/initramfs-tools/conf.d/00-legacy-initramfs @@ -0,0 +1,2 @@ +#MODULES=list +COMPRESS=xz diff --git a/mods/legacy-initramfs/data/etc/live/boot/00-legacy b/mods/legacy-initramfs/data/etc/live/boot/00-legacy new file mode 100644 index 0000000..2161b80 --- /dev/null +++ b/mods/legacy-initramfs/data/etc/live/boot/00-legacy @@ -0,0 +1,5 @@ +DISABLE_FAT=true +DISABLE_FUSE=true +DISABLE_NTFS=true +DISABLE_USB=true +MINIMAL=true \ No newline at end of file diff --git a/mods/legacy-initramfs/data/usr/bin/wdvn-cat b/mods/legacy-initramfs/data/usr/bin/wdvn-cat new file mode 100755 index 0000000..90625d3 --- /dev/null +++ b/mods/legacy-initramfs/data/usr/bin/wdvn-cat @@ -0,0 +1,2 @@ +#!/bin/sh +cat "$2" \ No newline at end of file diff --git a/mods/legacy-initramfs/data/usr/local/bin/update-initramfs b/mods/legacy-initramfs/data/usr/local/bin/update-initramfs new file mode 100755 index 0000000..2e6fc23 --- /dev/null +++ b/mods/legacy-initramfs/data/usr/local/bin/update-initramfs @@ -0,0 +1,12 @@ +#!/bin/bash +set -e +>&2 echo "Compressing modules ..." +for i in $(find /lib/modules -name "*.ko"); do + if [ "$(file "$i"|grep ELF)" != "" ]; then + >&2 echo "> $i ..." + xz -1 $i + mv $i.xz $i + fi +done +/usr/sbin/update-initramfs $* +exit $? \ No newline at end of file