First, in the configuration USB drive before starting to configure the router can surf the internet, through HyperTerminal (I often Xshell) login router, you can update the installation package source through Opkg update, if not, then refer to other tutorials to set.
Second, install the required package:
opkg Install kmod-usb-storage kmod-usb-uhci kmod-usb2 block-mount block-hotplug block-extroot kmod-fs-ext3
Description: KMOD-USB2 corresponds to USB2.0
KMOD-USB-UHCI corresponding to some of the Intel and via USB controllers
Implement USB storage device automatically mount and boot from USB, need to use the package: Block-mount, Block-hotplug (these two are automatically mounted) and Block-extroot (this is USB boot)
KMOD-FS-EXT3 is file system support, I am the format of the USB flash drive Ext3 file system use, do not install file system support, can not mount.
Note: After installing Block-extroot, an error may occur: "Collected errors: * resolve_conffiles:existing Conffile/etc/config/fstab is different From the Conffile in the new package. The new conffile would be placed at/etc/config/fstab-opkg. " This error is due to a new fstab conflict that was generated after the configuration file Fstab and installation Block-extroot under the original/etc/config. Therefore, use the command: MV Fstab fstab.bak; MV fstab-opkg fstab; This file needs to be used in the next configuration.
Third, I have only one partition of the U disk (note: The partition should be set as the main partition primary), after inserting a USB stick, you can use the "fdisk-l" command to query, if you need to divide two or more than two partitions, you can query other data for partitioning.
Mount/dev/sda1/mnt #挂载U盘第一个分区到/mnt
Mkdir/tmp/root #在 the/tmp directory to create a directory called root
Mount-o bind//tmp/root #挂载并同步系统根目录 "/" to/tmp/root
cp/tmp/root/*/mnt-a #拷贝/tmp/root all the files to "/mnt", this is actually your USB stick.
Umount/tmp/root Uninstalling/tmp/root#
Iv. modification of/etc/config/fstab.
Before modification: Config mount
Option Target/home
Option DEVICE/DEV/SDA1
Option Fstype ext3
Option Options Rw,sync
Option enabled 0
Config swap
Option Device/dev/sda2
Option enabled 0
After modification:
Config mount
# option Target/home This line should not matter, I generally remove or add a "#" in front
Option DEVICE/DEV/SDA1
Option Fstype ext3
Option Options Rw,sync
option enabled 1
Option Is_rootfs 1
Config swap
Option Device/dev/sda2
Option enabled 0
The red font is a modified or added content.
Add the logo to identify whether to boot from the USB stick;
Vi/mnt/etc/banner
Added on last line: Boot from Upan
After starting again, the effect is as follows:
Connecting to 192.168.1.1:22 ...
Connection established.
To escape to local shell, press ' ctrl+alt+] '.
BusyBox v1.15.3 (2012-01-31 02:23:09 CST) built-in shell (ASH)
Enter ' help ' for a list of built-in commands.
_.-"._
_-: () ":_
_-"‘. ‘. _" :-_
-" ‘.-.‘ -. .‘ "-_
|" _() _‘).:(.‘ () -"|
J "_. '.". -"F
L "_." () ‘. ' _-' o J
| O ' "-_ _:": |
"_ L '"-.-"| J _-"
"| J F () J:-"
"| () J:-"
"-_ | _"
"-"
Openwrt-dreambox (r365)--------------------
* Base on Openwrt Backfire
* LINTEL ([email protected]).
* Yuef Zhu ([email protected]).
* Xeye ([email protected]).
* Vcore ([email protected]).
* EMONGXX ([email protected]).
---------------------------------------------------
Boot from Upan
---------------------------------------------------
Using the "df-h" Query results:
Filesystem Size used Available use% mounted on
/dev/root 9.1M 9.1M 0 100%/rom
Tmpfs 14.5M 100.0K 14.4M 1%/tmp
Tmpfs 512.0K 0 512.0K 0%/dev
/DEV/SDA1 14.7G 201.3M 13.7G 1%/overlay
Mini_fo:/overlay 9.1M 9.1M 0 100%/
A red font appears, indicating that it has been booted from the USB stick.
Openwrt-dreambox 20120201 configuration USB Drive Boot