当前位置:首页 > 技术 > LINUX > 正文内容

Debian 9.9 (stretch) 文件系统制作

watrt2年前 (2021-12-06)LINUX8680

0. 准备工作:


sudo apt install qemu-user-static -y
sudo apt install debootstrap -y
mkdir rootfs


1. debootstrap

debootstrap --foreign --verbose --arch=armhf  stretch rootfs http://ftp2.cn.debian.org/debian

2.

cd rootfs
   mount --bind /dev dev/
   mount --bind /sys sys/
   mount --bind /proc proc/
   mount --bind /dev/pts dev/pts/
   cd ..

3.

cp /usr/bin/qemu-arm-static rootfs/usr/bin/
   chmod +x rootfs/usr/bin/qemu-arm-static

4. 解压   

    LC_ALL=C LANGUAGE=C chroot rootfs /debootstrap/debootstrap --second-stage --verbose

可以在这个时候

   LC_ALL=C LANGUAGE=C chroot rootfs

   安装任何东西

5.

passwd ###设置root密码
apt-cache clean #删除安装包 
exit
rm rootfs/usr/bin/qemu-arm-static
unmount all point 2 did.   ---- but all documents not mention this.

6. 在rootfs下面 运行 tar cvzf ../debian9.9.rootfs.gz .

    可以生成包,任意解压到文件系统即可

modify /etc/apt/sourc.list
deb http://ftp2.cn.debian.org/debian stretch main
modify /etc/ssh/sshd_config
PermitRootLogin yes


分享给朋友:

相关文章

mpalqyer 播放命令

mpalqyer 播放命令

mplayer -vo fbdev2 -vf scale=1366:768 film.avi /usr/bin/mplayer -x 800 -y 480 -zoom -framedrop aa.avi...

基于 debootstrap 和 busybox 构建 mini ubuntu

基于 debootstrap 和 busybox 构建 mini ubuntu

最近的工作涉及到服务器自动安装和网络部署操作系统,然后使用 ansible 和 saltsatck 进行配置并安装 openstack 。难点在于服务器的自动安装,由于不单只是通过 PXE 安装服务器,还需要能够安装时进行分区、配置网卡等工作,因此需要在开始安装前,必须先收集服务器的硬件信息。调研了一下目前的开源项目中,提供此类功能的有 tinycorelinux 、 puppet razor-el-mk 可做类似的工作。tinycorelinux 是个很好的工具,整个系统在 PXE 之后在内存...

制作荔枝派Zero开发板(全志V3s) TF/SD卡启动盘

制作荔枝派Zero开发板(全志V3s) TF/SD卡启动盘

0. 前言近几天买了一块荔枝派0开发板,以及官方配的480×272的屏幕。让我记录一下入坑与采坑过程。1. u-boot的编译git clone https://github.com/Lichee-Pi/u-boot -b v3s-current cd u-boot make ARCH=arm LicheePi_Zero_480x272LCD_defconfig make ARCH=arm CROSS...

buildroot编译中的问题

buildroot编译中的问题

在编译中遇到flex 报错。一直过不了。后来发现安装flex bison两个包后解决sudo apt-get install flex bison...

发表评论

访客

看不清,换一张

◎欢迎参与讨论,请在这里发表您的看法和观点。