Commit acac82cd authored by Guido Gunther's avatar Guido Gunther
Browse files

root.sh: Only run uboot_setup() if we have an fdt file

flash-kernel based boards need way less setup and we should rather
switch existing ones over.
parent 5f1efed9
......@@ -115,6 +115,9 @@ mirror=${MIRROR:-"http://deb.debian.org/debian"}
pureos_board=devkit
build_type=current
NULL=
# Device tree file name. Only set this if you're not using
# flash-kernel and want manual uboot script configuration.
fdt_file=
uboot_bin=
uboot_type=
build_tarball=
......
......@@ -91,7 +91,6 @@ case ${pureos_board} in
;;
esac
board_type=unknown
fdt_file=imx8mq-librem5-devkit.dtb
qemu=/usr/bin/qemu-aarch64-static
uboot_bin=u-boot-devkit.imx
uboot_type=devkit
......@@ -111,7 +110,6 @@ case ${pureos_board} in
board_type=x86
arch=x86_64
want_qcow2=1
fdt_file=
if [ -f ./bin/qemu-system-x86_64 ]; then
qemu=./bin/qemu-system-x86_64
else
......
......@@ -90,19 +90,28 @@ function setup_kernel()
function setup_uboot()
{
[ -n "${fdt_file}" ] || return
sed -e "s/##DTBNAME##/${fdt_file}/" "data/boot-${uboot_type}.txt.in" > "${basedir}/boot/boot_emmc.txt"
sed -e "s/##RFSPART##/0/" -i "${basedir}/boot/boot_emmc.txt"
mkimage -A arm -T script -O linux -d "${basedir}/boot/boot_emmc.txt" "${basedir}/boot/boot_emmc.scr"
sed -e "s/##DTBNAME##/${fdt_file}/" "data/boot-${uboot_type}.txt.in" > "${basedir}/boot/boot_sd.txt"
sed -e "s/##RFSPART##/1/" -i "${basedir}/boot/boot_sd.txt"
mkimage -A arm -T script -O linux -d "${basedir}/boot/boot_sd.txt" "${basedir}/boot/boot_sd.scr"
if [ "${pureos_board}" == "imx6" ]; then
ln -fs boot_sd.scr "${basedir}/boot/6x_bootscript"
elif [ "${pureos_board}" == "devkit" ]; then
ln -fs boot_emmc.scr "${basedir}/boot/boot.scr"
else
ln -fs boot_sd.scr "${basedir}/boot/boot.scr"
fi
# TODO: Use flash-kernel for these boards too
case "${pureos_board}" in
imx6)
ln -fs boot_sd.scr "${basedir}/boot/6x_bootscript"
;;
imx8|em-som)
ln -fs boot_sd.scr "${basedir}/boot/boot.scr"
;;
*)
echo "setup_uboot: Unhandled board type ${pureos_board} for"
exit 1
;;
esac
[ ! -d "files/uboot-${uboot_type}" ] || cp -a "files/uboot-${uboot_type}/"* "${basedir}/boot/"
}
......@@ -320,14 +329,14 @@ setup_gui
setup_journal
setup_sshd
# Skip setup until we have hardware, not needed for qemu
setup_kernel
case "${pureos_board}" in
imx6|imx8|ec-som|devkit)
setup_kernel
# Non flash-kernel boards
imx6|imx8|ec-som)
setup_uboot
;;
?)
echo "No kernel or u-boot setup for ${pureos_board}"
echo "No u-boot needed for ${pureos_board}"
;;
esac
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment