How To : systemd on VSIDO

VastOne

In a post over on #!, DapperMe17 tested systemd on VSIDO

This How To will show you how to install systemd to test and how to setup grub2 correctly

This should only be done on a Debian Kernel install.  If you try it on Liquorix, you will see a Kernel Panic

It is best run on a new install of VSIDO, IMO

1: Install systemd

sudo apt-get install systemd

2: Add a kernel with init=/lib/systemd/systemd added to the grub2 boot menu

sudo medit /etc/grub.d/40_custom


#!/bin/sh
exec tail -n +3 $0
menuentry "VSIDO Image Build latest Debian Kernel on sdc10" {
    set root=(hd2,10)
        linux /vmlinuz root=/dev/sdc10 ro quiet init=/lib/systemd/systemd
        initrd /initrd.img
}

# This file provides an easy way to add custom menu entries.  Simply type the
# menu entries you want to add after this comment.  Be careful not to change
# the 'exec tail' line above.


NOTE - The above is what is installed on my system and needs a bit of an explanation

sdc10 is the device/partition where this VSIDO is installed. It is on the 3rd disk in my machine which represents (hd2,10).  If you have just one hard drive it would be (hd0,X), on a second hard drive it would be (hd1,X) where X represents the device number and match the sdx number (in my case, sdc10)

3: update grub2

sudo update-grub

When you reboot you will have a menu entry for this (or whatever you named it):

QuoteVSIDO Image Build latest Debian Kernel on sdc10

Once all of this is completed, you can run smxi and install the Liquroix kernel if that is your preference

As I said over on that thread, I am seeing boot times of 12 seconds and shutdowns of 3 seconds with no issues running systemd

Very good grub2 Tutorial

I prefer the 40_custom method in grub2 because that is the recommended way of adding an entry to so that update-grub and grub-mkconfig does not remove edited or added entries

The 40_custom concept was also added to help eliminate user created errors/hacks to grub.cfg that made the system unbootable

Good luck
VSIDO      VSIDO Change Blog    

    I dev VSIDO

Sector11

You said:
Quote2: Add 'init=/lib/systemd/systemd' to the grub2 line

But you have:
Quotemenuentry "VSIDO Image Build latest Debian Kernel on sdc10" {
    set root=(hd2,10)
        linux /vmlinuz root=/dev/sdc10 ro quiet init=/lib/systemd/systemd
        initrd /initrd.img
}


My "/etc/grub.d/40_custom" looks like this:

#!/bin/sh
exec tail -n +3 $0

# This file provides an easy way to add custom menu entries.  Simply type the
# menu entries you want to add after this comment.  Be careful not to change
# the 'exec tail' line above.


Should the change just be:
#!/bin/sh
exec tail -n +3 $0

# This file provides an easy way to add custom menu entries.  Simply type the
# menu entries you want to add after this comment.  Be careful not to change
# the 'exec tail' line above.

init=/lib/systemd/systemd


What does "initrd /initrd.img" that you have do?

From the link:
Quoteadded  "init=/lib/systemd/systemd" (Without the quotes)
    to the kernel parameter line in grub.cfg.
    Works fine as tested with the Liquorix kernel.
    Both boot & shutdown are noticably quicker.

Why the difference between grub.cfg and /etc/grub.d/40_custom?
Stay Home

VastOne

^ No, the changes have to be just as I have outlined them.  The only differences would be whatever your hardware is (sdxx and hdx,x)

I have provided the precise example of what my /etc/grub.d/40_custom looks like to make it work

There is a BIG message on grub.cfg that says

#
# DO NOT EDIT THIS FILE
#
# It is automatically generated by grub-mkconfig using templates
# from /etc/grub.d and settings from /etc/default/grub


because by running update-grub will revert any changes made here to the default when run, meaning they will not be saved on an update.  Reading up on grub2 will let you know all about why /etc/grub.d/40_custom is the best way to add anything

initrd /initrd.img is the initial RAM disk (initrd) is an initial root file system that is mounted prior to when the real root file system is available. The initrd is bound to the kernel and loaded as part of the kernel boot procedure. The kernel then mounts this initrd as part of the two-stage boot process to load the modules to make the real file systems available and get at the real root file system.

It is absolutely needed just as I have outlined it
VSIDO      VSIDO Change Blog    

    I dev VSIDO

Sector11

Stay Home

jedi

WOW!!!  This works wonderfully and makes the grub menu on boot-up 1000% better!  Installing the changes to the /etc/grub.d/40_custom in my main go to partition (which by the way does NOT have systemd installed) fully corrected the issue I was having which was my own idiocy.  I now have a very nice selection on boot-up from my Grub2 menu as to which Install I want to boot too.
Also, the boot speeds which are already incredible with SSD, are even faster now.  Thanks for the great How To VastOne.
Here is what my /etc/grub.d/40_custom file looks like on my laptop!


#!/bin/sh
exec tail -n +3 $0
menuentry "VSIDO Test Gnome 3, Cinnamon, and Mate DE's sda5" {
    set root=(hd0,5)
        linux /vmlinuz root=/dev/sda5 ro quiet nomodeset nouvea.modeset=0 init=/lib/systemd/systemd
        initrd /initrd.img
}
menuentry "VSIDO and Nvidia not installed on sda6" {
    set root=(hd0,6)
        linux /vmlinuz root=/dev/sda6 ro quiet init=/lib/systemd/systemd
        initrd /initrd.img
}

# This file provides an easy way to add custom menu entries.  Simply type the
# menu entries you want to add after this comment.  Be careful not to change
# the 'exec tail' line above.


Maybe this will give others an idea of how this is supposed to work!  Once it's going, the simplicity factor on boot-up as to which install you want to boot into is incredibly simple!
Forum Netiquette

"No matter how smart you are you can never convince someone stupid that they are stupid."  Anonymous

VastOne

^ Great to hear that jedi, thanks for sharing your successes
VSIDO      VSIDO Change Blog    

    I dev VSIDO

PackRat

Worked as advertised on my Debian Sid install; using a custom build 3.9 kernel.

Now that you have been using it for a while, have you noticed any performance improvements other than boot and shutdown times? I distro hopped to OpenSuse and Arch just to get a look at systemd. I wasn't on those distros that long, but it looked like administration would be easier once you're past the learning curve.
I am tired of talk that comes to nothing.
-- Chief Joseph

...the sun, the darkness, the winds are all listening to what we have to say.
-- Geronimo


ozitraveller

#8
I've just done this using the instructions by VastOne, and allowing the upgrade to happen, on a liquorix kernel and dual boot, with out issue. All good so far. :) No kernel panic at all. I don't see any boot speed increase at all though.

VastOne

VSIDO + systemd + FluxBox

OOTB

VSIDO      VSIDO Change Blog    

    I dev VSIDO

Sector11

How does one do this with a liqiorix kernel and not get "colonel" panic?

--- "general" or even "captain" clamness would be nice.
Stay Home

VastOne

All I do is install systemd before any smxi activity...

Once it is installed and booted I run smxi and install the liquorix kernel with no panics
VSIDO      VSIDO Change Blog    

    I dev VSIDO

Sector11

Perfect for a new install ... what about an install that is up and running with a liquorix kernel already.

Is there any way to do this?
Stay Home

VastOne

Not to my knowledge... Perhaps the liquorix kernel folks can answer that one
VSIDO      VSIDO Change Blog    

    I dev VSIDO

statmonkey

Apologize for the necro-bump but wanted to say thanks for this VastOne, simple and well explained as always.