Z-Pocket Game Pro(ZPG Pro)

chroot


參考資訊:
1. 1ad4bf6d
2. QemuUserEmulation

步驟如下:

$ cd
$ wget https://github.com/steward-fu/zpg-pro/releases/download/v1.0/od_sdcard.rar
$ unrar x od_sdcard.rar
$ sudo losetup -f gmenu2release.img
$ sudo kpartx -a -v gmenu2release.img 
  add map loop1p1 (254:0): 0 229376 linear 7:1 32768
  add map loop1p2 (254:1): 0 11737857 linear 7:1 262144
  add map loop1p3 (254:2): 0 286047 linear 7:1 12000001

$ sudo mount /dev/mapper/loop1p2 /mnt
$ sudo cp -a /mnt rootfs
$ sudo umount /mnt
$ sudo kpartx -d /dev/loop1
$ sudo losetup -d /dev/loop1

$ sudo modprobe binfmt_misc
$ sudo mount binfmt_misc -t binfmt_misc /proc/sys/fs/binfmt_misc
$ sudo chmod 0777 /proc/sys/fs/binfmt_misc/register
$ sudo echo ':arm:M::\x7fELF\x01\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x28\x00:\xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff\xff:/usr/bin/qemu-arm:' > /proc/sys/fs/binfmt_misc/register
$ sudo cp /usr/bin/qemu-aarch64-static rootfs/usr/bin/

$ su
# mount -o bind /dev rootfs/dev
# mount -o bind /dev/pts rootfs/dev/pts
# mount -o bind /sys rootfs/sys
# mount -o bind /proc rootfs/proc
# chroot rootfs
# umount rootfs/dev/pts
# umount rootfs/dev
# umount rootfs/sys
# umount rootfs/proc


返回上一頁