diff --git a/MANUAL.md b/MANUAL.md index 8d3b0ed..ec487b8 100644 --- a/MANUAL.md +++ b/MANUAL.md @@ -12,9 +12,8 @@ This manual covers flashing, operating, and customizing **Bananarchy Linux** (Sx ## 1. System overview & workspace contents -### 1.1 System images (`images/`) +### 1.1 System image (`images/`) - `images/bananarchy-nokia-argon.img` — partitioned image (`256 MiB` `ext2` `pmOS_boot` + `ext4` `pmOS_root`) ready for EDL flashing to `userdata`, `fastboot flash userdata`, or raw `dd` to a microSD card. -- `images/boot-bananarchy-nokia-argon.img` — standalone Android `boot.img` with Linux `6.12.1-msm8916`, initramfs, and appended DTB. - Additional device images (`bananarchy-nokia-beatles.img`, `bananarchy-nokia-tough.img`, `bananarchy-nokia-sparkler.img`) can be generated at any time via `./rebuild-image.sh --mkinitfs`. ### 1.2 Bootloader & EDL programmer (`bootloader/`) diff --git a/README.md b/README.md index 53d20c5..30ca327 100644 --- a/README.md +++ b/README.md @@ -129,9 +129,8 @@ All components are pre-compiled in `prebuilt/` and `overlay/rootfs/`, and can be ./rebuild-image.sh nokia-tough --mkinitfs ./rebuild-image.sh nokia-sparkler --mkinitfs ``` -Output images are written to `images/`: -- `images/bananarchy-.img` (partitioned MBR image for EDL `userdata`, `fastboot flash userdata`, or microSD card) -- `images/boot-bananarchy-.img` (kernel + initramfs + DTB boot image) +Output image is written to `images/`: +- `images/bananarchy-.img` (partitioned MBR image with `pmOS_boot` + `pmOS_root` for EDL `userdata`, `fastboot flash userdata`, or microSD card) --- diff --git a/flash-edl.py b/flash-edl.py index b4b6bab..7cc9789 100755 --- a/flash-edl.py +++ b/flash-edl.py @@ -182,14 +182,7 @@ def resolve_default_bootloader(): def resolve_default_image(device): - candidates = [ - os.path.join(BASE_DIR, "images", f"bananarchy-{device}.img"), - os.path.join(BASE_DIR, "images", "nokia-argon-sxmo.img"), - ] - for cand in candidates: - if os.path.isfile(cand): - return cand - return candidates[0] + return os.path.join(BASE_DIR, "images", f"bananarchy-{device}.img") def parse_args(): diff --git a/rebuild-image.sh b/rebuild-image.sh index bfc1e7e..c288250 100755 --- a/rebuild-image.sh +++ b/rebuild-image.sh @@ -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" '