DistroKit Mailinglist
 help / color / mirror / Atom feed
From: Juergen Borleis <jbe@pengutronix.de>
To: distrokit@pengutronix.de
Subject: [DistroKit] [PATCH 2/3] v7a: barebox: enable loading kernel, dtb and initrd via fastboot
Date: Fri, 25 Aug 2023 12:15:58 +0200	[thread overview]
Message-ID: <20230825101559.29166-2-jbe@pengutronix.de> (raw)
In-Reply-To: <20230825101559.29166-1-jbe@pengutronix.de>

This change is similar to:

2732f93bcf4ee011cecca3518aec7e523c311d7a
 "v8a: barebox: enable loading kernel, dtb and initrd via fastboot"

but for some of the v7a platforms. Due to the absence of a common environment
it only can be added for the i.MX6 based systems for now.

This change prepares all v7a platforms to load kernel, dtb and initrd as
sparse images to RAM-files for rapid development.
It exposes mmc{1,2,3} as 'fastboot' partitions and add init script to
force barebox to detect these devices and have them available for
'fastboot'.

It autostarts the USB gadget and network capability to use 'fastboot' out of
the box.

Signed-off-by: Juergen Borleis <jbe@pengutronix.de>
---
 .../barebox-mx6-defaultenv/boot/ram-fastboot         |  7 +++++++
 .../barebox-mx6-defaultenv/init/detect-mmcs          |  3 +++
 .../barebox-mx6-defaultenv/nv/fastboot.acm           |  1 +
 .../barebox-mx6-defaultenv/nv/fastboot.bbu           |  1 +
 .../barebox-mx6-defaultenv/nv/fastboot.net.autostart |  1 +
 .../barebox-mx6-defaultenv/nv/fastboot.partitions    |  1 +
 .../barebox-mx6-defaultenv/nv/usbgadget.autostart    |  1 +
 configs/platform-v7a/kernelconfig                    | 12 +++++++++++-
 configs/platform-v7a/platformconfig                  | 10 +++++++++-
 9 files changed, 35 insertions(+), 2 deletions(-)
 create mode 100755 configs/platform-v7a/barebox-mx6-defaultenv/boot/ram-fastboot
 create mode 100755 configs/platform-v7a/barebox-mx6-defaultenv/init/detect-mmcs
 create mode 100644 configs/platform-v7a/barebox-mx6-defaultenv/nv/fastboot.acm
 create mode 100644 configs/platform-v7a/barebox-mx6-defaultenv/nv/fastboot.bbu
 create mode 100644 configs/platform-v7a/barebox-mx6-defaultenv/nv/fastboot.net.autostart
 create mode 100644 configs/platform-v7a/barebox-mx6-defaultenv/nv/fastboot.partitions
 create mode 100644 configs/platform-v7a/barebox-mx6-defaultenv/nv/usbgadget.autostart

diff --git a/configs/platform-v7a/barebox-mx6-defaultenv/boot/ram-fastboot b/configs/platform-v7a/barebox-mx6-defaultenv/boot/ram-fastboot
new file mode 100755
index 0000000..ff17b26
--- /dev/null
+++ b/configs/platform-v7a/barebox-mx6-defaultenv/boot/ram-fastboot
@@ -0,0 +1,7 @@
+#!/bin/sh
+
+global.bootm.image=/tmp/ram-kernel
+global.bootm.initrd=/tmp/ram-initramfs
+global.bootm.oftree=/tmp/ram-oftree
+
+global.linux.bootargs.dyn.root="rdinit=/sbin/init"
diff --git a/configs/platform-v7a/barebox-mx6-defaultenv/init/detect-mmcs b/configs/platform-v7a/barebox-mx6-defaultenv/init/detect-mmcs
new file mode 100755
index 0000000..e3433f6
--- /dev/null
+++ b/configs/platform-v7a/barebox-mx6-defaultenv/init/detect-mmcs
@@ -0,0 +1,3 @@
+#!/bin/sh
+
+detect mmc0 mmc1 mmc2
diff --git a/configs/platform-v7a/barebox-mx6-defaultenv/nv/fastboot.acm b/configs/platform-v7a/barebox-mx6-defaultenv/nv/fastboot.acm
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/configs/platform-v7a/barebox-mx6-defaultenv/nv/fastboot.acm
@@ -0,0 +1 @@
+1
diff --git a/configs/platform-v7a/barebox-mx6-defaultenv/nv/fastboot.bbu b/configs/platform-v7a/barebox-mx6-defaultenv/nv/fastboot.bbu
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/configs/platform-v7a/barebox-mx6-defaultenv/nv/fastboot.bbu
@@ -0,0 +1 @@
+1
diff --git a/configs/platform-v7a/barebox-mx6-defaultenv/nv/fastboot.net.autostart b/configs/platform-v7a/barebox-mx6-defaultenv/nv/fastboot.net.autostart
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/configs/platform-v7a/barebox-mx6-defaultenv/nv/fastboot.net.autostart
@@ -0,0 +1 @@
+1
diff --git a/configs/platform-v7a/barebox-mx6-defaultenv/nv/fastboot.partitions b/configs/platform-v7a/barebox-mx6-defaultenv/nv/fastboot.partitions
new file mode 100644
index 0000000..15c7d42
--- /dev/null
+++ b/configs/platform-v7a/barebox-mx6-defaultenv/nv/fastboot.partitions
@@ -0,0 +1 @@
+/dev/mmc1(mmc1)o,/dev/mmc2(mmc2)o,/dev/mmc3(mmc3)o,/tmp/ram-kernel(ram-kernel)c,/tmp/ram-initramfs(ram-initramfs)c,/tmp/ram-oftree(ram-oftree)c
diff --git a/configs/platform-v7a/barebox-mx6-defaultenv/nv/usbgadget.autostart b/configs/platform-v7a/barebox-mx6-defaultenv/nv/usbgadget.autostart
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/configs/platform-v7a/barebox-mx6-defaultenv/nv/usbgadget.autostart
@@ -0,0 +1 @@
+1
diff --git a/configs/platform-v7a/kernelconfig b/configs/platform-v7a/kernelconfig
index d1ebb0f..035e1c4 100644
--- a/configs/platform-v7a/kernelconfig
+++ b/configs/platform-v7a/kernelconfig
@@ -190,7 +190,15 @@ CONFIG_NET_NS=y
 # CONFIG_CHECKPOINT_RESTORE is not set
 # CONFIG_SCHED_AUTOGROUP is not set
 # CONFIG_RELAY is not set
-# CONFIG_BLK_DEV_INITRD is not set
+CONFIG_BLK_DEV_INITRD=y
+CONFIG_INITRAMFS_SOURCE=""
+CONFIG_RD_GZIP=y
+# CONFIG_RD_BZIP2 is not set
+# CONFIG_RD_LZMA is not set
+# CONFIG_RD_XZ is not set
+# CONFIG_RD_LZO is not set
+# CONFIG_RD_LZ4 is not set
+# CONFIG_RD_ZSTD is not set
 # CONFIG_BOOT_CONFIG is not set
 CONFIG_INITRAMFS_PRESERVE_MTIME=y
 CONFIG_CC_OPTIMIZE_FOR_PERFORMANCE=y
@@ -4025,10 +4033,12 @@ CONFIG_CRC32_SLICEBY8=y
 # CONFIG_CRC8 is not set
 CONFIG_XXHASH=y
 # CONFIG_RANDOM32_SELFTEST is not set
+CONFIG_ZLIB_INFLATE=y
 CONFIG_ZSTD_COMMON=y
 CONFIG_ZSTD_COMPRESS=y
 CONFIG_ZSTD_DECOMPRESS=y
 # CONFIG_XZ_DEC is not set
+CONFIG_DECOMPRESS_GZIP=y
 CONFIG_GENERIC_ALLOCATOR=y
 CONFIG_ASSOCIATIVE_ARRAY=y
 CONFIG_HAS_IOMEM=y
diff --git a/configs/platform-v7a/platformconfig b/configs/platform-v7a/platformconfig
index 89e1e18..0a90450 100644
--- a/configs/platform-v7a/platformconfig
+++ b/configs/platform-v7a/platformconfig
@@ -261,7 +261,15 @@ PTXCONF_IMAGE_KERNEL_INSTALL_EARLY=y
 PTXCONF_IMAGE_LXA_MC1=y
 # PTXCONF_IMAGE_RAUC is not set
 PTXCONF_IMAGE_RIOTBOARD=y
-# PTXCONF_IMAGE_ROOT_CPIO is not set
+PTXCONF_IMAGE_ROOT_CPIO=y
+# PTXCONF_IMAGE_ROOT_CPIO_COMPRESSION_MODE_NONE is not set
+PTXCONF_IMAGE_ROOT_CPIO_COMPRESSION_MODE_GZ=y
+# PTXCONF_IMAGE_ROOT_CPIO_COMPRESSION_MODE_ZSTD is not set
+# PTXCONF_IMAGE_ROOT_CPIO_COMPRESSION_MODE_XZ is not set
+# PTXCONF_IMAGE_ROOT_CPIO_COMPRESSION_MODE_LZOP is not set
+# PTXCONF_IMAGE_ROOT_CPIO_CUSTOM_COMPRESSION is not set
+PTXCONF_IMAGE_ROOT_CPIO_COMPRESSION_SUFFIX=".gz"
+PTXCONF_IMAGE_ROOT_CPIO_COMPRESSION_UTIL="gzip"
 PTXCONF_IMAGE_ROOT_EXT=y
 PTXCONF_IMAGE_ROOT_EXT_SIZE="125%"
 # PTXCONF_IMAGE_ROOT_EXT_EXT2 is not set
-- 
2.30.2




  reply	other threads:[~2023-08-25 10:16 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-08-25 10:15 [DistroKit] [PATCH 1/3] arch: fastboot: testing: fix typos Juergen Borleis
2023-08-25 10:15 ` Juergen Borleis [this message]
2023-08-25 10:48   ` [DistroKit] [PATCH 2/3] v7a: barebox: enable loading kernel, dtb and initrd via fastboot Robert Schwebel
2023-08-25 10:15 ` [DistroKit] [PATCH 3/3] doc: RIoT: mention the 'fastboot' capabilities Juergen Borleis
2023-08-25 10:54   ` Robert Schwebel
2023-08-25 10:49 ` [DistroKit] [PATCH 1/3] arch: fastboot: testing: fix typos Robert Schwebel

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230825101559.29166-2-jbe@pengutronix.de \
    --to=jbe@pengutronix.de \
    --cc=distrokit@pengutronix.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox