说明
用来生成 rootfs
步骤
准备
debian
1 | sudo apt install qemu-user-static debootstrap binfmt-support |
manjaro
1 | sudo pacman -S qemu-user-static debootstrap qemu-user-static-binfmt |
创建
1 | # 用 https 的源 |
基础配置
1 | sudo cp /usr/bin/qemu-arm-static ./deb_fs/usr/bin/ |
或者
1 | sudo bwrap \ |
1 | /debootstrap/debootstrap --second-stage |
1 | apt install -y neovim |
profile
/etc/profile.d/path.sh
1 | export PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin |
/etc/profile.d/ls.sh
1 | alias ll='ls -la --color=auto' 2>/dev/null |
/etc/profile.d/proxy.sh
1 | alias pon="export HTTP_PROXY=http://127.0.0.1:8118 HTTPS_PROXY=http://127.0.0.1:8118 ALL_PROXY=socks5://127.0.0.1:1080 NO_PROXY=localhost,127.0.0.1,10.0.2.1" |
/etc/profile.d/python.sh
1 | export PYTHONPYCACHEPREFIX=/dev/null |
~/.bashrc
1 | [[ -f /etc/profile ]] && source /etc/profile |
必备工具
1 | source /etc/profile |
测试
制作镜像
1 | # dd if=/dev/zero of=rootfs.ext4 bs=1M count=512 |
qemu
1 | qemu-system-arm \ |