You are not logged in.
Pages: 1
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)
Prediction...This year will be a very odd year!
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
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
Sometimes it is the people no one can imagine anything of who do the things no one can imagine. -- Alan Turing
---
How to Ask Questions the Smart Way
Offline
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.
Prediction...This year will be a very odd year!
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
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
$ 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 packages • Zsh and other configs
Offline
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
Sometimes it is the people no one can imagine anything of who do the things no one can imagine. -- Alan Turing
---
How to Ask Questions the Smart Way
Offline
Thanks gents!
Prediction...This year will be a very odd year!
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
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
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)
Prediction...This year will be a very odd year!
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
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?
Prediction...This year will be a very odd year!
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
@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
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.
Prediction...This year will be a very odd year!
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
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
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: MSI MAG X570S TORPEDO MAX // Processor: AMD Ryzen 9 5950X @4.9GHz // GFX: AMD Radeon RX 5700 XT // RAM: 32GB (4x 8GB) Corsair DDR4 (@ 3000MHz) // Storage: 1x 3TB HDD, 6x 1TB SSD, 2x 120GB SSD, 1x 275GB M2 SSD
Making lemonade from lemons since 2015.
Offline
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
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
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
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: MSI MAG X570S TORPEDO MAX // Processor: AMD Ryzen 9 5950X @4.9GHz // GFX: AMD Radeon RX 5700 XT // RAM: 32GB (4x 8GB) Corsair DDR4 (@ 3000MHz) // Storage: 1x 3TB HDD, 6x 1TB SSD, 2x 120GB SSD, 1x 275GB M2 SSD
Making lemonade from lemons since 2015.
Offline
/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
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: MSI MAG X570S TORPEDO MAX // Processor: AMD Ryzen 9 5950X @4.9GHz // GFX: AMD Radeon RX 5700 XT // RAM: 32GB (4x 8GB) Corsair DDR4 (@ 3000MHz) // Storage: 1x 3TB HDD, 6x 1TB SSD, 2x 120GB SSD, 1x 275GB M2 SSD
Making lemonade from lemons since 2015.
Offline
No I'm not sure. How do I determine that?
Offline
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: MSI MAG X570S TORPEDO MAX // Processor: AMD Ryzen 9 5950X @4.9GHz // GFX: AMD Radeon RX 5700 XT // RAM: 32GB (4x 8GB) Corsair DDR4 (@ 3000MHz) // Storage: 1x 3TB HDD, 6x 1TB SSD, 2x 120GB SSD, 1x 275GB M2 SSD
Making lemonade from lemons since 2015.
Offline
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.
Offline
Pages: 1