systemd-boot updater


#41

Gotta say, I’m excited to see your code :slightly_smiling_face:


#42

Isn’t bootctl update just about updating systemd-boot binary in ESP?
(something that can already be done automatically with this)

What has it to do with updating boot entries?


#43

Nothing, as far as I have seen.


#44

OK.

I finished testing everything and it seems like I should release a version before I add any more features and need to retest everything…again.

Now I just need to figure out how to get setup on gitlab.

A quick break and I will hopefully be back in a few hours with a link to a source repo.


#45

Well. That took longer than I thought.

It should be available here: https://gitlab.com/dalto.8/systemd-boot-manager

I have to say, this is one of the most anti-climatic projects I have ever worked on. A very small amount of code took a disproportionate amount of time to test. Too many scenarios. :sweat_smile:

Although I tested it as thoroughly as possible, it definitely could use some additional testing.

I explicitly tested it with:

  • btrfs
  • ext4
  • f2fs
  • zfs
  • ext4 on luks
  • ext4 on lvm on luks
  • ext4 on luks on lvm

I would expect it to work on other filesystems though.

The PKGBUILD just pulls straight from master at this point.

If anyone finds an problems please let me know. Also, this is the first project I have ever created at gitlab so if I forgot to do anything please also let me know.


#46

Looks excellent!

The only potential improvement to be made is dealing with btrfs root without subvolumes. I know it does not seem to make sense as an option, but apparently people do that too.

This is what I used for refind in m-a:

rootsubvol=$(findmnt -o TARGET,SOURCE | awk '/\/mnt / {print $2}' | cut -d "[" -f2 | cut -d "]" -f1)
... 
elif [[ -n "$rootsubvol" ]]; then

#47

OK, didn’t know that was possible. Let me fire up a vm real quick and make a btrfs install without subvols and see what that looks like.


#48

It’s just like on ext4, no special stuff required.


#49

I just did an install and it works on btrfs root with no subvols from what I can tell it works because it uses findmnt to get the fsroot.

On a btrfs install with subvols it sets the subvol to /@. When there are no subvols it sets to / which works in my testing.

I tested it with kernel 4.4, 4.14, 4.19 and 4.20.


#50

Okay, then catering to that use case is very low priority (fringe case+works already).

I’ll upload the package to unstable once I have the time. When it gets a little more testing, we can use it in manjaro-architect.

Btw, has it been tested in a chroot yet?


#51

Yes, in addition to my earlier testing, I used it in a chroot just now for the btrfs no subvol install. :grin:


#52

Aaaand down to unstable it goes. Systemd-boot-manager is now in the repos


#53

I wish I had programming skills to make some sort of refind-helper to fill the gap :wink:


#54

My trust was great and the curiosity even greater, so i tried it this morning first on virtualbox and later on my workstation.
My test case was manjaro single-boot, btrfs system partition with default subvolume layout and Kernel 4.20 with custom options for silent boot.
I run the gen command and everything worked out fine, as expected.
Maybe, a verbose switch/setting would be nice, to see what happens behind the scenes.
Thanks for the script, that brings a lot of comfort to systemd-boot.


#55

Good idea. Since it is a bit of an effort to test, I will collect any requests and implement them all at once.


#56

Already built into manjaro-architect. Latest dev version also includes microcode support. Refind generates boot entries automatically, so it needs setup script only initially.


#57

You should create release tags and use them in PKGBUILD, for example v0.0.1.
Add a open source license to your repository.

I have another feature request/idea. Your script could create additional boot entries
for booting into runlevel3.target, multi-user.target – Full multi-user text mode.
(This should be also configurable)

The boot menu could look like this:

Manjaro Linux 4.20 (manjaro-4.20)
Manjaro Linux 4.20 (manjaro-4.20 text mode)
Manjaro Linux 4.20 (manjaro-4.20 fallback)

#58

Aaaand now manjaro-architect uses it:

I’ll bump manjaro-architect-dev to a new version.


#59

Oh nice, I am glad you used my comments on how rEFInd works in order to improve its support in M-A. I mean I am happy to have shared some useful bits of information.


#60

I’m curious: what does a /boot/loader/entries/*.conf file to boot into ‘text mode’ look like?