由于空间不足,我挂载了 usb 盘。 ssh root@192.168.1.1 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 盘?
这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。
V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。
V2EX is a community of developers, designers and creative people.