Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH] system/inittab: update to fix bug #7442
@ 2014-10-22 19:36 Gustavo Zacarias
  2014-10-24 23:08 ` Yann E. MORIN
  2014-10-24 23:28 ` Peter Korsgaard
  0 siblings, 2 replies; 3+ messages in thread
From: Gustavo Zacarias @ 2014-10-22 19:36 UTC (permalink / raw)
  To: buildroot

Update inittabs (skeleton/busybox & sysvinit) to remove the trailing
REMOUNT_ROOTFS_RW comment used as magic string in system/system.mk to
enable/disable remounting the root filesystem rw or not since it affects
sysvinit in doing so properly as reported in bug #7442.

Instead update the sed expressions to match clean non-commented strings
by searching for "-o remount,rw /" and checking that's the end of the
line as well to avoid affecting possibly other remounts that a user can
have in a custom inittab.

Long-term the startup block of inittab should just move to a S00sysinit
script or similar so that rcS can pick it up directly.

Signed-off-by: Gustavo Zacarias <gustavo@zacarias.com.ar>
---
 package/sysvinit/inittab    | 2 +-
 system/skeleton/etc/inittab | 2 +-
 system/system.mk            | 4 ++--
 3 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/package/sysvinit/inittab b/package/sysvinit/inittab
index d3de4a7..fd0d2f0 100644
--- a/package/sysvinit/inittab
+++ b/package/sysvinit/inittab
@@ -5,7 +5,7 @@
 id:1:initdefault:
 
 proc::sysinit:/bin/mount -t proc proc /proc
-rwmo::sysinit:/bin/mount -o remount,rw / # REMOUNT_ROOTFS_RW
+rwmo::sysinit:/bin/mount -o remount,rw /
 dpts::sysinit:/bin/mkdir -p /dev/pts
 dshm::sysinit:/bin/mkdir -p /dev/shm
 moun::sysinit:/bin/mount -a
diff --git a/system/skeleton/etc/inittab b/system/skeleton/etc/inittab
index 85881f4..99d84e4 100644
--- a/system/skeleton/etc/inittab
+++ b/system/skeleton/etc/inittab
@@ -15,7 +15,7 @@
 
 # Startup the system
 null::sysinit:/bin/mount -t proc proc /proc
-null::sysinit:/bin/mount -o remount,rw / # REMOUNT_ROOTFS_RW
+null::sysinit:/bin/mount -o remount,rw /
 null::sysinit:/bin/mkdir -p /dev/pts
 null::sysinit:/bin/mkdir -p /dev/shm
 null::sysinit:/bin/mount -a
diff --git a/system/system.mk b/system/system.mk
index 5802e2d..e4a3160 100644
--- a/system/system.mk
+++ b/system/system.mk
@@ -79,12 +79,12 @@ endif
 ifeq ($(BR2_TARGET_GENERIC_REMOUNT_ROOTFS_RW),y)
 # Find commented line, if any, and remove leading '#'s
 define SYSTEM_REMOUNT_RW
-	$(SED) '/^#.*# REMOUNT_ROOTFS_RW$$/s~^#\+~~' $(TARGET_DIR)/etc/inittab
+	$(SED) '/^#.*-o remount,rw \/$$/s~^#\+~~' $(TARGET_DIR)/etc/inittab
 endef
 else
 # Find uncommented line, if any, and add a leading '#'
 define SYSTEM_REMOUNT_RW
-	$(SED) '/^[^#].*# REMOUNT_ROOTFS_RW$$/s~^~#~' $(TARGET_DIR)/etc/inittab
+	$(SED) '/^[^#].*-o remount,rw \/$$/s~^~#~' $(TARGET_DIR)/etc/inittab
 endef
 endif
 TARGET_FINALIZE_HOOKS += SYSTEM_REMOUNT_RW
-- 
2.0.4

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [Buildroot] [PATCH] system/inittab: update to fix bug #7442
  2014-10-22 19:36 [Buildroot] [PATCH] system/inittab: update to fix bug #7442 Gustavo Zacarias
@ 2014-10-24 23:08 ` Yann E. MORIN
  2014-10-24 23:28 ` Peter Korsgaard
  1 sibling, 0 replies; 3+ messages in thread
From: Yann E. MORIN @ 2014-10-24 23:08 UTC (permalink / raw)
  To: buildroot

Gustavo, All,

On 2014-10-22 16:36 -0300, Gustavo Zacarias spake thusly:
> Update inittabs (skeleton/busybox & sysvinit) to remove the trailing
> REMOUNT_ROOTFS_RW comment used as magic string in system/system.mk to
> enable/disable remounting the root filesystem rw or not since it affects
> sysvinit in doing so properly as reported in bug #7442.
> 
> Instead update the sed expressions to match clean non-commented strings
> by searching for "-o remount,rw /" and checking that's the end of the
> line as well to avoid affecting possibly other remounts that a user can
> have in a custom inittab.
> 
> Long-term the startup block of inittab should just move to a S00sysinit
> script or similar so that rcS can pick it up directly.
> 
> Signed-off-by: Gustavo Zacarias <gustavo@zacarias.com.ar>

Reviewed-by: "Yann E. MORIN" <yann.morin.1998@free.fr>

Regards,
Yann E. MORIN.

> ---
>  package/sysvinit/inittab    | 2 +-
>  system/skeleton/etc/inittab | 2 +-
>  system/system.mk            | 4 ++--
>  3 files changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/package/sysvinit/inittab b/package/sysvinit/inittab
> index d3de4a7..fd0d2f0 100644
> --- a/package/sysvinit/inittab
> +++ b/package/sysvinit/inittab
> @@ -5,7 +5,7 @@
>  id:1:initdefault:
>  
>  proc::sysinit:/bin/mount -t proc proc /proc
> -rwmo::sysinit:/bin/mount -o remount,rw / # REMOUNT_ROOTFS_RW
> +rwmo::sysinit:/bin/mount -o remount,rw /
>  dpts::sysinit:/bin/mkdir -p /dev/pts
>  dshm::sysinit:/bin/mkdir -p /dev/shm
>  moun::sysinit:/bin/mount -a
> diff --git a/system/skeleton/etc/inittab b/system/skeleton/etc/inittab
> index 85881f4..99d84e4 100644
> --- a/system/skeleton/etc/inittab
> +++ b/system/skeleton/etc/inittab
> @@ -15,7 +15,7 @@
>  
>  # Startup the system
>  null::sysinit:/bin/mount -t proc proc /proc
> -null::sysinit:/bin/mount -o remount,rw / # REMOUNT_ROOTFS_RW
> +null::sysinit:/bin/mount -o remount,rw /
>  null::sysinit:/bin/mkdir -p /dev/pts
>  null::sysinit:/bin/mkdir -p /dev/shm
>  null::sysinit:/bin/mount -a
> diff --git a/system/system.mk b/system/system.mk
> index 5802e2d..e4a3160 100644
> --- a/system/system.mk
> +++ b/system/system.mk
> @@ -79,12 +79,12 @@ endif
>  ifeq ($(BR2_TARGET_GENERIC_REMOUNT_ROOTFS_RW),y)
>  # Find commented line, if any, and remove leading '#'s
>  define SYSTEM_REMOUNT_RW
> -	$(SED) '/^#.*# REMOUNT_ROOTFS_RW$$/s~^#\+~~' $(TARGET_DIR)/etc/inittab
> +	$(SED) '/^#.*-o remount,rw \/$$/s~^#\+~~' $(TARGET_DIR)/etc/inittab
>  endef
>  else
>  # Find uncommented line, if any, and add a leading '#'
>  define SYSTEM_REMOUNT_RW
> -	$(SED) '/^[^#].*# REMOUNT_ROOTFS_RW$$/s~^~#~' $(TARGET_DIR)/etc/inittab
> +	$(SED) '/^[^#].*-o remount,rw \/$$/s~^~#~' $(TARGET_DIR)/etc/inittab
>  endef
>  endif
>  TARGET_FINALIZE_HOOKS += SYSTEM_REMOUNT_RW
> -- 
> 2.0.4
> 
> _______________________________________________
> buildroot mailing list
> buildroot at busybox.net
> http://lists.busybox.net/mailman/listinfo/buildroot

-- 
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 223 225 172 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [Buildroot] [PATCH] system/inittab: update to fix bug #7442
  2014-10-22 19:36 [Buildroot] [PATCH] system/inittab: update to fix bug #7442 Gustavo Zacarias
  2014-10-24 23:08 ` Yann E. MORIN
@ 2014-10-24 23:28 ` Peter Korsgaard
  1 sibling, 0 replies; 3+ messages in thread
From: Peter Korsgaard @ 2014-10-24 23:28 UTC (permalink / raw)
  To: buildroot

>>>>> "Gustavo" == Gustavo Zacarias <gustavo@zacarias.com.ar> writes:

 > Update inittabs (skeleton/busybox & sysvinit) to remove the trailing
 > REMOUNT_ROOTFS_RW comment used as magic string in system/system.mk to
 > enable/disable remounting the root filesystem rw or not since it affects
 > sysvinit in doing so properly as reported in bug #7442.

 > Instead update the sed expressions to match clean non-commented strings
 > by searching for "-o remount,rw /" and checking that's the end of the
 > line as well to avoid affecting possibly other remounts that a user can
 > have in a custom inittab.

 > Long-term the startup block of inittab should just move to a S00sysinit
 > script or similar so that rcS can pick it up directly.

 > Signed-off-by: Gustavo Zacarias <gustavo@zacarias.com.ar>

Committed, thanks.

-- 
Bye, Peter Korsgaard

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2014-10-24 23:28 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-10-22 19:36 [Buildroot] [PATCH] system/inittab: update to fix bug #7442 Gustavo Zacarias
2014-10-24 23:08 ` Yann E. MORIN
2014-10-24 23:28 ` Peter Korsgaard

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox