Advertisement
metalx1000

Debian Mipsel Chroot Setup

Jun 10th, 2025 (edited)
902
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.97 KB | None | 0 0
  1. #https://wiki.debian.org/EmDebian/CrossDebootstrap#QEMU.2Fdebootstrap_approach
  2. sudo apt-get install binfmt-support qemu qemu-user-static debootstrap
  3.  
  4. arch="mipsel"
  5. version="bookworm"
  6. dir="debian_${version}_${arch}"
  7.  
  8. #create empty image and mount it
  9. img="debian_${version}_${arch}.img"
  10. dd bs=512 count=5400000 if=/dev/zero of=$img #creates a empty IMG file that is about 2GB
  11.  
  12. mkfs.ext4 -F "$img"
  13.  
  14. mkdir $dir
  15.  
  16. sudo modprobe loop
  17. sudo mount -o loop "$img" "$dir"
  18.  
  19. sudo debootstrap --foreign --arch "$arch" "$version" "$dir" http://ftp.debian.org/debian/
  20.  
  21. sudo cp -v /usr/bin/qemu-${arch}-static $dir/usr/bin
  22.  
  23. sudo DEBIAN_FRONTEND=noninteractive DEBCONF_NONINTERACTIVE_SEEN=true \
  24.  LC_ALL=C LANGUAGE=C LANG=C chroot $dir /debootstrap/debootstrap --second-stage
  25.  
  26. sudo DEBIAN_FRONTEND=noninteractive DEBCONF_NONINTERACTIVE_SEEN=true \
  27.  LC_ALL=C LANGUAGE=C LANG=C chroot $dir dpkg --configure -a
  28.  
  29. echo "Welcome to your ${arch} chroot\!"
  30.  
  31. sudo chroot $dir bash
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement