aboutsummaryrefslogtreecommitdiffstats
path: root/export-image
diff options
context:
space:
mode:
authorSven Gothel <[email protected]>2021-07-04 01:10:45 +0200
committerSven Gothel <[email protected]>2021-07-04 01:10:45 +0200
commitc1395fed1ba87d0baa7c012332afcaefb5251444 (patch)
treeba646cea90760712cc6ad927a9e3826a3453e5d4 /export-image
parent5c15b55020568deb07e6fab5a5d3c07e5140c2cf (diff)
Create rootfs variations of squashfs and use the LZO variant as default; Use dedicated DEPLOY_DIR subfolder for each stage...
We produce squashfs variants with compression: - gzip - lzo - none Use dedicated DEPLOY_DIR subfolder for each stage due to exploded sdcard folder: ${DEPLOY_DIR}/${IMG_FILENAME}-${STAGE}
Diffstat (limited to 'export-image')
-rwxr-xr-xexport-image/04-finalise/01-run.sh30
1 files changed, 22 insertions, 8 deletions
diff --git a/export-image/04-finalise/01-run.sh b/export-image/04-finalise/01-run.sh
index 9819220..71cc614 100755
--- a/export-image/04-finalise/01-run.sh
+++ b/export-image/04-finalise/01-run.sh
@@ -8,12 +8,15 @@ elif [ "${DEPLOY_DIR}" = "/" ] ; then
exit 1
fi
-DEPLOY_DIR2="${DEPLOY_DIR}/${IMG_FILENAME}"
+DEPLOY_DIR2="${DEPLOY_DIR}/${IMG_FILENAME}-${STAGE}"
IMG_FILE="${STAGE_WORK_DIR}/${IMG_FILENAME}${IMG_SUFFIX}.img"
INFO_FILE="${STAGE_WORK_DIR}/${IMG_FILENAME}${IMG_SUFFIX}.info"
-IMG_FILE_ROOT="${STAGE_WORK_DIR}/${IMG_FILENAME}${IMG_SUFFIX}.root.img"
+IMG_FILE_ROOT_EXT4="${STAGE_WORK_DIR}/${IMG_FILENAME}${IMG_SUFFIX}.root-ext4.img"
+IMG_FILE_ROOT_SQFS_GZ="${STAGE_WORK_DIR}/${IMG_FILENAME}${IMG_SUFFIX}.root-sqfs_gz.img"
+IMG_FILE_ROOT_SQFS_LZO="${STAGE_WORK_DIR}/${IMG_FILENAME}${IMG_SUFFIX}.root-sqfs_lzo.img"
+IMG_FILE_ROOT_SQFS_NONE="${STAGE_WORK_DIR}/${IMG_FILENAME}${IMG_SUFFIX}.root-sqfs_none.img"
INFO_FILE_ROOT="${STAGE_WORK_DIR}/${IMG_FILENAME}${IMG_SUFFIX}.root.info"
#IMG_FILE_BOOT="${STAGE_WORK_DIR}/${IMG_FILENAME}${IMG_SUFFIX}.boot.img"
#INFO_FILE_BOOT="${STAGE_WORK_DIR}/${IMG_FILENAME}${IMG_SUFFIX}.boot.info"
@@ -89,7 +92,7 @@ cp "$INFO_FILE" "$INFO_FILE_ROOT"
echo >> "$INFO_FILE_ROOT"
echo "+++" >> "$INFO_FILE_ROOT"
echo >> "$INFO_FILE_ROOT"
-echo "Root Partition `basename $IMG_FILE_ROOT`" >> "$INFO_FILE_ROOT"
+echo "Root Partition `basename $IMG_FILE_ROOT_EXT4`" >> "$INFO_FILE_ROOT"
echo "Root Partition of `basename $IMG_FILE`" >> "$INFO_FILE_ROOT"
echo >> "$INFO_FILE_ROOT"
@@ -119,31 +122,42 @@ cp -a "${ROOTFS_DIR}/boot/zafena/etc" "${ROOTFS_DIR}/data/sdc
unload_qimage
make_bootable_image "${STAGE_WORK_DIR}/${IMG_FILENAME}${IMG_SUFFIX}.qcow2" \
"$IMG_FILE" \
- "$IMG_FILE_ROOT" "$INFO_FILE_ROOT"
+ "$IMG_FILE_ROOT_EXT4" "$INFO_FILE_ROOT"
# "$IMG_FILE_BOOT" "$INFO_FILE_BOOT" \
# "$IMG_FILE_DATA" "$INFO_FILE_DATA"
+mount -o ro "$IMG_FILE_ROOT_EXT4" "${ROOTFS_DIR}"
+mksquashfs "${ROOTFS_DIR}" "${IMG_FILE_ROOT_SQFS_GZ}" -comp gzip
+mksquashfs "${ROOTFS_DIR}" "${IMG_FILE_ROOT_SQFS_LZO}" -comp lzo
+mksquashfs "${ROOTFS_DIR}" "${IMG_FILE_ROOT_SQFS_NONE}" -noI -noD -noF -noX
+umount "${ROOTFS_DIR}"
+
cp -a "$INFO_FILE_ROOT" "${DEPLOY_DIR2}/sdcard/sys_arm64_000/rootfs.inf"
mv "$INFO_FILE" "$INFO_FILE_ROOT" "$DEPLOY_DIR2/"
#mv "$INFO_FILE" "$INFO_FILE_ROOT" "$INFO_FILE_BOOT" "$INFO_FILE_DATA" "$DEPLOY_DIR2/"
if [ "${DEPLOY_ZIP}" == "1" ]; then
gzip -k "$IMG_FILE"
- gzip -k "$IMG_FILE_ROOT"
+ gzip -k "$IMG_FILE_ROOT_EXT4"
#gzip -k "$IMG_FILE_BOOT"
#gzip -k "$IMG_FILE_DATA"
mv "$IMG_FILE".gz "$DEPLOY_DIR2/"
- mv "$IMG_FILE_ROOT".gz "$DEPLOY_DIR2/"
+ mv "$IMG_FILE_ROOT_EXT4".gz "$DEPLOY_DIR2/"
#mv "$IMG_FILE_BOOT".gz "$DEPLOY_DIR2/"
#mv "$IMG_FILE_DATA".gz "$DEPLOY_DIR2/"
fi
mv "$IMG_FILE" "$DEPLOY_DIR2/"
-cp -a "$IMG_FILE_ROOT" "${DEPLOY_DIR2}/sdcard/sys_arm64_000/rootfs.img"
-mv "$IMG_FILE_ROOT" "$DEPLOY_DIR2/"
+# cp -a "$IMG_FILE_ROOT_EXT4" "${DEPLOY_DIR2}/sdcard/sys_arm64_000/rootfs.img"
+cp -a "$IMG_FILE_ROOT_SQFS_LZO" "${DEPLOY_DIR2}/sdcard/sys_arm64_000/rootfs.img"
+
+mv "$IMG_FILE_ROOT_EXT4" "$DEPLOY_DIR2/"
+mv "$IMG_FILE_ROOT_SQFS_GZ" "$DEPLOY_DIR2/"
+mv "$IMG_FILE_ROOT_SQFS_LZO" "$DEPLOY_DIR2/"
+mv "$IMG_FILE_ROOT_SQFS_NONE" "$DEPLOY_DIR2/"
#mv "$IMG_FILE_BOOT" "$DEPLOY_DIR2/"
#mv "$IMG_FILE_DATA" "$DEPLOY_DIR2/"