From mboxrd@z Thu Jan 1 00:00:00 1970 Return-path: Received: from out28-3.mail.aliyun.com ([115.124.28.3]) by metis.ext.pengutronix.de with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1ktjhK-0008Rx-Es for ptxdist@pengutronix.de; Mon, 28 Dec 2020 04:59:55 +0100 From: "yd.zhang" Date: Mon, 28 Dec 2020 11:59:36 +0800 Message-Id: <20201228035937.3489293-2-yd.zhang@ilabservice.com> In-Reply-To: <20201228035937.3489293-1-yd.zhang@ilabservice.com> References: <20201228035937.3489293-1-yd.zhang@ilabservice.com> MIME-Version: 1.0 Subject: [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" 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 --- 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