add
This commit is contained in:
@@ -1,14 +0,0 @@
|
|||||||
### immortalwrt的docker构建脚本
|
|
||||||
|
|
||||||
根据自己情况修改,修改后执行`docker-run.sh`脚本即可自动构建,构建出来的固件在当前的`bin`目录。
|
|
||||||
|
|
||||||
- 初始化脚本修改:`files/etc/uci-defaults/99-custom.sh`
|
|
||||||
|
|
||||||
- 内置软件包修改:`build.sh`
|
|
||||||
|
|
||||||
- 镜像版本修改:`docker-run.sh`,选择符合自己设备的系统架构。
|
|
||||||
|
|
||||||
### 安装istore商店(只支持 x86_64 和 arm64 架构)
|
|
||||||
```
|
|
||||||
curl -sSL -O https://gh-proxy.com/https://raw.githubusercontent.com/sky22333/shell/main/openwrt/sh/istore.sh && chmod +x istore.sh && ./istore.sh
|
|
||||||
```
|
|
||||||
@@ -1,20 +0,0 @@
|
|||||||
#!/bin/bash
|
|
||||||
|
|
||||||
PACKAGES=""
|
|
||||||
PACKAGES="$PACKAGES curl"
|
|
||||||
PACKAGES="$PACKAGES luci-theme-argon"
|
|
||||||
PACKAGES="$PACKAGES luci-i18n-base-zh-cn"
|
|
||||||
PACKAGES="$PACKAGES luci-i18n-firewall-zh-cn"
|
|
||||||
PACKAGES="$PACKAGES luci-i18n-package-manager-zh-cn"
|
|
||||||
PACKAGES="$PACKAGES luci-i18n-homeproxy-zh-cn"
|
|
||||||
PACKAGES="$PACKAGES luci-i18n-ttyd-zh-cn"
|
|
||||||
PACKAGES="$PACKAGES luci-i18n-diskman-zh-cn"
|
|
||||||
PACKAGES="$PACKAGES luci-i18n-filemanager-zh-cn"
|
|
||||||
|
|
||||||
# Docker需要1G以上空间,下载汉化包即可自动安装对应软件和依赖
|
|
||||||
# PACKAGES="$PACKAGES luci-i18n-dockerman-zh-cn"
|
|
||||||
|
|
||||||
make image PACKAGES="$PACKAGES" FILES="/home/build/immortalwrt/files" ROOTFS_PARTSIZE="512"
|
|
||||||
|
|
||||||
# 通常需要传入路由器型号,例如:PROFILE=friendlyarm_nanopi-r2s
|
|
||||||
# 路由器型号id查询地址:https://downloads.immortalwrt.org/releases/24.10.4/.overview.json
|
|
||||||
@@ -1,12 +0,0 @@
|
|||||||
#!/bin/bash
|
|
||||||
|
|
||||||
mkdir -p bin
|
|
||||||
chmod -R 777 bin
|
|
||||||
chmod +x build.sh
|
|
||||||
chmod +x files/etc/uci-defaults/99-custom.sh
|
|
||||||
|
|
||||||
docker run --rm -it \
|
|
||||||
-v ./bin:/home/build/immortalwrt/bin \
|
|
||||||
-v ./files/etc/uci-defaults:/home/build/immortalwrt/files/etc/uci-defaults \
|
|
||||||
-v ./build.sh:/home/build/immortalwrt/build.sh \
|
|
||||||
immortalwrt/imagebuilder:x86-64-openwrt-24.10.4 /home/build/immortalwrt/build.sh
|
|
||||||
@@ -1,108 +0,0 @@
|
|||||||
#!/bin/sh
|
|
||||||
exec >/tmp/setup.log 2>&1
|
|
||||||
|
|
||||||
###########################################################
|
|
||||||
# 自 定 义 配 置 区 域
|
|
||||||
###########################################################
|
|
||||||
|
|
||||||
### 系统后台密码(为空则不修改)
|
|
||||||
root_password="root"
|
|
||||||
|
|
||||||
### LAN 的 IPv4 地址(也是后台地址,例如 192.168.2.1)
|
|
||||||
lan_ip_address="192.168.56.2"
|
|
||||||
|
|
||||||
### LAN 的子网掩码(例如 255.255.255.0)
|
|
||||||
# lan_netmask="255.255.255.0"
|
|
||||||
|
|
||||||
### LAN 的 IPv4 网关(可为空)
|
|
||||||
# lan_gateway="192.168.1.1"
|
|
||||||
|
|
||||||
### LAN 的 DNS(多个 DNS 可空格分隔,如 "8.8.8.8 1.1.1.1")
|
|
||||||
# lan_dns="8.8.8.8 223.5.5.5"
|
|
||||||
|
|
||||||
### DHCP 是否开启(1=开启,0=关闭)
|
|
||||||
# lan_dhcp_enable="1"
|
|
||||||
|
|
||||||
### DHCP 起始地址
|
|
||||||
# lan_dhcp_start="100"
|
|
||||||
|
|
||||||
### DHCP 地址池数量
|
|
||||||
# lan_dhcp_limit="150"
|
|
||||||
|
|
||||||
### DHCP 租约时间
|
|
||||||
# lan_dhcp_leasetime="12h"
|
|
||||||
|
|
||||||
### WiFi 名称 SSID(为空则不修改)
|
|
||||||
# wlan_name="ImmortalWrt"
|
|
||||||
|
|
||||||
### WiFi 密码(≥ 8 位才生效)
|
|
||||||
# wlan_password="12345678"
|
|
||||||
|
|
||||||
### PPPoE 宽带账号(为空则跳过)
|
|
||||||
# pppoe_username=""
|
|
||||||
|
|
||||||
### PPPoE 宽带密码
|
|
||||||
# pppoe_password=""
|
|
||||||
|
|
||||||
###########################################################
|
|
||||||
# 正 式 配 置 流 程
|
|
||||||
###########################################################
|
|
||||||
|
|
||||||
# ------------ root 密码 ------------
|
|
||||||
if [ -n "$root_password" ]; then
|
|
||||||
(echo "$root_password"; sleep 1; echo "$root_password") | passwd >/dev/null
|
|
||||||
fi
|
|
||||||
|
|
||||||
# ------------ LAN 基础配置 ------------
|
|
||||||
if [ -n "$lan_ip_address" ]; then
|
|
||||||
uci set network.lan.ipaddr="$lan_ip_address"
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ -n "$lan_netmask" ]; then
|
|
||||||
uci set network.lan.netmask="$lan_netmask"
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ -n "$lan_gateway" ]; then
|
|
||||||
uci set network.lan.gateway="$lan_gateway"
|
|
||||||
fi
|
|
||||||
|
|
||||||
# DNS
|
|
||||||
if [ -n "$lan_dns" ]; then
|
|
||||||
uci delete network.lan.dns 2>/dev/null
|
|
||||||
for d in $lan_dns; do
|
|
||||||
uci add_list network.lan.dns="$d"
|
|
||||||
done
|
|
||||||
fi
|
|
||||||
|
|
||||||
uci commit network
|
|
||||||
|
|
||||||
# ------------ DHCP 设置 ------------
|
|
||||||
if [ -n "$lan_dhcp_enable" ]; then
|
|
||||||
uci set dhcp.lan.ignore=$([ "$lan_dhcp_enable" = "1" ] && echo 0 || echo 1)
|
|
||||||
fi
|
|
||||||
|
|
||||||
[ -n "$lan_dhcp_start" ] && uci set dhcp.lan.start="$lan_dhcp_start"
|
|
||||||
[ -n "$lan_dhcp_limit" ] && uci set dhcp.lan.limit="$lan_dhcp_limit"
|
|
||||||
[ -n "$lan_dhcp_leasetime" ] && uci set dhcp.lan.leasetime="$lan_dhcp_leasetime"
|
|
||||||
|
|
||||||
uci commit dhcp
|
|
||||||
|
|
||||||
# ------------ WIFI 配置 ------------
|
|
||||||
if [ -n "$wlan_name" ] && [ -n "$wlan_password" ] && [ ${#wlan_password} -ge 8 ]; then
|
|
||||||
uci set wireless.@wifi-device[0].disabled='0'
|
|
||||||
uci set wireless.@wifi-iface[0].disabled='0'
|
|
||||||
uci set wireless.@wifi-iface[0].encryption='psk2'
|
|
||||||
uci set wireless.@wifi-iface[0].ssid="$wlan_name"
|
|
||||||
uci set wireless.@wifi-iface[0].key="$wlan_password"
|
|
||||||
uci commit wireless
|
|
||||||
fi
|
|
||||||
|
|
||||||
# ------------ PPPoE 宽带拨号 ------------
|
|
||||||
if [ -n "$pppoe_username" ] && [ -n "$pppoe_password" ]; then
|
|
||||||
uci set network.wan.proto=pppoe
|
|
||||||
uci set network.wan.username="$pppoe_username"
|
|
||||||
uci set network.wan.password="$pppoe_password"
|
|
||||||
uci commit network
|
|
||||||
fi
|
|
||||||
|
|
||||||
echo "All done!"
|
|
||||||
@@ -1,32 +0,0 @@
|
|||||||
FROM alpine:latest AS downloader
|
|
||||||
|
|
||||||
RUN apk add --no-cache wget
|
|
||||||
|
|
||||||
# ImmortalWrt版本
|
|
||||||
ARG IMWRT_VERSION=24.10.4
|
|
||||||
ARG TARGETARCH
|
|
||||||
|
|
||||||
# 根据TARGETARCH变量自动适配架构
|
|
||||||
RUN case "${TARGETARCH}" in \
|
|
||||||
amd64) \
|
|
||||||
URL="https://downloads.immortalwrt.org/releases/${IMWRT_VERSION}/targets/x86/64/immortalwrt-${IMWRT_VERSION}-x86-64-rootfs.tar.gz" \
|
|
||||||
;; \
|
|
||||||
arm64) \
|
|
||||||
URL="https://downloads.immortalwrt.org/releases/${IMWRT_VERSION}/targets/armsr/armv8/immortalwrt-${IMWRT_VERSION}-armsr-armv8-rootfs.tar.gz" \
|
|
||||||
;; \
|
|
||||||
*) \
|
|
||||||
echo "错误:不支持的架构 ${TARGETARCH}" && exit 1 \
|
|
||||||
;; \
|
|
||||||
esac && \
|
|
||||||
echo "开始下载 ImmortalWrt rootfs,版本:${IMWRT_VERSION},架构:${TARGETARCH}" && \
|
|
||||||
wget -O /rootfs.tar.gz "$URL" && \
|
|
||||||
mkdir -p /rootfs && \
|
|
||||||
tar -xzf /rootfs.tar.gz -C /rootfs
|
|
||||||
|
|
||||||
FROM scratch
|
|
||||||
|
|
||||||
COPY --from=downloader /rootfs/ /
|
|
||||||
|
|
||||||
WORKDIR /
|
|
||||||
|
|
||||||
CMD ["/sbin/init"]
|
|
||||||
@@ -1,36 +0,0 @@
|
|||||||
#!/bin/sh
|
|
||||||
# 支持所有x86_64和arm64设备
|
|
||||||
# 安装iStore 参考 https://github.com/linkease/istore
|
|
||||||
do_istore() {
|
|
||||||
echo "do_istore method==================>"
|
|
||||||
# istore源
|
|
||||||
ISTORE_REPO=https://istore.istoreos.com/repo/all/store
|
|
||||||
FCURL="curl --fail --show-error"
|
|
||||||
|
|
||||||
curl -V >/dev/null 2>&1 || {
|
|
||||||
echo "prereq: install curl"
|
|
||||||
opkg info curl | grep -Fqm1 curl || opkg update
|
|
||||||
opkg install curl
|
|
||||||
}
|
|
||||||
|
|
||||||
IPK=$($FCURL "$ISTORE_REPO/Packages.gz" | zcat | grep -m1 '^Filename: luci-app-store.*\.ipk$' | sed -n -e 's/^Filename: \(.\+\)$/\1/p')
|
|
||||||
|
|
||||||
[ -n "$IPK" ] || exit 1
|
|
||||||
|
|
||||||
$FCURL "$ISTORE_REPO/$IPK" | tar -xzO ./data.tar.gz | tar -xzO ./bin/is-opkg >/tmp/is-opkg
|
|
||||||
|
|
||||||
[ -s "/tmp/is-opkg" ] || exit 1
|
|
||||||
|
|
||||||
chmod 755 /tmp/is-opkg
|
|
||||||
/tmp/is-opkg update
|
|
||||||
# /tmp/is-opkg install taskd
|
|
||||||
/tmp/is-opkg opkg install --force-reinstall luci-lib-taskd luci-lib-xterm
|
|
||||||
/tmp/is-opkg opkg install --force-reinstall luci-app-store || exit $?
|
|
||||||
[ -s "/etc/init.d/tasks" ] || /tmp/is-opkg opkg install --force-reinstall taskd
|
|
||||||
[ -s "/usr/lib/lua/luci/cbi.lua" ] || /tmp/is-opkg opkg install luci-compat >/dev/null 2>&1
|
|
||||||
sed -i 's/istore.linkease.com/istore.istoreos.com/g' /bin/is-opkg
|
|
||||||
sed -i 's/istore.linkease.com/istore.istoreos.com/g' /etc/opkg/compatfeeds.conf
|
|
||||||
sed -i 's/istore.linkease.com/istore.istoreos.com/g' /www/luci-static/istore/index.js
|
|
||||||
}
|
|
||||||
|
|
||||||
do_istore
|
|
||||||
Reference in New Issue
Block a user