From mboxrd@z Thu Jan 1 00:00:00 1970 Delivery-date: Fri, 23 Jun 2023 15:14:30 +0200 Received: from metis.ext.pengutronix.de ([2001:67c:670:201:290:27ff:fe1d:cc33]) by lore.white.stw.pengutronix.de with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qCgcR-000c4V-Ka for lore@lore.pengutronix.de; Fri, 23 Jun 2023 15:14:30 +0200 Received: from localhost ([127.0.0.1] helo=metis.ext.pengutronix.de) by metis.ext.pengutronix.de with esmtp (Exim 4.92) (envelope-from ) id 1qCgcP-0001Pz-F3; Fri, 23 Jun 2023 15:14:29 +0200 Received: from ptz.office.stw.pengutronix.de ([2a0a:edc0:0:900:1d::77] helo=[127.0.0.1]) by metis.ext.pengutronix.de with esmtp (Exim 4.92) (envelope-from ) id 1qCgcL-0001Pl-MQ; Fri, 23 Jun 2023 15:14:25 +0200 Message-ID: Date: Fri, 23 Jun 2023 15:14:25 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.11.2 Content-Language: en-US To: Roland Hieber References: <20230531114744.3281270-1-a.fatoum@pengutronix.de> <20230531114744.3281270-6-a.fatoum@pengutronix.de> <20230623130415.knd3lwxwnz3ft2ar@pengutronix.de> From: Ahmad Fatoum In-Reply-To: <20230623130415.knd3lwxwnz3ft2ar@pengutronix.de> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Subject: Re: [DistroKit] [PATCH v3 5/8] v8a: rockchip: use common environment X-BeenThere: distrokit@pengutronix.de X-Mailman-Version: 2.1.29 Precedence: list List-Id: DistroKit Mailinglist List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: distrokit@pengutronix.de Sender: "DistroKit" X-SA-Exim-Connect-IP: 127.0.0.1 X-SA-Exim-Mail-From: distrokit-bounces@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false On 23.06.23 15:04, Roland Hieber wrote: > On Wed, May 31, 2023 at 01:47:41PM +0200, Ahmad Fatoum wrote: >> This effectively reverts commit 95014f4d8a50 ("v8a: rockchip: copy default >> barebox env"). The common environment and the rockchip one are now >> identical. >> >> The spi-nor part is just for the Rockchip board though, so let's make >> its execution conditional and drop barebox-rock3a-defaultenv. >> >> Signed-off-by: Ahmad Fatoum >> --- >> .../barebox-common-defaultenv/init/bootsource | 10 +++++++--- >> .../barebox-rock3a-defaultenv/init/bootsource | 13 ------------- >> .../nv/linux.bootargs.loglevel | 1 - >> configs/platform-v8a/rules/barebox-rockchip.make | 2 +- >> 4 files changed, 8 insertions(+), 18 deletions(-) >> delete mode 100644 configs/platform-v8a/barebox-rock3a-defaultenv/init/bootsource >> delete mode 100644 configs/platform-v8a/barebox-rock3a-defaultenv/nv/linux.bootargs.loglevel >> >> diff --git a/configs/platform-v8a/barebox-common-defaultenv/init/bootsource b/configs/platform-v8a/barebox-common-defaultenv/init/bootsource >> index 8f00bced5df2..db1915321531 100644 >> --- a/configs/platform-v8a/barebox-common-defaultenv/init/bootsource >> +++ b/configs/platform-v8a/barebox-common-defaultenv/init/bootsource >> @@ -8,7 +8,11 @@ fi >> if [ "$bootsource" = mmc ]; then >> detect mmc$bootsource_instance >> global.boot.default="mmc$bootsource_instance net" >> -elif [ "$bootsource" = "spi-nor" ]; then >> - usbgadget -A '/dev/mmc0(sd)' >> - global.autoboot=abort >> +fi >> + >> +if [ "${global.model}" = "Radxa ROCK3 Model A" ]; then > > At first I thought it would be better to match the board compatible (it > looks more machine-parsable and less subject to change), but then I > found out that there isn't a variable for that in barebox yet… Do you > think it makes sense to add one too? It seems like the code would be a > bit different than for the model though… barebox v2023.07.0 should contain an of_compatible command exactly for this use case[1]. This can be used instead of the model once we update. I'd only advise this for scripts though. If you have a set of nv variables that's board specific, you could install the defaultenv into the board dir in the barebox source tree and add bbenv-y to the board Makefile. [1]: https://github.com/barebox/barebox/commit/bf7405c00016beb7860729d18d4fe53772b81db7 > > - Roland > >> + if [ "$bootsource" = "spi-nor" ]; then >> + usbgadget -A '/dev/mmc1(sd)' >> + global.autoboot=abort >> + fi >> fi >> diff --git a/configs/platform-v8a/barebox-rock3a-defaultenv/init/bootsource b/configs/platform-v8a/barebox-rock3a-defaultenv/init/bootsource >> deleted file mode 100644 >> index bc81609a49c0..000000000000 >> --- a/configs/platform-v8a/barebox-rock3a-defaultenv/init/bootsource >> +++ /dev/null >> @@ -1,13 +0,0 @@ >> -#!/bin/sh >> - >> -if [ -n "${nv.boot.default}" ]; then >> - exit >> -fi >> - >> -if [ "$bootsource" = mmc ]; then >> - detect mmc$bootsource_instance >> - global.boot.default="mmc$bootsource_instance net" >> -elif [ "$bootsource" = "spi-nor" ]; then >> - usbgadget -A '/dev/mmc1(sd)' >> - global.autoboot=abort >> -fi >> diff --git a/configs/platform-v8a/barebox-rock3a-defaultenv/nv/linux.bootargs.loglevel b/configs/platform-v8a/barebox-rock3a-defaultenv/nv/linux.bootargs.loglevel >> deleted file mode 100644 >> index 705752ca416d..000000000000 >> --- a/configs/platform-v8a/barebox-rock3a-defaultenv/nv/linux.bootargs.loglevel >> +++ /dev/null >> @@ -1 +0,0 @@ >> -loglevel=5 systemd.log_level=warning systemd.show_status=auto >> diff --git a/configs/platform-v8a/rules/barebox-rockchip.make b/configs/platform-v8a/rules/barebox-rockchip.make >> index 805c8749d710..1ca7e8c109ee 100644 >> --- a/configs/platform-v8a/rules/barebox-rockchip.make >> +++ b/configs/platform-v8a/rules/barebox-rockchip.make >> @@ -69,7 +69,7 @@ $(BAREBOX_ROCKCHIP_CONFIG): >> endif >> >> BAREBOX_ROCKCHIP_EXTRA_ENV_PATH := $(foreach path, \ >> - $(call remove_quotes,"barebox-rock3a-defaultenv"), \ >> + $(call remove_quotes,"barebox-common-defaultenv"), \ >> $(call ptx/in-platformconfigdir,$(path))) >> BAREBOX_ROCKCHIP_EXTRA_ENV_DEPS := \ >> $(BAREBOX_ROCKCHIP_EXTRA_ENV_PATH) \ >> -- >> 2.39.2 >> >> >> > -- Pengutronix e.K. | | Steuerwalder Str. 21 | http://www.pengutronix.de/ | 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 | Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |