Giter Club home page Giter Club logo

Comments (7)

mrkiko avatar mrkiko commented on June 2, 2024

Hello!!

If pstore support is enabled, then it should be fairly possible.
Just
sync
and then, proceed with
echo c >/proc/sysrq-trigger

... if you did the mtk-snand transition, you should have no further issues.

from owrt-ubi-installer.

brentr avatar brentr commented on June 2, 2024

That's a cool way to force a boot info recovery without physical access to the router.
If I have physical access to the router, can I not also boot into recovery by holding down the reset button while it powers up?

More importantly...
My impression was that, WHENEVER the router boots into recovery, the normal UBIFS root filesystem gets cleared.

This clearing of the UBIFS is what I'm trying to avoid.
I want to boot into recovery, mount the UBIFS without clearing it, modify it and reboot normally.

If the UBIFS is not cleared by booting into recovery, when does it get cleared?

from owrt-ubi-installer.

mrkiko avatar mrkiko commented on June 2, 2024

Hello!!

Maybe you could be interested in FailSafe mode? It can be entered later on in the boot process, see
https://openwrt.org/docs/guide-user/troubleshooting/failsafe_and_factory_reset

That said, you can always play with the u-boot environment to change the device behaviour.

Then, depending on whether you are running an u-boot before openwrt.git commit
349e2b7e658290f967a4aab4fd9d754572f9b0b2
or after, behaviour might change. See that commit's commit message for further details.
I admit I have still some difficulties in following the flow of the environment code.

from owrt-ubi-installer.

brentr avatar brentr commented on June 2, 2024

failsafe mode should work well for me. Thank you!

Looking at the output for fw_printenv, I see that I'm running U-Boot 2021.04 (Aug 27 2021...)
This includes the definition for:
bootcmd=if pstore check ; then run boot_recovery ; else run boot_ubi ; fi

Will running "boot_recovery" will clear the production UBIFS, or will it leave it intact?

It seems that u-boot has been modified so "boot_first" somehow runs before "bootcmd":
boot_first=if button reset ; then led $bootled_rec on ; run boot_tftp_recovery ; setenv flag_recover 1 ; run boot_default ; fi ; bootmenu
--> This appears to be the logic booting to recovery if the reset button is pressed.

However, what is reading the 'boot_first' env variable?
I can't seem to find any reference to 'boot_first' in the u-boot sources either.

from owrt-ubi-installer.

dangowrt avatar dangowrt commented on June 2, 2024

Will running "boot_recovery" will clear the production UBIFS, or will it leave it intact?

boot_recovery will not wipe or otherwise destroy the existing rootfs_data nor anything else. only if the recovery image is missing or broken, the bootloader will try to load it via TFTP and then write it to flash. In order to make sure there is enough space, rootfs_data is being deleted at this point. However, this should really only happen in case you somehow broke the recovery image stored in flash by the installer, and even in that case, it should happen only once.

Regarding the logic of the button:
There is a patch which makes the bootloader reset the environment in case it is held down during boot:

https://github.com/openwrt/openwrt/blob/master/package/boot/uboot-mediatek/patches/300-mt7622-generic-reset-button-ignore-env.patch

Regarding the complete default environment (to answer your question "what is calling boot_first?"), find it here:
https://github.com/openwrt/openwrt/blob/master/package/boot/uboot-mediatek/patches/410-add-linksys-e8450.patch#L349

from owrt-ubi-installer.

brentr avatar brentr commented on June 2, 2024

That's a relief. Thanks.

If I understand these u-boot env definitions, one must apply the 300-mt7622-generic-reset-button-ignore-env.patch to enable pressing reset during power up to reach the boot_first definition, as it is only referenced by _firstboot, which deletes itself during the first boot after the env is initialized.

Correct?

If so, is there any reason not to allow booting recovery without reinitializing the U-Boot environment?
I'm thinking of tweaking the defs such that pressing reset during power up boots to recovery without applying the 300-mt7622-generic-reset-button-ignore-env.patch

from owrt-ubi-installer.

mrkiko avatar mrkiko commented on June 2, 2024

from owrt-ubi-installer.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.