kumquat-buildroot/board/ti/common/am6xx/post-build.sh
Dario Binacchi 415835567b board/ti/am62x-sk: move post-build.sh to board/ti/common/am6xx
The patch makes it clear that the moved script can be used by the
am6{2,4}x platforms.

Reviewed-by: Arnout Vandecappelle <arnout@mind.be>
Signed-off-by: Dario Binacchi <dario.binacchi@amarulasolutions.com>
Signed-off-by: Romain Naour <romain.naour@smile.fr>
2024-04-09 14:12:00 +02:00

59 lines
1.3 KiB
Bash
Executable File

#!/bin/sh -x
# genimage will need to find the extlinux.conf
# in the binaries directory
die() {
cat <<EOF >&2
Error: $@
Usage: ${0} -c <console> -r <root> [-x <extra-args>]
EOF
exit 1
}
o='c:d:l:r:x:'
O='console:,devicetree:,label:,root:,extra-args:'
opts="$(getopt -n "${0##*/}" -o "${o}" -l "${O}" -- "${@}")"
eval set -- "${opts}"
while [ ${#} -gt 0 ]; do
case "${1}" in
(-c|--console)
CONSOLE="${2}"; shift 2
;;
(-d|--devicetree)
DEVICETREE="${2}"; shift 2
;;
(-l|--label)
LABEL="${2}"; shift 2
;;
(-r|--root)
ROOT="${2}"; shift 2
;;
(-x|--extra-args)
EXTRA_ARGS="${2}"; shift 2
;;
(--)
shift 1; break
;;
esac
done
[ -n "${CONSOLE}" ] || die "Missing \`console' argument"
[ -n "${DEVICETREE}" ] || die "Missing \`devicetree' argument"
[ -n "${LABEL}" ] || die "Missing \`label' argument"
[ -n "${ROOT}" ] || die "Missing \`root' argument"
append="console=${CONSOLE} root=${ROOT} rw rootfstype=ext4 rootwait"
if [ -n "${EXTRA_ARGS}" ]; then
append="${append} ${EXTRA_ARGS}"
fi
mkdir -p "${BINARIES_DIR}"
cat <<-__HEADER_EOF > "${BINARIES_DIR}/extlinux.conf"
label ${LABEL}
kernel /Image
fdtdir /
devicetree /${DEVICETREE}
append ${append}
__HEADER_EOF