Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
This is script shortcut for chroot-to-pi.sh
if [ "$1" ]; then
sudo kpartx -v -a $1
loop_device=`losetup --list | grep "2021-02-02-raspbian-lite.img" | cut -d ' ' -f1 | cut -d'/' -f3`
mapper_loop_device="/dev/mapper/${loop_device}p"
echo "Mapper device => ${mapper_loop_device}"
echo "Mounting to => `ls /mnt`"
sudo bash chroot-to-pi.sh $mapper_loop_device
sudo kpartx -d $1
else
echo "Please Provide img file"
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment