纯净版的的debian制作如下:
sudo apt install debootstrap -y
mkdir debian-rootfs
cd debian-rootfs
wget https://ftp-master.debian.org/keys/release-10.asc -qO- | gpg --import --no-default-keyring --keyring /usr/share/keyrings/debian-archive-keyring.gpg
sudo debootstrap --foreign --verbose --arch=arm64 buster rootfs http://mirrors.huaweicloud.com/debian/
sudo mount --bind /dev rootfs/dev/
sudo mount --bind /sys rootfs/sys/
sudo mount --bind /proc rootfs/proc/
sudo mount --bind /dev/pts rootfs/dev/pts/
sudo cp /usr/bin/qemu-aarch64-static rootfs/usr/bin/
sudo LC_ALL=C LANGUAGE=C LANG=C chroot rootfs /debootstrap/debootstrap --second-stage --verbose
sudo LC_ALL=C LANGUAGE=C LANG=C chroot rootfs
echo deb http://mirrors.huaweicloud.com/debian buster main > /etc/apt/sources.list
apt update
~# apt install rsyslog systemd
~# apt install sudo htop vim bash-completion
~# apt install ssh net-tools ethtool ifupdown iputils-ping network-manager
~# touch /etc/network/interfaces.d/eth0
如果dhcp,eth0内容如下:
auto eth0
iface eth0 inet dhcp
pre-up ifconfig eth0 hw ether 10:10:10:10:10:10
如果固定ip,eth0内容如下:
auto eth0
iface eth0 inet static
address 192.168.1.10
netmask 255.255.255.0
gateway 192.168.1.1
dns-nameservers 223.5.5.5
dns-nameservers 223.6.6.6
pre-up ifconfig eth0 hw ether 10:10:10:10:10:20
ip地址根据自己情况修改。
~#echo "hi3798mv100" > /etc/hostname
~#echo "127.0.0.1 localhost" >> /etc/hosts
~#echo "127.0.0.1 hi3798mv100" >> /etc/hosts
修改root密码
~#passwd
允许root远程ssh
~#echo PermitRootLogin yes >> /etc/ssh/sshd_config
~#exit
sudo umount rootfs/dev/pts/
sudo umount rootfs/dev/
sudo umount rootfs/sys/
sudo umount rootfs/proc/
在把rootfs里面的文件在拷贝到u盘或盒子的分区里面就成了。
ubuntu的rootfs制作见这个链接。
https://bbs.histb.com/d/2417-zhi-zuo-upan-ubuntu-20045chun-jing-ban-qi-dong-ec6109gao-an-ban