@le-space/rootfs 0.3.3 → 0.3.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@le-space/rootfs",
3
- "version": "0.3.3",
3
+ "version": "0.3.6",
4
4
  "description": "Shared rootfs contract parsing, reference profile assets, and build helpers.",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -11,6 +11,7 @@ BASE_IMAGE="${OUT_DIR}/debian-12-genericcloud-amd64.qcow2"
11
11
  IMAGE="${OUT_DIR}/aleph-uc-go-peer.qcow2"
12
12
  APP_BINARY="${OUT_DIR}/universal-chat-go"
13
13
  ROOTFS_IMAGE_SIZE="${ROOTFS_IMAGE_SIZE:-20G}"
14
+ ROOTFS_SPARSIFY="${ROOTFS_SPARSIFY:-1}"
14
15
  ROOTFS_BUILD_TMPDIR=""
15
16
  HOST_UID="${HOST_UID:-}"
16
17
  HOST_GID="${HOST_GID:-}"
@@ -108,6 +109,14 @@ virt-customize \
108
109
  --run-command "systemctl enable ${ROOTFS_CONTRACT_AUTOTLS_SERVICE}" \
109
110
  --run-command "systemctl enable ${ROOTFS_CONTRACT_MAIN_SERVICE}"
110
111
 
112
+ if [ "${ROOTFS_SPARSIFY}" = "1" ] && command -v virt-sparsify >/dev/null 2>&1; then
113
+ SPARSE_IMAGE="${IMAGE%.qcow2}.sparse.qcow2"
114
+ rm -f "${SPARSE_IMAGE}"
115
+ echo "Sparsifying and compressing ${IMAGE}..."
116
+ virt-sparsify --compress "${IMAGE}" "${SPARSE_IMAGE}"
117
+ mv "${SPARSE_IMAGE}" "${IMAGE}"
118
+ fi
119
+
111
120
  echo "Rootfs image ready at ${IMAGE}"
112
121
 
113
122
  if [ -n "${HOST_UID}" ] && [ -n "${HOST_GID}" ]; then