From 01ebdb53b9e14621caca60516697dad76869e053 Mon Sep 17 00:00:00 2001 From: Dylan Araps Date: Thu, 20 Feb 2020 21:15:54 +0200 Subject: [PATCH] busybox: Add fsck fix for uuid --- core/busybox/build | 5 +- core/busybox/checksums | 1 + core/busybox/patches/fsck-resolve-uuid.patch | 56 ++++++++++++++++++++ core/busybox/sources | 1 + core/busybox/version | 2 +- 5 files changed, 62 insertions(+), 3 deletions(-) create mode 100644 core/busybox/patches/fsck-resolve-uuid.patch diff --git a/core/busybox/build b/core/busybox/build index 86b1f8d5..456012f1 100755 --- a/core/busybox/build +++ b/core/busybox/build @@ -1,7 +1,8 @@ #!/bin/sh -e -# WHY WHY WHY WHY WHY. -patch -p1 < adduser-no-setgid.patch +for patch in *.patch; do + patch -p1 < "$patch" +done # Build and install regular busybox. # This excludes utilities which require 'suid' to function. diff --git a/core/busybox/checksums b/core/busybox/checksums index ba40c771..5cd3681e 100644 --- a/core/busybox/checksums +++ b/core/busybox/checksums @@ -1,5 +1,6 @@ d0f940a72f648943c1f2211e0e3117387c31d765137d92bd8284a3fb9752a998 busybox-1.31.1.tar.bz2 09c2f601fec4e5c10664c22f787dafb9424efe219bf826727c356da90dfd60d5 adduser-no-setgid.patch +8d84b1719dca2a751c09072c20cd782a3c47f119a68d35316f89d851daf67b88 fsck-resolve-uuid.patch c22a310aa2b992d4b7620ae6340cea7a708fe9db61a52aae507209b46d4dfa09 .config da3ef90a65abcbd112fa98a00799745d88d568cde290e049a5380dfc74de620a .config-suid 814dea14ac612125e97dcc1d619219b2c9dfc14850bf48d858421fb2c98eca12 crond.run diff --git a/core/busybox/patches/fsck-resolve-uuid.patch b/core/busybox/patches/fsck-resolve-uuid.patch new file mode 100644 index 00000000..fd2503e7 --- /dev/null +++ b/core/busybox/patches/fsck-resolve-uuid.patch @@ -0,0 +1,56 @@ +From 2e673aac06d661038001286fd389d1b45c511c66 Mon Sep 17 00:00:00 2001 +From: Natanael Copa +Date: Tue, 28 Nov 2017 13:23:17 +0100 +Subject: [PATCH] fsck: resolve LABEL=.../UUID=... spec to device + +--- + e2fsprogs/fsck.c | 10 +++++----- + 1 file changed, 5 insertions(+), 5 deletions(-) + +diff --git a/e2fsprogs/fsck.c b/e2fsprogs/fsck.c +index f5aa3dbe4..e2edc9747 100644 +--- a/e2fsprogs/fsck.c ++++ b/e2fsprogs/fsck.c +@@ -60,6 +60,7 @@ + //usage: "\n -t TYPE List of filesystem types to check" + + #include "libbb.h" ++#include "volume_id.h" + #include "common_bufsiz.h" + + /* "progress indicator" code is somewhat buggy and ext[23] specific. +@@ -524,12 +525,13 @@ static int wait_many(int flags) + * Execute a particular fsck program, and link it into the list of + * child processes we are waiting for. + */ +-static void execute(const char *type, const char *device, ++static void execute(const char *type, const char *spec, + const char *mntpt /*, int interactive */) + { + int i; + struct fsck_instance *inst; + pid_t pid; ++ char *device = (char *)spec; + + G.args[0] = xasprintf("fsck.%s", type); + +@@ -544,7 +546,8 @@ static void execute(const char *type, const char *device, + } + #endif + +- G.args[G.num_args - 2] = (char*)device; ++ resolve_mount_spec(&device); ++ G.args[G.num_args - 2] = device; + /* G.args[G.num_args - 1] = NULL; - already is */ + + if (G.verbose || G.noexecute) { +@@ -973,9 +976,6 @@ int fsck_main(int argc UNUSED_PARAM, char **argv) + + /* "/dev/blk" or "/path" or "UUID=xxx" or "LABEL=xxx" */ + if ((arg[0] == '/' && !opts_for_fsck) || strchr(arg, '=')) { +-// FIXME: must check that arg is a blkdev, or resolve +-// "/path", "UUID=xxx" or "LABEL=xxx" into block device name +-// ("UUID=xxx"/"LABEL=xxx" can probably shifted to fsck.auto duties) + devices = xrealloc_vector(devices, 2, num_devices); + devices[num_devices++] = arg; + continue; diff --git a/core/busybox/sources b/core/busybox/sources index f7efa4ae..767f7da6 100644 --- a/core/busybox/sources +++ b/core/busybox/sources @@ -1,5 +1,6 @@ https://busybox.net/downloads/busybox-1.31.1.tar.bz2 patches/adduser-no-setgid.patch +patches/fsck-resolve-uuid.patch files/.config files/.config-suid files/crond.run diff --git a/core/busybox/version b/core/busybox/version index c23b9466..01aa66f1 100644 --- a/core/busybox/version +++ b/core/busybox/version @@ -1 +1 @@ -1.31.1 5 +1.31.1 6