All of lore.kernel.org
 help / color / mirror / Atom feed
From: Neal Frager <neal.frager@xilinx.com>
To: <buildroot@buildroot.org>
Cc: Neal Frager <neal.frager@amd.com>,
	wesley@sonifex.co.uk, luca@lucaceresoli.net,
	giulio.benetti@benettiengineering.com, michal.simek@amd.com,
	yann.morin.1998@free.fr
Subject: [Buildroot] [PATCH v2 1/4] board/zynqmp/post-build.sh: auto-generate extlinux.conf
Date: Thu, 9 Jun 2022 08:04:46 -0600	[thread overview]
Message-ID: <20220609140449.210030-1-neal.frager@xilinx.com> (raw)

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

             reply	other threads:[~2022-06-09 14:05 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-06-09 14:04 Neal Frager [this message]
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

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=20220609140449.210030-1-neal.frager@xilinx.com \
    --to=neal.frager@xilinx.com \
    --cc=buildroot@buildroot.org \
    --cc=giulio.benetti@benettiengineering.com \
    --cc=luca@lucaceresoli.net \
    --cc=michal.simek@amd.com \
    --cc=neal.frager@amd.com \
    --cc=wesley@sonifex.co.uk \
    --cc=yann.morin.1998@free.fr \
    /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 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.