From mboxrd@z Thu Jan 1 00:00:00 1970 Return-path: Received: from eddie.linux-mips.org ([148.251.95.138] helo=cvs.linux-mips.org) by metis.ext.pengutronix.de with esmtp (Exim 4.92) (envelope-from ) id 1ktpwm-0003XS-V2 for ptxdist@pengutronix.de; Mon, 28 Dec 2020 11:40:18 +0100 Received: (from localhost user: 'ladis' uid#1021 fake: STDIN (ladis@eddie.linux-mips.org)) by eddie.linux-mips.org id S23992657AbgL1KkOHXCsv (ORCPT ); Mon, 28 Dec 2020 11:40:14 +0100 Date: Mon, 28 Dec 2020 11:40:12 +0100 From: Ladislav Michl Message-ID: References: <20201228035937.3489293-1-yd.zhang@ilabservice.com> <20201228035937.3489293-2-yd.zhang@ilabservice.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20201228035937.3489293-2-yd.zhang@ilabservice.com> Subject: Re: [ptxdist] [PATCH 1/2] bbinit: Add rootrw script List-Id: PTXdist Development Mailing List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: ptxdist@pengutronix.de Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: ptxdist-bounces@pengutronix.de Sender: "ptxdist" To: ptxdist@pengutronix.de 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 > --- > 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