From e52e6d86e215b1322c7918b9d7804a4907846ec1 Mon Sep 17 00:00:00 2001 From: "Igor Zalatov (from Citadel PC)" Date: Sat, 21 Aug 2021 23:35:00 +0300 Subject: [PATCH] Enable cpio for all profilex and fix libjson --- ...nown_unknown_hi3516ev200_openipc_defconfig | 1 + ...nknown_unknown_hi3516ev300_glibc_defconfig | 1 + ...nown_unknown_hi3516ev300_openipc_defconfig | 1 + ...wn_unknown_hi3516ev300_tehshield_defconfig | 1 + ...nown_unknown_hi3518ev300_openipc_defconfig | 1 + .../unknown_unknown_ssc325_openipc_defconfig | 1 + .../unknown_unknown_ssc333_openipc_defconfig | 1 + ...unknown_unknown_ssc335_blackbird_defconfig | 1 + .../unknown_unknown_ssc335_dev_defconfig | 1 + .../unknown_unknown_ssc335_goodcam_defconfig | 1 + ...unknown_unknown_ssc335_initramfs_defconfig | 1 + .../unknown_unknown_ssc335_musl_defconfig | 1 + .../unknown_unknown_ssc335_openipc_defconfig | 1 + .../unknown_unknown_ssc335_portal_defconfig | 1 + .../unknown_unknown_ssc335_rotek_defconfig | 1 + ...unknown_unknown_ssc335de_openipc_defconfig | 1 + .../unknown_unknown_ssc337_kama_defconfig | 1 + .../unknown_unknown_ssc337_openipc_defconfig | 1 + ...unknown_unknown_ssc337de_openipc_defconfig | 1 + .../unknown_unknown_xm510_openipc_defconfig | 1 + .../unknown_unknown_xm530_openipc_defconfig | 1 + building.sh | 1 + general/overlay/usr/lib/libjson-c.so.2 | 1 + general/overlay/usr/sbin/firstboot | 28 ++++++++++++++++--- 24 files changed, 47 insertions(+), 4 deletions(-) create mode 120000 general/overlay/usr/lib/libjson-c.so.2 diff --git a/br-ext-chip-hisilicon/configs/unknown_unknown_hi3516ev200_openipc_defconfig b/br-ext-chip-hisilicon/configs/unknown_unknown_hi3516ev200_openipc_defconfig index c19959bd..051fd5b5 100644 --- a/br-ext-chip-hisilicon/configs/unknown_unknown_hi3516ev200_openipc_defconfig +++ b/br-ext-chip-hisilicon/configs/unknown_unknown_hi3516ev200_openipc_defconfig @@ -34,6 +34,7 @@ BR2_LINUX_KERNEL_EXT_HISI_PATCHER_LIST="$(BR2_EXTERNAL_HISILICON_PATH)/board/hi3 # Filesystem # BR2_TARGET_TZ_INFO is not set +BR2_TARGET_ROOTFS_CPIO=y BR2_TARGET_ROOTFS_SQUASHFS=y BR2_TARGET_ROOTFS_SQUASHFS4_XZ=y BR2_ROOTFS_OVERLAY="$(TOPDIR)/../general/overlay" diff --git a/br-ext-chip-hisilicon/configs/unknown_unknown_hi3516ev300_glibc_defconfig b/br-ext-chip-hisilicon/configs/unknown_unknown_hi3516ev300_glibc_defconfig index f765feea..3184ece6 100644 --- a/br-ext-chip-hisilicon/configs/unknown_unknown_hi3516ev300_glibc_defconfig +++ b/br-ext-chip-hisilicon/configs/unknown_unknown_hi3516ev300_glibc_defconfig @@ -37,6 +37,7 @@ BR2_LINUX_KERNEL_EXT_HISI_PATCHER_LIST="$(BR2_EXTERNAL_HISILICON_PATH)/board/hi3 # Filesystem # BR2_TARGET_TZ_INFO is not set +BR2_TARGET_ROOTFS_CPIO=y BR2_TARGET_ROOTFS_SQUASHFS=y BR2_TARGET_ROOTFS_SQUASHFS4_XZ=y BR2_ROOTFS_OVERLAY="$(TOPDIR)/../general/overlay" diff --git a/br-ext-chip-hisilicon/configs/unknown_unknown_hi3516ev300_openipc_defconfig b/br-ext-chip-hisilicon/configs/unknown_unknown_hi3516ev300_openipc_defconfig index e77ab3ae..2b2b613d 100644 --- a/br-ext-chip-hisilicon/configs/unknown_unknown_hi3516ev300_openipc_defconfig +++ b/br-ext-chip-hisilicon/configs/unknown_unknown_hi3516ev300_openipc_defconfig @@ -34,6 +34,7 @@ BR2_LINUX_KERNEL_EXT_HISI_PATCHER_LIST="$(BR2_EXTERNAL_HISILICON_PATH)/board/hi3 # Filesystem # BR2_TARGET_TZ_INFO is not set +BR2_TARGET_ROOTFS_CPIO=y BR2_TARGET_ROOTFS_SQUASHFS=y BR2_TARGET_ROOTFS_SQUASHFS4_XZ=y BR2_ROOTFS_OVERLAY="$(TOPDIR)/../general/overlay" diff --git a/br-ext-chip-hisilicon/configs/unknown_unknown_hi3516ev300_tehshield_defconfig b/br-ext-chip-hisilicon/configs/unknown_unknown_hi3516ev300_tehshield_defconfig index a97b40a0..27a26299 100644 --- a/br-ext-chip-hisilicon/configs/unknown_unknown_hi3516ev300_tehshield_defconfig +++ b/br-ext-chip-hisilicon/configs/unknown_unknown_hi3516ev300_tehshield_defconfig @@ -33,6 +33,7 @@ BR2_LINUX_KERNEL_EXT_HISI_PATCHER_LIST="$(BR2_EXTERNAL_HISILICON_PATH)/board/hi3 # Filesystem # BR2_TARGET_TZ_INFO is not set +BR2_TARGET_ROOTFS_CPIO=y BR2_TARGET_ROOTFS_SQUASHFS=y BR2_TARGET_ROOTFS_SQUASHFS4_XZ=y BR2_ROOTFS_OVERLAY="$(TOPDIR)/../general/overlay" 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 6d2cf589..9cf34982 100644 --- a/br-ext-chip-hisilicon/configs/unknown_unknown_hi3518ev300_openipc_defconfig +++ b/br-ext-chip-hisilicon/configs/unknown_unknown_hi3518ev300_openipc_defconfig @@ -33,6 +33,7 @@ BR2_LINUX_KERNEL_EXT_HISI_PATCHER_LIST="$(BR2_EXTERNAL_HISILICON_PATH)/board/hi3 # Filesystem # BR2_TARGET_TZ_INFO is not set +BR2_TARGET_ROOTFS_CPIO=y BR2_TARGET_ROOTFS_SQUASHFS=y BR2_TARGET_ROOTFS_SQUASHFS4_XZ=y BR2_ROOTFS_OVERLAY="$(TOPDIR)/../general/overlay" diff --git a/br-ext-chip-sigmastar/configs/unknown_unknown_ssc325_openipc_defconfig b/br-ext-chip-sigmastar/configs/unknown_unknown_ssc325_openipc_defconfig index c97fc77b..a5f2023b 100644 --- a/br-ext-chip-sigmastar/configs/unknown_unknown_ssc325_openipc_defconfig +++ b/br-ext-chip-sigmastar/configs/unknown_unknown_ssc325_openipc_defconfig @@ -34,6 +34,7 @@ BR2_LINUX_KERNEL_EXT_SIGMASTAR_PATCHER_LIST="$(BR2_EXTERNAL_SIGMASTAR_PATH)/boar # Filesystem # BR2_TARGET_TZ_INFO is not set +BR2_TARGET_ROOTFS_CPIO=y BR2_TARGET_ROOTFS_SQUASHFS=y BR2_TARGET_ROOTFS_SQUASHFS4_XZ=y BR2_ROOTFS_OVERLAY="$(TOPDIR)/../general/overlay" diff --git a/br-ext-chip-sigmastar/configs/unknown_unknown_ssc333_openipc_defconfig b/br-ext-chip-sigmastar/configs/unknown_unknown_ssc333_openipc_defconfig index e5763f83..06f1f0d3 100644 --- a/br-ext-chip-sigmastar/configs/unknown_unknown_ssc333_openipc_defconfig +++ b/br-ext-chip-sigmastar/configs/unknown_unknown_ssc333_openipc_defconfig @@ -34,6 +34,7 @@ BR2_LINUX_KERNEL_EXT_SIGMASTAR_PATCHER_LIST="$(BR2_EXTERNAL_SIGMASTAR_PATH)/boar # Filesystem # BR2_TARGET_TZ_INFO is not set +BR2_TARGET_ROOTFS_CPIO=y BR2_TARGET_ROOTFS_SQUASHFS=y BR2_TARGET_ROOTFS_SQUASHFS4_XZ=y BR2_ROOTFS_OVERLAY="$(TOPDIR)/../general/overlay" diff --git a/br-ext-chip-sigmastar/configs/unknown_unknown_ssc335_blackbird_defconfig b/br-ext-chip-sigmastar/configs/unknown_unknown_ssc335_blackbird_defconfig index d68d6ac8..d93d4322 100644 --- a/br-ext-chip-sigmastar/configs/unknown_unknown_ssc335_blackbird_defconfig +++ b/br-ext-chip-sigmastar/configs/unknown_unknown_ssc335_blackbird_defconfig @@ -35,6 +35,7 @@ BR2_LINUX_KERNEL_EXT_SIGMASTAR_PATCHER_LIST="$(BR2_EXTERNAL_SIGMASTAR_PATH)/boar # Filesystem # BR2_TARGET_TZ_INFO is not set +BR2_TARGET_ROOTFS_CPIO=y BR2_TARGET_ROOTFS_SQUASHFS=y BR2_TARGET_ROOTFS_SQUASHFS4_XZ=y BR2_ROOTFS_OVERLAY="$(TOPDIR)/../general/overlay" diff --git a/br-ext-chip-sigmastar/configs/unknown_unknown_ssc335_dev_defconfig b/br-ext-chip-sigmastar/configs/unknown_unknown_ssc335_dev_defconfig index bc893c09..775622e4 100644 --- a/br-ext-chip-sigmastar/configs/unknown_unknown_ssc335_dev_defconfig +++ b/br-ext-chip-sigmastar/configs/unknown_unknown_ssc335_dev_defconfig @@ -43,6 +43,7 @@ BR2_LINUX_KERNEL_EXT_SIGMASTAR_PATCHER_LIST="$(BR2_EXTERNAL_SIGMASTAR_PATH)/boar # Filesystem # BR2_TARGET_TZ_INFO is not set +BR2_TARGET_ROOTFS_CPIO=y BR2_TARGET_ROOTFS_SQUASHFS=y BR2_TARGET_ROOTFS_SQUASHFS4_XZ=y BR2_ROOTFS_OVERLAY="$(TOPDIR)/../general/overlay" diff --git a/br-ext-chip-sigmastar/configs/unknown_unknown_ssc335_goodcam_defconfig b/br-ext-chip-sigmastar/configs/unknown_unknown_ssc335_goodcam_defconfig index b51445f4..d97c7fbd 100644 --- a/br-ext-chip-sigmastar/configs/unknown_unknown_ssc335_goodcam_defconfig +++ b/br-ext-chip-sigmastar/configs/unknown_unknown_ssc335_goodcam_defconfig @@ -34,6 +34,7 @@ BR2_LINUX_KERNEL_EXT_SIGMASTAR_PATCHER_LIST="$(BR2_EXTERNAL_SIGMASTAR_PATH)/boar # Filesystem # BR2_TARGET_TZ_INFO is not set +BR2_TARGET_ROOTFS_CPIO=y BR2_TARGET_ROOTFS_SQUASHFS=y BR2_TARGET_ROOTFS_SQUASHFS4_XZ=y BR2_ROOTFS_OVERLAY="$(TOPDIR)/../general/overlay" diff --git a/br-ext-chip-sigmastar/configs/unknown_unknown_ssc335_initramfs_defconfig b/br-ext-chip-sigmastar/configs/unknown_unknown_ssc335_initramfs_defconfig index adaa8c44..8918ba0b 100644 --- a/br-ext-chip-sigmastar/configs/unknown_unknown_ssc335_initramfs_defconfig +++ b/br-ext-chip-sigmastar/configs/unknown_unknown_ssc335_initramfs_defconfig @@ -28,6 +28,7 @@ BR2_LINUX_KERNEL_EXT_SIGMASTAR_PATCHER=y BR2_LINUX_KERNEL_EXT_SIGMASTAR_PATCHER_LIST="$(BR2_EXTERNAL_SIGMASTAR_PATH)/board/infinity6b0/kernel/patches/ $(BR2_EXTERNAL_SIGMASTAR_PATH)/board/infinity6b0/kernel/overlay" # Filesystem +BR2_TARGET_ROOTFS_CPIO=y BR2_TARGET_ROOTFS_INITRAMFS=y BR2_ROOTFS_OVERLAY="$(TOPDIR)/../general/overlay" BR2_ROOTFS_POST_BUILD_SCRIPT="$(TOPDIR)/../scripts/executing_commands_for_$(BR2_TOOLCHAIN_BUILDROOT_LIBC).sh" diff --git a/br-ext-chip-sigmastar/configs/unknown_unknown_ssc335_musl_defconfig b/br-ext-chip-sigmastar/configs/unknown_unknown_ssc335_musl_defconfig index e4fa374e..fd2a4f17 100644 --- a/br-ext-chip-sigmastar/configs/unknown_unknown_ssc335_musl_defconfig +++ b/br-ext-chip-sigmastar/configs/unknown_unknown_ssc335_musl_defconfig @@ -34,6 +34,7 @@ BR2_LINUX_KERNEL_EXT_SIGMASTAR_PATCHER_LIST="$(BR2_EXTERNAL_SIGMASTAR_PATH)/boar # Filesystem # BR2_TARGET_TZ_INFO is not set +BR2_TARGET_ROOTFS_CPIO=y BR2_TARGET_ROOTFS_SQUASHFS=y BR2_TARGET_ROOTFS_SQUASHFS4_XZ=y BR2_ROOTFS_OVERLAY="$(TOPDIR)/../general/overlay" diff --git a/br-ext-chip-sigmastar/configs/unknown_unknown_ssc335_openipc_defconfig b/br-ext-chip-sigmastar/configs/unknown_unknown_ssc335_openipc_defconfig index c1d628bf..1c309775 100644 --- a/br-ext-chip-sigmastar/configs/unknown_unknown_ssc335_openipc_defconfig +++ b/br-ext-chip-sigmastar/configs/unknown_unknown_ssc335_openipc_defconfig @@ -34,6 +34,7 @@ BR2_LINUX_KERNEL_EXT_SIGMASTAR_PATCHER_LIST="$(BR2_EXTERNAL_SIGMASTAR_PATH)/boar # Filesystem # BR2_TARGET_TZ_INFO is not set +BR2_TARGET_ROOTFS_CPIO=y BR2_TARGET_ROOTFS_SQUASHFS=y BR2_TARGET_ROOTFS_SQUASHFS4_XZ=y BR2_ROOTFS_OVERLAY="$(TOPDIR)/../general/overlay" diff --git a/br-ext-chip-sigmastar/configs/unknown_unknown_ssc335_portal_defconfig b/br-ext-chip-sigmastar/configs/unknown_unknown_ssc335_portal_defconfig index 365bc0c7..5f407f01 100644 --- a/br-ext-chip-sigmastar/configs/unknown_unknown_ssc335_portal_defconfig +++ b/br-ext-chip-sigmastar/configs/unknown_unknown_ssc335_portal_defconfig @@ -34,6 +34,7 @@ BR2_LINUX_KERNEL_EXT_SIGMASTAR_PATCHER_LIST="$(BR2_EXTERNAL_SIGMASTAR_PATH)/boar # Filesystem # BR2_TARGET_TZ_INFO is not set +BR2_TARGET_ROOTFS_CPIO=y BR2_TARGET_ROOTFS_SQUASHFS=y BR2_TARGET_ROOTFS_SQUASHFS4_XZ=y BR2_ROOTFS_OVERLAY="$(TOPDIR)/../general/overlay" diff --git a/br-ext-chip-sigmastar/configs/unknown_unknown_ssc335_rotek_defconfig b/br-ext-chip-sigmastar/configs/unknown_unknown_ssc335_rotek_defconfig index d49f198b..5a3697d3 100644 --- a/br-ext-chip-sigmastar/configs/unknown_unknown_ssc335_rotek_defconfig +++ b/br-ext-chip-sigmastar/configs/unknown_unknown_ssc335_rotek_defconfig @@ -34,6 +34,7 @@ BR2_LINUX_KERNEL_EXT_SIGMASTAR_PATCHER_LIST="$(BR2_EXTERNAL_SIGMASTAR_PATH)/boar # Filesystem # BR2_TARGET_TZ_INFO is not set +BR2_TARGET_ROOTFS_CPIO=y BR2_TARGET_ROOTFS_SQUASHFS=y BR2_TARGET_ROOTFS_SQUASHFS4_XZ=y BR2_ROOTFS_OVERLAY="$(TOPDIR)/../general/overlay" diff --git a/br-ext-chip-sigmastar/configs/unknown_unknown_ssc335de_openipc_defconfig b/br-ext-chip-sigmastar/configs/unknown_unknown_ssc335de_openipc_defconfig index c8f39c5f..69a807bb 100644 --- a/br-ext-chip-sigmastar/configs/unknown_unknown_ssc335de_openipc_defconfig +++ b/br-ext-chip-sigmastar/configs/unknown_unknown_ssc335de_openipc_defconfig @@ -34,6 +34,7 @@ BR2_LINUX_KERNEL_EXT_SIGMASTAR_PATCHER_LIST="$(BR2_EXTERNAL_SIGMASTAR_PATH)/boar # Filesystem # BR2_TARGET_TZ_INFO is not set +BR2_TARGET_ROOTFS_CPIO=y BR2_TARGET_ROOTFS_SQUASHFS=y BR2_TARGET_ROOTFS_SQUASHFS4_XZ=y BR2_ROOTFS_OVERLAY="$(TOPDIR)/../general/overlay" diff --git a/br-ext-chip-sigmastar/configs/unknown_unknown_ssc337_kama_defconfig b/br-ext-chip-sigmastar/configs/unknown_unknown_ssc337_kama_defconfig index e4c2be2e..5e78b04a 100644 --- a/br-ext-chip-sigmastar/configs/unknown_unknown_ssc337_kama_defconfig +++ b/br-ext-chip-sigmastar/configs/unknown_unknown_ssc337_kama_defconfig @@ -34,6 +34,7 @@ BR2_LINUX_KERNEL_EXT_SIGMASTAR_PATCHER_LIST="$(BR2_EXTERNAL_SIGMASTAR_PATH)/boar # Filesystem # BR2_TARGET_TZ_INFO is not set +BR2_TARGET_ROOTFS_CPIO=y BR2_TARGET_ROOTFS_SQUASHFS=y BR2_TARGET_ROOTFS_SQUASHFS4_XZ=y BR2_ROOTFS_OVERLAY="$(TOPDIR)/../general/overlay" diff --git a/br-ext-chip-sigmastar/configs/unknown_unknown_ssc337_openipc_defconfig b/br-ext-chip-sigmastar/configs/unknown_unknown_ssc337_openipc_defconfig index 5fb7d4d0..7848bcd6 100644 --- a/br-ext-chip-sigmastar/configs/unknown_unknown_ssc337_openipc_defconfig +++ b/br-ext-chip-sigmastar/configs/unknown_unknown_ssc337_openipc_defconfig @@ -34,6 +34,7 @@ BR2_LINUX_KERNEL_EXT_SIGMASTAR_PATCHER_LIST="$(BR2_EXTERNAL_SIGMASTAR_PATH)/boar # Filesystem # BR2_TARGET_TZ_INFO is not set +BR2_TARGET_ROOTFS_CPIO=y BR2_TARGET_ROOTFS_SQUASHFS=y BR2_TARGET_ROOTFS_SQUASHFS4_XZ=y BR2_ROOTFS_OVERLAY="$(TOPDIR)/../general/overlay" diff --git a/br-ext-chip-sigmastar/configs/unknown_unknown_ssc337de_openipc_defconfig b/br-ext-chip-sigmastar/configs/unknown_unknown_ssc337de_openipc_defconfig index c9853077..0c4dcc37 100644 --- a/br-ext-chip-sigmastar/configs/unknown_unknown_ssc337de_openipc_defconfig +++ b/br-ext-chip-sigmastar/configs/unknown_unknown_ssc337de_openipc_defconfig @@ -34,6 +34,7 @@ BR2_LINUX_KERNEL_EXT_SIGMASTAR_PATCHER_LIST="$(BR2_EXTERNAL_SIGMASTAR_PATH)/boar # Filesystem # BR2_TARGET_TZ_INFO is not set +BR2_TARGET_ROOTFS_CPIO=y BR2_TARGET_ROOTFS_SQUASHFS=y BR2_TARGET_ROOTFS_SQUASHFS4_XZ=y BR2_ROOTFS_OVERLAY="$(TOPDIR)/../general/overlay" diff --git a/br-ext-chip-xiongmai/configs/unknown_unknown_xm510_openipc_defconfig b/br-ext-chip-xiongmai/configs/unknown_unknown_xm510_openipc_defconfig index 0a8f485f..b33afed6 100644 --- a/br-ext-chip-xiongmai/configs/unknown_unknown_xm510_openipc_defconfig +++ b/br-ext-chip-xiongmai/configs/unknown_unknown_xm510_openipc_defconfig @@ -32,6 +32,7 @@ BR2_LINUX_KERNEL_EXT_XIONGMAI_PATCHER_LIST="$(BR2_EXTERNAL_XIONGMAI_PATH)/board/ # Filesystem # BR2_TARGET_TZ_INFO is not set +BR2_TARGET_ROOTFS_CPIO=y BR2_TARGET_ROOTFS_SQUASHFS=y BR2_TARGET_ROOTFS_SQUASHFS4_XZ=y BR2_ROOTFS_OVERLAY="$(TOPDIR)/../general/overlay" diff --git a/br-ext-chip-xiongmai/configs/unknown_unknown_xm530_openipc_defconfig b/br-ext-chip-xiongmai/configs/unknown_unknown_xm530_openipc_defconfig index 2a99db3f..aebb02c9 100644 --- a/br-ext-chip-xiongmai/configs/unknown_unknown_xm530_openipc_defconfig +++ b/br-ext-chip-xiongmai/configs/unknown_unknown_xm530_openipc_defconfig @@ -32,6 +32,7 @@ BR2_LINUX_KERNEL_EXT_XIONGMAI_PATCHER_LIST="$(BR2_EXTERNAL_XIONGMAI_PATH)/board/ # Filesystem # BR2_TARGET_TZ_INFO is not set +BR2_TARGET_ROOTFS_CPIO=y BR2_TARGET_ROOTFS_SQUASHFS=y BR2_TARGET_ROOTFS_SQUASHFS4_XZ=y BR2_ROOTFS_OVERLAY="$(TOPDIR)/../general/overlay" diff --git a/building.sh b/building.sh index 9c88a8be..78ca0aa5 100755 --- a/building.sh +++ b/building.sh @@ -20,6 +20,7 @@ rename() { # mv -v ./output/images/uImage ./output/images/uImage.${soc} mv -v ./output/images/rootfs.squashfs ./output/images/rootfs.squashfs.${soc} + mv -v ./output/images/rootfs.cpio ./output/images/rootfs.${soc}.cpio mv -v ./output/images/rootfs.tar ./output/images/rootfs.${soc}.tar date >>/tmp/openipc_buildtime.txt echo -e "\n\n$(cat /tmp/openipc_buildtime.txt)" diff --git a/general/overlay/usr/lib/libjson-c.so.2 b/general/overlay/usr/lib/libjson-c.so.2 new file mode 120000 index 00000000..8f4f4938 --- /dev/null +++ b/general/overlay/usr/lib/libjson-c.so.2 @@ -0,0 +1 @@ +libjson-c.so.5 \ No newline at end of file diff --git a/general/overlay/usr/sbin/firstboot b/general/overlay/usr/sbin/firstboot index 6de05c80..98adf829 100755 --- a/general/overlay/usr/sbin/firstboot +++ b/general/overlay/usr/sbin/firstboot @@ -1,8 +1,28 @@ #!/bin/sh # -# OpenIPC.org | v.20210811 +# OpenIPC.org | v.20210821 # -echo -e "\n\e[1;31mСlearing the overlayfs partition and rebooting without any questions...\e[0m\n" -# -flash_eraseall -j /dev/$(awk -F ':' '/rootfs_data/ {print $1}' /proc/mtd) && reboot +set -e + +overlay=$(awk -F ':' '/"rootfs_data"/ {print $1}' /proc/mtd) + + + +clearing_overlayfs() { + echo -e "\n\e[1;31mСlearing the overlayfs partition...\e[0m\n" + flash_eraseall -j /dev/${overlay} +} + +quick_reboot() { + echo -e "\n\e[1;31mRebooting without any questions...\e[0m\n" + reboot -f +} + + + +if [ "$1" = "-s" ]; then + clearing_overlayfs +else + clearing_overlayfs && quick_reboot +fi