diff options
author | A. Wilcox <awilcox@wilcox-tech.com> | 2020-07-20 00:45:49 +0000 |
---|---|---|
committer | A. Wilcox <awilcox@wilcox-tech.com> | 2020-07-20 00:45:49 +0000 |
commit | 462a350678cbee57e9baa25152bc7de7379f4962 (patch) | |
tree | 340106b9e56368f5c7447e30d7e979268557480e | |
parent | 3e0ffda88c14c8e19ba72c0135ee049c0fa375c8 (diff) | |
parent | 77a32d089abcb5f43da122e4b97575e671213457 (diff) | |
download | packages-462a350678cbee57e9baa25152bc7de7379f4962.tar.gz packages-462a350678cbee57e9baa25152bc7de7379f4962.tar.bz2 packages-462a350678cbee57e9baa25152bc7de7379f4962.tar.xz packages-462a350678cbee57e9baa25152bc7de7379f4962.zip |
Merge branch 'new/easy-boot' into 'master'
Adjust existing boot-related triggers and add one for dracut
See merge request adelie/packages!485
-rw-r--r-- | system/easy-boot/APKBUILD | 45 | ||||
-rw-r--r-- | system/easy-boot/easy-boot.trigger | 2 | ||||
-rw-r--r-- | system/easy-boot/update-boot | 13 | ||||
-rw-r--r-- | system/easy-kernel/APKBUILD | 2 | ||||
-rw-r--r-- | user/dracut/APKBUILD | 9 | ||||
-rw-r--r-- | user/dracut/dracut.easy-boot | 14 | ||||
-rw-r--r-- | user/grub/APKBUILD | 7 | ||||
-rw-r--r-- | user/grub/grub.trigger | 2 | ||||
-rw-r--r-- | user/lilo/APKBUILD | 12 | ||||
-rw-r--r-- | user/lilo/initramfs.patch | 81 | ||||
-rw-r--r-- | user/lilo/lilo.easy-boot (renamed from user/lilo/lilo.trigger) | 0 |
11 files changed, 177 insertions, 10 deletions
diff --git a/system/easy-boot/APKBUILD b/system/easy-boot/APKBUILD new file mode 100644 index 000000000..e8189164c --- /dev/null +++ b/system/easy-boot/APKBUILD @@ -0,0 +1,45 @@ +# Maintainer: Max Rees <maxcrees@me.com> +pkgname=easy-boot +pkgver=1.0 +pkgrel=0 +pkgdesc="APK trigger to automatically update boot configuration" +url="https://www.adelielinux.org/" +arch="noarch" +options="!check" # No test suite. +license="NCSA" +depends="/bin/sh" +makedepends="" +subpackages="no-boot:none" +provides="kernel-boot" +provider_priority=10 +triggers="$pkgname.trigger=/boot" +source="update-boot" + +package() { + install -Dm755 "$srcdir"/update-boot \ + "$pkgdir"/usr/sbin/update-boot + + mkdir -p "$pkgdir"/etc/easy-boot.d + cat >"$pkgdir"/etc/easy-boot.d/README <<-EOF + This directory contains hooks that will be executed when the files + in /boot are upgraded, in particular the kernel from easy-kernel. + Each hook will be executed in collation order. The current numbering + conventions are: + + 20 - initramfs generation + 50 - bootloader configuration + + To completely disable this mechanism, install the "no-boot" package. + + The hooks can be re-run manually using the "update-boot" command. + EOF +} + +none() { + pkgdesc="Disable boot configuration from automatically updating" + depends="" + provides="kernel-boot" + provider_priority=1 + mkdir -p "$subpkgdir" +} +sha512sums="7436693956df66bebeef20937f210c889d109ba85456d4cd3c115d00e4c68f3f5b51dbaa1859a729c2599b344e21d45c484fe278c43c7c59bb04a4159e9b6577 update-boot" diff --git a/system/easy-boot/easy-boot.trigger b/system/easy-boot/easy-boot.trigger new file mode 100644 index 000000000..63f7f1850 --- /dev/null +++ b/system/easy-boot/easy-boot.trigger @@ -0,0 +1,2 @@ +#!/bin/sh -e +exec update-boot diff --git a/system/easy-boot/update-boot b/system/easy-boot/update-boot new file mode 100644 index 000000000..a3e45ebf4 --- /dev/null +++ b/system/easy-boot/update-boot @@ -0,0 +1,13 @@ +#!/bin/sh -e +rc=0 + +for i in /etc/easy-boot.d/*; do + [ -x "$i" ] || continue + printf '>>> %s\n' "${i##*/}" >&2 + if ! "$i"; then + printf '>>> Kernel boot hook failed!\n' >&2 + rc="$((rc + 1))" + fi +done + +exit "$rc" diff --git a/system/easy-kernel/APKBUILD b/system/easy-kernel/APKBUILD index c22db250f..b1ef436ce 100644 --- a/system/easy-kernel/APKBUILD +++ b/system/easy-kernel/APKBUILD @@ -12,7 +12,7 @@ url="https://kernel.org/" arch="all" options="!check !dbg !strip !tracedeps" license="GPL-2.0-only" -depends="" +depends="kernel-boot" makedepends="bc bison flex gzip kmod lzop openssl-dev rsync xz" provides="easy-kernel$_kflavour=$pkgver-r$pkgrel" replaces="easy-kernel-power8 easy-kernel-power8-64k" diff --git a/user/dracut/APKBUILD b/user/dracut/APKBUILD index 40f60f469..744b206c5 100644 --- a/user/dracut/APKBUILD +++ b/user/dracut/APKBUILD @@ -2,7 +2,7 @@ # Maintainer: A. Wilcox <awilfox@adelielinux.org> pkgname=dracut pkgver=050 -pkgrel=0 +pkgrel=1 pkgdesc="Event-driven initramfs infrastructure" url="https://dracut.wiki.kernel.org/" arch="all" @@ -16,6 +16,7 @@ source="https://www.kernel.org/pub/linux/utils/boot/$pkgname/$pkgname-$pkgver.ta fts.patch header-fix.patch mount-run-without-noexec.patch + dracut.easy-boot " prepare() { @@ -44,6 +45,9 @@ package() { 01systemd-initrd 02systemd-networkd; do rm -r "$pkgdir"/usr/lib/dracut/modules.d/$sysdmod done + + install -Dm755 "$srcdir"/dracut.easy-boot \ + "$pkgdir"/etc/easy-boot.d/20-dracut } bashcomp() { @@ -71,4 +75,5 @@ lvm() { sha512sums="eba046cf1c8013369a398e585e0bff233daa8595d469ce9acc8bbc6a32d55c6a5429d4219db19abbf6001104be05b357f0961f9e66b7f926039a5d3ee7c2b850 dracut-050.tar.xz ce84e527e441e18494ea9011b4b10cf723ce5981c4717140f43861b6ed3e0f0aa78545be41c111d3338422f2ad158edc8704376c3dca207ae4445c58f54a4574 fts.patch 988f03a3fd2e7ee62409d3c57e8029403513dcec5efb37e64633d989728e4c7b619ce5b8775a04c5a0b654f7f093777d94fe6e4098a99a690c353a94f537e24c header-fix.patch -d7aa2b35def975ec2a9620d3e8c94da5fad5be51e81ac913b9f3497b3ca62beefb9d4cf8e4ba3b292f89b936373486d0e3184f65eb1eaed972f38d17424a32b1 mount-run-without-noexec.patch" +d7aa2b35def975ec2a9620d3e8c94da5fad5be51e81ac913b9f3497b3ca62beefb9d4cf8e4ba3b292f89b936373486d0e3184f65eb1eaed972f38d17424a32b1 mount-run-without-noexec.patch +ea576d30e51b2f1c676e29fb81b064b3b8c696a3692dbcf6a31f8a589ab2a426f421bc1002295eb79843cba22d6ddeb04fadb3f99d9e5c00d2d5f53fd3a6c484 dracut.easy-boot" diff --git a/user/dracut/dracut.easy-boot b/user/dracut/dracut.easy-boot new file mode 100644 index 000000000..53c95c54e --- /dev/null +++ b/user/dracut/dracut.easy-boot @@ -0,0 +1,14 @@ +#!/bin/sh -e + +for i in /boot/vmlinu[xz]*; do + version="${i##*/vmlinu[xz]}" + # Support filenames with no version. LILO supports this, but GRUB + # doesn't (currently). + version="${version#-}" + if ! [ -d /lib/modules/"$version" ]; then + printf '>>> %s: no modules installed, skipping\n' "$version" >&2 + continue + fi + printf '>>> %s\n' "$version" >&2 + dracut --force --quiet /boot/initramfs-"$version".img "$version" +done diff --git a/user/grub/APKBUILD b/user/grub/APKBUILD index 2c0cfdbc9..66488715d 100644 --- a/user/grub/APKBUILD +++ b/user/grub/APKBUILD @@ -2,7 +2,7 @@ # Maintainer: A. Wilcox <awilfox@adelielinux.org> pkgname=grub pkgver=2.04 -pkgrel=3 +pkgrel=4 pkgdesc="Bootloader with support for Linux, Multiboot and more" url="https://www.gnu.org/software/grub/" arch="all !s390x" @@ -31,7 +31,6 @@ for f in $flavors; do done install="$pkgname.post-upgrade" -triggers="$pkgname.trigger=/boot" source="https://ftp.gnu.org/gnu/grub/grub-$pkgver.tar.xz adelie-branding.patch @@ -134,6 +133,10 @@ package() { install -Dm755 "$i" \ "$pkgdir"/etc/grub-quirks.d/"${i##"$srcdir"/quirk-}" done + + mkdir -p "$pkgdir"/etc/easy-boot.d + ln -s ../../usr/sbin/update-grub \ + "$pkgdir"/etc/easy-boot.d/50-grub } bios() { diff --git a/user/grub/grub.trigger b/user/grub/grub.trigger deleted file mode 100644 index eba13a458..000000000 --- a/user/grub/grub.trigger +++ /dev/null @@ -1,2 +0,0 @@ -#!/bin/sh -e -exec update-grub diff --git a/user/lilo/APKBUILD b/user/lilo/APKBUILD index 606b633b3..6282c211c 100644 --- a/user/lilo/APKBUILD +++ b/user/lilo/APKBUILD @@ -1,7 +1,7 @@ # Maintainer: Max Rees <maxcrees@me.com> pkgname=lilo pkgver=24.2 -pkgrel=0 +pkgrel=1 pkgdesc="Minimal BIOS bootloader for x86 systems" url="https://www.joonet.de/lilo/" arch="pmmx x86 x86_64" @@ -10,13 +10,14 @@ license="BSD-3-Clause AND GPL-2.0+ AND Public-Domain" depends="perl" makedepends="dev86 linux-headers lvm2-dev sharutils" subpackages="$pkgname-doc" -triggers="$pkgname.trigger=/boot" source="https://www.joonet.de/lilo/ftp/sources/lilo-$pkgver.tar.gz adelie.patch cflags.patch + initramfs.patch musl.patch partuuid.patch lilo.conf.template + lilo.easy-boot " build() { @@ -41,11 +42,16 @@ package() { "$pkgdir"/etc/lilo/lilo.conf.template mv "$pkgdir"/etc/lilo/lilo.conf_example \ "$pkgdir"/etc/lilo/lilo.conf.example + + install -Dm755 "$srcdir"/lilo.easy-boot \ + "$pkgdir"/etc/easy-boot.d/50-lilo } sha512sums="4437cae21345f483194a5dc95f686f3f3cb2beec78faae3fba959db25eae29fe2c56732e055c05f1d101682c5d442cdc9561fae8074f61f5537dde0413204c54 lilo-24.2.tar.gz cf8dab563e88cc7b280f5740c3b0f25049b9ce27c77a67e7b0c55dc21a158f8b2998f0c7743f11bcc4ae893697e6b6cc56054a40919899bf2d6d79b4e1a59190 adelie.patch ed1ffb03dbbbf6fe6974d045005f72b3657d470cd3f3556d582e09a38836090c3e75a684a1dcfbe7ade91e5ada3706b712ae7111460df85454518a746c60bde4 cflags.patch +98e26319a747e6cc7e9d7c695d20e511ef9d196dfc312403c7171380e75edbbdec6af39c0f1670956bcd7ec9ff203505c4001962c767f651b730da31830ed35f initramfs.patch 1c1ce61d2d7c88c1ba66e1415b36edb6743f46a50857b5bcd2b6b28a0711e4de3f0a75c352a5997bc9b5d50b0754c49a3f69b736e07a6e389c02da004289c64f musl.patch 3962bf30a866f31fa5263618210d61ac5663117cac1d5a52a5e14f3665ff8edfd628c80807591f3da5f2e6908b8c0af9b19fac32f6ab90e6c4755bf79cb34d5a partuuid.patch -489f57d29ee6607fb7040a33655bc369a510290804ae11686e02ba91d6cd3401175fa93d8d74da6058f03126b924004d28d5145ec5df70be4d04acba112c5729 lilo.conf.template" +489f57d29ee6607fb7040a33655bc369a510290804ae11686e02ba91d6cd3401175fa93d8d74da6058f03126b924004d28d5145ec5df70be4d04acba112c5729 lilo.conf.template +cdf4ea20a678cc01149c06556fe6b3b9b70a91aad7e44ffb7728b677297de8f68d4a5037aa44414bd606c838621fc9191c5ad45f909538b852c1f770b4fcb2e4 lilo.easy-boot" diff --git a/user/lilo/initramfs.patch b/user/lilo/initramfs.patch new file mode 100644 index 000000000..f6aca7f75 --- /dev/null +++ b/user/lilo/initramfs.patch @@ -0,0 +1,81 @@ +Adjust expected initrd name to match what dracut produces. + +--- lilo-24.2/scripts/liloconfig 2015-11-21 18:00:21.000000000 -0600 ++++ lilo-24.2/scripts/liloconfig 2020-07-11 00:35:13.400130230 -0500 +@@ -618,8 +618,8 @@ sub write_image_config { + foreach $image (@vmlinuz) { + # search for kernel initrd file + chomp $image; +- $initrd = $image; +- $initrd =~ s/vmlinuz/initrd\.img/; ++ $initrd = $image . ".img"; ++ $initrd =~ s/vmlinuz/initramfs/; + $initrd2 = $initrd; + $initrd2 =~ s/\.img//; + $nr2 = $nr + 1; +@@ -694,8 +694,8 @@ sub write_imagelinks_config { + foreach $image (@vmlinuz) { + # search for kernel initrd file + chomp $image; +- $initrd = $image; +- $initrd =~ s/vmlinuz/initrd\.img/; ++ $initrd = $image . ".img"; ++ $initrd =~ s/vmlinuz/initramfs/; + $nr2 = $nr + 1; + + print MYFH_NEW 'image = ' . $image . "\n"; +@@ -837,7 +837,7 @@ Lines in the configuration file /etc/lil + # restricted + # alias = 1 + # optional +- initrd = /boot/initrd.img-3.17-trunk-686 ++ initrd = /boot/initramfs-3.17-trunk-686.img + + image = /boot/vmlinuz-3.14-trunk-686 + label = "Linux Old" +@@ -847,7 +847,7 @@ Lines in the configuration file /etc/lil + # restricted + # alias = 2 + # optional +- initrd = /boot/initrd.img-3.14-trunk-686 ++ initrd = /boot/initramfs-3.14-trunk-686.img + + =head1 COPYRIGHT and LICENSE + +--- lilo-24.2/man/liloconfig.8 2015-11-21 17:25:48.000000000 -0600 ++++ lilo-24.2/man/liloconfig.8 2020-07-11 00:45:57.850132663 -0500 +@@ -140,7 +140,7 @@ Lines in the configuration file /etc/lil + \& # restricted + \& # alias = 1 + \& # optional +-\& initrd = /boot/initrd.img\-3.17\-trunk\-686 ++\& initrd = /boot/initramfs\-3.17\-trunk\-686.img + \& + \& image = /boot/vmlinuz\-3.14\-trunk\-686 + \& label = "Linux Old" +@@ -150,7 +150,7 @@ Lines in the configuration file /etc/lil + \& # restricted + \& # alias = 2 + \& # optional +-\& initrd = /boot/initrd.img\-3.14\-trunk\-686 ++\& initrd = /boot/initramfs\-3.14\-trunk\-686.img + .Ve + .SH "COPYRIGHT and LICENSE" + .IX Header "COPYRIGHT and LICENSE" +--- lilo-24.2/man/lilo.conf.5 2013-06-07 14:17:39.000000000 -0500 ++++ lilo-24.2/man/lilo.conf.5 2020-07-11 00:44:59.650132443 -0500 +@@ -47,12 +47,12 @@ menu-title=" John's Computer " + ### bootable kernel images ### + image=/boot/vmlinuz-2.6.29-1-i386 + label=try +- initrd=/boot/initrd.img-2.6.29-1-i386 ++ initrd=/boot/initramfs-2.6.29-1-i386.img + image=/boot/vmlinuz-2.4.33-1-i386 + label=2.4.33 + image=/tamu/vmlinuz + label=tamu +- initrd=/tamu/initrd.img ++ initrd=/tamu/initramfs.img + root=/dev/hdb2 + vga=ask + # diff --git a/user/lilo/lilo.trigger b/user/lilo/lilo.easy-boot index 0f5a802a2..0f5a802a2 100644 --- a/user/lilo/lilo.trigger +++ b/user/lilo/lilo.easy-boot |