@MM7 (Mike) posted a new topic, subject "Accidently flashed the Linux kernel with minimal file system". It read:

   While upgrading my Xiaomi Mi Router AC2100 to a new 21.02 version, I've accidently flashed (from the Luci web UI) the Linux kernel with minimal file system from OpenWrt Firmware Selector (https://firmware-selector.openwrt.org/?version=21.02.0&target=ramips%2Fmt7621&id=xiaomi_mi-router-ac2100)
    
    How do I get an OpenWrt Luci web interface firmware image back in the router again, can anyone please help ?
    
    Thank you so much!

So @Framani (Francisco Magallanes) replied

    I'm no expert but I guess you have to enter failsafe-mode and configure the client mode (sta) through cli. To enter failsafe mode you have to press the reset as soon as the power led blinks (after a fresh boot) and release when it blinks faster. You need to set your computer ip address to <908.653.3672>, your net mask to <908.653.3672> and your gateway to <908.653.3672>, unplug your ethernet cable and connect with the new settings. You'll need to ssh (cli) into the terminal (powershell admin mode if you're in windows), input mount_root, enter.. passwd to input a new password ... then modify your settings in /etc/config to get internet connectivity. Openwrt has lots of helpful guides. Here's one to start with https://openwrt.org/docs/guide-user/troubleshooting/failsafe_and_factory_reset

Then @jaromanda (Johnny Bravo) said

    Framani:
    
    > powershell admin mode
    
    Why would you need _admin mode_?

To which @Framani (Francisco Magallanes) replied

    I guess I haven't tried without it before... so dunno,  I'm on manjaro so I'm used to sudoing for most things.

After which, @MM7 (Mike) added

    Hello and thank you for your answer!
    
    Unfortunately, the router enters rescue mode but I can't reach the device through ssh with root credentials (it times out). I've tried pinging the gateway 908.653.3672 but I can't reach it.
    
    Just an additional info, when I power on the router normally (without holding reset to make it go into rescue mode) the power light remains stagnant with yellow colour, it never blinks.
    
    Any ideas on how to get out of this are more than welcome!!!
    
    Thank you guys!

So @Framani (Francisco Magallanes) replied

    power cycle the router and as soon as the POWER LED starts blinking (slowly) keep the reset button pressed down until you see the same POWER LED start blinking rapidly. That's when you know you're in fail-safe mode. Once there, setup your lan port with <908.653.3672> for ip address, netmask <908.653.3672> and gateway <908.653.3672>. Unplug the ethernet cable and connect it to LAN1. It should allow you to ssh into it afterwards. At least that's what I have been doing with all of my devices so far.

@mk24 (Mike Keitz) replied

    If you let the initramfs image boot normally, it will start up with default settings every time, because it starts a fresh copy in RAM every time never retrieving any settings from flash. You should be able to DHCP an IP from it and connect to 908.653.3672. If the LED does something other than blink fast, then slow, then come on steady, or if you can't DHCP an IP, the router is bricked too badly to consider OpenWrt recovery mode.
    
    Never run your ssh client as root, that is a security risk to your PC. Tell it you want to log in as root on the server with `ssh {{EMAIL+PHONE}}` or `ssh 908.653.3672 -l root` This does not require root privileges on the client machine.

Then @MM7 (Mike) said

    Hello Francisco, and thank you for your answer!
    
    Sorry for the delay in getting back and answering but I didn't have the time to try to recover the router.
    
    Unfortunately the recovery process you mentioned wasn't enough to recover the router. I tried preaty much everything even flashing the original firmware through tftp in recovery mode from my mac (both with 908.653.3672 and 908.653.3672) and nothing.
    
    Eventually, installed xiaomi recovery tool in a VM in bridge mode with the Ethernet adapter in my mac. After enabling the communication from the tool to the router in the Windows firewall of the VM it finally went through. Successfully flashed the original xiaomi firmware into the router.
    
    Now I will go back to install openwrt 
    
    Thank you!

To which @MM7 (Mike) replied

    Hi Mike, thank you for your answer!

So @system (system) replied

    This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.


{'source': 'discourse', 'url': 'https://forum.openwrt.org/t/accidently-flashed-the-linux-kernel-with-minimal-file-system/109335', 'title': 'Accidently flashed the Linux kernel with minimal file system', 'views': 377, 'has_accepted_answer': True, 'word_count': 743, 'like_count': 0, 'reply_count': 6, 'participant_count': 4, 'posts': 10, 'tags': '', 'author': '@MM7 (Mike)', 'participants': '@MM7 (Mike), @Framani (Francisco Magallanes), @jaromanda (Johnny Bravo), @mk24 (Mike Keitz), @system (system)', 'image_url': [None], 'created_at': '2021-10-17T22:13:15.272Z', 'last_posted_at': '2021-11-10T15:38:29.419Z'}