Commit 17bb2805 authored by Natanael Copa's avatar Natanael Copa

main/mkinitfs: upgrade to 3.4.1

fixes #9961

(cherry picked from commit b5fca727)
parent 267ee534
From fd347152fd873803441570c29fbcee90326722d9 Mon Sep 17 00:00:00 2001
From: Natanael Copa <ncopa@alpinelinux.org>
Date: Fri, 25 Jan 2019 16:05:28 +0000
Subject: [PATCH] features: add crc32 modules to f2fs
---
features.d/f2fs.modules | 3 +++
1 file changed, 3 insertions(+)
diff --git a/features.d/f2fs.modules b/features.d/f2fs.modules
index b16edae..920b83c 100644
--- a/features.d/f2fs.modules
+++ b/features.d/f2fs.modules
@@ -1 +1,4 @@
+kernel/arch/*/crypto/crc32*
+kernel/crypto/crc32*
+kernel/fs/crypto/fscrypto
kernel/fs/f2fs
--
2.20.1
From 76530be3c34db2e4fdbe9eefd86384ad5f2f38e2 Mon Sep 17 00:00:00 2001
From: Natanael Copa <ncopa@alpinelinux.org>
Date: Fri, 25 Jan 2019 18:15:48 +0000
Subject: [PATCH 1/2] nlplug-findfs: detect zfs pool
if search device is prefixed with ZFS= then we search for a label with
the zpool name in the zfs path. For example, if search device is
"ZFS=tank/alpine/root" then we search for device that is type
"zfs_member" and label "tank".
This makes it work better with grub which creates a boot cmdline with
ZFS=
---
nlplug-findfs.c | 16 +++++++++++++++-
1 file changed, 15 insertions(+), 1 deletion(-)
diff --git a/nlplug-findfs.c b/nlplug-findfs.c
index e037a93..0283161 100644
--- a/nlplug-findfs.c
+++ b/nlplug-findfs.c
@@ -961,6 +961,16 @@ static void founddev(struct ueventconf *conf, int found)
}
}
+static int is_zfs_pool(const char *path, const char *label)
+{
+ char pool_name[256];
+ char *p;
+ snprintf(pool_name, sizeof(pool_name), "%s", path);
+ if ((p = strchr(pool_name, '/')))
+ *p = '\0';
+ return strcmp(label, pool_name) == 0 ? FOUND_DEVICE : 0;
+}
+
static int searchdev(struct uevent *ev, const char *searchdev, int scanbootmedia)
{
struct ueventconf *conf = ev->conf;
@@ -981,10 +991,10 @@ static int searchdev(struct uevent *ev, const char *searchdev, int scanbootmedia
type = blkid_get_tag_value(conf->blkid_cache, "TYPE", ev->devnode);
uuid = blkid_get_tag_value(conf->blkid_cache, "UUID", ev->devnode);
+ label = blkid_get_tag_value(conf->blkid_cache, "LABEL", ev->devnode);
if (searchdev != NULL) {
if (strncmp("LABEL=", searchdev, 6) == 0) {
- label = blkid_get_tag_value(conf->blkid_cache, "LABEL", ev->devnode);
if (label && strcmp(label, searchdev+6) == 0)
rc = FOUND_DEVICE;
} else if (strncmp("UUID=", searchdev, 5) == 0) {
@@ -1003,6 +1013,10 @@ static int searchdev(struct uevent *ev, const char *searchdev, int scanbootmedia
start_lvm2(ev->devnode);
} else if (strcmp("zfs_member", type) == 0) {
start_zpool(uuid);
+ if (searchdev != NULL && label != NULL
+ && strncmp("ZFS=", searchdev, 4) == 0) {
+ rc = is_zfs_pool(&searchdev[4], label);
+ }
} else if (scanbootmedia) {
rc = scandev(conf, ev->devnode, type);
}
--
2.20.1
From 61bb69ba80ed8d46429b717ff4e40f5e78f434a0 Mon Sep 17 00:00:00 2001
From: Natanael Copa <ncopa@alpinelinux.org>
Date: Fri, 25 Jan 2019 18:32:20 +0000
Subject: [PATCH 2/2] init: fix root=ZFS... from grub
grub will set root=ZFS=... when root is zfs but will not add rootfstype,
so make a special case for zfs
---
initramfs-init.in | 16 ++++++++++++----
1 file changed, 12 insertions(+), 4 deletions(-)
diff --git a/initramfs-init.in b/initramfs-init.in
index 69f917e..252b9ca 100755
--- a/initramfs-init.in
+++ b/initramfs-init.in
@@ -401,10 +401,18 @@ if [ "${KOPT_s390x_net%%,*}" = "qeth_l2" ]; then
echo 1 > /sys/bus/ccwgroup/drivers/qeth/"${_channel%%,*}"/online
fi
+# make sure we load zfs module if root=ZFS=...
+rootfstype=${KOPT_rootfstype}
+if [ -z "$rootfstype" ]; then
+ case "$KOPT_root" in
+ ZFS=*) rootfstype=zfs ;;
+ esac
+fi
+
# load available drivers to get access to modloop media
ebegin "Loading boot drivers"
-modprobe -a $(echo "$KOPT_modules $KOPT_rootfstype" | tr ',' ' ' ) loop squashfs 2> /dev/null
+modprobe -a $(echo "$KOPT_modules $rootfstype" | tr ',' ' ' ) loop squashfs 2> /dev/null
if [ -f /etc/modules ] ; then
sed 's/\#.*//g' < /etc/modules |
while read module args; do
@@ -454,7 +462,7 @@ if [ -n "$KOPT_root" ]; then
nlplug-findfs $cryptopts -p /sbin/mdev ${KOPT_debug_init:+-d} \
$KOPT_root
- if echo "$KOPT_modules $KOPT_rootfstype" | grep -qw btrfs; then
+ if echo "$KOPT_modules $rootfstype" | grep -qw btrfs; then
/sbin/btrfs device scan >/dev/null || \
echo "Failed to scan devices for btrfs filesystem."
fi
@@ -476,9 +484,9 @@ if [ -n "$KOPT_root" ]; then
mkdir -p /media/root-rw/work /media/root-rw/root
mount -t overlay -o lowerdir=/media/root-ro,upperdir=/media/root-rw/root,workdir=/media/root-rw/work overlayfs $sysroot
else
- mount ${KOPT_rootfstype:+-t} ${KOPT_rootfstype} \
+ mount ${rootfstype:+-t} ${rootfstype} \
-o ${KOPT_rootflags:-ro} \
- $KOPT_root $sysroot
+ ${KOPT_root#ZFS=} $sysroot
fi
eend $?
--
2.20.1
From d7ee92e1cb19bc37688bfaea0efb6308febb47b4 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Timo=20Ter=C3=A4s?= <timo.teras@iki.fi>
Date: Wed, 6 Feb 2019 11:38:49 +0200
Subject: [PATCH] init: fix fbsplash
The configuration option was renamed when parts of our patch
were upstreamed to busybox.
---
initramfs-init.in | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/initramfs-init.in b/initramfs-init.in
index 252b9ca..62b041d 100755
--- a/initramfs-init.in
+++ b/initramfs-init.in
@@ -596,7 +596,7 @@ if [ -f "$sysroot/etc/.default_boot_services" -o ! -f "$ovl" ]; then
fi
if [ "$KOPT_splash" != "no" ]; then
- echo "IMAGE_ALIGN=CM" > /tmp/fbsplash.cfg
+ echo "IMG_ALIGN=CM" > /tmp/fbsplash.cfg
for fbdev in /dev/fb[0-9]; do
[ -e "$fbdev" ] || break
num="${fbdev#/dev/fb}"
--
2.20.1
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=mkinitfs
pkgver=3.4.0
pkgver=3.4.1
_ver=${pkgver%_git*}
pkgrel=3
pkgrel=0
pkgdesc="Tool to generate initramfs images for Alpine"
url="https://git.alpinelinux.org/cgit/mkinitfs"
arch="all"
......@@ -17,10 +17,6 @@ subpackages="$pkgname-doc"
install="$pkgname.pre-upgrade $pkgname.post-install $pkgname.post-upgrade"
triggers="$pkgname.trigger=/usr/share/kernel/*"
source="https://dev.alpinelinux.org/archive/$pkgname/$pkgname-$_ver.tar.xz
0001-features-add-crc32-modules-to-f2fs.patch
0001-nlplug-findfs-detect-zfs-pool.patch
0002-init-fix-root-ZFS.-from-grub.patch
0003-init-fix-fbsplash.patch
"
builddir="$srcdir/$pkgname-$_ver"
......@@ -35,8 +31,4 @@ package() {
make install DESTDIR="$pkgdir"
}
sha512sums="6c7c1e49e49203f50784e08c8dec9b6bc3bbe5e238d91e85a0a61c09623f6c7b7dfcb490f20e1d6317cbb87287d23e7ef848f1ebf563392cee4b80499676cffc mkinitfs-3.4.0.tar.xz
00d598c5bbcfc0cc99a43aefae388bb1740e5e6c678c0eca14c3707f81d6378f9385bc15da3cd383e97e4a107adea739bdb1a80c1100f93597dcea37eaf8c6f8 0001-features-add-crc32-modules-to-f2fs.patch
064ee531edff553f2a1eacba9805d156e3257c87cfacd075f149a318132dd0cc96ff1a7c2766d370b4d4a1c3aa5bb6f6dfb3a76f2696f105df3787ade1f1f73b 0001-nlplug-findfs-detect-zfs-pool.patch
7ad0a117678b2e7e1a6366db7194525aca3cff04159bba8199feeb5e51399745436e52129d61ad7d48b880dd0a6e6b50d529f0ce2361580ed60e49d9e5b90017 0002-init-fix-root-ZFS.-from-grub.patch
056460d45346530be78aa9c1764d9f0bf14d94e5f518f3f796b00a9e2e922e3468177cc0032addc1e152fec00a20027ce498d7ef781d796c0414de7d388a1ede 0003-init-fix-fbsplash.patch"
sha512sums="3839f3ec4ca9f7318a611397c7190d19ae2267f31ffa97bb3777a024940799bccef3db7374d3c840b95290c493b2d3795ed2d03d72eb984c202de00c182eef77 mkinitfs-3.4.1.tar.xz"
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment