Skip to content

Commit

Permalink
fs: waste less storage building Fedora
Browse files Browse the repository at this point in the history
  • Loading branch information
rvstry committed Dec 4, 2021
1 parent 4840a0d commit bbc7a73
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions fs/build
Original file line number Diff line number Diff line change
Expand Up @@ -93,20 +93,18 @@ case "$ROOTFS" in
IMAGE_URL="https://download.fedoraproject.org/pub/fedora-secondary/releases/35/Spins/aarch64/images/Fedora-Minimal-35-1.2.aarch64.raw.xz"
;;
esac
if [ ! -f "Fedora-$ARCH_FED.ext4" ]; then
# rootfs is 3rd partiton of raw image
if [ ! -f "fedora-$ARCH_FED.raw" ]; then
wget $IMAGE_URL -O fedora-$ARCH_FED.raw.xz
xz -vdk fedora-$ARCH_FED.raw.xz
IMAGE_LOOP=$(losetup -f -P fedora*.raw --show)
dd if=${IMAGE_LOOP}p3 of=Fedora-$ARCH_FED.ext4 status=progress
losetup -d $IMAGE_LOOP
xz -vd fedora-$ARCH_FED.raw.xz
fi
# TODO: write rootfs image to rootpart instead of copying over files
# rootfs is 3rd partiton of raw image
IMAGE_LOOP=$(losetup -f -P fedora-$ARCH_FED.raw --show)
mkdir -p fedorarootfsimg
mount Fedora-$ARCH_FED.ext4 fedorarootfsimg/
mount ${IMAGE_LOOP}p3 fedorarootfsimg/
cp -a fedorarootfsimg/* $CADMIUMROOT/tmp/root
for x in {1..3}; do sed -i '$d' root/etc/fstab; sleep 1; done # remove / , /boot, /boot/efi from fstab
umount fedorarootfsimg/
losetup -d $IMAGE_LOOP
;;
# let's explain this: when void is set, $V is set to -v, so it does 'grep -v musl', printing link without musl
# when $V is not set, grep is 'grep musl', printing only link with musl
Expand Down

0 comments on commit bbc7a73

Please sign in to comment.