2020年1月19日 星期日

Debian 10 (Buster) for arm64

Install:
sudo apt-get install qemu qemu-user-static debootstrap kpartx
Create a new space image:
sudo dd if=/dev/zero of=rootfs.img  bs=1048576 count=1900
Make a loop device with losetup
sudo losetup -f --show rootfs.img

ex: /dev/loop19  <- pre="" success="">
Partition:
1.sudo fdisk /dev/loop19
2.sudo losetup -d /dev/loop0
Format & mount:
1. sudo kpartx -va rootfs.img
1. sudo mkfs.ext4 /dev/mapper/loop19p1
2. sudo mount /dev/mapper/loop19p1 /mnt
Download:
1. mkdir -p /mnt/usr/bin
2. cp /usr/bin/qemu-aarch64-static /mnt/usr/bin/
               (for arm 64 bit)
3. sudo debootstrap --arch arm64 buster /mnt https://deb.debian.org/debian/
Set up dns
sudo cp /etc/resolv.conf /mnt/etc/
Change root
sudo mount -t proc /proc /mnt/proc
sudo mount -t sysfs /sys /mnt/sys
sudo mount -o bind /dev /mnt/dev
sudo mount -o bind /dev/pts /mnt/dev/pts

sudo chroot /mnt
or 
sudo chroot /mnt /bin/bash
follow this page to install the required packages

umount /mnt
sudo umount /mnt/dev/pts
sudo umount /mnt/dev
sudo umount /mnt/sys
sudo umount /mnt/proc

ref:
1. [心] 誌
2. Quick and easy bootstrap of Debian 8 (Jessie) for armhf

沒有留言:

張貼留言