* [Buildroot] [PATCH 0/3] tinit and stm32f746_disco_sd_defconfig
@ 2024-08-03 15:55 Dario Binacchi
2024-08-03 15:55 ` [Buildroot] [PATCH 1/3] package/tinit: new package Dario Binacchi
` (4 more replies)
0 siblings, 5 replies; 11+ messages in thread
From: Dario Binacchi @ 2024-08-03 15:55 UTC (permalink / raw)
To: buildroot; +Cc: linux-amarula, Damien Le Moal, Dario Binacchi, Thomas Petazzoni
This series is inspired by reading the following topic:
https://lore.kernel.org/buildroot/20230206230203.70e2dbd8@windsurf/T
Starting from that patch, and following Thomas Petazzoni's suggestions
regarding the possibility of using a single minimal script without
duplicating it within Buildroot, I developed these three patches.
Meanwhile, the configuration for the stm32f746_disco board was useful
for developing the display support for the board, which was later
merged into Linux.
Dario Binacchi (3):
package/tinit: new package
configs/stm32f746_disco_sd_defconfig: new defconfig
board/canaan/k210-soc: use tinit as Linux init process
.checkpackageignore | 1 -
DEVELOPERS | 3 +
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 +
.../stm32f746-disco/busybox-tiny.config | 230 ++++++++++++++++++
.../stm32f746-disco/extlinux.conf | 4 +
.../stm32f746-disco/flash_sd.sh | 22 ++
.../stm32f746-disco/genimage.cfg | 27 ++
.../stm32f746-disco/linux.fragment | 13 +
.../patches/linux-headers/linux-headers.hash | 1 +
.../stm32f746-disco/patches/linux/linux.hash | 2 +
.../stm32f746-disco/patches/uboot/uboot.hash | 2 +
.../stm32f746-disco/post-build.sh | 15 ++
.../stm32f746-disco/readme.txt | 31 +++
.../stm32f746-disco/tinit-logo.txt | 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 +-
configs/stm32f746_disco_sd_defconfig | 32 +++
package/Config.in | 1 +
package/tinit/Config.in | 9 +
package/tinit/tinit.hash | 3 +
package/tinit/tinit.mk | 17 ++
system/Config.in | 5 +
32 files changed, 462 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
create mode 100644 board/stmicroelectronics/stm32f746-disco/busybox-tiny.config
create mode 100644 board/stmicroelectronics/stm32f746-disco/extlinux.conf
create mode 100755 board/stmicroelectronics/stm32f746-disco/flash_sd.sh
create mode 100644 board/stmicroelectronics/stm32f746-disco/genimage.cfg
create mode 100644 board/stmicroelectronics/stm32f746-disco/linux.fragment
create mode 120000 board/stmicroelectronics/stm32f746-disco/patches/linux-headers/linux-headers.hash
create mode 100644 board/stmicroelectronics/stm32f746-disco/patches/linux/linux.hash
create mode 100644 board/stmicroelectronics/stm32f746-disco/patches/uboot/uboot.hash
create mode 100755 board/stmicroelectronics/stm32f746-disco/post-build.sh
create mode 100644 board/stmicroelectronics/stm32f746-disco/readme.txt
create mode 100644 board/stmicroelectronics/stm32f746-disco/tinit-logo.txt
create mode 100644 configs/stm32f746_disco_sd_defconfig
create mode 100644 package/tinit/Config.in
create mode 100644 package/tinit/tinit.hash
create mode 100644 package/tinit/tinit.mk
--
2.43.0
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
^ permalink raw reply [flat|nested] 11+ messages in thread
* [Buildroot] [PATCH 1/3] package/tinit: new package
2024-08-03 15:55 [Buildroot] [PATCH 0/3] tinit and stm32f746_disco_sd_defconfig Dario Binacchi
@ 2024-08-03 15:55 ` Dario Binacchi
2024-08-03 15:55 ` [Buildroot] [PATCH 2/3] configs/stm32f746_disco_sd_defconfig: new defconfig Dario Binacchi
` (3 subsequent siblings)
4 siblings, 0 replies; 11+ messages in thread
From: Dario Binacchi @ 2024-08-03 15:55 UTC (permalink / raw)
To: buildroot; +Cc: linux-amarula, Damien Le Moal, Dario Binacchi, Thomas Petazzoni
This package contains a Linux init script suitable for resource-limited
systems which can be used as an alternative to the one provided by
Busybox.
Signed-off-by: Dario Binacchi <dario.binacchi@amarulasolutions.com>
---
DEVELOPERS | 1 +
package/Config.in | 1 +
package/tinit/Config.in | 9 +++++++++
package/tinit/tinit.hash | 3 +++
package/tinit/tinit.mk | 17 +++++++++++++++++
system/Config.in | 5 +++++
6 files changed, 36 insertions(+)
create mode 100644 package/tinit/Config.in
create mode 100644 package/tinit/tinit.hash
create mode 100644 package/tinit/tinit.mk
diff --git a/DEVELOPERS b/DEVELOPERS
index 68729f721b6f..5fef1fd3da2f 100644
--- a/DEVELOPERS
+++ b/DEVELOPERS
@@ -797,6 +797,7 @@ F: configs/imx8mn_bsh_smm_s2_defconfig
F: configs/imx8mn_bsh_smm_s2_pro_defconfig
F: configs/stm32f769_disco_sd_defconfig
F: package/sscep/
+F: package/tinit/
F: package/uuu/
N: Dario Binacchi <dariobin@libero.it>
diff --git a/package/Config.in b/package/Config.in
index e21987717f16..818d96e3b1b5 100644
--- a/package/Config.in
+++ b/package/Config.in
@@ -2866,6 +2866,7 @@ menu "System tools"
source "package/tar/Config.in"
source "package/tealdeer/Config.in"
source "package/thermald/Config.in"
+ source "package/tinit/Config.in"
source "package/tpm-tools/Config.in"
source "package/tpm2-abrmd/Config.in"
source "package/tpm2-tools/Config.in"
diff --git a/package/tinit/Config.in b/package/tinit/Config.in
new file mode 100644
index 000000000000..e711b37e89f0
--- /dev/null
+++ b/package/tinit/Config.in
@@ -0,0 +1,9 @@
+config BR2_PACKAGE_TINIT
+ bool "tinit"
+ depends on BR2_INIT_TINIT
+ help
+ A Linux tiny initialization script suitable for resource
+ limited systems, which can be used as an alternative to the
+ one provided by Busybox.
+
+ https://github.com/passgat/tinit
diff --git a/package/tinit/tinit.hash b/package/tinit/tinit.hash
new file mode 100644
index 000000000000..e8c6d1386277
--- /dev/null
+++ b/package/tinit/tinit.hash
@@ -0,0 +1,3 @@
+# Locally calculated
+sha256 27cc4dbbd88df00dd98b64cbadf3d1de6062d8a4ea7bc405c445e560c6dd23c1 tinit-0.1.0.tar.gz
+sha256 8177f97513213526df2cf6184d8ff986c675afb514d4e68a404010521b880643 LICENSE
diff --git a/package/tinit/tinit.mk b/package/tinit/tinit.mk
new file mode 100644
index 000000000000..5fa9ad8d2329
--- /dev/null
+++ b/package/tinit/tinit.mk
@@ -0,0 +1,17 @@
+################################################################################
+#
+# tinit
+#
+################################################################################
+
+TINIT_VERSION = 0.1.0
+TINIT_SITE = $(call github,passgat,tinit,v$(TINIT_VERSION))
+TINIT_LICENSE = GPL-2.0
+TINIT_LICENSE_FILES = LICENSE
+
+define TINIT_INSTALL_TARGET_CMDS
+ $(INSTALL) -m 0755 -D $(@D)/init $(TARGET_DIR)/sbin/init
+ (cd $(TARGET_DIR); ln -sf /sbin/init init)
+endef
+
+$(eval $(generic-package))
diff --git a/system/Config.in b/system/Config.in
index bc0c6eb6bc82..a4543b104769 100644
--- a/system/Config.in
+++ b/system/Config.in
@@ -145,6 +145,11 @@ comment "systemd highly recommends Linux >= 4.15"
depends on BR2_INIT_SYSTEMD
depends on !BR2_TOOLCHAIN_HEADERS_AT_LEAST_4_15
+config BR2_INIT_TINIT
+ bool "tiny init"
+ select BR2_PACKAGE_TINIT
+ select BR2_PACKAGE_SKELETON_INIT_NONE if BR2_ROOTFS_SKELETON_DEFAULT
+
config BR2_INIT_NONE
bool "None"
select BR2_PACKAGE_SKELETON_INIT_NONE if BR2_ROOTFS_SKELETON_DEFAULT
--
2.43.0
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
^ permalink raw reply related [flat|nested] 11+ messages in thread
* [Buildroot] [PATCH 2/3] configs/stm32f746_disco_sd_defconfig: new defconfig
2024-08-03 15:55 [Buildroot] [PATCH 0/3] tinit and stm32f746_disco_sd_defconfig Dario Binacchi
2024-08-03 15:55 ` [Buildroot] [PATCH 1/3] package/tinit: new package Dario Binacchi
@ 2024-08-03 15:55 ` Dario Binacchi
2024-08-03 15:55 ` [Buildroot] [PATCH 3/3] board/canaan/k210-soc: use tinit as Linux init process Dario Binacchi
` (2 subsequent siblings)
4 siblings, 0 replies; 11+ messages in thread
From: Dario Binacchi @ 2024-08-03 15:55 UTC (permalink / raw)
To: buildroot; +Cc: linux-amarula, Damien Le Moal, Dario Binacchi, Thomas Petazzoni
The commit adds support for STM32F746G-DISCO board. The discovery kit is
a complete demonstration and development platform for STMicroelectronics
Arm Cortex-M7-core-based STM32F746NG.
Board support package includes the following components:
- mainline Linux kernel 5.15.163
- mainline U-Boot 2024.07
- default packages from buildroot
Link: https://www.st.com/en/evaluation-tools/32f746gdiscovery.html
Co-Developed-by: Waldemar Brodkorb <wbx@openadk.org>
Signed-off-by: Dario Binacchi <dario.binacchi@amarulasolutions.com>
---
DEVELOPERS | 2 +
.../stm32f746-disco/busybox-tiny.config | 230 ++++++++++++++++++
.../stm32f746-disco/extlinux.conf | 4 +
.../stm32f746-disco/flash_sd.sh | 22 ++
.../stm32f746-disco/genimage.cfg | 27 ++
.../stm32f746-disco/linux.fragment | 13 +
| 1 +
.../stm32f746-disco/patches/linux/linux.hash | 2 +
.../stm32f746-disco/patches/uboot/uboot.hash | 2 +
.../stm32f746-disco/post-build.sh | 15 ++
.../stm32f746-disco/readme.txt | 31 +++
.../stm32f746-disco/tinit-logo.txt | 10 +
configs/stm32f746_disco_sd_defconfig | 32 +++
13 files changed, 391 insertions(+)
create mode 100644 board/stmicroelectronics/stm32f746-disco/busybox-tiny.config
create mode 100644 board/stmicroelectronics/stm32f746-disco/extlinux.conf
create mode 100755 board/stmicroelectronics/stm32f746-disco/flash_sd.sh
create mode 100644 board/stmicroelectronics/stm32f746-disco/genimage.cfg
create mode 100644 board/stmicroelectronics/stm32f746-disco/linux.fragment
create mode 120000 board/stmicroelectronics/stm32f746-disco/patches/linux-headers/linux-headers.hash
create mode 100644 board/stmicroelectronics/stm32f746-disco/patches/linux/linux.hash
create mode 100644 board/stmicroelectronics/stm32f746-disco/patches/uboot/uboot.hash
create mode 100755 board/stmicroelectronics/stm32f746-disco/post-build.sh
create mode 100644 board/stmicroelectronics/stm32f746-disco/readme.txt
create mode 100644 board/stmicroelectronics/stm32f746-disco/tinit-logo.txt
create mode 100644 configs/stm32f746_disco_sd_defconfig
diff --git a/DEVELOPERS b/DEVELOPERS
index 5fef1fd3da2f..dcfa6afed6ee 100644
--- a/DEVELOPERS
+++ b/DEVELOPERS
@@ -791,10 +791,12 @@ F: package/xinetd/
N: Dario Binacchi <dario.binacchi@amarulasolutions.com>
F: board/bsh/
+F: board/stmicroelectronics/stm32f746-disco/
F: board/stmicroelectronics/stm32f769-disco/
F: configs/imx6ulz_bsh_smm_m2_defconfig
F: configs/imx8mn_bsh_smm_s2_defconfig
F: configs/imx8mn_bsh_smm_s2_pro_defconfig
+F: configs/stm32f746_disco_sd_defconfig
F: configs/stm32f769_disco_sd_defconfig
F: package/sscep/
F: package/tinit/
diff --git a/board/stmicroelectronics/stm32f746-disco/busybox-tiny.config b/board/stmicroelectronics/stm32f746-disco/busybox-tiny.config
new file mode 100644
index 000000000000..97c97270cb35
--- /dev/null
+++ b/board/stmicroelectronics/stm32f746-disco/busybox-tiny.config
@@ -0,0 +1,230 @@
+#
+# Additional config changes for busybox-minimal.config
+# to reduce the size of the busybox executable.
+#
+
+#
+# Settings
+#
+# CONFIG_INCLUDE_SUSv2 is not set
+# CONFIG_LONG_OPTS is not set
+# CONFIG_FEATURE_DEVPTS is not set
+# CONFIG_FEATURE_SYSLOG_INFO is not set
+# CONFIG_FEATURE_SYSLOG is not set
+
+#
+# Library Tuning
+#
+# CONFIG_FEATURE_RTMINMAX is not set
+# CONFIG_FEATURE_RTMINMAX_USE_LIBC_DEFINITIONS is not set
+# CONFIG_FEATURE_BUFFERS_USE_MALLOC is not set
+CONFIG_FEATURE_BUFFERS_GO_ON_STACK=y
+# CONFIG_FEATURE_EDITING_VI is not set
+# CONFIG_FEATURE_EDITING_SAVEHISTORY is not set
+# CONFIG_FEATURE_REVERSE_SEARCH is not set
+# CONFIG_FEATURE_EDITING_WINCH is not set
+# CONFIG_FEATURE_HWIB is not set
+
+#
+# Archival Utilities
+#
+# CONFIG_ZCAT is not set
+# CONFIG_BZCAT is not set
+# CONFIG_LZCAT is not set
+# CONFIG_XZCAT is not set
+# CONFIG_UNLZOP is not set
+# CONFIG_LZOPCAT is not set
+
+#
+# Coreutils
+#
+# CONFIG_CKSUM is not set
+# CONFIG_DOS2UNIX is not set
+# CONFIG_UNIX2DOS is not set
+# CONFIG_DU is not set
+# CONFIG_FACTOR is not set
+# CONFIG_FOLD is not set
+# CONFIG_HEAD is not set
+# CONFIG_INSTALL is not set
+# CONFIG_LINK is not set
+# CONFIG_LOGNAME is not set
+# CONFIG_MD5SUM is not set
+# CONFIG_SHA1SUM is not set
+# CONFIG_SHA256SUM is not set
+# CONFIG_SHA512SUM is not set
+# CONFIG_SHA3SUM is not set
+# CONFIG_MKFIFO is not set
+# CONFIG_NICE is not set
+# CONFIG_NL is not set
+# CONFIG_NOHUP is not set
+# CONFIG_OD is not set
+# CONFIG_PASTE is not set
+# CONFIG_SHRED is not set
+# CONFIG_SORT is not set
+# CONFIG_TAIL is not set
+# CONFIG_TEE is not set
+# CONFIG_TIMEOUT is not set
+# CONFIG_TR is not set
+# CONFIG_UNIQ is not set
+# CONFIG_UUDECODE is not set
+# CONFIG_BASE32 is not set
+# CONFIG_UUENCODE is not set
+# CONFIG_WC is not set
+# CONFIG_WHOAMI is not set
+# CONFIG_WHO is not set
+# CONFIG_W is not set
+# CONFIG_USERS is not set
+# CONFIG_YES is not set
+
+#
+# Common options
+#
+# CONFIG_FEATURE_VERBOSE is not set
+
+#
+# Debian Utilities
+#
+# CONFIG_RUN_PARTS is not set
+# CONFIG_FEATURE_RUN_PARTS_LONG_OPTIONS is not set
+# CONFIG_FEATURE_RUN_PARTS_FANCY is not set
+# CONFIG_START_STOP_DAEMON is not set
+# CONFIG_FEATURE_START_STOP_DAEMON_LONG_OPTIONS is not set
+# CONFIG_FEATURE_START_STOP_DAEMON_FANCY is not set
+# CONFIG_WHICH is not set
+
+#
+# klibc-utils
+#
+# CONFIG_NUKE is not set
+# CONFIG_RESUME is not set
+# CONFIG_RUN_INIT is not set
+
+#
+# Editors
+#
+# CONFIG_SED is not set
+CONFIG_VI=y
+CONFIG_FEATURE_VI_MAX_LEN=4096
+CONFIG_FEATURE_VI_COLON=y
+CONFIG_FEATURE_VI_YANKMARK=y
+CONFIG_FEATURE_VI_USE_SIGNALS=y
+CONFIG_FEATURE_VI_DOT_CMD=y
+CONFIG_FEATURE_VI_READONLY=y
+CONFIG_FEATURE_VI_SETOPTS=y
+CONFIG_FEATURE_VI_SET=y
+CONFIG_FEATURE_VI_WIN_RESIZE=y
+CONFIG_FEATURE_VI_ASK_TERMINAL=y
+CONFIG_FEATURE_VI_UNDO=y
+
+#
+# Finding Utilities
+#
+CONFIG_GREP=y
+# CONFIG_EGREP is not set
+# CONFIG_FGREP is not set
+# CONFIG_XARGS is not set
+
+#
+# Init Utilities
+#
+# CONFIG_HALT is not set
+# CONFIG_POWEROFF is not set
+# CONFIG_FEATURE_WAIT_FOR_INIT is not set
+# CONFIG_FEATURE_CALL_TELINIT is not set
+# CONFIG_INIT is not set
+# CONFIG_LINUXRC is not set
+
+#
+# Login/Password Management Utilities
+#
+# CONFIG_FEATURE_SHADOWPASSWDS is not set
+# CONFIG_USE_BB_CRYPT is not set
+# CONFIG_USE_BB_CRYPT_SHA is not set
+# CONFIG_ADDUSER is not set
+# CONFIG_GETTY is not set
+# CONFIG_LOGIN is not set
+# CONFIG_PASSWD is not set
+
+#
+# Linux System Utilities
+#
+# CONFIG_FALLOCATE is not set
+# CONFIG_FREERAMDISK is not set
+# CONFIG_FSFREEZE is not set
+# CONFIG_GETOPT is not set
+# CONFIG_XXD is not set
+# CONFIG_MESG is not set
+# CONFIG_MKE2FS is not set
+# CONFIG_MKDOSFS is not set
+# CONFIG_FEATURE_MOUNT_CIFS is not set
+# CONFIG_FEATURE_MOUNT_FSTAB is not set
+# CONFIG_FEATURE_MOUNT_OTHERTAB is not set
+# CONFIG_NOLOGIN is not set
+# CONFIG_LINUX32 is not set
+# CONFIG_LINUX64 is not set
+# CONFIG_SETPRIV is not set
+
+#
+# Common options for mount/umount
+#
+# CONFIG_FEATURE_MOUNT_LOOP is not set
+# CONFIG_FEATURE_MOUNT_LOOP_CREATE is not set
+
+#
+# Miscellaneous Utilities
+#
+# CONFIG_BC is not set
+# CONFIG_HEXEDIT is not set
+# CONFIG_I2CTRANSFER is not set
+# CONFIG_LSSCSI is not set
+# CONFIG_MIM is not set
+# CONFIG_PARTPROBE is not set
+# CONFIG_SETFATTR is not set
+# CONFIG_SETSERIAL is not set
+# CONFIG_TS is not set
+
+#
+# Networking Utilities
+#
+# CONFIG_HOSTNAME is not set
+# CONFIG_DNSDOMAINNAME is not set
+# CONFIG_IFCONFIG is not set
+# CONFIG_IFUP is not set
+# CONFIG_IFDOWN is not set
+# CONFIG_IP is not set
+# CONFIG_IPADDR is not set
+# CONFIG_IPLINK is not set
+# CONFIG_IPROUTE is not set
+# CONFIG_NC is not set
+# CONFIG_NETSTAT is not set
+# CONFIG_PING is not set
+# CONFIG_ROUTE is not set
+# CONFIG_TC is not set
+# CONFIG_TELNET is not set
+# CONFIG_WGET is not set
+# CONFIG_UDHCPC is not set
+
+#
+# Process Utilities
+#
+# CONFIG_KILLALL is not set
+# CONFIG_KILLALL5 is not set
+
+#
+# Runit Utilities
+#
+# CONFIG_SVC is not set
+# CONFIG_SVOK is not set
+
+#
+# Shells
+#
+CONFIG_BASH_IS_HUSH=y
+# CONFIG_BASH_IS_NONE is not set
+# CONFIG_HUSH_SAVEHISTORY is not set
+
+#
+# Options common to all shells
+#
+# CONFIG_FEATURE_SH_READ_FRAC is not set
+# CONFIG_FEATURE_SH_EMBEDDED_SCRIPTS is not set
diff --git a/board/stmicroelectronics/stm32f746-disco/extlinux.conf b/board/stmicroelectronics/stm32f746-disco/extlinux.conf
new file mode 100644
index 000000000000..bb79c0b412a2
--- /dev/null
+++ b/board/stmicroelectronics/stm32f746-disco/extlinux.conf
@@ -0,0 +1,4 @@
+label stm32f746-disco-buildroot
+ kernel /zImage
+ devicetree /stm32f746-disco.dtb
+ append console=ttySTM0,115200 root=/dev/mmcblk0p2 rw rootwait consoleblank=0 ignore_loglevel
diff --git a/board/stmicroelectronics/stm32f746-disco/flash_sd.sh b/board/stmicroelectronics/stm32f746-disco/flash_sd.sh
new file mode 100755
index 000000000000..4fe85448f984
--- /dev/null
+++ b/board/stmicroelectronics/stm32f746-disco/flash_sd.sh
@@ -0,0 +1,22 @@
+#!/bin/bash
+
+if [ $# -eq 0 ]; then
+ OUTPUT_DIR=output
+else
+ OUTPUT_DIR=$1
+fi
+
+if ! test -d "${OUTPUT_DIR}" ; then
+ echo "ERROR: no output directory specified."
+ echo "Usage: $0 OUTPUT_DIR"
+ exit 1
+fi
+
+"${OUTPUT_DIR}"/host/bin/openocd -f board/stm32f746g-disco.cfg \
+ -c "init" \
+ -c "reset init" \
+ -c "flash probe 0" \
+ -c "flash info 0" \
+ -c "flash write_image erase ${OUTPUT_DIR}/images/u-boot.bin 0x08000000" \
+ -c "reset run" \
+ -c "shutdown"
diff --git a/board/stmicroelectronics/stm32f746-disco/genimage.cfg b/board/stmicroelectronics/stm32f746-disco/genimage.cfg
new file mode 100644
index 000000000000..6743d41972c0
--- /dev/null
+++ b/board/stmicroelectronics/stm32f746-disco/genimage.cfg
@@ -0,0 +1,27 @@
+image boot.vfat {
+ vfat {
+ files = {
+ "zImage",
+ "stm32f746-disco.dtb",
+ "extlinux"
+ }
+ }
+
+ size = 16M
+}
+
+image sdcard.img {
+ hdimage {
+ }
+
+ partition u-boot {
+ partition-type = 0xC
+ image = "boot.vfat"
+ }
+
+ partition rootfs {
+ partition-type = 0x83
+ image = "rootfs.ext2"
+ size = 32M
+ }
+}
diff --git a/board/stmicroelectronics/stm32f746-disco/linux.fragment b/board/stmicroelectronics/stm32f746-disco/linux.fragment
new file mode 100644
index 000000000000..625fdced9e8d
--- /dev/null
+++ b/board/stmicroelectronics/stm32f746-disco/linux.fragment
@@ -0,0 +1,13 @@
+# CONFIG_PREEMPT is not set
+# CONFIG_MULTIUSER is not set
+# CONFIG_TIMERFD is not set
+CONFIG_SET_MEM_PARAM=y
+CONFIG_DRAM_BASE=0xC0000000
+CONFIG_DRAM_SIZE=0x01000000
+# CONFIG_GCC_PLUGINS is not set
+# CONFIG_XIP_KERNEL is not set
+# CONFIG_BLK_DEV is not set
+# CONFIG_COMPAT_BRK is not set
+# CONFIG_PROC_SYSCTL is not set
+# CONFIG_CRYPTO is not set
+CONFIG_RCU_TRACE=y
\ No newline at end of file
--git a/board/stmicroelectronics/stm32f746-disco/patches/linux-headers/linux-headers.hash b/board/stmicroelectronics/stm32f746-disco/patches/linux-headers/linux-headers.hash
new file mode 120000
index 000000000000..5808d92afe89
--- /dev/null
+++ b/board/stmicroelectronics/stm32f746-disco/patches/linux-headers/linux-headers.hash
@@ -0,0 +1 @@
+../linux/linux.hash
\ No newline at end of file
diff --git a/board/stmicroelectronics/stm32f746-disco/patches/linux/linux.hash b/board/stmicroelectronics/stm32f746-disco/patches/linux/linux.hash
new file mode 100644
index 000000000000..e5b92c57bd02
--- /dev/null
+++ b/board/stmicroelectronics/stm32f746-disco/patches/linux/linux.hash
@@ -0,0 +1,2 @@
+# Locally calculated
+sha256 025fc7d8b1560cf456ccae50591fe1ca21c990645df9791aed25820fe78db302 linux-5.15.163.tar.xz
diff --git a/board/stmicroelectronics/stm32f746-disco/patches/uboot/uboot.hash b/board/stmicroelectronics/stm32f746-disco/patches/uboot/uboot.hash
new file mode 100644
index 000000000000..fe9b4f53dc63
--- /dev/null
+++ b/board/stmicroelectronics/stm32f746-disco/patches/uboot/uboot.hash
@@ -0,0 +1,2 @@
+# Locally calculated
+sha256 f591da9ab90ef3d6b3d173766d0ddff90c4ed7330680897486117df390d83c8f u-boot-2024.07.tar.bz2
diff --git a/board/stmicroelectronics/stm32f746-disco/post-build.sh b/board/stmicroelectronics/stm32f746-disco/post-build.sh
new file mode 100755
index 000000000000..57f14f6ff5e3
--- /dev/null
+++ b/board/stmicroelectronics/stm32f746-disco/post-build.sh
@@ -0,0 +1,15 @@
+#!/bin/sh
+BOARD_DIR="$(dirname "$0")"
+
+install -m 0644 -D "${BOARD_DIR}"/extlinux.conf "${BINARIES_DIR}"/extlinux/extlinux.conf
+
+# finalize the init script
+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
+
+sed -i "/^# Clear memory to reduce page fragmentation/d" "${INIT_PATH}"
+sed -i "/^echo 3 > \/proc\/sys\/vm\/drop_caches/d" "${INIT_PATH}"
diff --git a/board/stmicroelectronics/stm32f746-disco/readme.txt b/board/stmicroelectronics/stm32f746-disco/readme.txt
new file mode 100644
index 000000000000..4ac16da33132
--- /dev/null
+++ b/board/stmicroelectronics/stm32f746-disco/readme.txt
@@ -0,0 +1,31 @@
+STM32F746-DISCO
+===================
+
+This tutorial describes how to use the predefined Buildroot
+configuration for the STM32F746-DISCO evaluation platform.
+
+Building
+--------
+
+ make stm32f746_disco_sd_defconfig
+ make
+
+Flashing
+--------
+
+ ./board/stmicroelectronics/stm32f746-disco/flash_sd.sh output/
+
+It will flash the U-boot bootloader.
+
+Creating SD card
+----------------
+
+Buildroot prepares an "sdcard.img" image in the output/images/ directory,
+ready to be dumped on a SD card. Launch the following command as root:
+
+ dd if=output/images/sdcard.img of=/dev/<your-sd-device>
+
+*** WARNING! This will destroy all the card content. Use with care! ***
+
+For details about the medium image layout and its content, see the
+definition in board/stmicroelectronics/stm32f746-disco/genimage.cfg.
diff --git a/board/stmicroelectronics/stm32f746-disco/tinit-logo.txt b/board/stmicroelectronics/stm32f746-disco/tinit-logo.txt
new file mode 100644
index 000000000000..de58bc636de0
--- /dev/null
+++ b/board/stmicroelectronics/stm32f746-disco/tinit-logo.txt
@@ -0,0 +1,10 @@
+echo " "
+echo " ,, "
+echo " \`7MMF' db "
+echo " MM "
+echo " MM \`7MM \`7MMpMMMb.\`7MM \`7MM \`7M' \`MF'"
+echo " MM MM MM MM MM MM \`VA ,V' "
+echo " MM , MM MM MM MM MM XMX "
+echo " MM ,M MM MM MM MM MM ,V' VA. "
+echo " .JMMmmmmMMM .JMML..JMML JMML.\`Mbod\"YML..AM. .MA."
+echo " ST Microsystems STM32F746-DISCO "
diff --git a/configs/stm32f746_disco_sd_defconfig b/configs/stm32f746_disco_sd_defconfig
new file mode 100644
index 000000000000..0c761ced9a85
--- /dev/null
+++ b/configs/stm32f746_disco_sd_defconfig
@@ -0,0 +1,32 @@
+BR2_arm=y
+BR2_cortex_m7=y
+BR2_PACKAGE_HOST_LINUX_HEADERS_CUSTOM_5_15=y
+BR2_GLOBAL_PATCH_DIR="board/stmicroelectronics/stm32f746-disco/patches"
+BR2_DOWNLOAD_FORCE_CHECK_HASHES=y
+BR2_INIT_TINIT=y
+BR2_ROOTFS_POST_BUILD_SCRIPT="board/stmicroelectronics/stm32f746-disco/post-build.sh"
+BR2_ROOTFS_POST_IMAGE_SCRIPT="support/scripts/genimage.sh"
+BR2_ROOTFS_POST_SCRIPT_ARGS="-c board/stmicroelectronics/stm32f746-disco/genimage.cfg"
+BR2_LINUX_KERNEL=y
+BR2_LINUX_KERNEL_CUSTOM_VERSION=y
+BR2_LINUX_KERNEL_CUSTOM_VERSION_VALUE="5.15.163"
+BR2_LINUX_KERNEL_DEFCONFIG="stm32"
+BR2_LINUX_KERNEL_CONFIG_FRAGMENT_FILES="board/stmicroelectronics/stm32f746-disco/linux.fragment"
+BR2_LINUX_KERNEL_IMAGE_TARGET_CUSTOM=y
+BR2_LINUX_KERNEL_IMAGE_TARGET_NAME="zImage"
+BR2_LINUX_KERNEL_DTS_SUPPORT=y
+BR2_LINUX_KERNEL_INTREE_DTS_NAME="stm32f746-disco"
+BR2_PACKAGE_BUSYBOX_CONFIG_FRAGMENT_FILES="board/stmicroelectronics/stm32f746-disco/busybox-tiny.config"
+BR2_TARGET_ROOTFS_EXT2=y
+BR2_TARGET_ROOTFS_EXT2_SIZE="32M"
+# BR2_TARGET_ROOTFS_TAR is not set
+BR2_TARGET_UBOOT=y
+BR2_TARGET_UBOOT_BUILD_SYSTEM_KCONFIG=y
+BR2_TARGET_UBOOT_CUSTOM_VERSION=y
+BR2_TARGET_UBOOT_CUSTOM_VERSION_VALUE="2024.07"
+BR2_TARGET_UBOOT_BOARD_DEFCONFIG="stm32f746-disco"
+BR2_TARGET_UBOOT_NEEDS_OPENSSL=y
+BR2_PACKAGE_HOST_DOSFSTOOLS=y
+BR2_PACKAGE_HOST_GENIMAGE=y
+BR2_PACKAGE_HOST_MTOOLS=y
+BR2_PACKAGE_HOST_OPENOCD=y
--
2.43.0
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
^ permalink raw reply related [flat|nested] 11+ messages in thread
* [Buildroot] [PATCH 3/3] board/canaan/k210-soc: use tinit as Linux init process
2024-08-03 15:55 [Buildroot] [PATCH 0/3] tinit and stm32f746_disco_sd_defconfig Dario Binacchi
2024-08-03 15:55 ` [Buildroot] [PATCH 1/3] package/tinit: new package Dario Binacchi
2024-08-03 15:55 ` [Buildroot] [PATCH 2/3] configs/stm32f746_disco_sd_defconfig: new defconfig Dario Binacchi
@ 2024-08-03 15:55 ` Dario Binacchi
2024-08-03 20:45 ` [Buildroot] [PATCH 0/3] tinit and stm32f746_disco_sd_defconfig Thomas Petazzoni via buildroot
2024-08-04 0:47 ` Waldemar Brodkorb
4 siblings, 0 replies; 11+ messages in thread
From: Dario Binacchi @ 2024-08-03 15:55 UTC (permalink / raw)
To: buildroot; +Cc: linux-amarula, Damien Le Moal, Dario Binacchi, Thomas Petazzoni
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
diff --git a/.checkpackageignore b/.checkpackageignore
index 10662bb11edc..61e2116c5055 100644
--- a/.checkpackageignore
+++ b/.checkpackageignore
@@ -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
diff --git a/board/canaan/k210-soc/rootfs_overlay/init b/board/canaan/k210-soc/rootfs_overlay/init
deleted file mode 120000
index a0b71977c06f..000000000000
--- a/board/canaan/k210-soc/rootfs_overlay/init
+++ /dev/null
@@ -1 +0,0 @@
-/sbin/init
\ No newline at end of file
diff --git a/board/canaan/k210-soc/rootfs_overlay/sbin/init b/board/canaan/k210-soc/rootfs_overlay/sbin/init
deleted file mode 100755
index d4bf53d45231..000000000000
--- a/board/canaan/k210-soc/rootfs_overlay/sbin/init
+++ /dev/null
@@ -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
diff --git a/board/canaan/k210-soc/tinit-logo.txt b/board/canaan/k210-soc/tinit-logo.txt
new file mode 100644
index 000000000000..ab4484da6475
--- /dev/null
+++ b/board/canaan/k210-soc/tinit-logo.txt
@@ -0,0 +1,7 @@
+echo " __ _"
+echo " / / (_) ____ _ _ __ __"
+echo " / / | || _ \\ | | | |\\ \\/ /"
+echo " / /___| || | | || |_| | > < "
+echo " /_____/|_||_| |_| \\____|/_/\\_\\"
+echo " 64-bits RISC-V Kendryte K210 NOMMU"
+echo ""
diff --git a/board/canaan/k210-soc/tinit-setup.sh b/board/canaan/k210-soc/tinit-setup.sh
new file mode 100755
index 000000000000..f6564dda46a6
--- /dev/null
+++ b/board/canaan/k210-soc/tinit-setup.sh
@@ -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
diff --git a/configs/canaan_kd233_defconfig b/configs/canaan_kd233_defconfig
index 832f8363a75c..46ebce77e61d 100644
--- a/configs/canaan_kd233_defconfig
+++ b/configs/canaan_kd233_defconfig
@@ -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"
diff --git a/configs/sipeed_maix_bit_defconfig b/configs/sipeed_maix_bit_defconfig
index 238e082a3d40..1d5b16ee25aa 100644
--- a/configs/sipeed_maix_bit_defconfig
+++ b/configs/sipeed_maix_bit_defconfig
@@ -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
diff --git a/configs/sipeed_maix_bit_sdcard_defconfig b/configs/sipeed_maix_bit_sdcard_defconfig
index 28aa143583bd..039290aca9ed 100644
--- a/configs/sipeed_maix_bit_sdcard_defconfig
+++ b/configs/sipeed_maix_bit_sdcard_defconfig
@@ -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"
diff --git a/configs/sipeed_maix_dock_defconfig b/configs/sipeed_maix_dock_defconfig
index ee1b0d837284..b0cdc3d154a3 100644
--- a/configs/sipeed_maix_dock_defconfig
+++ b/configs/sipeed_maix_dock_defconfig
@@ -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"
diff --git a/configs/sipeed_maix_dock_sdcard_defconfig b/configs/sipeed_maix_dock_sdcard_defconfig
index 41a062c7a179..068d3748dc42 100644
--- a/configs/sipeed_maix_dock_sdcard_defconfig
+++ b/configs/sipeed_maix_dock_sdcard_defconfig
@@ -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"
diff --git a/configs/sipeed_maix_go_defconfig b/configs/sipeed_maix_go_defconfig
index a5b09e17ac1c..53ff9c5e5052 100644
--- a/configs/sipeed_maix_go_defconfig
+++ b/configs/sipeed_maix_go_defconfig
@@ -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"
diff --git a/configs/sipeed_maix_go_sdcard_defconfig b/configs/sipeed_maix_go_sdcard_defconfig
index 0e80d9c83ad8..2d2c26f59f7e 100644
--- a/configs/sipeed_maix_go_sdcard_defconfig
+++ b/configs/sipeed_maix_go_sdcard_defconfig
@@ -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"
diff --git a/configs/sipeed_maixduino_defconfig b/configs/sipeed_maixduino_defconfig
index 7ba7653e8d5f..96ee9892852d 100644
--- a/configs/sipeed_maixduino_defconfig
+++ b/configs/sipeed_maixduino_defconfig
@@ -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"
diff --git a/configs/sipeed_maixduino_sdcard_defconfig b/configs/sipeed_maixduino_sdcard_defconfig
index 7bdd36e1d09f..120cc127c571 100644
--- a/configs/sipeed_maixduino_sdcard_defconfig
+++ b/configs/sipeed_maixduino_sdcard_defconfig
@@ -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"
--
2.43.0
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
^ permalink raw reply related [flat|nested] 11+ messages in thread
* Re: [Buildroot] [PATCH 0/3] tinit and stm32f746_disco_sd_defconfig
2024-08-03 15:55 [Buildroot] [PATCH 0/3] tinit and stm32f746_disco_sd_defconfig Dario Binacchi
` (2 preceding siblings ...)
2024-08-03 15:55 ` [Buildroot] [PATCH 3/3] board/canaan/k210-soc: use tinit as Linux init process Dario Binacchi
@ 2024-08-03 20:45 ` Thomas Petazzoni via buildroot
2024-08-05 17:40 ` Damien Le Moal
2024-08-20 18:47 ` Dario Binacchi
2024-08-04 0:47 ` Waldemar Brodkorb
4 siblings, 2 replies; 11+ messages in thread
From: Thomas Petazzoni via buildroot @ 2024-08-03 20:45 UTC (permalink / raw)
To: Dario Binacchi; +Cc: Damien Le Moal, linux-amarula, buildroot
Hello Dario,
On Sat, 3 Aug 2024 17:55:14 +0200
Dario Binacchi <dario.binacchi@amarulasolutions.com> wrote:
> This series is inspired by reading the following topic:
>
> https://lore.kernel.org/buildroot/20230206230203.70e2dbd8@windsurf/T
>
> Starting from that patch, and following Thomas Petazzoni's suggestions
> regarding the possibility of using a single minimal script without
> duplicating it within Buildroot, I developed these three patches.
> Meanwhile, the configuration for the stm32f746_disco board was useful
> for developing the display support for the board, which was later
> merged into Linux.
>
> Dario Binacchi (3):
> package/tinit: new package
> configs/stm32f746_disco_sd_defconfig: new defconfig
> board/canaan/k210-soc: use tinit as Linux init process
From a high-level point of view, I think it looks fine, though I'd
really like to have some opinion from some of the other maintainers on
this.
Maybe some comments:
- I don't really think it's super useful to have a Github project for
tinit. The script could just as well be inside package/tinit
- Should it be named tinyinit instead of tinit, just to make things
clear?
- I believe you should drop entirely the logo thing in tinit, we don't
have such "logos" in any other Buildroot defconfig, so I don't see
why we would have one for those super small noMMU defconfigs. This
would allow to get rid of tiny-setup.sh stuff.
> .../stm32f746-disco/busybox-tiny.config | 230 ++++++++++++++++++
Why do we need a busybox-tiny.config? We already have
package/busybox/busybox-minimal.config. How different are they?
Thanks!
Thomas
--
Thomas Petazzoni, co-owner and CEO, Bootlin
Embedded Linux and Kernel engineering and training
https://bootlin.com
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [Buildroot] [PATCH 0/3] tinit and stm32f746_disco_sd_defconfig
2024-08-03 15:55 [Buildroot] [PATCH 0/3] tinit and stm32f746_disco_sd_defconfig Dario Binacchi
` (3 preceding siblings ...)
2024-08-03 20:45 ` [Buildroot] [PATCH 0/3] tinit and stm32f746_disco_sd_defconfig Thomas Petazzoni via buildroot
@ 2024-08-04 0:47 ` Waldemar Brodkorb
2024-08-20 19:03 ` Dario Binacchi
4 siblings, 1 reply; 11+ messages in thread
From: Waldemar Brodkorb @ 2024-08-04 0:47 UTC (permalink / raw)
To: Dario Binacchi; +Cc: Damien Le Moal, linux-amarula, Thomas Petazzoni, buildroot
Hi Dario,
Dario Binacchi wrote,
> This series is inspired by reading the following topic:
>
> https://lore.kernel.org/buildroot/20230206230203.70e2dbd8@windsurf/T
>
> Starting from that patch, and following Thomas Petazzoni's suggestions
> regarding the possibility of using a single minimal script without
> duplicating it within Buildroot, I developed these three patches.
> Meanwhile, the configuration for the stm32f746_disco board was useful
> for developing the display support for the board, which was later
> merged into Linux.
>
> Dario Binacchi (3):
> package/tinit: new package
> configs/stm32f746_disco_sd_defconfig: new defconfig
> board/canaan/k210-soc: use tinit as Linux init process
You can add a
Tested-by: Waldemar Brodkorb <wbx@openadk.org>
for your next patch submission.
I build and runtime tested the stm32f746 config.
In which version we will have display support for the board?
Are you also working on the missing ethernet part?
Thanks for the good work.
This board is used to test uClibc-ng ARM FDPIC support.
Sadly FDPIC support in buildroot never made it upstream. (hint :=) )
best regards
Waldemar
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [Buildroot] [PATCH 0/3] tinit and stm32f746_disco_sd_defconfig
2024-08-03 20:45 ` [Buildroot] [PATCH 0/3] tinit and stm32f746_disco_sd_defconfig Thomas Petazzoni via buildroot
@ 2024-08-05 17:40 ` Damien Le Moal
2024-08-20 18:47 ` Dario Binacchi
1 sibling, 0 replies; 11+ messages in thread
From: Damien Le Moal @ 2024-08-05 17:40 UTC (permalink / raw)
To: Thomas Petazzoni, Dario Binacchi; +Cc: linux-amarula, buildroot
On 2024/08/03 13:45, Thomas Petazzoni via buildroot wrote:
> Hello Dario,
>
> On Sat, 3 Aug 2024 17:55:14 +0200
> Dario Binacchi <dario.binacchi@amarulasolutions.com> wrote:
>
>> This series is inspired by reading the following topic:
>>
>> https://lore.kernel.org/buildroot/20230206230203.70e2dbd8@windsurf/T
>>
>> Starting from that patch, and following Thomas Petazzoni's suggestions
>> regarding the possibility of using a single minimal script without
>> duplicating it within Buildroot, I developed these three patches.
>> Meanwhile, the configuration for the stm32f746_disco board was useful
>> for developing the display support for the board, which was later
>> merged into Linux.
>>
>> Dario Binacchi (3):
>> package/tinit: new package
>> configs/stm32f746_disco_sd_defconfig: new defconfig
>> board/canaan/k210-soc: use tinit as Linux init process
>
> From a high-level point of view, I think it looks fine, though I'd
> really like to have some opinion from some of the other maintainers on
> this.
>
> Maybe some comments:
>
> - I don't really think it's super useful to have a Github project for
> tinit. The script could just as well be inside package/tinit
>
> - Should it be named tinyinit instead of tinit, just to make things
> clear?
>
> - I believe you should drop entirely the logo thing in tinit, we don't
> have such "logos" in any other Buildroot defconfig, so I don't see
> why we would have one for those super small noMMU defconfigs. This
> would allow to get rid of tiny-setup.sh stuff.
>
>> .../stm32f746-disco/busybox-tiny.config | 230 ++++++++++++++++++
>
> Why do we need a busybox-tiny.config? We already have
> package/busybox/busybox-minimal.config. How different are they?
I tried to compile the sipeed_max_bit_defconfig to check again but running into
an error (host-fakeroot download fails with "The certificate is NOT trusted. The
certificate issuer is unknown."). Let me dig into that.
>
> Thanks!
>
> Thomas
--
Damien Le Moal
Western Digital Research
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [Buildroot] [PATCH 0/3] tinit and stm32f746_disco_sd_defconfig
2024-08-03 20:45 ` [Buildroot] [PATCH 0/3] tinit and stm32f746_disco_sd_defconfig Thomas Petazzoni via buildroot
2024-08-05 17:40 ` Damien Le Moal
@ 2024-08-20 18:47 ` Dario Binacchi
2024-08-20 21:02 ` Thomas Petazzoni via buildroot
1 sibling, 1 reply; 11+ messages in thread
From: Dario Binacchi @ 2024-08-20 18:47 UTC (permalink / raw)
To: Thomas Petazzoni; +Cc: Damien Le Moal, linux-amarula, buildroot
Hello Thomas,
I apologize for the delayed response.
On Sat, Aug 3, 2024 at 10:45 PM Thomas Petazzoni
<thomas.petazzoni@bootlin.com> wrote:
>
> Hello Dario,
>
> On Sat, 3 Aug 2024 17:55:14 +0200
> Dario Binacchi <dario.binacchi@amarulasolutions.com> wrote:
>
> > This series is inspired by reading the following topic:
> >
> > https://lore.kernel.org/buildroot/20230206230203.70e2dbd8@windsurf/T
> >
> > Starting from that patch, and following Thomas Petazzoni's suggestions
> > regarding the possibility of using a single minimal script without
> > duplicating it within Buildroot, I developed these three patches.
> > Meanwhile, the configuration for the stm32f746_disco board was useful
> > for developing the display support for the board, which was later
> > merged into Linux.
> >
> > Dario Binacchi (3):
> > package/tinit: new package
> > configs/stm32f746_disco_sd_defconfig: new defconfig
> > board/canaan/k210-soc: use tinit as Linux init process
>
> From a high-level point of view, I think it looks fine, though I'd
> really like to have some opinion from some of the other maintainers on
> this.
>
> Maybe some comments:
>
> - I don't really think it's super useful to have a Github project for
> tinit. The script could just as well be inside package/tinit
>
> - Should it be named tinyinit instead of tinit, just to make things
> clear?
I will rename it in v2.
>
> - I believe you should drop entirely the logo thing in tinit, we don't
> have such "logos" in any other Buildroot defconfig, so I don't see
> why we would have one for those super small noMMU defconfigs. This
> would allow to get rid of tiny-setup.sh stuff.
I implemented the logo management only to ensure that the patch
"board/canaan/k210-soc: use tinit as Linux init process" was backward
compatible.
The previous script included the Linux logo. But if this is not an
issue, I agree with you
that it's better to adopt a simpler approach.
>
> > .../stm32f746-disco/busybox-tiny.config | 230 ++++++++++++++++++
>
> Why do we need a busybox-tiny.config? We already have
> package/busybox/busybox-minimal.config. How different are they?
I think this is a configuration I used for upstreaming the Linux
display driver.
I will remove it and use the busybox-minimal.config.
Thanks and regards,
Dario
>
> Thanks!
>
> Thomas
> --
> Thomas Petazzoni, co-owner and CEO, Bootlin
> Embedded Linux and Kernel engineering and training
> https://bootlin.com
--
Dario Binacchi
Senior Embedded Linux Developer
dario.binacchi@amarulasolutions.com
__________________________________
Amarula Solutions SRL
Via Le Canevare 30, 31100 Treviso, Veneto, IT
T. +39 042 243 5310
info@amarulasolutions.com
www.amarulasolutions.com
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [Buildroot] [PATCH 0/3] tinit and stm32f746_disco_sd_defconfig
2024-08-04 0:47 ` Waldemar Brodkorb
@ 2024-08-20 19:03 ` Dario Binacchi
2024-08-24 4:10 ` Waldemar Brodkorb
0 siblings, 1 reply; 11+ messages in thread
From: Dario Binacchi @ 2024-08-20 19:03 UTC (permalink / raw)
To: Waldemar Brodkorb
Cc: Damien Le Moal, linux-amarula, Thomas Petazzoni, buildroot
Hello Waldemar,
I apologize for the delayed response.
On Sun, Aug 4, 2024 at 2:47 AM Waldemar Brodkorb <wbx@openadk.org> wrote:
>
> Hi Dario,
> Dario Binacchi wrote,
>
> > This series is inspired by reading the following topic:
> >
> > https://lore.kernel.org/buildroot/20230206230203.70e2dbd8@windsurf/T
> >
> > Starting from that patch, and following Thomas Petazzoni's suggestions
> > regarding the possibility of using a single minimal script without
> > duplicating it within Buildroot, I developed these three patches.
> > Meanwhile, the configuration for the stm32f746_disco board was useful
> > for developing the display support for the board, which was later
> > merged into Linux.
> >
> > Dario Binacchi (3):
> > package/tinit: new package
> > configs/stm32f746_disco_sd_defconfig: new defconfig
> > board/canaan/k210-soc: use tinit as Linux init process
>
> You can add a
> Tested-by: Waldemar Brodkorb <wbx@openadk.org>
> for your next patch submission.
> I build and runtime tested the stm32f746 config.
Thank you for the test.
>
> In which version we will have display support for the board?
Some patches have been merged in version 6.5:
13cdd12a9f9341 ("drm/panel: simple: add support for Rocktech RK043FN48H panel")
but the display is actually supported in version 6.6:
10a970bc3ebfa ("ARM: dts: stm32: support display on stm32f746-disco board").
> Are you also working on the missing ethernet part?
No, but who knows, maybe in the future.
Thanks for the suggestion
>
> Thanks for the good work.
>
> This board is used to test uClibc-ng ARM FDPIC support.
> Sadly FDPIC support in buildroot never made it upstream. (hint :=) )
Do you have any documents/links to suggest on this topic?
Thanks and regards,
Dario
>
> best regards
> Waldemar
--
Dario Binacchi
Senior Embedded Linux Developer
dario.binacchi@amarulasolutions.com
__________________________________
Amarula Solutions SRL
Via Le Canevare 30, 31100 Treviso, Veneto, IT
T. +39 042 243 5310
info@amarulasolutions.com
www.amarulasolutions.com
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [Buildroot] [PATCH 0/3] tinit and stm32f746_disco_sd_defconfig
2024-08-20 18:47 ` Dario Binacchi
@ 2024-08-20 21:02 ` Thomas Petazzoni via buildroot
0 siblings, 0 replies; 11+ messages in thread
From: Thomas Petazzoni via buildroot @ 2024-08-20 21:02 UTC (permalink / raw)
To: Dario Binacchi; +Cc: Damien Le Moal, linux-amarula, buildroot
Hello Dario,
On Tue, 20 Aug 2024 20:47:09 +0200
Dario Binacchi <dario.binacchi@amarulasolutions.com> wrote:
> > - I believe you should drop entirely the logo thing in tinit, we don't
> > have such "logos" in any other Buildroot defconfig, so I don't see
> > why we would have one for those super small noMMU defconfigs. This
> > would allow to get rid of tiny-setup.sh stuff.
>
> I implemented the logo management only to ensure that the patch
> "board/canaan/k210-soc: use tinit as Linux init process" was backward
> compatible.
> The previous script included the Linux logo. But if this is not an
> issue, I agree with you
> that it's better to adopt a simpler approach.
I think it could be dropped (perhaps as a preparation commit). No other
Buildroot defconfig has this, it doesn't bring anything really useful,
and is just extra complexity for no benefit.
> > Why do we need a busybox-tiny.config? We already have
> > package/busybox/busybox-minimal.config. How different are they?
>
> I think this is a configuration I used for upstreaming the Linux
> display driver.
> I will remove it and use the busybox-minimal.config.
Perfect, thanks a lot!
Thomas
--
Thomas Petazzoni, co-owner and CEO, Bootlin
Embedded Linux and Kernel engineering and training
https://bootlin.com
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [Buildroot] [PATCH 0/3] tinit and stm32f746_disco_sd_defconfig
2024-08-20 19:03 ` Dario Binacchi
@ 2024-08-24 4:10 ` Waldemar Brodkorb
0 siblings, 0 replies; 11+ messages in thread
From: Waldemar Brodkorb @ 2024-08-24 4:10 UTC (permalink / raw)
To: Dario Binacchi; +Cc: Damien Le Moal, linux-amarula, Thomas Petazzoni, buildroot
Hi Dario,
Dario Binacchi wrote,
> Hello Waldemar,
>
> I apologize for the delayed response.
>
> On Sun, Aug 4, 2024 at 2:47 AM Waldemar Brodkorb <wbx@openadk.org> wrote:
> >
> > Hi Dario,
> > Dario Binacchi wrote,
> >
> > > This series is inspired by reading the following topic:
> > >
> > > https://lore.kernel.org/buildroot/20230206230203.70e2dbd8@windsurf/T
> > >
> > > Starting from that patch, and following Thomas Petazzoni's suggestions
> > > regarding the possibility of using a single minimal script without
> > > duplicating it within Buildroot, I developed these three patches.
> > > Meanwhile, the configuration for the stm32f746_disco board was useful
> > > for developing the display support for the board, which was later
> > > merged into Linux.
> > >
> > > Dario Binacchi (3):
> > > package/tinit: new package
> > > configs/stm32f746_disco_sd_defconfig: new defconfig
> > > board/canaan/k210-soc: use tinit as Linux init process
> >
> > You can add a
> > Tested-by: Waldemar Brodkorb <wbx@openadk.org>
> > for your next patch submission.
> > I build and runtime tested the stm32f746 config.
>
> Thank you for the test.
>
> >
> > In which version we will have display support for the board?
>
> Some patches have been merged in version 6.5:
> 13cdd12a9f9341 ("drm/panel: simple: add support for Rocktech RK043FN48H panel")
> but the display is actually supported in version 6.6:
> 10a970bc3ebfa ("ARM: dts: stm32: support display on stm32f746-disco board").
>
> > Are you also working on the missing ethernet part?
> No, but who knows, maybe in the future.
> Thanks for the suggestion
>
> >
> > Thanks for the good work.
> >
> > This board is used to test uClibc-ng ARM FDPIC support.
> > Sadly FDPIC support in buildroot never made it upstream. (hint :=) )
>
> Do you have any documents/links to suggest on this topic?
See here:
https://lore.kernel.org/buildroot/20230930223622.06e32f3c@windsurf/T/
I know Emcraft is using these patches for their products:
https://github.com/EmcraftSystems/buildroot
It works really more stable then BFLAT, because of less memory
fragmentation. With BFLAT i can not execute more then 4 or 5
commands before I get a memory problem on the device.
best regards
Waldemar
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
^ permalink raw reply [flat|nested] 11+ messages in thread
end of thread, other threads:[~2024-08-24 4:10 UTC | newest]
Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-08-03 15:55 [Buildroot] [PATCH 0/3] tinit and stm32f746_disco_sd_defconfig Dario Binacchi
2024-08-03 15:55 ` [Buildroot] [PATCH 1/3] package/tinit: new package Dario Binacchi
2024-08-03 15:55 ` [Buildroot] [PATCH 2/3] configs/stm32f746_disco_sd_defconfig: new defconfig Dario Binacchi
2024-08-03 15:55 ` [Buildroot] [PATCH 3/3] board/canaan/k210-soc: use tinit as Linux init process Dario Binacchi
2024-08-03 20:45 ` [Buildroot] [PATCH 0/3] tinit and stm32f746_disco_sd_defconfig Thomas Petazzoni via buildroot
2024-08-05 17:40 ` Damien Le Moal
2024-08-20 18:47 ` Dario Binacchi
2024-08-20 21:02 ` Thomas Petazzoni via buildroot
2024-08-04 0:47 ` Waldemar Brodkorb
2024-08-20 19:03 ` Dario Binacchi
2024-08-24 4:10 ` Waldemar Brodkorb
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox