Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Image export fails when ${WORK_DIR} contains relative paths #697

Open
tblaha opened this issue Jul 17, 2023 · 1 comment
Open

Image export fails when ${WORK_DIR} contains relative paths #697

tblaha opened this issue Jul 17, 2023 · 1 comment

Comments

@tblaha
Copy link

tblaha commented Jul 17, 2023

Hey all!

I'm building my image with pi-gen as a submodule and so I configured WORK_DIR=${BASE_DIR}/../../build/pi-ing/work, and I've noticed that this breaks the command that should find the loopback device, because the mount table is of course absolute:

if [ "${USE_QCOW2}" = "0" ] && [ "${NO_PRERUN_QCOW2}" = "0" ]; then
ROOT_DEV="$(mount | grep "${ROOTFS_DIR} " | cut -f1 -d' ')"
unmount "${ROOTFS_DIR}"
zerofree "${ROOT_DEV}"
unmount_image "${IMG_FILE}"
else
unload_qimage
make_bootable_image "${STAGE_WORK_DIR}/${IMG_FILENAME}${IMG_SUFFIX}.qcow2" "$IMG_FILE"
fi

I would propose to add $(realpath ${POTENTIALLY_RELATIVE_PATH}) where ever necessary (eg my problem was fixed when applying this to the ROOTFS_DIR definition in build.sh).

Regards,
Till

@XECDesign
Copy link
Member

I wouldn't be opposed to merging a PR with the fix. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants