debootstrap 比較完整的步驟


mkdir /opt/rootfs -p

apt-get install debootstrap -y
apt-get install qemu-user-static -y

cd /opt/
#debootstrap --foreign --verbose --arch=armhf  stretch rootfs http://ftp2.cn.debian.org/debian 
debootstrap --foreign --verbose --arch=armhf stretch rootfs http://ftp.de.debian.org/debian


###掛載###
mount --bind /dev   /opt/rootfs/dev/
mount --bind /sys   /opt/rootfs/sys/
mount --bind /proc   /opt/rootfs/proc/
mount --bind /dev/pts /opt/rootfs/dev/pts/

cp /usr/bin/qemu-arm-static /opt/rootfs/usr/bin/
chmod +x /opt/rootfs/usr/bin/qemu-arm-static
   
###解壓###
LC_ALL=C LANGUAGE=C LANG=C chroot rootfs /debootstrap/debootstrap --second-stage --verbose

###可以在這個時候, 安裝任何東西###
LC_ALL=C LANGUAGE=C LANG=C chroot rootfs

###刪除qemu-arm-static, 深藏功與名###
rm rootfs/usr/bin/qemu-arm-static

###卸載###
umount /opt/rootfs/dev/
umount /opt/rootfs/sys/
umount /opt/rootfs/proc/
umount /opt/rootfs/dev/pts/

cd /opt/rootfs/
tar cvzf ../debian9.9.rootfs.gz .

https://linux-sunxi.org/Debootstrap

其他配置:
參考:
https://gist.github.com/linzheming/205752af251ef2160fcfa2ee51a83287
如:
/etc/resolv.conf
echo DebianHostName > /etc/hostname



免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM