This commit is contained in:
John Doe
2021-10-23 22:09:15 +08:00
parent 5538f41315
commit 261a056567
2 changed files with 5 additions and 4 deletions

View File

@@ -40,7 +40,7 @@ if [ $md5r != $md5sum ]; then
fi
mv $board_id.img FriendlyWrt.img
[ $board_id = 'x86' ] && drive='sda' || drive='mmcblk0'
[ $board_id == 'x86' ] && drive='sda' || drive='mmcblk0'
bs=`expr $(cat /sys/block/$drive/size) \* 512`
truncate -s $bs FriendlyWrt.img || ../truncate -s $bs FriendlyWrt.img
echo ", +" | sfdisk -N 2 FriendlyWrt.img
@@ -55,8 +55,8 @@ cd /mnt/img
sysupgrade -b back.tar.gz
tar zxf back.tar.gz
echo 'opkg update' > packages_needed
opkg list-installed | grep "luci-i18n\|luci-app" | cut -d\ -f1 | sort -r | xargs -n1 echo opkg install >> packages_needed
sed -i '/exit/i\[ -e /packages_needed ] && (mv /packages_needed /packages_needed.installed && sh /packages_needed.installed)\' /etc/rc.local
opkg list-installed | grep "luci-i18n\|luci-app" | cut -d\ -f1 | sort -r | xargs -n1 echo opkg install --force-overwrite >> packages_needed
[ x$ver == 'x-slim' ] && sed -i '/exit/i\sed -i "/packages_needed/d" /etc/rc.local; [ -e /packages_needed ] && (mv /packages_needed /packages_needed.installed && sh /packages_needed.installed)\' etc/rc.local
if ! grep -q macaddr /etc/config/network; then
echo -e '\e[91m注意由于已知的问题“网络接口”配置无法继承重启后需要重新设置WAN拨号和LAN网段信息\e[0m'
rm etc/config/network;
@@ -79,7 +79,7 @@ if [ -f FriendlyWrt.img ]; then
echo 1 > /proc/sys/kernel/sysrq
echo u > /proc/sysrq-trigger && umount / || true
#pv FriendlyWrt.img | dd of=/dev/mmcblk0 conv=fsync
dd if=FriendlyWrt.img of=/dev/$drive conv=sparse status=progress bs=1M
dd if=FriendlyWrt.img of=/dev/$drive oflag=direct conv=sparse status=progress bs=1M
echo -e '\e[92m刷机完毕正在重启...\e[0m'
echo b > /proc/sysrq-trigger
fi

View File

@@ -38,6 +38,7 @@ merge_package https://github.com/coolsnowwolf/lede/trunk/package/lean/ntfs3-moun
merge_package https://github.com/coolsnowwolf/lede/trunk/package/lean/ntfs3
merge_package https://github.com/coolsnowwolf/lede/trunk/package/lean/uugamebooster
merge_package https://github.com/coolsnowwolf/lede/trunk/package/lean/luci-app-uugamebooster
merge_package https://github.com/kuoruan/openwrt-frp frp
merge_package https://github.com/kuoruan/luci-app-frpc
merge_package https://github.com/small-5/luci-app-adblock-plus
merge_package https://github.com/zxlhhyccc/luci-app-v2raya