Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Boot menu with XBian versions #7

Open
CurlyMoo opened this issue Apr 14, 2013 · 22 comments
Open

Boot menu with XBian versions #7

CurlyMoo opened this issue Apr 14, 2013 · 22 comments
Assignees

Comments

@CurlyMoo
Copy link
Contributor

I just had a nice idea. Since we are running BTRFS, we can easily create snapshots before each version update (or other package updates). However, not all users report all our updates as an improvement. So, what about creating a boot menu with which we enable users to boot from one of the snapshots created of prior versions? This way, users can always boot from a previous version without reinstalling, and easily update to the next version without reinstalling the latest version again. He just has to boot the last version and update (which again adds another boot menu item). This boot menu can show for about 3 sec. so it doesn't slow down the boot too much.

Something for version 2 i think 😄

@mk01
Copy link
Member

mk01 commented Apr 14, 2013

this is what I'm doing now https://github.com/mk01/btrfs-auto-snapshot ... i need to implement rollback through rename in initramfs and voala...

On 14.4.2013, at 15:05, CurlyMoo [email protected] wrote:

I just had a nice idea. Since we are running BTRFS, we can easily create snapshots before each version update (or other package updates). However, not all users report all our updates as an improvement. So, what about creating a boot menu with which we enable users to boot from one of the snapshots created of prior versions? This way, users can always boot from a previous version without reinstalling, and easily update to the next version without reinstalling the latest version again. He just has to boot the last version and update (which again adds another boot menu item). This boot menu can show for about 3 sec. so it doesn't slow down the boot too much.

Something for version 2 i think


Reply to this email directly or view it on GitHub.

@CurlyMoo
Copy link
Contributor Author

Cool

@mk01
Copy link
Member

mk01 commented Apr 28, 2013

for start perfect would be possibility to load to rescue mode (shell) without messing with device, card, editing ...

currently, there is no bootload for arm, but what about some curl cli hacking. should be possible, not ???

@CurlyMoo
Copy link
Contributor Author

I have no idea what you're trying to ask/explain here :p

@CurlyMoo
Copy link
Contributor Author

But i can of course give my suggestion:

Have a script check all the snapshots that exists of the root partition and load these snapshots in a dialog window. Just like xbian-config-shell does.

Another idea would be to add the possibility for system-restore-points. Let's say someone wants to install a new package through apt. Then the workflow would be:

create-restore-point
apt-get install xbian-package-samba

Now, would this break the boot, the user can be shown a recovery menu with all the restore-points (as in snapshots) available (including the different xbian snapshots like in the boot menu) and start for a previous version. If the users wants to rollback, you can add a script like:

rollback-restore-point 2013-04-29-001

So this would essentially make two boot menu's. One simple menu with only previous XBian versions and an advanced menu with the additional restore-points. The user should then be given the possibility to switch between the two.

@mk01
Copy link
Member

mk01 commented Apr 28, 2013

that currently there is no convenient solution, how to alter booting ! you have to complicatedly use other pcs, moving the media etc.

but what I invented is the shift key, you can hold during booting which will put you into rescue shell immediately - while killing splash as well, restoring text mode. you can do what you need without moving from the raspberry.

and what I wanted to ask, is it too much to have "light" version of xbian-config in initramfs ???

@CurlyMoo
Copy link
Contributor Author

and what I wanted to ask, is it too much to have "light" version of xbian-config in initramfs ???

Of course, it just uses bash and my modified dialog. If you make the language of this light version hard-coded you don't need gettext. The basic xbian-config is just 60kb, the rest are modules. You only need to check if the sed, awk and grep implementations of busybox are the same as the ones i used.

@mk01
Copy link
Member

mk01 commented Apr 28, 2013

I was still hoping you can adapt. What I see there is first RPI with safe boot options provided ad hoc on ones needs.

Plug keyboard, reboot, hold shift, ... a user gui shows with recovery options, partition management, partition copy from device to device, emergency fsck...

@CurlyMoo
Copy link
Contributor Author

Like i told you before, i don't have anymore time to develop. Therefore i put a lot of effort to document everything well. So it's just a breeze to create new xbian-config modules:
https://github.com/xbianonpi/xbian-config-bash/wiki

@mk01
Copy link
Member

mk01 commented Apr 28, 2013

ok, I will push @Koenkk then :)))

@CurlyMoo
Copy link
Contributor Author

And you're totally right. XBian will be the first with these cool features as we where the first RPi distro with an animated splash and such.

@mk01
Copy link
Member

mk01 commented Apr 29, 2013

i'm currently at 52 s with full xvmc, if we need less, we need to look into initramfs. at least I can't do anything more with the scripts after initramfs. no more ideas.

@CurlyMoo
Copy link
Contributor Author

If you think you're done for now, than consider releasing Beta 1. Maybe you can help @Koenkk creating the update?
https://github.com/xbianonpi/xbian-deb-sources/tree/master/update/1.0-1

@CurlyMoo
Copy link
Contributor Author

To help you guys a little bit. I created a stripped down version of xbian-config-bash in a separate branch:
https://github.com/xbianonpi/xbian-config-bash/tree/rescue

@mk01
Copy link
Member

mk01 commented Apr 29, 2013

If I will post something, definitely not a "story changer", minor bugs at max, but the structure is final for now. t

I will look later to the config-bash.

And with the beta, you know I will never reject ask for help... But I'm not always available at all times.

But Koennk has my Skype and email - which I'm following online. So at least I can get notified.

@belese
Copy link

belese commented Oct 11, 2014

Is this already implemented?

i've seen code about this, but as i understand, it need a keyboard to activate boot menu.
problem is, i don't have usb keyboard, only a laptop.

i was talking about this at the beginning of xbian, i've a lacie nas (networkspace), without button, and the reset, was 2 power on/off rapidly.

We could maybe use something like this (maybe only when keyboard are not detected):

If device is reboot (unplug) during initramfs, (with help of some flag file in boot partition), next reboot will boot in the menu.
for selected an entry in the menu, again a reboot with a time out, if timeout is expired, the next element is selected(with again a timeout) and so on, if user reboot before timeout, this element is selected, and action are done on next reboot if user didn't select anything (don't reboot), boot continue as normal.

This is not very ergonomic, but with 2 reboot, you can reboot in @last_goodknow, or vanilla install, without unplugged the card or plug anything on the pi.

if you believe it's possible to do (i don't see something that can block, but you know the code better), i can take a try, i should have a sometime again now.

@mk01
Copy link
Member

mk01 commented Nov 26, 2014

@belese

indeed this is basically present.
currently it is not applied as default way to boot (so shift takes only to SHELL not MENU (but you can start it)).
other way is a kernel parameter into cmdline.txt "bootmenu". it will boot as usual /init from initramfs, but at the moment of storage drivers be present it will trigger /bootmenu script (source is in /etc/xbian-initramfs/bootmenu).

the current code is (considering my default style-nonstyle) still good readable so you should get the point.
as it is started it scans all DISK DRIVES / PARTITIONS for mountable filesystems having bootconfiguration file with valid parameters (kernelfile to boot, intiramfs(optional) and new kernel-args).

  • it scans the default root= for root/@xxxxxx snapshots.

then it shows dialog providing this options to user (with a timeout). after no action the previous boot process continues.

so the foundation is there - it's up to us what we make out of it.

@CurlyMoo CurlyMoo closed this as completed Feb 8, 2015
@CurlyMoo
Copy link
Contributor Author

CurlyMoo commented Mar 6, 2015

@mk01, I was thinking about our talk on IRC yesterday and that hardly anyone understands how our failsafe mechanisms work. apt downgrade, btrfs snapshots rollback / boot. I think a key feature to make users aware is to add this bootmenu with the 3 snapshots. Then users always see that XBian has snapshots and that they can do things with it.

I also think we should add a message in xbian-config and in the shell that explains that users can always downgrade when apt upgrade fails. In xbian-config, it should be made easy to actually downgrade.

@CurlyMoo CurlyMoo reopened this Mar 6, 2015
@mk01
Copy link
Member

mk01 commented Mar 6, 2015

@CurlyMoo

better idea - let's finally do "tips". showing at console upon login. oneliners. in the meaning:

Did you know, that .... ?

@CurlyMoo
Copy link
Contributor Author

CurlyMoo commented Mar 6, 2015

Yes, but only users using the command line will see those tips. Not regular users.

@mk01
Copy link
Member

mk01 commented Mar 6, 2015

@belese

@belese
Copy link

belese commented Mar 7, 2015

Ahh, i've done code fr that few times ago, but wasn't able to do it working,
the menu was working, a file is writed on boot partition for action on next boot
but don't know after.
will look if i find code, but i'm believe it is lost, and i probably don't have a backup, have to check at home
I was using the splash screen with menu item, and time out of each selected items, once you want to select, you reboot.

But i'm now tring to add bluetooth (and A2dp sink) directly inside xbmc, and it takes a bit times, i've already extends DBus messaging, add a DBus handler , hope to have a first test soon (or not;-),
it should normally work with bluez4 and 5.
After that, i could look again in that, but no prmoise when i could do it.

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

No branches or pull requests

3 participants