mount-media-chroot 501 Bytes
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13
#!/bin/bash
# This script runs on the live media, ie. outside of the chroot environment.

# debian-live ensures that this is always at the same place, so we can just bind-mount it
MEDIA="/lib/live/mount/medium"

# More tricky, we need to figure out where calamares left us the chroot.
# This seems to work reliably in all tested cases.
CHROOT=$(mount | grep proc | grep calamares | awk '{print $3}' | sed -e "s#/proc##g")

mkdir -p $CHROOT/media/installer
mount --bind $MEDIA $CHROOT/media/installer