Commit 718b52e6 authored by Angus Ainslie (Purism)'s avatar Angus Ainslie (Purism)
Browse files

Different pureos boards can use the same uboot type.


Signed-off-by: default avatarAngus Ainslie (Purism) <angus@akkea.ca>
parent 948e9cb2
...@@ -107,6 +107,7 @@ pureos_board=imx6 ...@@ -107,6 +107,7 @@ pureos_board=imx6
build_type=latest build_type=latest
NULL= NULL=
uboot_bin= uboot_bin=
uboot_type=
build_tarball= build_tarball=
want_qcow2= want_qcow2=
want_boot_image= want_boot_image=
...@@ -205,6 +206,7 @@ set -x ...@@ -205,6 +206,7 @@ set -x
sudo pureos_board="${pureos_board}" \ sudo pureos_board="${pureos_board}" \
distro="${distro}" \ distro="${distro}" \
packages="${packages} ${board_packages}" \ packages="${packages} ${board_packages}" \
uboot_type="${uboot_type}" \
patched="${patched}" \ patched="${patched}" \
http_proxy="${http_apt_proxy:-${http_proxy:-}}" \ http_proxy="${http_apt_proxy:-${http_proxy:-}}" \
https_proxy="${https_apt_proxy:-${https_proxy:-}}" \ https_proxy="${https_apt_proxy:-${https_proxy:-}}" \
...@@ -239,11 +241,11 @@ if [ "${arch}" == "arm64" ]; then ...@@ -239,11 +241,11 @@ if [ "${arch}" == "arm64" ]; then
if [ "${want_boot_image}" == 1 ]; then if [ "${want_boot_image}" == 1 ]; then
# Copy the boot image as a separate file # Copy the boot image as a separate file
bootimg="${pureos_board}-boot.img" bootimg="${pureos_board}-boot.img"
cp "files/uboot-${uboot_type}/${pureos_board}-boot.img" "${bootimg}" cp "files/uboot-${uboot_type}/${uboot_type}-boot.img" "${bootimg}"
else else
# Merge boot image inside the main image # Merge boot image inside the main image
loop=$(setup_loop "${mainimg}") loop=$(setup_loop "${mainimg}")
sudo dd if="files/uboot-${uboot_type}/${pureos_board}-boot.img" of="${loop}" bs=1024 seek=2 sudo dd if="files/uboot-${uboot_type}/${uboot_type}-boot.img" of="${loop}" bs=1024 seek=2
sudo losetup -d "${loop}" sudo losetup -d "${loop}"
fi fi
fi fi
......
...@@ -19,6 +19,7 @@ ...@@ -19,6 +19,7 @@
: "${kernel_deb:-}" : "${kernel_deb:-}"
: "${patched:-}" : "${patched:-}"
: "${qemu:-}" : "${qemu:-}"
: "${uboot_type:-}"
# distro and basedir set by calling script # distro and basedir set by calling script
basedir="$1" basedir="$1"
...@@ -33,6 +34,11 @@ for env_var in distro pureos_board packages; do ...@@ -33,6 +34,11 @@ for env_var in distro pureos_board packages; do
fi fi
done done
if [ "${pureos_board}" != "qemu-x86_64" ] && [ -z "${uboot_type}" ]; then
echo "Must pass in uboot_type via the environment" 1>&2
exit 1
fi
set -e set -e
set -u set -u
set -x set -x
...@@ -81,10 +87,10 @@ function setup_kernel() ...@@ -81,10 +87,10 @@ function setup_kernel()
function setup_uboot() function setup_uboot()
{ {
sed -e "s/##DTBNAME##/${fdt_file}/" "data/boot-${pureos_board}.txt.in" > "${basedir}/boot/boot_emmc.txt" 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" 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" 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-${pureos_board}.txt.in" > "${basedir}/boot/boot_sd.txt" 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" 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" mkimage -A arm -T script -O linux -d "${basedir}/boot/boot_sd.txt" "${basedir}/boot/boot_sd.scr"
if [ "${pureos_board}" == "imx6" ]; then if [ "${pureos_board}" == "imx6" ]; then
...@@ -95,7 +101,7 @@ function setup_uboot() ...@@ -95,7 +101,7 @@ function setup_uboot()
ln -fs boot_sd.scr "${basedir}/boot/boot.scr" ln -fs boot_sd.scr "${basedir}/boot/boot.scr"
fi fi
[ ! -d "files/uboot-${pureos_board}" ] || cp -a "files/uboot-${pureos_board}/"* "${basedir}/boot/" [ ! -d "files/uboot-${uboot_type}" ] || cp -a "files/uboot-${uboot_type}/"* "${basedir}/boot/"
} }
......
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