diff options
author | 2017-07-18 19:25:33 +0200 | |
---|---|---|
committer | 2017-07-22 22:34:40 +0200 | |
commit | 5a8484dec291cedc3bbf239921f5dc8467b9e657 (patch) | |
tree | 4b7e4a6bd01ee6d2453a1c4d800bd218fe1cf8e2 /system | |
parent | b07ccc47cb511b877e6e7bb45c511e0646cb5528 (diff) | |
download | buildroot-5a8484dec291cedc3bbf239921f5dc8467b9e657.tar.gz buildroot-5a8484dec291cedc3bbf239921f5dc8467b9e657.tar.bz2 |
system: move remounting / to the corresponding init systems
Currently, remounting / read-write (or not) is done by the skeleton
package when the init system is either busybox or sysvinit, by
registering a target-finalize hook; it is not done at all for systemd.
Move registering this target-finalize hook to both of busybox and
sysvinit. Leave systemd alone, we'll take care of it later.
Rename the macro to a more meaningful name, and move it to system.mk
with the other such macros.
Yet a little bit less init-system knowledge in the skeleton.
Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
[Thomas: remove not-so-useful comments, as pointed by Arnout.]
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Diffstat (limited to 'system')
-rw-r--r-- | system/system.mk | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/system/system.mk b/system/system.mk index 7b843dad8e..ca6bf1388f 100644 --- a/system/system.mk +++ b/system/system.mk @@ -28,6 +28,9 @@ # - SYSTEM_GETTY_OPTIONS # the un-quoted getty setting # +# - SYSTEM_REMOUNT_ROOT_INITTAB +# set inittab to remount root read-write or read-only +# # This function handles the merged or non-merged /usr cases ifeq ($(BR2_ROOTFS_MERGED_USR),y) @@ -71,3 +74,15 @@ SYSTEM_GETTY_PORT = $(call qstrip,$(BR2_TARGET_GENERIC_GETTY_PORT)) SYSTEM_GETTY_BAUDRATE = $(call qstrip,$(BR2_TARGET_GENERIC_GETTY_BAUDRATE)) SYSTEM_GETTY_TERM = $(call qstrip,$(BR2_TARGET_GENERIC_GETTY_TERM)) SYSTEM_GETTY_OPTIONS = $(call qstrip,$(BR2_TARGET_GENERIC_GETTY_OPTIONS)) + +ifeq ($(BR2_TARGET_GENERIC_REMOUNT_ROOTFS_RW),y) +# Find commented line, if any, and remove leading '#'s +define SYSTEM_REMOUNT_ROOT_INITTAB + $(SED) '/^#.*-o remount,rw \/$$/s~^#\+~~' $(TARGET_DIR)/etc/inittab +endef +else +# Find uncommented line, if any, and add a leading '#' +define SYSTEM_REMOUNT_ROOT_INITTAB + $(SED) '/^[^#].*-o remount,rw \/$$/s~^~#~' $(TARGET_DIR)/etc/inittab +endef +endif |