osbuilder: Multistrap Ubuntu

Use `multistrap` for building Ubuntu rootfs. Adds support for building
for foreign architectures using the `ARCH` environment variable.
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-02-15 19:12:41 +01:00
parent df511bf179
commit 72f7e9e300
5 changed files with 71 additions and 135 deletions

View File

@@ -203,8 +203,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"
@@ -220,6 +220,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" \
Dockerfile.in > Dockerfile