* [Buildroot] [PATCH 0/5] Add support for Kendryte K210 RISC-V boards
@ 2020-09-08 5:16 Damien Le Moal
2020-09-08 5:16 ` [Buildroot] [PATCH 1/5] toolchain/buildroot: allow uclibc-ng for riscv Damien Le Moal
` (4 more replies)
0 siblings, 5 replies; 15+ messages in thread
From: Damien Le Moal @ 2020-09-08 5:16 UTC (permalink / raw)
To: buildroot
(resending as my first drop was rejected due to lack of subscription to
the mailining list. My apologies for the noise)
This patch series adds support for building bootable images for RISC-V
boards based on the Kendryte K210 SoC which is supported by the Linux
kernel since version 5.8.0. This SoC has no MMU supported by Linux and
requires uClibc flatbin binaries as gcc does not yet support FDPIC
executables for RISC-V.
The first four patches adjust buildroot configuration to allow building
uClibc static no-MMU libraries for RISC-V. The last and fifth patch adds
buildroot defconfig for the Kendryte K210 as well as uClibc and busybox
configuration.
Building is as simple as:
make kendryte_k210_defconfig
make
Which generate the output/image/loader.bin bootable image.
The result using a SiPeed Dan Dock board is:
[ 0.000000] Linux version 5.8.0 (damien at localhost.localdomain) (riscv64-buildroot-linux-uclibc-gcc.br_real (Buildroot 2020.08-301-g80b623ab02) 9.3.0, GNU ld (GNU Binutils) 2.32) #5 SMP Tue Sep 8 13:24:36 JST 2020
[ 0.000000] earlycon: sifive0 at MMIO 0x0000000038000000 (options '')
[ 0.000000] printk: bootconsole [sifive0] enabled
[ 0.000000] Zone ranges:
[ 0.000000] DMA32 [mem 0x0000000080000000-0x00000000807fffff]
[ 0.000000] Normal empty
[ 0.000000] Movable zone start for each node
[ 0.000000] Early memory node ranges
[ 0.000000] node 0: [mem 0x0000000080000000-0x00000000807fffff]
[ 0.000000] Initmem setup node 0 [mem 0x0000000080000000-0x00000000807fffff]
[ 0.000000] riscv: ISA extensions acdfim
[ 0.000000] riscv: ELF capabilities acdfim
[ 0.000000] percpu: max_distance=0x18000 too large for vmalloc space 0x0
[ 0.000000] percpu: Embedded 12 pages/cpu s18336 r0 d30816 u49152
[ 0.000000] Built 1 zonelists, mobility grouping off. Total pages: 2020
[ 0.000000] Kernel command line: earlycon console=ttySIF0
[ 0.000000] Dentry cache hash table entries: 1024 (order: 1, 8192 bytes, linear)
[ 0.000000] Inode-cache hash table entries: 512 (order: 0, 4096 bytes, linear)
[ 0.000000] Sorting __ex_table...
[ 0.000000] mem auto-init: stack:off, heap alloc:off, heap free:off
[ 0.000000] Memory: 6328K/8192K available (939K kernel code, 127K rwdata, 169K rodata, 281K init, 97K bss, 1864K reserved, 0K cma-reserved)
[ 0.000000] rcu: Hierarchical RCU implementation.
[ 0.000000] rcu: RCU calculated value of scheduler-enlistment delay is 25 jiffies.
[ 0.000000] NR_IRQS: 64, nr_irqs: 64, preallocated irqs: 0
[ 0.000000] riscv-intc: 64 local interrupts mapped
[ 0.000000] plic: interrupt-controller at c000000: mapped 65 interrupts with 2 handlers for 4 contexts.
[ 0.000000] riscv_timer_init_dt: Registering clocksource cpuid [0] hartid [0]
[ 0.000000] clocksource: riscv_clocksource: mask: 0xffffffffffffffff max_cycles: 0x3990be68b, max_idle_ns: 881590404272 ns
[ 0.000014] sched_clock: 64 bits at 7MHz, resolution 128ns, wraps every 4398046511054ns
[ 0.008243] Console: colour dummy device 80x25
[ 0.012482] Calibrating delay loop (skipped), value calculated using timer frequency.. 15.60 BogoMIPS (lpj=31200)
[ 0.022681] pid_max: default: 4096 minimum: 301
[ 0.027301] Mount-cache hash table entries: 512 (order: 0, 4096 bytes, linear)
[ 0.034417] Mountpoint-cache hash table entries: 512 (order: 0, 4096 bytes, linear)
[ 0.044877] rcu: Hierarchical SRCU implementation.
[ 0.049777] smp: Bringing up secondary CPUs ...
[ 0.055061] smp: Brought up 1 node, 2 CPUs
[ 0.059461] devtmpfs: initialized
[ 0.065630] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 7645041785100000 ns
[ 0.074654] futex hash table entries: 16 (order: -2, 1024 bytes, linear)
[ 0.084164] Kendryte K210 SoC sysctl
[ 0.097676] clocksource: Switched to clocksource riscv_clocksource
[ 0.234143] workingset: timestamp_bits=62 max_order=11 bucket_order=0
[ 0.241568] 38000000.serial: ttySIF0 at MMIO 0x38000000 (irq = 1, base_baud = 0) is a SiFive UART v0
[ 0.250052] printk: console [ttySIF0] enabled
[ 0.250052] printk: console [ttySIF0] enabled
[ 0.258687] printk: bootconsole [sifive0] disabled
[ 0.258687] printk: bootconsole [sifive0] disabled
[ 0.271261] random: get_random_bytes called from 0x000000008004c75c with crng_init=0
[ 0.279763] Freeing unused kernel memory: 280K
[ 0.283478] This architecture does not have kernel memory protection.
[ 0.289922] Run /init as init process
-----------------------------
| Kendryte K210 NOMMU Linux |
-----------------------------
BusyBox v1.32.0 (2020-09-08 12:18:21 JST) hush - the humble shell
Enter 'help' for a list of built-in commands.
/ # cat /proc/cpuinfo
processor : 0
hart : 0
isa : rv64imafdc
uarch : kendryte,k210
processor : 1
hart : 1
isa : rv64imafdc
uarch : kendryte,k210
/ #
These patches are also available at
git at github.com:damien-lemoal/buildroot.git
(https://github.com/damien-lemoal/buildroot)
Christoph Hellwig (2):
package/elf2flt: add RISC-V support
package make: build nommu builds as linux
Damien Le Moal (3):
toolchain/buildroot: allow uclibc-ng for riscv
arch/config: Make RISC-V MMU optional
Add support for Kendryte K210 based RISC-V boards
arch/Config.in | 2 +-
board/kendryte/k210/busybox.config | 1181 +++++++++++++++++
board/kendryte/k210/device_table_dev.txt | 17 +
board/kendryte/k210/fakeroot.sh | 8 +
...evert-Fix-static-linking-with-GCC-10.patch | 43 +
...0002-fix-static-builds-with-gcc-10.x.patch | 25 +
...-utils-getconf-Fix-compilation-error.patch | 103 ++
.../0004-librt-avoid-compilation-error.patch | 42 +
board/kendryte/k210/rootfs_overlay/init | 11 +
board/kendryte/k210/uClibc-ng.config | 209 +++
configs/kendryte_k210_defconfig | 36 +
package/Makefile.in | 2 +-
.../0002-elf2flt-add-riscv-support.patch | 302 +++++
package/elf2flt/Config.in.host | 2 +-
package/uclibc/Config.in | 2 +
toolchain/toolchain-buildroot/Config.in | 4 +-
16 files changed, 1985 insertions(+), 4 deletions(-)
create mode 100644 board/kendryte/k210/busybox.config
create mode 100644 board/kendryte/k210/device_table_dev.txt
create mode 100755 board/kendryte/k210/fakeroot.sh
create mode 100644 board/kendryte/k210/patches/uclibc/0001-Revert-Fix-static-linking-with-GCC-10.patch
create mode 100644 board/kendryte/k210/patches/uclibc/0002-fix-static-builds-with-gcc-10.x.patch
create mode 100644 board/kendryte/k210/patches/uclibc/0003-utils-getconf-Fix-compilation-error.patch
create mode 100644 board/kendryte/k210/patches/uclibc/0004-librt-avoid-compilation-error.patch
create mode 100755 board/kendryte/k210/rootfs_overlay/init
create mode 100644 board/kendryte/k210/uClibc-ng.config
create mode 100644 configs/kendryte_k210_defconfig
create mode 100644 package/elf2flt/0002-elf2flt-add-riscv-support.patch
--
2.26.2
^ permalink raw reply [flat|nested] 15+ messages in thread
* [Buildroot] [PATCH 1/5] toolchain/buildroot: allow uclibc-ng for riscv
2020-09-08 5:16 [Buildroot] [PATCH 0/5] Add support for Kendryte K210 RISC-V boards Damien Le Moal
@ 2020-09-08 5:16 ` Damien Le Moal
2020-09-08 5:16 ` [Buildroot] [PATCH 2/5] arch/config: Make RISC-V MMU optional Damien Le Moal
` (3 subsequent siblings)
4 siblings, 0 replies; 15+ messages in thread
From: Damien Le Moal @ 2020-09-08 5:16 UTC (permalink / raw)
To: buildroot
uclibcb supports RISC-V architecture since version 1.0.31. Allow its
selection for that architecture.
Signed-off-by: Damien Le Moal <damien.lemoal@wdc.com>
---
package/uclibc/Config.in | 2 ++
toolchain/toolchain-buildroot/Config.in | 4 +++-
2 files changed, 5 insertions(+), 1 deletion(-)
diff --git a/package/uclibc/Config.in b/package/uclibc/Config.in
index de2885bc92..35b1cb8e2f 100644
--- a/package/uclibc/Config.in
+++ b/package/uclibc/Config.in
@@ -106,6 +106,8 @@ config BR2_UCLIBC_TARGET_ARCH
default "xtensa" if BR2_xtensa
default "i386" if BR2_i386
default "x86_64" if BR2_x86_64
+ default "riscv64" if BR2_riscv && BR2_ARCH_IS_64
+ default "riscv32" if BR2_riscv && !BR2_ARCH_IS_6
config BR2_UCLIBC_MIPS_ABI
string
diff --git a/toolchain/toolchain-buildroot/Config.in b/toolchain/toolchain-buildroot/Config.in
index 418d5cb387..49f67c7348 100644
--- a/toolchain/toolchain-buildroot/Config.in
+++ b/toolchain/toolchain-buildroot/Config.in
@@ -32,7 +32,9 @@ config BR2_TOOLCHAIN_BUILDROOT_UCLIBC
BR2_i386 || BR2_m68k || BR2_microblaze || \
BR2_mips || BR2_mipsel || BR2_mips64 || BR2_mips64el || \
BR2_or1k || BR2_powerpc || BR2_sh2a || BR2_sh4 || \
- BR2_sh4eb || BR2_sparc || BR2_xtensa || BR2_x86_64
+ BR2_sh4eb || BR2_sparc || BR2_xtensa || BR2_x86_64 || \
+ BR2_riscv
+
select BR2_TOOLCHAIN_USES_UCLIBC
help
This option selects uClibc-ng as the C library for the
--
2.26.2
^ permalink raw reply related [flat|nested] 15+ messages in thread
* [Buildroot] [PATCH 2/5] arch/config: Make RISC-V MMU optional
2020-09-08 5:16 [Buildroot] [PATCH 0/5] Add support for Kendryte K210 RISC-V boards Damien Le Moal
2020-09-08 5:16 ` [Buildroot] [PATCH 1/5] toolchain/buildroot: allow uclibc-ng for riscv Damien Le Moal
@ 2020-09-08 5:16 ` Damien Le Moal
2020-09-08 5:16 ` [Buildroot] [PATCH 3/5] package/elf2flt: add RISC-V support Damien Le Moal
` (2 subsequent siblings)
4 siblings, 0 replies; 15+ messages in thread
From: Damien Le Moal @ 2020-09-08 5:16 UTC (permalink / raw)
To: buildroot
Linux supports No-MMU RISC-V since kernel version 5.8. Make MMU optional
to enable building for RISC-V boards that do not have one.
Signed-off-by: Damien Le Moal <damien.lemoal@wdc.com>
---
arch/Config.in | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/Config.in b/arch/Config.in
index 0707c076e2..4a2787c350 100644
--- a/arch/Config.in
+++ b/arch/Config.in
@@ -210,7 +210,7 @@ config BR2_powerpc64le
config BR2_riscv
bool "RISCV"
- select BR2_ARCH_HAS_MMU_MANDATORY
+ select BR2_ARCH_HAS_MMU_OPTIONAL
select BR2_ARCH_NEEDS_GCC_AT_LEAST_7
help
RISC-V is an open, free Instruction Set Architecture created
--
2.26.2
^ permalink raw reply related [flat|nested] 15+ messages in thread
* [Buildroot] [PATCH 3/5] package/elf2flt: add RISC-V support
2020-09-08 5:16 [Buildroot] [PATCH 0/5] Add support for Kendryte K210 RISC-V boards Damien Le Moal
2020-09-08 5:16 ` [Buildroot] [PATCH 1/5] toolchain/buildroot: allow uclibc-ng for riscv Damien Le Moal
2020-09-08 5:16 ` [Buildroot] [PATCH 2/5] arch/config: Make RISC-V MMU optional Damien Le Moal
@ 2020-09-08 5:16 ` Damien Le Moal
[not found] ` <20200908053821.GA13505@lst.de>
2020-09-08 5:16 ` [Buildroot] [PATCH 4/5] package make: build nommu builds as linux Damien Le Moal
2020-09-08 5:16 ` [Buildroot] [PATCH 5/5] Add support for Kendryte K210 based RISC-V boards Damien Le Moal
4 siblings, 1 reply; 15+ messages in thread
From: Damien Le Moal @ 2020-09-08 5:16 UTC (permalink / raw)
To: buildroot
From: Christoph Hellwig <hch@lst.de>
Enable selecting elf2flt for RISC-V no MMU builds ad add support for it.
Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Damien Le Moal <damien.lemoal@wdc.com>
---
.../0002-elf2flt-add-riscv-support.patch | 302 ++++++++++++++++++
package/elf2flt/Config.in.host | 2 +-
2 files changed, 303 insertions(+), 1 deletion(-)
create mode 100644 package/elf2flt/0002-elf2flt-add-riscv-support.patch
diff --git a/package/elf2flt/0002-elf2flt-add-riscv-support.patch b/package/elf2flt/0002-elf2flt-add-riscv-support.patch
new file mode 100644
index 0000000000..2f3ce5ac69
--- /dev/null
+++ b/package/elf2flt/0002-elf2flt-add-riscv-support.patch
@@ -0,0 +1,302 @@
+From 9a1c84590f31897e681a8142481c73456a7eedcf Mon Sep 17 00:00:00 2001
+From: Christoph Hellwig <hch@lst.de>
+Date: Mon, 10 Jun 2019 09:21:57 +0200
+Subject: elf2flt: add riscv support
+
+We need a new linker script - riscv has a global_pointer and is
+very picky about some section ordering.
+
+Signed-off-by: Christoph Hellwig <hch@lst.de>
+---
+ Makefile.in | 4 +-
+ elf2flt.c | 15 ++-
+ riscv64-elf2flt.ld | 222 +++++++++++++++++++++++++++++++++++++++++++++
+ 3 files changed, 239 insertions(+), 2 deletions(-)
+ create mode 100644 riscv64-elf2flt.ld
+
+diff --git a/Makefile.in b/Makefile.in
+index 52b3347..3b0b604 100644
+--- a/Makefile.in
++++ b/Makefile.in
+@@ -43,7 +43,9 @@ endif
+ LDFILE= elf2flt.ld
+ ifeq ($(strip $(CPU)),e1)
+ SRC_LDFILE= $(srcdir)/$(CPU)-elf2flt.ld
+-else
++else ifeq ($(strip $(CPU)),riscv64)
++SRC_LDFILE= riscv64-elf2flt.ld
++else
+ SRC_LDFILE= elf2flt.ld
+ endif
+
+diff --git a/elf2flt.c b/elf2flt.c
+index 67f720a..81c9456 100644
+--- a/elf2flt.c
++++ b/elf2flt.c
+@@ -80,6 +80,8 @@ const char *elf2flt_progname;
+ #include <elf/v850.h>
+ #elif defined(TARGET_xtensa)
+ #include <elf/xtensa.h>
++#elif defined(TARGET_riscv64)
++#include <elf/riscv.h>
+ #endif
+
+ #if defined(__MINGW32__)
+@@ -122,6 +124,8 @@ const char *elf2flt_progname;
+ #define ARCH "nios2"
+ #elif defined(TARGET_xtensa)
+ #define ARCH "xtensa"
++#elif defined(TARGET_riscv64)
++#define ARCH "riscv64"
+ #else
+ #error "Don't know how to support your CPU architecture??"
+ #endif
+@@ -507,7 +511,16 @@ output_relocs (
+ them. */
+ continue;
+ }
+-#endif /* USE_V850_RELOCS */
++#endif /* TARGET_v850 */
++
++#if defined(TARGET_riscv64)
++ switch ((*p)->howto->type) {
++ case R_RISCV_ADD32:
++ case R_RISCV_SUB32:
++ case R_RISCV_32_PCREL:
++ continue;
++ }
++#endif
+
+ q = *p;
+ if (q->sym_ptr_ptr && *q->sym_ptr_ptr) {
+diff --git a/riscv64-elf2flt.ld b/riscv64-elf2flt.ld
+new file mode 100644
+index 0000000..89ac2e8
+--- /dev/null
++++ b/riscv64-elf2flt.ld
+@@ -0,0 +1,222 @@
++
++ENTRY (_start)
++
++SECTIONS {
++
++ .text 0x0 : {
++ . = . + 4;
++ . = ALIGN(0x4) ;
++ _stext = . ;
++ *(.literal .text)
++ *(.literal.* .text.*)
++ *(.gnu.warning)
++ *(.stub)
++ *(.gnu.linkonce.literal.*)
++ *(.gnu.linkonce.t*)
++ *(.glue_7t)
++ *(.glue_7)
++ *(.jcr)
++ *(.init.literal)
++ KEEP (*(.init))
++ *(.fini.literal)
++ KEEP (*(.fini))
++
++W_RODAT *(.rodata)
++W_RODAT *(.rodata1)
++W_RODAT *(.rodata.*)
++W_RODAT *(.gnu.linkonce.r*)
++
++ /* .ARM.extab name sections containing exception unwinding information */
++ *(.ARM.extab* .gnu.linkonce.armextab.*)
++ /* This is special code area at the end of the normal
++ text section. It contains a small lookup table at
++ the start followed by the code pointed to by entries
++ in the lookup table. */
++ . = ALIGN (4) ;
++ PROVIDE(__ctbp = .);
++ *(.call_table_data)
++ *(.call_table_text)
++ }
++
++ /* .ARM.exidx name sections containing index entries for section unwinding */
++ /* .ARM.exidx is sorted, so has to go in its own output section. */
++ __exidx_start = .;
++ .ARM.exidx :
++ {
++ *(.ARM.exidx* .gnu.linkonce.armexidx.*)
++ }
++ __exidx_end = .;
++
++ . = ALIGN(0x20) ;
++ _etext = . ;
++
++ .data : {
++ . = ALIGN(0x4) ;
++ _sdata = . ;
++ __data_start = . ;
++ data_start = . ;
++ *(.got)
++ *(.igot)
++ *(.got.plt)
++ *(.igot.plt)
++ FILL(0) ;
++ . = ALIGN(0x20) ;
++ LONG(-1)
++ . = ALIGN(0x20) ;
++
++ __global_pointer$ = . + 0x800;
++
++ *(.data)
++ *(.data1)
++ *(.data.*)
++ *(.gnu.linkonce.d*)
++R_RODAT *(.rodata)
++R_RODAT *(.rodata1)
++R_RODAT *(.rodata.*)
++R_RODAT *(.gnu.linkonce.r*)
++
++ /* Microblaze has .sdata and .sbss (small bss). They must
++ be contiguous, so please don't move any of this. JW */
++ _ssrw = . ;
++ *(.srodata)
++ *(.srodata.*)
++ *(.sdata)
++ *(.sdata.*)
++ *(.sbss) /* Don't move this! */
++ *(.gnu.linkonce.sb*)
++ _essrw = . ;
++
++ _ssrw_size = _essrw - _ssrw;
++ PROVIDE(_SDA_BASE_ = _ssrw + (_ssrw_size / 2));
++
++ *(.gnu.linkonce.s.*)
++ *(__libc_atexit)
++ *(__libc_subinit)
++ *(__libc_subfreeres)
++
++ /* microblaze-specific read-only small data area
++ and associated locating symbols */
++ _ssro = . ;
++ *(.sdata2)
++ _essro = . ;
++ _ssro_size = _essro - _ssro;
++ PROVIDE(_SDA2_BASE_ = _ssro + (_ssro_size / 2));
++
++ . = ALIGN(4) ;
++TOR: __CTOR_LIST__ = .;
++TOR: LONG((__CTOR_END__ - __CTOR_LIST__) / 4 - 2)
++SINGLE_LINK: /* gcc uses crtbegin.o to find the start of
++SINGLE_LINK: the constructors, so we make sure it is
++SINGLE_LINK: first. Because this is a wildcard, it
++SINGLE_LINK: doesn't matter if the user does not
++SINGLE_LINK: actually link against crtbegin.o; the
++SINGLE_LINK: linker won't look for a file to match a
++SINGLE_LINK: wildcard. The wildcard also means that it
++SINGLE_LINK: doesn't matter which directory crtbegin.o
++SINGLE_LINK: is in. */
++SINGLE_LINK: KEEP (*crtbegin*.o(.ctors))
++SINGLE_LINK: /* We don't want to include the .ctor section from
++SINGLE_LINK: from the crtend.o file until after the sorted ctors.
++SINGLE_LINK: The .ctor section from the crtend file contains the
++SINGLE_LINK: end of ctors marker and it must be last */
++SINGLE_LINK: KEEP (*(EXCLUDE_FILE (*crtend*.o ) .ctors))
++SINGLE_LINK: KEEP (*(SORT(.ctors.*)))
++ KEEP (*(.ctors))
++TOR: LONG(0)
++TOR: __CTOR_END__ = .;
++TOR: __DTOR_LIST__ = .;
++TOR: LONG((__DTOR_END__ - __DTOR_LIST__) / 4 - 2)
++SINGLE_LINK: KEEP (*crtbegin*.o(.dtors))
++SINGLE_LINK: KEEP (*(EXCLUDE_FILE (*crtend*.o ) .dtors))
++SINGLE_LINK: KEEP (*(SORT(.dtors.*)))
++ KEEP (*(.dtors))
++TOR: LONG(0)
++TOR: __DTOR_END__ = .;
++
++ PROVIDE (__preinit_array_start = .);
++ KEEP (*(.preinit_array))
++ PROVIDE (__preinit_array_end = .);
++
++ PROVIDE (__init_array_start = .);
++ KEEP (*(SORT(.init_array.*)))
++ KEEP (*(.init_array))
++ PROVIDE (__init_array_end = .);
++
++ PROVIDE (__fini_array_start = .);
++ KEEP (*(.fini_array))
++ KEEP (*(SORT(.fini_array.*)))
++ PROVIDE (__fini_array_end = .);
++ }
++
++ .note.ABI-tag : { *(.note.ABI-tag) }
++ .eh_frame_hdr : { *(.eh_frame_hdr) }
++ .eh_frame : { KEEP(*(.eh_frame)) }
++ .gcc_except_table : {
++ KEEP(*(.gcc_except_table))
++ KEEP(*(.gcc_except_table.*))
++ }
++
++ . = ALIGN(0x10) ;
++ _edata = . ;
++
++ .bss : {
++ . = ALIGN(0x4) ;
++ _sbss = ALIGN(0x4) ;
++ __bss_start = . ;
++ *(.dynsbss)
++ *(.sbss)
++ *(.sbss.*)
++ *(.scommon)
++ *(.dynbss)
++ *(.bss)
++ *(.bss.*)
++ *(.bss*)
++ *(.gnu.linkonce.b*)
++ *(COMMON)
++ . = ALIGN(0x10) ;
++ _ebss = . ;
++ _end = . ;
++ end = . ;
++ }
++
++ .stack : {
++ . = ALIGN(0x4);
++ _stack_start = .;
++ }
++
++ .junk 0 : { *(.rel*) *(.rela*) }
++ /DISCARD/ : { *(.note.GNU-stack) }
++ /* Stabs debugging sections. */
++ .stab 0 : { *(.stab) }
++ .stabstr 0 : { *(.stabstr) }
++ .stab.excl 0 : { *(.stab.excl) }
++ .stab.exclstr 0 : { *(.stab.exclstr) }
++ .stab.index 0 : { *(.stab.index) }
++ .stab.indexstr 0 : { *(.stab.indexstr) }
++ .comment 0 : { *(.comment) }
++ /* DWARF debug sections.
++ Symbols in the DWARF debugging sections are relative to the beginning
++ of the section so we begin them at 0. */
++ /* DWARF 1 */
++ .debug 0 : { *(.debug) }
++ .line 0 : { *(.line) }
++ /* GNU DWARF 1 extensions */
++ .debug_srcinfo 0 : { *(.debug_srcinfo) }
++ .debug_sfnames 0 : { *(.debug_sfnames) }
++ /* DWARF 1.1 and DWARF 2 */
++ .debug_aranges 0 : { *(.debug_aranges) }
++ .debug_pubnames 0 : { *(.debug_pubnames) }
++ /* DWARF 2 */
++ .debug_info 0 : { *(.debug_info .gnu.linkonce.wi.*) }
++ .debug_abbrev 0 : { *(.debug_abbrev) }
++ .debug_line 0 : { *(.debug_line) }
++ .debug_frame 0 : { *(.debug_frame) }
++ .debug_str 0 : { *(.debug_str) }
++ .debug_loc 0 : { *(.debug_loc) }
++ .debug_macinfo 0 : { *(.debug_macinfo) }
++ /* SGI/MIPS DWARF 2 extensions */
++ .debug_weaknames 0 : { *(.debug_weaknames) }
++ .debug_funcnames 0 : { *(.debug_funcnames) }
++ .debug_typenames 0 : { *(.debug_typenames) }
++ .debug_varnames 0 : { *(.debug_varnames) }
++}
+--
+2.20.1
+
diff --git a/package/elf2flt/Config.in.host b/package/elf2flt/Config.in.host
index d6685a7ff6..2010526e04 100644
--- a/package/elf2flt/Config.in.host
+++ b/package/elf2flt/Config.in.host
@@ -1,6 +1,6 @@
config BR2_PACKAGE_HOST_ELF2FLT
bool "Enable elf2flt support?"
- depends on BR2_arm || BR2_sh || BR2_sparc || BR2_xtensa
+ depends on BR2_arm || BR2_sh || BR2_sparc || BR2_xtensa || BR2_riscv
depends on !BR2_USE_MMU
help
uCLinux uses a Binary Flat format commonly known as BFLT. It
--
2.26.2
^ permalink raw reply related [flat|nested] 15+ messages in thread
* [Buildroot] [PATCH 4/5] package make: build nommu builds as linux
2020-09-08 5:16 [Buildroot] [PATCH 0/5] Add support for Kendryte K210 RISC-V boards Damien Le Moal
` (2 preceding siblings ...)
2020-09-08 5:16 ` [Buildroot] [PATCH 3/5] package/elf2flt: add RISC-V support Damien Le Moal
@ 2020-09-08 5:16 ` Damien Le Moal
2020-09-08 5:16 ` [Buildroot] [PATCH 5/5] Add support for Kendryte K210 based RISC-V boards Damien Le Moal
4 siblings, 0 replies; 15+ messages in thread
From: Damien Le Moal @ 2020-09-08 5:16 UTC (permalink / raw)
To: buildroot
From: Christoph Hellwig <hch@lst.de>
Using *-uclinux-* seems like an only partially followed convention.
And at least for RISC-V gcc doesn't know about uclinux tuples, so
switch back to the normal Linux one for now.
Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Damien Le Moal <damien.lemoal@wdc.com>
---
package/Makefile.in | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/package/Makefile.in b/package/Makefile.in
index 51f5cbce4f..dd04124b1b 100644
--- a/package/Makefile.in
+++ b/package/Makefile.in
@@ -41,7 +41,7 @@ GNU_TARGET_NAME = $(ARCH)-$(TARGET_VENDOR)-$(TARGET_OS)-$(LIBC)$(ABI)
# FLAT binary format needs uclinux
ifeq ($(BR2_BINFMT_FLAT),y)
-TARGET_OS = uclinux
+TARGET_OS = linux
else
TARGET_OS = linux
endif
--
2.26.2
^ permalink raw reply related [flat|nested] 15+ messages in thread
* [Buildroot] [PATCH 5/5] Add support for Kendryte K210 based RISC-V boards
2020-09-08 5:16 [Buildroot] [PATCH 0/5] Add support for Kendryte K210 RISC-V boards Damien Le Moal
` (3 preceding siblings ...)
2020-09-08 5:16 ` [Buildroot] [PATCH 4/5] package make: build nommu builds as linux Damien Le Moal
@ 2020-09-08 5:16 ` Damien Le Moal
2020-09-08 7:17 ` Thomas Petazzoni
4 siblings, 1 reply; 15+ messages in thread
From: Damien Le Moal @ 2020-09-08 5:16 UTC (permalink / raw)
To: buildroot
Add support for RISC-V boards based on the Kendryte K210 dual-core SoC.
This SoC has very little memory (8MB of SRAM) and no supported MMU. To
support it, provide the following configs:
- uClibc no MMU static build configuration for flat binary format. Some
patches are added to avoid compilation errors also present in upstream
uClibc.
- A minimal busybox config resulting in a tiny rootfs image using
initramfs/cpio format that is directly embedded in the kernel.
The kernel configuration used is the default nommu_k210 defconfig
present in the kernel since version 5.8. The kernel also provides the
device tree.
To avoid "no memory" errors when using the default busybox
initialization scripts and init process, an simple init script is
provided as a rootfs overlay. A fakeroot.sh script is also added to
allow simplification to the default rootfs structure and doing so,
saving some memory.
Signed-off-by: Damien Le Moal <damien.lemoal@wdc.com>
---
board/kendryte/k210/busybox.config | 1181 +++++++++++++++++
board/kendryte/k210/device_table_dev.txt | 17 +
board/kendryte/k210/fakeroot.sh | 8 +
...evert-Fix-static-linking-with-GCC-10.patch | 43 +
...0002-fix-static-builds-with-gcc-10.x.patch | 25 +
...-utils-getconf-Fix-compilation-error.patch | 103 ++
.../0004-librt-avoid-compilation-error.patch | 42 +
board/kendryte/k210/rootfs_overlay/init | 11 +
board/kendryte/k210/uClibc-ng.config | 209 +++
configs/kendryte_k210_defconfig | 36 +
10 files changed, 1675 insertions(+)
create mode 100644 board/kendryte/k210/busybox.config
create mode 100644 board/kendryte/k210/device_table_dev.txt
create mode 100755 board/kendryte/k210/fakeroot.sh
create mode 100644 board/kendryte/k210/patches/uclibc/0001-Revert-Fix-static-linking-with-GCC-10.patch
create mode 100644 board/kendryte/k210/patches/uclibc/0002-fix-static-builds-with-gcc-10.x.patch
create mode 100644 board/kendryte/k210/patches/uclibc/0003-utils-getconf-Fix-compilation-error.patch
create mode 100644 board/kendryte/k210/patches/uclibc/0004-librt-avoid-compilation-error.patch
create mode 100755 board/kendryte/k210/rootfs_overlay/init
create mode 100644 board/kendryte/k210/uClibc-ng.config
create mode 100644 configs/kendryte_k210_defconfig
diff --git a/board/kendryte/k210/busybox.config b/board/kendryte/k210/busybox.config
new file mode 100644
index 0000000000..5dd5496ba5
--- /dev/null
+++ b/board/kendryte/k210/busybox.config
@@ -0,0 +1,1181 @@
+#
+# Automatically generated make config: don't edit
+# Busybox version: 1.33.0.git
+# Tue Sep 8 09:22:07 2020
+#
+CONFIG_HAVE_DOT_CONFIG=y
+
+#
+# Settings
+#
+# CONFIG_DESKTOP is not set
+# CONFIG_EXTRA_COMPAT is not set
+# CONFIG_FEDORA_COMPAT is not set
+# CONFIG_INCLUDE_SUSv2 is not set
+# CONFIG_LONG_OPTS is not set
+# CONFIG_SHOW_USAGE is not set
+# CONFIG_FEATURE_VERBOSE_USAGE is not set
+# CONFIG_FEATURE_COMPRESS_USAGE is not set
+CONFIG_LFS=y
+# CONFIG_PAM is not set
+CONFIG_FEATURE_DEVPTS=y
+CONFIG_FEATURE_UTMP=y
+CONFIG_FEATURE_WTMP=y
+# CONFIG_FEATURE_PIDFILE is not set
+CONFIG_PID_FILE_PATH=""
+CONFIG_BUSYBOX=y
+CONFIG_FEATURE_SHOW_SCRIPT=y
+CONFIG_FEATURE_INSTALLER=y
+# CONFIG_INSTALL_NO_USR is not set
+CONFIG_FEATURE_SUID=y
+# CONFIG_FEATURE_SUID_CONFIG is not set
+# CONFIG_FEATURE_SUID_CONFIG_QUIET is not set
+CONFIG_FEATURE_PREFER_APPLETS=y
+CONFIG_BUSYBOX_EXEC_PATH=""
+# CONFIG_SELINUX is not set
+# CONFIG_FEATURE_CLEAN_UP is not set
+# CONFIG_FEATURE_SYSLOG_INFO is not set
+# CONFIG_FEATURE_SYSLOG is not set
+
+#
+# Build Options
+#
+CONFIG_STATIC=y
+# CONFIG_PIE is not set
+CONFIG_NOMMU=y
+# CONFIG_BUILD_LIBBUSYBOX is not set
+# CONFIG_FEATURE_LIBBUSYBOX_STATIC is not set
+# CONFIG_FEATURE_INDIVIDUAL is not set
+# CONFIG_FEATURE_SHARED_BUSYBOX is not set
+CONFIG_CROSS_COMPILER_PREFIX=""
+CONFIG_SYSROOT=""
+CONFIG_EXTRA_CFLAGS="-Os -fPIC"
+CONFIG_EXTRA_LDFLAGS="-Os -static -Wl,-elf2flt=-r"
+CONFIG_EXTRA_LDLIBS=""
+# CONFIG_USE_PORTABLE_CODE is not set
+# CONFIG_STACK_OPTIMIZATION_386 is not set
+
+#
+# Installation Options ("make install" behavior)
+#
+CONFIG_INSTALL_APPLET_SYMLINKS=y
+# CONFIG_INSTALL_APPLET_HARDLINKS is not set
+# CONFIG_INSTALL_APPLET_SCRIPT_WRAPPERS is not set
+# CONFIG_INSTALL_APPLET_DONT is not set
+# CONFIG_INSTALL_SH_APPLET_SYMLINK is not set
+# CONFIG_INSTALL_SH_APPLET_HARDLINK is not set
+# CONFIG_INSTALL_SH_APPLET_SCRIPT_WRAPPER is not set
+CONFIG_PREFIX="./_install"
+
+#
+# Debugging Options
+#
+# CONFIG_DEBUG is not set
+# CONFIG_DEBUG_PESSIMIZE is not set
+# CONFIG_DEBUG_SANITIZE is not set
+# CONFIG_UNIT_TEST is not set
+# CONFIG_WERROR is not set
+# CONFIG_WARN_SIMPLE_MSG is not set
+CONFIG_NO_DEBUG_LIB=y
+# CONFIG_DMALLOC is not set
+# CONFIG_EFENCE is not set
+
+#
+# Library Tuning
+#
+# CONFIG_FEATURE_USE_BSS_TAIL is not set
+# CONFIG_FLOAT_DURATION is not set
+# 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_BUFFERS_GO_IN_BSS is not set
+CONFIG_PASSWORD_MINLEN=6
+CONFIG_MD5_SMALL=1
+CONFIG_SHA3_SMALL=1
+CONFIG_FEATURE_FAST_TOP=y
+# CONFIG_FEATURE_ETC_NETWORKS is not set
+# CONFIG_FEATURE_ETC_SERVICES is not set
+CONFIG_FEATURE_EDITING=y
+CONFIG_FEATURE_EDITING_MAX_LEN=1024
+CONFIG_FEATURE_EDITING_VI=y
+CONFIG_FEATURE_EDITING_HISTORY=999
+# CONFIG_FEATURE_EDITING_SAVEHISTORY is not set
+# CONFIG_FEATURE_EDITING_SAVE_ON_EXIT is not set
+# CONFIG_FEATURE_REVERSE_SEARCH is not set
+# CONFIG_FEATURE_TAB_COMPLETION is not set
+# CONFIG_FEATURE_USERNAME_COMPLETION is not set
+CONFIG_FEATURE_EDITING_FANCY_PROMPT=y
+# CONFIG_FEATURE_EDITING_WINCH is not set
+# CONFIG_FEATURE_EDITING_ASK_TERMINAL is not set
+# CONFIG_LOCALE_SUPPORT is not set
+# CONFIG_UNICODE_SUPPORT is not set
+# CONFIG_UNICODE_USING_LOCALE is not set
+# CONFIG_FEATURE_CHECK_UNICODE_IN_ENV is not set
+CONFIG_SUBST_WCHAR=0
+CONFIG_LAST_SUPPORTED_WCHAR=0
+# CONFIG_UNICODE_COMBINING_WCHARS is not set
+# CONFIG_UNICODE_WIDE_WCHARS is not set
+# CONFIG_UNICODE_BIDI_SUPPORT is not set
+# CONFIG_UNICODE_NEUTRAL_TABLE is not set
+# CONFIG_UNICODE_PRESERVE_BROKEN is not set
+CONFIG_FEATURE_NON_POSIX_CP=y
+# CONFIG_FEATURE_VERBOSE_CP_MESSAGE is not set
+CONFIG_FEATURE_USE_SENDFILE=y
+CONFIG_FEATURE_COPYBUF_KB=4
+CONFIG_FEATURE_SKIP_ROOTFS=y
+CONFIG_MONOTONIC_SYSCALL=y
+CONFIG_IOCTL_HEX2STR_ERROR=y
+# CONFIG_FEATURE_HWIB is not set
+
+#
+# Applets
+#
+
+#
+# Archival Utilities
+#
+# CONFIG_FEATURE_SEAMLESS_XZ is not set
+# CONFIG_FEATURE_SEAMLESS_LZMA is not set
+# CONFIG_FEATURE_SEAMLESS_BZ2 is not set
+# CONFIG_FEATURE_SEAMLESS_GZ is not set
+# CONFIG_FEATURE_SEAMLESS_Z is not set
+# CONFIG_AR is not set
+# CONFIG_FEATURE_AR_LONG_FILENAMES is not set
+# CONFIG_FEATURE_AR_CREATE is not set
+# CONFIG_UNCOMPRESS is not set
+# CONFIG_GUNZIP is not set
+# CONFIG_ZCAT is not set
+# CONFIG_FEATURE_GUNZIP_LONG_OPTIONS is not set
+# CONFIG_BUNZIP2 is not set
+# CONFIG_BZCAT is not set
+# CONFIG_UNLZMA is not set
+# CONFIG_LZCAT is not set
+# CONFIG_LZMA is not set
+# CONFIG_UNXZ is not set
+# CONFIG_XZCAT is not set
+# CONFIG_XZ is not set
+# CONFIG_BZIP2 is not set
+CONFIG_BZIP2_SMALL=0
+# CONFIG_FEATURE_BZIP2_DECOMPRESS is not set
+# CONFIG_CPIO is not set
+# CONFIG_FEATURE_CPIO_O is not set
+# CONFIG_FEATURE_CPIO_P is not set
+# CONFIG_DPKG is not set
+# CONFIG_DPKG_DEB is not set
+# CONFIG_GZIP is not set
+# CONFIG_FEATURE_GZIP_LONG_OPTIONS is not set
+CONFIG_GZIP_FAST=0
+# CONFIG_FEATURE_GZIP_LEVELS is not set
+# CONFIG_FEATURE_GZIP_DECOMPRESS is not set
+# CONFIG_LZOP is not set
+# CONFIG_UNLZOP is not set
+# CONFIG_LZOPCAT is not set
+# CONFIG_LZOP_COMPR_HIGH is not set
+# CONFIG_RPM is not set
+# CONFIG_RPM2CPIO is not set
+# CONFIG_TAR is not set
+# CONFIG_FEATURE_TAR_LONG_OPTIONS is not set
+# CONFIG_FEATURE_TAR_CREATE is not set
+# CONFIG_FEATURE_TAR_AUTODETECT is not set
+# CONFIG_FEATURE_TAR_FROM is not set
+# CONFIG_FEATURE_TAR_OLDGNU_COMPATIBILITY is not set
+# CONFIG_FEATURE_TAR_OLDSUN_COMPATIBILITY is not set
+# CONFIG_FEATURE_TAR_GNU_EXTENSIONS is not set
+# CONFIG_FEATURE_TAR_TO_COMMAND is not set
+# CONFIG_FEATURE_TAR_UNAME_GNAME is not set
+# CONFIG_FEATURE_TAR_NOPRESERVE_TIME is not set
+# CONFIG_FEATURE_TAR_SELINUX is not set
+# CONFIG_UNZIP is not set
+# CONFIG_FEATURE_UNZIP_CDF is not set
+# CONFIG_FEATURE_UNZIP_BZIP2 is not set
+# CONFIG_FEATURE_UNZIP_LZMA is not set
+# CONFIG_FEATURE_UNZIP_XZ is not set
+# CONFIG_FEATURE_LZMA_FAST is not set
+
+#
+# Coreutils
+#
+CONFIG_BASENAME=y
+CONFIG_CAT=y
+CONFIG_FEATURE_CATN=y
+CONFIG_FEATURE_CATV=y
+CONFIG_CHGRP=y
+CONFIG_CHMOD=y
+CONFIG_CHOWN=y
+# CONFIG_FEATURE_CHOWN_LONG_OPTIONS is not set
+CONFIG_CHROOT=y
+# CONFIG_CKSUM is not set
+# CONFIG_COMM is not set
+CONFIG_CP=y
+# CONFIG_FEATURE_CP_LONG_OPTIONS is not set
+# CONFIG_FEATURE_CP_REFLINK is not set
+# CONFIG_CUT is not set
+CONFIG_DATE=y
+CONFIG_FEATURE_DATE_ISOFMT=y
+# CONFIG_FEATURE_DATE_NANO is not set
+CONFIG_FEATURE_DATE_COMPAT=y
+# CONFIG_DD is not set
+# CONFIG_FEATURE_DD_SIGNAL_HANDLING is not set
+# CONFIG_FEATURE_DD_THIRD_STATUS_LINE is not set
+# CONFIG_FEATURE_DD_IBS_OBS is not set
+# CONFIG_FEATURE_DD_STATUS is not set
+# CONFIG_DF is not set
+# CONFIG_FEATURE_DF_FANCY is not set
+CONFIG_DIRNAME=y
+# CONFIG_DOS2UNIX is not set
+# CONFIG_UNIX2DOS is not set
+# CONFIG_DU is not set
+# CONFIG_FEATURE_DU_DEFAULT_BLOCKSIZE_1K is not set
+CONFIG_ECHO=y
+CONFIG_FEATURE_FANCY_ECHO=y
+CONFIG_ENV=y
+# CONFIG_EXPAND is not set
+# CONFIG_UNEXPAND is not set
+CONFIG_EXPR=y
+CONFIG_EXPR_MATH_SUPPORT_64=y
+# CONFIG_FACTOR is not set
+CONFIG_FALSE=y
+# CONFIG_FOLD is not set
+CONFIG_HEAD=y
+CONFIG_FEATURE_FANCY_HEAD=y
+CONFIG_HOSTID=y
+CONFIG_ID=y
+# CONFIG_GROUPS is not set
+# CONFIG_INSTALL is not set
+# CONFIG_FEATURE_INSTALL_LONG_OPTIONS is not set
+CONFIG_LINK=y
+CONFIG_LN=y
+# CONFIG_LOGNAME is not set
+CONFIG_LS=y
+CONFIG_FEATURE_LS_FILETYPES=y
+CONFIG_FEATURE_LS_FOLLOWLINKS=y
+CONFIG_FEATURE_LS_RECURSIVE=y
+CONFIG_FEATURE_LS_WIDTH=y
+CONFIG_FEATURE_LS_SORTFILES=y
+CONFIG_FEATURE_LS_TIMESTAMPS=y
+CONFIG_FEATURE_LS_USERNAME=y
+# CONFIG_FEATURE_LS_COLOR is not set
+# CONFIG_FEATURE_LS_COLOR_IS_DEFAULT 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_FEATURE_MD5_SHA1_SUM_CHECK is not set
+CONFIG_MKDIR=y
+# CONFIG_MKFIFO is not set
+CONFIG_MKNOD=y
+# CONFIG_MKTEMP is not set
+CONFIG_MV=y
+# CONFIG_NICE is not set
+# CONFIG_NL is not set
+# CONFIG_NOHUP is not set
+# CONFIG_NPROC is not set
+# CONFIG_OD is not set
+# CONFIG_PASTE is not set
+CONFIG_PRINTENV=y
+CONFIG_PRINTF=y
+CONFIG_PWD=y
+CONFIG_READLINK=y
+CONFIG_FEATURE_READLINK_FOLLOW=y
+CONFIG_REALPATH=y
+CONFIG_RM=y
+CONFIG_RMDIR=y
+CONFIG_SEQ=y
+# CONFIG_SHRED is not set
+# CONFIG_SHUF is not set
+CONFIG_SLEEP=y
+CONFIG_FEATURE_FANCY_SLEEP=y
+# CONFIG_SORT is not set
+# CONFIG_FEATURE_SORT_BIG is not set
+# CONFIG_FEATURE_SORT_OPTIMIZE_MEMORY is not set
+# CONFIG_SPLIT is not set
+# CONFIG_FEATURE_SPLIT_FANCY is not set
+# CONFIG_STAT is not set
+# CONFIG_FEATURE_STAT_FORMAT is not set
+# CONFIG_FEATURE_STAT_FILESYSTEM is not set
+CONFIG_STTY=y
+# CONFIG_SUM is not set
+# CONFIG_SYNC is not set
+# CONFIG_FEATURE_SYNC_FANCY is not set
+# CONFIG_FSYNC is not set
+# CONFIG_TAC is not set
+CONFIG_TAIL=y
+CONFIG_FEATURE_FANCY_TAIL=y
+CONFIG_TEE=y
+CONFIG_FEATURE_TEE_USE_BLOCK_IO=y
+CONFIG_TEST=y
+CONFIG_TEST1=y
+CONFIG_TEST2=y
+CONFIG_FEATURE_TEST_64=y
+# CONFIG_TIMEOUT is not set
+CONFIG_TOUCH=y
+# CONFIG_FEATURE_TOUCH_NODEREF is not set
+CONFIG_FEATURE_TOUCH_SUSV3=y
+# CONFIG_TR is not set
+# CONFIG_FEATURE_TR_CLASSES is not set
+# CONFIG_FEATURE_TR_EQUIV is not set
+CONFIG_TRUE=y
+# CONFIG_TRUNCATE is not set
+CONFIG_TTY=y
+CONFIG_UNAME=y
+CONFIG_UNAME_OSNAME="GNU/Linux"
+CONFIG_BB_ARCH=y
+CONFIG_UNIQ=y
+CONFIG_UNLINK=y
+CONFIG_USLEEP=y
+# CONFIG_UUDECODE is not set
+# CONFIG_BASE64 is not set
+# CONFIG_UUENCODE is not set
+CONFIG_WC=y
+# CONFIG_FEATURE_WC_LARGE is not set
+# CONFIG_WHOAMI is not set
+CONFIG_WHO=y
+CONFIG_W=y
+CONFIG_USERS=y
+CONFIG_YES=y
+
+#
+# Common options
+#
+CONFIG_FEATURE_VERBOSE=y
+
+#
+# Common options for cp and mv
+#
+CONFIG_FEATURE_PRESERVE_HARDLINKS=y
+
+#
+# Common options for df, du, ls
+#
+CONFIG_FEATURE_HUMAN_READABLE=y
+
+#
+# Console Utilities
+#
+# CONFIG_CHVT is not set
+CONFIG_CLEAR=y
+# CONFIG_DEALLOCVT is not set
+# CONFIG_DUMPKMAP is not set
+# CONFIG_FGCONSOLE is not set
+# CONFIG_KBD_MODE is not set
+# CONFIG_LOADFONT is not set
+# CONFIG_SETFONT is not set
+# CONFIG_FEATURE_SETFONT_TEXTUAL_MAP is not set
+CONFIG_DEFAULT_SETFONT_DIR=""
+# CONFIG_FEATURE_LOADFONT_PSF2 is not set
+# CONFIG_FEATURE_LOADFONT_RAW is not set
+# CONFIG_LOADKMAP is not set
+# CONFIG_OPENVT is not set
+# CONFIG_RESET is not set
+# CONFIG_RESIZE is not set
+# CONFIG_FEATURE_RESIZE_PRINT is not set
+# CONFIG_SETCONSOLE is not set
+# CONFIG_FEATURE_SETCONSOLE_LONG_OPTIONS is not set
+# CONFIG_SETKEYCODES is not set
+# CONFIG_SETLOGCONS is not set
+# CONFIG_SHOWKEY is not set
+
+#
+# Debian Utilities
+#
+# CONFIG_PIPE_PROGRESS is not set
+# 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_MINIPS is not set
+# CONFIG_NUKE is not set
+# CONFIG_RESUME is not set
+# CONFIG_RUN_INIT is not set
+
+#
+# Editors
+#
+# CONFIG_AWK is not set
+# CONFIG_FEATURE_AWK_LIBM is not set
+# CONFIG_FEATURE_AWK_GNU_EXTENSIONS is not set
+# CONFIG_CMP is not set
+# CONFIG_DIFF is not set
+# CONFIG_FEATURE_DIFF_LONG_OPTIONS is not set
+# CONFIG_FEATURE_DIFF_DIR is not set
+# CONFIG_ED is not set
+# CONFIG_PATCH is not set
+# CONFIG_SED is not set
+CONFIG_VI=y
+CONFIG_FEATURE_VI_MAX_LEN=4096
+# CONFIG_FEATURE_VI_8BIT is not set
+CONFIG_FEATURE_VI_COLON=y
+CONFIG_FEATURE_VI_YANKMARK=y
+CONFIG_FEATURE_VI_SEARCH=y
+# CONFIG_FEATURE_VI_REGEX_SEARCH is not set
+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
+CONFIG_FEATURE_VI_UNDO_QUEUE=y
+CONFIG_FEATURE_VI_UNDO_QUEUE_MAX=256
+CONFIG_FEATURE_ALLOW_EXEC=y
+
+#
+# Finding Utilities
+#
+# CONFIG_FIND is not set
+# CONFIG_FEATURE_FIND_PRINT0 is not set
+# CONFIG_FEATURE_FIND_MTIME is not set
+# CONFIG_FEATURE_FIND_MMIN is not set
+# CONFIG_FEATURE_FIND_PERM is not set
+# CONFIG_FEATURE_FIND_TYPE is not set
+# CONFIG_FEATURE_FIND_EXECUTABLE is not set
+# CONFIG_FEATURE_FIND_XDEV is not set
+# CONFIG_FEATURE_FIND_MAXDEPTH is not set
+# CONFIG_FEATURE_FIND_NEWER is not set
+# CONFIG_FEATURE_FIND_INUM is not set
+# CONFIG_FEATURE_FIND_EXEC is not set
+# CONFIG_FEATURE_FIND_EXEC_PLUS is not set
+# CONFIG_FEATURE_FIND_USER is not set
+# CONFIG_FEATURE_FIND_GROUP is not set
+# CONFIG_FEATURE_FIND_NOT is not set
+# CONFIG_FEATURE_FIND_DEPTH is not set
+# CONFIG_FEATURE_FIND_PAREN is not set
+# CONFIG_FEATURE_FIND_SIZE is not set
+# CONFIG_FEATURE_FIND_PRUNE is not set
+# CONFIG_FEATURE_FIND_QUIT is not set
+# CONFIG_FEATURE_FIND_DELETE is not set
+# CONFIG_FEATURE_FIND_EMPTY is not set
+# CONFIG_FEATURE_FIND_PATH is not set
+# CONFIG_FEATURE_FIND_REGEX is not set
+# CONFIG_FEATURE_FIND_CONTEXT is not set
+# CONFIG_FEATURE_FIND_LINKS is not set
+# CONFIG_GREP is not set
+# CONFIG_EGREP is not set
+# CONFIG_FGREP is not set
+# CONFIG_FEATURE_GREP_CONTEXT is not set
+# CONFIG_XARGS is not set
+# CONFIG_FEATURE_XARGS_SUPPORT_CONFIRMATION is not set
+# CONFIG_FEATURE_XARGS_SUPPORT_QUOTES is not set
+# CONFIG_FEATURE_XARGS_SUPPORT_TERMOPT is not set
+# CONFIG_FEATURE_XARGS_SUPPORT_ZERO_TERM is not set
+# CONFIG_FEATURE_XARGS_SUPPORT_REPL_STR is not set
+# CONFIG_FEATURE_XARGS_SUPPORT_PARALLEL is not set
+# CONFIG_FEATURE_XARGS_SUPPORT_ARGS_FILE is not set
+
+#
+# Init Utilities
+#
+# CONFIG_BOOTCHARTD is not set
+# CONFIG_FEATURE_BOOTCHARTD_BLOATED_HEADER is not set
+# CONFIG_FEATURE_BOOTCHARTD_CONFIG_FILE is not set
+# CONFIG_HALT is not set
+# CONFIG_POWEROFF is not set
+CONFIG_REBOOT=y
+CONFIG_FEATURE_WAIT_FOR_INIT=y
+# CONFIG_FEATURE_CALL_TELINIT is not set
+CONFIG_TELINIT_PATH=""
+# CONFIG_INIT is not set
+# CONFIG_LINUXRC is not set
+# CONFIG_FEATURE_USE_INITTAB is not set
+# CONFIG_FEATURE_KILL_REMOVED is not set
+CONFIG_FEATURE_KILL_DELAY=0
+# CONFIG_FEATURE_INIT_SCTTY is not set
+# CONFIG_FEATURE_INIT_SYSLOG is not set
+# CONFIG_FEATURE_INIT_QUIET is not set
+# CONFIG_FEATURE_INIT_COREDUMPS is not set
+CONFIG_INIT_TERMINAL_TYPE=""
+# CONFIG_FEATURE_INIT_MODIFY_CMDLINE is not set
+
+#
+# Login/Password Management Utilities
+#
+# CONFIG_FEATURE_SHADOWPASSWDS is not set
+# CONFIG_USE_BB_PWD_GRP is not set
+# CONFIG_USE_BB_SHADOW is not set
+# CONFIG_USE_BB_CRYPT is not set
+# CONFIG_USE_BB_CRYPT_SHA is not set
+# CONFIG_ADDGROUP is not set
+# CONFIG_FEATURE_ADDUSER_TO_GROUP is not set
+# CONFIG_ADD_SHELL is not set
+# CONFIG_REMOVE_SHELL is not set
+# CONFIG_ADDUSER is not set
+# CONFIG_FEATURE_CHECK_NAMES is not set
+CONFIG_LAST_ID=0
+CONFIG_FIRST_SYSTEM_ID=0
+CONFIG_LAST_SYSTEM_ID=0
+# CONFIG_CHPASSWD is not set
+CONFIG_FEATURE_DEFAULT_PASSWD_ALGO=""
+# CONFIG_CRYPTPW is not set
+# CONFIG_MKPASSWD is not set
+# CONFIG_DELUSER is not set
+# CONFIG_DELGROUP is not set
+# CONFIG_FEATURE_DEL_USER_FROM_GROUP is not set
+# CONFIG_GETTY is not set
+# CONFIG_LOGIN is not set
+# CONFIG_LOGIN_SESSION_AS_CHILD is not set
+# CONFIG_LOGIN_SCRIPTS is not set
+# CONFIG_FEATURE_NOLOGIN is not set
+# CONFIG_FEATURE_SECURETTY is not set
+# CONFIG_PASSWD is not set
+# CONFIG_FEATURE_PASSWD_WEAK_CHECK is not set
+# CONFIG_SU is not set
+# CONFIG_FEATURE_SU_SYSLOG is not set
+# CONFIG_FEATURE_SU_CHECKS_SHELLS is not set
+# CONFIG_FEATURE_SU_BLANK_PW_NEEDS_SECURE_TTY is not set
+# CONFIG_SULOGIN is not set
+# CONFIG_VLOCK is not set
+
+#
+# Linux Ext2 FS Progs
+#
+# CONFIG_CHATTR is not set
+# CONFIG_FSCK is not set
+# CONFIG_LSATTR is not set
+# CONFIG_TUNE2FS is not set
+
+#
+# Linux Module Utilities
+#
+# CONFIG_MODPROBE_SMALL is not set
+# CONFIG_DEPMOD is not set
+# CONFIG_INSMOD is not set
+# CONFIG_LSMOD is not set
+# CONFIG_FEATURE_LSMOD_PRETTY_2_6_OUTPUT is not set
+# CONFIG_MODINFO is not set
+# CONFIG_MODPROBE is not set
+# CONFIG_FEATURE_MODPROBE_BLACKLIST is not set
+# CONFIG_RMMOD is not set
+
+#
+# Options common to multiple modutils
+#
+# CONFIG_FEATURE_CMDLINE_MODULE_OPTIONS is not set
+# CONFIG_FEATURE_MODPROBE_SMALL_CHECK_ALREADY_LOADED is not set
+# CONFIG_FEATURE_2_4_MODULES is not set
+# CONFIG_FEATURE_INSMOD_VERSION_CHECKING is not set
+# CONFIG_FEATURE_INSMOD_KSYMOOPS_SYMBOLS is not set
+# CONFIG_FEATURE_INSMOD_LOADINKMEM is not set
+# CONFIG_FEATURE_INSMOD_LOAD_MAP is not set
+# CONFIG_FEATURE_INSMOD_LOAD_MAP_FULL is not set
+# CONFIG_FEATURE_CHECK_TAINTED_MODULE is not set
+# CONFIG_FEATURE_INSMOD_TRY_MMAP is not set
+# CONFIG_FEATURE_MODUTILS_ALIAS is not set
+# CONFIG_FEATURE_MODUTILS_SYMBOLS is not set
+CONFIG_DEFAULT_MODULES_DIR=""
+CONFIG_DEFAULT_DEPMOD_FILE=""
+
+#
+# Linux System Utilities
+#
+# CONFIG_ACPID is not set
+# CONFIG_FEATURE_ACPID_COMPAT is not set
+# CONFIG_BLKDISCARD is not set
+# CONFIG_BLKID is not set
+# CONFIG_FEATURE_BLKID_TYPE is not set
+# CONFIG_BLOCKDEV is not set
+# CONFIG_CAL is not set
+# CONFIG_CHRT is not set
+CONFIG_DMESG=y
+# CONFIG_FEATURE_DMESG_PRETTY is not set
+# CONFIG_EJECT is not set
+# CONFIG_FEATURE_EJECT_SCSI is not set
+# CONFIG_FALLOCATE is not set
+# CONFIG_FATATTR is not set
+# CONFIG_FBSET is not set
+# CONFIG_FEATURE_FBSET_FANCY is not set
+# CONFIG_FEATURE_FBSET_READMODE is not set
+# CONFIG_FDFORMAT is not set
+# CONFIG_FDISK is not set
+# CONFIG_FDISK_SUPPORT_LARGE_DISKS is not set
+# CONFIG_FEATURE_FDISK_WRITABLE is not set
+# CONFIG_FEATURE_AIX_LABEL is not set
+# CONFIG_FEATURE_SGI_LABEL is not set
+# CONFIG_FEATURE_SUN_LABEL is not set
+# CONFIG_FEATURE_OSF_LABEL is not set
+# CONFIG_FEATURE_GPT_LABEL is not set
+# CONFIG_FEATURE_FDISK_ADVANCED is not set
+# CONFIG_FINDFS is not set
+# CONFIG_FLOCK is not set
+# CONFIG_FDFLUSH is not set
+# CONFIG_FREERAMDISK is not set
+# CONFIG_FSCK_MINIX is not set
+# CONFIG_FSFREEZE is not set
+# CONFIG_FSTRIM is not set
+# CONFIG_GETOPT is not set
+# CONFIG_FEATURE_GETOPT_LONG is not set
+# CONFIG_HEXDUMP is not set
+# CONFIG_FEATURE_HEXDUMP_REVERSE is not set
+# CONFIG_HD is not set
+# CONFIG_XXD is not set
+# CONFIG_HWCLOCK is not set
+# CONFIG_FEATURE_HWCLOCK_ADJTIME_FHS is not set
+# CONFIG_IONICE is not set
+# CONFIG_IPCRM is not set
+# CONFIG_IPCS is not set
+# CONFIG_LAST is not set
+# CONFIG_FEATURE_LAST_FANCY is not set
+# CONFIG_LOSETUP is not set
+# CONFIG_LSPCI is not set
+# CONFIG_LSUSB is not set
+# CONFIG_MDEV is not set
+# CONFIG_FEATURE_MDEV_CONF is not set
+# CONFIG_FEATURE_MDEV_RENAME is not set
+# CONFIG_FEATURE_MDEV_RENAME_REGEXP is not set
+# CONFIG_FEATURE_MDEV_EXEC is not set
+# CONFIG_FEATURE_MDEV_LOAD_FIRMWARE is not set
+# CONFIG_FEATURE_MDEV_DAEMON is not set
+# CONFIG_MESG is not set
+# CONFIG_FEATURE_MESG_ENABLE_ONLY_GROUP is not set
+# CONFIG_MKE2FS is not set
+# CONFIG_MKFS_EXT2 is not set
+# CONFIG_MKFS_MINIX is not set
+# CONFIG_FEATURE_MINIX2 is not set
+# CONFIG_MKFS_REISER is not set
+# CONFIG_MKDOSFS is not set
+# CONFIG_MKFS_VFAT is not set
+# CONFIG_MKSWAP is not set
+# CONFIG_FEATURE_MKSWAP_UUID is not set
+CONFIG_MORE=y
+CONFIG_MOUNT=y
+# CONFIG_FEATURE_MOUNT_FAKE is not set
+# CONFIG_FEATURE_MOUNT_VERBOSE is not set
+# CONFIG_FEATURE_MOUNT_HELPERS is not set
+# CONFIG_FEATURE_MOUNT_LABEL is not set
+# CONFIG_FEATURE_MOUNT_NFS is not set
+# CONFIG_FEATURE_MOUNT_CIFS is not set
+# CONFIG_FEATURE_MOUNT_FLAGS is not set
+# CONFIG_FEATURE_MOUNT_FSTAB is not set
+# CONFIG_FEATURE_MOUNT_OTHERTAB is not set
+# CONFIG_MOUNTPOINT is not set
+# CONFIG_NOLOGIN is not set
+# CONFIG_NOLOGIN_DEPENDENCIES is not set
+# CONFIG_NSENTER is not set
+# CONFIG_PIVOT_ROOT is not set
+# CONFIG_RDATE is not set
+# CONFIG_RDEV is not set
+# CONFIG_READPROFILE is not set
+# CONFIG_RENICE is not set
+# CONFIG_REV is not set
+# CONFIG_RTCWAKE is not set
+# CONFIG_SCRIPT is not set
+# CONFIG_SCRIPTREPLAY is not set
+# CONFIG_SETARCH is not set
+# CONFIG_LINUX32 is not set
+# CONFIG_LINUX64 is not set
+# CONFIG_SETPRIV is not set
+# CONFIG_FEATURE_SETPRIV_DUMP is not set
+# CONFIG_FEATURE_SETPRIV_CAPABILITIES is not set
+# CONFIG_FEATURE_SETPRIV_CAPABILITY_NAMES is not set
+# CONFIG_SETSID is not set
+# CONFIG_SWAPON is not set
+# CONFIG_FEATURE_SWAPON_DISCARD is not set
+# CONFIG_FEATURE_SWAPON_PRI is not set
+# CONFIG_SWAPOFF is not set
+# CONFIG_FEATURE_SWAPONOFF_LABEL is not set
+# CONFIG_SWITCH_ROOT is not set
+# CONFIG_TASKSET is not set
+# CONFIG_FEATURE_TASKSET_FANCY is not set
+# CONFIG_FEATURE_TASKSET_CPULIST is not set
+# CONFIG_UEVENT is not set
+CONFIG_UMOUNT=y
+CONFIG_FEATURE_UMOUNT_ALL=y
+# CONFIG_UNSHARE is not set
+# CONFIG_WALL is not set
+
+#
+# Common options for mount/umount
+#
+# CONFIG_FEATURE_MOUNT_LOOP is not set
+# CONFIG_FEATURE_MOUNT_LOOP_CREATE is not set
+# CONFIG_FEATURE_MTAB_SUPPORT is not set
+# CONFIG_VOLUMEID is not set
+# CONFIG_FEATURE_VOLUMEID_BCACHE is not set
+# CONFIG_FEATURE_VOLUMEID_BTRFS is not set
+# CONFIG_FEATURE_VOLUMEID_CRAMFS is not set
+# CONFIG_FEATURE_VOLUMEID_EXFAT is not set
+# CONFIG_FEATURE_VOLUMEID_EXT is not set
+# CONFIG_FEATURE_VOLUMEID_F2FS is not set
+# CONFIG_FEATURE_VOLUMEID_FAT is not set
+# CONFIG_FEATURE_VOLUMEID_HFS is not set
+# CONFIG_FEATURE_VOLUMEID_ISO9660 is not set
+# CONFIG_FEATURE_VOLUMEID_JFS is not set
+# CONFIG_FEATURE_VOLUMEID_LFS is not set
+# CONFIG_FEATURE_VOLUMEID_LINUXRAID is not set
+# CONFIG_FEATURE_VOLUMEID_LINUXSWAP is not set
+# CONFIG_FEATURE_VOLUMEID_LUKS is not set
+# CONFIG_FEATURE_VOLUMEID_MINIX is not set
+# CONFIG_FEATURE_VOLUMEID_NILFS is not set
+# CONFIG_FEATURE_VOLUMEID_NTFS is not set
+# CONFIG_FEATURE_VOLUMEID_OCFS2 is not set
+# CONFIG_FEATURE_VOLUMEID_REISERFS is not set
+# CONFIG_FEATURE_VOLUMEID_ROMFS is not set
+# CONFIG_FEATURE_VOLUMEID_SQUASHFS is not set
+# CONFIG_FEATURE_VOLUMEID_SYSV is not set
+# CONFIG_FEATURE_VOLUMEID_UBIFS is not set
+# CONFIG_FEATURE_VOLUMEID_UDF is not set
+# CONFIG_FEATURE_VOLUMEID_XFS is not set
+
+#
+# Miscellaneous Utilities
+#
+# CONFIG_ADJTIMEX is not set
+# CONFIG_BBCONFIG is not set
+# CONFIG_FEATURE_COMPRESS_BBCONFIG is not set
+# CONFIG_BC is not set
+# CONFIG_DC is not set
+# CONFIG_FEATURE_DC_BIG is not set
+# CONFIG_FEATURE_DC_LIBM is not set
+# CONFIG_FEATURE_BC_INTERACTIVE is not set
+# CONFIG_FEATURE_BC_LONG_OPTIONS is not set
+# CONFIG_BEEP is not set
+CONFIG_FEATURE_BEEP_FREQ=0
+CONFIG_FEATURE_BEEP_LENGTH_MS=0
+# CONFIG_CHAT is not set
+# CONFIG_FEATURE_CHAT_NOFAIL is not set
+# CONFIG_FEATURE_CHAT_TTY_HIFI is not set
+# CONFIG_FEATURE_CHAT_IMPLICIT_CR is not set
+# CONFIG_FEATURE_CHAT_SWALLOW_OPTS is not set
+# CONFIG_FEATURE_CHAT_SEND_ESCAPES is not set
+# CONFIG_FEATURE_CHAT_VAR_ABORT_LEN is not set
+# CONFIG_FEATURE_CHAT_CLR_ABORT is not set
+# CONFIG_CONSPY is not set
+# CONFIG_CROND is not set
+# CONFIG_FEATURE_CROND_D is not set
+# CONFIG_FEATURE_CROND_CALL_SENDMAIL is not set
+# CONFIG_FEATURE_CROND_SPECIAL_TIMES is not set
+CONFIG_FEATURE_CROND_DIR=""
+# CONFIG_CRONTAB is not set
+# CONFIG_DEVFSD is not set
+# CONFIG_DEVFSD_MODLOAD is not set
+# CONFIG_DEVFSD_FG_NP is not set
+# CONFIG_DEVFSD_VERBOSE is not set
+# CONFIG_FEATURE_DEVFS is not set
+# CONFIG_DEVMEM is not set
+# CONFIG_FBSPLASH is not set
+# CONFIG_FLASHCP is not set
+# CONFIG_FLASH_ERASEALL is not set
+# CONFIG_FLASH_LOCK is not set
+# CONFIG_FLASH_UNLOCK is not set
+# CONFIG_HDPARM is not set
+# CONFIG_FEATURE_HDPARM_GET_IDENTITY is not set
+# CONFIG_FEATURE_HDPARM_HDIO_SCAN_HWIF is not set
+# CONFIG_FEATURE_HDPARM_HDIO_UNREGISTER_HWIF is not set
+# CONFIG_FEATURE_HDPARM_HDIO_DRIVE_RESET is not set
+# CONFIG_FEATURE_HDPARM_HDIO_TRISTATE_HWIF is not set
+# CONFIG_FEATURE_HDPARM_HDIO_GETSET_DMA is not set
+# CONFIG_HEXEDIT is not set
+# CONFIG_I2CGET is not set
+# CONFIG_I2CSET is not set
+# CONFIG_I2CDUMP is not set
+# CONFIG_I2CDETECT is not set
+# CONFIG_I2CTRANSFER is not set
+# CONFIG_INOTIFYD is not set
+# CONFIG_LESS is not set
+CONFIG_FEATURE_LESS_MAXLINES=0
+# CONFIG_FEATURE_LESS_BRACKETS is not set
+# CONFIG_FEATURE_LESS_FLAGS is not set
+# CONFIG_FEATURE_LESS_TRUNCATE is not set
+# CONFIG_FEATURE_LESS_MARKS is not set
+# CONFIG_FEATURE_LESS_REGEXP is not set
+# CONFIG_FEATURE_LESS_WINCH is not set
+# CONFIG_FEATURE_LESS_ASK_TERMINAL is not set
+# CONFIG_FEATURE_LESS_DASHCMD is not set
+# CONFIG_FEATURE_LESS_LINENUMS is not set
+# CONFIG_FEATURE_LESS_RAW is not set
+# CONFIG_FEATURE_LESS_ENV is not set
+# CONFIG_LSSCSI is not set
+# CONFIG_MAKEDEVS is not set
+# CONFIG_FEATURE_MAKEDEVS_LEAF is not set
+# CONFIG_FEATURE_MAKEDEVS_TABLE is not set
+# CONFIG_MAN is not set
+# CONFIG_MICROCOM is not set
+# CONFIG_MIM is not set
+# CONFIG_MT is not set
+# CONFIG_NANDWRITE is not set
+# CONFIG_NANDDUMP is not set
+# CONFIG_PARTPROBE is not set
+# CONFIG_RAIDAUTORUN is not set
+# CONFIG_READAHEAD is not set
+# CONFIG_RFKILL is not set
+# CONFIG_RUNLEVEL is not set
+# CONFIG_RX is not set
+# CONFIG_SETFATTR is not set
+CONFIG_SETSERIAL=y
+# CONFIG_STRINGS is not set
+# CONFIG_TIME is not set
+# CONFIG_TS is not set
+# CONFIG_TTYSIZE is not set
+# CONFIG_UBIRENAME is not set
+# CONFIG_UBIATTACH is not set
+# CONFIG_UBIDETACH is not set
+# CONFIG_UBIMKVOL is not set
+# CONFIG_UBIRMVOL is not set
+# CONFIG_UBIRSVOL is not set
+# CONFIG_UBIUPDATEVOL is not set
+# CONFIG_VOLNAME is not set
+# CONFIG_WATCHDOG is not set
+
+#
+# Networking Utilities
+#
+# CONFIG_FEATURE_IPV6 is not set
+# CONFIG_FEATURE_UNIX_LOCAL is not set
+# CONFIG_FEATURE_PREFER_IPV4_ADDRESS is not set
+# CONFIG_VERBOSE_RESOLUTION_ERRORS is not set
+# CONFIG_FEATURE_TLS_SHA1 is not set
+# CONFIG_ARP is not set
+# CONFIG_ARPING is not set
+# CONFIG_BRCTL is not set
+# CONFIG_FEATURE_BRCTL_FANCY is not set
+# CONFIG_FEATURE_BRCTL_SHOW is not set
+# CONFIG_DNSD is not set
+# CONFIG_ETHER_WAKE is not set
+# CONFIG_FTPD is not set
+# CONFIG_FEATURE_FTPD_WRITE is not set
+# CONFIG_FEATURE_FTPD_ACCEPT_BROKEN_LIST is not set
+# CONFIG_FEATURE_FTPD_AUTHENTICATION is not set
+# CONFIG_FTPGET is not set
+# CONFIG_FTPPUT is not set
+# CONFIG_FEATURE_FTPGETPUT_LONG_OPTIONS is not set
+# CONFIG_HOSTNAME is not set
+# CONFIG_DNSDOMAINNAME is not set
+# CONFIG_HTTPD is not set
+# CONFIG_FEATURE_HTTPD_RANGES is not set
+# CONFIG_FEATURE_HTTPD_SETUID is not set
+# CONFIG_FEATURE_HTTPD_BASIC_AUTH is not set
+# CONFIG_FEATURE_HTTPD_AUTH_MD5 is not set
+# CONFIG_FEATURE_HTTPD_CGI is not set
+# CONFIG_FEATURE_HTTPD_CONFIG_WITH_SCRIPT_INTERPR is not set
+# CONFIG_FEATURE_HTTPD_SET_REMOTE_PORT_TO_ENV is not set
+# CONFIG_FEATURE_HTTPD_ENCODE_URL_STR is not set
+# CONFIG_FEATURE_HTTPD_ERROR_PAGES is not set
+# CONFIG_FEATURE_HTTPD_PROXY is not set
+# CONFIG_FEATURE_HTTPD_GZIP is not set
+# CONFIG_FEATURE_HTTPD_ETAG is not set
+# CONFIG_FEATURE_HTTPD_LAST_MODIFIED is not set
+# CONFIG_FEATURE_HTTPD_DATE is not set
+# CONFIG_FEATURE_HTTPD_ACL_IP is not set
+# CONFIG_IFCONFIG is not set
+# CONFIG_FEATURE_IFCONFIG_STATUS is not set
+# CONFIG_FEATURE_IFCONFIG_SLIP is not set
+# CONFIG_FEATURE_IFCONFIG_MEMSTART_IOADDR_IRQ is not set
+# CONFIG_FEATURE_IFCONFIG_HW is not set
+# CONFIG_FEATURE_IFCONFIG_BROADCAST_PLUS is not set
+# CONFIG_IFENSLAVE is not set
+# CONFIG_IFPLUGD is not set
+# CONFIG_IFUP is not set
+# CONFIG_IFDOWN is not set
+CONFIG_IFUPDOWN_IFSTATE_PATH=""
+# CONFIG_FEATURE_IFUPDOWN_IP is not set
+# CONFIG_FEATURE_IFUPDOWN_IPV4 is not set
+# CONFIG_FEATURE_IFUPDOWN_IPV6 is not set
+# CONFIG_FEATURE_IFUPDOWN_MAPPING is not set
+# CONFIG_FEATURE_IFUPDOWN_EXTERNAL_DHCP is not set
+# CONFIG_INETD is not set
+# CONFIG_FEATURE_INETD_SUPPORT_BUILTIN_ECHO is not set
+# CONFIG_FEATURE_INETD_SUPPORT_BUILTIN_DISCARD is not set
+# CONFIG_FEATURE_INETD_SUPPORT_BUILTIN_TIME is not set
+# CONFIG_FEATURE_INETD_SUPPORT_BUILTIN_DAYTIME is not set
+# CONFIG_FEATURE_INETD_SUPPORT_BUILTIN_CHARGEN is not set
+# CONFIG_FEATURE_INETD_RPC is not set
+# CONFIG_IP is not set
+# CONFIG_IPADDR is not set
+# CONFIG_IPLINK is not set
+# CONFIG_IPROUTE is not set
+# CONFIG_IPTUNNEL is not set
+# CONFIG_IPRULE is not set
+# CONFIG_IPNEIGH is not set
+# CONFIG_FEATURE_IP_ADDRESS is not set
+# CONFIG_FEATURE_IP_LINK is not set
+# CONFIG_FEATURE_IP_ROUTE is not set
+CONFIG_FEATURE_IP_ROUTE_DIR=""
+# CONFIG_FEATURE_IP_TUNNEL is not set
+# CONFIG_FEATURE_IP_RULE is not set
+# CONFIG_FEATURE_IP_NEIGH is not set
+# CONFIG_FEATURE_IP_RARE_PROTOCOLS is not set
+# CONFIG_IPCALC is not set
+# CONFIG_FEATURE_IPCALC_LONG_OPTIONS is not set
+# CONFIG_FEATURE_IPCALC_FANCY is not set
+# CONFIG_FAKEIDENTD is not set
+# CONFIG_NAMEIF is not set
+# CONFIG_FEATURE_NAMEIF_EXTENDED is not set
+# CONFIG_NBDCLIENT is not set
+# CONFIG_NC is not set
+# CONFIG_NETCAT is not set
+# CONFIG_NC_SERVER is not set
+# CONFIG_NC_EXTRA is not set
+# CONFIG_NC_110_COMPAT is not set
+# CONFIG_NETSTAT is not set
+# CONFIG_FEATURE_NETSTAT_WIDE is not set
+# CONFIG_FEATURE_NETSTAT_PRG is not set
+# CONFIG_NSLOOKUP is not set
+# CONFIG_FEATURE_NSLOOKUP_BIG is not set
+# CONFIG_FEATURE_NSLOOKUP_LONG_OPTIONS is not set
+# CONFIG_NTPD is not set
+# CONFIG_FEATURE_NTPD_SERVER is not set
+# CONFIG_FEATURE_NTPD_CONF is not set
+# CONFIG_FEATURE_NTP_AUTH is not set
+# CONFIG_PING is not set
+# CONFIG_PING6 is not set
+# CONFIG_FEATURE_FANCY_PING is not set
+# CONFIG_PSCAN is not set
+# CONFIG_ROUTE is not set
+# CONFIG_SLATTACH is not set
+# CONFIG_SSL_CLIENT is not set
+# CONFIG_TC is not set
+# CONFIG_FEATURE_TC_INGRESS is not set
+# CONFIG_TCPSVD is not set
+# CONFIG_UDPSVD is not set
+# CONFIG_TELNET is not set
+# CONFIG_FEATURE_TELNET_TTYPE is not set
+# CONFIG_FEATURE_TELNET_AUTOLOGIN is not set
+# CONFIG_FEATURE_TELNET_WIDTH is not set
+# CONFIG_TELNETD is not set
+# CONFIG_FEATURE_TELNETD_STANDALONE is not set
+# CONFIG_FEATURE_TELNETD_INETD_WAIT is not set
+# CONFIG_TFTP is not set
+# CONFIG_FEATURE_TFTP_PROGRESS_BAR is not set
+# CONFIG_FEATURE_TFTP_HPA_COMPAT is not set
+# CONFIG_TFTPD is not set
+# CONFIG_FEATURE_TFTP_GET is not set
+# CONFIG_FEATURE_TFTP_PUT is not set
+# CONFIG_FEATURE_TFTP_BLOCKSIZE is not set
+# CONFIG_TFTP_DEBUG is not set
+# CONFIG_TLS is not set
+# CONFIG_TRACEROUTE is not set
+# CONFIG_TRACEROUTE6 is not set
+# CONFIG_FEATURE_TRACEROUTE_VERBOSE is not set
+# CONFIG_FEATURE_TRACEROUTE_USE_ICMP is not set
+# CONFIG_TUNCTL is not set
+# CONFIG_FEATURE_TUNCTL_UG is not set
+# CONFIG_VCONFIG is not set
+# CONFIG_WGET is not set
+# CONFIG_FEATURE_WGET_LONG_OPTIONS is not set
+# CONFIG_FEATURE_WGET_STATUSBAR is not set
+# CONFIG_FEATURE_WGET_AUTHENTICATION is not set
+# CONFIG_FEATURE_WGET_TIMEOUT is not set
+# CONFIG_FEATURE_WGET_HTTPS is not set
+# CONFIG_FEATURE_WGET_OPENSSL is not set
+# CONFIG_WHOIS is not set
+# CONFIG_ZCIP is not set
+# CONFIG_UDHCPD is not set
+# CONFIG_FEATURE_UDHCPD_BASE_IP_ON_MAC is not set
+# CONFIG_FEATURE_UDHCPD_WRITE_LEASES_EARLY is not set
+CONFIG_DHCPD_LEASES_FILE=""
+# CONFIG_DUMPLEASES is not set
+# CONFIG_DHCPRELAY is not set
+# CONFIG_UDHCPC is not set
+# CONFIG_FEATURE_UDHCPC_ARPING is not set
+# CONFIG_FEATURE_UDHCPC_SANITIZEOPT is not set
+CONFIG_UDHCPC_DEFAULT_SCRIPT=""
+# CONFIG_UDHCPC6 is not set
+# CONFIG_FEATURE_UDHCPC6_RFC3646 is not set
+# CONFIG_FEATURE_UDHCPC6_RFC4704 is not set
+# CONFIG_FEATURE_UDHCPC6_RFC4833 is not set
+# CONFIG_FEATURE_UDHCPC6_RFC5970 is not set
+# CONFIG_FEATURE_UDHCP_PORT is not set
+CONFIG_UDHCP_DEBUG=0
+CONFIG_UDHCPC_SLACK_FOR_BUGGY_SERVERS=0
+# CONFIG_FEATURE_UDHCP_RFC3397 is not set
+# CONFIG_FEATURE_UDHCP_8021Q is not set
+CONFIG_IFUPDOWN_UDHCPC_CMD_OPTIONS=""
+
+#
+# Print Utilities
+#
+# CONFIG_LPD is not set
+# CONFIG_LPR is not set
+# CONFIG_LPQ is not set
+
+#
+# Mail Utilities
+#
+# CONFIG_MAKEMIME is not set
+# CONFIG_POPMAILDIR is not set
+# CONFIG_FEATURE_POPMAILDIR_DELIVERY is not set
+# CONFIG_REFORMIME is not set
+# CONFIG_FEATURE_REFORMIME_COMPAT is not set
+# CONFIG_SENDMAIL is not set
+CONFIG_FEATURE_MIME_CHARSET=""
+
+#
+# Process Utilities
+#
+# CONFIG_FREE is not set
+# CONFIG_FUSER is not set
+# CONFIG_IOSTAT is not set
+CONFIG_KILL=y
+CONFIG_KILLALL=y
+# CONFIG_KILLALL5 is not set
+# CONFIG_LSOF is not set
+# CONFIG_MPSTAT is not set
+# CONFIG_NMETER is not set
+# CONFIG_PGREP is not set
+# CONFIG_PKILL is not set
+# CONFIG_PIDOF is not set
+# CONFIG_FEATURE_PIDOF_SINGLE is not set
+# CONFIG_FEATURE_PIDOF_OMIT is not set
+# CONFIG_PMAP is not set
+# CONFIG_POWERTOP is not set
+# CONFIG_FEATURE_POWERTOP_INTERACTIVE is not set
+CONFIG_PS=y
+CONFIG_FEATURE_PS_WIDE=y
+CONFIG_FEATURE_PS_LONG=y
+# CONFIG_FEATURE_PS_TIME is not set
+# CONFIG_FEATURE_PS_UNUSUAL_SYSTEMS is not set
+# CONFIG_FEATURE_PS_ADDITIONAL_COLUMNS is not set
+CONFIG_PSTREE=y
+# CONFIG_PWDX is not set
+# CONFIG_SMEMCAP is not set
+# CONFIG_BB_SYSCTL is not set
+# CONFIG_TOP is not set
+# CONFIG_FEATURE_TOP_INTERACTIVE is not set
+# CONFIG_FEATURE_TOP_CPU_USAGE_PERCENTAGE is not set
+# CONFIG_FEATURE_TOP_CPU_GLOBAL_PERCENTS is not set
+# CONFIG_FEATURE_TOP_SMP_CPU is not set
+# CONFIG_FEATURE_TOP_DECIMALS is not set
+# CONFIG_FEATURE_TOP_SMP_PROCESS is not set
+# CONFIG_FEATURE_TOPMEM is not set
+# CONFIG_UPTIME is not set
+# CONFIG_FEATURE_UPTIME_UTMP_SUPPORT is not set
+# CONFIG_WATCH is not set
+# CONFIG_FEATURE_SHOW_THREADS is not set
+
+#
+# Runit Utilities
+#
+# CONFIG_CHPST is not set
+# CONFIG_SETUIDGID is not set
+# CONFIG_ENVUIDGID is not set
+# CONFIG_ENVDIR is not set
+# CONFIG_SOFTLIMIT is not set
+# CONFIG_RUNSV is not set
+# CONFIG_RUNSVDIR is not set
+# CONFIG_FEATURE_RUNSVDIR_LOG is not set
+# CONFIG_SV is not set
+CONFIG_SV_DEFAULT_SERVICE_DIR=""
+# CONFIG_SVC is not set
+# CONFIG_SVOK is not set
+# CONFIG_SVLOGD is not set
+# CONFIG_CHCON is not set
+# CONFIG_GETENFORCE is not set
+# CONFIG_GETSEBOOL is not set
+# CONFIG_LOAD_POLICY is not set
+# CONFIG_MATCHPATHCON is not set
+# CONFIG_RUNCON is not set
+# CONFIG_SELINUXENABLED is not set
+# CONFIG_SESTATUS is not set
+# CONFIG_SETENFORCE is not set
+# CONFIG_SETFILES is not set
+# CONFIG_FEATURE_SETFILES_CHECK_OPTION is not set
+# CONFIG_RESTORECON is not set
+# CONFIG_SETSEBOOL is not set
+
+#
+# Shells
+#
+# CONFIG_SH_IS_ASH is not set
+CONFIG_SH_IS_HUSH=y
+# CONFIG_SH_IS_NONE is not set
+# CONFIG_BASH_IS_ASH is not set
+CONFIG_BASH_IS_HUSH=y
+# CONFIG_BASH_IS_NONE is not set
+# CONFIG_SHELL_ASH is not set
+# CONFIG_ASH is not set
+# CONFIG_ASH_OPTIMIZE_FOR_SIZE is not set
+# CONFIG_ASH_INTERNAL_GLOB is not set
+# CONFIG_ASH_BASH_COMPAT is not set
+# CONFIG_ASH_BASH_SOURCE_CURDIR is not set
+# CONFIG_ASH_BASH_NOT_FOUND_HOOK is not set
+# CONFIG_ASH_JOB_CONTROL is not set
+# CONFIG_ASH_ALIAS is not set
+# CONFIG_ASH_RANDOM_SUPPORT is not set
+# CONFIG_ASH_EXPAND_PRMT is not set
+# CONFIG_ASH_IDLE_TIMEOUT is not set
+# CONFIG_ASH_MAIL is not set
+# CONFIG_ASH_ECHO is not set
+# CONFIG_ASH_PRINTF is not set
+# CONFIG_ASH_TEST is not set
+# CONFIG_ASH_HELP is not set
+# CONFIG_ASH_GETOPTS is not set
+# CONFIG_ASH_CMDCMD is not set
+# CONFIG_CTTYHACK is not set
+CONFIG_HUSH=y
+CONFIG_SHELL_HUSH=y
+CONFIG_HUSH_BASH_COMPAT=y
+CONFIG_HUSH_BRACE_EXPANSION=y
+CONFIG_HUSH_LINENO_VAR=y
+# CONFIG_HUSH_BASH_SOURCE_CURDIR is not set
+CONFIG_HUSH_INTERACTIVE=y
+# CONFIG_HUSH_SAVEHISTORY is not set
+CONFIG_HUSH_JOB=y
+CONFIG_HUSH_TICK=y
+CONFIG_HUSH_IF=y
+CONFIG_HUSH_LOOPS=y
+CONFIG_HUSH_CASE=y
+CONFIG_HUSH_FUNCTIONS=y
+CONFIG_HUSH_LOCAL=y
+CONFIG_HUSH_RANDOM_SUPPORT=y
+CONFIG_HUSH_MODE_X=y
+CONFIG_HUSH_ECHO=y
+CONFIG_HUSH_PRINTF=y
+CONFIG_HUSH_TEST=y
+CONFIG_HUSH_HELP=y
+CONFIG_HUSH_EXPORT=y
+CONFIG_HUSH_EXPORT_N=y
+CONFIG_HUSH_READONLY=y
+CONFIG_HUSH_KILL=y
+CONFIG_HUSH_WAIT=y
+CONFIG_HUSH_COMMAND=y
+CONFIG_HUSH_TRAP=y
+CONFIG_HUSH_TYPE=y
+CONFIG_HUSH_TIMES=y
+CONFIG_HUSH_READ=y
+CONFIG_HUSH_SET=y
+CONFIG_HUSH_UNSET=y
+CONFIG_HUSH_ULIMIT=y
+CONFIG_HUSH_UMASK=y
+CONFIG_HUSH_GETOPTS=y
+# CONFIG_HUSH_MEMLEAK is not set
+
+#
+# Options common to all shells
+#
+CONFIG_FEATURE_SH_MATH=y
+CONFIG_FEATURE_SH_MATH_64=y
+CONFIG_FEATURE_SH_MATH_BASE=y
+# CONFIG_FEATURE_SH_EXTRA_QUIET is not set
+# CONFIG_FEATURE_SH_STANDALONE is not set
+# CONFIG_FEATURE_SH_NOFORK is not set
+# CONFIG_FEATURE_SH_READ_FRAC is not set
+# CONFIG_FEATURE_SH_HISTFILESIZE is not set
+# CONFIG_FEATURE_SH_EMBEDDED_SCRIPTS is not set
+
+#
+# System Logging Utilities
+#
+# CONFIG_KLOGD is not set
+# CONFIG_FEATURE_KLOGD_KLOGCTL is not set
+# CONFIG_LOGGER is not set
+# CONFIG_LOGREAD is not set
+# CONFIG_FEATURE_LOGREAD_REDUCED_LOCKING is not set
+# CONFIG_SYSLOGD is not set
+# CONFIG_FEATURE_ROTATE_LOGFILE is not set
+# CONFIG_FEATURE_REMOTE_LOG is not set
+# CONFIG_FEATURE_SYSLOGD_DUP is not set
+# CONFIG_FEATURE_SYSLOGD_CFG is not set
+# CONFIG_FEATURE_SYSLOGD_PRECISE_TIMESTAMPS is not set
+CONFIG_FEATURE_SYSLOGD_READ_BUFFER_SIZE=0
+# CONFIG_FEATURE_IPC_SYSLOG is not set
+CONFIG_FEATURE_IPC_SYSLOG_BUFFER_SIZE=0
+# CONFIG_FEATURE_KMSG_SYSLOG is not set
diff --git a/board/kendryte/k210/device_table_dev.txt b/board/kendryte/k210/device_table_dev.txt
new file mode 100644
index 0000000000..7af3106d3e
--- /dev/null
+++ b/board/kendryte/k210/device_table_dev.txt
@@ -0,0 +1,17 @@
+# See package/makedevs/README for details
+#
+# This device table is used only to create device files when a static
+# device configuration is used (entries in /dev are static).
+#
+# <name> <type> <mode> <uid> <gid> <major> <minor> <start> <inc> <count>
+
+# Minimal device set before mounting devtpmfs
+/dev/null c 666 0 0 1 3 0 0 -
+/dev/zero c 666 0 0 1 5 0 0 -
+/dev/random c 666 0 0 1 8 0 0 -
+/dev/urandom c 666 0 0 1 9 0 0 -
+/dev/console c 666 0 0 5 1 - - -
+/dev/tty c 666 0 0 5 0 - - -
+/dev/tty0 c 666 0 0 4 0 0 0 -
+/dev/ttySIF0 c 666 0 0 4 64 0 0 -
+/dev/ptmx c 666 0 0 5 2 - - -
diff --git a/board/kendryte/k210/fakeroot.sh b/board/kendryte/k210/fakeroot.sh
new file mode 100755
index 0000000000..6a5e96ae0c
--- /dev/null
+++ b/board/kendryte/k210/fakeroot.sh
@@ -0,0 +1,8 @@
+#!/bin/sh
+
+echo "Simplifying target rootfs ($TARGET_DIR)"
+
+rm -rf "$TARGET_DIR"/var/www > /dev/null 2>&1
+rm -rf "$TARGET_DIR"/media > /dev/null 2>&1
+
+exit 0
diff --git a/board/kendryte/k210/patches/uclibc/0001-Revert-Fix-static-linking-with-GCC-10.patch b/board/kendryte/k210/patches/uclibc/0001-Revert-Fix-static-linking-with-GCC-10.patch
new file mode 100644
index 0000000000..6adc827308
--- /dev/null
+++ b/board/kendryte/k210/patches/uclibc/0001-Revert-Fix-static-linking-with-GCC-10.patch
@@ -0,0 +1,43 @@
+From e80384786d7b7f895c97f2447d4b91af8eb5f0f4 Mon Sep 17 00:00:00 2001
+From: Waldemar Brodkorb <wbx@openadk.org>
+Date: Wed, 2 Sep 2020 09:45:17 +0200
+Subject: [PATCH 1/4] Revert "Fix static linking with GCC-10"
+
+This reverts commit 5b58a1ebd89a4f05778441814e81817c82193fa3.
+
+This breaks all static builds earlier to gcc 10 :(
+Bad testing on my side.
+---
+ libc/misc/elf/dl-support.c | 2 +-
+ libpthread/nptl/sysdeps/generic/libc-tls.c | 2 +-
+ 2 files changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/libc/misc/elf/dl-support.c b/libc/misc/elf/dl-support.c
+index eaf08f5bb..87cd1bb72 100644
+--- a/libc/misc/elf/dl-support.c
++++ b/libc/misc/elf/dl-support.c
+@@ -29,7 +29,7 @@ void (*_dl_init_static_tls) (struct link_map *) = &_dl_nothread_init_static_tls;
+
+ ElfW(Phdr) *_dl_phdr;
+ size_t _dl_phnum;
+-extern size_t _dl_pagesize;
++size_t _dl_pagesize;
+
+ void internal_function _dl_aux_init (ElfW(auxv_t) *av);
+ void internal_function _dl_aux_init (ElfW(auxv_t) *av)
+diff --git a/libpthread/nptl/sysdeps/generic/libc-tls.c b/libpthread/nptl/sysdeps/generic/libc-tls.c
+index a1d2ef913..d746c9a38 100644
+--- a/libpthread/nptl/sysdeps/generic/libc-tls.c
++++ b/libpthread/nptl/sysdeps/generic/libc-tls.c
+@@ -72,7 +72,7 @@ struct dtv_slotinfo_list *_dl_tls_dtv_slotinfo_list;
+ /* Number of modules in the static TLS block. */
+ size_t _dl_tls_static_nelem;
+ /* Size of the static TLS block. */
+-extern size_t _dl_tls_static_size;
++size_t _dl_tls_static_size;
+ /* Size actually allocated in the static TLS block. */
+ size_t _dl_tls_static_used;
+ /* Alignment requirement of the static TLS block. */
+--
+2.26.2
+
diff --git a/board/kendryte/k210/patches/uclibc/0002-fix-static-builds-with-gcc-10.x.patch b/board/kendryte/k210/patches/uclibc/0002-fix-static-builds-with-gcc-10.x.patch
new file mode 100644
index 0000000000..63d506c328
--- /dev/null
+++ b/board/kendryte/k210/patches/uclibc/0002-fix-static-builds-with-gcc-10.x.patch
@@ -0,0 +1,25 @@
+From 4deace34cfcc5476b71a9cdc05828f5a48d1cd74 Mon Sep 17 00:00:00 2001
+From: Waldemar Brodkorb <wbx@openadk.org>
+Date: Thu, 3 Sep 2020 15:08:24 +0200
+Subject: [PATCH 2/4] fix static builds with gcc 10.x
+
+---
+ Rules.mak | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/Rules.mak b/Rules.mak
+index f270b7bee..55e88d462 100644
+--- a/Rules.mak
++++ b/Rules.mak
+@@ -288,7 +288,7 @@ OPTIMIZATION += $(CFLAG_-fstrict-aliasing)
+
+ # Why -funsigned-char: I hunted a bug related to incorrect
+ # sign extension of 'char' type for 10 hours straight. Not fun.
+-CPU_CFLAGS-y := -funsigned-char -fno-builtin
++CPU_CFLAGS-y := -funsigned-char -fno-builtin -fcommon
+
+ $(eval $(call check-gcc-var,-fno-asm))
+ CPU_CFLAGS-y += $(CFLAG_-fno-asm)
+--
+2.26.2
+
diff --git a/board/kendryte/k210/patches/uclibc/0003-utils-getconf-Fix-compilation-error.patch b/board/kendryte/k210/patches/uclibc/0003-utils-getconf-Fix-compilation-error.patch
new file mode 100644
index 0000000000..2fc86d6161
--- /dev/null
+++ b/board/kendryte/k210/patches/uclibc/0003-utils-getconf-Fix-compilation-error.patch
@@ -0,0 +1,103 @@
+From 684b80c97a38033cf0065537783ecf29bc2251ee Mon Sep 17 00:00:00 2001
+From: Damien Le Moal <damien.lemoal@wdc.com>
+Date: Mon, 7 Sep 2020 15:12:39 +0900
+Subject: [PATCH 3/4] utils/getconf: Fix compilation error
+
+Avoid "warning: statement will never be executed" compilation error if
+none of the cases are defined.
+
+Signed-off-by: Damien Le Moal <damien.lemoal@wdc.com>
+---
+ utils/getconf.c | 20 +++++++++++++++++---
+ 1 file changed, 17 insertions(+), 3 deletions(-)
+
+diff --git a/utils/getconf.c b/utils/getconf.c
+index 3dd3d75d9..b8d00f90f 100644
+--- a/utils/getconf.c
++++ b/utils/getconf.c
+@@ -1154,7 +1154,6 @@ environment SPEC.\n\n");
+
+ const char *spec = NULL;
+ char buf[sizeof "POSIX_V6_LPBIG_OFFBIG"];
+- char *argv0 = argv[0];
+ if (argc > 1 && strncmp (argv[1], "-v", 2) == 0)
+ {
+ if (argv[1][2] == '\0')
+@@ -1199,42 +1198,56 @@ environment SPEC.\n\n");
+
+ switch (specs[i].num)
+ {
++#undef DO_GETCONF_NAME
+ #if !defined(_XBS5_ILP32_OFF32) && defined(_SC_XBS5_ILP32_OFF32)
++#define DO_GETCONF_NAME
+ case _SC_XBS5_ILP32_OFF32:
+ #endif
+ #if !defined(_XBS5_ILP32_OFFBIG) && defined(_SC_XBS5_ILP32_OFFBIG)
++#define DO_GETCONF_NAME
+ case _SC_XBS5_ILP32_OFFBIG:
+ #endif
+ #if !defined(_XBS5_LP64_OFF64) && defined(_SC_XBS5_LP64_OFF64)
++#define DO_GETCONF_NAME
+ case _SC_XBS5_LP64_OFF64:
+ #endif
+ #if !defined(_XBS5_LPBIG_OFFBIG) && defined(_SC_XBS5_LPBIG_OFFBIG)
++#define DO_GETCONF_NAME
+ case _SC_XBS5_LPBIG_OFFBIG:
+ #endif
+ #if !defined(_POSIX_V6_ILP32_OFF32) && defined(_SC_V6_ILP32_OFF32)
++#define DO_GETCONF_NAME
+ case _SC_V6_ILP32_OFF32:
+ #endif
+ #if !defined(_POSIX_V6_ILP32_OFFBIG) && defined(_SC_V6_ILP32_OFFBIG)
++#define DO_GETCONF_NAME
+ case _SC_V6_ILP32_OFFBIG:
+ #endif
+ #if !defined(_POSIX_V6_LP64_OFF64) && defined(_SC_V6_LP64_OFF64)
++#define DO_GETCONF_NAME
+ case _SC_V6_LP64_OFF64:
+ #endif
+ #if !defined(_POSIX_V6_LPBIG_OFFBIG) && defined(_SC_V6_LPBIG_OFFBIG)
++#define DO_GETCONF_NAME
+ case _SC_V6_LPBIG_OFFBIG:
+ #endif
+ #if !defined(_POSIX_V7_ILP32_OFF32) && defined(_SC_V7_ILP32_OFF32)
++#define DO_GETCONF_NAME
+ case _SC_V7_ILP32_OFF32:
+ #endif
+ #if !defined(_POSIX_V7_ILP32_OFFBIG) && defined(_SC_V7_ILP32_OFFBIG)
++#define DO_GETCONF_NAME
+ case _SC_V7_ILP32_OFFBIG:
+ #endif
+ #if !defined(_POSIX_V7_LP64_OFF64) && defined(_SC_V7_LP64_OFF64)
++#define DO_GETCONF_NAME
+ case _SC_V7_LP64_OFF64:
+ #endif
+ #if !defined(_POSIX_V7_LPBIG_OFFBIG) && defined(_SC_V7_LPBIG_OFFBIG)
++#define DO_GETCONF_NAME
+ case _SC_V7_LPBIG_OFFBIG:
+ #endif
++#ifdef DO_GETCONF_NAME
+ {
+ const char *args[argc + 3];
+ size_t spec_len = strlen (spec);
+@@ -1242,14 +1255,15 @@ environment SPEC.\n\n");
+ memcpy (mempcpy (mempcpy (getconf_name, getconf_dir,
+ getconf_dirlen),
+ "/", 1), spec, spec_len + 1);
+- args[0] = argv0;
++ args[0] = argv[0];
+ args[1] = "-v";
+ args[2] = spec;
+ memcpy (&args[3], &argv[1], argc * sizeof (argv[1]));
+ execv (getconf_name, (char * const *) args);
+ error (4, errno, _("Couldn't execute %s"), getconf_name);
+ }
+- default:
++#endif
++ default:
+ break;
+ }
+ }
+--
+2.26.2
+
diff --git a/board/kendryte/k210/patches/uclibc/0004-librt-avoid-compilation-error.patch b/board/kendryte/k210/patches/uclibc/0004-librt-avoid-compilation-error.patch
new file mode 100644
index 0000000000..c0b7177f58
--- /dev/null
+++ b/board/kendryte/k210/patches/uclibc/0004-librt-avoid-compilation-error.patch
@@ -0,0 +1,42 @@
+From 4f7150086ffc2936d2c0f44e136984fcb232f7c7 Mon Sep 17 00:00:00 2001
+From: Damien Le Moal <damien.lemoal@wdc.com>
+Date: Mon, 7 Sep 2020 16:51:09 +0900
+Subject: [PATCH 4/4] librt: avoid compilation error
+
+For no MMU builds, LIBC_CANCEL_ASYNC and LIBC_CANCEL_RESET are not
+defined. Prevent these to by visible by the compiler in
+clock_nanosleep() by replacing "if (SINGLE_THREAD_P) {" with the
+pre-compiler directive "#if defined(SINGLE_THREAD_P)".
+
+Signed-off-by: Damien Le Moal <damien.lemoal@wdc.com>
+---
+ librt/clock_nanosleep.c | 5 +++--
+ 1 file changed, 3 insertions(+), 2 deletions(-)
+
+diff --git a/librt/clock_nanosleep.c b/librt/clock_nanosleep.c
+index 4cf1e06b4..1515cf5b0 100644
+--- a/librt/clock_nanosleep.c
++++ b/librt/clock_nanosleep.c
+@@ -36,9 +36,9 @@ clock_nanosleep (clockid_t clock_id, int flags, const struct timespec *req,
+ if (clock_id == CLOCK_PROCESS_CPUTIME_ID)
+ clock_id = MAKE_PROCESS_CPUCLOCK (0, CPUCLOCK_SCHED);
+
+- if (SINGLE_THREAD_P)
++#if defined(SINGLE_THREAD_P)
+ r = INTERNAL_SYSCALL (clock_nanosleep, err, 4, clock_id, flags, req, rem);
+- else
++#else
+ {
+ int oldstate = LIBC_CANCEL_ASYNC ();
+
+@@ -47,6 +47,7 @@ clock_nanosleep (clockid_t clock_id, int flags, const struct timespec *req,
+
+ LIBC_CANCEL_RESET (oldstate);
+ }
++#endif
+
+ return (INTERNAL_SYSCALL_ERROR_P (r, err)
+ ? INTERNAL_SYSCALL_ERRNO (r, err) : 0);
+--
+2.26.2
+
diff --git a/board/kendryte/k210/rootfs_overlay/init b/board/kendryte/k210/rootfs_overlay/init
new file mode 100755
index 0000000000..945ac13789
--- /dev/null
+++ b/board/kendryte/k210/rootfs_overlay/init
@@ -0,0 +1,11 @@
+#!/bin/sh
+
+mount -t devtmpfs devtmpfs /dev
+mount -t proc proc /proc
+
+echo ""
+echo "-----------------------------"
+echo "| Kendryte K210 NOMMU Linux |"
+echo "-----------------------------"
+
+exec /bin/sh
diff --git a/board/kendryte/k210/uClibc-ng.config b/board/kendryte/k210/uClibc-ng.config
new file mode 100644
index 0000000000..409139fa7e
--- /dev/null
+++ b/board/kendryte/k210/uClibc-ng.config
@@ -0,0 +1,209 @@
+#
+# Automatically generated file; DO NOT EDIT.
+# uClibc-ng 1.0.32 C Library Configuration
+#
+# TARGET_aarch64 is not set
+# TARGET_alpha is not set
+# TARGET_arc is not set
+# TARGET_arm is not set
+# TARGET_avr32 is not set
+# TARGET_bfin is not set
+# TARGET_c6x is not set
+# TARGET_cris is not set
+# TARGET_csky is not set
+# TARGET_frv is not set
+# TARGET_h8300 is not set
+# TARGET_hppa is not set
+# TARGET_i386 is not set
+# TARGET_ia64 is not set
+# TARGET_lm32 is not set
+# TARGET_m68k is not set
+# TARGET_metag is not set
+# TARGET_microblaze is not set
+# TARGET_mips is not set
+# TARGET_nds32 is not set
+# TARGET_nios2 is not set
+# TARGET_or1k is not set
+# TARGET_powerpc is not set
+TARGET_riscv64=y
+# TARGET_sh is not set
+# TARGET_sparc is not set
+# TARGET_sparc64 is not set
+# TARGET_tile is not set
+# TARGET_x86_64 is not set
+# TARGET_xtensa is not set
+
+#
+# Target Architecture Features and Options
+#
+TARGET_ARCH="riscv64"
+FORCE_OPTIONS_FOR_ARCH=y
+TARGET_SUBARCH=""
+UCLIBC_FORMAT_FLAT=y
+# UCLIBC_FORMAT_FLAT_SEP_DATA is not set
+# UCLIBC_FORMAT_SHARED_FLAT is not set
+ARCH_LITTLE_ENDIAN=y
+
+#
+# Using Little Endian
+#
+ARCH_HAS_MMU=y
+# ARCH_USE_MMU is not set
+UCLIBC_HAS_FLOATS=y
+UCLIBC_HAS_FPU=y
+DO_C99_MATH=y
+DO_XSI_MATH=y
+# UCLIBC_HAS_LONG_DOUBLE_MATH is not set
+KERNEL_HEADERS=""
+UCLIBC_UCLINUX_BROKEN_MUNMAP=y
+HAVE_DOT_CONFIG=y
+
+#
+# General Library Settings
+#
+DOPIC=y
+ARCH_HAS_NO_SHARED=y
+ARCH_HAS_NO_LDSO=y
+HAS_NO_THREADS=y
+UCLIBC_HAS_SYSLOG=y
+UCLIBC_HAS_LFS=y
+# MALLOC is not set
+MALLOC_SIMPLE=y
+# UCLIBC_DYNAMIC_ATEXIT is not set
+UCLIBC_HAS_UTMPX=y
+UCLIBC_HAS_UTMP=y
+UCLIBC_SUSV2_LEGACY=y
+UCLIBC_SUSV3_LEGACY=y
+# UCLIBC_SUSV3_LEGACY_MACROS is not set
+UCLIBC_SUSV4_LEGACY=y
+# UCLIBC_STRICT_HEADERS is not set
+UCLIBC_HAS_STUBS=y
+UCLIBC_HAS_SHADOW=y
+UCLIBC_HAS_PROGRAM_INVOCATION_NAME=y
+UCLIBC_HAS___PROGNAME=y
+UCLIBC_HAS_PTY=y
+ASSUME_DEVPTS=y
+UNIX98PTY_ONLY=y
+UCLIBC_HAS_GETPT=y
+# UCLIBC_HAS_LIBUTIL is not set
+# UCLIBC_HAS_TM_EXTENSIONS is not set
+# UCLIBC_HAS_TZ_CACHING is not set
+# UCLIBC_HAS_TZ_FILE is not set
+
+#
+# Advanced Library Settings
+#
+UCLIBC_PWD_BUFFER_SIZE=256
+UCLIBC_GRP_BUFFER_SIZE=256
+
+#
+# Support various families of functions
+#
+UCLIBC_LINUX_SPECIFIC=y
+# UCLIBC_HAS_GNU_ERROR is not set
+# UCLIBC_BSD_SPECIFIC is not set
+# UCLIBC_HAS_BSD_ERR is not set
+# UCLIBC_HAS_OBSOLETE_BSD_SIGNAL is not set
+# UCLIBC_HAS_OBSOLETE_SYSV_SIGNAL is not set
+# UCLIBC_NTP_LEGACY is not set
+# UCLIBC_SV4_DEPRECATED is not set
+UCLIBC_HAS_REALTIME=y
+UCLIBC_HAS_ADVANCED_REALTIME=y
+UCLIBC_HAS_EPOLL=y
+UCLIBC_HAS_XATTR=y
+# UCLIBC_HAS_PROFILING is not set
+# UCLIBC_HAS_CRYPT_IMPL is not set
+UCLIBC_HAS_CRYPT_STUB=y
+UCLIBC_HAS_CRYPT=y
+UCLIBC_HAS_NETWORK_SUPPORT=y
+UCLIBC_HAS_SOCKET=y
+UCLIBC_HAS_IPV4=y
+UCLIBC_HAS_IPV6=y
+# UCLIBC_USE_NETLINK is not set
+# UCLIBC_HAS_BSD_RES_CLOSE is not set
+# UCLIBC_HAS_COMPAT_RES_STATE is not set
+# UCLIBC_HAS_EXTRA_COMPAT_RES_STATE is not set
+# UCLIBC_HAS_RESOLVER_SUPPORT is not set
+
+#
+# String and Stdio Support
+#
+UCLIBC_HAS_STRING_GENERIC_OPT=y
+# UCLIBC_HAS_STRING_ARCH_OPT is not set
+UCLIBC_HAS_CTYPE_TABLES=y
+UCLIBC_HAS_CTYPE_SIGNED=y
+# UCLIBC_HAS_CTYPE_UNSAFE is not set
+UCLIBC_HAS_CTYPE_CHECKED=y
+# UCLIBC_HAS_CTYPE_ENFORCED is not set
+# UCLIBC_HAS_WCHAR is not set
+# UCLIBC_HAS_LIBICONV is not set
+UCLIBC_HAS_LIBINTL=y
+# UCLIBC_HAS_LOCALE is not set
+UCLIBC_HAS_HEXADECIMAL_FLOATS=y
+UCLIBC_HAS_GLIBC_CUSTOM_PRINTF=y
+# USE_OLD_VFPRINTF is not set
+UCLIBC_PRINTF_SCANF_POSITIONAL_ARGS=9
+# UCLIBC_HAS_STDIO_BUFSIZ_NONE is not set
+# UCLIBC_HAS_STDIO_BUFSIZ_256 is not set
+# UCLIBC_HAS_STDIO_BUFSIZ_512 is not set
+# UCLIBC_HAS_STDIO_BUFSIZ_1024 is not set
+# UCLIBC_HAS_STDIO_BUFSIZ_2048 is not set
+UCLIBC_HAS_STDIO_BUFSIZ_4096=y
+# UCLIBC_HAS_STDIO_BUFSIZ_8192 is not set
+UCLIBC_HAS_STDIO_BUILTIN_BUFFER_NONE=y
+# UCLIBC_HAS_STDIO_BUILTIN_BUFFER_4 is not set
+# UCLIBC_HAS_STDIO_BUILTIN_BUFFER_8 is not set
+# UCLIBC_HAS_STDIO_SHUTDOWN_ON_ABORT is not set
+UCLIBC_HAS_STDIO_GETC_MACRO=y
+UCLIBC_HAS_STDIO_PUTC_MACRO=y
+UCLIBC_HAS_STDIO_AUTO_RW_TRANSITION=y
+# UCLIBC_HAS_FOPEN_LARGEFILE_MODE is not set
+UCLIBC_HAS_FOPEN_EXCLUSIVE_MODE=y
+# UCLIBC_HAS_FOPEN_CLOSEEXEC_MODE is not set
+UCLIBC_HAS_GLIBC_CUSTOM_STREAMS=y
+UCLIBC_HAS_PRINTF_M_SPEC=y
+UCLIBC_HAS_ERRNO_MESSAGES=y
+# UCLIBC_HAS_SYS_ERRLIST is not set
+UCLIBC_HAS_SIGNUM_MESSAGES=y
+# UCLIBC_HAS_SYS_SIGLIST is not set
+UCLIBC_HAS_GNU_GETOPT=y
+UCLIBC_HAS_GETOPT_LONG=y
+UCLIBC_HAS_GNU_GETSUBOPT=y
+# UCLIBC_HAS_ARGP is not set
+
+#
+# Big and Tall
+#
+UCLIBC_HAS_REGEX=y
+UCLIBC_HAS_FNMATCH=y
+UCLIBC_HAS_WORDEXP=y
+UCLIBC_HAS_NFTW=y
+UCLIBC_HAS_FTW=y
+# UCLIBC_HAS_FTS is not set
+UCLIBC_HAS_GLOB=y
+UCLIBC_HAS_GNU_GLOB=y
+
+#
+# Library Installation Options
+#
+RUNTIME_PREFIX="/"
+DEVEL_PREFIX="/usr"
+MULTILIB_DIR="lib"
+HARDWIRED_ABSPATH=y
+
+#
+# Security options
+#
+# UCLIBC_HAS_SSP is not set
+# UCLIBC_BUILD_NOEXECSTACK is not set
+
+#
+# Development/debugging options
+#
+CROSS_COMPILER_PREFIX=""
+UCLIBC_EXTRA_CFLAGS=""
+# DODEBUG is not set
+DOSTRIP=y
+# DOASSERTS is not set
+WARNINGS="-Wall"
+# EXTRA_WARNINGS is not set
diff --git a/configs/kendryte_k210_defconfig b/configs/kendryte_k210_defconfig
new file mode 100644
index 0000000000..ff3812b4d4
--- /dev/null
+++ b/configs/kendryte_k210_defconfig
@@ -0,0 +1,36 @@
+BR2_riscv=y
+BR2_CCACHE=y
+BR2_GLOBAL_PATCH_DIR="board/kendryte/k210/patches"
+# BR2_COMPILER_PARANOID_UNSAFE_PATH is not set
+BR2_KERNEL_HEADERS_VERSION=y
+BR2_DEFAULT_KERNEL_VERSION="5.8"
+BR2_UCLIBC_CONFIG="board/kendryte/k210/uClibc-ng.config"
+# BR2_UCLIBC_INSTALL_UTILS is not set
+BR2_GCC_ENABLE_LTO=y
+BR2_PACKAGE_HOST_ELF2FLT=y
+# BR2_USE_MMU is not set
+BR2_INIT_NONE=y
+BR2_ROOTFS_DEVICE_CREATION_STATIC=y
+BR2_ROOTFS_STATIC_DEVICE_TABLE="board/kendryte/k210/device_table_dev.txt"
+BR2_ROOTFS_MERGED_USR=y
+# BR2_TARGET_ENABLE_ROOT_LOGIN is not set
+# BR2_TARGET_GENERIC_GETTY is not set
+# BR2_TARGET_GENERIC_REMOUNT_ROOTFS_RW is not set
+BR2_SYSTEM_DEFAULT_PATH="/bin:/sbin:/usr/bin:/usr/sbin"
+BR2_ENABLE_LOCALE_WHITELIST="C"
+BR2_ROOTFS_OVERLAY="board/kendryte/k210/rootfs_overlay"
+BR2_ROOTFS_POST_FAKEROOT_SCRIPT="board/kendryte/k210/fakeroot.sh"
+BR2_LINUX_KERNEL=y
+BR2_LINUX_KERNEL_CUSTOM_VERSION=y
+BR2_LINUX_KERNEL_CUSTOM_VERSION_VALUE="5.8"
+BR2_LINUX_KERNEL_DEFCONFIG="nommu_k210"
+BR2_LINUX_KERNEL_IMAGE_TARGET_CUSTOM=y
+BR2_LINUX_KERNEL_IMAGE_NAME="loader.bin"
+BR2_LINUX_KERNEL_DTS_SUPPORT=y
+BR2_LINUX_KERNEL_DTB_IS_SELF_BUILT=y
+BR2_LINUX_KERNEL_INTREE_DTS_NAME="kendryte/k210"
+BR2_PACKAGE_BUSYBOX_CONFIG="board/kendryte/k210/busybox.config"
+BR2_PACKAGE_BUSYBOX_SHOW_OTHERS=y
+# BR2_PACKAGE_IFUPDOWN_SCRIPTS is not set
+BR2_TARGET_ROOTFS_INITRAMFS=y
+# BR2_TARGET_ROOTFS_TAR is not set
--
2.26.2
^ permalink raw reply related [flat|nested] 15+ messages in thread
* [Buildroot] [PATCH 3/5] package/elf2flt: add RISC-V support
[not found] ` <20200908053821.GA13505@lst.de>
@ 2020-09-08 6:00 ` Damien Le Moal
0 siblings, 0 replies; 15+ messages in thread
From: Damien Le Moal @ 2020-09-08 6:00 UTC (permalink / raw)
To: buildroot
On 2020/09/08 14:38, Christoph Hellwig wrote:
> On Tue, Sep 08, 2020 at 02:16:22PM +0900, Damien Le Moal wrote:
>> From: Christoph Hellwig <hch@lst.de>
>>
>> Enable selecting elf2flt for RISC-V no MMU builds ad add support for it.
>>
>> Signed-off-by: Christoph Hellwig <hch@lst.de>
>> Signed-off-by: Damien Le Moal <damien.lemoal@wdc.com>
>
> Cn we try to upstream the elf2flt changes first? Sorry, I should have
> probably done that long time ago..
>
Yes. Will send that out too. Same for the uClibc build fixes (currently, static
builds with gcc10 are totally broken though).
--
Damien Le Moal
Western Digital Research
^ permalink raw reply [flat|nested] 15+ messages in thread
* [Buildroot] [PATCH 5/5] Add support for Kendryte K210 based RISC-V boards
2020-09-08 5:16 ` [Buildroot] [PATCH 5/5] Add support for Kendryte K210 based RISC-V boards Damien Le Moal
@ 2020-09-08 7:17 ` Thomas Petazzoni
2020-09-08 8:02 ` Damien Le Moal
0 siblings, 1 reply; 15+ messages in thread
From: Thomas Petazzoni @ 2020-09-08 7:17 UTC (permalink / raw)
To: buildroot
Hello Damien,
Thanks for this contribution, glad to see more RISC-V support in
Buildroot! Some questions/comments below.
On Tue, 8 Sep 2020 14:16:24 +0900
Damien Le Moal <damien.lemoal@wdc.com> wrote:
> board/kendryte/k210/busybox.config | 1181 +++++++++++++++++
Do we really need a complete Busybox configuration? We already have a
somewhat minimal Busybox configuration at
package/busybox/busybox-minimal.config, which precisely is used on
noMMU platforms:
configs/qemu_arm_versatile_nommu_defconfig:BR2_PACKAGE_BUSYBOX_CONFIG="package/busybox/busybox-minimal.config"
configs/qemu_m68k_mcf5208_defconfig:BR2_PACKAGE_BUSYBOX_CONFIG="package/busybox/busybox-minimal.config"
configs/stm32f429_disco_defconfig:BR2_PACKAGE_BUSYBOX_CONFIG="package/busybox/busybox-minimal.config"
configs/stm32f469_disco_defconfig:BR2_PACKAGE_BUSYBOX_CONFIG="package/busybox/busybox-minimal.config"
Could you try to use this one ?
> diff --git a/board/kendryte/k210/device_table_dev.txt b/board/kendryte/k210/device_table_dev.txt
> new file mode 100644
> index 0000000000..7af3106d3e
> --- /dev/null
> +++ b/board/kendryte/k210/device_table_dev.txt
> @@ -0,0 +1,17 @@
> +# See package/makedevs/README for details
> +#
> +# This device table is used only to create device files when a static
> +# device configuration is used (entries in /dev are static).
> +#
> +# <name> <type> <mode> <uid> <gid> <major> <minor> <start> <inc> <count>
> +
> +# Minimal device set before mounting devtpmfs
> +/dev/null c 666 0 0 1 3 0 0 -
> +/dev/zero c 666 0 0 1 5 0 0 -
> +/dev/random c 666 0 0 1 8 0 0 -
> +/dev/urandom c 666 0 0 1 9 0 0 -
> +/dev/console c 666 0 0 5 1 - - -
> +/dev/tty c 666 0 0 5 0 - - -
> +/dev/tty0 c 666 0 0 4 0 0 0 -
> +/dev/ttySIF0 c 666 0 0 4 64 0 0 -
> +/dev/ptmx c 666 0 0 5 2 - - -
I see in your /init script that you are mount devtmpfs, so a custom
device table for static /dev should not be needed. Could you explain
why this device table is necessary ?
> diff --git a/board/kendryte/k210/fakeroot.sh b/board/kendryte/k210/fakeroot.sh
> new file mode 100755
> index 0000000000..6a5e96ae0c
> --- /dev/null
> +++ b/board/kendryte/k210/fakeroot.sh
> @@ -0,0 +1,8 @@
> +#!/bin/sh
> +
> +echo "Simplifying target rootfs ($TARGET_DIR)"
> +
> +rm -rf "$TARGET_DIR"/var/www > /dev/null 2>&1
> +rm -rf "$TARGET_DIR"/media > /dev/null 2>&1
What is in /var/www and /media that takes so much space? In a default
Buildroot configuration, those folders should be empty.
> diff --git a/board/kendryte/k210/patches/uclibc/0001-Revert-Fix-static-linking-with-GCC-10.patch b/board/kendryte/k210/patches/uclibc/0001-Revert-Fix-static-linking-with-GCC-10.patch
None of the uClibc patches here are board-specific, so they should be
added to package/uclibc/. In fact, I think the gcc10 patches would fix
some build issues we have in our autobuilders:
http://autobuild.buildroot.net/?reason=uclibc-1.0.35
> diff --git a/board/kendryte/k210/rootfs_overlay/init b/board/kendryte/k210/rootfs_overlay/init
> new file mode 100755
> index 0000000000..945ac13789
> --- /dev/null
> +++ b/board/kendryte/k210/rootfs_overlay/init
> @@ -0,0 +1,11 @@
> +#!/bin/sh
> +
> +mount -t devtmpfs devtmpfs /dev
> +mount -t proc proc /proc
> +
> +echo ""
> +echo "-----------------------------"
> +echo "| Kendryte K210 NOMMU Linux |"
> +echo "-----------------------------"
> +
> +exec /bin/sh
So with the normal Busybox init you don't have enough memory? Is this
platform using XIP, or is the code loaded into SRAM ? Indeed, 8 MB of
SRAM is quite a lot if you are running code from flash. But if indeed
the entire kernel is loaded into SRAM because you don't have XIP
support, the story is a bit different.
> diff --git a/board/kendryte/k210/uClibc-ng.config b/board/kendryte/k210/uClibc-ng.config
> new file mode 100644
> index 0000000000..409139fa7e
> --- /dev/null
> +++ b/board/kendryte/k210/uClibc-ng.config
Do you really need your own custom uclibc configuration file? What is
the difference compared to the default one?
> diff --git a/configs/kendryte_k210_defconfig b/configs/kendryte_k210_defconfig
> new file mode 100644
> index 0000000000..ff3812b4d4
> --- /dev/null
> +++ b/configs/kendryte_k210_defconfig
> @@ -0,0 +1,36 @@
> +BR2_riscv=y
> +BR2_CCACHE=y
We normally don't enable ccache in our defconfigs.
> +BR2_GLOBAL_PATCH_DIR="board/kendryte/k210/patches"
> +# BR2_COMPILER_PARANOID_UNSAFE_PATH is not set
> +BR2_KERNEL_HEADERS_VERSION=y
> +BR2_DEFAULT_KERNEL_VERSION="5.8"
Since this defconfig also builds the kernel, you should select the
option "kernel headers same as kernel".
> +BR2_UCLIBC_CONFIG="board/kendryte/k210/uClibc-ng.config"
> +# BR2_UCLIBC_INSTALL_UTILS is not set
> +BR2_GCC_ENABLE_LTO=y
> +BR2_PACKAGE_HOST_ELF2FLT=y
> +# BR2_USE_MMU is not set
> +BR2_INIT_NONE=y
> +BR2_ROOTFS_DEVICE_CREATION_STATIC=y
> +BR2_ROOTFS_STATIC_DEVICE_TABLE="board/kendryte/k210/device_table_dev.txt"
> +BR2_ROOTFS_MERGED_USR=y
> +# BR2_TARGET_ENABLE_ROOT_LOGIN is not set
> +# BR2_TARGET_GENERIC_GETTY is not set
> +# BR2_TARGET_GENERIC_REMOUNT_ROOTFS_RW is not set
> +BR2_SYSTEM_DEFAULT_PATH="/bin:/sbin:/usr/bin:/usr/sbin"
Any reason to tweak this option ?
> +BR2_ENABLE_LOCALE_WHITELIST="C"
Or this one ?
> +BR2_ROOTFS_OVERLAY="board/kendryte/k210/rootfs_overlay"
> +BR2_ROOTFS_POST_FAKEROOT_SCRIPT="board/kendryte/k210/fakeroot.sh"
> +BR2_LINUX_KERNEL=y
> +BR2_LINUX_KERNEL_CUSTOM_VERSION=y
> +BR2_LINUX_KERNEL_CUSTOM_VERSION_VALUE="5.8"
> +BR2_LINUX_KERNEL_DEFCONFIG="nommu_k210"
> +BR2_LINUX_KERNEL_IMAGE_TARGET_CUSTOM=y
> +BR2_LINUX_KERNEL_IMAGE_NAME="loader.bin"
> +BR2_LINUX_KERNEL_DTS_SUPPORT=y
> +BR2_LINUX_KERNEL_DTB_IS_SELF_BUILT=y
> +BR2_LINUX_KERNEL_INTREE_DTS_NAME="kendryte/k210"
> +BR2_PACKAGE_BUSYBOX_CONFIG="board/kendryte/k210/busybox.config"
> +BR2_PACKAGE_BUSYBOX_SHOW_OTHERS=y
> +# BR2_PACKAGE_IFUPDOWN_SCRIPTS is not set
> +BR2_TARGET_ROOTFS_INITRAMFS=y
> +# BR2_TARGET_ROOTFS_TAR is not set
Thanks a lot!
Thomas
--
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
^ permalink raw reply [flat|nested] 15+ messages in thread
* [Buildroot] [PATCH 5/5] Add support for Kendryte K210 based RISC-V boards
2020-09-08 7:17 ` Thomas Petazzoni
@ 2020-09-08 8:02 ` Damien Le Moal
2020-09-08 9:07 ` Thomas Petazzoni
0 siblings, 1 reply; 15+ messages in thread
From: Damien Le Moal @ 2020-09-08 8:02 UTC (permalink / raw)
To: buildroot
On 2020/09/08 16:17, Thomas Petazzoni wrote:
> Hello Damien,
>
> Thanks for this contribution, glad to see more RISC-V support in
> Buildroot! Some questions/comments below.
>
> On Tue, 8 Sep 2020 14:16:24 +0900
> Damien Le Moal <damien.lemoal@wdc.com> wrote:
>
>> board/kendryte/k210/busybox.config | 1181 +++++++++++++++++
>
> Do we really need a complete Busybox configuration? We already have a
> somewhat minimal Busybox configuration at
> package/busybox/busybox-minimal.config, which precisely is used on
> noMMU platforms:
>
> configs/qemu_arm_versatile_nommu_defconfig:BR2_PACKAGE_BUSYBOX_CONFIG="package/busybox/busybox-minimal.config"
> configs/qemu_m68k_mcf5208_defconfig:BR2_PACKAGE_BUSYBOX_CONFIG="package/busybox/busybox-minimal.config"
> configs/stm32f429_disco_defconfig:BR2_PACKAGE_BUSYBOX_CONFIG="package/busybox/busybox-minimal.config"
> configs/stm32f469_disco_defconfig:BR2_PACKAGE_BUSYBOX_CONFIG="package/busybox/busybox-minimal.config"
>
> Could you try to use this one ?
Yes, the minimal config work. but it gives me a rootfs cpio image of 650KB
while the one I added is even smaller and results in a rootf of 350KB. 300KB
saved on a board with only 8MB of SRAM, that is not negligible...
>
>> diff --git a/board/kendryte/k210/device_table_dev.txt b/board/kendryte/k210/device_table_dev.txt
>> new file mode 100644
>> index 0000000000..7af3106d3e
>> --- /dev/null
>> +++ b/board/kendryte/k210/device_table_dev.txt
>> @@ -0,0 +1,17 @@
>> +# See package/makedevs/README for details
>> +#
>> +# This device table is used only to create device files when a static
>> +# device configuration is used (entries in /dev are static).
>> +#
>> +# <name> <type> <mode> <uid> <gid> <major> <minor> <start> <inc> <count>
>> +
>> +# Minimal device set before mounting devtpmfs
>> +/dev/null c 666 0 0 1 3 0 0 -
>> +/dev/zero c 666 0 0 1 5 0 0 -
>> +/dev/random c 666 0 0 1 8 0 0 -
>> +/dev/urandom c 666 0 0 1 9 0 0 -
>> +/dev/console c 666 0 0 5 1 - - -
>> +/dev/tty c 666 0 0 5 0 - - -
>> +/dev/tty0 c 666 0 0 4 0 0 0 -
>> +/dev/ttySIF0 c 666 0 0 4 64 0 0 -
>> +/dev/ptmx c 666 0 0 5 2 - - -
>
> I see in your /init script that you are mount devtmpfs, so a custom
> device table for static /dev should not be needed. Could you explain
> why this device table is necessary ?
The init process is just a shell. So if I do not create at least the console
files, I see errors "could not open console" when the init process is started by
the kernel as devtmpfs is not yet mounted. Will check again.
>> diff --git a/board/kendryte/k210/fakeroot.sh b/board/kendryte/k210/fakeroot.sh
>> new file mode 100755
>> index 0000000000..6a5e96ae0c
>> --- /dev/null
>> +++ b/board/kendryte/k210/fakeroot.sh
>> @@ -0,0 +1,8 @@
>> +#!/bin/sh
>> +
>> +echo "Simplifying target rootfs ($TARGET_DIR)"
>> +
>> +rm -rf "$TARGET_DIR"/var/www > /dev/null 2>&1
>> +rm -rf "$TARGET_DIR"/media > /dev/null 2>&1
>
> What is in /var/www and /media that takes so much space? In a default
> Buildroot configuration, those folders should be empty.
They are. Frankly, I could drop this. But as that is totally not needed,
removing them can save a block or so on the cpio image. Memory saving again, but
likely not much here.
>
>> diff --git a/board/kendryte/k210/patches/uclibc/0001-Revert-Fix-static-linking-with-GCC-10.patch b/board/kendryte/k210/patches/uclibc/0001-Revert-Fix-static-linking-with-GCC-10.patch
>
> None of the uClibc patches here are board-specific, so they should be
> added to package/uclibc/. In fact, I think the gcc10 patches would fix
> some build issues we have in our autobuilders:
>
> http://autobuild.buildroot.net/?reason=uclibc-1.0.35
I could not get gcc10 builds to work. The static build is broken and uclibc seem
to imply as much. As I was afraid of the potential impact of these patches on
other builds, I put them as board specific for now. I intend to send them to
uclibc too. Thoughts ? Should I keep this as is for now ?
>
>> diff --git a/board/kendryte/k210/rootfs_overlay/init b/board/kendryte/k210/rootfs_overlay/init
>> new file mode 100755
>> index 0000000000..945ac13789
>> --- /dev/null
>> +++ b/board/kendryte/k210/rootfs_overlay/init
>> @@ -0,0 +1,11 @@
>> +#!/bin/sh
>> +
>> +mount -t devtmpfs devtmpfs /dev
>> +mount -t proc proc /proc
>> +
>> +echo ""
>> +echo "-----------------------------"
>> +echo "| Kendryte K210 NOMMU Linux |"
>> +echo "-----------------------------"
>> +
>> +exec /bin/sh
>
> So with the normal Busybox init you don't have enough memory? Is this
> platform using XIP, or is the code loaded into SRAM ? Indeed, 8 MB of
> SRAM is quite a lot if you are running code from flash. But if indeed
> the entire kernel is loaded into SRAM because you don't have XIP
> support, the story is a bit different.
No XIP. Kernel + embedded initramfs and dtb all end up in memory. SD card is not
working yet, so this is really the only solution for now. Once I get the SD card
to work, the initramfs can go onto the SD card, which will improve things.
But for now, it is very easy to trigger the oom killer in init phase if care is
not taken. And I did see it with the default busybox /init shell + /sbin/init
process. Hence this small init shell script which only mounts devtmpfs and proc
and exec a shell.
>
>> diff --git a/board/kendryte/k210/uClibc-ng.config b/board/kendryte/k210/uClibc-ng.config
>> new file mode 100644
>> index 0000000000..409139fa7e
>> --- /dev/null
>> +++ b/board/kendryte/k210/uClibc-ng.config
>
> Do you really need your own custom uclibc configuration file? What is
> the difference compared to the default one?
Need to try again. I can probably drop this.
>> diff --git a/configs/kendryte_k210_defconfig b/configs/kendryte_k210_defconfig
>> new file mode 100644
>> index 0000000000..ff3812b4d4
>> --- /dev/null
>> +++ b/configs/kendryte_k210_defconfig
>> @@ -0,0 +1,36 @@
>> +BR2_riscv=y
>> +BR2_CCACHE=y
>
> We normally don't enable ccache in our defconfigs.
OK. Will remove it.
>> +BR2_GLOBAL_PATCH_DIR="board/kendryte/k210/patches"
>> +# BR2_COMPILER_PARANOID_UNSAFE_PATH is not set
>> +BR2_KERNEL_HEADERS_VERSION=y
>> +BR2_DEFAULT_KERNEL_VERSION="5.8"
>
> Since this defconfig also builds the kernel, you should select the
> option "kernel headers same as kernel".
>
>> +BR2_UCLIBC_CONFIG="board/kendryte/k210/uClibc-ng.config"
>> +# BR2_UCLIBC_INSTALL_UTILS is not set
>> +BR2_GCC_ENABLE_LTO=y
>> +BR2_PACKAGE_HOST_ELF2FLT=y
>> +# BR2_USE_MMU is not set
>> +BR2_INIT_NONE=y
>> +BR2_ROOTFS_DEVICE_CREATION_STATIC=y
>> +BR2_ROOTFS_STATIC_DEVICE_TABLE="board/kendryte/k210/device_table_dev.txt"
>> +BR2_ROOTFS_MERGED_USR=y
>> +# BR2_TARGET_ENABLE_ROOT_LOGIN is not set
>> +# BR2_TARGET_GENERIC_GETTY is not set
>> +# BR2_TARGET_GENERIC_REMOUNT_ROOTFS_RW is not set
>> +BR2_SYSTEM_DEFAULT_PATH="/bin:/sbin:/usr/bin:/usr/sbin"
>
> Any reason to tweak this option ?
I do not think I changed anything here... Weird. I will check again.
>
>> +BR2_ENABLE_LOCALE_WHITELIST="C"
>
> Or this one ?
Same. A bug. Will fix that.
>
>> +BR2_ROOTFS_OVERLAY="board/kendryte/k210/rootfs_overlay"
>> +BR2_ROOTFS_POST_FAKEROOT_SCRIPT="board/kendryte/k210/fakeroot.sh"
>> +BR2_LINUX_KERNEL=y
>> +BR2_LINUX_KERNEL_CUSTOM_VERSION=y
>> +BR2_LINUX_KERNEL_CUSTOM_VERSION_VALUE="5.8"
>> +BR2_LINUX_KERNEL_DEFCONFIG="nommu_k210"
>> +BR2_LINUX_KERNEL_IMAGE_TARGET_CUSTOM=y
>> +BR2_LINUX_KERNEL_IMAGE_NAME="loader.bin"
>> +BR2_LINUX_KERNEL_DTS_SUPPORT=y
>> +BR2_LINUX_KERNEL_DTB_IS_SELF_BUILT=y
>> +BR2_LINUX_KERNEL_INTREE_DTS_NAME="kendryte/k210"
>> +BR2_PACKAGE_BUSYBOX_CONFIG="board/kendryte/k210/busybox.config"
>> +BR2_PACKAGE_BUSYBOX_SHOW_OTHERS=y
>> +# BR2_PACKAGE_IFUPDOWN_SCRIPTS is not set
>> +BR2_TARGET_ROOTFS_INITRAMFS=y
>> +# BR2_TARGET_ROOTFS_TAR is not set
>
> Thanks a lot!
Thank you for your comments. Will revirew this and send a V2.
--
Damien Le Moal
Western Digital Research
^ permalink raw reply [flat|nested] 15+ messages in thread
* [Buildroot] [PATCH 5/5] Add support for Kendryte K210 based RISC-V boards
2020-09-08 8:02 ` Damien Le Moal
@ 2020-09-08 9:07 ` Thomas Petazzoni
2020-09-08 9:32 ` Damien Le Moal
2020-09-08 10:47 ` Damien Le Moal
0 siblings, 2 replies; 15+ messages in thread
From: Thomas Petazzoni @ 2020-09-08 9:07 UTC (permalink / raw)
To: buildroot
Hello Damien,
On Tue, 8 Sep 2020 08:02:15 +0000
Damien Le Moal <Damien.LeMoal@wdc.com> wrote:
> > configs/qemu_arm_versatile_nommu_defconfig:BR2_PACKAGE_BUSYBOX_CONFIG="package/busybox/busybox-minimal.config"
> > configs/qemu_m68k_mcf5208_defconfig:BR2_PACKAGE_BUSYBOX_CONFIG="package/busybox/busybox-minimal.config"
> > configs/stm32f429_disco_defconfig:BR2_PACKAGE_BUSYBOX_CONFIG="package/busybox/busybox-minimal.config"
> > configs/stm32f469_disco_defconfig:BR2_PACKAGE_BUSYBOX_CONFIG="package/busybox/busybox-minimal.config"
> >
> > Could you try to use this one ?
>
> Yes, the minimal config work. but it gives me a rootfs cpio image of 650KB
> while the one I added is even smaller and results in a rootf of 350KB. 300KB
> saved on a board with only 8MB of SRAM, that is not negligible...
Agreed. Perhaps we should change our busybox-minimal.config ? It would
be nice to diff yours against busybox-minimal.config and see if we can
get to a common conclusion.
As you can imagine, we're trying to avoid the situation where every
single board would have its own custom Busybox configuration file, with
a semi-random selection of tools.
> >> +# Minimal device set before mounting devtpmfs
> >> +/dev/null c 666 0 0 1 3 0 0 -
> >> +/dev/zero c 666 0 0 1 5 0 0 -
> >> +/dev/random c 666 0 0 1 8 0 0 -
> >> +/dev/urandom c 666 0 0 1 9 0 0 -
> >> +/dev/console c 666 0 0 5 1 - - -
> >> +/dev/tty c 666 0 0 5 0 - - -
> >> +/dev/tty0 c 666 0 0 4 0 0 0 -
> >> +/dev/ttySIF0 c 666 0 0 4 64 0 0 -
> >> +/dev/ptmx c 666 0 0 5 2 - - -
> >
> > I see in your /init script that you are mount devtmpfs, so a custom
> > device table for static /dev should not be needed. Could you explain
> > why this device table is necessary ?
>
> The init process is just a shell. So if I do not create at least the console
> files, I see errors "could not open console" when the init process is started by
> the kernel as devtmpfs is not yet mounted. Will check again.
If you enable BR2_ROOTFS_DEVICE_CREATION_DYNAMIC_DEVTMPFS, then
Buildroot doesn't use any static device table, but since in the
initramfs case devtmpfs is not mounted by the kernel, /dev/console is
created anyway by Buildroot in the image. See fs/cpio/cpio.mk:
define ROOTFS_CPIO_ADD_INIT
if [ ! -e $(TARGET_DIR)/init ]; then \
$(INSTALL) -m 0755 fs/cpio/init $(TARGET_DIR)/init; \
fi
mkdir -p $(TARGET_DIR)/dev
mknod -m 0622 $(TARGET_DIR)/dev/console c 5 1
endef
So, /dev/console should be there without having a custom device table.
This should allow your /init script to run and mount devtmpfs.
BTW, you probably want your /init script to be modeled after
fs/cpio/init, except for the last line where you would exec /bin/sh
instead of exec /sbin/init of course.
> >> +rm -rf "$TARGET_DIR"/var/www > /dev/null 2>&1
> >> +rm -rf "$TARGET_DIR"/media > /dev/null 2>&1
> >
> > What is in /var/www and /media that takes so much space? In a default
> > Buildroot configuration, those folders should be empty.
>
> They are. Frankly, I could drop this. But as that is totally not needed,
> removing them can save a block or so on the cpio image. Memory saving again, but
> likely not much here.
OK, we could keep that I guess then. No need for the >/dev/null 2>&1 I
guess, since rm -rf ignores errors.
> >> diff --git a/board/kendryte/k210/patches/uclibc/0001-Revert-Fix-static-linking-with-GCC-10.patch b/board/kendryte/k210/patches/uclibc/0001-Revert-Fix-static-linking-with-GCC-10.patch
> >
> > None of the uClibc patches here are board-specific, so they should be
> > added to package/uclibc/. In fact, I think the gcc10 patches would fix
> > some build issues we have in our autobuilders:
> >
> > http://autobuild.buildroot.net/?reason=uclibc-1.0.35
>
> I could not get gcc10 builds to work. The static build is broken and uclibc seem
> to imply as much. As I was afraid of the potential impact of these patches on
> other builds, I put them as board specific for now. I intend to send them to
> uclibc too. Thoughts ? Should I keep this as is for now ?
We need to look more closely at the patches, but having them
board-specific is not ideal. Perhaps this is something that can be
worked on with upstream uClibc?
> > So with the normal Busybox init you don't have enough memory? Is this
> > platform using XIP, or is the code loaded into SRAM ? Indeed, 8 MB of
> > SRAM is quite a lot if you are running code from flash. But if indeed
> > the entire kernel is loaded into SRAM because you don't have XIP
> > support, the story is a bit different.
>
> No XIP. Kernel + embedded initramfs and dtb all end up in memory. SD card is not
> working yet, so this is really the only solution for now. Once I get the SD card
> to work, the initramfs can go onto the SD card, which will improve things.
OK. But supporting the SD card will not improve the memory consumption,
just give you more storage space.
> But for now, it is very easy to trigger the oom killer in init phase if care is
> not taken. And I did see it with the default busybox /init shell + /sbin/init
> process. Hence this small init shell script which only mounts devtmpfs and proc
> and exec a shell.
Indeed.
Thomas
--
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
^ permalink raw reply [flat|nested] 15+ messages in thread
* [Buildroot] [PATCH 5/5] Add support for Kendryte K210 based RISC-V boards
2020-09-08 9:07 ` Thomas Petazzoni
@ 2020-09-08 9:32 ` Damien Le Moal
2020-09-08 10:47 ` Damien Le Moal
1 sibling, 0 replies; 15+ messages in thread
From: Damien Le Moal @ 2020-09-08 9:32 UTC (permalink / raw)
To: buildroot
On 2020/09/08 18:07, Thomas Petazzoni wrote:
> Hello Damien,
>
> On Tue, 8 Sep 2020 08:02:15 +0000
> Damien Le Moal <Damien.LeMoal@wdc.com> wrote:
>
>>> configs/qemu_arm_versatile_nommu_defconfig:BR2_PACKAGE_BUSYBOX_CONFIG="package/busybox/busybox-minimal.config"
>>> configs/qemu_m68k_mcf5208_defconfig:BR2_PACKAGE_BUSYBOX_CONFIG="package/busybox/busybox-minimal.config"
>>> configs/stm32f429_disco_defconfig:BR2_PACKAGE_BUSYBOX_CONFIG="package/busybox/busybox-minimal.config"
>>> configs/stm32f469_disco_defconfig:BR2_PACKAGE_BUSYBOX_CONFIG="package/busybox/busybox-minimal.config"
>>>
>>> Could you try to use this one ?
>>
>> Yes, the minimal config work. but it gives me a rootfs cpio image of 650KB
>> while the one I added is even smaller and results in a rootf of 350KB. 300KB
>> saved on a board with only 8MB of SRAM, that is not negligible...
>
> Agreed. Perhaps we should change our busybox-minimal.config ? It would
> be nice to diff yours against busybox-minimal.config and see if we can
> get to a common conclusion.
>
> As you can imagine, we're trying to avoid the situation where every
> single board would have its own custom Busybox configuration file, with
> a semi-random selection of tools.
OK. Let me check.
>
>>>> +# Minimal device set before mounting devtpmfs
>>>> +/dev/null c 666 0 0 1 3 0 0 -
>>>> +/dev/zero c 666 0 0 1 5 0 0 -
>>>> +/dev/random c 666 0 0 1 8 0 0 -
>>>> +/dev/urandom c 666 0 0 1 9 0 0 -
>>>> +/dev/console c 666 0 0 5 1 - - -
>>>> +/dev/tty c 666 0 0 5 0 - - -
>>>> +/dev/tty0 c 666 0 0 4 0 0 0 -
>>>> +/dev/ttySIF0 c 666 0 0 4 64 0 0 -
>>>> +/dev/ptmx c 666 0 0 5 2 - - -
>>>
>>> I see in your /init script that you are mount devtmpfs, so a custom
>>> device table for static /dev should not be needed. Could you explain
>>> why this device table is necessary ?
>>
>> The init process is just a shell. So if I do not create at least the console
>> files, I see errors "could not open console" when the init process is started by
>> the kernel as devtmpfs is not yet mounted. Will check again.
>
> If you enable BR2_ROOTFS_DEVICE_CREATION_DYNAMIC_DEVTMPFS, then
> Buildroot doesn't use any static device table, but since in the
> initramfs case devtmpfs is not mounted by the kernel, /dev/console is
> created anyway by Buildroot in the image. See fs/cpio/cpio.mk:
>
> define ROOTFS_CPIO_ADD_INIT
> if [ ! -e $(TARGET_DIR)/init ]; then \
> $(INSTALL) -m 0755 fs/cpio/init $(TARGET_DIR)/init; \
> fi
> mkdir -p $(TARGET_DIR)/dev
> mknod -m 0622 $(TARGET_DIR)/dev/console c 5 1
> endef
>
> So, /dev/console should be there without having a custom device table.
> This should allow your /init script to run and mount devtmpfs.
>
> BTW, you probably want your /init script to be modeled after
> fs/cpio/init, except for the last line where you would exec /bin/sh
> instead of exec /sbin/init of course.
I checked again and I do not need the device table at all. The error I was
seeing is not here. Might have got confused with something else.
Will revisit the init too to follow fs/cpio/init more closely.
>
>>>> +rm -rf "$TARGET_DIR"/var/www > /dev/null 2>&1
>>>> +rm -rf "$TARGET_DIR"/media > /dev/null 2>&1
>>>
>>> What is in /var/www and /media that takes so much space? In a default
>>> Buildroot configuration, those folders should be empty.
>>
>> They are. Frankly, I could drop this. But as that is totally not needed,
>> removing them can save a block or so on the cpio image. Memory saving again, but
>> likely not much here.
>
> OK, we could keep that I guess then. No need for the >/dev/null 2>&1 I
> guess, since rm -rf ignores errors.
I dropped this too. It was not making any difference on the final rootfs size.
>>>> diff --git a/board/kendryte/k210/patches/uclibc/0001-Revert-Fix-static-linking-with-GCC-10.patch b/board/kendryte/k210/patches/uclibc/0001-Revert-Fix-static-linking-with-GCC-10.patch
>>>
>>> None of the uClibc patches here are board-specific, so they should be
>>> added to package/uclibc/. In fact, I think the gcc10 patches would fix
>>> some build issues we have in our autobuilders:
>>>
>>> http://autobuild.buildroot.net/?reason=uclibc-1.0.35
>>
>> I could not get gcc10 builds to work. The static build is broken and uclibc seem
>> to imply as much. As I was afraid of the potential impact of these patches on
>> other builds, I put them as board specific for now. I intend to send them to
>> uclibc too. Thoughts ? Should I keep this as is for now ?
>
> We need to look more closely at the patches, but having them
> board-specific is not ideal. Perhaps this is something that can be
> worked on with upstream uClibc?
I will send them upstream to uclibc too. I moved the patches under
package/uclibc for now.
>>> So with the normal Busybox init you don't have enough memory? Is this
>>> platform using XIP, or is the code loaded into SRAM ? Indeed, 8 MB of
>>> SRAM is quite a lot if you are running code from flash. But if indeed
>>> the entire kernel is loaded into SRAM because you don't have XIP
>>> support, the story is a bit different.
>>
>> No XIP. Kernel + embedded initramfs and dtb all end up in memory. SD card is not
>> working yet, so this is really the only solution for now. Once I get the SD card
>> to work, the initramfs can go onto the SD card, which will improve things.
>
> OK. But supporting the SD card will not improve the memory consumption,
> just give you more storage space.
It will improve memory consumption since only running processes will use memory.
Right now, the entire initramfs being in memory, memory is used even without
anything running. With the SD card, no initramfs is needed (no kernel module).
re-checking and testing everything now. Will send a V2 shortly.
Thanks !
--
Damien Le Moal
Western Digital Research
^ permalink raw reply [flat|nested] 15+ messages in thread
* [Buildroot] [PATCH 5/5] Add support for Kendryte K210 based RISC-V boards
2020-09-08 9:07 ` Thomas Petazzoni
2020-09-08 9:32 ` Damien Le Moal
@ 2020-09-08 10:47 ` Damien Le Moal
2020-09-08 11:08 ` Thomas Petazzoni
1 sibling, 1 reply; 15+ messages in thread
From: Damien Le Moal @ 2020-09-08 10:47 UTC (permalink / raw)
To: buildroot
On 2020/09/08 18:07, Thomas Petazzoni wrote:
> Hello Damien,
>
> On Tue, 8 Sep 2020 08:02:15 +0000
> Damien Le Moal <Damien.LeMoal@wdc.com> wrote:
>
>>> configs/qemu_arm_versatile_nommu_defconfig:BR2_PACKAGE_BUSYBOX_CONFIG="package/busybox/busybox-minimal.config"
>>> configs/qemu_m68k_mcf5208_defconfig:BR2_PACKAGE_BUSYBOX_CONFIG="package/busybox/busybox-minimal.config"
>>> configs/stm32f429_disco_defconfig:BR2_PACKAGE_BUSYBOX_CONFIG="package/busybox/busybox-minimal.config"
>>> configs/stm32f469_disco_defconfig:BR2_PACKAGE_BUSYBOX_CONFIG="package/busybox/busybox-minimal.config"
>>>
>>> Could you try to use this one ?
>>
>> Yes, the minimal config work. but it gives me a rootfs cpio image of 650KB
>> while the one I added is even smaller and results in a rootf of 350KB. 300KB
>> saved on a board with only 8MB of SRAM, that is not negligible...
>
> Agreed. Perhaps we should change our busybox-minimal.config ? It would
> be nice to diff yours against busybox-minimal.config and see if we can
> get to a common conclusion.
>
> As you can imagine, we're trying to avoid the situation where every
> single board would have its own custom Busybox configuration file, with
> a semi-random selection of tools.
I checked the differences. Mostly, they come from me removing all the file
related tools since there is no SD card on the board, so no real file system
beside in-RAM rootfs.
Given the memory savings this k210 busybox config gives, I would like to keep it
as is for now, until I get to add the SD card support in the kernel, at which
point switching back to the default minimal busybox config will make perfect
sense. What do you think ?
Apart from this, I removed the uclibc config (not needed) and use the default.
The init script is fixed and the overall, everything is much simpler. If you do
not have any objection, I will post V2 of the series.
--
Damien Le Moal
Western Digital Research
^ permalink raw reply [flat|nested] 15+ messages in thread
* [Buildroot] [PATCH 5/5] Add support for Kendryte K210 based RISC-V boards
2020-09-08 10:47 ` Damien Le Moal
@ 2020-09-08 11:08 ` Thomas Petazzoni
2020-09-08 11:08 ` Damien Le Moal
[not found] ` <20200908122138.GB31727@lst.de>
0 siblings, 2 replies; 15+ messages in thread
From: Thomas Petazzoni @ 2020-09-08 11:08 UTC (permalink / raw)
To: buildroot
On Tue, 8 Sep 2020 10:47:35 +0000
Damien Le Moal <Damien.LeMoal@wdc.com> wrote:
> I checked the differences. Mostly, they come from me removing all the file
> related tools since there is no SD card on the board, so no real file system
> beside in-RAM rootfs.
>
> Given the memory savings this k210 busybox config gives, I would like to keep it
> as is for now, until I get to add the SD card support in the kernel, at which
> point switching back to the default minimal busybox config will make perfect
> sense. What do you think ?
>
> Apart from this, I removed the uclibc config (not needed) and use the default.
> The init script is fixed and the overall, everything is much simpler. If you do
> not have any objection, I will post V2 of the series.
Sounds good to me, I'm fine with a custom Busybox config file for the
time being. Perhaps justify that in the commit log so we have a trace
somewhere of why we accepted a custom Busybox config file.
Thanks!
Thomas
--
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
^ permalink raw reply [flat|nested] 15+ messages in thread
* [Buildroot] [PATCH 5/5] Add support for Kendryte K210 based RISC-V boards
2020-09-08 11:08 ` Thomas Petazzoni
@ 2020-09-08 11:08 ` Damien Le Moal
[not found] ` <20200908122138.GB31727@lst.de>
1 sibling, 0 replies; 15+ messages in thread
From: Damien Le Moal @ 2020-09-08 11:08 UTC (permalink / raw)
To: buildroot
On 2020/09/08 20:08, Thomas Petazzoni wrote:
> On Tue, 8 Sep 2020 10:47:35 +0000
> Damien Le Moal <Damien.LeMoal@wdc.com> wrote:
>
>> I checked the differences. Mostly, they come from me removing all the file
>> related tools since there is no SD card on the board, so no real file system
>> beside in-RAM rootfs.
>>
>> Given the memory savings this k210 busybox config gives, I would like to keep it
>> as is for now, until I get to add the SD card support in the kernel, at which
>> point switching back to the default minimal busybox config will make perfect
>> sense. What do you think ?
>>
>> Apart from this, I removed the uclibc config (not needed) and use the default.
>> The init script is fixed and the overall, everything is much simpler. If you do
>> not have any objection, I will post V2 of the series.
>
> Sounds good to me, I'm fine with a custom Busybox config file for the
> time being. Perhaps justify that in the commit log so we have a trace
> somewhere of why we accepted a custom Busybox config file.
OK. Will add that.
>
> Thanks!
>
> Thomas
>
--
Damien Le Moal
Western Digital Research
^ permalink raw reply [flat|nested] 15+ messages in thread
* [Buildroot] [PATCH 5/5] Add support for Kendryte K210 based RISC-V boards
[not found] ` <20200908122138.GB31727@lst.de>
@ 2020-09-08 23:16 ` Damien Le Moal
0 siblings, 0 replies; 15+ messages in thread
From: Damien Le Moal @ 2020-09-08 23:16 UTC (permalink / raw)
To: buildroot
On 2020/09/08 21:21, Christoph Hellwig wrote:
> On Tue, Sep 08, 2020 at 01:08:06PM +0200, Thomas Petazzoni wrote:
>> Sounds good to me, I'm fine with a custom Busybox config file for the
>> time being. Perhaps justify that in the commit log so we have a trace
>> somewhere of why we accepted a custom Busybox config file.
>
> Maybe give the busybox config a more generic name like initramfs-only
> to document the purpose?
>
Yes, good idea. Will do that in addition to the commit message rewrite.
--
Damien Le Moal
Western Digital Research
^ permalink raw reply [flat|nested] 15+ messages in thread
end of thread, other threads:[~2020-09-08 23:16 UTC | newest]
Thread overview: 15+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-09-08 5:16 [Buildroot] [PATCH 0/5] Add support for Kendryte K210 RISC-V boards Damien Le Moal
2020-09-08 5:16 ` [Buildroot] [PATCH 1/5] toolchain/buildroot: allow uclibc-ng for riscv Damien Le Moal
2020-09-08 5:16 ` [Buildroot] [PATCH 2/5] arch/config: Make RISC-V MMU optional Damien Le Moal
2020-09-08 5:16 ` [Buildroot] [PATCH 3/5] package/elf2flt: add RISC-V support Damien Le Moal
[not found] ` <20200908053821.GA13505@lst.de>
2020-09-08 6:00 ` Damien Le Moal
2020-09-08 5:16 ` [Buildroot] [PATCH 4/5] package make: build nommu builds as linux Damien Le Moal
2020-09-08 5:16 ` [Buildroot] [PATCH 5/5] Add support for Kendryte K210 based RISC-V boards Damien Le Moal
2020-09-08 7:17 ` Thomas Petazzoni
2020-09-08 8:02 ` Damien Le Moal
2020-09-08 9:07 ` Thomas Petazzoni
2020-09-08 9:32 ` Damien Le Moal
2020-09-08 10:47 ` Damien Le Moal
2020-09-08 11:08 ` Thomas Petazzoni
2020-09-08 11:08 ` Damien Le Moal
[not found] ` <20200908122138.GB31727@lst.de>
2020-09-08 23:16 ` Damien Le Moal
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox