osbuilder: Multistrap Ubuntu

Use `multistrap` for building Ubuntu rootfs. Adds support for building
for foreign architectures using the `ARCH` environment variable
(including umoci).
In the process, the Ubuntu rootfs workflow is vastly simplified.

Signed-off-by: Jakob Naucke <jakob.naucke@ibm.com>
This commit is contained in:
Jakob Naucke
2022-03-21 20:20:24 +01:00
parent 578678e051
commit 8fbf6c4e14
5 changed files with 100 additions and 147 deletions

View File

@@ -227,8 +227,8 @@ generate_dockerfile()
dir="$1"
[ -d "${dir}" ] || die "${dir}: not a directory"
local rustarch=$(uname -m)
[ "$rustarch" = ppc64le ] && rustarch=powerpc64le
local rustarch="$ARCH"
[ "$ARCH" = ppc64le ] && rustarch=powerpc64le
[ -n "${http_proxy:-}" ] && readonly set_proxy="RUN sed -i '$ a proxy="${http_proxy:-}"' /etc/dnf/dnf.conf /etc/yum.conf; true"
@@ -244,6 +244,7 @@ RUN . /root/.cargo/env; cargo install cargo-when
sed \
-e "s#@OS_VERSION@#${OS_VERSION:-}#g" \
-e "s#@ARCH@#$ARCH#g" \
-e "s#@INSTALL_RUST@#${install_rust//$'\n'/\\n}#g" \
-e "s#@SET_PROXY@#${set_proxy:-}#g" \
-e "s#@INSTALL_AA_KBC@#${AA_KBC_EXTRAS//$'\n'/\\n}#g" \