RPi-Distro / pi-gen

Tool used to create the official Raspberry Pi OS images
BSD 3-Clause "New" or "Revised" License
2.57k stars 1.61k forks source link

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

Open tblaha opened 1 year ago

tblaha commented 1 year ago

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:

https://github.com/RPi-Distro/pi-gen/blob/01d24ef22778337ed04cf9d6444b1be57b6a1e1a/export-image/05-finalise/01-run.sh#L86-L96

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 commented 1 year ago

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