location ~* \.(jpg|jpeg|png|gif)$ {
alias /www/wwwroot/wxapi.ooolo.net/$uri;
access_log off;
expires max;
}
我的博客即将同步至腾讯云开发者社区,邀请大家一同入驻:https://cloud.tencent.com/developer/support-plan?invite_code=uyxbfoo752m6
location ~* \.(jpg|jpeg|png|gif)$ {
alias /www/wwwroot/wxapi.ooolo.net/$uri;
access_log off;
expires max;
}
我的博客即将同步至腾讯云开发者社区,邀请大家一同入驻:https://cloud.tencent.com/developer/support-plan?invite_code=uyxbfoo752m6
baota.sh
docker pull azking/arm64_bt59_lnmp && echo "success"
usb.sh
mkdir -p /tmp/introot &&
mkdir -p /tmp/extroot &&
mount --bind / /tmp/introot &&
mount /dev/sda1 /tmp/extroot &&
tar -C /tmp/introot -cvf - . | tar -C /tmp/extroot -xf - &&
umount /tmp/introot &&
umount /tmp/extroot &&
echo "success"
以上命令运行超慢建议搭配 nohup 命令使用
docker run --name webServer -it --network=host azking/arm64_bt59_lnmp bash /www/init.sh
面板登陆地址:http://192.168.x.x:9999
镜像内容: arm64架构|centos|宝塔5.9|php5.6|php7.1|mysql5.5|nginx|ftp
面板端口: 9999
账号: btadmin
密码: azking/baota59
phpmyadmin端口: 999
网站默认端口: 81 (防止和路由器 openwrt自身80端口冲突).
这样就可以直接食用了。
建议切换到国内源不然很慢
docker ps
docker exec -it 775c7c9ee1e1 /bin/bash
usb.sh:
mkdir -p /tmp/introot &&
mkdir -p /tmp/extroot &&
mount --bind / /tmp/introot &&
mount /dev/sda1 /tmp/extroot &&
tar -C /tmp/introot -cvf - . | tar -C /tmp/extroot -xf - &&
umount /tmp/introot &&
umount /tmp/extroot &&
echo "success"
nohup sh usb.sh > log_out.txt 2>&1 &
查看执行日志:
tail -f log_out.txt
/etc/fstab 只读无法修改的解决办法
mount -o remount,rw /
修改/etc/config/fstab文件
删除默认的mount信息
config global
option anon_swap '0'
option anon_mount '1'
option auto_swap '1'
option auto_mount '1'
option delay_root '5'
option check_fs '0'
config mount
option target '/rom'
option uuid '1f045de8-469f-4786-9614-85ebdf19b519'
option enabled '0'
config mount
option target '/mnt/mmcblk2p3'
option uuid '7df14b19-6e49-4532-bda7-8901e5388e36'
option enabled '1'
config mount
option target '/mnt/mmcblk2p4'
option uuid 'c48f430a-443e-4992-9424-e575f1e1f159'
option enabled '1'
config mount
option target '/'
option uuid 'e5e198c0-53ee-407a-b2a2-a0fc98d68715'
option enabled '1'
config mount
option enabled '1'
option uuid 'e5e198c0-53ee-407a-b2a2-a0fc98d68715'
option target '/opt'
config mount
option enabled '1'
option uuid 'e5e198c0-53ee-407a-b2a2-a0fc98d68715'
option target '/overlay'
设置显示从哪里启动的:
echo Booted from internal rom >> /etc/banner
docker根目录设置
例如当前 U 盘挂载点为 /dev/sda,先执行卸载命令:umount /dev/sda
mkdir -p /tmp/introot
mkdir -p /tmp/extroot
mount --bind / /tmp/introot
mount /dev/sda /tmp/extroot
tar -C /tmp/introot -cvf - . | tar -C /tmp/extroot -xf -
umount /tmp/introot
umount /tmp/extroot
打开“系统”-“挂载点”界面,点击下方“挂载点”区域内的“添加”按钮,手动配置挂载信息,然后“保存并应用”,如图所示。
最后重启系统即可,路由器会自动从 U 盘加载启动,再查看软件包界面就会显示成 U 盘的容量。
完毕!
备注:
为了便于区分是从设备的ROM启动还是U盘启动。可以对U盘上的/etc/banner文件末尾添加Boot From USB!这样再设备启动时候或者telnet进去的时候可以看到此banner。