Remove redundant boot-* and nokia-argon-sxmo.img image artifacts

This commit is contained in:
Luxferre
2026-10-25 08:51:46 +02:00
parent fb5b9c9982
commit 0a65fc0ea2
4 changed files with 14 additions and 27 deletions
+10 -14
View File
@@ -170,7 +170,7 @@ EOF
depmod -b "$ROOTFS" 6.12.1-msm8916
if [ "$RUN_MKINITFS" = "--mkinitfs" ] || [ ! -f "$ROOTFS/boot/boot.img" ]; then
if [ "$RUN_MKINITFS" = "--mkinitfs" ] || [ ! -f "$ROOTFS/boot/initramfs" ]; then
echo "[2/5] Running depmod and mkinitfs inside $ROOTFS..."
rm -rf "$ROOTFS/tmp/hostbin"
mkdir -p "$ROOTFS/tmp/hostbin"
@@ -211,12 +211,7 @@ EOF
ln -sf /bin/busybox "$ROOTFS/bin/sh"
rm -rf "$ROOTFS/tmp/hostbin" "$ROOTFS/lib/ld-musl-x86_64.so.1" "$ROOTFS/proc/1"
else
echo "[2/5] Using existing $ROOTFS/boot/boot.img (pass --mkinitfs to regenerate)..."
fi
cp "$ROOTFS/boot/boot.img" "/images/boot-bananarchy-$TARGET_DEVICE.img"
if [ "$TARGET_DEVICE" = "nokia-argon" ]; then
cp "$ROOTFS/boot/boot.img" "/images/boot-nokia-argon-sxmo.img"
echo "[2/5] Using existing $ROOTFS/boot/initramfs (pass --mkinitfs to regenerate)..."
fi
echo "[3/5] Creating ext2 boot (256 MiB) and ext4 root filesystems..."
@@ -247,7 +242,12 @@ EOF
echo "[4/5] Assembling partitioned MBR raw image..."
RAW_IMG="/images/bananarchy-$TARGET_DEVICE.img"
TOTAL_MB=$(( 1 + BOOT_MB + ROOT_MB ))
rm -f "$RAW_IMG" "/images/bananarchy-$TARGET_DEVICE.sparse.img" "/images/nokia-argon-sxmo.sparse.img"
rm -f "$RAW_IMG" \
"/images/bananarchy-$TARGET_DEVICE.sparse.img" \
"/images/nokia-argon-sxmo.sparse.img" \
"/images/nokia-argon-sxmo.img" \
"/images/boot-bananarchy-$TARGET_DEVICE.img" \
"/images/boot-nokia-argon-sxmo.img"
truncate -s "${TOTAL_MB}M" "$RAW_IMG"
BOOT_SECTORS=$(( BOOT_MB * 2048 ))
@@ -265,14 +265,10 @@ SFEOF
dd if="$ROOT_IMG" of="$RAW_IMG" bs=1M seek=$(( 1 + BOOT_MB )) conv=notrunc,sparse status=none
rm -f "$BOOT_IMG" "$ROOT_IMG"
if [ "$TARGET_DEVICE" = "nokia-argon" ]; then
ln -f "$RAW_IMG" "/images/nokia-argon-sxmo.img"
fi
echo "[5/5] Restoring host user ownership on $ROOTFS for easy host editing..."
chown -R "$HOST_UID:$HOST_GID" "$ROOTFS" "/images"
chmod -R u+rwX "$ROOTFS"
echo "Built Bananarchy images for $TARGET_DEVICE:"
ls -lh "/images/boot-bananarchy-$TARGET_DEVICE.img" "$RAW_IMG"
echo "Built Bananarchy image for $TARGET_DEVICE:"
ls -lh "$RAW_IMG"
'