Skip to content

Commit

Permalink
ensure that rootfs tarballs usability for standard chroots
Browse files Browse the repository at this point in the history
Make sure all xattrs are preserved in the archive.
  • Loading branch information
sylirre committed Dec 19, 2023
1 parent 7bb3d7d commit d5797cf
Show file tree
Hide file tree
Showing 12 changed files with 92 additions and 77 deletions.
20 changes: 20 additions & 0 deletions bootstrap-rootfs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,26 @@ translate_arch() {
esac
}

# Common way to archive the rootfs.
# Usage: archive_rootfs /path/to/rootfs.tar.xz rootfs-dir
# rootfs-dir is relative to $WORKDIR
archive_rootfs() {
sudo tar \
--directory="$WORKDIR" \
--create \
--sort=name \
--hard-dereference \
--numeric-owner \
--preserve-permissions \
--acls \
--xattrs \
--xattrs-include='*' \
--xz \
--file="$1" \
"$2"
sudo chown $(id -un):$(id -gn) "$1"
}

##############################################################################

# Reset workspace. This also deletes any previously made rootfs tarballs.
Expand Down
8 changes: 3 additions & 5 deletions distro-build/alpine.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,9 @@ bootstrap_distribution() {
"https://dl-cdn.alpinelinux.org/alpine/v${dist_version:0:4}/releases/${arch}/alpine-minirootfs-${dist_version}-${arch}.tar.gz.sha256"
sha256sum -c "${WORKDIR}/alpine-minirootfs-${dist_version}-${arch}.tar.gz.sha256"

sudo rm -rf "${WORKDIR}/alpine-$(translate_arch "$arch")"
sudo mkdir -m 755 "${WORKDIR}/alpine-$(translate_arch "$arch")"
sudo tar -zxp \
sudo tar -zxp --acls --xattrs --xattrs-include='*' \
-f "${WORKDIR}/alpine-minirootfs-${dist_version}-${arch}.tar.gz" \
-C "${WORKDIR}/alpine-$(translate_arch "$arch")"

Expand All @@ -33,11 +34,8 @@ bootstrap_distribution() {

sudo rm -f "${WORKDIR:?}/alpine-$(translate_arch "$arch")"/var/cache/apk/* || true

sudo tar -J -c \
-f "${ROOTFS_DIR}/alpine-$(translate_arch "$arch")-pd-${CURRENT_VERSION}.tar.xz" \
-C "$WORKDIR" \
archive_rootfs "${ROOTFS_DIR}/alpine-$(translate_arch "$arch")-pd-${CURRENT_VERSION}.tar.xz" \
"alpine-$(translate_arch "$arch")"
sudo chown $(id -un):$(id -gn) "${ROOTFS_DIR}/alpine-$(translate_arch "$arch")-pd-${CURRENT_VERSION}.tar.xz"
done
}

Expand Down
15 changes: 6 additions & 9 deletions distro-build/archlinux.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,10 @@ bootstrap_distribution() {
--output "${WORKDIR}/archlinux-${arch}.tar.gz" \
"http://os.archlinuxarm.org/os/ArchLinuxARM-${arch}-latest.tar.gz"

sudo rm -rf "${WORKDIR}/archlinux-$(translate_arch "$arch")"
sudo mkdir -m 755 "${WORKDIR}/archlinux-$(translate_arch "$arch")"
sudo tar -zxpf "${WORKDIR}/archlinux-${arch}.tar.gz" \
sudo tar -zxp --acls --xattrs --xattrs-include='*' \
-f "${WORKDIR}/archlinux-${arch}.tar.gz" \
-C "${WORKDIR}/archlinux-$(translate_arch "$arch")"

cat <<- EOF | sudo unshare -mpf bash -e -
Expand All @@ -32,11 +34,8 @@ bootstrap_distribution() {

sudo rm -f "${WORKDIR:?}/archlinux-$(translate_arch "$arch")"/var/cache/pacman/pkg/* || true

sudo tar -J -c \
-f "${ROOTFS_DIR}/archlinux-$(translate_arch "$arch")-pd-${CURRENT_VERSION}.tar.xz" \
-C "$WORKDIR" \
archive_rootfs "${ROOTFS_DIR}/archlinux-$(translate_arch "$arch")-pd-${CURRENT_VERSION}.tar.xz" \
"archlinux-$(translate_arch "$arch")"
sudo chown $(id -un):$(id -gn) "${ROOTFS_DIR}/archlinux-$(translate_arch "$arch")-pd-${CURRENT_VERSION}.tar.xz"
done
unset arch

Expand All @@ -48,7 +47,7 @@ bootstrap_distribution() {
"https://mirror.rackspace.com/archlinux/iso/${dist_version}/archlinux-bootstrap-${dist_version}-x86_64.tar.gz"

sudo mkdir -m 755 "${WORKDIR}/archlinux-bootstrap"
sudo tar -zxp --strip-components=1 \
sudo tar -zxp --strip-components=1 --acls --xattrs --xattrs-include='*' \
-f "${WORKDIR}/archlinux-x86_64.tar.gz" \
-C "${WORKDIR}/archlinux-bootstrap"

Expand Down Expand Up @@ -76,10 +75,8 @@ bootstrap_distribution() {

for arch in i686 x86_64; do
sudo rm -f "${WORKDIR:?}/archlinux-bootstrap/archlinux-${arch}"/var/cache/pacman/pkg/* || true
sudo tar -Jcf "${ROOTFS_DIR}/archlinux-${arch}-pd-${CURRENT_VERSION}.tar.xz" \
-C "${WORKDIR}/archlinux-bootstrap" \
archive_rootfs "${ROOTFS_DIR}/archlinux-${arch}-pd-${CURRENT_VERSION}.tar.xz" \
"archlinux-${arch}"
sudo chown $(id -un):$(id -gn) "${ROOTFS_DIR}/archlinux-${arch}-pd-${CURRENT_VERSION}.tar.xz"
done
unset arch
}
Expand Down
9 changes: 4 additions & 5 deletions distro-build/artix.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,10 @@ bootstrap_distribution() {
--output "${WORKDIR}/artix-aarch64.tar.xz" \
"https://armtixlinux.org/images/armtix-runit-20230401.tar.xz"

sudo rm -rf "${WORKDIR}/artix-aarch64"
sudo mkdir -m 755 "${WORKDIR}/artix-aarch64"
sudo tar -Jxpf "${WORKDIR}/artix-aarch64.tar.xz" \
sudo tar -Jxp --acls --xattrs --xattrs-include='*' \
-f "${WORKDIR}/artix-aarch64.tar.xz" \
-C "${WORKDIR}/artix-aarch64"

cat <<- EOF | sudo unshare -mpf bash -e -
Expand All @@ -25,11 +27,8 @@ bootstrap_distribution() {

sudo rm -f "${WORKDIR:?}/artix-aarch64"/var/cache/pacman/pkg/* || true

sudo tar -J -c \
-f "${ROOTFS_DIR}/artix-aarch64-pd-${CURRENT_VERSION}.tar.xz" \
-C "$WORKDIR" \
archive_rootfs "${ROOTFS_DIR}/artix-aarch64-pd-${CURRENT_VERSION}.tar.xz" \
"artix-aarch64"
sudo chown $(id -un):$(id -gn) "${ROOTFS_DIR}/artix-aarch64-pd-${CURRENT_VERSION}.tar.xz"
}

write_plugin() {
Expand Down
9 changes: 5 additions & 4 deletions distro-build/debian.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,19 @@ dist_version="bookworm"

bootstrap_distribution() {
sudo rm -f "${ROOTFS_DIR}"/debian-*.tar.xz
sudo rm -rf "${WORKDIR}/debian-$(translate_arch "$arch")"

for arch in arm64 armhf i386 amd64; do
sudo mmdebstrap \
--architectures=${arch} \
--variant=minbase \
--components="main,contrib" \
--include="ca-certificates,locales" \
--format=tar \
--format=directory \
"${dist_version}" \
"${ROOTFS_DIR}/debian-$(translate_arch "$arch")-pd-${CURRENT_VERSION}.tar"
sudo chown $(id -un):$(id -gn) "${ROOTFS_DIR}/debian-$(translate_arch "$arch")-pd-${CURRENT_VERSION}.tar"
xz "${ROOTFS_DIR}/debian-$(translate_arch "$arch")-pd-${CURRENT_VERSION}.tar"
"${WORKDIR}/debian-$(translate_arch "$arch")"
archive_rootfs "${ROOTFS_DIR}/debian-$(translate_arch "$arch")-pd-${CURRENT_VERSION}.tar.xz" \
"${WORKDIR}/debian-$(translate_arch "$arch")"
done
unset arch
}
Expand Down
9 changes: 4 additions & 5 deletions distro-build/deepin.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@ bootstrap_distribution() {
sudo rm -f "${ROOTFS_DIR}"/deepin-*.tar.xz

for arch in amd64 arm64; do
mkdir -p ${WORKDIR}/deepin-$(translate_arch "$arch")/etc/apt/trusted.gpg.d
sudo rm -rf ${WORKDIR}/deepin-$(translate_arch "$arch")
sudo mkdir -p ${WORKDIR}/deepin-$(translate_arch "$arch")/etc/apt/trusted.gpg.d
sudo chmod 755 ${WORKDIR}/deepin-$(translate_arch "$arch")
curl --fail --location \
--output "${WORKDIR}/deepin-$(translate_arch "$arch")/etc/apt/trusted.gpg.d/deepin.gpg" \
"https://github.com/deepin-community/deepin-rootfs/raw/master/deepin.gpg"
Expand Down Expand Up @@ -42,11 +44,8 @@ bootstrap_distribution() {
env DEBIAN_FRONTEND=noninteractive DEBCONF_NONINTERACTIVE_SEEN=true LC_ALL=C LANGUAGE=C LANG=C chroot "${WORKDIR}/deepin-$(translate_arch "$arch")" dpkg --configure -a
EOF

sudo tar -J -c \
-f "${ROOTFS_DIR}/deepin-$(translate_arch "$arch")-pd-${CURRENT_VERSION}.tar.xz" \
-C "$WORKDIR" \
archive_rootfs "${ROOTFS_DIR}/deepin-$(translate_arch "$arch")-pd-${CURRENT_VERSION}.tar.xz" \
"deepin-$(translate_arch "$arch")"
sudo chown $(id -un):$(id -gn) "${ROOTFS_DIR}/deepin-$(translate_arch "$arch")-pd-${CURRENT_VERSION}.tar.xz"
done
unset arch
}
Expand Down
35 changes: 18 additions & 17 deletions distro-build/fedora.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,31 +9,32 @@ bootstrap_distribution() {
--output "${WORKDIR}/fedora-${dist_version}-${arch}.tar.xz" \
"https://mirror.de.leaseweb.net/fedora/linux/releases/${dist_version:0:2}/Container/${arch}/images/Fedora-Container-Base-${dist_version}.${arch}.tar.xz"

mkdir "${WORKDIR}/fedora-$(translate_arch "$arch")"
sudo rm -rf "${WORKDIR}/fedora-tmp" "${WORKDIR}/fedora-$(translate_arch "$arch")"
mkdir "${WORKDIR}/fedora-tmp"
sudo mkdir -m 755 "${WORKDIR}/fedora-$(translate_arch "$arch")"
sudo tar -Jx --strip-components=1 \
-f "${WORKDIR}/fedora-${dist_version}-${arch}.tar.xz" \
-C "${WORKDIR}/fedora-tmp"
sudo tar -xp --acls --xattrs --xattrs-include='*' \
-f "${WORKDIR}/fedora-tmp"/layer.tar \
-C "${WORKDIR}/fedora-$(translate_arch "$arch")"
sudo mkdir -m 755 "${WORKDIR}/fedora-$(translate_arch "$arch")/fedora-$(translate_arch "$arch")"
sudo tar -xpf "${WORKDIR}/fedora-$(translate_arch "$arch")"/layer.tar \
-C "${WORKDIR}/fedora-$(translate_arch "$arch")/fedora-$(translate_arch "$arch")"
sudo rm -rf "${WORKDIR}/fedora-tmp"

cat <<- EOF | sudo unshare -mpf bash -e -
rm -f "${WORKDIR}/fedora-$(translate_arch "$arch")/fedora-$(translate_arch "$arch")/etc/resolv.conf"
echo "nameserver 1.1.1.1" > "${WORKDIR}/fedora-$(translate_arch "$arch")/fedora-$(translate_arch "$arch")/etc/resolv.conf"
echo "excludepkgs=*selinux*" >> "${WORKDIR}/fedora-$(translate_arch "$arch")/fedora-$(translate_arch "$arch")/etc/dnf/dnf.conf"
mount --bind /dev "${WORKDIR}/fedora-$(translate_arch "$arch")/fedora-$(translate_arch "$arch")/dev"
mount --bind /proc "${WORKDIR}/fedora-$(translate_arch "$arch")/fedora-$(translate_arch "$arch")/proc"
mount --bind /sys "${WORKDIR}/fedora-$(translate_arch "$arch")/fedora-$(translate_arch "$arch")/sys"
chroot "${WORKDIR}/fedora-$(translate_arch "$arch")/fedora-$(translate_arch "$arch")" yum upgrade -y
chroot "${WORKDIR}/fedora-$(translate_arch "$arch")/fedora-$(translate_arch "$arch")" yum install -y passwd util-linux
chroot "${WORKDIR}/fedora-$(translate_arch "$arch")/fedora-$(translate_arch "$arch")" yum clean all
chmod 4755 "${WORKDIR}/fedora-$(translate_arch "$arch")/fedora-$(translate_arch "$arch")"/usr/bin/sudo
rm -f "${WORKDIR}/fedora-$(translate_arch "$arch")/etc/resolv.conf"
echo "nameserver 1.1.1.1" > "${WORKDIR}/fedora-$(translate_arch "$arch")/etc/resolv.conf"
echo "excludepkgs=*selinux*" >> "${WORKDIR}/fedora-$(translate_arch "$arch")/etc/dnf/dnf.conf"
mount --bind /dev "${WORKDIR}/fedora-$(translate_arch "$arch")/dev"
mount --bind /proc "${WORKDIR}/fedora-$(translate_arch "$arch")/proc"
mount --bind /sys "${WORKDIR}/fedora-$(translate_arch "$arch")/sys"
chroot "${WORKDIR}/fedora-$(translate_arch "$arch")" yum upgrade -y
chroot "${WORKDIR}/fedora-$(translate_arch "$arch")" yum install -y passwd util-linux
chroot "${WORKDIR}/fedora-$(translate_arch "$arch")" yum clean all
chmod 4755 "${WORKDIR}/fedora-$(translate_arch "$arch")"/usr/bin/sudo
EOF

sudo tar -Jcf "${ROOTFS_DIR}/fedora-$(translate_arch "$arch")-pd-${CURRENT_VERSION}.tar.xz" \
-C "${WORKDIR}/fedora-$(translate_arch "$arch")" \
archive_rootfs "${ROOTFS_DIR}/fedora-$(translate_arch "$arch")-pd-${CURRENT_VERSION}.tar.xz" \
"fedora-$(translate_arch "$arch")"
sudo chown $(id -un):$(id -gn) "${ROOTFS_DIR}/fedora-$(translate_arch "$arch")-pd-${CURRENT_VERSION}.tar.xz"
done
unset arch
}
Expand Down
10 changes: 5 additions & 5 deletions distro-build/manjaro.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,9 @@ bootstrap_distribution() {
--output "${WORKDIR}/manjaro-aarch64.tar.xz" \
"https://github.com/manjaro-arm/rootfs/releases/download/${dist_version}/Manjaro-ARM-aarch64-latest.tar.gz"

mkdir "${WORKDIR}/manjaro-aarch64"
sudo tar -xp \
sudo rm -rf "${WORKDIR}/manjaro-aarch64"
sudo mkdir -m 755 "${WORKDIR}/manjaro-aarch64"
sudo tar -xp --acls --xattrs --xattrs-include='*' \
-f "${WORKDIR}/manjaro-aarch64.tar.xz" \
-C "${WORKDIR}/manjaro-aarch64"

Expand All @@ -30,9 +31,8 @@ bootstrap_distribution() {

sudo rm -f "${WORKDIR:?}"/manjaro-aarch64/var/cache/pacman/pkg/* || true

sudo tar -Jcf "${ROOTFS_DIR}/manjaro-aarch64-pd-${CURRENT_VERSION}.tar.xz" \
-C "${WORKDIR}/manjaro-aarch64" ./
sudo chown $(id -un):$(id -gn) "${ROOTFS_DIR}/manjaro-aarch64-pd-${CURRENT_VERSION}.tar.xz"
archive_rootfs "${ROOTFS_DIR}/manjaro-aarch64-pd-${CURRENT_VERSION}.tar.xz" \
"manjaro-aarch64"
}

write_plugin() {
Expand Down
28 changes: 14 additions & 14 deletions distro-build/opensuse.sh
Original file line number Diff line number Diff line change
Expand Up @@ -26,28 +26,28 @@ bootstrap_distribution() {
docker save --output "${WORKDIR}/opensuse-image-dump-${arch}.tar" \
"opensuse/tumbleweed@${digest}"

mkdir "${WORKDIR}/opensuse-$(translate_arch "$arch")"
sudo rm -rf "${WORKDIR}/opensuse-tmp" "${WORKDIR}/opensuse-$(translate_arch "$arch")"
mkdir "${WORKDIR}/opensuse-tmp"
sudo mkdir -m 755 "${WORKDIR}/opensuse-$(translate_arch "$arch")"
sudo tar -x --strip-components=1 \
-f "${WORKDIR}/opensuse-image-dump-${arch}.tar" \
-C "${WORKDIR}/opensuse-tmp"
sudo tar -xpf "${WORKDIR}/opensuse-tmp"/layer.tar \
-C "${WORKDIR}/opensuse-$(translate_arch "$arch")"
sudo mkdir -m 755 "${WORKDIR}/opensuse-$(translate_arch "$arch")/opensuse-$(translate_arch "$arch")"
sudo tar -xpf "${WORKDIR}/opensuse-$(translate_arch "$arch")"/layer.tar \
-C "${WORKDIR}/opensuse-$(translate_arch "$arch")/opensuse-$(translate_arch "$arch")"
sudo rm -rf "${WORKDIR}/opensuse-tmp"

cat <<- EOF | sudo unshare -mpf bash -e -
rm -f "${WORKDIR}/opensuse-$(translate_arch "$arch")/opensuse-$(translate_arch "$arch")/etc/resolv.conf"
echo "nameserver 1.1.1.1" > "${WORKDIR}/opensuse-$(translate_arch "$arch")/opensuse-$(translate_arch "$arch")/etc/resolv.conf"
mount --bind /dev "${WORKDIR}/opensuse-$(translate_arch "$arch")/opensuse-$(translate_arch "$arch")/dev"
mount --bind /proc "${WORKDIR}/opensuse-$(translate_arch "$arch")/opensuse-$(translate_arch "$arch")/proc"
mount --bind /sys "${WORKDIR}/opensuse-$(translate_arch "$arch")/opensuse-$(translate_arch "$arch")/sys"
chroot "${WORKDIR}/opensuse-$(translate_arch "$arch")/opensuse-$(translate_arch "$arch")" zypper dup || true
chroot "${WORKDIR}/opensuse-$(translate_arch "$arch")/opensuse-$(translate_arch "$arch")" zypper install --no-confirm util-linux || true
rm -f "${WORKDIR}/opensuse-$(translate_arch "$arch")/etc/resolv.conf"
echo "nameserver 1.1.1.1" > "${WORKDIR}/opensuse-$(translate_arch "$arch")/etc/resolv.conf"
mount --bind /dev "${WORKDIR}/opensuse-$(translate_arch "$arch")/dev"
mount --bind /proc "${WORKDIR}/opensuse-$(translate_arch "$arch")/proc"
mount --bind /sys "${WORKDIR}/opensuse-$(translate_arch "$arch")/sys"
chroot "${WORKDIR}/opensuse-$(translate_arch "$arch")" zypper dup || true
chroot "${WORKDIR}/opensuse-$(translate_arch "$arch")" zypper install --no-confirm util-linux || true
EOF

sudo tar -Jcf "${ROOTFS_DIR}/opensuse-$(translate_arch "$arch")-pd-${CURRENT_VERSION}.tar.xz" \
-C "${WORKDIR}/opensuse-$(translate_arch "$arch")" \
archive_rootfs "${ROOTFS_DIR}/opensuse-$(translate_arch "$arch")-pd-${CURRENT_VERSION}.tar.xz" \
"opensuse-$(translate_arch "$arch")"
sudo chown $(id -un):$(id -gn) "${ROOTFS_DIR}/opensuse-$(translate_arch "$arch")-pd-${CURRENT_VERSION}.tar.xz"
done
unset opensuse_manifest
}
Expand Down
9 changes: 5 additions & 4 deletions distro-build/pardus.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ dist_version="yirmibir"

bootstrap_distribution() {
sudo rm -f "${ROOTFS_DIR}"/pardus-*.tar.xz
sudo rm -rf "${WORKDIR}/pardus-$(translate_arch "$arch")"

for arch in arm64 i386 amd64; do
wget https://depo.pardus.org.tr/pardus/pool/main/p/pardus-archive-keyring/pardus-archive-keyring_2021.1_all.deb
Expand All @@ -13,12 +14,12 @@ bootstrap_distribution() {
--variant=minbase \
--components="main,contrib,non-free" \
--include="ca-certificates,libsystemd0,pardus-archive-keyring,systemd-sysv" \
--format=tar \
--format=directory \
"${dist_version}" \
"${ROOTFS_DIR}/pardus-$(translate_arch "$arch")-pd-${CURRENT_VERSION}.tar" \
"${WORKDIR}/pardus-$(translate_arch "$arch")" \
https://depo.pardus.org.tr/pardus
sudo chown $(id -un):$(id -gn) "${ROOTFS_DIR}/pardus-$(translate_arch "$arch")-pd-${CURRENT_VERSION}.tar"
xz "${ROOTFS_DIR}/pardus-$(translate_arch "$arch")-pd-${CURRENT_VERSION}.tar"
archive_rootfs "${ROOTFS_DIR}/pardus-$(translate_arch "$arch")-pd-${CURRENT_VERSION}.tar.xz" \
"${WORKDIR}/pardus-$(translate_arch "$arch")"
done
unset arch
}
Expand Down
9 changes: 5 additions & 4 deletions distro-build/ubuntu.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,19 @@ dist_version="mantic"

bootstrap_distribution() {
sudo rm -f "${ROOTFS_DIR}"/ubuntu-*.tar.xz
sudo rm -rf "${WORKDIR}/ubuntu-$(translate_arch "$arch")"

for arch in arm64 armhf amd64; do
sudo mmdebstrap \
--architectures=${arch} \
--variant=apt \
--components="main,universe,multiverse" \
--include="locales,passwd" \
--format=tar \
--format=directory \
"${dist_version}" \
"${ROOTFS_DIR}/ubuntu-$(translate_arch "$arch")-pd-${CURRENT_VERSION}.tar"
sudo chown $(id -un):$(id -gn) "${ROOTFS_DIR}/ubuntu-$(translate_arch "$arch")-pd-${CURRENT_VERSION}.tar"
xz "${ROOTFS_DIR}/ubuntu-$(translate_arch "$arch")-pd-${CURRENT_VERSION}.tar"
"${WORKDIR}/ubuntu-$(translate_arch "$arch")"
archive_rootfs "${ROOTFS_DIR}/ubuntu-$(translate_arch "$arch")-pd-${CURRENT_VERSION}.tar.xz" \
"${WORKDIR}/ubuntu-$(translate_arch "$arch")"
done
unset arch
}
Expand Down
8 changes: 3 additions & 5 deletions distro-build/void.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,9 @@ bootstrap_distribution() {
--output "${WORKDIR}/void-${arch}.tar.xz" \
"https://repo-default.voidlinux.org/live/${dist_version}/void-${arch}-ROOTFS-${dist_version}.tar.xz"

sudo rm -rf "${WORKDIR}/void-$(translate_arch "$arch")"
sudo mkdir -m 755 "${WORKDIR}/void-$(translate_arch "$arch")"
sudo tar -Jxp \
sudo tar -Jxp --acls --xattrs --xattrs-include='*' \
-f "${WORKDIR}/void-${arch}.tar.xz" \
-C "${WORKDIR}/void-$(translate_arch "$arch")"

Expand All @@ -29,11 +30,8 @@ bootstrap_distribution() {

sudo rm -f "${WORKDIR}/void-$(translate_arch "$arch")"/var/cache/xbps/* || true

sudo tar -J -c \
-f "${ROOTFS_DIR}/void-$(translate_arch "$arch")-pd-${CURRENT_VERSION}.tar.xz" \
-C "$WORKDIR" \
archive_rootfs "${ROOTFS_DIR}/void-$(translate_arch "$arch")-pd-${CURRENT_VERSION}.tar.xz" \
"void-$(translate_arch "$arch")"
sudo chown $(id -un):$(id -gn) "${ROOTFS_DIR}/void-$(translate_arch "$arch")-pd-${CURRENT_VERSION}.tar.xz"
done
}

Expand Down

0 comments on commit d5797cf

Please sign in to comment.