Menu
0 Comments

rootfs的制作(busybox)和安装

体系外界:

  操控体系:(lsb_release 命令看
  穿插缀编器链:arm-linux-gcc 4.5.1
  BasyBox源顺序包:busybox-1.25.0

1、到达根发稿体系的列出

[根]纯朴的大师 FS] ls
[根]纯朴的大师 FS] mkdir myrootfs
[根]纯朴的大师 FS] cd myrootfs/
[根]纯朴的大师 myrootFS] mkdir bin dev etc lib proc sbin sys usr mnt tmp var
[根]纯朴的大师 myrootFS] mkdir usr/bin usr/lib usr/sbin lib/modules

2、到达能力发稿

[根]纯朴的大师 myrootFS] cd dev/
[根]纯朴的大师 DEV] mknod -m 666 console c 5 1
[根]纯朴的大师 DEV] mknod -m 666 null c 1 3

3、有效地利用/等

获取有效地利用发稿

     在BasyBox源列出下完全平等地的东西ETC的目录到在这一点上。/home/fs/myrootfs/在等在下面

cp -a /home/w/* ./

  修正有效地利用发稿

    本人可以安身本人必要,对下面列出的有效地利用发稿,做相当的的修正,以下涉及文献可涉及。

etc/
etc/inittab
etc/profile
etc/fstab
etc/init.d/
etc/init.d/rcS

    还可以运用在位于正打中完全平等地的东西的默许有效地利用发稿。,即使您必要修正iNITAB发稿

tty2::askfirst:-/bin/sh

::askfirst:-/bin/sh

修正以前表现运转/bin/sh的诉讼默许运用与init诉讼平等地的控制台。

涉及 :

4、安装GLIMC库

      本人将Buxybox缀编为定态,无法有效地利用此跨入。假使你缀编BusyBox,选择单独静态库缀编,它必要笔记这静态库是由制定的busybox的运用,而且将它们完全平等地的东西到ROTFS/LIB列出中。下面的方法可以涉及。

    RooToFS下的新LIB列出,再把arm-linux-穿插缀编链下的lib发稿拷贝到本人root_fs下的lib列出下。我运用cp /usr/local/arm/4./arm-none-linux-gnueabi/libc/armv4t/lib/*root_fs/lib/* -df 运用-d得到或获准停止选择表用环连接发稿以原始用环连接的方法完全平等地的东西。,另外,用环连接发稿的正本是正本。。

5、有效地利用busybox

在本人的根发稿体系中,在DI下有杂多的命令敷用药。,这些顺序是经过嵌入式体系的BusyBox的建。,每个命令在世界上是单独BuyBox的用环连接。,BuyBox确定经过传入PARAM操控哪个命令操控。

[根]纯朴的大师 FS] ls
busybox-1.13.3.tar.gz    myrootfs
[根]纯朴的大师 FS] tar -xvzf busybox-1.13.3.tar.gz
[根]纯朴的大师 FS] cd busybox-1.13.3
[根]纯朴的大师 busybox-1.13.3]# make menuconfig

Busybox Settings—–> build Options—–>

选择制定 BusyBox as a static 二元(无 shared LIBS)

 Busybox Settings—–> InstallationOptions ————>     

选中 “don”t use /usr”    选中此项可以弃权busybox被安装到做东道主体系的/usr列出下,做东道主体系受到严重损伤的人

Busybox Installation Prefix(/home/fs/myrootfs)   在这一点上要输出busybox安装的绝对路径

6、缀编安装 busybox

[根]纯朴的大师 busybox-1.13.3]# make ARCH=arm CROSS_COMPILE=arm-linux-
[根]纯朴的大师 busybox-1.13.3]# make install

将busybox 安装列出打中发稿被完全平等地的东西到/home/fs/在MyROOTFS列出中。

缀编进程中对抗以下4个成绩。,及其receiver 收音机。

有单独颠倒的如次:

miscutils/: In function ”nandwrite_main”:
miscutils/:151: error: ”MTD_FILE_MODE_RAW” undeclared (率先) use in this 作用
miscutils/:151: error: (每个) undeclared identifier is reported only once
miscutils/:151: error: for each function it appears in.)
scripts/Makefile.build:197: recipe for target ”miscutils/” failed
使[ 1 ] *** [miscutils/] Error 1
Makefile:742: recipe for target ”miscutils” failed
make: *** [miscutils] Error 2

清算条件:

MTD_FILE_MODE_RAW在/usr/include/mtd/中下定义,立即的在位于正打中缀编依然无法经过。将/usr/include/mtd/拷贝到busybox的include发稿中,而且容纳头发稿:

#include “”
#include “”
#include

缀编可以经过。

持续实行,有单独颠倒的如次:

util-linux/: In function ”blkdiscard_main”:
util-linux/:72: error: ”BLKSECDISCARD” undeclared (率先) use in this 作用
util-linux/:72: error: (每个) undeclared identifier is reported only once
util-linux/:72: error: for each function it appears in.)
scripts/Makefile.build:197: recipe for target ”util-linux/” failed
使[ 1 ] *** [util-linux/] Error 1
Makefile:742: recipe for target ”util-linux” failed
make: *** [util-linux] Error 2

清算条件:

BLKSECDISCARD在/usr/include/linux/中下定义,下面刻画了该方法。,将/usr/include/linux/拷贝到busybox的include发稿中,而且将修正后的头发稿容纳在内。:

修正:#include

#include “”

持续实行,缀编与经过,即使用环连接中有单独成绩:

networking/(): In function `print_host”:
:(.): warning: Using '书信' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking
debianutils/(): In function `mktemp_main”:
:(.): warning: the use of `mktemp” is dangerous, better use `mkstemp”
networking/(): In function `ipcalc_main”:
:(.): warning: Using ”gethostbyaddr” in statically linked applications requires at runtime the shared libraries from the glibc version used for linking
libbb/(): In function `INET_resolve”:
:(.): warning: Using ”gethostbyname” in statically linked applications requires at runtime the shared libraries from the glibc version used for linking
networking/(): In function `reread_config_file”:
:(.): warning: Using ”getservbyname” in statically linked applications requires at runtime the shared libraries from the glibc version used for linking
networking/(): In function `ip_port_str”:
:(.): warning: Using ”getservbyport” in statically linked applications requires at runtime the shared libraries from the glibc version used for linking
util-linux/(): In function `nsenter_main”:
:(.): undefined reference to `setns”
collect2: ld returned 1 exit status
Note: if build needs additional libraries, put them in CONFIG_EXTRA_LDLIBS.
Example: CONFIG_EXTRA_LDLIBS=”pthread dl tirpc audit pam”
Makefile:717: recipe for target ”busybox_unstripped” failed
make: *** [busybox_unstripped] Error 1 

清算条件:

make menuconfig

Linux System Utilities—>nsenter,剪下此得到或获准停止选择,重行做,又有单独颠倒的如次:

networking/(): In function `print_host”:
:(.): warning: Using '书信' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking
debianutils/(): In function `mktemp_main”:
:(.): warning: the use of `mktemp” is dangerous, better use `mkstemp”
networking/(): In function `ipcalc_main”:
:(.): warning: Using ”gethostbyaddr” in statically linked applications requires at runtime the shared libraries from the glibc version used for linking
libbb/(): In function `INET_resolve”:
:(.): warning: Using ”gethostbyname” in statically linked applications requires at runtime the shared libraries from the glibc version used for linking
networking/(): In function `reread_config_file”:
:(.): warning: Using ”getservbyname” in statically linked applications requires at runtime the shared libraries from the glibc version used for linking
networking/(): In function `ip_port_str”:
:(.): warning: Using ”getservbyport” in statically linked applications requires at runtime the shared libraries from the glibc version used for linking
coreutils/(): In function `sync_main”:
:(.): undefined reference to `syncfs”
collect2: ld returned 1 exit status
Note: if build needs additional libraries, put them in CONFIG_EXTRA_LDLIBS.
Example: CONFIG_EXTRA_LDLIBS=”pthread dl tirpc audit pam”
Makefile:717: recipe for target ”busybox_unstripped” failed
make: *** [busybox_unstripped] Error 1

清算条件:

make menuconfig

剪下CORUTILLS–>同时存在的得到或获准停止选择,重行make缀编与经过,制定BuyBox可家具发稿。。

涉及:

合乎逻辑的推论是,根发稿体系停止。

7、根发稿体系安装

、安装InRAMFS根发稿体系

运用iNITRAFS作为根发稿体系,在内核中家具以下有效地利用,并列行缀编内核肖像。

General setup —>

[*] Initial RAM filesystem and RAM disk (initramfs/initrd) support

(/rootfs_dir) Initramfs source 发稿(s) 输出根发稿体系位置关系的列出

、实行根发稿体系 成ramdisk

[根]纯朴的大师 FS] genext2fs -b 8192 -d /home/fs/myrootfs/  ramdisk
[根]纯朴的大师 FS] gzip -9 -f ramdisk
[根]纯朴的大师 FS] ls
busybox-1.13.3                  
busybox-1.13.3.tar.gz    myrootfs

你可以把它下载到发展板上。。

8、起航背离辨析

     在在体系启动进程中,当填充物init顺序时,它将呈现。Kernel
panic – not syncing: Attempted to kill init!
”颠倒的
,我被发现的人这事颠倒的是与运用两样版本的穿插缀编器缀编出的busybox可家具发稿不能用参与,详细的辨析可以涉及我的文字。,“ARM下Kernel panic – not syncing: Attempted
to kill init!颠倒的辨析”。

9、涉及资料

[1 ] Linux根发稿体系的实行


发表评论

电子邮件地址不会被公开。 必填项已用*标注