debian 系统文件制作

制作debian系统,首先要安装软件:

sudo apt-get install debian-archive-keyring  debian-keyring

sudo apt-get install binfmt-support qemu qemu-user-static debootstrap multibootstrap

基本软件安装之后需要下载debian源码:

1.debootstrap --arch=armel --foreign wheezy rootfs_debian/ http://ftp.us.debian.org/debian

arch:表示支持的架构,x86,arm等,armel是比较低端的arm芯片,armhf是支持浮点运算的arm芯片,arm64是arm64架构。

wheezy 表示debian软件版本,目前wheezy已经停止支持,

rootfs_debian 表示要存放文件系统的目录。

debootstrap --arch=armhf --foreign stretch rootfs_debian/ http://ftp.us.debian.org/debian

2. cp /usr/bin/qemu-arm-static ./rootfs_debian/usr/bin/

3. chroot ./rootfs_debian /debootstrap/debootstrap --second-stage

4. rm rootfs_debian/usr/bin/qemu-arm-static

5. vim rootfs_debian/etc/shadow

  去掉root登录密码, 去掉'*'

   root::15880:0:99999:7:::

6.添加串口支持

  在文件rootfs_debian/etc/inittab 中添加

  T0:23:respawn:/sbin/getty -L ttymxc0 115200 vt100

7.添加更新包的源/etc/apt/sources.list

 deb http://ftp.us.debian.org/debian wheezy main

讲原始的源替换为:

deb http://mirror.lzu.edu.cn/debian stable main contrib non-free
deb-src http://mirror.lzu.edu.cn/debian stable main contrib non-free
deb http://mirror.lzu.edu.cn/debian stable-updates main contrib non-free
deb-src http://mirror.lzu.edu.cn/debian stable-updates main contrib non-free
deb http://mirror.lzu.edu.cn/debian/ stretch-backports main contrib non-free
deb-src http://mirror.lzu.edu.cn/debian/ stretch-backports main contrib non-free
deb http://mirror.lzu.edu.cn/debian-security/ stretch/updates main contrib non-free
deb-src http://mirror.lzu.edu.cn/debian-security/ stretch/updates main contrib non-free

这些工作做完之后就得到一个完整的文件系统了。

文件系统可以通过nfs网络挂载方式添加到开发板,或是通过mfgtool 软件烧录,烧录之前需要把文件系统压缩为tar.bz2的格式:

tar -jcvf nfs_debian.tar.bz2 nfs_debian

8.通过nfs挂载启动之后,遇到如下问题:

apt-get install vim时,提示/usr/bin/locale: Cannot set LC_CTYPE to default locale: No such file or directory,可以通过执行命令:apt-get install locales-all来解决

root@cxt-Vostro-5468:/# locale -a
/usr/bin/locale: Cannot set LC_CTYPE to default locale: No such file or directory
/usr/bin/locale: Cannot set LC_MESSAGES to default locale: No such file or directory
/usr/bin/locale: Cannot set LC_COLLATE to default locale: No such file or directory
C
POSIX
root@cxt-Vostro-5468:/# vim /etc/default/locale

2.安装基本的软件支持包

https://github.com/deadsnakes/
 More info: https://launchpad.net/~deadsnakes/+archive/ubuntu/ppa
Press [ENTER] to continue or ctrl-c to cancel adding it

gpg: keybox '/tmp/tmp7b0aya_p/pubring.gpg' created
gpg: failed to start the dirmngr '/usr/bin/dirmngr': No such file or directory
gpg: connecting dirmngr at '/tmp/tmp7b0aya_p/S.dirmngr' failed: No such file or directory
gpg: keyserver receive failed: No dirmngr

apt update

apt-get install locales-all  

apt-get install net-tools  python3  python3-pip busybox  udhcpc iw rfkill

apt-get install  minicom rsyslog libatlas-base-dev  screen   cmake  libboost-all-dev

apt-get install dirmngr

cp  /lib -a

cp /usr/libexec

添加brcm_patchram_plus的bin文件

安装bootst软件

 ./bootstrap.sh --with-libraries=all --with-toolset=gcc

3.生成了debian文件系统之后,如果通过mfgtool软件烧录,需要将文件压缩为rootfs.tar.bz2格式。

注意压缩的路径,只能是当前路径压缩,如果在上级目录,就会导致系统不能成功挂载:提示devtmpfs: error mounting -2

XT3-fs (mmcblk1p2): using internal journal
EXT3-fs (mmcblk1p2): recovery complete
EXT3-fs (mmcblk1p2): mounted filesystem with ordered data mode
VFS: Mounted root (ext3 filesystem) on device 179:2.
--cxt---mntdir is dev
devtmpfs: error mounting -2
Freeing unused kernel memory: 400K (80a2a000 - 80a8e000)

https://www.cnblogs.com/aaronLinux/p/6886163.html

https://juejin.im/post/5d70b78b6fb9a06ad3474b26

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值