summaryrefslogtreecommitdiff
path: root/nonsystemd/mkinitcpio
diff options
context:
space:
mode:
authorDavid P <megver83@parabola.nu>2018-05-08 23:47:40 -0300
committerDavid P <megver83@parabola.nu>2018-05-08 23:47:40 -0300
commit40a0ca9eb80616bf2bc7ad9db4e3cf4eb0d9e0e7 (patch)
treea2a919c5496103fa5dd75504ed80cd5dfac0b0bc /nonsystemd/mkinitcpio
parent35299cf68a862c8d84fc50db078cbd3e187b530f (diff)
nonsystemd/mkinitcpio: add package
Signed-off-by: David P <megver83@parabola.nu>
Diffstat (limited to 'nonsystemd/mkinitcpio')
-rw-r--r--nonsystemd/mkinitcpio/0001-Restore-addition-of-modules-from-config-file.patch39
-rw-r--r--nonsystemd/mkinitcpio/PKGBUILD45
-rw-r--r--nonsystemd/mkinitcpio/mkinitcpio.install15
-rw-r--r--nonsystemd/mkinitcpio/nosystemd.patch50
4 files changed, 149 insertions, 0 deletions
diff --git a/nonsystemd/mkinitcpio/0001-Restore-addition-of-modules-from-config-file.patch b/nonsystemd/mkinitcpio/0001-Restore-addition-of-modules-from-config-file.patch
new file mode 100644
index 000000000..bd2668a36
--- /dev/null
+++ b/nonsystemd/mkinitcpio/0001-Restore-addition-of-modules-from-config-file.patch
@@ -0,0 +1,39 @@
+From 5bba09cb1c661627fde76b977cfe9f937b1264a3 Mon Sep 17 00:00:00 2001
+From: Dave Reisner <dreisner@archlinux.org>
+Date: Fri, 6 Oct 2017 08:15:43 -0400
+Subject: [mkinitcpio] [PATCH] Restore addition of modules from config file
+
+Broken by c5ad00c2.
+
+ref: https://bugs.archlinux.org/task/55870
+---
+ functions | 11 ++++++++++-
+ 1 file changed, 10 insertions(+), 1 deletion(-)
+
+diff --git a/functions b/functions
+index 1486f2f..ba95e80 100644
+--- a/functions
++++ b/functions
+@@ -627,9 +627,18 @@ parse_config() {
+ map add_file "${FILES[@]}"
+
+ tee "$BUILDROOT/buildconfig" < "$1" | {
++ # When MODULES is not an array (but instead implicitly converted at
++ # startup), sourcing the config causes the string value of MODULES
++ # to be assigned as MODULES[0]. Avoid this by explicitly unsetting
++ # MODULES before re-sourcing the config.
++ unset MODULES
++
+ . /dev/stdin
+
+- for mod in "${modules[@]%\?}"; do
++ # arrayize MODULES if necessary.
++ [[ ${MODULES@a} != *a* ]] && read -ra MODULES <<<"${MODULES//-/_}"
++
++ for mod in "${MODULES[@]%\?}"; do
+ mod=${mod//-/_}
+ # only add real modules (2 == builtin)
+ (( _addedmodules["$mod"] == 1 )) && add+=("$mod")
+--
+2.14.2
+
diff --git a/nonsystemd/mkinitcpio/PKGBUILD b/nonsystemd/mkinitcpio/PKGBUILD
new file mode 100644
index 000000000..80980d860
--- /dev/null
+++ b/nonsystemd/mkinitcpio/PKGBUILD
@@ -0,0 +1,45 @@
+# Maintainer (Arch): Dave Reisner <dreisner@archlinux.org>
+# Maintainer (Arch): Thomas Bächler <thomas@archlinux.org>
+# Maintainer: David P. <megver83@parabola.nu>
+
+pkgname=mkinitcpio
+pkgver=24
+pkgrel=2.nosystemd1
+pkgdesc="Modular initramfs image creation utility"
+arch=('any')
+url="https://projects.archlinux.org/mkinitcpio.git/"
+license=('GPL')
+depends=('awk' 'mkinitcpio-busybox>=1.19.4-2' 'kmod' 'util-linux>=2.23' 'libarchive'
+ 'coreutils' 'bash' 'findutils' 'grep' 'filesystem>=2011.10-1' 'gzip' 'eudev')
+makedepends=('asciidoc')
+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'
+ 'mkinitcpio-nfs-utils: Support for root filesystem on NFS')
+backup=('etc/mkinitcpio.conf')
+source=("https://sources.archlinux.org/other/$pkgname/$pkgname-$pkgver.tar.gz"{,.sig}
+ 'nosystemd.patch'
+ '0001-Restore-addition-of-modules-from-config-file.patch')
+install=mkinitcpio.install
+sha256sums=('ec0ecbc518c14ecacf5a8ece2f068fe86fcaf3aed09ee6b82737e773e5d7d02b'
+ 'SKIP'
+ 'e561464646274d995a02776d3fee03199e3b3c5bdc80f31fdf53391744bb6b64'
+ 'd4cbbf7b05f5dcaf23139469376ff6c29e948ce77a8c51ad4867413b4bddc4db')
+validpgpkeys=('487EACC08557AD082088DABA1EB2638FF56C0C53' # Dave Reisner
+ '86CFFCA918CF3AF47147588051E8B148A9999C34') # Evangelos Foutras
+
+prepare() {
+ rm -rf ${srcdir}/${pkgname}-${pkgver}/install/sd-*
+ cd $pkgname-$pkgver
+ patch -Np1 -i $srcdir/nosystemd.patch
+ patch -Np1 -i $srcdir/0001-Restore-addition-of-modules-from-config-file.patch
+}
+
+check() {
+ make -C "$pkgname-$pkgver" check
+}
+
+package() {
+ make -C "$pkgname-$pkgver" DESTDIR="$pkgdir" install
+}
diff --git a/nonsystemd/mkinitcpio/mkinitcpio.install b/nonsystemd/mkinitcpio/mkinitcpio.install
new file mode 100644
index 000000000..8571ee7d3
--- /dev/null
+++ b/nonsystemd/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
+}
diff --git a/nonsystemd/mkinitcpio/nosystemd.patch b/nonsystemd/mkinitcpio/nosystemd.patch
new file mode 100644
index 000000000..4be0424ea
--- /dev/null
+++ b/nonsystemd/mkinitcpio/nosystemd.patch
@@ -0,0 +1,50 @@
+ Makefile | 6 +-----
+ init_functions | 11 -----------
+ 2 files changed, 1 insertion(+), 16 deletions(-)
+
+diff --git a/Makefile b/Makefile
+index 264f077..3958b62 100644
+--- a/Makefile
++++ b/Makefile
+@@ -17,7 +17,6 @@ DIRS = \
+ /usr/share/man/man5 \
+ /usr/share/man/man1 \
+ /usr/share/mkinitcpio \
+- /usr/lib/systemd/system/shutdown.target.wants \
+ /usr/lib/tmpfiles.d
+
+ BASH_SCRIPTS = \
+@@ -55,10 +54,7 @@ install: all
+
+ 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
+- ln -s ../mkinitcpio-generate-shutdown-ramfs.service \
+- $(DESTDIR)/usr/lib/systemd/system/shutdown.target.wants/mkinitcpio-generate-shutdown-ramfs.service
++
+ install -m644 tmpfiles/mkinitcpio.conf $(DESTDIR)/usr/lib/tmpfiles.d/mkinitcpio.conf
+
+ install -m755 50-mkinitcpio.install $(DESTDIR)/usr/lib/kernel/install.d/50-mkinitcpio.install
+diff --git a/init_functions b/init_functions
+index 8ad10c7..5579a49 100644
+--- a/init_functions
++++ b/init_functions
+@@ -298,17 +298,6 @@ fsck_root() {
+ 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
+ }
+