在x86平台制作龙芯版debian 10系统(mips64el)

OS: ubuntu 18.04

使用debootstrap制作根文件系统会分成两个阶段。第一阶段是,使用debootstrap命令来下载软件包。 第二阶段是安装软件包。

安装debootstap 等相关工具
$ sudo apt install  binfmt-support qemu qemu-user-static debootstrap

使用debootstrap 下载软件包

$ mkdir debian10_mips64el
$ sudo debootstrap --arch mips64el --foreign buster debian10_mips64el  http://mirrors.ustc.edu.cn/debian/

--arch:指定要制作文件系统的处理器体系结构,比如mipsel或者mips64el
buster:指定Debian的版本。buster是Debian10系统的代号。
debian10_mips64el:本地目录,最后制作好的文件系统会在此目录。
--foreign:只执行引导的初始解包阶段,仅仅下载和解压。
http:/mirrors.ustc.edu.cn/debian/:国内中科大镜像源地址

因为主机跑在x86架构上,而我们要制作的文件系统是跑在龙芯上,因此可以使用qemu-mips64el-static来模拟成mips64el的执行环境。
$ cp /usr/bin/qemu-mips64el-static  debian10_mips64el/usr/bin/

通过chroot 使用debootstrap命令进行软件包的安装和配置。其中命令参数--second-stage表示执行第二阶段的安装
$ sudo chroot debian10_mips64el/  debootstrap/debootstrap --second-stage

显示"I:Base system installed successfully."这句话,说明第二阶段已经完成。


通过chroot 进入刚制作的根文件系统
$ sudo chroot debian10_mips64el/


设置密码
# passwd root

配置网卡支持DHCP协议。修改/etc/network/interfaces文件,增加如下内容。
auto lo 
iface lo inet loopback 

allow-hotplug eth0
iface eth0 inet dhcp

发布了35 篇原创文章 · 获赞 5 · 访问量 3万+
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章