编译x86架构的openwrt系统,让笔记本从u盘启动openwrt

下载openwrt源码, 
参考: 
http://blog.csdn.net/u011641885/article/details/46348267html

make menuconfig 基本配置linux

    Target System (x86)  ---> 
    Subtarget (Generic)  --->
    Target Profile (Generic)  --->
    Target Images  --->      
1
2
3
4
Target Images配置 
参考配置以下: windows

主要勾选内容:ui

[*] ext4  --->  
[*] iso  操作系统

[*] squashfs  ---> .net

[*] Build VirtualBox image files (VDI)
[*] Build VMware image files (VMDK)
1
2
3
4
5
6
7
下面是比较重要的配置htm

(10) Kernel partition size (in MB) 
(48) Root filesystem partition size (in MB)
()  Root partition on target device 
[ ] Include kernel in root filesystem  ---- 
1
2
3
4
Kernel partition size (in MB) 
内核分区大小,默认为 2MB,当咱们选上太多内核模块时,编译出来的内核将大于 2MB 。这时候系统会启动失败的。会提示找不到内核。我的建议修改成 10MBblog

Root filesystem partition size 
根文件系统分区大小。默认 48MBmd5

Root partition on target device 
根文件系统所在分区位置。默认值为 /dev/sda2 
若是咱们把openwrt烧写u盘的话。系统启动后会提示找不到根文件系统。由于咱们的根文件系统是在 u盘里面。因此这个值要清空。get

建议在内核模块中把全部网卡驱动都选上

编译
make V=s
1
最后会在 bin/x86 目录下生成下面的文件:

md5sums
openwrt-x86-generic-combined-ext4.img.gz
openwrt-x86-generic-combined-ext4.vdi
openwrt-x86-generic-combined-ext4.vmdk
openwrt-x86-generic-combined-squashfs.img.gz
openwrt-x86-generic-combined-squashfs.vdi
openwrt-x86-generic-combined-squashfs.vmdk
openwrt-x86-generic-Generic-rootfs.tar.gz
openwrt-x86-generic.iso
openwrt-x86-generic-rootfs-ext4.img.gz
openwrt-x86-generic-rootfs-squashfs.img.gz
openwrt-x86-generic-vmlinuz
packages
sha256sums
1
2
3
4
5
6
7
8
9
10
11
12
13
14
比较重要的是这几个文件: 
openwrt-x86-generic.iso 用于烧录到光盘,从光盘启动openwrt

openwrt-x86-generic-combined-ext4.img.gz 解压获得 openwrt-x86-generic-combined-ext4.img,可在linux用 dd 命令烧写到 u盘 硬盘等

openwrt-x86-generic-combined-ext4.vmdk 虚拟机硬盘文件:能够在虚拟机下面运行openwrt,具体参考: 
http://jingyan.baidu.com/article/9113f81b2796852b3214c705.html

将openwrt 烧写到u盘去 
在linux下,能够使用 dd 命令将 openwrt-x86-generic-combined-ext4.img 文件烧写到 u盘。 
windows 7 操做系统的操做请参考: 
http://blog.csdn.net/aa120515692/article/details/46826233
参考u盘 
 
能够看到 u盘被分配成两个区,另一个区未分配。而已经分配了的两个区的大小正好和咱们前面设置的 
(10) Kernel partition size (in MB) 
(48) Root filesystem partition size (in MB) 
同样! 
没错。第一个区就是内核分区。第二个是根文件系统分区。

从u盘启动openwrt 
重启电脑,选为 u 盘启动模式,能够看到下面的信息。成功启动了openwrt
 
选择 USB HDD 启动

  GUN GRUB ~~!

相关文章
相关标签/搜索