mailarchive of the ptxdist mailing list
 help / color / mirror / Atom feed
* [ptxdist] [PATCH 0/2] bbinit: Add rootrw script
@ 2020-12-28  3:59 yd.zhang
  2020-12-28  3:59 ` [ptxdist] [PATCH 1/2] " yd.zhang
  2020-12-28  3:59 ` [ptxdist] [PATCH 2/2] bbinit: Modify the start order of the rc-once script yd.zhang
  0 siblings, 2 replies; 6+ messages in thread
From: yd.zhang @ 2020-12-28  3:59 UTC (permalink / raw)
  To: ptxdist; +Cc: yd.zhang

yd.zhang (2):
  bbinit: Add rootrw script
  bbinit: Modify the start order of the rc-once script

 projectroot/etc/init.d/rootrw | 16 ++++++++++++++++
 rules/initmethod-bbinit.in    | 14 ++++++++++++++
 rules/initmethod-bbinit.make  | 12 ++++++++++++
 rules/rc-once-bbinit.in       |  2 +-
 4 files changed, 43 insertions(+), 1 deletion(-)
 create mode 100644 projectroot/etc/init.d/rootrw

-- 
2.29.2


_______________________________________________
ptxdist mailing list
ptxdist@pengutronix.de
To unsubscribe, send a mail with subject "unsubscribe" to ptxdist-request@pengutronix.de

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

* [ptxdist] [PATCH 1/2] bbinit: Add rootrw script
  2020-12-28  3:59 [ptxdist] [PATCH 0/2] bbinit: Add rootrw script yd.zhang
@ 2020-12-28  3:59 ` yd.zhang
  2020-12-28 10:40   ` Ladislav Michl
  2021-01-08  8:55   ` Michael Olbrich
  2020-12-28  3:59 ` [ptxdist] [PATCH 2/2] bbinit: Modify the start order of the rc-once script yd.zhang
  1 sibling, 2 replies; 6+ messages in thread
From: yd.zhang @ 2020-12-28  3:59 UTC (permalink / raw)
  To: ptxdist; +Cc: yd.zhang

The script is remount root as rw. Some embedded systems to root mounted as ro,
and cannot use custom u-boot and linux-kernel.

Signed-off-by: yd.zhang <yd.zhang@ilabservice.com>
---
 projectroot/etc/init.d/rootrw | 16 ++++++++++++++++
 rules/initmethod-bbinit.in    | 14 ++++++++++++++
 rules/initmethod-bbinit.make  | 12 ++++++++++++
 3 files changed, 42 insertions(+)
 create mode 100644 projectroot/etc/init.d/rootrw

diff --git a/projectroot/etc/init.d/rootrw b/projectroot/etc/init.d/rootrw
new file mode 100644
index 000000000..50e7e5686
--- /dev/null
+++ b/projectroot/etc/init.d/rootrw
@@ -0,0 +1,16 @@
+#!/bin/sh
+
+#
+# /etc/init.d/rootrw - remount root as rw
+#
+
+case $1 in
+	start)
+		mount -o remount,rw /	
+		;;
+	stop)
+		;;
+	*)
+		echo "Usage: $0 [start|stop]"
+		;;
+esac
diff --git a/rules/initmethod-bbinit.in b/rules/initmethod-bbinit.in
index e0b3be178..2ed37c627 100644
--- a/rules/initmethod-bbinit.in
+++ b/rules/initmethod-bbinit.in
@@ -2,6 +2,14 @@
 
 if INITMETHOD_BBINIT
 
+config INITMETHOD_BBINIT_ETC_INITD_ROOTRW
+	bool
+	prompt "install /etc/init.d/rootrw"
+	default y
+	select BUSYBOX_MOUNT     if BUSYBOX
+	help
+		The /etc/init.d/rootrw script remount root as rw.
+
 config INITMETHOD_BBINIT_ETC_INITD_MODULES
 	bool
 	prompt "install /etc/init.d/modules"
@@ -43,6 +51,12 @@ menu "service startup configuration "
 
 source "generated/initmethod_bbinit.in"
 
+config INITMETHOD_BBINIT_LINK_ROOTRW
+  string
+  depends on INITMETHOD_BBINIT_ETC_INITD_ROOTRW
+  prompt "rootrw"
+  default "S01rootrw"
+
 config INITMETHOD_BBINIT_LINK_LOGROTATE
 	string
 	depends on INITMETHOD_BBINIT_ETC_INITD_LOGROTATE
diff --git a/rules/initmethod-bbinit.make b/rules/initmethod-bbinit.make
index 75d381e29..5440b6032 100644
--- a/rules/initmethod-bbinit.make
+++ b/rules/initmethod-bbinit.make
@@ -45,6 +45,11 @@ $(STATEDIR)/initmethod-bbinit.targetinstall:
 #	#
 #	# start scripts
 #	#
+
+ifdef PTXCONF_INITMETHOD_BBINIT_ETC_INITD_ROOTRW
+	@$(call install_alternative, initmethod-bbinit, 0, 0, 0755, /etc/init.d/rootrw, n)
+endif
+
 ifdef PTXCONF_INITMETHOD_BBINIT_ETC_INITD_MODULES
 	@$(call install_alternative, initmethod-bbinit, 0, 0, 0755, /etc/init.d/modules, n)
 	@$(call install_alternative, initmethod-bbinit, 0, 0, 0644, /etc/modules, n)
@@ -72,6 +77,13 @@ endif
 #	#
 #	# collect start links
 #	#
+
+ifneq ($(call remove_quotes,$(PTXCONF_INITMETHOD_BBINIT_LINK_ROOTRW)),)
+	@$(call install_link, initmethod-bbinit, \
+		../init.d/rootrw, \
+		/etc/rc.d/$(PTXCONF_INITMETHOD_BBINIT_LINK_ROOTRW))
+endif
+
 ifneq ($(call remove_quotes,$(PTXCONF_INITMETHOD_BBINIT_LINK_LOGROTATE)),)
 	@$(call install_link, initmethod-bbinit, \
 		../init.d/logrotate, \
-- 
2.29.2


_______________________________________________
ptxdist mailing list
ptxdist@pengutronix.de
To unsubscribe, send a mail with subject "unsubscribe" to ptxdist-request@pengutronix.de

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

* [ptxdist] [PATCH 2/2] bbinit: Modify the start order of the rc-once script
  2020-12-28  3:59 [ptxdist] [PATCH 0/2] bbinit: Add rootrw script yd.zhang
  2020-12-28  3:59 ` [ptxdist] [PATCH 1/2] " yd.zhang
@ 2020-12-28  3:59 ` yd.zhang
  2021-01-08  8:47   ` Michael Olbrich
  1 sibling, 1 reply; 6+ messages in thread
From: yd.zhang @ 2020-12-28  3:59 UTC (permalink / raw)
  To: ptxdist; +Cc: yd.zhang

The script may be executed before S01rootrw, will operate on
read-only root. So change start order to S02.

Signed-off-by: yd.zhang <yd.zhang@ilabservice.com>
---
 rules/rc-once-bbinit.in | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/rules/rc-once-bbinit.in b/rules/rc-once-bbinit.in
index f14de0d79..c75ded458 100644
--- a/rules/rc-once-bbinit.in
+++ b/rules/rc-once-bbinit.in
@@ -4,5 +4,5 @@ config RC_ONCE_BBINIT_LINK
 	string
 	depends on RC_ONCE
 	prompt "rc-once"
-	default "S01rc-once"
+	default "S02rc-once"
 
-- 
2.29.2


_______________________________________________
ptxdist mailing list
ptxdist@pengutronix.de
To unsubscribe, send a mail with subject "unsubscribe" to ptxdist-request@pengutronix.de

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

* Re: [ptxdist] [PATCH 1/2] bbinit: Add rootrw script
  2020-12-28  3:59 ` [ptxdist] [PATCH 1/2] " yd.zhang
@ 2020-12-28 10:40   ` Ladislav Michl
  2021-01-08  8:55   ` Michael Olbrich
  1 sibling, 0 replies; 6+ messages in thread
From: Ladislav Michl @ 2020-12-28 10:40 UTC (permalink / raw)
  To: ptxdist; +Cc: yd.zhang

On Mon, Dec 28, 2020 at 11:59:36AM +0800, yd.zhang wrote:
> The script is remount root as rw. Some embedded systems to root mounted as ro,
> and cannot use custom u-boot and linux-kernel.

What is the use case here? Binary only u-boot and kernel, so modifying
kernel command line is impossible? I would leave such things to BSP.

> Signed-off-by: yd.zhang <yd.zhang@ilabservice.com>
> ---
>  projectroot/etc/init.d/rootrw | 16 ++++++++++++++++
>  rules/initmethod-bbinit.in    | 14 ++++++++++++++
>  rules/initmethod-bbinit.make  | 12 ++++++++++++
>  3 files changed, 42 insertions(+)
>  create mode 100644 projectroot/etc/init.d/rootrw
> 
> diff --git a/projectroot/etc/init.d/rootrw b/projectroot/etc/init.d/rootrw
> new file mode 100644
> index 000000000..50e7e5686
> --- /dev/null
> +++ b/projectroot/etc/init.d/rootrw
> @@ -0,0 +1,16 @@
> +#!/bin/sh
> +
> +#
> +# /etc/init.d/rootrw - remount root as rw
> +#
> +
> +case $1 in
> +	start)
> +		mount -o remount,rw /	
> +		;;
> +	stop)
> +		;;
> +	*)
> +		echo "Usage: $0 [start|stop]"
> +		;;
> +esac
> diff --git a/rules/initmethod-bbinit.in b/rules/initmethod-bbinit.in
> index e0b3be178..2ed37c627 100644
> --- a/rules/initmethod-bbinit.in
> +++ b/rules/initmethod-bbinit.in
> @@ -2,6 +2,14 @@
>  
>  if INITMETHOD_BBINIT
>  
> +config INITMETHOD_BBINIT_ETC_INITD_ROOTRW
> +	bool
> +	prompt "install /etc/init.d/rootrw"
> +	default y
> +	select BUSYBOX_MOUNT     if BUSYBOX
> +	help
> +		The /etc/init.d/rootrw script remount root as rw.
> +
>  config INITMETHOD_BBINIT_ETC_INITD_MODULES
>  	bool
>  	prompt "install /etc/init.d/modules"
> @@ -43,6 +51,12 @@ menu "service startup configuration "
>  
>  source "generated/initmethod_bbinit.in"
>  
> +config INITMETHOD_BBINIT_LINK_ROOTRW
> +  string
> +  depends on INITMETHOD_BBINIT_ETC_INITD_ROOTRW
> +  prompt "rootrw"
> +  default "S01rootrw"
> +
>  config INITMETHOD_BBINIT_LINK_LOGROTATE
>  	string
>  	depends on INITMETHOD_BBINIT_ETC_INITD_LOGROTATE
> diff --git a/rules/initmethod-bbinit.make b/rules/initmethod-bbinit.make
> index 75d381e29..5440b6032 100644
> --- a/rules/initmethod-bbinit.make
> +++ b/rules/initmethod-bbinit.make
> @@ -45,6 +45,11 @@ $(STATEDIR)/initmethod-bbinit.targetinstall:
>  #	#
>  #	# start scripts
>  #	#
> +
> +ifdef PTXCONF_INITMETHOD_BBINIT_ETC_INITD_ROOTRW
> +	@$(call install_alternative, initmethod-bbinit, 0, 0, 0755, /etc/init.d/rootrw, n)
> +endif
> +
>  ifdef PTXCONF_INITMETHOD_BBINIT_ETC_INITD_MODULES
>  	@$(call install_alternative, initmethod-bbinit, 0, 0, 0755, /etc/init.d/modules, n)
>  	@$(call install_alternative, initmethod-bbinit, 0, 0, 0644, /etc/modules, n)
> @@ -72,6 +77,13 @@ endif
>  #	#
>  #	# collect start links
>  #	#
> +
> +ifneq ($(call remove_quotes,$(PTXCONF_INITMETHOD_BBINIT_LINK_ROOTRW)),)
> +	@$(call install_link, initmethod-bbinit, \
> +		../init.d/rootrw, \
> +		/etc/rc.d/$(PTXCONF_INITMETHOD_BBINIT_LINK_ROOTRW))
> +endif
> +
>  ifneq ($(call remove_quotes,$(PTXCONF_INITMETHOD_BBINIT_LINK_LOGROTATE)),)
>  	@$(call install_link, initmethod-bbinit, \
>  		../init.d/logrotate, \
> -- 
> 2.29.2
> 
> 
> _______________________________________________
> ptxdist mailing list
> ptxdist@pengutronix.de
> To unsubscribe, send a mail with subject "unsubscribe" to ptxdist-request@pengutronix.de

_______________________________________________
ptxdist mailing list
ptxdist@pengutronix.de
To unsubscribe, send a mail with subject "unsubscribe" to ptxdist-request@pengutronix.de

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

* Re: [ptxdist] [PATCH 2/2] bbinit: Modify the start order of the rc-once script
  2020-12-28  3:59 ` [ptxdist] [PATCH 2/2] bbinit: Modify the start order of the rc-once script yd.zhang
@ 2021-01-08  8:47   ` Michael Olbrich
  0 siblings, 0 replies; 6+ messages in thread
From: Michael Olbrich @ 2021-01-08  8:47 UTC (permalink / raw)
  To: ptxdist; +Cc: yd.zhang

On Mon, Dec 28, 2020 at 11:59:37AM +0800, yd.zhang wrote:
> The script may be executed before S01rootrw, will operate on
> read-only root. So change start order to S02.

This makes no sense: rc-once should handle its own remounting as needed.

Michael

> 
> Signed-off-by: yd.zhang <yd.zhang@ilabservice.com>
> ---
>  rules/rc-once-bbinit.in | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/rules/rc-once-bbinit.in b/rules/rc-once-bbinit.in
> index f14de0d79..c75ded458 100644
> --- a/rules/rc-once-bbinit.in
> +++ b/rules/rc-once-bbinit.in
> @@ -4,5 +4,5 @@ config RC_ONCE_BBINIT_LINK
>  	string
>  	depends on RC_ONCE
>  	prompt "rc-once"
> -	default "S01rc-once"
> +	default "S02rc-once"
>  
> -- 
> 2.29.2
> 
> 
> _______________________________________________
> ptxdist mailing list
> ptxdist@pengutronix.de
> To unsubscribe, send a mail with subject "unsubscribe" to ptxdist-request@pengutronix.de
> 

_______________________________________________
ptxdist mailing list
ptxdist@pengutronix.de
To unsubscribe, send a mail with subject "unsubscribe" to ptxdist-request@pengutronix.de

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

* Re: [ptxdist] [PATCH 1/2] bbinit: Add rootrw script
  2020-12-28  3:59 ` [ptxdist] [PATCH 1/2] " yd.zhang
  2020-12-28 10:40   ` Ladislav Michl
@ 2021-01-08  8:55   ` Michael Olbrich
  1 sibling, 0 replies; 6+ messages in thread
From: Michael Olbrich @ 2021-01-08  8:55 UTC (permalink / raw)
  To: ptxdist; +Cc: yd.zhang

On Mon, Dec 28, 2020 at 11:59:36AM +0800, yd.zhang wrote:
> The script is remount root as rw. Some embedded systems to root mounted as ro,
> and cannot use custom u-boot and linux-kernel.

I'm not sure what this is supposed to mean.

> 
> Signed-off-by: yd.zhang <yd.zhang@ilabservice.com>
> ---
>  projectroot/etc/init.d/rootrw | 16 ++++++++++++++++
>  rules/initmethod-bbinit.in    | 14 ++++++++++++++
>  rules/initmethod-bbinit.make  | 12 ++++++++++++
>  3 files changed, 42 insertions(+)
>  create mode 100644 projectroot/etc/init.d/rootrw
> 
> diff --git a/projectroot/etc/init.d/rootrw b/projectroot/etc/init.d/rootrw
> new file mode 100644
> index 000000000..50e7e5686
> --- /dev/null
> +++ b/projectroot/etc/init.d/rootrw
> @@ -0,0 +1,16 @@
> +#!/bin/sh
> +
> +#
> +# /etc/init.d/rootrw - remount root as rw
> +#
> +
> +case $1 in
> +	start)
> +		mount -o remount,rw /	

This does now work in all cases. Take a look at what is done here:
projectroot/usr/lib/init/initmethod-bbinit-functions.sh

This seems to work in all cases that I know about.

Michael

> +		;;
> +	stop)
> +		;;
> +	*)
> +		echo "Usage: $0 [start|stop]"
> +		;;
> +esac
> diff --git a/rules/initmethod-bbinit.in b/rules/initmethod-bbinit.in
> index e0b3be178..2ed37c627 100644
> --- a/rules/initmethod-bbinit.in
> +++ b/rules/initmethod-bbinit.in
> @@ -2,6 +2,14 @@
>  
>  if INITMETHOD_BBINIT
>  
> +config INITMETHOD_BBINIT_ETC_INITD_ROOTRW
> +	bool
> +	prompt "install /etc/init.d/rootrw"
> +	default y
> +	select BUSYBOX_MOUNT     if BUSYBOX
> +	help
> +		The /etc/init.d/rootrw script remount root as rw.
> +
>  config INITMETHOD_BBINIT_ETC_INITD_MODULES
>  	bool
>  	prompt "install /etc/init.d/modules"
> @@ -43,6 +51,12 @@ menu "service startup configuration "
>  
>  source "generated/initmethod_bbinit.in"
>  
> +config INITMETHOD_BBINIT_LINK_ROOTRW
> +  string
> +  depends on INITMETHOD_BBINIT_ETC_INITD_ROOTRW
> +  prompt "rootrw"
> +  default "S01rootrw"
> +
>  config INITMETHOD_BBINIT_LINK_LOGROTATE
>  	string
>  	depends on INITMETHOD_BBINIT_ETC_INITD_LOGROTATE
> diff --git a/rules/initmethod-bbinit.make b/rules/initmethod-bbinit.make
> index 75d381e29..5440b6032 100644
> --- a/rules/initmethod-bbinit.make
> +++ b/rules/initmethod-bbinit.make
> @@ -45,6 +45,11 @@ $(STATEDIR)/initmethod-bbinit.targetinstall:
>  #	#
>  #	# start scripts
>  #	#
> +
> +ifdef PTXCONF_INITMETHOD_BBINIT_ETC_INITD_ROOTRW
> +	@$(call install_alternative, initmethod-bbinit, 0, 0, 0755, /etc/init.d/rootrw, n)
> +endif
> +
>  ifdef PTXCONF_INITMETHOD_BBINIT_ETC_INITD_MODULES
>  	@$(call install_alternative, initmethod-bbinit, 0, 0, 0755, /etc/init.d/modules, n)
>  	@$(call install_alternative, initmethod-bbinit, 0, 0, 0644, /etc/modules, n)
> @@ -72,6 +77,13 @@ endif
>  #	#
>  #	# collect start links
>  #	#
> +
> +ifneq ($(call remove_quotes,$(PTXCONF_INITMETHOD_BBINIT_LINK_ROOTRW)),)
> +	@$(call install_link, initmethod-bbinit, \
> +		../init.d/rootrw, \
> +		/etc/rc.d/$(PTXCONF_INITMETHOD_BBINIT_LINK_ROOTRW))
> +endif
> +
>  ifneq ($(call remove_quotes,$(PTXCONF_INITMETHOD_BBINIT_LINK_LOGROTATE)),)
>  	@$(call install_link, initmethod-bbinit, \
>  		../init.d/logrotate, \
> -- 
> 2.29.2
> 
> 
> _______________________________________________
> ptxdist mailing list
> ptxdist@pengutronix.de
> To unsubscribe, send a mail with subject "unsubscribe" to ptxdist-request@pengutronix.de
> 

_______________________________________________
ptxdist mailing list
ptxdist@pengutronix.de
To unsubscribe, send a mail with subject "unsubscribe" to ptxdist-request@pengutronix.de

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

end of thread, other threads:[~2021-01-08  8:55 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-12-28  3:59 [ptxdist] [PATCH 0/2] bbinit: Add rootrw script yd.zhang
2020-12-28  3:59 ` [ptxdist] [PATCH 1/2] " yd.zhang
2020-12-28 10:40   ` Ladislav Michl
2021-01-08  8:55   ` Michael Olbrich
2020-12-28  3:59 ` [ptxdist] [PATCH 2/2] bbinit: Modify the start order of the rc-once script yd.zhang
2021-01-08  8:47   ` Michael Olbrich

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