Skip to content

Commit fa54120

Browse files
committed
fixup! feat(rootfs-to-image): support ROOTFS_EXPORT_DIR and configurable ROOTFS_COMPRESSION
1 parent cf6e053 commit fa54120

1 file changed

Lines changed: 3 additions & 11 deletions

File tree

lib/functions/image/rootfs-to-image.sh

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -145,16 +145,8 @@ function create_image_from_sdcard_rootfs() {
145145
# Useful when the build host is the NFS server, or has the NFS export mounted,
146146
# so netboot deployment is a single build step with no unpack/transport phase.
147147
if [[ -n "${ROOTFS_EXPORT_DIR}" ]]; then
148-
# Resolve and refuse catastrophic values (e.g. typoed "/"): rsync --delete
149-
# below would then mirror the rootfs into the host/container root and drop
150-
# anything not in the image.
151-
declare rootfs_export_dir_resolved
152-
rootfs_export_dir_resolved="$(realpath -m "${ROOTFS_EXPORT_DIR}")"
153-
if [[ "${rootfs_export_dir_resolved}" == "/" ]]; then
154-
exit_with_error "ROOTFS_EXPORT_DIR must not resolve to /" "${ROOTFS_EXPORT_DIR}"
155-
fi
156-
display_alert "Exporting rootfs tree" "${rootfs_export_dir_resolved}" "info"
157-
run_host_command_logged mkdir -pv "${rootfs_export_dir_resolved}"
148+
display_alert "Exporting rootfs tree" "${ROOTFS_EXPORT_DIR}" "info"
149+
run_host_command_logged mkdir -pv "${ROOTFS_EXPORT_DIR}"
158150
# --delete so files removed from the source rootfs don't survive in a
159151
# reused export tree (otherwise the NFS root silently drifts from the image).
160152
# --delete-excluded additionally purges receiver-side files that match our
@@ -167,7 +159,7 @@ function create_image_from_sdcard_rootfs() {
167159
--exclude="/tmp/*" \
168160
--exclude="/sys/*" \
169161
$exclude_home \
170-
--info=progress0,stats1 "$SDCARD/" "${rootfs_export_dir_resolved}/"
162+
--info=progress0,stats1 "$SDCARD/" "${ROOTFS_EXPORT_DIR}/"
171163
fi
172164

173165
call_extension_method "post_create_rootfs_archive" <<- 'POST_CREATE_ROOTFS_ARCHIVE'

0 commit comments

Comments
 (0)