Skip to contentSkip to conversation

board/wandboard/post-build.sh: create boot.scr at TARGET_DIR/boot

PATCH New unixmania at gmail.com 4 participants 4 messages Oct 12, 2019 – May 6, 2020

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 board/wandboard/post-build.sh: create boot.scr at TARGET_DIR/boot

From: Carlos Santos <[email protected]>

There is no reason to create boot.scr at board/wandboard and later install it at TARGET_DIR/boot, leaving a stale file behind.

---
 board/wandboard/post-build.sh | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
board/wandboard/post-build.sh +4 -2
index 43e091c5d7..17aa9eefaf 100755
@@ -2,7 +2,9 @@
 
 BOARD_DIR="$(dirname $0)"
 
+install -d -m 755 $TARGET_DIR/boot
+
 $HOST_DIR/bin/mkimage -A arm -O linux -T script -C none  \
--n "boot script" -d $BOARD_DIR/boot.scr.txt $BOARD_DIR/boot.scr
+-n "boot script" -d $BOARD_DIR/boot.scr.txt $TARGET_DIR/boot/boot.scr
 
-install -m 0644 -D $BOARD_DIR/boot.scr $TARGET_DIR/boot/boot.scr
+chmod 644 $TARGET_DIR/boot/boot.scr
Signature · 1 line
2.18.1
#1 lore raw

PATCH 1/1 board/wandboard/post-build.sh: create boot.scr at TARGET_DIR/boot

Quoted 16 lines · unixmania at gmail.com

From: Carlos Santos <[email protected]>

There is no reason to create boot.scr at board/wandboard and later install it at TARGET_DIR/boot, leaving a stale file behind.

---
 board/wandboard/post-build.sh | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
board/wandboard/post-build.sh +0 -0
index 43e091c5d7..17aa9eefaf 100755
@@ -2,7 +2,9 @@
 

board/wandboard/post-build.sh line 10

Quoted 10 lines
board/wandboard/post-build.sh +4 -2
 BOARD_DIR="$(dirname $0)"
 
+install -d -m 755 $TARGET_DIR/boot
+
 $HOST_DIR/bin/mkimage -A arm -O linux -T script -C none  \
--n "boot script" -d $BOARD_DIR/boot.scr.txt $BOARD_DIR/boot.scr
+-n "boot script" -d $BOARD_DIR/boot.scr.txt $TARGET_DIR/boot/boot.scr
 
-install -m 0644 -D $BOARD_DIR/boot.scr $TARGET_DIR/boot/boot.scr
+chmod 644 $TARGET_DIR/boot/boot.scr

Is the chmod even needed? AFAIK mkimage doesn't create any special permissions,
so the umask should apply.

Regards,
Arnout

#2 lore raw

PATCH 1/1 board/wandboard/post-build.sh: create boot.scr at TARGET_DIR/boot

In reply to unixmania at gmail.com

Hello Carlos,

Quoted 9 lines · On Sat, 12 Oct 2019 20:30:41 -0300 unixmania at gmail.com wrote:

From: Carlos Santos <[email protected]>

There is no reason to create boot.scr at board/wandboard and later install it at TARGET_DIR/boot, leaving a stale file behind.

---
 board/wandboard/post-build.sh | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

Applied to master after dropping the additional chmod 644 on the file, as suggested by Arnout. Also, the same issue was present for other boards, so I also did the following commits:

2306339d1fe8d5ea2d9e17641f78a374f612f45e board/udoo/neo: create boot.scr in TARGET_DIR/boot 9ddbd11620b5a01945a438085d45ef2131bad35f board/solidrun/mx6cubox: create boot.scr in TARGET_DIR/boot

What would perhaps be good is to use the BR2_TARGET_UBOOT_BOOT_SCRIPT feature, which would automatically run mkimage and install boot.src in $(BINARIES_DIR). The post-build script would then only have to copy it to $TARGET_DIR/boot/.

Best regards,

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
#3 lore raw

PATCH 1/1 board/wandboard/post-build.sh: create boot.scr at TARGET_DIR/boot

Quoted 20 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"Thomas" == Thomas Petazzoni <[email protected]> writes:

Hello Carlos,

Quoted 9 lines · On Sat, 12 Oct 2019 20:30:41 -0300 unixmania at gmail.com wrote:

From: Carlos Santos <[email protected]>

There is no reason to create boot.scr at board/wandboard and later install it at TARGET_DIR/boot, leaving a stale file behind.

---
board/wandboard/post-build.sh | 6 ++++--

1 file changed, 4 insertions(+), 2 deletions(-)

Applied to master after dropping the additional chmod 644 on the file, as suggested by Arnout. Also, the same issue was present for other boards, so I also did the following commits:

Quoted 7 lines

2306339d1fe8d5ea2d9e17641f78a374f612f45e board/udoo/neo: create boot.scr in TARGET_DIR/boot 9ddbd11620b5a01945a438085d45ef2131bad35f board/solidrun/mx6cubox: create boot.scr in TARGET_DIR/boot

What would perhaps be good is to use the BR2_TARGET_UBOOT_BOOT_SCRIPT feature, which would automatically run mkimage and install boot.src in $(BINARIES_DIR). The post-build script would then only have to copy it to $TARGET_DIR/boot/.

The same set of commits now cherry-picked to 2020.02.x, thanks.

Signature · 1 line
Bye, Peter Korsgaard