You are not logged in.

#1 2012-06-05 04:01:42

lilsirecho
Veteran
Registered: 2003-10-24
Posts: 5,000

Systemd kernel line(solved)

How does a user place /usr/bin/systemd on the kernel line in grub2 bootloader?

It seems to extend too far and requires a backslash.

Adding to the kernel line in grub2 differs from grub?  How?

Last edited by lilsirecho (2012-06-09 19:48:24)


Sign of the times: Navajo blanket..made in China
Hard work does not kill people but why risk it: Charlie Mccarthy
A man is not complete until he is married..then..he is finished.
When ALL is lost, what can be found? Even bytes get lonely for a little bit!     X-ray confirms Iam spineless!

Offline

#2 2012-06-05 04:09:16

ewaller
Administrator
From: Pasadena, CA
Registered: 2009-07-13
Posts: 13,808

Re: Systemd kernel line(solved)

ewaller@odin:/etc/default 1003 %diff grub grub~
5c5
< GRUB_CMDLINE_LINUX=""
---
> GRUB_CMDLINE_LINUX="init=/bin/systemd"
ewaller@odin:/etc/default[1] 1004 %

Edit:  Change that file, and regenerate the grub config file.

Last edited by ewaller (2012-06-05 04:11:00)


Nothing is too wonderful to be true, if it be consistent with the laws of nature -- Michael Faraday
You assume people are rational and influenced by evidence.  You must not work with the public much. -- Trilby
----
How to Ask Questions the Smart Way

Offline

#3 2012-06-05 16:14:22

lilsirecho
Veteran
Registered: 2003-10-24
Posts: 5,000

Re: Systemd kernel line(solved)

Confused:  wiki saya to add /usr/bin/systemd to the kernel line....

Your post adds init=/bin/systemd.. and requires regen of grub.  I assume the regen is to make it permanent.

My purpose is to make trial runs.  I hope to add this to a raid0 system.


Sign of the times: Navajo blanket..made in China
Hard work does not kill people but why risk it: Charlie Mccarthy
A man is not complete until he is married..then..he is finished.
When ALL is lost, what can be found? Even bytes get lonely for a little bit!     X-ray confirms Iam spineless!

Offline

#4 2012-06-05 17:54:09

Gnarl
Member
Registered: 2010-11-18
Posts: 63

Re: Systemd kernel line(solved)

In grub 1 edit the /boot/grub/menu.lst find the line(s)

kernel /vmlinuz-linux root=/dev/sdXx ro

and add the parameter to the end. Ex mine is:

kernel /vmlinuz-linux root=/dev/sda3 ro init=/bin/systemd

and don't touch anything but the part you are adding.

Offline

#5 2012-06-05 17:55:54

graysky
Member
From: The worse toilet in Scotland
Registered: 2008-12-01
Posts: 8,818
Website

Re: Systemd kernel line(solved)

$ head /etc/default/grub 
GRUB_DEFAULT=0
GRUB_TIMEOUT=5
GRUB_DISTRIBUTOR="Arch Linux"
GRUB_CMDLINE_LINUX_DEFAULT="quiet init=/usr/lib/systemd/systemd"
GRUB_CMDLINE_LINUX=""

# Preload both GPT and MBR modules so that they are not missed

Remember to regenerate your /boot/grub/grub.cfg

# grub-mkconfig -o /boot/grub/grub.cfg

Last edited by graysky (2012-06-05 17:57:06)


CPU-optimized Linux-ck packages @ Repo-ck  • AUR packagesZsh and other configs

Offline

#6 2012-06-05 18:13:29

ewaller
Administrator
From: Pasadena, CA
Registered: 2009-07-13
Posts: 13,808

Re: Systemd kernel line(solved)

Graysky,
The disconnect with our posts is that he wants to do it on a one-off basis.  He does not want to change it permanently.

Gnarl,
I think he is using Grub 2.

lilsirecho,
I am not in front of my grub2 machine right now, so I cannot try this.  I am sure there exists the means to edit the command line at boot.  I'll look when I get home this evening (GMT-7)


Nothing is too wonderful to be true, if it be consistent with the laws of nature -- Michael Faraday
You assume people are rational and influenced by evidence.  You must not work with the public much. -- Trilby
----
How to Ask Questions the Smart Way

Offline

#7 2012-06-05 18:15:31

lilsirecho
Veteran
Registered: 2003-10-24
Posts: 5,000

Re: Systemd kernel line(solved)

Thanks gents!


Sign of the times: Navajo blanket..made in China
Hard work does not kill people but why risk it: Charlie Mccarthy
A man is not complete until he is married..then..he is finished.
When ALL is lost, what can be found? Even bytes get lonely for a little bit!     X-ray confirms Iam spineless!

Offline

#8 2012-06-06 21:09:34

Gnarl
Member
Registered: 2010-11-18
Posts: 63

Re: Systemd kernel line(solved)

Off the top of my head...

For one-offs - at the grub menu on start up press the e key then use the arrow keys to navigate to the kernel line and press e again. Add the init=/bin/systemd to the end and press enter then b to boot it.

Offline

#9 2012-06-06 22:21:50

lilsirecho
Veteran
Registered: 2003-10-24
Posts: 5,000

Re: Systemd kernel line(solved)

Attempted the procedure but the structure in grub2 does not permit inserting that size of add-on.  The added info is not printed completely on the kernel line.


I suspect that another procedure is required for grub2 changes in the kernel line but have no idea what that is.

EDIT:  My system is unique however.  The boot is made from a partition but the mbr has the grub2 installed.  Therefore, I may have to change the boot partition params but they don't appear in the grub prompt directly.  So it is likely that I cannot do the one-time systemd trial.

One item in using the procedure you outlined is that the boot is enabled with f10 and "b" is not an option.

Last edited by lilsirecho (2012-06-06 22:29:49)


Sign of the times: Navajo blanket..made in China
Hard work does not kill people but why risk it: Charlie Mccarthy
A man is not complete until he is married..then..he is finished.
When ALL is lost, what can be found? Even bytes get lonely for a little bit!     X-ray confirms Iam spineless!

Offline

#10 2012-06-07 05:38:13

lilsirecho
Veteran
Registered: 2003-10-24
Posts: 5,000

Re: Systemd kernel line(solved)

Applied the systemd to an arch non-raid grub bootloader system .

This produced a systemd boot to root prompt.  Obtained log-in and started xfce4 successfully.

Therefore I conclude the info in the wiki applies only to grub legacy.

It may not be possible to use systemd in grub2 bootloader?


Sign of the times: Navajo blanket..made in China
Hard work does not kill people but why risk it: Charlie Mccarthy
A man is not complete until he is married..then..he is finished.
When ALL is lost, what can be found? Even bytes get lonely for a little bit!     X-ray confirms Iam spineless!

Offline

#11 2012-06-09 16:18:33

teateawhy
Member
From: GER
Registered: 2012-03-05
Posts: 1,077
Website

Re: Systemd kernel line(solved)

@lilsirecho:
Of course it is possible to use systemd and grub2 together.
I am doing it right now, and also a lot of other distros have it as default.

>>> However arch has grub1 as default, therefore it is your job to know the difference when reading the wiki.

Also it is easy to test systemd by pressing e in Grub2 and adding init=/bin/systemd.
Press f10 and it boots only once with systemd. Boot again and its gone.
Edit /etc/default/grub the same way, and issue grub-mkconfig -o /boot/grub/grub.cfg to make it permanent.

PS: My post is only summing up what everyone said before....

Offline

#12 2012-06-09 19:44:28

lilsirecho
Veteran
Registered: 2003-10-24
Posts: 5,000

Re: Systemd kernel line(solved)

teateawhy:

Thanks for your comment.

Prior to this posting I had been using /usr/bin/systemd which was in the wiki.

Utilizing the ...init=/bin/systemd does generate a systemd result on a one-time basis.  I guess I can proceed from this point.

I probably made an oops in using the older entry.


Sign of the times: Navajo blanket..made in China
Hard work does not kill people but why risk it: Charlie Mccarthy
A man is not complete until he is married..then..he is finished.
When ALL is lost, what can be found? Even bytes get lonely for a little bit!     X-ray confirms Iam spineless!

Offline

#13 2013-02-03 01:55:40

Cotton
Member
From: Cornwall, UK
Registered: 2004-09-17
Posts: 549

Re: Systemd kernel line(solved)

Although this post is marked solved, you didn't explain whether you successfully added the init=... statement to the kernel line, since it was too long to fit in the available space.
Using the suggestions given above, I've modified the line, even inserting a "\" before continuing the next line, but get an error when pressing F10:   "can't find command 's' "
This appears to relate to the word "setup" at the beginning of the grub2 code listed after "e" is pressed to edit it.
Pressing e then ESC allows the system to boot normally, but obviously without any modifications to the command line.
Any suggestions?

Offline

#14 2013-02-03 02:04:59

WorMzy
Forum Moderator
From: Scotland
Registered: 2010-06-16
Posts: 5,910
Website

Re: Systemd kernel line(solved)

Assuming you're up-to-date (i.e. have systemd-sysvcompat installed) you don't need to modify grub to load systemd as init.


Sakura:-
Mobo: ASUS P8Z77-V PRO // Processor: Intel Core i7-3770K 3.4GHz // GFX: nVidia GeForce GTX 970 Ti // RAM: 32GB (4x 8GB) Corsair DDR3 (@ 2133MHz) // Storage: 1x 3TB Seagate SATAII 5x 1TB Samsung SATAII, 2x 120GB Corsair SSD

Making lemonade from lemons since 2015.

Offline

#15 2013-02-03 02:09:26

Cotton
Member
From: Cornwall, UK
Registered: 2004-09-17
Posts: 549

Re: Systemd kernel line(solved)

That's the point - I don't have systemd-sysvcompat installed.  I just want to test the impact of changing to systemd by temporarily modifying the kernel command at boot up.
The problem is that any modification results in the "can't find command 's' " error.

Offline

#16 2013-02-03 02:17:03

Scimmia
Bug Wrangler
Registered: 2012-09-01
Posts: 5,349

Re: Systemd kernel line(solved)

If you want it to be temporary, just select your normal boot entry in the menu and hit "e". Add init=/usr/lib/systemd/systemd to the command.

Last edited by Scimmia (2013-02-03 02:17:40)

Offline

#17 2013-02-03 02:20:14

Cotton
Member
From: Cornwall, UK
Registered: 2004-09-17
Posts: 549

Re: Systemd kernel line(solved)

Done that.  Gives "can't find command 's' " on pressing F10.
This is using GRUB2 which is up to date.

Last edited by Cotton (2013-02-03 02:20:48)

Offline

#18 2013-02-03 04:12:26

WorMzy
Forum Moderator
From: Scotland
Registered: 2010-06-16
Posts: 5,910
Website

Re: Systemd kernel line(solved)

I dunno what you're doing wrong here, but I've just tested it myself, and it works fine. One thing I noticed though, was that I don't have any mention of "setup" in my 'e' menu, or my grub.cfg.

Please post your grub.cfg so we can have a look at it.

Also, don't bother manually inserting '\'s to trail onto a new line, grub adds those in when the line overflows, as far as I can tell, it's just cosmetic.


Sakura:-
Mobo: ASUS P8Z77-V PRO // Processor: Intel Core i7-3770K 3.4GHz // GFX: nVidia GeForce GTX 970 Ti // RAM: 32GB (4x 8GB) Corsair DDR3 (@ 2133MHz) // Storage: 1x 3TB Seagate SATAII 5x 1TB Samsung SATAII, 2x 120GB Corsair SSD

Making lemonade from lemons since 2015.

Offline

#19 2013-02-03 09:29:21

Cotton
Member
From: Cornwall, UK
Registered: 2004-09-17
Posts: 549

Re: Systemd kernel line(solved)

/etc/boot/grub.cfg:

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

### BEGIN /etc/grub.d/00_header ###
insmod part_gpt
insmod part_msdos
if [ -s $prefix/grubenv ]; then
  load_env
fi
set default="0"

if [ x"${feature_menuentry_id}" = xy ]; then
  menuentry_id_option="--id"
else
  menuentry_id_option=""
fi

export menuentry_id_option

if [ "${prev_saved_entry}" ]; then
  set saved_entry="${prev_saved_entry}"
  save_env saved_entry
  set prev_saved_entry=
  save_env prev_saved_entry
  set boot_once=true
fi

function savedefault {
  if [ -z "${boot_once}" ]; then
    saved_entry="${chosen}"
    save_env saved_entry
  fi
}

function load_video {
  if [ x$feature_all_video_module = xy ]; then
    insmod all_video
  else
    insmod efi_gop
    insmod efi_uga
    insmod ieee1275_fb
    insmod vbe
    insmod vga
    insmod video_bochs
    insmod video_cirrus
  fi
}

if [ x$feature_default_font_path = xy ] ; then
   font=unicode
else
insmod part_gpt
insmod ext2
set root='hd2,gpt4'
if [ x$feature_platform_search_hint = xy ]; then
  search --no-floppy --fs-uuid --set=root --hint-bios=hd2,gpt4 --hint-efi=hd2,gpt4 --hint-baremetal=ahci2,gpt4  4c5dd898-2c32-4da5-a97d-c3412e7b20ac
else
  search --no-floppy --fs-uuid --set=root 4c5dd898-2c32-4da5-a97d-c3412e7b20ac
fi
    font="/usr/share/grub/unicode.pf2"
fi

if loadfont $font ; then
  set gfxmode=auto
  load_video
  insmod gfxterm
fi
terminal_input console
terminal_output gfxterm
set timeout=5
### END /etc/grub.d/00_header ###

### BEGIN /etc/grub.d/10_linux ###
menuentry 'Arch GNU/Linux, with Linux ck kernel' --class arch --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-ck kernel-true-4c5dd898-2c32-4da5-a97d-c3412e7b20ac' {
	load_video
	set gfxpayload=keep
	insmod gzio
	insmod part_gpt
	insmod ext2
	set root='hd2,gpt2'
	if [ x$feature_platform_search_hint = xy ]; then
	  search --no-floppy --fs-uuid --set=root --hint-bios=hd2,gpt2 --hint-efi=hd2,gpt2 --hint-baremetal=ahci2,gpt2  c3610caf-f6db-4499-a0a5-cf821a90b672
	else
	  search --no-floppy --fs-uuid --set=root c3610caf-f6db-4499-a0a5-cf821a90b672
	fi
	echo	'Loading Linux ck kernel ...'
	linux	/vmlinuz-linux-ck root=UUID=4c5dd898-2c32-4da5-a97d-c3412e7b20ac ro  quiet
	echo	'Loading initial ramdisk ...'
	initrd	/initramfs-linux-ck.img
}
menuentry 'Arch GNU/Linux, with Linux ck kernel (Fallback initramfs)' --class arch --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-ck kernel-fallback-4c5dd898-2c32-4da5-a97d-c3412e7b20ac' {
	load_video
	set gfxpayload=keep
	insmod gzio
	insmod part_gpt
	insmod ext2
	set root='hd2,gpt2'
	if [ x$feature_platform_search_hint = xy ]; then
	  search --no-floppy --fs-uuid --set=root --hint-bios=hd2,gpt2 --hint-efi=hd2,gpt2 --hint-baremetal=ahci2,gpt2  c3610caf-f6db-4499-a0a5-cf821a90b672
	else
	  search --no-floppy --fs-uuid --set=root c3610caf-f6db-4499-a0a5-cf821a90b672
	fi
	echo	'Loading Linux ck kernel ...'
	linux	/vmlinuz-linux-ck root=UUID=4c5dd898-2c32-4da5-a97d-c3412e7b20ac ro  quiet
	echo	'Loading initial ramdisk ...'
	initrd	/initramfs-linux-ck-fallback.img
}
menuentry 'Arch GNU/Linux, with Linux core repo kernel' --class arch --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-core repo kernel-true-4c5dd898-2c32-4da5-a97d-c3412e7b20ac' {
	load_video
	set gfxpayload=keep
	insmod gzio
	insmod part_gpt
	insmod ext2
	set root='hd2,gpt2'
	if [ x$feature_platform_search_hint = xy ]; then
	  search --no-floppy --fs-uuid --set=root --hint-bios=hd2,gpt2 --hint-efi=hd2,gpt2 --hint-baremetal=ahci2,gpt2  c3610caf-f6db-4499-a0a5-cf821a90b672
	else
	  search --no-floppy --fs-uuid --set=root c3610caf-f6db-4499-a0a5-cf821a90b672
	fi
	echo	'Loading Linux core repo kernel ...'
	linux	/vmlinuz-linux root=UUID=4c5dd898-2c32-4da5-a97d-c3412e7b20ac ro  quiet
	echo	'Loading initial ramdisk ...'
	initrd	/initramfs-linux.img
}
menuentry 'Arch GNU/Linux, with Linux core repo kernel (Fallback initramfs)' --class arch --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-core repo kernel-fallback-4c5dd898-2c32-4da5-a97d-c3412e7b20ac' {
	load_video
	set gfxpayload=keep
	insmod gzio
	insmod part_gpt
	insmod ext2
	set root='hd2,gpt2'
	if [ x$feature_platform_search_hint = xy ]; then
	  search --no-floppy --fs-uuid --set=root --hint-bios=hd2,gpt2 --hint-efi=hd2,gpt2 --hint-baremetal=ahci2,gpt2  c3610caf-f6db-4499-a0a5-cf821a90b672
	else
	  search --no-floppy --fs-uuid --set=root c3610caf-f6db-4499-a0a5-cf821a90b672
	fi
	echo	'Loading Linux core repo kernel ...'
	linux	/vmlinuz-linux root=UUID=4c5dd898-2c32-4da5-a97d-c3412e7b20ac ro  quiet
	echo	'Loading initial ramdisk ...'
	initrd	/initramfs-linux-fallback.img
}

### END /etc/grub.d/10_linux ###

### BEGIN /etc/grub.d/20_linux_xen ###
### END /etc/grub.d/20_linux_xen ###

### BEGIN /etc/grub.d/20_memtest86+ ###
menuentry "Memory test (memtest86+)" --class memtest86 --class gnu --class tool {
  insmod part_gpt
  insmod ext2
  set root='hd2,gpt2'
  if [ x$feature_platform_search_hint = xy ]; then
    search --no-floppy --fs-uuid --set=root --hint-bios=hd2,gpt2 --hint-efi=hd2,gpt2 --hint-baremetal=ahci2,gpt2  c3610caf-f6db-4499-a0a5-cf821a90b672
  else
    search --no-floppy --fs-uuid --set=root c3610caf-f6db-4499-a0a5-cf821a90b672
  fi
  linux16 ($root)/memtest86+/memtest.bin
}
### END /etc/grub.d/20_memtest86+ ###

### BEGIN /etc/grub.d/30_os-prober ###
### END /etc/grub.d/30_os-prober ###

### BEGIN /etc/grub.d/40_custom ###
# 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.

menuentry "Microsoft Windows 7 Crucial M4 128 GB" {
    insmod part_msdos
    insmod ntfs
    insmod search_fs_uuid
    insmod ntldr     
    search --fs-uuid --no-floppy --set=root 242058EE2058C886
    ntldr /bootmgr
}

menuentry "Microsoft Windows 7 Vertex4 128 GB" {
    insmod part_msdos
    insmod ntfs
    insmod search_fs_uuid
    insmod ntldr     
    search --fs-uuid --no-floppy --set=root 5802C31F02C3014C
    ntldr /bootmgr
}

menuentry "Linux CK" {
set root=(hd2,gpt2)
linux /boot/vmlinuz-linuz-ck
initrd /boot/initramfs-linux-ck.img 
}

### END /etc/grub.d/40_custom ###

### BEGIN /etc/grub.d/41_custom ###
if [ -f  ${config_directory}/custom.cfg ]; then
  source ${config_directory}/custom.cfg
elif [ -z "${config_directory}" -a -f  $prefix/custom.cfg ]; then
  source $prefix/custom.cfg;
fi
### END /etc/grub.d/41_custom ###

Offline

#20 2013-02-03 13:20:43

WorMzy
Forum Moderator
From: Scotland
Registered: 2010-06-16
Posts: 5,910
Website

Re: Systemd kernel line(solved)

Well that looks fine to me. I've done some research, and it appears that someone else experienced a similar bug back in grub v2.00 beta3. Are you sure that the grub you have installed to the mbr is up-to-date? Note that upgrading the grub package in Arch doesn't touch the version you have installed to the mbr.


Sakura:-
Mobo: ASUS P8Z77-V PRO // Processor: Intel Core i7-3770K 3.4GHz // GFX: nVidia GeForce GTX 970 Ti // RAM: 32GB (4x 8GB) Corsair DDR3 (@ 2133MHz) // Storage: 1x 3TB Seagate SATAII 5x 1TB Samsung SATAII, 2x 120GB Corsair SSD

Making lemonade from lemons since 2015.

Offline

#21 2013-02-03 18:00:44

Cotton
Member
From: Cornwall, UK
Registered: 2004-09-17
Posts: 549

Re: Systemd kernel line(solved)

No I'm not sure. How do I determine that?

Offline

#22 2013-02-03 18:45:42

WorMzy
Forum Moderator
From: Scotland
Registered: 2010-06-16
Posts: 5,910
Website

Re: Systemd kernel line(solved)

When you get to the grub menu, it should say at the top of the screen, like this. If it just says "GNU GRUB version 2.00", then you're up to date.

Last edited by WorMzy (2013-02-03 18:46:56)


Sakura:-
Mobo: ASUS P8Z77-V PRO // Processor: Intel Core i7-3770K 3.4GHz // GFX: nVidia GeForce GTX 970 Ti // RAM: 32GB (4x 8GB) Corsair DDR3 (@ 2133MHz) // Storage: 1x 3TB Seagate SATAII 5x 1TB Samsung SATAII, 2x 120GB Corsair SSD

Making lemonade from lemons since 2015.

Offline

#23 2013-02-09 18:15:30

Cotton
Member
From: Cornwall, UK
Registered: 2004-09-17
Posts: 549

Re: Systemd kernel line(solved)

WorMzy wrote:

Well that looks fine to me. I've done some research, and it appears that someone else experienced a similar bug back in grub v2.00 beta3. Are you sure that the grub you have installed to the mbr is up-to-date? Note that upgrading the grub package in Arch doesn't touch the version you have installed to the mbr.

Thanks WorMzy, you were right - I was using beta 3.
Upgraded and boot time edits work as expected.  smile

Offline

Board footer

Powered by FluxBB