summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbill-auger <mr.j.spam.me@gmail.com>2021-11-21 04:32:14 +0100
committerDenis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>2021-11-21 04:33:25 +0100
commitd544044d45ebb3a3f0c688cd640c6c354c9f3e1c (patch)
treeed2f5467f11493c07d4ab9ac485b82577acc8434
parent359e2c4e7f3637bbb58712c62c0ab1ef9225edcf (diff)
libre: Add mkinitcpio mkinitcpio-30-2.parabola2-any.src.tar.gz source code
The process of packages releases makes it very easy to forget to push a package or its source code to git: - A developer can push to abslibre and forget to build the package, or that developer might want to build the package later on for various reasons. - A developer can also push the package and forget to push the corresponding git commits to abslibre. I often am in the first case, but here we are in the later case. Fortunately the process of packages releases also makes it easy to find that source code. The source code of libre/mkinitcpio can be found here: https://repo.parabola.nu/sources/parabola/mkinitcpio-30-2.parabola1-any.src.tar.gz https://repo.parabola.nu/sources/parabola/mkinitcpio-30-2.parabola1-any.src.tar.gz.sig And we can even verify its signature: $ gpg --verify mkinitcpio-30-2.parabola2-any.src.tar.gz.sig gpg: assuming signed data in 'mkinitcpio-30-2.parabola2-any.src.tar.gz' gpg: Signature made sam. 06 nov. 2021 03:42:02 CET gpg: using RSA key FBCC5AD7421197B7ABA72853908710913E8C7778 gpg: Good signature from "bill-auger <bill-auger@peers.community>" [unknown] gpg: aka "bill-auger <mr.j.spam.me@gmail.com>" [unknown] gpg: aka "bill-auger <bill-auger@programmer.net>" [unknown] gpg: aka "[jpeg image of size 6017]" [unknown] gpg: Note: This key has expired! Primary key fingerprint: 3954 A7AB 837D 0EA9 CFA9 7989 25DB 7D9B 5A8D 4B40 Subkey fingerprint: FBCC 5AD7 4211 97B7 ABA7 2853 9087 1091 3E8C 7778 So we can safely import the source back in abslibre. The archive has a bit more than needed for this specific situation: $ tar tf ../mkinitcpio-30-2.parabola2-any.src.tar.gz mkinitcpio/ mkinitcpio/mkinitcpio-30.tar.gz mkinitcpio/PKGBUILD mkinitcpio/.SRCINFO mkinitcpio/mkinitcpio.install mkinitcpio/mkinitcpio-30.tar.gz.sig mkinitcpio/9001-udev.patch So I only used the PKGBUILD, mkinitcpio.install and 9001-udev.patch files here as we don't commit the .SRCINFO or source tarballs to git in Parabola. Signed-off-by: Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>
-rw-r--r--libre/mkinitcpio/9001-udev.patch52
-rw-r--r--libre/mkinitcpio/PKGBUILD67
-rw-r--r--libre/mkinitcpio/mkinitcpio.install15
3 files changed, 134 insertions, 0 deletions
diff --git a/libre/mkinitcpio/9001-udev.patch b/libre/mkinitcpio/9001-udev.patch
new file mode 100644
index 000000000..0de1067a4
--- /dev/null
+++ b/libre/mkinitcpio/9001-udev.patch
@@ -0,0 +1,52 @@
+$ curl https://github.com/archlinux/mkinitcpio/commit/9ee1333a5f3302d7ddb004cf0909c94b4cff60ba.diff
+diff --git a/functions b/functions
+index 9539a60..f95fb92 100644
+--- a/functions
++++ b/functions
+@@ -625,6 +625,46 @@ add_binary() {
+ return 0
+ }
+
++add_udev_rule() {
++ # Add an udev rules file to the initcpio image. Dependencies on binaries
++ # will be discovered and added.
++ # $1: path to rules file (or name of rules file)
++
++ local rules="$1" rule= key= value= binary=
++
++ if [[ ${rules:0:1} != '/' ]]; then
++ rules=$(PATH=/usr/lib/udev/rules.d:/lib/udev/rules.d type -P "$rules")
++ fi
++ if [[ -z $rules ]]; then
++ # complain about not found rules
++ return 1
++ fi
++
++ add_file "$rules" /usr/lib/udev/rules.d/"${rules##*/}"
++
++ while IFS=, read -ra rule; do
++ # skip empty lines, comments
++ [[ -z $rule || $rule = @(+([[:space:]])|#*) ]] && continue
++
++ for pair in "${rule[@]}"; do
++ IFS=' =' read -r key value <<< "$pair"
++ case $key in
++ RUN@({program}|+)|IMPORT{program}|ENV{REMOVE_CMD})
++ # strip quotes
++ binary=${value//[\"\']/}
++ # just take the first word as the binary name
++ binary=${binary%% *}
++ [[ ${binary:0:1} == '$' ]] && continue
++ if [[ ${binary:0:1} != '/' ]]; then
++ binary=$(PATH=/usr/lib/udev:/lib/udev type -P "$binary")
++ fi
++ add_binary "$binary"
++ ;;
++ esac
++ done
++ done <"$rules"
++}
++
+ parse_config() {
+ # parse key global variables set by the config file.
+
diff --git a/libre/mkinitcpio/PKGBUILD b/libre/mkinitcpio/PKGBUILD
new file mode 100644
index 000000000..d8d12a586
--- /dev/null
+++ b/libre/mkinitcpio/PKGBUILD
@@ -0,0 +1,67 @@
+# Maintainer (Arch): Giancarlo Razzolini <grazzolini@archlinux.org>
+# Maintainer (Arch): Dave Reisner <dreisner@archlinux.org>
+# Maintainer (Arch): Thomas Bächler <thomas@archlinux.org>
+# Maintainer: David P. <megver83@parabola.nu>
+
+
+# parabola changes and rationale:
+# - replace 'systemd' dep with 'udev'
+# - emergency patch (mkinitcpio/udev patch #3121)
+# normally we keep core/mkinitcpio
+# !!! REMEMBER to db-remove libre/mkinitcpio !!!
+_IS_NONSYSTEMD=false
+
+
+pkgname=mkinitcpio
+pkgver=30
+pkgrel=2
+pkgrel+=$(${_IS_NONSYSTEMD} && echo '.nonsystemd1' || echo '.parabola2')
+pkgdesc="Modular initramfs image creation utility"
+arch=('any')
+url='https://github.com/archlinux/mkinitcpio'
+license=('GPL')
+makedepends=('asciidoc')
+depends=('awk' 'mkinitcpio-busybox>=1.19.4-2' 'kmod' 'util-linux>=2.23' 'libarchive' 'coreutils'
+ 'bash' 'diffutils' 'findutils' 'grep' 'filesystem>=2011.10-1' 'zstd' 'systemd')
+depends=( $(${_IS_NONSYSTEMD} && echo ${depends[*]/systemd/udev} || echo ${depends[*]}) )
+optdepends=('gzip: Use gzip 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'
+ 'lz4: Use lz4 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.gz"{,.sig})
+source+=( $(${_IS_NONSYSTEMD} && echo '9000-nonsystemd.patch') )
+source+=(9001-udev.patch)
+install=mkinitcpio.install
+sha512sums=('ef43a8ddc01697fa43bede4eebad3271bbc89efa57ba7e4e9f321e8174ff2af74d857b308c5c0f37b42a91906c91c1b022f9a651c70d5d3e9dfc8dc441a60ee4'
+ 'SKIP')
+sha512sums+=( $(${_IS_NONSYSTEMD} && echo 'f1ad7792b3b42397c2645e834d4b6c6a89122060455954d1ab56a71c673c3b8a8fdbbd6d722d30195211672b9075d09ac07ce6fb5d9723f56ce540709ebe4665') )
+sha512sums+=('695e70d85cf4c666b4325113f5f784b06002b0d9c626338b72bec9049a133cd5a2209d73193574da18d8ecac2fab54754cf499c18faaff5b20e2053a4d338b12')
+b2sums=('2001f9ac12bfa7369ad32842956cd21b2a786cd28133b6d3256e4aa77210c78ec6cac8a710ff8c2feb5a4797c1a33ce8c8c7dfabd84d7927c08bf8377e330300'
+ 'SKIP')
+b2sums+=( $(${_IS_NONSYSTEMD} && echo '92e1969572e0022bd257f44314045f57db47821d99a40ea1290749967b50ead1cb11adaa9b79f4286fbf20a94173e0ba7f2d4f88208e31d7a03a8de4ea014396') )
+b2sums+=('0f53c448b2ada7923c1dbab331a0b68a9e79f402bd7e16388a6ea2da4c7d93539405e4bd86eccdaaabcdfdbb0c01c5ca337ba226b81dd8dc91f6411c4e678c64')
+validpgpkeys=('ECCAC84C1BA08A6CC8E63FBBF22FB1D78A77AEAB' # Giancarlo Razzolini
+ '86CFFCA918CF3AF47147588051E8B148A9999C34') # Evangelos Foutras
+
+prepare() {
+ cd $pkgname-$pkgver
+
+ ${_IS_NONSYSTEMD} && patch -Np1 -i ../9000-nonsystemd.patch
+
+ # https://labs.parabola.nu/issues/3121
+ # https://github.com/archlinux/mkinitcpio/pull/54
+ # https://github.com/archlinux/mkinitcpio/commit/9ee1333a5f3302d7ddb004cf0909c94b4cff60ba.diff
+ patch -Np1 -i ../9001-udev.patch
+}
+
+check() {
+ make -C "$pkgname-$pkgver" check
+}
+
+package() {
+ make -C "$pkgname-$pkgver" DESTDIR="$pkgdir" install
+}
diff --git a/libre/mkinitcpio/mkinitcpio.install b/libre/mkinitcpio/mkinitcpio.install
new file mode 100644
index 000000000..8571ee7d3
--- /dev/null
+++ b/libre/mkinitcpio/mkinitcpio.install
@@ -0,0 +1,15 @@
+#!/bin/sh
+
+post_upgrade() {
+ if [ "$(vercmp 0.9.0 "$2")" -eq 1 ]; then
+ printf '==> If your /usr is on a separate partition, you must add the "usr" hook\n'
+ printf ' to /etc/mkinitcpio.conf and regenerate your images before rebooting\n'
+ fi
+
+ if [ "$(vercmp 0.12.0 "$2")" -eq 1 ]; then
+ printf '==> The "block" hook has replaced several hooks:\n'
+ printf ' fw, sata, pata, scsi, virtio, mmc, usb\n'
+ printf ' Replace any and all of these in /etc/mkinitcpio.conf with a single\n'
+ printf ' instance of the "block" hook\n'
+ fi
+}