Bump buildroot to 2020.11-rc1 (#985)
* Update buildroot-patches for 2020.11-rc1 buildroot * Update buildroot to 2020.11-rc1 Signed-off-by: Stefan Agner <stefan@agner.ch> * Don't rely on sfdisk --list-free output The --list-free (-F) argument does not allow machine readable mode. And it seems that the output format changes over time (different spacing, using size postfixes instead of raw blocks). Use sfdisk json output and calculate free partition space ourselfs. This works for 2.35 and 2.36 and is more robust since we rely on output which is meant for scripts to parse. * Migrate defconfigs for Buildroot 2020.11-rc1 In particular, rename BR2_TARGET_UBOOT_BOOT_SCRIPT(_SOURCE) to BR2_PACKAGE_HOST_UBOOT_TOOLS_BOOT_SCRIPT(_SOURCE). * Rebase/remove systemd patches for systemd 246 * Drop apparmor/libapparmor from buildroot-external * hassos-persists: use /run as directory for lockfiles The U-Boot tools use /var/lock by default which is not created any more by systemd by default (it is under tmpfiles legacy.conf, which we no longer install). * Disable systemd-update-done.service The service is not suited for pure read-only systems. In particular the service needs to be able to write a file in /etc and /var. Remove the service. Note: This is a static service and cannot be removed using systemd-preset. * Disable apparmor.service for now The service loads all default profiles. Some might actually cause problems. E.g. the profile for ping seems not to match our setup for /etc/resolv.conf: [85503.634653] audit: type=1400 audit(1605286002.684:236): apparmor="DENIED" operation="open" profile="ping" name="/run/resolv.conf" pid=27585 comm="ping" requested_mask="r" denied_mask="r" fsuid=0 ouid=0
This commit is contained in:
@@ -1,30 +0,0 @@
|
||||
From 7727b6fe0897849d4fc8f75a48326e902f0ab8b2 Mon Sep 17 00:00:00 2001
|
||||
From: Fabrice Fontaine <fontaine.fabrice@gmail.com>
|
||||
Date: Sun, 22 Sep 2019 10:06:35 +0200
|
||||
Subject: [PATCH] mkfs/Makefile.am: fix build without blkid
|
||||
|
||||
Commit d56232bc1640e2a3ffc412faff42cd8e77dbb8dd hardcoded -lblkid in
|
||||
libf2fs_format_la_LDFLAGS which breaks the build with --without-blkid
|
||||
option so use ${libblkid_LIBS} instead
|
||||
|
||||
Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
|
||||
---
|
||||
mkfs/Makefile.am | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/mkfs/Makefile.am b/mkfs/Makefile.am
|
||||
index cae2f93..83e2389 100644
|
||||
--- a/mkfs/Makefile.am
|
||||
+++ b/mkfs/Makefile.am
|
||||
@@ -12,7 +12,7 @@ lib_LTLIBRARIES = libf2fs_format.la
|
||||
libf2fs_format_la_SOURCES = f2fs_format_main.c f2fs_format.c f2fs_format_utils.c
|
||||
libf2fs_format_la_CFLAGS = -DWITH_BLKDISCARD
|
||||
libf2fs_format_la_CPPFLAGS = -I$(top_srcdir)/include
|
||||
-libf2fs_format_la_LDFLAGS = -lblkid -luuid -L$(top_builddir)/lib -lf2fs \
|
||||
+libf2fs_format_la_LDFLAGS = ${libblkid_LIBS} -luuid -L$(top_builddir)/lib -lf2fs \
|
||||
-version-info $(FMT_CURRENT):$(FMT_REVISION):$(FMT_AGE)
|
||||
|
||||
install-exec-hook:
|
||||
--
|
||||
2.23.0
|
||||
|
||||
@@ -1,195 +0,0 @@
|
||||
From eee12fe5e2e6c5f71bc7cbe25a608b730fd5362e Mon Sep 17 00:00:00 2001
|
||||
From: Chao Yu <yuchao0@huawei.com>
|
||||
Date: Fri, 7 Aug 2020 10:02:31 +0800
|
||||
Subject: [PATCH] fsck.f2fs: correct return value
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
As Norbert Lange reported:
|
||||
|
||||
"
|
||||
$ fsck.f2fs -a /dev/mmcblk0p5; echo $?
|
||||
Info: Fix the reported corruption.
|
||||
Info: Mounted device!
|
||||
Info: Check FS only on RO mounted device
|
||||
Error: Failed to open the device!
|
||||
255
|
||||
"
|
||||
|
||||
Michael Laß reminds:
|
||||
|
||||
"
|
||||
I think the return value is exactly the problem here. See fsck(8) (
|
||||
https://linux.die.net/man/8/fsck) which specifies the return values.
|
||||
Systemd looks at these and decides how to proceed:
|
||||
|
||||
https://github.com/systemd/systemd/blob/a859abf062cef1511e4879c4ee39c6036ebeaec8/src/fsck/fsck.c#L407
|
||||
|
||||
That means, if fsck.f2fs returns 255, then
|
||||
the FSCK_SYSTEM_SHOULD_REBOOT bit is set and systemd will reboot.
|
||||
"
|
||||
|
||||
So the problem here is fsck.f2fs didn't return correct value to userspace
|
||||
apps, result in later unexpected behavior of rebooting, let's fix this.
|
||||
|
||||
Reported-by: Norbert Lange <nolange79@gmail.com>
|
||||
Reported-by: Michael Laß <bevan@bi-co.net>
|
||||
Signed-off-by: Chao Yu <yuchao0@huawei.com>
|
||||
Signed-off-by: Norbert Lange <nolange79@gmail.com>
|
||||
---
|
||||
fsck/fsck.h | 11 +++++++++++
|
||||
fsck/main.c | 45 +++++++++++++++++++++++++++++++--------------
|
||||
2 files changed, 42 insertions(+), 14 deletions(-)
|
||||
|
||||
diff --git a/fsck/fsck.h b/fsck/fsck.h
|
||||
index ccf4a39..c8aeb06 100644
|
||||
--- a/fsck/fsck.h
|
||||
+++ b/fsck/fsck.h
|
||||
@@ -13,6 +13,17 @@
|
||||
|
||||
#include "f2fs.h"
|
||||
|
||||
+enum {
|
||||
+ FSCK_SUCCESS = 0,
|
||||
+ FSCK_ERROR_CORRECTED = 1 << 0,
|
||||
+ FSCK_SYSTEM_SHOULD_REBOOT = 1 << 1,
|
||||
+ FSCK_ERRORS_LEFT_UNCORRECTED = 1 << 2,
|
||||
+ FSCK_OPERATIONAL_ERROR = 1 << 3,
|
||||
+ FSCK_USAGE_OR_SYNTAX_ERROR = 1 << 4,
|
||||
+ FSCK_USER_CANCELLED = 1 << 5,
|
||||
+ FSCK_SHARED_LIB_ERROR = 1 << 7,
|
||||
+};
|
||||
+
|
||||
struct quota_ctx;
|
||||
|
||||
#define FSCK_UNMATCHED_EXTENT 0x00000001
|
||||
diff --git a/fsck/main.c b/fsck/main.c
|
||||
index 8c62a14..b0f2ec3 100644
|
||||
--- a/fsck/main.c
|
||||
+++ b/fsck/main.c
|
||||
@@ -591,7 +591,7 @@ void f2fs_parse_options(int argc, char *argv[])
|
||||
error_out(prog);
|
||||
}
|
||||
|
||||
-static void do_fsck(struct f2fs_sb_info *sbi)
|
||||
+static int do_fsck(struct f2fs_sb_info *sbi)
|
||||
{
|
||||
struct f2fs_checkpoint *ckpt = F2FS_CKPT(sbi);
|
||||
u32 flag = le32_to_cpu(ckpt->ckpt_flags);
|
||||
@@ -614,7 +614,7 @@ static void do_fsck(struct f2fs_sb_info *sbi)
|
||||
} else {
|
||||
MSG(0, "[FSCK] F2FS metadata [Ok..]");
|
||||
fsck_free(sbi);
|
||||
- return;
|
||||
+ return FSCK_SUCCESS;
|
||||
}
|
||||
|
||||
if (!c.ro)
|
||||
@@ -646,7 +646,7 @@ static void do_fsck(struct f2fs_sb_info *sbi)
|
||||
ret = quota_init_context(sbi);
|
||||
if (ret) {
|
||||
ASSERT_MSG("quota_init_context failure: %d", ret);
|
||||
- return;
|
||||
+ return FSCK_OPERATIONAL_ERROR;
|
||||
}
|
||||
}
|
||||
fsck_chk_orphan_node(sbi);
|
||||
@@ -654,8 +654,14 @@ static void do_fsck(struct f2fs_sb_info *sbi)
|
||||
F2FS_FT_DIR, TYPE_INODE, &blk_cnt, NULL);
|
||||
fsck_chk_quota_files(sbi);
|
||||
|
||||
- fsck_verify(sbi);
|
||||
+ ret = fsck_verify(sbi);
|
||||
fsck_free(sbi);
|
||||
+
|
||||
+ if (!c.bug_on)
|
||||
+ return FSCK_SUCCESS;
|
||||
+ if (!ret)
|
||||
+ return FSCK_ERROR_CORRECTED;
|
||||
+ return FSCK_ERRORS_LEFT_UNCORRECTED;
|
||||
}
|
||||
|
||||
static void do_dump(struct f2fs_sb_info *sbi)
|
||||
@@ -763,7 +769,7 @@ static int do_sload(struct f2fs_sb_info *sbi)
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
struct f2fs_sb_info *sbi;
|
||||
- int ret = 0;
|
||||
+ int ret = 0, ret2;
|
||||
clock_t start = clock();
|
||||
|
||||
f2fs_init_configuration();
|
||||
@@ -771,10 +777,15 @@ int main(int argc, char **argv)
|
||||
f2fs_parse_options(argc, argv);
|
||||
|
||||
if (c.func != DUMP && f2fs_devs_are_umounted() < 0) {
|
||||
- if (errno == EBUSY)
|
||||
+ if (errno == EBUSY) {
|
||||
+ if (c.func == FSCK)
|
||||
+ return FSCK_OPERATIONAL_ERROR;
|
||||
return -1;
|
||||
+ }
|
||||
if (!c.ro || c.func == DEFRAG) {
|
||||
MSG(0, "\tError: Not available on mounted device!\n");
|
||||
+ if (c.func == FSCK)
|
||||
+ return FSCK_OPERATIONAL_ERROR;
|
||||
return -1;
|
||||
}
|
||||
|
||||
@@ -789,8 +800,11 @@ int main(int argc, char **argv)
|
||||
}
|
||||
|
||||
/* Get device */
|
||||
- if (f2fs_get_device_info() < 0)
|
||||
+ if (f2fs_get_device_info() < 0) {
|
||||
+ if (c.func == FSCK)
|
||||
+ return FSCK_OPERATIONAL_ERROR;
|
||||
return -1;
|
||||
+ }
|
||||
|
||||
fsck_again:
|
||||
memset(&gfsck, 0, sizeof(gfsck));
|
||||
@@ -808,7 +822,7 @@ fsck_again:
|
||||
|
||||
switch (c.func) {
|
||||
case FSCK:
|
||||
- do_fsck(sbi);
|
||||
+ ret = do_fsck(sbi);
|
||||
break;
|
||||
#ifdef WITH_DUMP
|
||||
case DUMP:
|
||||
@@ -856,8 +870,8 @@ fsck_again:
|
||||
char ans[255] = {0};
|
||||
retry:
|
||||
printf("Do you want to fix this partition? [Y/N] ");
|
||||
- ret = scanf("%s", ans);
|
||||
- ASSERT(ret >= 0);
|
||||
+ ret2 = scanf("%s", ans);
|
||||
+ ASSERT(ret2 >= 0);
|
||||
if (!strcasecmp(ans, "y"))
|
||||
c.fix_on = 1;
|
||||
else if (!strcasecmp(ans, "n"))
|
||||
@@ -869,12 +883,15 @@ retry:
|
||||
goto fsck_again;
|
||||
}
|
||||
}
|
||||
- ret = f2fs_finalize_device();
|
||||
- if (ret < 0)
|
||||
- return ret;
|
||||
+ ret2 = f2fs_finalize_device();
|
||||
+ if (ret2) {
|
||||
+ if (c.func == FSCK)
|
||||
+ return FSCK_OPERATIONAL_ERROR;
|
||||
+ return ret2;
|
||||
+ }
|
||||
|
||||
printf("\nDone: %lf secs\n", (clock() - start) / (double)CLOCKS_PER_SEC);
|
||||
- return 0;
|
||||
+ return ret;
|
||||
|
||||
out_err:
|
||||
if (sbi->ckpt)
|
||||
--
|
||||
2.27.0
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
# Locally computed
|
||||
sha256 b39d3ae9224267aab0070b5f17d91d0c5143f6d960166a27f6b11c8c87072c7d f2fs-tools-1.13.0.tar.gz
|
||||
sha256 619263d4e2022152a1472c1d912eaae104f20bd227ce0bb9d41d1d6608094bd1 f2fs-tools-1.14.0.tar.gz
|
||||
sha256 662abb3a8a80b36ae7036c289dd1e03b361ee5dd2e6fd5211d0d8d029146449f COPYING
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
#
|
||||
################################################################################
|
||||
|
||||
F2FS_TOOLS_VERSION = 1.13.0
|
||||
F2FS_TOOLS_VERSION = 1.14.0
|
||||
F2FS_TOOLS_SITE = https://git.kernel.org/pub/scm/linux/kernel/git/jaegeuk/f2fs-tools.git/snapshot
|
||||
F2FS_TOOLS_CONF_ENV = ac_cv_file__git=no
|
||||
F2FS_TOOLS_DEPENDENCIES = host-pkgconf util-linux
|
||||
|
||||
Reference in New Issue
Block a user