View Single Post
Community Council | Posts: 4,920 | Thanked: 12,867 times | Joined on May 2012 @ Southerrn Finland
#1128
Now this problem that @marmistrz got had me thinking a bit of a design problem in ubiboot that need addressing.

If indeed it is possible to get init to trap with an ill-formatted ubiboot.conf file there needs to be a way to get out of this situation gracefully, for example by marking the ubiboot.conf file tainted and not use it on the subsequent boots.

Scenario could be something like this;
  • 1.) set up basic environment
  • 2.) load ubiboot.conf
  • 3.) check if init has trapped 2 times since a clean boot
  • 4.) if not, then use the loaded ubiboot.conf, else mark the ubiboot.conf file bad
  • 5.) continue in OK case, reboot in NOK case.
If init traps after that, a persistent counter is increased before the device is booted.

Basically what happens is if you soup up your ubiboot.conf badly, the device renames it to ubiboot.conf.bad for example and so on the 3rd attempt no configuration file is found and the device goes to maintanance mode.

Actually there is a possibility of using an automatic backup configuration with this kind of setup!
  • since ubiboot searches the partitions in order; 1, 2, 3, 4, ... when looking for a valid ubiboot.conf file, it is now enough to place another ubiboobt.conf and CPIO files to /boot/ of partition 2
  • if a valid file is not found on /boot/ of partition 1, then the system will continue to search from the next partitions
  • this way you can have a copy of the previous proven ubiboot configuration there if you want to experiment, or even a totally different menu layout...
 

The Following 4 Users Say Thank You to juiceme For This Useful Post: