@@ -22,7 +22,6 @@ board/bsh/imx8mn-bsh-smm-s2-pro/post-image.sh Shellcheck
board/bsh/imx8mn-bsh-smm-s2/flash.sh Shellcheck lib_shellscript.EmptyLastLine
board/bsh/imx8mn-bsh-smm-s2/post-build.sh Shellcheck
board/canaan/k210-soc/post-build.sh Shellcheck
-board/canaan/k210-soc/rootfs_overlay/sbin/init Shellcheck
board/chromebook/elm/sign.sh Shellcheck
board/chromebook/mksd.sh Shellcheck
board/chromebook/snow/sign.sh Shellcheck
deleted file mode 120000
@@ -1 +0,0 @@
-/sbin/init
\ No newline at end of file
deleted file mode 100755
@@ -1,41 +0,0 @@
-#!/bin/sh
-
-# This script replaces the default busybox init process to avoid having that
-# process staying alive and sleeping in the background, (uselessly) consuming
-# precious memory.
-
-# Mount procfs and sysfs
-/bin/mount -t proc proc /proc
-/bin/mount -t sysfs sysfs /sys
-
-# When the kernel is directly booted, devtmpfs is not automatically mounted.
-# Manually mount it if needed.
-devmnt=$(mount | grep -c devtmpfs)
-if [ ${devmnt} -eq 0 ]; then
- /bin/mount -t devtmpfs devtmpfs /dev
-fi
-
-# Use the /dev/console device node from devtmpfs if possible to not
-# confuse glibc's ttyname_r().
-# This may fail (E.G. booted with console=), and errors from exec will
-# terminate the shell, so use a subshell for the test
-if (exec 0</dev/console) 2>/dev/null; then
- exec 0</dev/console
- exec 1>/dev/console
- exec 2>/dev/console
-fi
-
-# Clear memory to reduce page fragmentation
-echo 3 > /proc/sys/vm/drop_caches
-
-# Print a fun logo :)
-echo " __ _"
-echo " / / (_) ____ _ _ __ __"
-echo " / / | || _ \\ | | | |\\ \\/ /"
-echo " / /___| || | | || |_| | > < "
-echo " /_____/|_||_| |_| \\____|/_/\\_\\"
-echo " 64-bits RISC-V Kendryte K210 NOMMU"
-echo ""
-
-# Finally, let's start an interactive shell
-exec /bin/sh
new file mode 100644
@@ -0,0 +1,7 @@
+echo " __ _"
+echo " / / (_) ____ _ _ __ __"
+echo " / / | || _ \\ | | | |\\ \\/ /"
+echo " / /___| || | | || |_| | > < "
+echo " /_____/|_||_| |_| \\____|/_/\\_\\"
+echo " 64-bits RISC-V Kendryte K210 NOMMU"
+echo ""
new file mode 100755
@@ -0,0 +1,10 @@
+#!/bin/sh
+BOARD_DIR="$(dirname "$0")"
+
+# Add the Linux logo
+INIT_PATH="${TARGET_DIR}/sbin/init"
+INIT_LOGO_TAG="# Print a fun logo"
+if grep -Eq "^${INIT_LOGO_TAG}" "${INIT_PATH}"; then
+ sed "/^${INIT_LOGO_TAG}/r ${BOARD_DIR}/tinit-logo.txt" -i "${INIT_PATH}"
+ sed "s/^${INIT_LOGO_TAG}/# Print Linux logo/g" -i "${INIT_PATH}"
+fi
@@ -32,6 +32,6 @@ BR2_PACKAGE_BUSYBOX_CONFIG_FRAGMENT_FILES="board/canaan/k210-soc/busybox-tiny.co
# BR2_PACKAGE_IFUPDOWN_SCRIPTS is not set
# Filesystem
-BR2_INIT_NONE=y
+BR2_INIT_TINIT=y
BR2_TARGET_ROOTFS_INITRAMFS=y
-BR2_ROOTFS_OVERLAY="board/canaan/k210-soc/rootfs_overlay"
+BR2_ROOTFS_POST_BUILD_SCRIPT="board/canaan/k210-soc/tinit-setup.sh"
@@ -32,6 +32,6 @@ BR2_PACKAGE_BUSYBOX_CONFIG_FRAGMENT_FILES="board/canaan/k210-soc/busybox-tiny.co
# BR2_PACKAGE_IFUPDOWN_SCRIPTS is not set
# Filesystem
-BR2_INIT_NONE=y
+BR2_INIT_TINIT=y
BR2_TARGET_ROOTFS_INITRAMFS=y
-BR2_ROOTFS_OVERLAY="board/canaan/k210-soc/rootfs_overlay"
+BR2_ROOTFS_POST_BUILD_SCRIPT="board/canaan/k210-soc/tinit-setup.sh"
\ No newline at end of file
@@ -33,11 +33,10 @@ BR2_LINUX_KERNEL_INTREE_DTS_NAME="canaan/sipeed_maix_bit"
# BR2_PACKAGE_IFUPDOWN_SCRIPTS is not set
# Filesystem
-BR2_INIT_NONE=y
+BR2_INIT_TINIT=y
BR2_TARGET_ROOTFS_EXT2=y
BR2_TARGET_ROOTFS_EXT2_SIZE="64M"
-BR2_ROOTFS_OVERLAY="board/canaan/k210-soc/rootfs_overlay"
-BR2_ROOTFS_POST_BUILD_SCRIPT="board/canaan/k210-soc/post-build.sh"
+BR2_ROOTFS_POST_BUILD_SCRIPT="board/canaan/k210-soc/post-build.sh board/canaan/k210-soc/tinit-setup.sh"
BR2_ROOTFS_POST_IMAGE_SCRIPT="support/scripts/genimage.sh"
BR2_ROOTFS_POST_SCRIPT_ARGS="-c board/canaan/k210-soc/genimage.cfg"
@@ -32,6 +32,6 @@ BR2_PACKAGE_BUSYBOX_CONFIG_FRAGMENT_FILES="board/canaan/k210-soc/busybox-tiny.co
# BR2_PACKAGE_IFUPDOWN_SCRIPTS is not set
# Filesystem
-BR2_INIT_NONE=y
+BR2_INIT_TINIT=y
BR2_TARGET_ROOTFS_INITRAMFS=y
-BR2_ROOTFS_OVERLAY="board/canaan/k210-soc/rootfs_overlay"
+BR2_ROOTFS_POST_BUILD_SCRIPT="board/canaan/k210-soc/tinit-setup.sh"
@@ -33,11 +33,10 @@ BR2_LINUX_KERNEL_INTREE_DTS_NAME="canaan/sipeed_maix_dock"
# BR2_PACKAGE_IFUPDOWN_SCRIPTS is not set
# Filesystem
-BR2_INIT_NONE=y
+BR2_INIT_TINIT=y
BR2_TARGET_ROOTFS_EXT2=y
BR2_TARGET_ROOTFS_EXT2_SIZE="64M"
-BR2_ROOTFS_OVERLAY="board/canaan/k210-soc/rootfs_overlay"
-BR2_ROOTFS_POST_BUILD_SCRIPT="board/canaan/k210-soc/post-build.sh"
+BR2_ROOTFS_POST_BUILD_SCRIPT="board/canaan/k210-soc/post-build.sh board/canaan/k210-soc/tinit-setup.sh"
BR2_ROOTFS_POST_IMAGE_SCRIPT="support/scripts/genimage.sh"
BR2_ROOTFS_POST_SCRIPT_ARGS="-c board/canaan/k210-soc/genimage.cfg"
@@ -32,6 +32,6 @@ BR2_PACKAGE_BUSYBOX_CONFIG_FRAGMENT_FILES="board/canaan/k210-soc/busybox-tiny.co
# BR2_PACKAGE_IFUPDOWN_SCRIPTS is not set
# Filesystem
-BR2_INIT_NONE=y
+BR2_INIT_TINIT=y
BR2_TARGET_ROOTFS_INITRAMFS=y
-BR2_ROOTFS_OVERLAY="board/canaan/k210-soc/rootfs_overlay"
+BR2_ROOTFS_POST_BUILD_SCRIPT="board/canaan/k210-soc/tinit-setup.sh"
@@ -33,11 +33,11 @@ BR2_LINUX_KERNEL_INTREE_DTS_NAME="canaan/sipeed_maix_go"
# BR2_PACKAGE_IFUPDOWN_SCRIPTS is not set
# Filesystem
-BR2_INIT_NONE=y
+BR2_INIT_TINIT=y
BR2_TARGET_ROOTFS_EXT2=y
BR2_TARGET_ROOTFS_EXT2_SIZE="64M"
BR2_ROOTFS_OVERLAY="board/canaan/k210-soc/rootfs_overlay"
-BR2_ROOTFS_POST_BUILD_SCRIPT="board/canaan/k210-soc/post-build.sh"
+BR2_ROOTFS_POST_BUILD_SCRIPT="board/canaan/k210-soc/post-build.sh board/canaan/k210-soc/tinit-setup.sh"
BR2_ROOTFS_POST_IMAGE_SCRIPT="support/scripts/genimage.sh"
BR2_ROOTFS_POST_SCRIPT_ARGS="-c board/canaan/k210-soc/genimage.cfg"
@@ -32,6 +32,6 @@ BR2_PACKAGE_BUSYBOX_CONFIG_FRAGMENT_FILES="board/canaan/k210-soc/busybox-tiny.co
# BR2_PACKAGE_IFUPDOWN_SCRIPTS is not set
# Filesystem
-BR2_INIT_NONE=y
+BR2_INIT_TINIT=y
BR2_TARGET_ROOTFS_INITRAMFS=y
-BR2_ROOTFS_OVERLAY="board/canaan/k210-soc/rootfs_overlay"
+BR2_ROOTFS_POST_BUILD_SCRIPT="board/canaan/k210-soc/tinit-setup.sh"
@@ -33,11 +33,10 @@ BR2_LINUX_KERNEL_INTREE_DTS_NAME="canaan/sipeed_maixduino"
# BR2_PACKAGE_IFUPDOWN_SCRIPTS is not set
# Filesystem
-BR2_INIT_NONE=y
+BR2_INIT_TINIT=y
BR2_TARGET_ROOTFS_EXT2=y
BR2_TARGET_ROOTFS_EXT2_SIZE="64M"
-BR2_ROOTFS_OVERLAY="board/canaan/k210-soc/rootfs_overlay"
-BR2_ROOTFS_POST_BUILD_SCRIPT="board/canaan/k210-soc/post-build.sh"
+BR2_ROOTFS_POST_BUILD_SCRIPT="board/canaan/k210-soc/post-build.sh board/canaan/k210-soc/tinit-setup.sh"
BR2_ROOTFS_POST_IMAGE_SCRIPT="support/scripts/genimage.sh"
BR2_ROOTFS_POST_SCRIPT_ARGS="-c board/canaan/k210-soc/genimage.cfg"
The initialization script provided by the tinit package is the same as the one contained in board/canaan/k210-soc/rootfs_overlay/sbin/init except for the Linux logo, which has been removed. The patch reworks the configurations that use this overlay directory by replacing the initialization process contained within it with the one provided by the tinit package and adding to it the textual logo displayed by the old init script. Signed-off-by: Dario Binacchi <dario.binacchi@amarulasolutions.com> --- .checkpackageignore | 1 - board/canaan/k210-soc/rootfs_overlay/init | 1 - .../canaan/k210-soc/rootfs_overlay/sbin/init | 41 ------------------- board/canaan/k210-soc/tinit-logo.txt | 7 ++++ board/canaan/k210-soc/tinit-setup.sh | 10 +++++ configs/canaan_kd233_defconfig | 4 +- configs/sipeed_maix_bit_defconfig | 4 +- configs/sipeed_maix_bit_sdcard_defconfig | 5 +-- configs/sipeed_maix_dock_defconfig | 4 +- configs/sipeed_maix_dock_sdcard_defconfig | 5 +-- configs/sipeed_maix_go_defconfig | 4 +- configs/sipeed_maix_go_sdcard_defconfig | 4 +- configs/sipeed_maixduino_defconfig | 4 +- configs/sipeed_maixduino_sdcard_defconfig | 5 +-- 14 files changed, 35 insertions(+), 64 deletions(-) delete mode 120000 board/canaan/k210-soc/rootfs_overlay/init delete mode 100755 board/canaan/k210-soc/rootfs_overlay/sbin/init create mode 100644 board/canaan/k210-soc/tinit-logo.txt create mode 100755 board/canaan/k210-soc/tinit-setup.sh