从无到有构建一个Mini Linux(4)
2016-12-12 08:48
281 查看
16.编译busybox
17.提供inittab文件
18.提供初始化脚本
19.第七次测试启动
16.编译busybox
//删除/mnt/sysroot下的目录,重新开始从头测试
简单测试
//创建相应的目录
17.提供inittab文件
//busybox提供/sbin/init文件,我们手动编写init的配置文件/etc/inittab文件即可(参照centos 5系列)
18.提供初始化脚本
19.第七次测试启动
//启动成功,且绝大多数的命令都可以使用
17.提供inittab文件
18.提供初始化脚本
19.第七次测试启动
16.编译busybox
BusyBox简介 BusyBox 是一个集成了一百多个最常用linux命令和工具的软件。 BusyBox 包含了一些简单的工具,例如ls、cat和echo等等,还包含了一些更大、更复杂的工具, 如grep、find、mount以及telnet.有些人将 BusyBox 称为 Linux 工具里的瑞士军刀. 简单的说BusyBox就好像是个大工具箱,它集成压缩了 Linux 的许多工具和命令, 也包含了 Android 系统的自带的shell. --- 来源 百度百科
[root@centos6 ~]# tar xf busybox-1.22.1.tar.bz2 [root@centos6 ~]# cd busybox-1.22.1 [root@centos6 busybox-1.22.1]# less INSTALL [root@centos6 busybox-1.22.1]# make menuconfig //静态方式编译 Busybox Settings ---> Build Options ---> [*] Build BusyBox as a static binary (no shared libs) Installation Options ("make install" behavior) ---> (./_install) BusyBox installation prefix [root@centos6 busybox-1.22.1]# make && make install
//删除/mnt/sysroot下的目录,重新开始从头测试
[root@centos6 busybox-1.22.1]# rm -rf /mnt/sysroot/*
[root@centos6 busybox-1.22.1]# ls _install/ bin linuxrc sbin usr //编译成功后生成的文件 [root@centos6 busybox-1.22.1]# cp -a _install/* /mnt/sysroot/ [root@centos6 busybox-1.22.1]# ls /mnt/sysroot/ bin linuxrc sbin usr
简单测试
[root@centos6 ~]# chroot /mnt/sysroot/ chroot: failed to run command '/bin/bash': No such file or directory [root@centos6 ~]# chroot /mnt/sysroot/ /bin/ash / # //绝大部分命令执行成功
//创建相应的目录
[root@centos6 sysroot]# mkdir -pv etc lib lib64 proc sys dev root home boot mnt media tmp var
17.提供inittab文件
//busybox提供/sbin/init文件,我们手动编写init的配置文件/etc/inittab文件即可(参照centos 5系列)
[root@centos6 sysroot]# vim etc/inittab //注意是相对路径 ::sysinit:/etc/rc.d/rc.sysinit console::respawn:-/bin/ash ::ctrlaltdel:/sbin/reboot ::shutdown:/bin/umount -a -r
18.提供初始化脚本
[root@centos6 sysroot]# mkdir etc/rc.d/ [root@centos6 sysroot]# vim etc/rc.d/rc.sysinit #!/bin/ash # echo -e "\tWelcome to Sxj \033[32mMini\033[0m Linux" mount -t proc proc /proc mount -t sysfs sysfs /sys mount -o remount,rw /dev/sda2 / //加执行权限 [root@centos6 sysroot]# chmod +x etc/rc.d/rc.sysinit
19.第七次测试启动
//启动成功,且绝大多数的命令都可以使用
相关文章推荐
- 从无到有构建一个Mini Linux(2)
- 从无到有构建一个Mini Linux(5)
- 从无到有构建一个Mini Linux(1)
- 从无到有构建一个Mini Linux(3)
- 从无到有构建一个Mini Linux(7)
- 从无到有构建一个Mini Linux(6)
- 从无到有构建一个Mini Linux(8)
- 在写一个嵌入式Linux构建的初级教程,先放上两篇,请大家拍拍转。
- 在 Linux 上构建一个 RADIUS 服务器
- linux下eclipse构建并编译android一个简单jni项目
- Build an embedded Linux distro from scratch 从无到有打造Linux发布包 之3 构建内核
- 从头开始构建一个嵌入式 Linux 发行版
- 从头开始构建一个嵌入式 Linux 发行版
- Linux实验报告-构建一个LVS的DR模型
- 自己动手制作(DIY)一个Mini-Linux系统
- 从头开始构建一个嵌入式 Linux 发行版
- 在 Linux 上构建一个 RADIUS 服务器
- 一个绿色版本的LAMP包. (快速构建linux下的php开发环境)
- linux下eclipse构建并编译android一个简单jni项目