sudo mkdir -p /mnt/runimg pi@raspberry48:~ $ sudo mount --bind /media/netdir/raspbrreyPi/mnt_runimg /mnt/runimg pi@raspberry48:~ $ ls -l /mnt/runimg/ total 18797568 -rwxrwxrwx+ 1 99 99 4555014144 Jan 7 22:32 2019-04-08-raspbian-stretch_chroot.img -rwxrwxrwx+ 1 systemd-timesync 98 3481272320 Feb 9 23:45 2019-04-08-raspbian-stretch-make-new.img -rwxrwxrwx+ 1 root root 3481272320 Dec 30 09:55 2019-04-08-raspbian-stretch-make-old.img -rwx------+ 1 99 99 3829399552 Jan 26 21:38 2019-09-26-raspbian-buster_jin.img drwxrwxrwx+ 1 root root 160 Dec 19 22:41 bak -rw-rw-rw-+ 1 99 99 1728053248 Feb 10 20:28 readynas_compile_tool2.img -rw-rw-rw-+ 1 99 99 2173698048 Jan 8 23:25 readynas_compile_tool.img pi@raspberry48:~ $ sudo mkdir -p ~/rpi_mnt pi@raspberry48:~ $ sudo losetup -f -P --show /mnt/runimg/readynas_compile_tool2.img /dev/loop0 pi@raspberry48:~ $ sudo mount /dev/loop0p2 -o rw ~/rpi_mnt pi@raspberry48:~ $ cd ~/rpi_mnt pi@raspberry48:~/rpi_mnt $ sudo mount --bind /dev ~/rpi_mnt/dev/ pi@raspberry48:~/rpi_mnt $ sudo mount --bind /sys ~/rpi_mnt/sys/ pi@raspberry48:~/rpi_mnt $ sudo mount --bind /proc ~/rpi_mnt/proc/ pi@raspberry48:~/rpi_mnt $ sudo mount --bind /dev/pts ~/rpi_mnt/dev/pts pi@raspberry48:~/rpi_mnt $ sudo mkdir -p /media/netdir/source/raspberrypi/4-02_readynas pi@raspberry48:~/rpi_mnt $ sudo mkdir -p ~/rpi_mnt/mnt/compile pi@raspberry48:~/rpi_mnt $ sudo mount --bind /media/netdir/source/raspberrypi/4-02_readynas ~/rpi_mnt/mnt/compile pi@raspberry48:~/rpi_mnt $ cd ~/rpi_mnt pi@raspberry48:~/rpi_mnt $ sudo chroot . bin/bash root@raspberry48:/# root@raspberry48:/# ls -l total 76 drwxr-xr-x 2 root root 4096 Jan 13 02:37 bin drwxr-xr-x 2 root root 4096 Jun 17 2018 boot drwxr-xr-x 17 root root 3960 Feb 28 13:23 dev drwxr-xr-x 66 root root 4096 Jan 13 00:46 etc drwxr-xr-x 2 root root 4096 Jun 17 2018 home drwxr-xr-x 12 root root 4096 Jan 13 02:37 lib drwx------ 2 root root 16384 Jan 12 13:37 lost+found drwxr-xr-x 2 root root 4096 Jan 13 02:37 media drwxr-xr-x 3 root root 4096 Jan 13 02:37 mnt drwxr-xr-x 2 root root 4096 Jan 13 02:37 opt dr-xr-xr-x 180 root root 0 Jan 1 1970 proc drwx------ 2 root root 4096 Jan 12 14:00 root drwxr-xr-x 4 root root 4096 Jan 12 13:43 run drwxr-xr-x 2 root root 4096 Jan 12 13:43 sbin drwxr-xr-x 2 root root 4096 Jan 13 02:37 srv dr-xr-xr-x 12 root root 0 Jan 1 1970 sys drwxrwxrwt 2 root root 4096 Feb 10 11:27 tmp drwxr-xr-x 10 root root 4096 Jan 13 02:37 usr drwxr-xr-x 11 root root 4096 Jan 13 02:37 var root@raspberry48:/# echo 00:00:00 00:00:00 root@raspberry48:/# date Fri Feb 28 13:23:04 UTC 2020 root@raspberry48:/# cat /usr/bin/gcc #!/bin/bash gcc-4.9 $* -mcpu=cortex-a7 root@raspberry48:/# cat /usr/bin/g++ #!/bin/bash g++-4.9 $* -mcpu=cortex-a7 root@raspberry48:/# compile i          root@raspberry48:/# compile finish bash: compile: command not found root@raspberry48:/# exit exit pi@raspberry48:~/rpi_mnt $ cd pi@raspberry48:~ $ sudo umount ~/rpi_mnt/mnt/compile pi@raspberry48:~ $ sudo umount ~/rpi_mnt/dev/pts pi@raspberry48:~ $ sudo umount ~/rpi_mnt/proc pi@raspberry48:~ $ sudo umount ~/rpi_mnt/sys pi@raspberry48:~ $ sudo umount ~/rpi_mnt/dev pi@raspberry48:~ $ sudo umount ~/rpi_mnt pi@raspberry48:~ $ sudo losetup -d /dev/loop0 pi@raspberry48:~ $