|
所有的内容都是按照教程来的,除了root的密码没有改成admin
当刷入stock-initramfs-factory.ubi后,重启,路由器就直接变砖了,搜不到WiFi信号,但是蓝灯常量
刷了两次都是这个结果,好在两次丢用救砖工具救回来了
开启telnet,ssh什么的都是一切正常,直到执行下面这条命令,然后重启就没有WiFi了,网线连接也是未识别的网络
ubiformat /dev/mtd8 -y -f /tmp/stock-initramfs-factory.ubi
关于/dev/mtd8 这个位置也使用cat /proc/cmdline 和cat /proc/mtd命令确认过了
刷机log如下
- Xshell 7 (Build 0122)
- Copyright (c) 2020 NetSarang Computer, Inc. All rights reserved.
- Type `help' to learn how to use Xshell prompt.
- [E:\~]$
- Connecting to 192.168.31.1:23...
- Connection established.
- To escape to local shell, press 'Ctrl+Alt+]'.
- BusyBox v1.25.1 (2023-01-30 10:31:26 UTC) built-in shell (ash)
- -----------------------------------------------------
- Welcome to XiaoQiang!
- -----------------------------------------------------
- $$$$$$\ $$$$$$$\ $$$$$$$$\ $$\ $$\ $$$$$$\ $$\ $$\
- $$ __$$\ $$ __$$\ $$ _____| $$ | $$ | $$ __$$\ $$ | $$ |
- $$ / $$ |$$ | $$ |$$ | $$ | $$ | $$ / $$ |$$ |$$ /
- $$$$$$$$ |$$$$$$$ |$$$$$\ $$ | $$ | $$ | $$ |$$$$$ /
- $$ __$$ |$$ __$$< $$ __| $$ | $$ | $$ | $$ |$$ $$<
- $$ | $$ |$$ | $$ |$$ | $$ | $$ | $$ | $$ |$$ |\$$\
- $$ | $$ |$$ | $$ |$$$$$$$$\ $$$$$$$$$ | $$$$$$ |$$ | \$$\
- \__| \__|\__| \__|\________| \_________/ \______/ \__| \__|
- root@XiaoQiang:/# echo -e '123456qwer.\n123456qwer.' | passwd root
- Changing password for root
- New password:
- Retype password:
- passwd: password for root changed by root
- root@XiaoQiang:/# nvram set ssh_en=1
- root@XiaoQiang:/# nvram set telnet_en=1
- root@XiaoQiang:/# nvram set uart_en=1
- root@XiaoQiang:/# nvram set boot_wait=on
- root@XiaoQiang:/# nvram commit
- root@XiaoQiang:/# mkdir /data/auto_ssh && cd /data/auto_ssh
- root@XiaoQiang:/data/auto_ssh# curl -O https://cdn.jsdelivr.net/gh/lemoeo/AX6S@main/auto_ssh.sh
- % Total % Received % Xferd Average Speed Time Time Time Current
- Dload Upload Total Spent Left Speed
- 100 2455 0 2455 0 0 2438 0 --:--:-- 0:00:01 --:--:-- 2462
- root@XiaoQiang:/data/auto_ssh# chmod +x auto_ssh.sh
- root@XiaoQiang:/data/auto_ssh# ls
- auto_ssh.sh
- root@XiaoQiang:/data/auto_ssh# cat auto_ssh.sh
- #!/bin/sh
- auto_ssh_dir="/data/auto_ssh"
- host_key="/etc/dropbear/dropbear_rsa_host_key"
- host_key_bk="${auto_ssh_dir}/dropbear_rsa_host_key"
- unlock() {
- # Restore the host key.
- [ -f $host_key_bk ] && ln -sf $host_key_bk $host_key
- # Enable telnet, ssh, uart and boot_wait.
- [ "$(nvram get telnet_en)" = 0 ] && nvram set telnet_en=1 && nvram commit
- [ "$(nvram get ssh_en)" = 0 ] && nvram set ssh_en=1 && nvram commit
- [ "$(nvram get uart_en)" = 0 ] && nvram set uart_en=1 && nvram commit
- [ "$(nvram get boot_wait)" = "off" ] && nvram set boot_wait=on && nvram commit
- [ "`uci -c /usr/share/xiaoqiang get xiaoqiang_version.version.CHANNEL`" != 'stable' ] && {
- uci -c /usr/share/xiaoqiang set xiaoqiang_version.version.CHANNEL='stable'
- uci -c /usr/share/xiaoqiang commit xiaoqiang_version.version 2>/dev/null
- }
- channel=`/sbin/uci get /usr/share/xiaoqiang/xiaoqiang_version.version.CHANNEL`
- if [ "$channel" = "release" ]; then
- sed -i 's/channel=.*/channel="debug"/g' /etc/init.d/dropbear
- fi
- if [ -z "$(pidof dropbear)" -o -z "$(netstat -ntul | grep :22)" ]; then
- /etc/init.d/dropbear restart 2>/dev/null
- /etc/init.d/dropbear enable
- fi
- }
- install() {
- # unlock SSH.
- unlock
- # host key is empty, restart dropbear to generate the host key.
- [ -s $host_key ] || /etc/init.d/dropbear restart 2>/dev/null
- # Backup the host key.
- if [ ! -s $host_key_bk ]; then
- i=0
- while [ $i -le 30 ]
- do
- if [ -s $host_key ]; then
- cp -f $host_key $host_key_bk 2>/dev/null
- break
- fi
- let i++
- sleep 1s
- done
- fi
- # Add script to system autostart
- uci set firewall.auto_ssh=include
- uci set firewall.auto_ssh.type='script'
- uci set firewall.auto_ssh.path="${auto_ssh_dir}/auto_ssh.sh"
- uci set firewall.auto_ssh.enabled='1'
- uci commit firewall
- echo -e "\033[32m SSH unlock complete. \033[0m"
- }
- uninstall() {
- # Remove scripts from system autostart
- uci delete firewall.auto_ssh
- uci commit firewall
- echo -e "\033[33m SSH unlock has been removed. \033[0m"
- }
- main() {
- [ -z "$1" ] && unlock && return
- case "$1" in
- install)
- install
- ;;
- uninstall)
- uninstall
- ;;
- *)
- echo -e "\033[31m Unknown parameter: $1 \033[0m"
- return 1
- ;;
- esac
- }
- main "$@"root@XiaoQiang:/data/auto_ssh# uci set firewall.auto_ssh=include
- root@XiaoQiang:/data/auto_ssh# uci set firewall.auto_ssh.type='script'
- root@XiaoQiang:/data/auto_ssh# uci set firewall.auto_ssh.path='/data/auto_ssh/auto_ssh.sh'
- root@XiaoQiang:/data/auto_ssh# uci set firewall.auto_ssh.enabled='1'
- root@XiaoQiang:/data/auto_ssh# uci commit firewall
- root@XiaoQiang:/data/auto_ssh# mtd erase crash
- Unlocking crash ...
- Erasing crash ...
- root@XiaoQiang:/data/auto_ssh# reboot
- root@XiaoQiang:/data/auto_ssh#
- Socket error Event: 32 Error: 10053.
- Connection closing...Socket close.
- Connection closed by foreign host.
- Disconnected from remote host(AX6000) at 09:55:20.
- Type `help' to learn how to use Xshell prompt.
- [E:\~]$
- Connecting to 192.168.31.1:22...
- Connection established.
- To escape to local shell, press 'Ctrl+Alt+]'.
- sh: /usr/bin/xauth: not found
- BusyBox v1.25.1 (2023-01-30 10:31:26 UTC) built-in shell (ash)
- -----------------------------------------------------
- Welcome to XiaoQiang!
- -----------------------------------------------------
- $$$$$$\ $$$$$$$\ $$$$$$$$\ $$\ $$\ $$$$$$\ $$\ $$\
- $$ __$$\ $$ __$$\ $$ _____| $$ | $$ | $$ __$$\ $$ | $$ |
- $$ / $$ |$$ | $$ |$$ | $$ | $$ | $$ / $$ |$$ |$$ /
- $$$$$$$$ |$$$$$$$ |$$$$$\ $$ | $$ | $$ | $$ |$$$$$ /
- $$ __$$ |$$ __$$< $$ __| $$ | $$ | $$ | $$ |$$ $$<
- $$ | $$ |$$ | $$ |$$ | $$ | $$ | $$ | $$ |$$ |\$$\
- $$ | $$ |$$ | $$ |$$$$$$$$\ $$$$$$$$$ | $$$$$$ |$$ | \$$\
- \__| \__|\__| \__|\________| \_________/ \______/ \__| \__|
- root@XiaoQiang:~# cat /proc/cmdline
- console=ttyS0,115200n1 loglevel=8 firmware=0 uart_en=1
- root@XiaoQiang:~#
- Connection closed.
- Disconnected from remote host(Ax6000_SSH) at 10:16:50.
- Type `help' to learn how to use Xshell prompt.
- [E:\~]$
- Connecting to 192.168.31.1:22...
- Connection established.
- To escape to local shell, press 'Ctrl+Alt+]'.
- sh: /usr/bin/xauth: not found
- BusyBox v1.25.1 (2023-01-30 10:31:26 UTC) built-in shell (ash)
- -----------------------------------------------------
- Welcome to XiaoQiang!
- -----------------------------------------------------
- $$$$$$\ $$$$$$$\ $$$$$$$$\ $$\ $$\ $$$$$$\ $$\ $$\
- $$ __$$\ $$ __$$\ $$ _____| $$ | $$ | $$ __$$\ $$ | $$ |
- $$ / $$ |$$ | $$ |$$ | $$ | $$ | $$ / $$ |$$ |$$ /
- $$$$$$$$ |$$$$$$$ |$$$$$\ $$ | $$ | $$ | $$ |$$$$$ /
- $$ __$$ |$$ __$$< $$ __| $$ | $$ | $$ | $$ |$$ $$<
- $$ | $$ |$$ | $$ |$$ | $$ | $$ | $$ | $$ |$$ |\$$\
- $$ | $$ |$$ | $$ |$$$$$$$$\ $$$$$$$$$ | $$$$$$ |$$ | \$$\
- \__| \__|\__| \__|\________| \_________/ \______/ \__| \__|
- root@XiaoQiang:~# cd /tmp/
- root@XiaoQiang:/tmp# ls
- 2526.bootcheck.log
- TZ
- arrays
- boot_check_done
- daemon
- dhcp.leases
- diag_net_spd
- dnsmasq.d
- dropbear
- etc
- hosts
- lib
- lock
- log
- logexec
- luci-indexcache
- luci-sessions
- messages
- mi_ip_conflict_pid
- miqos.lock
- mq
- mtk
- ntp.status
- oui
- rc.done
- rc.timing
- resolv.conf
- resolv.conf.auto
- roam.conf
- run
- shm
- spool
- startscene_crontab.lua.PID
- stat_points
- state
- sysinfo
- syslog-ng.ctl
- syslog-ng.persist
- tmp
- uploadfiles
- x-wrt-23.06-b202307091202-mediatek-filogic-xiaomi_redmi-router-ax6000-stock-initramfs-factory.ubi
- root@XiaoQiang:/tmp# mv x-wrt-23.06-b202307091202-mediatek-filogic-xiaomi_redmi-router-ax6000-stock-initramfs-factory.ubi intramfs-facto
- ry.ubi
- root@XiaoQiang:/tmp# ls
- 2526.bootcheck.log intramfs-factory.ubi mtk startscene_crontab.lua.PID
- TZ lib ntp.status stat_points
- arrays lock oui state
- boot_check_done log rc.done sysinfo
- daemon logexec rc.timing syslog-ng.ctl
- dhcp.leases luci-indexcache resolv.conf syslog-ng.persist
- diag_net_spd luci-sessions resolv.conf.auto tmp
- dnsmasq.d messages roam.conf uploadfiles
- dropbear mi_ip_conflict_pid run
- etc miqos.lock shm
- hosts mq spool
- root@XiaoQiang:/tmp# cat /proc/cmdline
- console=ttyS0,115200n1 loglevel=8 firmware=0 uart_en=1
- root@XiaoQiang:/tmp# nvram set boot_wait=on
- root@XiaoQiang:/tmp# nvram set uart_en=1
- root@XiaoQiang:/tmp# nvram set flag_boot_rootfs=1
- root@XiaoQiang:/tmp# nvram set flag_last_success=1
- root@XiaoQiang:/tmp# nvram set flag_boot_success=1
- root@XiaoQiang:/tmp# nvram set flag_try_sys1_failed=0
- root@XiaoQiang:/tmp# nvram set flag_try_sys2_failed=0
- root@XiaoQiang:/tmp# nvram commit
- root@XiaoQiang:/tmp# cat /proc/mtd
- dev: size erasesize name
- mtd0: 08000000 00020000 "spi0.1"
- mtd1: 00100000 00020000 "BL2"
- mtd2: 00040000 00020000 "Nvram"
- mtd3: 00040000 00020000 "Bdata"
- mtd4: 00200000 00020000 "Factory"
- mtd5: 00200000 00020000 "FIP"
- mtd6: 00040000 00020000 "crash"
- mtd7: 00040000 00020000 "crash_log"
- mtd8: 01e00000 00020000 "ubi"
- mtd9: 01e00000 00020000 "ubi1"
- mtd10: 03200000 00020000 "overlay"
- root@XiaoQiang:/tmp# ubiformat /dev/mtd9 -y -f /tmp/intramfs-factory.ubi
- ubiformat: mtd9 (nand), size 31457280 bytes (30.0 MiB), 240 eraseblocks of 131072 bytes (128.0 KiB), min. I/O size 2048 bytes
- libscan: scanning eraseblock 239 -- 100 % complete
- ubiformat: 160 eraseblocks have valid erase counter, mean value is 0
- ubiformat: 80 eraseblocks are supposedly empty
- ubiformat: warning!: only 160 of 240 eraseblocks have valid erase counter
- ubiformat: mean erase counter 0 will be used for the rest of eraseblock
- ubiformat: use erase counter 0 for all eraseblocks
- ubiformat: flashing eraseblock 85 -- 100 % complete
- ubiformat: formatting eraseblock 239 -- 100 % complete
- root@XiaoQiang:/tmp# reboot
- root@XiaoQiang:/tmp# Connection closing...Socket close.
- Connection closed by foreign host.
- Disconnected from remote host(Ax6000_SSH) at 10:42:46.
- Type `help' to learn how to use Xshell prompt.
- [E:\~]$
- Connecting to 192.168.31.1:22...
- Could not connect to '192.168.31.1' (port 22): Connection failed.
- Type `help' to learn how to use Xshell prompt.
- [E:\~]$
复制代码
|
|