ImmortalWrt 系统编译与定制 🏔️
🛠️ 从零开始构建专属的 OpenWrt 固件,满足个性化需求。本指南详细介绍了 ImmortalWrt 的编译、定制、安装和优化全过程。
✨ 目录
✨ 概述 ImmortalWrt 是 OpenWrt 的一个分支,专注于提供更稳定的功能和更好的用户体验。本指南将帮助您:
✅ 了解 ImmortalWrt 的基本概念和优势
✅ 掌握在线定制编译的方法
✅ 配置个性化的软件包组合
✅ 创建自动化的首次启动脚本
✅ 处理镜像扩容和系统优化
✅ 部署和维护您的定制系统
🎯 一、准备工作 📚 学习资源
🔧 环境要求 1 2 3 4 5 6 7 8 9 10 - 处理器: x86_64 或 ARM 架构 - 内存: 至少 2GB RAM - 存储: 至少 10GB 可用空间 - 网络: 稳定的互联网连接 - 操作系统: Linux (推荐 Ubuntu 20.04+ 或 iStoreOS/OpenWrt) - 基础工具: git, curl, wget, build-essential - 编译依赖: 参见官方文档
🛠️ 必要工具安装 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 sudo apt updatesudo apt install -y \ git curl wget \ build-essential \ libssl-dev \ libncurses5-dev \ unzip gzip \ python3 python3-pip opkg update opkg install \ git-http \ curl \ wget \ unzip \ gzip \ parted \ losetup \ resize2fs \ openssh-sftp-server
📁 创建工作目录 1 2 3 4 5 6 mkdir -p ~/immortalwrt-buildcd ~/immortalwrt-buildgit clone https://github.com/wukongdaily/OpenBackRestore.git
⚙️ 二、在线定制编译 🌐 访问在线构建器 打开 ImmortalWrt 官方在线构建器:Firmware Selector
🎛️ 配置构建参数
选择版本 : 23.05.4
(稳定版)
选择平台 :
架构: x86/64
子目标: generic
变体: ext4-combined
(推荐)
点击展开按钮 → 自定义预装软件
🔍 软件包搜索技巧 需要查找软件包名称?访问:软件包仓库
📝 构建配置示例 1 2 3 4 5 6 7 8 9 10 11 12 13 14 TARGET: x86 SUBTARGET: 64 PROFILE: generic EXT4_ROOTFS: enabled COMBINED_IMAGE: enabled GRUB_IMAGES: disabled BASE: enabled LUCI: enabled LUCI_SSL: enabled
⏳ 编译过程监控 1 2 3 4 5 6 7 8 - 低端设备: 2-4 小时 - 中端设备: 1-2 小时 - 高端设备: 30-60 分钟 - 云服务器: 15-30 分钟 tail -f build.log | grep -E "(processing|install|Creating)"
📦 三、预装软件配置 🎯 推荐预装软件列表 🌐 网络工具 1 2 3 4 5 6 7 8 9 10 11 luci-i18n-firewall-zh-cn luci-i18n-opkg-zh-cn luci-i18n-ttyd-zh-cn openssh-sftp-server luci-app-wol luci-i18n-wol-zh-cn luci-app-upnp luci-i18n-upnp-zh-cn
📁 文件管理 1 2 3 4 5 6 7 8 9 10 11 12 13 luci-app-filebrowser luci-i18n-filebrowser-zh-cn vsftpd luci-app-vsftpd luci-app-diskman parted fdisk e2fsprogs
🎨 主题界面 1 2 3 4 5 6 7 8 luci-theme-argon luci-app-argon-config luci-i18n-argon-config-zh-cn luci-theme-material luci-theme-bootstrap
🔒 科学上网 1 2 3 4 5 6 7 8 9 10 11 12 13 14 luci-app-passwall luci-i18n-passwall-zh-cn luci-app-openclash luci-app-homeproxy luci-i18n-homeproxy-zh-cn shadowsocks-libev luci-app-shadowsocks-libev
🛠️ 系统工具 1 2 3 4 5 6 7 8 9 10 11 12 13 14 luci-app-statistics luci-i18n-statistics-zh-cn luci-app-nlbwmon luci-i18n-nlbwmon-zh-cn luci-app-cron luci-i18n-cron-zh-cn luci-app-partexp
🔧 自定义软件选择技巧 1. 按功能需求选择 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 luci-i18n-firewall-zh-cn luci-i18n-upnp-zh-cn luci-app-wol luci-theme-argon luci-app-passwall luci-app-diskman luci-app-statistics luci-app-filebrowser luci-i18n-firewall-zh-cn luci-i18n-opkg-zh-cn openssh-sftp-server
2. 空间优化策略 1 2 3 4 5 6 7 opkg info <package-name> | grep Size luci-i18n-base-zh-cn luci-i18n-firewall-zh-cn
3. 依赖关系处理 1 2 3 4 5 6 7 ./scripts/feeds update -a ./scripts/feeds install -a make defconfig make -j1 V=s 2>&1 | grep "missing"
4. 模块化配置 1 2 3 4 5 6 7 8 9 10 cat > custom_packages.list << 'EOF' luci-i18n-firewall-zh-cn luci-i18n-opkg-zh-cn luci-theme-argon openssh-sftp-server EOF xargs -a custom_packages.list opkg install
🔧 四、首次启动脚本 🚀 初始化脚本配置 创建首次启动配置文件:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 #!/bin/sh logger -t custom-init "开始执行首次启动配置" uci set firewall.@zone[1].input='ACCEPT' uci commit firewall logger -t custom-init "已启用 WAN 口防火墙访问" uci add dhcp domain uci set "dhcp.@domain[-1].name=time.android.com" uci set "dhcp.@domain[-1].ip=203.107.6.88" uci commit dhcp logger -t custom-init "已配置 Android TV 时间服务器" NETWORK_CONFIGURED=false PHYSICAL_IFACES=$(ls /sys/class/net | grep -E '^(eth|en|wl)' | grep -v lo) IFACE_COUNT=$(echo "$PHYSICAL_IFACES " | wc -w) logger -t custom-init "检测到 $IFACE_COUNT 个物理网卡: $PHYSICAL_IFACES " case $IFACE_COUNT in 0) logger -t custom-init "未检测到物理网卡,保持默认配置" ;; 1) uci set network.lan.proto='dhcp' uci delete network.lan.ipaddr 2>/dev/null uci delete network.lan.netmask 2>/dev/null uci commit network logger -t custom-init "已配置为单网卡 DHCP 客户端模式" NETWORK_CONFIGURED=true ;; *) uci set network.lan.ipaddr='192.168.100.1' uci set network.lan.netmask='255.255.255.0' uci commit network logger -t custom-init "已配置为多网卡静态路由模式 (192.168.100.1/24)" NETWORK_CONFIGURED=true ;; esac uci set system.@system[0].timezone='CST-8' uci set system.@system[0].zonename='Asia/Shanghai' uci set system.@system[0].hostname='ImmortalWrt-Router' uci commit system logger -t custom-init "已设置时区为亚洲/上海" uci set dropbear.@dropbear[0].RootLogin='1' uci set dropbear.@dropbear[0].PasswordAuth='on' uci set dropbear.@dropbear[0].GatewayPorts='on' uci commit dropbear logger -t custom-init "已启用 SSH 根登录" if [ -f /etc/opkg/distfeeds.conf ]; then sed -i \ -e 's|https://downloads.immortalwrt.org|https://mirrors.cernet.edu.cn/immortalwrt|g' \ -e 's|https://mirrors.vsean.net/openwrt|https://mirrors.cernet.edu.cn/immortalwrt|g' \ /etc/opkg/distfeeds.conf logger -t custom-init "已配置国内软件源镜像" fi touch /etc/.first_boot_completelogger -t custom-init "首次启动配置完成" if [ "$NETWORK_CONFIGURED " = "true" ]; then /etc/init.d/network restart logger -t custom-init "网络服务已重启" fi exit 0
🛠️ 脚本部署方法 方法一:编译时集成 1 2 3 4 5 6 7 8 9 mkdir -p files/etc/uci-defaultscat > files/etc/uci-defaults/99-custom-init << 'EOF' EOF chmod +x files/etc/uci-defaults/99-custom-init
方法二:首次启动后上传 1 2 3 4 5 6 7 8 scp 99-custom-init root@192.168.1.1:/etc/uci-defaults/ ssh root@192.168.1.1 " chmod +x /etc/uci-defaults/99-custom-init ./etc/uci-defaults/99-custom-init "
方法三:使用 Luci 界面
登录 Luci 管理界面
进入「系统」→「启动项」
在「本地启动脚本」中添加配置
保存并执行
🔍 脚本调试技巧 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 logread -e custom-init chmod +x /etc/uci-defaults/99-custom-initsh -x /etc/uci-defaults/99-custom-init uci show network uci show system uci show firewall ifconfig route -n
⚙️ 高级配置选项 动态 DNS 配置 1 2 3 4 5 6 7 8 WAN_IP=$(uci get network.wan.ipaddr 2>/dev/null || ip addr show dev br-lan | grep 'inet ' | awk '{print $2}' | cut -d/ -f1) if [ -n "$WAN_IP " ]; then uci set ddns.myddns.ipaddr="$WAN_IP " uci commit ddns logger -t custom-init "已配置 DDNS IP: $WAN_IP " fi
硬件特定配置 1 2 3 4 5 6 7 8 9 10 CPU_CORES=$(nproc ) MEMORY_KB=$(grep MemTotal /proc/meminfo | awk '{print $2}' ) if [ "$CPU_CORES " -ge 4 ] && [ "$MEMORY_KB " -ge 4000000 ]; then uci set system.@system[0].cronloglevel='9' uci set uhttpd.main.limits='100' logger -t custom-init "已启用高性能模式配置" fi
💾 五、镜像扩容处理 📈 镜像扩容步骤 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 echo "解压镜像文件..." gzip -kd immortalwrt-23.05.4-x86-64-generic-ext4-combined.img.gz echo "扩展镜像大小..." dd if =/dev/zero bs=1M count=2048 >> immortalwrt-23.05.4-x86-64-generic-ext4-combined.imgecho "调整分区大小..." parted immortalwrt-23.05.4-x86-64-generic-ext4-combined.img << EOF print resizepart 2 100% print quit EOF echo "分区调整完成,验证结果:" fdisk -l immortalwrt-23.05.4-x86-64-generic-ext4-combined.img
🛠️ 所需工具安装 在 OpenWrt/iStoreOS 上: 1 2 3 4 5 6 7 8 9 10 11 12 opkg update opkg install \ parted \ fdisk \ losetup \ resize2fs \ e2fsprogs \ openssh-sftp-server which parted && echo "parted 已安装" || echo "parted 未安装" which resize2fs && echo "resize2fs 已安装" || echo "resize2fs 未安装"
在 Ubuntu/Debian 上: 1 2 3 4 5 6 7 sudo apt updatesudo apt install -y \ parted \ fdisk \ dosfstools \ e2fsprogs \ qemu-utils
🔄 自动化扩容脚本 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 #!/bin/bash set -eIMAGE_FILE="$1 " EXPAND_SIZE="${2:-2048} " if [ -z "$IMAGE_FILE " ] || [ ! -f "$IMAGE_FILE " ]; then echo "用法: $0 <镜像文件> [扩展大小(MB)]" echo "示例: $0 openwrt.img 2048" exit 1 fi echo "正在处理镜像: $IMAGE_FILE " echo "扩展大小: ${EXPAND_SIZE} MB" BACKUP_FILE="${IMAGE_FILE} .backup.$(date +%Y%m%d_%H%M%S) " echo "创建备份: $BACKUP_FILE " cp "$IMAGE_FILE " "$BACKUP_FILE " echo "扩展镜像文件..." dd if =/dev/zero bs=1M count="$EXPAND_SIZE " >> "$IMAGE_FILE " echo "调整分区表..." PARTITION_INFO=$(parted -s "$IMAGE_FILE " unit MB print ) PARTITION_NUM=$(echo "$PARTITION_INFO " | grep -E '^ [2-9]' | wc -l) if [ "$PARTITION_NUM " -eq 0 ]; then echo "错误: 未找到可调整的分区" exit 1 fi parted -s "$IMAGE_FILE " resizepart 2 100% echo "调整文件系统大小..." LOOP_DEVICE=$(losetup -f --show -P "$IMAGE_FILE " ) if [ -z "$LOOP_DEVICE " ]; then echo "错误: 无法设置 loop 设备" exit 1 fi e2fsck -f "${LOOP_DEVICE} p2" resize2fs "${LOOP_DEVICE} p2" losetup -d "$LOOP_DEVICE " echo "镜像扩容完成!" echo "原镜像备份: $BACKUP_FILE " echo "新镜像大小: $(du -h "$IMAGE_FILE " | cut -f1) "
📊 使用示例 1 2 3 4 5 6 7 8 9 10 11 12 13 14 chmod +x resize_image.sh./resize_image.sh immortalwrt.img 2048 gzip -kd image.img.gz && \ dd if =/dev/zero bs=1M count=2048 >> image.img && \parted -s image.img resizepart 2 100% && \ LOOP_DEV=$(losetup -f --show -P image.img) && \ e2fsck -f ${LOOP_DEV} p2 && \ resize2fs ${LOOP_DEV} p2 && \ losetup -d $LOOP_DEV
🔍 验证扩容结果 1 2 3 4 5 6 7 8 9 10 ls -lh immortalwrt-*.imgfdisk -l immortalwrt-*.img losetup -f --show -P immortalwrt-*.img tune2fs -l /dev/loop0p2 | grep 'Block count' losetup -d /dev/loop0
🚀 六、安装与部署 🔄 软件源优化配置 首次启动后建议更换国内软件源:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 cp /etc/opkg/distfeeds.conf /etc/opkg/distfeeds.conf.bakcat > /etc/opkg/distfeeds.conf << 'EOF' src/gz immortalwrt_core https://mirrors.cernet.edu.cn/immortalwrt/releases/23.05.4/targets/x86/64/packages src/gz immortalwrt_base https://mirrors.cernet.edu.cn/immortalwrt/releases/23.05.4/packages/x86_64/base src/gz immortalwrt_luci https://mirrors.cernet.edu.cn/immortalwrt/releases/23.05.4/packages/x86_64/luci src/gz immortalwrt_packages https://mirrors.cernet.edu.cn/immortalwrt/releases/23.05.4/packages/x86_64/packages src/gz immortalwrt_routing https://mirrors.cernet.edu.cn/immortalwrt/releases/23.05.4/packages/x86_64/routing src/gz immortalwrt_telephony https://mirrors.cernet.edu.cn/immortalwrt/releases/23.05.4/packages/x86_64/telephony EOF opkg update opkg list | head -10
📊 一键分区扩容工具 使用 sirpdboy 的分区扩容工具:
1 2 3 4 5 6 7 8 9 10 11 wget -O install.sh https://cafe.cpolar.cn/wkdaily/OneKeyExpand/raw/branch/main/install.sh chmod +x install.sh./install.sh opkg install luci-app-partexp partexp
💾 系统备份与恢复 使用一键备份工具:
1 2 3 4 5 6 7 8 9 10 git clone https://github.com/wukongdaily/OpenBackRestore.git cd OpenBackRestorechmod +x backup.sh./backup.sh ls -la /tmp/backup/
🖥️ 物理机安装方法 使用 DD 命令写入 1 2 3 4 5 6 7 8 9 fdisk -l dd if =immortalwrt.img of=/dev/sdX bs=4M status=progresssync fdisk -l /dev/sdX
使用 Etcher 工具
下载 Balena Etcher
选择镜像文件
选择目标磁盘
点击 Flash 开始写入
使用 Ventoy 启动
准备 Ventoy U盘
将镜像文件拷贝到 U盘
从 U盘启动选择镜像安装
☁️ 虚拟机部署 Proxmox VE 部署 1 2 3 4 5 6 7 8 9 10 11 12 13 qm create 100 --name immortalwrt --memory 512 --net0 virtio,bridge=vmbr0 qm importdisk 100 immortalwrt.img local-lvm qm set 100 --scsihw virtio-scsi-pci --scsi0 local-lvm:vm-100-disk-0 qm set 100 --boot c --bootdisk scsi0 qm set 100 --serial0 socket --vga serial0 qm start 100
VMware/VirtualBox 部署
创建新虚拟机
选择 Linux 2.6.x 32-bit
使用现有虚拟磁盘文件
调整网络设置(桥接模式)
启动并配置
⚡ 七、优化与技巧 🎨 主题优化配置 1 2 3 4 5 6 7 8 9 10 11 12 13 14 opkg update opkg install \ luci-theme-argon \ luci-app-argon-config \ luci-i18n-argon-config-zh-cn uci set luci.main.mediaurlbase='/luci-static/argon' uci set luci.main.lang='zh_cn' uci commit luci /etc/init.d/uhttpd restart
🔧 性能调优设置 系统参数优化 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 echo "options timeout:1 attempts:2 rotate" >> /etc/resolv.confecho "fs.file-max = 524288" >> /etc/sysctl.confcat >> /etc/sysctl.conf << 'EOF' net.core.rmem_max = 67108864 net.core.wmem_max = 67108864 net.core.netdev_max_backlog = 250000 net.core.somaxconn = 4096 net.ipv4.tcp_syncookies = 1 net.ipv4.tcp_tw_reuse = 1 net.ipv4.tcp_fin_timeout = 30 net.ipv4.tcp_keepalive_time = 1200 EOF sysctl -p
内存优化 1 2 3 4 5 6 7 8 9 10 11 echo "vm.swappiness = 10" >> /etc/sysctl.confcat > /usr/bin/clearcache << 'EOF' sync echo 3 > /proc/sys/vm/drop_cachesecho "内存缓存已清理" EOF chmod +x /usr/bin/clearcache
📱 移动端优化 1 2 3 4 5 6 7 8 9 10 11 12 uci set luci.main.mediaurlbase='/luci-static/argon' uci set luci.main.responsive='1' uci commit luci opkg install luci-compat if [ -f /usr/lib/lua/luci/view/argon/mobile.htm ]; then ln -sf /usr/lib/lua/luci/view/argon/mobile.htm /www/index.html fi
🛡️ 安全加固 SSH 安全配置 1 2 3 4 5 6 7 8 9 10 11 12 13 uci set dropbear.@dropbear[0].RootLogin='0' uci set dropbear.@dropbear[0].PasswordAuth='off' uci commit dropbear /etc/init.d/dropbear restart useradd -m -s /bin/bash admin passwd admin opkg install sudo echo "admin ALL=(ALL) ALL" >> /etc/sudoers
防火墙加固 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 uci set uhttpd.main.listen_http='0.0.0.0:80' uci set uhttpd.main.listen_https='0.0.0.0:443' uci commit uhttpd uci add firewall rule uci set firewall.@rule[-1].name='Allow-WAN-HTTP' uci set firewall.@rule[-1].src='wan' uci set firewall.@rule[-1].proto='tcp' uci set firewall.@rule[-1].dest_port='80' uci set firewall.@rule[-1].target='ACCEPT' uci add firewall rule uci set firewall.@rule[-1].name='Allow-WAN-HTTPS' uci set firewall.@rule[-1].src='wan' uci set firewall.@rule[-1].proto='tcp' uci set firewall.@rule[-1].dest_port='443' uci set firewall.@rule[-1].target='ACCEPT' uci commit firewall
📊 监控与日志 系统监控设置 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 opkg install \ luci-app-statistics \ collectd \ collectd-mod-cpu \ collectd-mod-memory \ collectd-mod-interface uci set luci_statistics.collectd_interval=10 uci set luci_statistics.rrdtool=1 uci commit luci_statistics /etc/init.d/collectd enable /etc/init.d/collectd start
日志管理 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 cat > /etc/logrotate.conf << 'EOF' /var/log/messages /var/log/daemon.log /var/log/system.log { daily rotate 7 missingok notifempty compress delaycompress sharedscripts postrotate /etc/init.d/rsyslog reload >/dev/null 2>&1 || true endscript } EOF cat > /usr/bin/cleanlogs << 'EOF' find /var/log -name "*.log" -mtime +7 -delete find /var/log -name "*.gz" -mtime +30 -delete echo "日志文件已清理" EOF chmod +x /usr/bin/cleanlogs
⚠️ 八、注意事项 🔴 重要警告
💾 备份数据 : 刷机前务必备份原有配置
1 2 3 4 sysupgrade -b /tmp/backup.tar.gz tar -czf /tmp/config-backup.tar.gz /etc/config/
🔌 电源稳定 : 确保刷机过程中不断电
📶 网络连接 : 编译和下载需要稳定网络
⚡ 兼容性 : 确认硬件兼容性再刷机
✅ 最佳实践
🧪 测试环境 : 先在虚拟机测试新固件
1 2 qemu-system-x86_64 -m 512 -hda immortalwrt.img -nographic
📝 记录配置 : 记录所有自定义配置
1 2 3 uci show > /root/uci-config-backup.txt opkg list-installed > /root/packages-backup.txt
⏰ 维护窗口 : 在业务低峰期进行更新
🔧 逐步更新 : 每次只更改一个配置项测试
🐛 常见问题解决 启动失败问题 1 2 3 4 5 6 7 8 dmesg | tail -50 logread -e error 1. 从备份镜像启动 2. 使用恢复控制台 3. 重新刷写固件
网络异常问题 1 2 3 4 5 6 7 8 ifconfig route -n ping -c 4 8.8.8.8 /etc/init.d/network restart rm -f /etc/config/network && firstboot -y
空间不足问题 1 2 3 4 5 6 7 df -hdu -sh /overlay/*rm -rf /tmp/*opkg clean
软件冲突问题 1 2 3 4 5 opkg list-installed | grep -E '(dns|vpn|proxy)' opkg remove --force-removal-of-dependent-packages <package-name>
📋 编译检查清单
[ ] 确认目标平台和版本
[ ] 选择需要的软件包
[ ] 配置首次启动脚本
[ ] 准备扩容所需工具
[ ] 备份原有系统和配置
[ ] 安排合适的维护时间
[ ] 准备恢复方案
[ ] 通知相关用户
🔧 故障恢复方案 快速恢复步骤
连接串口控制台
进入恢复模式
重新刷写固件
恢复配置文件
紧急恢复工具 1 2 3 4 5 wget https://downloads.immortalwrt.org/releases/23.05.4/targets/x86/64/immortalwrt-23.05.4-x86-64-generic-ext4-combined.img.gz dd if =immortalwrt.img of=/dev/sdX bs=4M status=progress
💡 专业提示 : 建议在投入生产环境前,先在测试设备上充分验证新固件的稳定性和兼容性。定期检查 ImmortalWrt 的更新,及时获取安全补丁和功能改进。
Happy Building! 🎉 祝您编译顺利!
📚 扩展资源
❓ 常见问题解答 Q: 编译过程中出现错误怎么办? A: 查看编译日志中的具体错误信息,通常缺少依赖包或配置错误。可以尝试 make -j1 V=s
来获取详细错误信息。
Q: 如何添加自定义软件包? A: 在 package/
目录下创建自定义软件包目录,编写 Makefile,然后在 make menuconfig
中选择。
Q: 固件太大无法写入怎么办? A: 移除不必要的软件包,或者使用 squashfs 格式的固件,它支持 overlay 分区扩展。
Q: 如何更新 ImmortalWrt 系统? A: 使用 sysupgrade
命令:sysupgrade -n /path/to/new-firmware.bin
Q: 忘记 Luci 密码怎么办? A: 通过 SSH 登录后使用 passwd
命令重置密码,或者使用恢复模式重设。