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.zh...@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-requ...@pengutronix.de
> 

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

Reply via email to