![Make Modules Install Rootfs Make Modules Install Rootfs](http://images2015.cnblogs.com/blog/672177/201602/672177-20160213233125232-47145711.jpg)
![Make Modules Install Rootfs Make Modules Install Rootfs](http://images2015.cnblogs.com/blog/672177/201602/672177-20160213233219716-2020907.jpg)
![Make Modules Install Rootfs Make Modules Install Rootfs](http://peter.korsgaard.com/articles/debian-install-done.png)
Linux. 2. 6. 2. 4内核的nfs根文件系统一、主机环境 Linux version 2. Red. Hat. 9, VMWare.
- 保存退出,直接make,make install 。 3、用shell脚本创建根文件系统的目录结构,并在想要建立根文件系统的地方运行此脚本。我是用root用户登陆的,直接创建了设备.
- 【 make modules_install ARCH=arm INSTALL_MOD_PATH=/xxx/rootfs 】 六、配置 busybox 大家都在 linux 系统或 arm 嵌入式系统都使用过诸如 cd ls mkdir.
![Make Modules Install Rootfs Make Modules Install Rootfs](http://images2015.cnblogs.com/blog/672177/201602/672177-20160213233138716-143483890.jpg)
Thread model: posix; GNU Make 3. Linux. 2. 6内核的交叉编译工具链) 所需源文件: busybox- 1. Busybox创建nfs文件系统1、解压busybox- 1.
Mini2440的板子,内核和配置是照着tekkaman的源码来弄的,编译很顺利。 make clean make make modules make modlues_install INSTALL_MOD_PATH. 5 /7 安装内核模块make modules_install ARCH=arm INSTALL_MOD_PATH=/xxx/rootfs 安装内核模块make modules_install ARCH=arm INSTALL_MOD_PATH=/xxx/rootfs. Make a bootable linux with ramfs and hardisk rootfs on vmware,蒙奇D小豌豆的网易博客,用心做事,不求回报。即使获得,保持感恩。. 温馨提示!由于新浪.
Make modules_install后发现安装的模块很少,然后more /lib/modules/2.6.11.6/modules.dep /lib/modules/2.6.11.6/kernel/net/ipv6/ipcomp6.ko:/lib/modules/2.6.
Sure busybox- 1. 1. Makefilez中的ARCH和CROSS_COMPILE与本机的路径一致:CROSS_COMPILE ?= /opt/crosstool/bin/arm- s. ARCH ?= arm. 2、编译busybox。先make menuconfig,修改以下: Busybox Settings - -- > Build Options - -- > [*] Build Busy. Box as a static binary (no shared libs) //直接编译成静态库,省事点 (/opt/crosstool/bin/arm- s. Cross Compiler prefix //这里和Makefile里保持一致,应该写一处就行了 Installation Options - -- > [*] Don't use /usr //不用本机的目录Shells - -- > Choose your default shell (ash) - -- > //这里选择shell为ash,应该是默认选中的 - -- ash //把ash这档的选项全部选上保存退出,直接make,make install。3、用shell脚本创建根文件系统的目录结构,并在想要建立根文件系统的地方运行此脚本。我是用root用户登陆的,直接创建了设备节点。[root@Sure root- s. Don't use mknod, unless you run this Script as mknod - m 6. Sure root- s. 3c.
![Make Modules Install Rootfs Make Modules Install Rootfs](http://processors.wiki.ti.com/images/0/09/EnableSmartCardDriver.png)
Sure rootfs]# lsbin boot dev etc home lib mnt proc root sbin sys tmp usr var. Sure rootfs]# cd etc/[root@Sure etc]# cp - a /home/jacky/busybox- 1. Sure etc]# vim profile # /etc/profile: system- wide .
Bourne shellsecho "Processing /etc/profile"# no- op# Set search library pathecho " Set search library path"export LD_LIBRARY_PATH=/lib: /usr/lib# Set user pathecho " Set user path"PATH=/bin: /sbin: /usr/bin: /usr/sbinexport PATH# Set PS1echo " Set PS1"HOSTNAME=`/bin/hostname`# 此处让shell提示符显示host名称的。是`,不是’,要注意# 会在进入根系统后显示Jackyexport PS1="\\e[3. USER@$HOSTNAME \\w\\a]\\$\\e[0. USER@$HOSTNAME \\w\\a]”显示为绿色# \\e[0. All done!"echo. 6、修改初始化文件inittab和fstab[root@Sure etc]# vim inittab : :sysinit: /etc/init. S: :respawn: -/bin/sh: :restart: /sbin/inittty. Sure etc]# vim fstab proc /proc proc defaults 0 0none /tmp ramfs defaults 0 0mdev /dev ramfs defaults 0 0sysfs /sys sysfs defaults 0 0.
S[root@Sure etc]# vim init. S #! /bin/shecho "Processing etc/init. S"#hostname ${HOSTNAME}echo " Mount all"/bin/mount - aecho " Start mdev.."/bin/echo /sbin/mdev > proc/sys/kernel/hotplugmdev - secho "****************************************************"echo " Root. FS by NFS, s. 3c. Created by Jacky Xu @ 2. Enjoy it!!!"echo "****************************************************"echo.
Sure etc]# touch mdev. Sure etc]# cp /etc/passwd .[root@Sure etc]# cp /etc/shadow .[root@Sure etc]# cp /etc/group .修改passwd文件,把第一行和最后一行的bash修改成ash。1. Sure etc]# cd .[root@Sure rootfs]# cp - Rfv /home/jacky/busybox- 1. OK,以上用busybox创建了一个基本的文件系统。PS: 如果编译busybox时选择动态库方式编译,则需要查看生成的busybox使用哪些动态库,然后把它们拷贝到rootfs/lib目录下。[root@Sure lib]# arm- s. Dynamic section at offset 0xc. Tag Type Name/Value 0x. NEEDED) Shared library: [libm.
NEEDED) Shared library: [libc. INIT) 0xc. 2ec 0x. FINI) 0xa. 96b. 8 0x. HASH) 0x. 80e. 8 0x. STRTAB) 0xa. 4c. 4 0x.
SYMTAB) 0x. 8b. 64 0x. STRSZ) 3. 50. 5 (bytes) 0x. SYMENT) 1. 6 (bytes) 0x.
DEBUG) 0x. 0 0x. 00. PLTGOT) 0xd. 10e. PLTRELSZ) 3. 11. 2 (bytes) 0x. PLTREL) REL 0x. 00. JMPREL) 0xb. 6c. 4 0x. REL) 0xb. 67. 4 0x.
RELSZ) 8. 0 (bytes) 0x. RELENT) 8 (bytes) 0x. VERNEED) 0xb. 5a. VERNEEDNUM) 2 0x. VERSYM) 0xb. 27. 6 0x.
NULL) 0x. 0可以看出,使用了libm. NFS服务:[root@Sure rootfs]# vim /etc/exports/home/jacky/root- s. Sure rootfs]# service nfs restart.
Bootloader中传递以下参数给Kernel:root=/dev/nfs rw nfsroot=1. Jacky: eth. 0: off console=tty. SAC0,1. 15. 20. 0 init=/linuxrc noinitrd. Boot Parameters: root=/dev/nfs rw nfsroot=1. Jacky: eth. 0: off console=tty. SAC0,1. 15. 20. 0 init=/linuxrc noinitrd. Now, booting Linux..
Uncompressing Linux...................................................... Linux version 2. 6.
Sure) (gcc version 4. Sat Jul 1. 2 1. 7: 2.
CST 2. 00. 8CPU: ARM9. T [4. 11. 29. 20. ARMv. 4T), cr=c. 00.
Machine: SMDK2. 41. ATAG_INITRD is deprecated; please update your bootloader. Memory policy: ECC disabled, Data cache writeback. CPU S3. C2. 41. 0A (id 0x. S3. C2. 41. 0: core 2. MHz, memory 1. 00. MHz, peripheral 5.
MHz. S3. C2. 4XX Clocks, (c) 2. Simtec Electronics. CLOCK: Slow mode (1. MHz), fast, MPLL on, UPLL on. CPU0: D VIVT write- back cache. CPU0: I cache: 1. CPU0: D cache: 1.
Built 1 zonelists in Zone order, mobility grouping on. Total pages: 1. 62. Kernel command line: root=/dev/nfs rw nfsroot=1. Jacky: eth. 0: off console=tty. SAC0,1. 15. 20. 0 init=/linuxrc noinitrdirq: clearing subpending status 0. PID hash table entries: 2. Console: colour dummy device 8.
SAC0] enabled. Dentry cache hash table entries: 8. Inode- cache hash table entries: 4. Memory: 6. 4MB = 6. MB total. Memory: 6. KB available (3. 04.
K code, 3. 14. K data, 1. K init)Mount- cache hash table entries: 5. CPU: Testing write buffer coherency: oknet_namespace: 6. NET: Registered protocol family 1.
S3. C2. 41. 0 Power Management, (c) 2. Simtec Electronics. S3. C2. 41. 0: Initialising architecture. S3. C2. 4XX DMA Driver, (c) 2. Simtec Electronics. DMA channel 0 at c.
DMA channel 1 at c. DMA channel 2 at c. DMA channel 3 at c. Bluetooth: Core ver 2. NET: Registered protocol family 3.
Bluetooth: HCI device and connection manager initialized. Bluetooth: HCI socket layer initialized. NET: Registered protocol family 2. IP route cache hash table entries: 1.
TCP established hash table entries: 2. TCP bind hash table entries: 2. TCP: Hash tables configured (established 2. TCP reno registered.
Net. Winder Floating Point Emulator V0. JFFS2 version 2. 2. NAND) & Acirc; & copy; 2.
Red Hat, Inc. JFS: n. Tx. Block = 4. 80, n. Tx. Lock = 3. 84. Serial: 8. 25. 0/1. Revision: 1. 9. 0 $ 4 ports, IRQ sharing enableds. MMIO 0x. 50. 00. 00.
S3. C2. 41. 0s. 3c. MMIO 0x. 50. 00. 40. S3. C2. 41. 0s. 3c. MMIO 0x. 50. 00. 80. S3. C2. 41. 0RAMDISK driver initialized: 1. RAM disks of 4. 09.
K size 1. 02. 4 blocksizeloop: module loaded. Cirrus Logic CS8. A driver for Linux (Modified for SMDK2. CS8. 90. 0A rev E at 0xe. E: 2. 6: 0. A: 0.
Uniform Multi- Platform E- IDE driver Revision: 7. Assuming 5. 0MHz system bus speed for PIO modes; override with idebus=xx. S3. C2. 4XX NAND Driver, (c) 2.
Simtec Electronicss. Tacls=3, 3. 0ns Twrph. Twrph. 1=3 3. 0ns. NAND device: Manufacturer ID: 0xec, Chip ID: 0x. Samsung NAND 6. 4Mi. B 3,3. V 8- bit)Scanning device for bad blocks.
Creating 5 MTD partitions on "NAND 6. Mi. B 3,3. V 8- bit": 0x. Bootloader"0x. 00. Kernel"0x. 00. 40.
Root"0x. 03. 40. 00. Ext. Root"0x. 03fe.
Param"usbmon: debugfs is not availables. S3. C2. 4XX OHCIs. USB bus registered, assigned bus number 1s. USB hub foundhub 1- 0: 1. PS/2 mouse device common for all mice. S3. C2. 4XX RTC, (c) 2.
Simtec Electronicss. KHzs. 3c. 24. 10- i. S3. C I2. C adapter. S3. C2. 41. 0 Watchdog Timer, (c) 2. Simtec Electronicss.
TCP cubic registered. NET: Registered protocol family 1. NET: Registered protocol family 1. RPC: Registered udp transport module. RPC: Registered tcp transport module. IP- Config: Complete: device=eth. Jacky, domain=, nis- domain=(none), bootserver=1.
Looking up port of RPC 1. Looking up port of RPC 1. VFS: Mounted root (nfs filesystem). Freeing init memory: 1. Kinit started: Busy.
Box v. 1. 1. 1. 1 (2. CST)starting pid 7. S'Processing etc/init. S Mount all Start mdev..**************************************************** Root. FS by NFS, s. 3c. Created by Jacky Xu @ 2. Enjoy ****************************************************starting pid 7.
Processing /etc/profile Set search library path Set user path Set PS1. All [root@Jacky /]# lsbin dev home linuxrc proc sbin tmp varboot etc lib mnt root sys usr[root@Jacky /]#已经直接进入了nfs文件系统!.
Apollo. Enterprise环境:ubuntu. OK6. 41. 0 内核编译环境 linux 3. WINJre 》》》目前使用的是 uboot. ARCH=arm CROSS_COMPILE=arm- linux- 会生成 u- boot. Kp 》》》目前使用的是 kernel 3.
ARCH=arm 进入图形界面,进行相关配置(),如果需要采用nfs方式挂载根文件系统,此时需设置 $ make u. Image ARCH=arm CROSS_COMPILE=arm- linux- 第一次编译时会显示错误如下: (1)"mkimage" command not found - U- Boot images will not be built make[1]: *** [arch/arm/boot/u. Image] 错误 1 make: *** [u.
Image] 错误 2 为避免此错误修改如下: 进入 Uboot源代码目录 cp mkimage /bin 修改完成,再次编译即可 (2) Unable to find the ncurses libraries or the required header files. 'make menuconfig' requires the ncurses libraries. Install ncurses (ncurses- devel) and try again. 解决:sudo apt- get install libncurses. Ncurses是一个能提供功能键定义(快捷键),屏幕绘制以及基于文本终端的图形互动功能的动态库 在内核源代码目录的 arch/arm/boot 中 生成u. Image. 4、 制作文件系统 linux可能包含多个文件系统,根文件系统必须要有 (1) 创建目录 $ mkdir rootfs $ cd rootfs $ mkdir bin dev etc lib proc sbin sys usr mnt tmp var $ mkdir usr/bin usr/lib usr/sbin lib/modules (2) 创建设备文件 $ cd rootfs/dev $ mknod - m 6. Ty. Fip. L 》》》》链接 $ tar zxvf etc. ARCH=arm CROSS_COMPILE=arm- linux- $ make modules_install ARCH=arm INSTALL_MOD_PATH=/work/rootfs (/work/rootfs 为制作的文件系统目录) 运行完成后,可在/work/rootfs/lib/modules中看到新文件 注意:如果运行 make modules_install 出现如下错误: ##Warning: you may need to install module- init- tools See http: //www. Resource. ID=6. 90. TLFLVh》》》 $ 进入busybox 目录 $ make menuconfig setting- build Options- 选中 "Build busybox as a static binary" "Cross Compiler prefix " 填写 arm- linux- setting- Installation Options- 选中 “Don't use/use” , 此项可避免busybox被安装到宿主系统的usr目录中,破坏宿主系统 "(./_install)busy.
Box installtion prefix" 填写 /work/rootfs 此目录为制作的rootfs的路径 $ make $ make install 在/work/rootfs/bin 中新生成许多命令.