009 Embedded Linux-ARM. StorageQueries and discussion related to usage of Linux on ARM based devices. Linux has been ported to a variety of CPUs which are not only primarily used as the processor of a desktop or server computer, but also ARM, AVR32, ETRAX CRIS, FR-V, H8300, IP7000, m68k, MIPS, mn10300, SuperH, and Xtensa processors, It is also used as an alternative to using a proprietary operating system and toolchain. » 009.04.Boot Loaders
009.04.91.34. Could you walk us through the process of how the `08_fallback_counting` script handles fallback behavior in GRUB2? How does it determine when to switch to a fallback boot entry based on boot success or failure?
PROCESS OF FUNCTIONING OF FALLBACK BEHAVIOUR BY `FALLBACK_COUNTING` SCRIPT -
Two environment variables `boot_counter` and `boot_success` are used for above process.
CHECKING BOOT COUNTER AND BOOT SUCCESS - if[ -n "${boot_counter}" -a "${boot_success}"="0" ] then #..( further logic here ) fi
--It checks if `boot_counter` variable is set ( if boot tracking system is in place) and if `boot_success` variable is set to "0" ( boot failure )
{ fallback behaviour code in semantics as described below... }
If `boot_counter` has reached "0" or "-1", the fallback behavour code sets the default boot entry to "1". If `boot_counter` is greater than "0", it decrements the counter by one using the `decrement` command which comes from `increment` module. This variable is saved using `save_env` command.