360 P2 刷 openWRT 潘多拉 (PandoraBox) 后安装软件到 U 盘

路由器挂在 U 盘我的自动挂在到 /mnt/sda1。


PS:可以格式 U 盘为 ext4/3 格式,步骤卸载挂载 ,然后 mkfs.ext4 /dev/sda1, 然后在挂载


U 盘挂在完在 U 盘创建 文件夹 packages  命令如下


#mkdir /mnt/sda1/packages


然后配置 opkg.conf 文件:


[root@PandoraBox:/mnt/sda1/packages/usr]#cat /etc/opkg.conf
dest root /
dest ram /tmp
#这里配置 U 盘的挂载地址 /mnt/sda1 是 U 盘地址 packages 为 U 盘下的目录
dest usb /mnt/sda1/packages
lists_dir ext /var/opkg-lists
option overlay_root /overlay
#  http://downloads.openwrt.org/chaos_calmer/15.05/ramips/mt7628 这个地址换成路由器固件对应的地址
src/gz barrier_breaker_packages http://downloads.openwrt.org/chaos_calmer/15.05/ramips/mt7628/packages/packages
#src/gz barrier_breaker_base http://downloads.openwrt.org/chaos_calmer/15.05/ramips/mt7628/packages/base
#src/gz barrier_breaker_luci http://downloads.openwrt.org/chaos_calmer/15.05/ramips/mt7628/packages/luci
#src/gz barrier_breaker_management http://downloads.openwrt.org/chaos_calmer/15.05/ramips/mt7628/packages/management
#src/gz barrier_breaker_packages http://downloads.openwrt.org/chaos_calmer/15.05/ramips/mt7628/packages/packages
#src/gz barrier_breaker_routing http://downloads.openwrt.org/chaos_calmer/15.05/ramips/mt7628/packages/routing
#src/gz barrier_breaker_telephony http://downloads.openwrt.org/chaos_calmer/15.05/ramips/mt7628/packages/telephony
# 安装软件如果报这个错误 就配置下面的信息 Package XXX version XXXX has no valid architecture, ignoring.
arch all 100
arch noarch 200
arch ralink 300
arch ramips_24kec 400

 


 然后配置 profile 命令如下:


#vi /etc/profile 


[root@PandoraBox:/mnt/sda1/packages/usr]#vi /etc/profile
#!/bin/sh
[ -f /etc/banner ] && cat /etc/banner
#红色部分为添加部分
export LD_LIBRARY_PATH=/mnt/sda1/packages/usr/lib:/mnt/sda1/packages/lib
export PATH=/usr/bin:/usr/sbin:/bin:/sbin:/mnt/sda1/packages/usr/bin:/mnt/sda1/packages/usr/sbin:/mnt/sda1/packages/bin:/mnt/sda1/packages/sbin
export HOME=$(grep -e "^${USER:-root}:" /etc/passwd | cut -d ":" -f 6)
export HOME=${HOME:-/root}
#export PS1='\u@\h:\w\$ '
export PS1='[[\033[35;1m]\u[\033[0m]@[\033[31;1m]\h[\033[0m]:[\033[32;1m]$PWD[\033[0m]]\$'
[ -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 $*; }
alias df='df -h'
alias ps='ps -ww'
alias free='free -m'
#alias ls='ls -hF --color=auto'
alias ll='ls -alh'
alias la='ll -A'
#alias top='top -d1'

 保存后 执行以下命令 或者重启路由器:


#source /etc/profile


 好了,下面开始安装软件:


执行  opkg update 


执行 opkg -d usb install python 安装软件,安装命令加  -d usb 就是把软件安装到 /etc/opkg.conf 配置的 dest usb /mnt/sda1/packages 目录下.