Skip to content

Commit

Permalink
export-image: Set /boot size to 256MB
Browse files Browse the repository at this point in the history
  • Loading branch information
XECDesign authored and fuji246 committed Sep 13, 2019
1 parent 4dc1803 commit 18909d4
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions export-image/prerun.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@ rm -f "${IMG_FILE}"
rm -rf "${ROOTFS_DIR}"
mkdir -p "${ROOTFS_DIR}"

BOOT_SIZE=$(du --apparent-size -s "${EXPORT_ROOTFS_DIR}/boot" --block-size=1 | cut -f 1)
BOOT_SIZE="$((256 * 1024 * 1024))"
TOTAL_SIZE=$(du --apparent-size -s "${EXPORT_ROOTFS_DIR}" --exclude var/cache/apt/archives --block-size=1 | cut -f 1)

ROUND_SIZE="$((4 * 1024 * 1024))"
ROUNDED_ROOT_SECTOR=$(((2 * BOOT_SIZE + ROUND_SIZE) / ROUND_SIZE * ROUND_SIZE / 512 + 8192))
ROUNDED_ROOT_SECTOR=$(((BOOT_SIZE + ROUND_SIZE) / ROUND_SIZE * ROUND_SIZE / 512 + 8192))
IMG_SIZE=$(((BOOT_SIZE + TOTAL_SIZE + (800 * 1024 * 1024) + ROUND_SIZE - 1) / ROUND_SIZE * ROUND_SIZE))

truncate -s "${IMG_SIZE}" "${IMG_FILE}"
Expand All @@ -23,7 +23,7 @@ n
8192
+$((BOOT_SIZE * 2 /512))
+$((BOOT_SIZE / 512))
p
t
c
Expand Down
2 changes: 1 addition & 1 deletion export-noobs/00-release/00-run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ ROOT_SIZE="$(xz --robot -l "${NOOBS_DIR}/root.tar.xz" | grep totals | cut -f 5)
BOOT_SIZE="$(( BOOT_SIZE / 1024 / 1024 + 1))"
ROOT_SIZE="$(( ROOT_SIZE / 1024 / 1024 + 1))"

BOOT_NOM="$(( BOOT_SIZE * 3 ))"
BOOT_NOM="256"
ROOT_NOM="$(( ROOT_SIZE + 400 ))"

mv "${NOOBS_DIR}/OS.png" "${NOOBS_DIR}/${NOOBS_NAME// /_}.png"
Expand Down

0 comments on commit 18909d4

Please sign in to comment.