Skip to content

Instantly share code, notes, and snippets.

@Robokishan
Created February 17, 2021 05:26
Show Gist options
  • Save Robokishan/8ffb8acec88fbbaf6c6c857d9c4ffe6a to your computer and use it in GitHub Desktop.
Save Robokishan/8ffb8acec88fbbaf6c6c857d9c4ffe6a to your computer and use it in GitHub Desktop.
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