diff --git a/mkinitcpio/002-add-back-lvm2-hook.patch b/mkinitcpio/002-add-back-lvm2-hook.patch new file mode 100644 index 0000000..3f9f570 --- /dev/null +++ b/mkinitcpio/002-add-back-lvm2-hook.patch @@ -0,0 +1,29 @@ +diff --git a/install/lvm2 b/install/lvm2 +index c2dc8a6..3bb20b0 100644 +--- a/install/lvm2 ++++ b/install/lvm2 +@@ -19,6 +19,10 @@ build() { + 'raid456' \ + 'dm-integrity' + ++ # Obarun still needs binaries ++ add_binary 'dmsetup' ++ add_binary 'lvm' ++ + # from thin-provisioning-tools + add_binary 'pdata_tools' + while IFS='' read -r -d '' symlink; do +@@ -33,12 +37,7 @@ build() { + '95-dm-notify.rules' \ + '/usr/lib/initcpio/udev/11-dm-initramfs.rules' + +- # this udev rule is specific for systemd and non-systemd systems +- if declare -F add_systemd_unit &>/dev/null; then +- add_udev_rule '69-dm-lvm.rules' +- else +- add_udev_rule '/usr/lib/initcpio/udev/69-dm-lvm.rules' +- fi ++ add_udev_rule '/usr/lib/initcpio/udev/69-dm-lvm.rules' + + # config file + add_file '/etc/lvm/lvm.conf' diff --git a/mkinitcpio/LICENSE b/mkinitcpio/LICENSE new file mode 100644 index 0000000..3e82a44 --- /dev/null +++ b/mkinitcpio/LICENSE @@ -0,0 +1,14 @@ +Copyright (c) 2024 joborun +All rights reserved. + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted, provided that the above +copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. diff --git a/mkinitcpio/LICENSE-obarun b/mkinitcpio/LICENSE-obarun new file mode 100644 index 0000000..c2d31fb --- /dev/null +++ b/mkinitcpio/LICENSE-obarun @@ -0,0 +1,14 @@ +Copyright (c) 2023 Eric Vidal +All rights reserved. + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted, provided that the above +copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. diff --git a/mkinitcpio/PKGBUILD b/mkinitcpio/PKGBUILD index 96dafc3..24db075 100644 --- a/mkinitcpio/PKGBUILD +++ b/mkinitcpio/PKGBUILD @@ -4,15 +4,16 @@ # PkgSource : url="https://gittea.disroot.org/joborun-pkg/jobcore/$pkgname" # Website : https://pozol.eu #-----------------------------------------| DESCRIPTION |--------------------------------------- +# https://git.obarun.org/pkg/obcore/mkinitcpio # thanks to the good work by Obarun developers +# on arch's mkinitcpio > 39.0 pkgname=mkinitcpio -pkgver=38.1 -pkgrel=02 +pkgver=39.2 +pkgrel=01 pkgdesc="Modular initramfs image creation utility w/o systemd zstd " makedepends=('binutils' 'asciidoc' 'sed') -install=mkinitcpio.install depends=('awk' 'mkinitcpio-busybox>=1.35.0' 'kmod' 'util-linux>=2.23' 'libarchive' 'coreutils' - 'bash' 'binutils' 'diffutils' 'findutils' 'grep' 'filesystem' 'gzip') + 'bash' 'binutils' 'diffutils' 'findutils' 'grep' 'filesystem' 'xz' 'gzip') checkdepends=('bats' 'bats-assert' 'lzop') conflicts=('systemd>0' 'cryptsetup<2.7.0-3' 'mdadm<4.3-2' 'lvm2<2.03.23-3') optdepends=('zstd: Use zstd compression for the initramfs image' @@ -22,61 +23,79 @@ optdepends=('zstd: Use zstd compression for the initramfs image' 'mkinitcpio-nfs-utils: Support for root filesystem on NFS') provides=("mkinitcpio=$pkgver-$pkgrel" 'initramfs') -#backup=('etc/mkinitcpio.conf') +backup=('etc/mkinitcpio.conf') +#old source location #url='https://github.com/archlinux/mkinitcpio' #url='https://gitlab.archlinux.org/archlinux/mkinitcpio/mkinitcpio' +# source-url="https://gitlab.archlinux.org/archlinux/mkinitcpio/mkinitcpio" url="https://sources.archlinux.org/other" -source=("$url/$pkgname/$pkgname-$pkgver.tar.gz"{,.sig} -# "$pkgname-fix-path.patch::https://gitlab.archlinux.org/archlinux/mkinitcpio/mkinitcpio/-/commit/aced07e06b9b274439eeb90e235edf42780b4a7a.patch" - nosystemd.patch - mkinitcpio.conf) +source=("$url/$pkgname/$pkgname-$pkgver.tar.xz"{,.sig} + '002-add-back-lvm2-hook.patch' + 'fix_manpage.patch' + 'makefile_remove_generate_shutdown_ramfs.patch' + 'remove_fsck_warning.patch' + 'remove_uki_test.patch' + 'use_xz_as_default.patch' + 'mkinitcpio.conf' + 'LICENSE' + 'LICENSE-obarun') prepare() { - cd "${pkgname}-${pkgver}" - patch -Np1 -i ../nosystemd.patch -# patch -Np1 < "$srcdir/mkinitcpio-fix-path.patch" + cd "${pkgname}-${pkgver}" + patch -Np1 < ../002-add-back-lvm2-hook.patch + patch -Np2 < ../fix_manpage.patch + patch -Np2 < ../makefile_remove_generate_shutdown_ramfs.patch + patch -Np2 < ../remove_fsck_warning.patch + patch -Np2 < ../remove_uki_test.patch + patch -Np2 < ../use_xz_as_default.patch } check() { - make -C $pkgname-$pkgver check + make -C $pkgname-$pkgver check } package() { make -C $pkgname-$pkgver DESTDIR="$pkgdir" install - rm -f "${pkgdir}"/usr/lib/initcpio/install/sd-* - rm -f "${pkgdir}/etc/mkinitcpio.conf" + mv -f "${pkgdir}/etc/mkinitcpio.conf" "${pkgdir}/etc/mkinitcpio.conf.source" ## The following two files are provided by eudev and the ones ## provided here contain systemd commands which wouldn't work on obarun or joborun rm -f "${pkgdir}/usr/lib/initcpio/install/udev" rm -f "${pkgdir}/usr/lib/initcpio/hooks/udev" - +## Remove useless systemd crap out of the pkg + rm -rf "${pkgdir}/usr/lib/systemd" + rm -rf "${pkgdir}/usr/lib/initcpio/install/systemd" + rm -rf "${pkgdir}/usr/lib/initcpio/install/sd-encrypt" + rm -rf "${pkgdir}/usr/lib/initcpio/install/sd-shutdown" + rm -rf "${pkgdir}/usr/lib/initcpio/install/sd-shutdown" + rm -rf "${pkgdir}/usr/lib/initcpio/install/sd-vconsole" + rm -rf "${pkgdir}/usr/lib/initcpio/install/resume" + rm -rf "${pkgdir}/usr/share/mkinitcpio/hook.preset" + sed -i 's/ for systemd//' "${pkgdir}/usr/lib/initcpio/functions" install -Dm644 "${srcdir}/mkinitcpio.conf" "${pkgdir}/etc/mkinitcpio.conf" + install -Dm644 "${srcdir}/LICENSE" "$pkgdir/usr/share/licenses/$pkgname/LICENSE" + install -Dm644 "${srcdir}/LICENSE-obarun" "$pkgdir/usr/share/licenses/$pkgname/LICENSE-obarun" } #---- arch license gpg-key & sha256sums ---- arch=(x86_64) -license=(GPL) +license=('GPL-2.0-only') validpgpkeys=('ECCAC84C1BA08A6CC8E63FBBF22FB1D78A77AEAB' # Giancarlo Razzolini 'C100346676634E80C940FB9E9C02FF419FECBE16') # Morten Linderud -sha512sums=('e727509badc528f45f2b193b3f49c202df41d4e75067bebd44c22ebc59f635d4a9596bc671d609d8941644f3a246267f7a199946730ba474040a1f24b94f663c' - 'SKIP' - 'SKIP' - 'SKIP') -b2sums=('625455bb1140688bcdf04c946eb6fa1da53deaa221b2c8090c173aef1d7fc617227aa0674344f3c18d5b9ab77a093725856f4f0cd3b8a33462a2ac742f0dbf11' - 'SKIP' - 'SKIP' - 'SKIP') +sha256sums=(bc37195fab724c42e154a93e6ab797410161c07f223302898673c0e17afd8e0a # mkinitcpio-39.2.tar.xz + 294d8736cf9b4b36f61bcbf0a36a3209c644a9b78bed445ca523455fba06de1d # mkinitcpio-39.2.tar.xz.sig + 2f654513de710e3fddf950066597052f028149d7217db8cb9060d1cb2250ae35 # 002-add-back-lvm2-hook.patch + 8ee7d899fc8e50b19b84f8d4c661ec029cac3080c5fc248b076486d14100673d # fix_manpage.patch + 3e6be42413e841fac3f4a4c3d6591d5af45e62074affefa6889c1bc6ac470667 # makefile_remove_generate_shutdown_ramfs.patch + 5b4a667acedee873c678a44cb41826f31201a869a76edf421fa28848f64bffd9 # remove_fsck_warning.patch + d05f780ad78760560bf9efd2f8819f2bcc14f4fd78fb189bb98a4e16678e99a2 # remove_uki_test.patch + 0c94f36e971599e560398f20561eb7b979b3a9108065422f33ddf4b14f4c1547 # use_xz_as_default.patch + 08e6b8ab289b77c122c7ab4b02ad2795152eb72d17b1a9e5b719fdb0be54d246 # mkinitcpio.conf + 0259339beff6d1a335fc05c97ca104a54ed6baf056a69d04636950fb81e441f5 # LICENSE + 37deb048dd216c0b065f57fd8969dcf85c9d18f9dbd0ee3612c942037c2acc71) # LICENSE-obarun - -sha256sums=(5c63525097a3c17bfb654dacea71ed7681c3102a3684d18c319d06e57007e1cd # mkinitcpio-38.1.tar.gz - e43a102a6f2e17834e351b6206b5d45c83340b09f379c05ebc89c16cc8600d06 # mkinitcpio-38.1.tar.gz.sig -# 207972bfc62cb7bf0547fd075b55c49b9f190afc76e8f4dded1b1c79fd886d0d # mkinitcpio-fix-path.patch - c4afeb6b3300c4d50c3f01233705b542f59d6e95a7670f7efde097ea209ef5bd # nosystemd.patch - 3fd3810547c39a8cb55a8ec729e8e8500c365dd345e242e6fda568c346947436) # mkinitcpio.conf - -## ba8be900c8c6ff9c1e8178b008701175e49d19d45710e30c254e0f030f428335 mkinitcpio-38.1-02-x86_64.pkg.tar.lz +## bfd22e8bcea13da95894778917a21759c85208d83f371176b3d3d38e11bec6f3 mkinitcpio-39.2-01-x86_64.pkg.tar.lz diff --git a/mkinitcpio/PKGBUILD-arch b/mkinitcpio/PKGBUILD-arch index d907d21..922030e 100644 --- a/mkinitcpio/PKGBUILD-arch +++ b/mkinitcpio/PKGBUILD-arch @@ -4,7 +4,7 @@ # Contributor: Thomas Bächler pkgname=mkinitcpio -pkgver=39 +pkgver=39.2 pkgrel=1 pkgdesc="Modular initramfs image creation utility" arch=('any') @@ -23,9 +23,9 @@ optdepends=('gzip: Use gzip compression for the initramfs image' provides=('initramfs') backup=('etc/mkinitcpio.conf') source=("https://sources.archlinux.org/other/$pkgname/$pkgname-$pkgver.tar.xz"{,.sig}) -sha512sums=('50ae08ddf7596b821c89f927ff6692ca907a5045590096155ec6de64e0b5da647ff2c75d1603ab0035046096d37a6eacae383d458b1bb36bd525691b2b23c9ea' +sha512sums=('e4ba9fe901da56bb116510ec0c6abeba5153e57d9545baccbc466932951b7f324aa75ef7cc3de87f966456b0365b17552f367411d62585d500e88dc5c815058b' 'SKIP') -b2sums=('3a28d6711ce843aafe2868b09ba5a723e57e4fdffe905ac915aa5d224279590a10bba902933f183de33e08e96a6aad4d9e1d4752be74c011a37c4cbe83c8d645' +b2sums=('7bd6bf491dd8b23d83e42834566375736cf8868d5120c7e24f4c8923eb03a64864cdda51d6a6f41373db88c29905535e4c8aa4bde172955bc7529e6b3ffc252c' 'SKIP') validpgpkeys=('ECCAC84C1BA08A6CC8E63FBBF22FB1D78A77AEAB' # Giancarlo Razzolini 'C100346676634E80C940FB9E9C02FF419FECBE16') # Morten Linderud diff --git a/mkinitcpio/PKGBUILD-oba b/mkinitcpio/PKGBUILD-oba index 75018bd..525b314 100644 --- a/mkinitcpio/PKGBUILD-oba +++ b/mkinitcpio/PKGBUILD-oba @@ -1,104 +1,61 @@ -# Obarun : 66 init/supervisor -# Maintainer : Eric Vidal -# Maintainer : Jean-Michel T.Dydak -# Obarun PkgSrc : https://git.obarun.org/pkg/obcore/mkinitcpio -#---------------- -#-------------------------------------------------------------- -# DESCRIPTION ] +# Maintainer: Giancarlo Razzolini +# Maintainer: Morten Linderud +# Contributor: Dave Reisner +# Contributor: Thomas Bächler pkgname=mkinitcpio -pkgver=31 -pkgrel=3 - -pkgdesc='Modular initramfs image creation utility' - -url='https://github.com/archlinux/mkinitcpio' - -source=( - "https://sources.archlinux.org/other/$pkgname/$pkgname-$pkgver.tar.gz" - '001-remove-systemd-and-kept-gzip-as-default.patch' +pkgver=39.2 +pkgrel=1 +pkgdesc="Modular initramfs image creation utility" +arch=('any') +url='https://gitlab.archlinux.org/archlinux/mkinitcpio/mkinitcpio' +license=('GPL-2.0-only') +depends=('awk' 'mkinitcpio-busybox>=1.19.4-2' 'kmod' 'util-linux>=2.23' 'libarchive' 'coreutils' + 'bash' 'binutils' 'diffutils' 'findutils' 'grep' 'filesystem>=2011.10-1' 'gzip') +checkdepends=('bats' 'bats-assert' 'lzop') +makedepends=('asciidoc' 'git' 'sed') +optdepends=('gzip: Use gzip compression for the initramfs image' + 'zstd: Use zstd compression for the initramfs image' + 'xz: Use lzma or xz compression for the initramfs image' + 'bzip2: Use bzip2 compression for the initramfs image' + 'lzop: Use lzo compression for the initramfs image' + 'mkinitcpio-nfs-utils: Support for root filesystem on NFS') +provides=('initramfs') +backup=('etc/mkinitcpio.conf') +source=("https://sources.archlinux.org/other/$pkgname/$pkgname-$pkgver.tar.xz"{,.sig} + '002-add-back-lvm2-hook.patch' + 'fix_manpage.patch' + 'makefile_remove_generate_shutdown_ramfs.patch' + 'remove_fsck_warning.patch' + 'remove_uki_test.patch' + 'use_gzip_as_default_in_conf.patch' + 'use_gzip_as_default.patch' ) - -#---------------------- -# BUILD CONFIGURATION ] - -makedepends=( - 'asciidoc' - 'git' - 'sed' -) - -#------------------------ -# INSTALL CONFIGURATION ] - -arch=(x86_64) - -install=mkinitcpio.install - -depends=( - 'awk' - 'mkinitcpio-busybox>=1.19.4-2' - 'kmod' - 'util-linux>=2.23' - 'libarchive' - 'coreutils' - 'bash' - 'binutils' - 'diffutils' - 'findutils' - 'grep' - 'filesystem>=2011.10-1' - 'gzip' - 'lz4' - 'sed' -) - -optdepends=( - 'xz: Use lzma or xz compression for the initramfs image' - 'bzip2: Use bzip2 compression for the initramfs image' - 'lzop: Use lzo compression for the initramfs image' - 'lz4: Use lz4 compression for the initramfs image' - 'zstd: Use zstd compression for the initramfs image' - 'mkinitcpio-nfs-utils: Support for root filesystem on NFS' -) - -backup=( - 'etc/mkinitcpio.conf' -) - -provides=( - "mkinitcpio=$pkgver-$pkgrel" - 'initramfs' -) - -#---------------- -# BUILD PREPARE ] +sha512sums=('e4ba9fe901da56bb116510ec0c6abeba5153e57d9545baccbc466932951b7f324aa75ef7cc3de87f966456b0365b17552f367411d62585d500e88dc5c815058b' + 'SKIP') +b2sums=('7bd6bf491dd8b23d83e42834566375736cf8868d5120c7e24f4c8923eb03a64864cdda51d6a6f41373db88c29905535e4c8aa4bde172955bc7529e6b3ffc252c' + 'SKIP') +validpgpkeys=('ECCAC84C1BA08A6CC8E63FBBF22FB1D78A77AEAB' # Giancarlo Razzolini + 'C100346676634E80C940FB9E9C02FF419FECBE16') # Morten Linderud prepare() { - cd $pkgname-$pkgver - - ## Apply 0003-remove-systemd.patch - patch -Np1 < $srcdir/001-remove-systemd-and-kept-gzip-as-default.patch - + cd "${pkgname}-${pkgver}" + patch -Np1 < ../002-add-back-lvm2-hook.patch + patch -Np2 < ../fix_manpage.patch + patch -Np2 < ../makefile_remove_generate_shutdown_ramfs.patch + patch -Np2 < ../remove_fsck_warning.patch + patch -Np2 < ../remove_uki_test.patch + patch -Np2 < ../use_gzip_as_default_in_conf.patch + patch -Np2 < ../use_gzip_as_default.patch } -#-------- -# CHECK ] - check() { - make -C $pkgname-$pkgver check + make -C "$pkgname-$pkgver" check } -#---------- -# PACKAGE ] - package() { - make -C $pkgname-$pkgver DESTDIR="$pkgdir" install + make -C "$pkgname-$pkgver" DESTDIR="$pkgdir" install ++ # obarun udev files owend by eudev ++ rm "$pkgdir/usr/lib/initcpio/hooks/udev" ++ rm "$pkgdir/usr/lib/initcpio/install/udev" } - -#------------------------- -# LICENCE AND VALIDATION ] - -license=(GPL) - -sha512sums=(' ') diff --git a/mkinitcpio/clean b/mkinitcpio/clean index 605b4c8..2fee219 100644 --- a/mkinitcpio/clean +++ b/mkinitcpio/clean @@ -1,2 +1,2 @@ -rm -rf {src,pkg,mki*tar.xz*,mki*tar.gz*} +rm -rf {src,pkg,mki*tar.xz*} diff --git a/mkinitcpio/fix_manpage.patch b/mkinitcpio/fix_manpage.patch new file mode 100644 index 0000000..f4bd9f5 --- /dev/null +++ b/mkinitcpio/fix_manpage.patch @@ -0,0 +1,12 @@ +diff -Nuar --unified --recursive --text --color a/mkinitcpio-39.1/man/mkinitcpio.8 b/mkinitcpio-39.1/man/mkinitcpio.8 +--- a/mkinitcpio-39.1/man/mkinitcpio.8 2024-05-14 16:09:00.109483198 +1100 ++++ b/mkinitcpio-39.1/man/mkinitcpio.8 2024-05-14 16:14:48.713241713 +1100 +@@ -152,7 +152,7 @@ + comma\-separated. This option can be specified multiple times. + .RE + .sp +-\fB\-s\fP, \fB\-\-save\fP ++\fB\-S\fP, \fB\-\-save\fP + .RS 4 + Saves the build directory for the initial ramdisk. Default: no; This means + the directory will not be retained if this option is not specified. Useful diff --git a/mkinitcpio/key b/mkinitcpio/key index 0cc367a..d2c3aa6 100644 --- a/mkinitcpio/key +++ b/mkinitcpio/key @@ -1,2 +1,2 @@ gpg -v --recv-key F22FB1D78A77AEAB -gpg -v --recv-keys 9C02FF419FECBE16 +gpg -v --recv-key 9C02FF419FECBE16 diff --git a/mkinitcpio/makefile_remove_generate_shutdown_ramfs.patch b/mkinitcpio/makefile_remove_generate_shutdown_ramfs.patch new file mode 100644 index 0000000..b5d7ddb --- /dev/null +++ b/mkinitcpio/makefile_remove_generate_shutdown_ramfs.patch @@ -0,0 +1,15 @@ +diff -Nuar --unified --recursive --text --color a/mkinitcpio-39.1/Makefile b/mkinitcpio-39.1/Makefile +--- a/mkinitcpio-39.1/Makefile 2024-05-14 16:09:00.092816623 +1100 ++++ b/mkinitcpio-39.1/Makefile 2024-05-14 16:10:11.191231625 +1100 +@@ -75,11 +75,6 @@ + cp -at $(DESTDIR)/usr/lib/initcpio hooks install + install -m644 -t $(DESTDIR)/usr/share/mkinitcpio mkinitcpio.d/* + +- install -m644 systemd/mkinitcpio-generate-shutdown-ramfs.service \ +- $(DESTDIR)/usr/lib/systemd/system/mkinitcpio-generate-shutdown-ramfs.service +- for target in $(addprefix $(DESTDIR),$(SHUTDOWN_DIRS)); do \ +- ln -s ../mkinitcpio-generate-shutdown-ramfs.service -t $$target || exit; \ +- done + install -m644 tmpfiles/mkinitcpio.conf $(DESTDIR)/usr/lib/tmpfiles.d/mkinitcpio.conf + + install -m755 kernel-install/50-mkinitcpio.install $(DESTDIR)/usr/lib/kernel/install.d/50-mkinitcpio.install diff --git a/mkinitcpio/mkinitcpio.conf b/mkinitcpio/mkinitcpio.conf index 6ec1230..7573c42 100644 --- a/mkinitcpio/mkinitcpio.conf +++ b/mkinitcpio/mkinitcpio.conf @@ -38,7 +38,7 @@ FILES=() # ## This setup will generate a 'full' image which supports most systems. ## No autodetection is done. - HOOKS=(base udev modconf block filesystems fsck) +# HOOKS=(base udev modconf block filesystems fsck) # ## This setup assembles a mdadm array with an encrypted root file system. ## Note: See 'mkinitcpio -H mdadm_udev' for more information on RAID devices. @@ -52,9 +52,9 @@ FILES=() HOOKS=(base udev autodetect microcode modconf kms keyboard keymap consolefont block filesystems fsck) # COMPRESSION -# Use this to compress the initramfs image. By default, zstd compression -## joborun linux wants to revert this default behavior and adds its own mkinitcpio.conf file -# is used. Use 'cat' to create an uncompressed image. +# Use this to compress the initramfs image. By arch default, zstd compression +# joborun linux wants to revert this default behavior and adds its own mkinitcpio.conf file. +# Use 'cat' to create an uncompressed image. #COMPRESSION="gzip" #COMPRESSION="bzip2" #COMPRESSION="lzma" @@ -65,8 +65,13 @@ COMPRESSION="xz" # COMPRESSION_OPTIONS # Additional options for the compressor COMPRESSION_OPTIONS=( -T2 -7 ) + # MODULES_DECOMPRESS -# Decompress kernel modules during initramfs creation. -# Enable to speedup boot process, disable to save RAM -# during early userspace. Switch (yes/no). -#MODULES_DECOMPRESS="yes" +# Decompress loadable kernel modules and their firmware during initramfs +# creation. Switch (yes/no). +# Enable to allow further decreasing image size when using high compression +# (e.g. xz -9e or zstd --long --ultra -22) at the expense of increased RAM usage +# at early boot. +# Note that any compressed files will be placed in the uncompressed early CPIO +# to avoid double compression. +#MODULES_DECOMPRESS="no" diff --git a/mkinitcpio/remove_fsck_warning.patch b/mkinitcpio/remove_fsck_warning.patch new file mode 100644 index 0000000..76e5eca --- /dev/null +++ b/mkinitcpio/remove_fsck_warning.patch @@ -0,0 +1,21 @@ +diff -Nuar --unified --recursive --text --color a/mkinitcpio-39.1/init_functions b/mkinitcpio-39.1/init_functions +--- a/mkinitcpio-39.1/init_functions 2024-05-14 16:09:00.096149938 +1100 ++++ b/mkinitcpio-39.1/init_functions 2024-05-14 16:12:22.287178910 +1100 +@@ -350,17 +350,6 @@ + elif bitfield_has_bit "$fsckret" 128; then + err "fatal error invoking fsck" + fi +- +- # ensure that root is going to be mounted rw. Otherwise, systemd +- # might fsck the device again. Annoy the user so that they fix this. +- if [ "${rwopt:-ro}" != 'rw' ]; then +- echo "********************** WARNING **********************" +- echo "* *" +- echo "* The root device is not configured to be mounted *" +- echo "* read-write! It may be fsck'd again later. *" +- echo "* *" +- echo "*****************************************************" +- fi + fi + } + diff --git a/mkinitcpio/remove_uki_test.patch b/mkinitcpio/remove_uki_test.patch new file mode 100644 index 0000000..0cb7c0d --- /dev/null +++ b/mkinitcpio/remove_uki_test.patch @@ -0,0 +1,126 @@ +diff -Nuar --unified --recursive --text --color a/mkinitcpio-39.1/test/cases/mkinitcpio.bats b/mkinitcpio-39.1/test/cases/mkinitcpio.bats +--- a/mkinitcpio-39.1/test/cases/mkinitcpio.bats 2024-05-14 16:09:00.116149829 +1100 ++++ b/mkinitcpio-39.1/test/cases/mkinitcpio.bats 2024-05-14 16:18:59.927260425 +1100 +@@ -28,122 +28,6 @@ + cmp "$tmpdir/initramfs-1.img" "$tmpdir/initramfs-2.img" + } + +-__validate_uki() { +- if [[ ! -d "/lib/modules/$(uname -r)/" ]]; then +- skip "No kernel modules available" +- fi +- +- local mode="$1" tmpdir kver +- shift +- tmpdir="$(mktemp -d --tmpdir="$BATS_RUN_TMPDIR" "${BATS_TEST_NAME}.XXXXXX")" +- kver="$(uname -r)" +- +- tmp_knl="$(__gen_test_kernel "$kver")" +- ln -s "$tmp_knl" "$tmpdir/linux.in" +- printf '%s' "$kver" > "$tmpdir/uname.in" +- printf 'VERSION_ID=%s\n' "$kver" > "$tmpdir/osrel.in" +- grep -v '^VERSION_ID=' /etc/os-release >> "$tmpdir/osrel.in" +- printf '%s' 'root=gpt-auto rw' > "$tmpdir/cmdline.in" +- ln -s "$BATS_TEST_DIRNAME/../fixtures/uki/splash.bmp" "$tmpdir/splash.in" +- +- echo 'HOOKS=(base)' > "$tmpdir/mkinitcpio.conf" +- run ./mkinitcpio \ +- -t "$tmpdir" \ +- -D "${PWD}" \ +- -c "$tmpdir/mkinitcpio.conf" \ +- --kernel "$tmpdir/linux.in" \ +- --generate "$tmpdir/initrd.in" \ +- --cmdline "$tmpdir/cmdline.in" \ +- --osrelease "$tmpdir/osrel.in" \ +- --splash "$tmpdir/splash.in" \ +- --uki "$tmpdir/uki.efi" \ +- --verbose "$@" +- assert_success +- assert_output --partial "Using $mode to build UKI" +- assert_output --partial "Assembling UKI: $mode " +- +- printf ' \n\0' >> "$tmpdir/cmdline.in" +- +- objcopy \ +- --dump-section ".linux=$tmpdir/linux.out" \ +- --dump-section ".initrd=$tmpdir/initrd.out" \ +- --dump-section ".uname=$tmpdir/uname.out" \ +- --dump-section ".osrel=$tmpdir/osrel.out" \ +- --dump-section ".cmdline=$tmpdir/cmdline.out" \ +- --dump-section ".splash=$tmpdir/splash.out" \ +- "$tmpdir/uki.efi" +- +- cmp "$tmpdir"/linux.{in,out} +- cmp "$tmpdir"/initrd.{in,out} +- cmp "$tmpdir"/uname.{in,out} +- cmp "$tmpdir"/osrel.{in,out} +- cmp "$tmpdir"/cmdline.{in,out} +- cmp "$tmpdir"/splash.{in,out} +-} +- +-@test "test creating UKI with ukify" { +- if ! command -v ukify &>/dev/null; then +- skip "ukify is not available" +- fi +- __validate_uki ukify --ukiconfig /dev/null +-} +- +-@test "test creating UKI with objcopy" { +- __validate_uki objcopy --no-ukify +-} +- +-@test "test reproducible builds for UKI" { +- if [[ ! -d "/lib/modules/$(uname -r)/" ]]; then +- skip "No kernel modules available" +- fi +- +- local tmpdir +- tmpdir="$(mktemp -d --tmpdir="$BATS_RUN_TMPDIR" "${BATS_TEST_NAME}.XXXXXX")" +- +- echo "HOOKS=(base)" >> "$tmpdir/mkinitcpio.conf" +- +- ./mkinitcpio \ +- -D "${PWD}" \ +- -c "$tmpdir/mkinitcpio.conf" \ +- --uki "$tmpdir/uki-1.efi" \ +- --no-ukify +- +- ./mkinitcpio \ +- -D "${PWD}" \ +- -c "$tmpdir/mkinitcpio.conf" \ +- --uki "$tmpdir/uki-2.efi" \ +- --no-ukify +- +- sha256sum "$tmpdir/uki-1.efi" "$tmpdir/uki-2.efi" +- cmp "$tmpdir/uki-1.efi" "$tmpdir/uki-2.efi" +-} +- +-@test "test creating UKI with no cmdline" { +- bats_require_minimum_version 1.5.0 +- if [[ ! -d "/lib/modules/$(uname -r)/" ]]; then +- skip 'No kernel modules available' +- fi +- +- local tmpdir +- tmpdir="$(mktemp -d --tmpdir="$BATS_RUN_TMPDIR" "${BATS_TEST_NAME}.XXXXXX")" +- +- printf '%s\n' 'HOOKS=(base)' > "${tmpdir}/mkinitcpio.conf" +- +- ./mkinitcpio \ +- -D "${PWD}" \ +- -c "${tmpdir}/mkinitcpio.conf" \ +- --uki "${tmpdir}/uki.efi" \ +- --no-ukify \ +- --no-cmdline +- +- run objdump -h "${tmpdir}/uki.efi" +- assert_success +- refute_output --partial ' .cmdline ' +- assert_output --partial ' .linux ' +- assert_output --partial ' .initrd ' +- assert_output --partial ' .uname ' +-} +- + @test "test early cpio creation" { + if [[ ! -d "/lib/modules/$(uname -r)/" ]]; then + skip "No kernel modules available" diff --git a/mkinitcpio/time b/mkinitcpio/time index e580bfe..dc04643 100644 --- a/mkinitcpio/time +++ b/mkinitcpio/time @@ -1,6 +1,6 @@ -real 0m8.348s -user 0m6.956s -sys 0m1.239s +real 0m8.190s +user 0m12.524s +sys 0m2.240s diff --git a/mkinitcpio/use_xz_as_default.patch b/mkinitcpio/use_xz_as_default.patch new file mode 100644 index 0000000..9452554 --- /dev/null +++ b/mkinitcpio/use_xz_as_default.patch @@ -0,0 +1,13 @@ +diff -Nuar --unified --recursive --text --color a/mkinitcpio-39.1/mkinitcpio b/mkinitcpio-39.1/mkinitcpio +--- a/mkinitcpio-39.1/mkinitcpio 2024-05-28 16:09:00.109483198 +1100 ++++ b/mkinitcpio-39.1/mkinitcpio 2024-05-28 06:06:06.586070899 +1100 +@@ -413,7 +413,7 @@ + } + + validate_compression() { +- local major minor compression_fallback='zstd' ++ local major minor compression_fallback='xz' + + if [[ -z "$_optcompress" && -v COMPRESSION_OPTIONS && ! -v COMPRESSION ]]; then + warning 'COMPRESSION_OPTIONS is set without also setting COMPRESSION. Configure COMPRESSION explicitly!' +