Skip to content
This repository was archived by the owner on Feb 27, 2023. It is now read-only.

[feature request] Default OS and Timeout #168

Closed
mhtrinh opened this issue Jan 12, 2014 · 21 comments
Closed

[feature request] Default OS and Timeout #168

mhtrinh opened this issue Jan 12, 2014 · 21 comments

Comments

@mhtrinh
Copy link

mhtrinh commented Jan 12, 2014

I would like to suggest those feature for NOOBS:

  • set a default OS to boot (and still keep the feature boot to OS from last time)
  • set timeout for default OS
@lurch
Copy link
Collaborator

lurch commented Jan 13, 2014

I'm not entirely sure what you mean by "set a default OS to boot (and still keep the feature boot to OS from last time)" - NOOBS already has exactly that functionality https://github.com/raspberrypi/noobs#how-to-change-the-default-language-keyboard-layout-display-mode-or-boot-partition

And regarding "set timeout for default OS" - NOOBS does have a timeout already, of 10 seconds :) Do you mean you want to be able to change the timeout, or did you mean something else?

@mhtrinh
Copy link
Author

mhtrinh commented Jan 13, 2014

About setting default OS :

About the timeout : yes, I mean giving the possibility to change the 10s timeout to some user define timeout (like 1s, just enough to go on rescue mode if needed)

@lurch
Copy link
Collaborator

lurch commented Jan 13, 2014

"It still boot to the last selected OS." - isn't that exactly what you asked for in your original request? "keep the feature boot to OS from last time".
Perhaps we've got our wires crossed, and you need to explain in more detail exactly what you're asking for?

The activation of rescue mode "press shift..." happens before the NOOBS application itself loads, so is independent of any OS-selection-timeout in NOOBS. You can set the 'timeout' to zero by only installing one OS from within NOOBS ;-)

@mhtrinh
Copy link
Author

mhtrinh commented Jan 13, 2014

I will try to explain again : what I want to suggest is a bit similar to what you have before in grub (grub2, I still don't understand how to configure to boot to last selected ...). It would be great if you have a default_os parameter like this :
default_os=last : it will boot to the last selected OS
default_os=5 : it will boot to partition 5, no matter what you last choosen
default_os=7 : it will boot to partition 7, no matter what you last choosen

timeout=-1 : wait for user to choose an OS (wait infinite)
timeout=5 : wait for 5s and boot on the OS depending on default_os ( if the Shift key is pressed, boot to NOOBS rescue : edit config file, install/re-install OS, ...)
timeout=0 : wait for 0s and boot on the OS depending on default_os (but if the Shift key is pressed, boot to NOOBS rescue : edit config file, install/re-install OS, ...)

The current situation :

  • Timeout is hardcoded to 10 as I understand.
  • with autoboot.txt present in the first FAT partition, the RPi read the partition number and boot from it. The Shift key pressed is ignored (I didn't manage to bring the NOOBS rescue when autoboot.txt is present. I have keyboard through a USB hub, may be why ??)
  • putting "partition=#" in 'recovery.cmdline' is not doing what I expected. When booting in NOOBS, it always select the last booted OS and not the one mentionned in 'recovery.cmdline'. (is this parameter, 'partition' in 'recovery.cmdline' deprecated ?? In that case, we should remove it from the README https://github.com/raspberrypi/noobs#how-to-change-the-default-language-keyboard-layout-display-mode-or-boot-partition)

@lurch
Copy link
Collaborator

lurch commented Jan 13, 2014

Thanks for the more detailed explanation, I can see what you're asking for now. Although it should be quite obvious that NOOBS and GRUB are very different things ;-)

  • "Timeout is hardcoded to 10 as I understand." - correct, if you have more than one OS installed. If you have just the one OS installed, the timeout is zero. (but if you've got more than one OS installed, and you haven't booted any of them yet, the timeout is infinite)
  • "with autoboot.txt .... the Shift keypress is ignored" - correct, I believe autoboot.txt is read and acted upon directly by start.elf / recovery.elf i.e. before the NOOBS application has even started
  • "putting "partition=#" in 'recovery.cmdline' is not doing what I expected" - it does work, but only when you haven't booted any other OS yet. If you have booted any of the OSes, it always uses the last-booted-OS as the default. Which is exactly what the README says with "these defaults will be overwritten by any changes made in the GUI", although it's perhaps not the best wording. (in case you're curious, the last-booted-OS is stored in the settings partition /dev/mmcblk0p3)

One of the problems I can foresee with allowing the user to set a default_partition, might be if a user installs e.g. Pidora and Raspbian (which might put Pidora on partition 5 and Raspbian on partition 7), and then they set the default_partition to 7, and then later on they use recovery mode to install just Raspbian (pushing it down to partition 5, with no partition 7), but the default partition is still set to 7...

Just out of interest, what problem is the current behaviour of always-booting-the-last-OS causing? After all, the primary goal of NOOBS is to make life simple for noobs, so we don't want to overcomplicate it too much ;)

@mhtrinh
Copy link
Author

mhtrinh commented Jan 13, 2014

Thanks for the explanation. I know now how it really works (I was just guessing from observation. A bit lazy to read trhough the NOOBS coce :-p )

The features that I suggested would be for experienced linux user.
As you will need to manually edit file and probably mounting it (my Xfce does not mount the fat partition containing NOOBS but it automatically mount some others partition ... weird ... )
So yes if the user remove one OS from the SD card, he will have to manually update the setting in the file. He have to know wht he is doing ...

We will still keep the current features (like boot to last selected) because it is great and user friendly. What you guys done is great. You make the RPI an "one-click-button" computer !! So it is good to keep it like that.

My philosophy is to keep what is working and friendly (high priority) and add possibility to advanced user to tweak. It is not always possible because it takes time and work. I understand that. That why it is just a suggestion.

And for why those features: in my case, I want to deploy the RPi to different places. It will have the main, every day, OS on an USB drive (much faster and reliable than SD card). And another OS on sdcard as a rescue OS (kind of live CD rescue ...). Daily, the RPi will boot to the main OS, with an 0s timeout.
But if one day, RPi don't boot for whatever reason that may be related to the usb drive, I (or somebody more-less experienced with linux) can still boot to the sdcard and check what wrong (and why not even by ssh ...)
I can almost do that if I can set the timeout to 0s. (and that why I'm trying to build NOOBS on my machine and got some issues :p)

Cheers,

@lurch
Copy link
Collaborator

lurch commented Jan 14, 2014

For your specific scenario, I guess you could install the same OS to both the SDcard and to the USB drive, so as far as NOOBS is concerned there's only one OS available (and hence a zero-second timeout). And then you could switch between loading your root filesystem from sd-card or from usb-drive by pressing SHIFT and using NOOBS's built-in config editor to change the root= parameter of cmdline.txt ;-)
(but then you may have problems down the road when the kernel modules in one of the rootfs partitions get out of sync with an upgraded kernel.img on the boot partition)

BTW the build issues you're finding are a good thing - much better to find and fix bugs, than have them lurking around undetected :)

@mhtrinh
Copy link
Author

mhtrinh commented Jan 14, 2014

And then you could switch between loading your root filesystem from sd-card or from usb-drive by pressing SHIFT and using NOOBS's built-in config editor to change the root= parameter of cmdline.txt ;-)
(but then you may have problems down the road when the kernel modules in one of the rootfs partitions get out of sync with an upgraded kernel.img on the boot partition)

Haha ! That is exactly what I am doing right now ! (meanwhile successfully build and hack NOOBS)
And yes, I also aware about the out sync kernel module possibility. For that I use different kernel naming (from 'kernel=' in 'config.txt', and thanks for making it possible, and not hard coded somewhere !!!)

BTW the build issues you're finding are a good thing - much better to find and fix bugs, than have them lurking around undetected :)

No worry, happy to help :D

@lurch
Copy link
Collaborator

lurch commented Jan 14, 2014

Cool :-)

@Ruffio
Copy link

Ruffio commented Jun 27, 2015

@mhtrinh is this still an issue?

@mhtrinh
Copy link
Author

mhtrinh commented Jun 28, 2015

Because NOOBS lack this feature, I end up using another way to do it. If some day this feature end up in Noobs, then I will probably use it.
But it seems I'm the only one who need this ...

@robgjansen
Copy link

I would very much like the ability to make the default OS sticky, rather than always automatically updating the default OS to the last-selected OS. I like the option suggested here:

default_partition_to_boot=last # boot to last selected OS
default_partition_to_boot=5 # boot to partition 5, no matter the last selected OS

The use case is when the user is dual-booting where one installed OS does not require a graphical interface (e.g., raspbian lite, and/or pidora configured with runlevel 3) and one installed OS does require a graphical interface (e.g., OpenELEC, and/or RetroPie).

When the non-graphical OS is the main OS and primarily accessed through a serial cable, it gets very annoying to boot back into that after, e.g., connecting to the TV to play a game in RetroPie. Currently, the user would need to boot back into raspbian from the TV to make sure the default is updated before going back to the serial cable method, or otherwise figure out how to get to the correct partition to update the setting manually.

Concerning the issue raised about booting into a non-existent partition: I believe that is a rare condition and should be testable programmatically. If the default partition doesn't exit, we can go back to the "last" setting again.

@robgjansen
Copy link

One way to implement this:

default_partition_to_boot=5 would boot partition 5, and auto-update the setting to the last-selected OS (current behavior), and then default_partition_to_boot=-5 would also boot partition 5, but there would be no auto-update of the setting.

To handle the "partition does not exist problem", in that case we can boot into recovery, since that is always in partition 1.

robgjansen added a commit to robgjansen/noobs that referenced this issue Mar 19, 2016
default_partition_to_boot=5 would boot partition 5, and auto-update
the setting to the last-selected OS (current behavior), and then
default_partition_to_boot=-5 would also boot partition 5, but there
would be no auto-update of the setting.

refs raspberrypi#168
robgjansen added a commit to robgjansen/noobs that referenced this issue Mar 19, 2016
if default_boot_timeout is given in noobs.conf, it will be used
to set the timeout before booting the selected OS.

refs raspberrypi#168
@robgjansen robgjansen mentioned this issue Mar 19, 2016
@procount
Copy link
Contributor

procount commented Jan 6, 2017

I have implemented my take on this requirement in PINN.
Please look in https://sourceforge.net/projects/pinn/files/testing/ and use pinn-212a.zip in the same way as noobs-lite.
By adding 'bootmenutimeout=X' to recovery.cmdline you can change the OS boot selection menu timeout to X seconds.
The boot selection dialog now has a checkbox next to each installed OS. Only one can be checked at a time. The checked OS becomes the default sticky OS that is booted on each boot with no intervention, regardless of the last OS chosen. When a 'sticky' OS is set, then the menu timeout will drop to 1 second, giving just enough time to hit a key to choose another OS to be booted on the next boot only.
It's not quite as I want it yet, but I just wanted to throw this proof of concept out there to see what people thought about it.

@procount
Copy link
Contributor

procount commented Jan 6, 2017

On https://sourceforge.net/projects/pinn/files/testing/ I have deleted pinn-212a.zip and replaced it with pinn-212b.zip which works much better.
Here are the new features:

  1. By adding 'bootmenutimeout=X' to recovery.cmdline you can change the OS boot selection menu timeout to X seconds.
  2. On the OS Boot Selection dialog, ONE of the installed OSes may be checked to make it a sticky default OS. On subsequent boots, this is the OS that will be booted automatically without delay, if the user does not interact with the system. The user may still hold shift, press the Left mouse key, CEC remote key, or touch the touchscreen to enter the main dialog menu. Exiting from here will still go to the boot selection dialog to choose another OS to boot or change the default OS. An OS chosen here will boot once, but if a default OS is set, that will be used on following boots.
  3. If no sticky flags are set, the boot sequence operates as before, except bootmenutimeout is used for the timeout.
  4. The title bar indicates PINN.
  5. A left mouse click will now also halt the boot and enter the main dialog (just like the shift key).

Comments welcome. I should be able to adapt this to NOOBS as well and create a PR if there is enough interest.

@procount
Copy link
Contributor

These features are now released in PINN p2.1.2

@XECDesign
Copy link
Contributor

No plans to add this to NOOBS.

@korokinopio
Copy link

One other reason for the boot menu time out option is for people who don't have the dexterity to select the OS they want in the 10 time limit.
I'll use an example from my own life.
I just set my elderly father up with a RPi to act as a media box.
It currently has raspbian and libreelec installed on it
Because it's a media box, it's hidden behind his TV
The has a wireless air mouse connected to it
At his age, the 10 seconds is just about not enough for him to select the different OS

I wouldn't necessarily need the default OS settings, except that he would be running it most often in libreelec, so cutting the number of times he has to select an OS down by half might not be a bad thing

@procount
Copy link
Contributor

procount commented Dec 3, 2018

In NOOBS you have the forcetrigger option which will provide indefinite time but it needs more mouse clicks even in the default case.

If you need the adjustable menu timeout, try PINN, which has that plus a lot more options, but is otherwise compatible with NOOBS and will look familiar.

@biswaKL
Copy link

biswaKL commented Dec 9, 2018

In NOOBS you have the forcetrigger option which will provide indefinite time but it needs more mouse clicks even in the default case.

If you need the adjustable menu timeout, try PINN, which has that plus a lot more options, but is otherwise compatible with NOOBS and will look familiar.

Thanks @procount , its working like a charm.
One thing to notice that it will only trigger if the os release date is greater than os installed date.

@procount
Copy link
Contributor

procount commented Dec 9, 2018

What is working like a charm - forcetrigger or PINN?

Forcetrigger will ALWAYS force the recovery menu to be shown regardless of any dates.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

8 participants