Skip to contentSkip to conversation

busybox: Don't overwrite existing inittab

PATCH New Paul Cercueil 3 participants 3 messages Dec 6, 2019 – Dec 22, 2019

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 busybox: Don't overwrite existing inittab

If a inittab file was already provided in the skeleton, don't overwrite it with the one that comes with the busybox package.

---
 package/busybox/busybox.mk | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
package/busybox/busybox.mk +3 -1
index 301e72bdd2..e5d2f1bd0c 100644
@@ -277,7 +277,9 @@ endif
 
 ifeq ($(BR2_INIT_BUSYBOX),y)
 define BUSYBOX_INSTALL_INITTAB
-	$(INSTALL) -D -m 0644 package/busybox/inittab $(TARGET_DIR)/etc/inittab
+	if test ! -r $(TARGET_DIR)/etc/inittab; then \
+		$(INSTALL) -D -m 0644 package/busybox/inittab $(TARGET_DIR)/etc/inittab; \
+	fi
 endef
 endif
 
Signature · 1 line
2.24.0
#1 lore raw

PATCH 1/1 busybox: Don't overwrite existing inittab

Quoted 13 lines · On Fri, 6 Dec 2019 13:31:54 +0100 Paul Cercueil <[email protected]> wrote:

If a inittab file was already provided in the skeleton, don't overwrite it with the one that comes with the busybox package.

---
 package/busybox/busybox.mk | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
package/busybox/busybox.mk +0 -0
index 301e72bdd2..e5d2f1bd0c 100644

package/busybox/busybox.mk endif · line 280

Quoted 5 lines
package/busybox/busybox.mk +1 -1
@@ -277,7 +277,9 @@ endif
 
 ifeq ($(BR2_INIT_BUSYBOX),y)
 define BUSYBOX_INSTALL_INITTAB
-	$(INSTALL) -D -m 0644 package/busybox/inittab $(TARGET_DIR)/etc/inittab
+	if test ! -r $(TARGET_DIR)/etc/inittab; then \

We more commonly use test -e and not test -r for this kind of tests, so I've changed to use test -e, and applied to master. Thanks!

Note that we normally recommend to override such files using a rootfs overlay instead of a skeleton, as a rootfs overlay always wins over whatever Buildroot packages might do.

Best regards,

Thomas

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

PATCH 1/1 busybox: Don't overwrite existing inittab

In reply to Paul Cercueil
Quoted 6 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"Paul" == Paul Cercueil <[email protected]> writes:

If a inittab file was already provided in the skeleton, don't overwrite it with the one that comes with the busybox package.

Committed to 2019.02.x and 2019.11.x, thanks.

Signature · 1 line
Bye, Peter Korsgaard