Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #https://wiki.debian.org/EmDebian/CrossDebootstrap#QEMU.2Fdebootstrap_approach
- sudo apt-get install binfmt-support qemu qemu-user-static debootstrap
- arch="mipsel"
- version="bookworm"
- dir="debian_${version}_${arch}"
- #create empty image and mount it
- img="debian_${version}_${arch}.img"
- dd bs=512 count=5400000 if=/dev/zero of=$img #creates a empty IMG file that is about 2GB
- mkfs.ext4 -F "$img"
- mkdir $dir
- sudo modprobe loop
- sudo mount -o loop "$img" "$dir"
- sudo debootstrap --foreign --arch "$arch" "$version" "$dir" http://ftp.debian.org/debian/
- sudo cp -v /usr/bin/qemu-${arch}-static $dir/usr/bin
- sudo DEBIAN_FRONTEND=noninteractive DEBCONF_NONINTERACTIVE_SEEN=true \
- LC_ALL=C LANGUAGE=C LANG=C chroot $dir /debootstrap/debootstrap --second-stage
- sudo DEBIAN_FRONTEND=noninteractive DEBCONF_NONINTERACTIVE_SEEN=true \
- LC_ALL=C LANGUAGE=C LANG=C chroot $dir dpkg --configure -a
- echo "Welcome to your ${arch} chroot\!"
- sudo chroot $dir bash
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement