diff --git a/br-ext-chip-hisilicon/Config.in b/br-ext-chip-hisilicon/Config.in index e4849fdf..9b94ba66 100644 --- a/br-ext-chip-hisilicon/Config.in +++ b/br-ext-chip-hisilicon/Config.in @@ -1,6 +1,7 @@ source "$BR2_EXTERNAL_HISILICON_PATH/linux/Config.ext.in" source "$BR2_EXTERNAL_HISILICON_PATH/package/hisi_patcher/Config.in" source "$BR2_EXTERNAL_HISILICON_PATH/package/aura-httpd/Config.in" +source "$BR2_EXTERNAL_HISILICON_PATH/package/f2fs-tools-openipc/Config.in" source "$BR2_EXTERNAL_HISILICON_PATH/package/fdk-aac-openipc/Config.in" source "$BR2_EXTERNAL_HISILICON_PATH/package/fwprintenv-openipc/Config.in" source "$BR2_EXTERNAL_HISILICON_PATH/package/gdbserver-lite/Config.in" diff --git a/br-ext-chip-hisilicon/configs/unknown_unknown_hi3518ev300_openipc_defconfig b/br-ext-chip-hisilicon/configs/unknown_unknown_hi3518ev300_openipc_defconfig index d69dac0f..63596909 100644 --- a/br-ext-chip-hisilicon/configs/unknown_unknown_hi3518ev300_openipc_defconfig +++ b/br-ext-chip-hisilicon/configs/unknown_unknown_hi3518ev300_openipc_defconfig @@ -17,7 +17,7 @@ BR2_GCC_VERSION_7_X=y BR2_TOOLCHAIN_USES_MUSL=y BR2_TOOLCHAIN_BUILDROOT_MUSL=y BR2_TOOLCHAIN_BUILDROOT_LIBC="musl" -# BR2_TOOLCHAIN_BUILDROOT_CXX is not set +BR2_TOOLCHAIN_BUILDROOT_CXX=y BR2_TOOLCHAIN_BUILDROOT_LOCALE=y BR2_TOOLCHAIN_BUILDROOT_USE_SSP=y diff --git a/br-ext-chip-hisilicon/external.mk b/br-ext-chip-hisilicon/external.mk index 1c5f1771..8662b3cc 100644 --- a/br-ext-chip-hisilicon/external.mk +++ b/br-ext-chip-hisilicon/external.mk @@ -2,6 +2,7 @@ include $(BR2_EXTERNAL_HISILICON_PATH)/linux/linux-ext-hisi_patcher.mk include $(BR2_EXTERNAL_HISILICON_PATH)/package/hisi_patcher/hisi_patcher.mk include $(BR2_EXTERNAL_HISILICON_PATH)/package/aura-httpd/aura-httpd.mk include $(BR2_EXTERNAL_HISILICON_PATH)/package/gdbserver-lite/gdbserver-lite.mk +include $(BR2_EXTERNAL_HISILICON_PATH)/package/f2fs-tools-openipc/f2fs-tools-openipc.mk include $(BR2_EXTERNAL_HISILICON_PATH)/package/fdk-aac-openipc/fdk-aac-openipc.mk include $(BR2_EXTERNAL_HISILICON_PATH)/package/fwprintenv-openipc/fwprintenv-openipc.mk include $(BR2_EXTERNAL_HISILICON_PATH)/package/hisi_gpio/hisi_gpio.mk diff --git a/br-ext-chip-hisilicon/package/f2fs-tools-openipc b/br-ext-chip-hisilicon/package/f2fs-tools-openipc new file mode 120000 index 00000000..ecdabf86 --- /dev/null +++ b/br-ext-chip-hisilicon/package/f2fs-tools-openipc @@ -0,0 +1 @@ +../../general/package/f2fs-tools-openipc \ No newline at end of file diff --git a/general/overlay/etc/network/interfaces b/general/overlay/etc/network/interfaces index f9fc7ca4..132708aa 100644 --- a/general/overlay/etc/network/interfaces +++ b/general/overlay/etc/network/interfaces @@ -8,6 +8,11 @@ iface eth0 inet dhcp hwaddress ether $(fw_printenv -n ethaddr || echo 00:24:B8:FF:FF:FF) #pre-up echo -e "nameserver 77.88.8.8\nnameserver 8.8.4.4\n" >/tmp/resolv.conf +manual eth0:1 +iface eth0:1 inet static + address $(fw_printenv -n ipaddr) + netmask 255.255.255.0 + manual wlan0 iface wlan0 inet dhcp pre-up devmem 0x100C0080 32 0x530 diff --git a/general/package/busybox/busybox.config b/general/package/busybox/busybox.config index 88e9e7ff..66d0774f 100644 --- a/general/package/busybox/busybox.config +++ b/general/package/busybox/busybox.config @@ -631,7 +631,7 @@ CONFIG_FEATURE_MDEV_EXEC=y CONFIG_FEATURE_MDEV_DAEMON=y CONFIG_MESG=y CONFIG_FEATURE_MESG_ENABLE_ONLY_GROUP=y -CONFIG_MKE2FS=y +# CONFIG_MKE2FS is not set # CONFIG_MKFS_EXT2 is not set # CONFIG_MKFS_MINIX is not set # CONFIG_FEATURE_MINIX2 is not set diff --git a/general/package/f2fs-tools-openipc/0001-mkfs-Makefile.am-fix-build-without-blkid.patch b/general/package/f2fs-tools-openipc/0001-mkfs-Makefile.am-fix-build-without-blkid.patch new file mode 100644 index 00000000..aac60e70 --- /dev/null +++ b/general/package/f2fs-tools-openipc/0001-mkfs-Makefile.am-fix-build-without-blkid.patch @@ -0,0 +1,30 @@ +From 7727b6fe0897849d4fc8f75a48326e902f0ab8b2 Mon Sep 17 00:00:00 2001 +From: Fabrice Fontaine +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 +--- + 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 + diff --git a/general/package/f2fs-tools-openipc/0002-fsck.f2fs-correct-return-value.patch b/general/package/f2fs-tools-openipc/0002-fsck.f2fs-correct-return-value.patch new file mode 100644 index 00000000..b420e27a --- /dev/null +++ b/general/package/f2fs-tools-openipc/0002-fsck.f2fs-correct-return-value.patch @@ -0,0 +1,195 @@ +From eee12fe5e2e6c5f71bc7cbe25a608b730fd5362e Mon Sep 17 00:00:00 2001 +From: Chao Yu +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 +Reported-by: Michael Laß +Signed-off-by: Chao Yu +Signed-off-by: Norbert Lange +--- + 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 + diff --git a/general/package/f2fs-tools-openipc/Config.in b/general/package/f2fs-tools-openipc/Config.in new file mode 100644 index 00000000..4263fe84 --- /dev/null +++ b/general/package/f2fs-tools-openipc/Config.in @@ -0,0 +1,12 @@ +config BR2_PACKAGE_F2FS_TOOLS_OPENIPC + bool "f2fs-tools-openipc" + depends on BR2_USE_WCHAR # uses wchar_t + select BR2_PACKAGE_UTIL_LINUX + select BR2_PACKAGE_UTIL_LINUX_LIBUUID + help + Tools for Flash-Friendly File System (F2FS) + + https://git.kernel.org/pub/scm/linux/kernel/git/jaegeuk/f2fs-tools.git + +comment "f2fs-tools-openipc needs a toolchain w/ wchar" + depends on !BR2_USE_WCHAR diff --git a/general/package/f2fs-tools-openipc/f2fs-tools-openipc.mk b/general/package/f2fs-tools-openipc/f2fs-tools-openipc.mk new file mode 100644 index 00000000..d2ec4fc1 --- /dev/null +++ b/general/package/f2fs-tools-openipc/f2fs-tools-openipc.mk @@ -0,0 +1,22 @@ +################################################################################ +# +# f2fs-tools-openipc +# +################################################################################ + +F2FS_TOOLS_OPENIPC_VERSION = 1.13.0 +F2FS_TOOLS_OPENIPC_SITE = https://git.kernel.org/pub/scm/linux/kernel/git/jaegeuk/f2fs-tools.git/snapshot +F2FS_TOOLS_OPENIPC_CONF_ENV = ac_cv_file__git=no +F2FS_TOOLS_OPENIPC_DEPENDENCIES = host-pkgconf +# GIT version, shipped without configure +F2FS_TOOLS_OPENIPC_AUTORECONF = YES +F2FS_TOOLS_OPENIPC_INSTALL_STAGING = YES +F2FS_TOOLS_OPENIPC_LICENSE = GPL-2.0 +F2FS_TOOLS_OPENIPC_LICENSE_FILES = COPYING + +F2FS_TOOLS_OPENIPC_CONF_OPTS = \ + --without-selinux \ + --without-blkid + +$(eval $(autotools-package)) +$(eval $(host-autotools-package)) diff --git a/general/package/majestic-hi3516cv200/majestic-hi3516cv200.mk b/general/package/majestic-hi3516cv200/majestic-hi3516cv200.mk index 5710bb79..c0aafc42 100644 --- a/general/package/majestic-hi3516cv200/majestic-hi3516cv200.mk +++ b/general/package/majestic-hi3516cv200/majestic-hi3516cv200.mk @@ -1,6 +1,6 @@ ################################################################################ # -# majestic-hi3516c2300 +# majestic-hi3516cv200 # ################################################################################