summaryrefslogtreecommitdiff
path: root/system
diff options
context:
space:
mode:
authorThomas Petazzoni <thomas.petazzoni@free-electrons.com>2015-07-14 10:13:18 +0200
committerThomas Petazzoni <thomas.petazzoni@free-electrons.com>2015-07-14 10:13:18 +0200
commitddc63be5294af5418207564ffb5ab1ecc3f9b055 (patch)
tree770f389d2473caf8c1bf9bce9e66d87cd5c3672d /system
parent34f95bf9dbb0a2698d425975d83a92fa5e7ca0aa (diff)
system: fix BR2_INIT_NONE / BR2_INIT_SYSTEMD build
Following the introduction of the initscripts package in commit 89d39fc7a392530be043bac541ade0bef746edb6 ("initscripts: new package"), the /etc/inittab file is no longer part of the skeleton, and therefore is not always installed. However, system/system.mk tweaks the inittab for getty and filesystem remount as rw, without taking the precautions of whether the init system is Busybox or SysV. This commit fixes that by adding the necessary conditions around the code adjusting the inittab file. Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Diffstat (limited to 'system')
-rw-r--r--system/system.mk6
1 files changed, 4 insertions, 2 deletions
diff --git a/system/system.mk b/system/system.mk
index fd94e03a2..e44f64cc8 100644
--- a/system/system.mk
+++ b/system/system.mk
@@ -89,14 +89,14 @@ endif
TARGET_FINALIZE_HOOKS += SYSTEM_BIN_SH
ifeq ($(BR2_TARGET_GENERIC_GETTY),y)
-ifeq ($(BR2_PACKAGE_SYSVINIT),y)
+ifeq ($(BR2_INIT_SYSV),y)
# In sysvinit inittab, the "id" must not be longer than 4 bytes, so we
# skip the "tty" part and keep only the remaining.
define SYSTEM_GETTY
$(SED) '/# GENERIC_SERIAL$$/s~^.*#~$(shell echo $(TARGET_GENERIC_GETTY_PORT) | tail -c+4)::respawn:/sbin/getty -L $(TARGET_GENERIC_GETTY_OPTIONS) $(TARGET_GENERIC_GETTY_PORT) $(TARGET_GENERIC_GETTY_BAUDRATE) $(TARGET_GENERIC_GETTY_TERM) #~' \
$(TARGET_DIR)/etc/inittab
endef
-else
+else ifeq ($(BR2_INIT_BUSYBOX),y)
# Add getty to busybox inittab
define SYSTEM_GETTY
$(SED) '/# GENERIC_SERIAL$$/s~^.*#~$(TARGET_GENERIC_GETTY_PORT)::respawn:/sbin/getty -L $(TARGET_GENERIC_GETTY_OPTIONS) $(TARGET_GENERIC_GETTY_PORT) $(TARGET_GENERIC_GETTY_BAUDRATE) $(TARGET_GENERIC_GETTY_TERM) #~' \
@@ -106,6 +106,7 @@ endif
TARGET_FINALIZE_HOOKS += SYSTEM_GETTY
endif
+ifeq ($(BR2_INIT_BUSYBOX)$(BR2_INIT_SYSV),y)
ifeq ($(BR2_TARGET_GENERIC_REMOUNT_ROOTFS_RW),y)
# Find commented line, if any, and remove leading '#'s
define SYSTEM_REMOUNT_RW
@@ -118,5 +119,6 @@ define SYSTEM_REMOUNT_RW
endef
endif
TARGET_FINALIZE_HOOKS += SYSTEM_REMOUNT_RW
+endif
endif # BR2_ROOTFS_SKELETON_DEFAULT