All of lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH v2 1/4] board/zynqmp/post-build.sh: auto-generate extlinux.conf
@ 2022-06-09 14:04 Neal Frager
  2022-06-09 14:04 ` [Buildroot] [PATCH v2 2/4] configs/zynqmp_zcu10x_defconfig: add parameters to generate extlinux.conf Neal Frager
                   ` (5 more replies)
  0 siblings, 6 replies; 10+ messages in thread
From: Neal Frager @ 2022-06-09 14:04 UTC (permalink / raw)
  To: buildroot
  Cc: Neal Frager, wesley, luca, giulio.benetti, michal.simek, yann.morin.1998

From: Neal Frager <neal.frager@amd.com>

This patch uses the BR2_ROOTFS_POST_SCRIPT_ARGS to auto-generate the
extlinux.conf file, so developers will only need to modify the
board_defconfig file to change the console and boot file system locations.

Signed-off-by: Neal Frager <neal.frager@amd.com>
---
V1->V2:
  - generates extlinux.conf directly in output/images directory
  - uses "cat <<-" option to remove leading tabs
---
 board/zynqmp/post-build.sh | 15 ++++++++++++++-
 1 file changed, 14 insertions(+), 1 deletion(-)

diff --git a/board/zynqmp/post-build.sh b/board/zynqmp/post-build.sh
index 9fd8bbf2c8..7387576414 100755
--- a/board/zynqmp/post-build.sh
+++ b/board/zynqmp/post-build.sh
@@ -4,5 +4,18 @@
 # in the binaries directory
 
 BOARD_DIR="$(dirname $0)"
+CONSOLE=$2
+ROOT=$3
 
-install -m 0644 -D $BOARD_DIR/extlinux.conf $BINARIES_DIR/extlinux.conf
+FILE=${BOARD_DIR}/extlinux.conf
+if test -f "${FILE}"; then
+  install -m 0644 -D "${FILE}" "${BINARIES_DIR}/extlinux.conf"
+else
+  mkdir -p "${BINARIES_DIR}"
+  cat <<-__HEADER_EOF > "${BINARIES_DIR}/extlinux.conf"
+	label linux
+	  kernel /Image
+	  devicetree /system.dtb
+	  append console=${CONSOLE} root=/dev/${ROOT} rw rootwait
+	__HEADER_EOF
+fi
-- 
2.17.1

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply related	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2022-06-19 16:48 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-06-09 14:04 [Buildroot] [PATCH v2 1/4] board/zynqmp/post-build.sh: auto-generate extlinux.conf Neal Frager
2022-06-09 14:04 ` [Buildroot] [PATCH v2 2/4] configs/zynqmp_zcu10x_defconfig: add parameters to generate extlinux.conf Neal Frager
2022-06-15 21:01   ` Luca Ceresoli
2022-06-09 14:04 ` [Buildroot] [PATCH v2 3/4] configs/zynqmp_kria_kv260_defconfig: " Neal Frager
2022-06-15 21:01   ` Luca Ceresoli
2022-06-09 14:04 ` [Buildroot] [PATCH v2 4/4] board/zynqmp/post-build.sh: remove unnecessary if Neal Frager
2022-06-15 21:01   ` Luca Ceresoli
2022-06-15  5:20 ` [Buildroot] [PATCH v2 1/4] board/zynqmp/post-build.sh: auto-generate extlinux.conf Frager, Neal via buildroot
2022-06-15 21:00 ` Luca Ceresoli
2022-06-19 16:47 ` Arnout Vandecappelle

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.