Commit f084034a authored by Natanael Copa's avatar Natanael Copa

main/mkinitfs: upgrade to 3.4.3

parent 36773b5d
From bedf249e829f34d51cc8c4e4eef864b9b6163450 Mon Sep 17 00:00:00 2001
From: Natanael Copa <ncopa@alpinelinux.org>
Date: Wed, 29 May 2019 13:19:24 +0200
Subject: [PATCH] nlplug-findfs: fix when cryptheader is a regular file
Handle case when the crypt header is a normal file which is included in
initramfs and not a blockdevice.
---
nlplug-findfs.c | 13 +++++++++++++
1 file changed, 13 insertions(+)
diff --git a/nlplug-findfs.c b/nlplug-findfs.c
index 0283161..9f15de5 100644
--- a/nlplug-findfs.c
+++ b/nlplug-findfs.c
@@ -1213,6 +1213,13 @@ static void usage(int rc)
exit(rc);
}
+static int regular_file(const char *path)
+{
+ struct stat st;
+ int r = stat(path, &st);
+ return r == -1 ? 0 : S_ISREG(st.st_mode);
+}
+
int main(int argc, char *argv[])
{
struct pollfd fds[3];
@@ -1262,6 +1269,12 @@ int main(int argc, char *argv[])
break;
case 'H':
conf.crypt.header.device = EARGF(usage(1));
+ /* the header may be in a regular file and not a device */
+ if (regular_file(conf.crypt.header.device)) {
+ snprintf(conf.crypt.header.devnode,
+ sizeof(conf.crypt.header.devnode),
+ "%s", conf.crypt.header.device);
+ }
break;
case 'h':
usage(0);
--
2.21.0
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=mkinitfs
pkgver=3.4.2
pkgver=3.4.3
_ver=${pkgver%_git*}
pkgrel=1
pkgrel=0
pkgdesc="Tool to generate initramfs images for Alpine"
url="https://git.alpinelinux.org/cgit/mkinitfs"
arch="all"
......@@ -17,7 +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-nlplug-findfs-fix-when-cryptheader-is-a-regular-file.patch
"
builddir="$srcdir/$pkgname-$_ver"
......@@ -32,5 +31,4 @@ package() {
make install DESTDIR="$pkgdir"
}
sha512sums="4eb28928052dddf7d092b1b18c868bc92435ad1702101db5973b9f4969bda89ccc4efb12cd7fd849037f6a663ef2e4a8b54f4b01747222dae5a9e8d1a31804bc mkinitfs-3.4.2.tar.xz
0bca7e4f48b944eb8b802ea728393d76bf1132a165e7ca443394f06c79117fdbe284a3b233558ff527c96f2ce3a21adcc9df9cc93d287eb3e9dd1c16e938a3a2 0001-nlplug-findfs-fix-when-cryptheader-is-a-regular-file.patch"
sha512sums="d335a6f58ca38a3cc6dcc560baaabd3ea9522ce25de008eb637f0761db7f783c3b03767ba046c3d34550d1d0741bcc54ad09903b41e79fe408264eadbbc0a457 mkinitfs-3.4.3.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