Commit c324d00a authored by Guido Gunther's avatar Guido Gunther

Pass in the kernel package late

This allows us to modify it with versions fetched during build
that we don't know upfront.
parent 2923d6bc
...@@ -81,6 +81,7 @@ want_qcow2= ...@@ -81,6 +81,7 @@ want_qcow2=
apt_sources= apt_sources=
debootstrap_dist= debootstrap_dist=
kernel_deb= kernel_deb=
custom_package_opt=
while getopts ":hb:d:T:B" opt; do while getopts ":hb:d:T:B" opt; do
case ${opt} in case ${opt} in
...@@ -138,10 +139,13 @@ if [ "${build_type}" == "latest" ]; then ...@@ -138,10 +139,13 @@ if [ "${build_type}" == "latest" ]; then
fi fi
kernel_deb="$deb" kernel_deb="$deb"
done done
[ -n "${kernel_deb}" ] || { echo "No kernel found."; exit 1; }
custom_package_opt=(--custom-package "${kernel_deb}")
else else
kernel_url=https://storage.puri.sm/librem5/binaries/${build_type}/latest/files/ kernel_url=https://storage.puri.sm/librem5/binaries/${build_type}/latest/files/
if [ -n "${kernel_deb}" ] && [ ! -f "files/${kernel_deb}" ]; then if [ -n "${kernel_deb}" ] && [ ! -f "files/${kernel_deb}" ]; then
wget -Pfiles/ "${kernel_url}/${kernel_deb}" wget -Pfiles/ "${kernel_url}/${kernel_deb}"
custom_package_opt=(--custom-package "files/${kernel_deb}")
fi fi
if [ -n "${uboot_bin}" ] && [ ! -f "files/uboot-${uboot_type}/${uboot_bin}" ]; then if [ -n "${uboot_bin}" ] && [ ! -f "files/uboot-${uboot_type}/${uboot_bin}" ]; then
...@@ -157,6 +161,7 @@ echo "Using kernel ${kernel_deb}" ...@@ -157,6 +161,7 @@ echo "Using kernel ${kernel_deb}"
escaped_apt_sources=$(echo "${apt_sources}" | sed 's/$/|/g') escaped_apt_sources=$(echo "${apt_sources}" | sed 's/$/|/g')
set -x set -x
# shellcheck disable=SC2086
sudo pureos_board="${pureos_board}" \ sudo pureos_board="${pureos_board}" \
distro="${distro}" \ distro="${distro}" \
packages="${packages}" \ packages="${packages}" \
...@@ -177,6 +182,7 @@ sudo pureos_board="${pureos_board}" \ ...@@ -177,6 +182,7 @@ sudo pureos_board="${pureos_board}" \
--root-password='root' --hostname='pureos' --user=purism/123456 --sudo \ --root-password='root' --hostname='pureos' --user=purism/123456 --sudo \
--customize "${cwd}/root.sh" \ --customize "${cwd}/root.sh" \
--owner "$(whoami)" \ --owner "$(whoami)" \
"${custom_package_opt[@]}" \
"${vmdebootstrap_opts[@]}" \ "${vmdebootstrap_opts[@]}" \
${NULL} ${NULL}
set +x set +x
......
...@@ -21,7 +21,6 @@ case ${pureos_board} in ...@@ -21,7 +21,6 @@ case ${pureos_board} in
--bootsize 200M --bootsize 200M
--boottype ext2 --boottype ext2
--bootoffset 1M --bootoffset 1M
--custom-package "files/${kernel_deb}"
--no-kernel --no-kernel
--no-update-initramfs --no-update-initramfs
--arch="${arch}" --arch="${arch}"
...@@ -43,7 +42,6 @@ case ${pureos_board} in ...@@ -43,7 +42,6 @@ case ${pureos_board} in
--bootsize 200M --bootsize 200M
--boottype ext2 --boottype ext2
--bootoffset 5M --bootoffset 5M
--custom-package "files/${kernel_deb}"
--no-kernel --no-kernel
--no-update-initramfs --no-update-initramfs
--arch="${arch}" --arch="${arch}"
...@@ -63,7 +61,6 @@ case ${pureos_board} in ...@@ -63,7 +61,6 @@ case ${pureos_board} in
--bootsize 200M --bootsize 200M
--boottype ext2 --boottype ext2
--bootoffset 5MiB --bootoffset 5MiB
--custom-package "files/${kernel_deb}"
--no-kernel --no-kernel
--no-update-initramfs --no-update-initramfs
--arch="${arch}" --arch="${arch}"
...@@ -85,7 +82,6 @@ case ${pureos_board} in ...@@ -85,7 +82,6 @@ case ${pureos_board} in
--bootsize 200M --bootsize 200M
--boottype ext2 --boottype ext2
--bootoffset 5MiB --bootoffset 5MiB
--custom-package "files/${kernel_deb}"
--no-kernel --no-kernel
--arch="${arch}" --arch="${arch}"
) )
......
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