Clean up clean up
This commit is contained in:
@@ -8,19 +8,19 @@ rm -f ${IMG_FILE}
|
||||
rm -rf ${ROOTFS_DIR}
|
||||
mkdir -p ${ROOTFS_DIR}
|
||||
|
||||
BOOT_SIZE=$(du -sh ${EXPORT_ROOTFS_DIR}/boot -B M | cut -f 1 | tr -d M)
|
||||
TOTAL_SIZE=$(du -sh ${EXPORT_ROOTFS_DIR} -B M | cut -f 1 | tr -d M)
|
||||
BOOT_SIZE=$(du -s ${EXPORT_ROOTFS_DIR}/boot --block-size=1 | cut -f 1)
|
||||
TOTAL_SIZE=$(du -s ${EXPORT_ROOTFS_DIR} --exclude var/cache/apt/archives --block-size=1 | cut -f 1)
|
||||
|
||||
IMG_SIZE=$(expr $BOOT_SIZE \* 2 \+ $TOTAL_SIZE \+ 512)M
|
||||
IMG_SIZE=$((BOOT_SIZE + TOTAL_SIZE + (400 * 1024 * 1024)))
|
||||
|
||||
fallocate -l ${IMG_SIZE} ${IMG_FILE}
|
||||
fdisk ${IMG_FILE} > /dev/null 2>&1 <<EOF
|
||||
fdisk -H 255 -S 63 ${IMG_FILE} <<EOF
|
||||
o
|
||||
n
|
||||
|
||||
|
||||
8192
|
||||
+`expr $BOOT_SIZE \* 3`M
|
||||
+$((BOOT_SIZE * 2 /512))
|
||||
p
|
||||
t
|
||||
c
|
||||
@@ -57,4 +57,4 @@ mount -v $ROOT_DEV ${ROOTFS_DIR} -t ext4
|
||||
mkdir -p ${ROOTFS_DIR}/boot
|
||||
mount -v $BOOT_DEV ${ROOTFS_DIR}/boot -t vfat
|
||||
|
||||
rsync -aHAXx ${EXPORT_ROOTFS_DIR}/ ${ROOTFS_DIR}/
|
||||
rsync -aHAXx --exclude var/cache/apt/archives ${EXPORT_ROOTFS_DIR}/ ${ROOTFS_DIR}/
|
||||
|
Reference in New Issue
Block a user