由于空间不足,我挂载了 usb 盘。 ssh [email protected] mkdir /mnt/material mkdir /mnt/material/opkg
mount /dev/sda /mnt/material
mkdir /tmp/root
mount -o bind / /tmp/root
cp /tmp/root/* /mnt/material -a
umount /tmp/root
vim /etc/config/fstab config 'mount' option target '/mnt/sda' option uuid '00BC-D08E' option enabled '0' option 'target' '/mnt/material' option 'enabled' '1' option 'fstype' 'ext3' option 'device' '/dev/sda' option is_rootfs '1'
vim /etc/opkg.conf dest root / dest ram /tmp dest usb /mnt/material/opkg lists_dir ext /var/opkg-lists option overlay_root /overlay option check_signature 1
vim /etc/profile #!/bin/sh [ -f /etc/banner ] && cat /etc/banner [ -e /tmp/.failsafe ] && cat /etc/banner.failsafe
export PATH=/usr/sbin:/usr/bin:/sbin:/bin:/mnt/material/opkg/usr/bin export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/mnt/material/opkg/usr/lib:/usr/lib:/lib export HOME=$(grep -e "^${USER:-root}:" /etc/passwd | cut -d ":" -f 6) export HOME=${HOME:-/root} export PS1='\u@\h:\w$ '
[ -x /bin/more ] || alias more=less [ -x /usr/bin/vim ] && alias vi=vim || alias vim=vi
[ -z "$KSH_VERSION" -o ! -s /etc/mkshrc ] || . /etc/mkshrc
[ -x /usr/bin/arp ] || arp() { cat /proc/net/arp; } [ -x /usr/bin/ldd ] || ldd() { LD_TRACE_LOADED_OBJECTS=1 $*; }
下面以一个具体的 package 为例,进行说明:安装 bash
root@OpenWrt:~# opkg install -d usb bash Installing bash (4.3.39-1) to usb... Downloading http://downloads.openwrt.org/chaos_calmer/15.05.1/ar71xx/generic/packages/packages/bash_4.3.39-1_ar71xx.ipk. Configuring bash. grep: /usr/lib/opkg/info/bash.control: No such file or directory cat: can't open '/usr/lib/opkg/info/bash.list': No such file or directory
opkg install bash 没有问题。
怎样才能将 package 安装到 usb 盘?
1
qvvo 2016-06-08 01:06:03 +08:00 via Android
我只试过把系统从 usb 盘启动,完全把 usb 当成 rootfs 的方式,目前 wr703 运行稳定
|