Skip to contentSkip to conversation

busybox: Add shell arithmetic to work with poky-tiny

PATCH In review Alejandro Hernandez Samaniego 3 participants 5 messages Jan 22, 2022 – Jan 26, 2022

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 busybox: Add shell arithmetic to work with poky-tiny

Fix error when trying to boot core-image-tiny-initramfs:

/init: line 144: syntax error: support for $((arith)) is disabled

Kernel panic - not syncing: Attempted to kill init!

[YOCTO #14702]

---
 meta-poky/recipes-core/busybox/busybox/poky-tiny/defconfig | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
meta-poky/recipes-core/busybox/busybox/poky-tiny/defconfig +1 -1
index b0fb88a0c1..6e9faa4119 100644
@@ -1160,7 +1160,7 @@ CONFIG_CTTYHACK=y
 #
 # Options common to all shells
 #
-# CONFIG_FEATURE_SH_MATH is not set
+CONFIG_FEATURE_SH_MATH=y
 # CONFIG_FEATURE_SH_MATH_64 is not set
 # CONFIG_FEATURE_SH_MATH_BASE is not set
 CONFIG_FEATURE_SH_EXTRA_QUIET=y
Signature · 1 line
2.25.1
#1 lore raw
Quoted 17 lines · Alejandro Hernandez Samaniego

Fix error when trying to boot core-image-tiny-initramfs:

/init: line 144: syntax error: support for $((arith)) is disabled

Kernel panic - not syncing: Attempted to kill init!

[YOCTO #14702]

---
  meta-poky/recipes-core/busybox/busybox/poky-tiny/defconfig | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
meta-poky/recipes-core/busybox/busybox/poky-tiny/defconfig +0 -0
index b0fb88a0c1..6e9faa4119 100644

meta-poky/recipes-core/busybox/busybox/poky-tiny/defconfig CONFIG_CTTYHACK=y · line 1163

Quoted 5 lines
meta-poky/recipes-core/busybox/busybox/poky-tiny/defconfig +1 -1
@@ -1160,7 +1160,7 @@ CONFIG_CTTYHACK=y
  #
  # Options common to all shells
  #
-# CONFIG_FEATURE_SH_MATH is not set
+CONFIG_FEATURE_SH_MATH=y

how much does it add to binary size ?

Quoted 8 lines
meta-poky/recipes-core/busybox/busybox/poky-tiny/defconfig +0 -0
  # CONFIG_FEATURE_SH_MATH_64 is not set
  # CONFIG_FEATURE_SH_MATH_BASE is not set
  CONFIG_FEATURE_SH_EXTRA_QUIET=y
#2 lore raw
Quoted 18 lines · Khem Raj
Quoted 8 lines · Alejandro Hernandez Samaniego

Fix error when trying to boot core-image-tiny-initramfs:

/init: line 144: syntax error: support for $((arith)) is disabled

Kernel panic - not syncing: Attempted to kill init!

[YOCTO #14702]

Signed-off-by Alejandro Enedino Hernandez Samaniego <

[email protected]>

Review

Quoted 5 lines
---
  meta-poky/recipes-core/busybox/busybox/poky-tiny/defconfig | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
(quoted diff) +0 -0

b/meta-poky/recipes-core/busybox/busybox/poky-tiny/defconfig

Quoted 12 lines

meta-poky/recipes-core/busybox/busybox/poky-tiny/defconfig CONFIG_CTTYHACK=y · line 1163

Quoted 9 lines

index b0fb88a0c1..6e9faa4119 100644

meta-poky/recipes-core/busybox/busybox/poky-tiny/defconfig +1 -1
@@ -1160,7 +1160,7 @@ CONFIG_CTTYHACK=y
  #
  # Options common to all shells
  #
-# CONFIG_FEATURE_SH_MATH is not set
+CONFIG_FEATURE_SH_MATH=y

Hey Khem,

This adds 12KB to the compiled binary (less than 1%) and does not reflect on the installed binary size, its required both by the tiny-init and the initramfs-framework which throws the same error.

Alejandro

Quoted 14 lines

how much does it add to binary size ?

Quoted 8 lines
meta-poky/recipes-core/busybox/busybox/poky-tiny/defconfig +0 -0
  # CONFIG_FEATURE_SH_MATH_64 is not set
  # CONFIG_FEATURE_SH_MATH_BASE is not set
  CONFIG_FEATURE_SH_EXTRA_QUIET=y
#3 lore raw
Quoted 31 lines · Alejandro Hernandez
Quoted 16 lines · Khem Raj
Quoted 12 lines · Alejandro Hernandez Samaniego

Fix error when trying to boot core-image-tiny-initramfs:

/init: line 144: syntax error: support for $((arith)) is disabled

Kernel panic - not syncing: Attempted to kill init!

[YOCTO #14702]

---
  meta-poky/recipes-core/busybox/busybox/poky-tiny/defconfig | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
Quoted 12 lines

meta-poky/recipes-core/busybox/busybox/poky-tiny/defconfig CONFIG_CTTYHACK=y · line 1163

Quoted 10 lines
meta-poky/recipes-core/busybox/busybox/poky-tiny/defconfig +1 -1
index b0fb88a0c1..6e9faa4119 100644
@@ -1160,7 +1160,7 @@ CONFIG_CTTYHACK=y
  #
  # Options common to all shells
  #
-# CONFIG_FEATURE_SH_MATH is not set
+CONFIG_FEATURE_SH_MATH=y
Quoted 2 lines

Hey Khem,
This adds 12KB to the compiled binary (less than 1%) and does not reflect on the installed binary size, its required both by the tiny-init and the initramfs-framework which throws the same error.

yeah perhaps using $((arith)) could be avoided in these shell scripts but I guess it should be ok if thats too hard.

Quoted 18 lines

Alejandro

Quoted 14 lines

how much does it add to binary size ?

Quoted 8 lines
meta-poky/recipes-core/busybox/busybox/poky-tiny/defconfig +0 -0
  # CONFIG_FEATURE_SH_MATH_64 is not set
  # CONFIG_FEATURE_SH_MATH_BASE is not set
  CONFIG_FEATURE_SH_EXTRA_QUIET=y
#4 lore raw
Quoted 36 lines · Khem Raj
Quoted 7 lines · Alejandro Hernandez
Quoted 4 lines · Khem Raj

On 1/22/22 2:33 PM, Alejandro Hernandez Samaniego wrote:

Quoted 8 lines
Quoted 8 lines
Quoted 8 lines

Fix error when trying to boot core-image-tiny-initramfs:

/init: line 144: syntax error: support for $((arith)) is disabled

Kernel panic - not syncing: Attempted to kill init!

[YOCTO #14702]

Signed-off-by Alejandro Enedino Hernandez Samaniego <

[email protected]>

Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
---
  meta-poky/recipes-core/busybox/busybox/poky-tiny/defconfig | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)

diff --git

a/meta-poky/recipes-core/busybox/busybox/poky-tiny/defconfig b/meta-poky/recipes-core/busybox/busybox/poky-tiny/defconfig

Quoted 11 lines
Quoted 11 lines
Quoted 9 lines

index b0fb88a0c1..6e9faa4119 100644

meta-poky/recipes-core/busybox/busybox/poky-tiny/defconfig +1 -1
@@ -1160,7 +1160,7 @@ CONFIG_CTTYHACK=y
  #
  # Options common to all shells
  #
-# CONFIG_FEATURE_SH_MATH is not set
+CONFIG_FEATURE_SH_MATH=y
Quoted 8 lines
Quoted 2 lines

Hey Khem,
This adds 12KB to the compiled binary (less than 1%) and does not

reflect on the installed binary size, its required both by the tiny-init and the initramfs-framework which throws the same error.

yeah perhaps using $((arith)) could be avoided in these shell scripts but I guess it should be ok if thats too hard.

Its true, my initial thought was to fix tiny-init but when I saw that initramfs-framework is also
failing I thought adding it here was worth it.

Quoted 19 lines
Quoted 18 lines

Alejandro

Quoted 14 lines

how much does it add to binary size ?

Quoted 8 lines
meta-poky/recipes-core/busybox/busybox/poky-tiny/defconfig +0 -0
  # CONFIG_FEATURE_SH_MATH_64 is not set
  # CONFIG_FEATURE_SH_MATH_BASE is not set
  CONFIG_FEATURE_SH_EXTRA_QUIET=y