Forums

Skip to content

Advanced search
  • Quick links
    • Unanswered topics
    • Active topics
    • Search
  • FAQ
  • Login
  • Register
  • Board index Assistance Installing Gentoo
  • Search

Guide to customize install media? Need to add kernel flags

Having problems with the Gentoo Handbook? If you're still working your way through it, or just need some info before you start your install, this is the place. All other questions go elsewhere.
Post Reply
Advanced search
20 posts • Page 1 of 1
Author
Message
MickeJ
n00b
n00b
Posts: 13
Joined: Mon May 29, 2023 7:56 pm

Guide to customize install media? Need to add kernel flags

  • Quote

Post by MickeJ » Tue Jul 04, 2023 6:17 pm

Hi, I need to add below kernel flags for my laptop keyboard to work. And I only have one USB port so its either USB boot memory stick or an external keyboard plugged in. According to a google search my new Lenovo Yoga laptop needs some additional boot flags to enable the keyboard.

Is there any guides i can use to help me add additional kernel boot flags into the install ISO?

I have ordered a usb hub but i want to do it now... 8)

i915.enable_psr=0
atkbd.reset=1
i8042.nomux=1
i8042.reset=1
i8042.nopnp=1
i8042.dumbkbd=1
Top
pietinger
Moderator
Moderator
Posts: 6620
Joined: Tue Oct 17, 2006 5:11 pm
Location: Bavaria

  • Quote

Post by pietinger » Tue Jul 04, 2023 7:20 pm

If you want add kernel command line parameter it depends how you boot (or if you do your own kernel configuration). All is here described: https://wiki.gentoo.org/wiki/User:Pieti ... _Parameter
Top
pietinger
Moderator
Moderator
Posts: 6620
Joined: Tue Oct 17, 2006 5:11 pm
Location: Bavaria

  • Quote

Post by pietinger » Tue Jul 04, 2023 7:28 pm

MickeJ wrote:[...] add additional kernel boot flags into the install ISO?
If you boot with the install-CD you can stop grub and edit kernel command line parameter also.

(If you want it permanent in your ISO-CD you should unpack the ISO and edit grub.cfg file; then make them an ISO again)
Top
NeddySeagoon
Administrator
Administrator
User avatar
Posts: 56080
Joined: Sat Jul 05, 2003 9:37 am
Location: 56N 3W

  • Quote

Post by NeddySeagoon » Tue Jul 04, 2023 7:31 pm

MickeJ,

If you are trying to install but can't use a non Gentoo boot media,
Its just a toolkit.

If you have installed already, use the kernel, initrd and lib/modules from the install media you used.
That is, put those things into your Gentoo.
Now update grub.cfg to use that kernel and initrd.

Once it boots, with a working keyboard, you can fix your own kernel.

Code: Select all

i915.enable_psr=0
atkbd.reset=1
i8042.nomux=1
i8042.reset=1
i8042.nopnp=1
i8042.dumbkbd=1
Look like they are kernel command line parameters. If you have the kernel support you need boot to the grub menu, choose the kernel you would like to boot then press 'e' for edit.
Find the kernel line and append those options to the end as a space separated list.

Let the boot happen. Those changes are in RAM only.
If all is well, fix grub to make the options permanent. I use syslinux, so I don't know how to do that.
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Top
MickeJ
n00b
n00b
Posts: 13
Joined: Mon May 29, 2023 7:56 pm

  • Quote

Post by MickeJ » Tue Jul 04, 2023 8:12 pm

pietinger wrote: If you boot with the install-CD you can stop grub and edit kernel command line parameter also.

(If you want it permanent in your ISO-CD you should unpack the ISO and edit grub.cfg file; then make them an ISO again)
No i can not edit kernel command line parameter, because i have no keyboard.

Yes from another working linux machine i need to unpack the boot ISO, edit the grub, then repack the ISO and dd:it to a USB and boot.

What im asking is for pointers how to do this. Maybe it is easier then i think... But Im not really sure how to unpack an ISO and pack the ISO again into bootable medium. I was think there is some squashfs magic going on...

Example this one, pointers how to unpack it and pack it again... https://distfiles.gentoo.org/releases/a ... 70203Z.iso
Top
NeddySeagoon
Administrator
Administrator
User avatar
Posts: 56080
Joined: Sat Jul 05, 2003 9:37 am
Location: 56N 3W

  • Quote

Post by NeddySeagoon » Tue Jul 04, 2023 8:16 pm

MickeJ,

If you have no keyboard in grub, kernel parameters cannot help as the kernel is not loaded.
That's what grub does.

Check your firmware settings.

Only the root filesystem is in squashfs.
Last edited by NeddySeagoon on Tue Jul 04, 2023 8:17 pm, edited 1 time in total.
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Top
MickeJ
n00b
n00b
Posts: 13
Joined: Mon May 29, 2023 7:56 pm

  • Quote

Post by MickeJ » Tue Jul 04, 2023 8:17 pm

NeddySeagoon wrote:MickeJ,

If you are trying to install but can't use a non Gentoo boot media,
Its just a toolkit.

If you have installed already, use the kernel, initrd and lib/modules from the install media you used.
That is, put those things into your Gentoo.
Now update grub.cfg to use that kernel and initrd.

Once it boots, with a working keyboard, you can fix your own kernel.

Code: Select all

i915.enable_psr=0
atkbd.reset=1
i8042.nomux=1
i8042.reset=1
i8042.nopnp=1
i8042.dumbkbd=1
Look like they are kernel command line parameters. If you have the kernel support you need boot to the grub menu, choose the kernel you would like to boot then press 'e' for edit.
Find the kernel line and append those options to the end as a space separated list.

Let the boot happen. Those changes are in RAM only.
If all is well, fix grub to make the options permanent. I use syslinux, so I don't know how to do that.
There is no Linux ISO boot media on the whole Internet with this kernel parameters given. I need to make this install media myself. For example modifying Gentoo minimal boot ISO. Im asking for pointers how to do that.
Top
MickeJ
n00b
n00b
Posts: 13
Joined: Mon May 29, 2023 7:56 pm

  • Quote

Post by MickeJ » Tue Jul 04, 2023 8:20 pm

NeddySeagoon wrote: ...then press 'e' for edit.
I cant :(
Top
pietinger
Moderator
Moderator
Posts: 6620
Joined: Tue Oct 17, 2006 5:11 pm
Location: Bavaria

  • Quote

Post by pietinger » Tue Jul 04, 2023 8:24 pm

MickeJ wrote:[...] Im asking for pointers how to do that.
I have googled "unpack iso" and the first hit was:
https://www.tecmint.com/extract-files-f ... les-linux/

(I have done it with the loopback device ... but I forgot all ... too many years ;-) )

The same with "linux pack to iso" got me:
https://www.wikihow.com/Create-an-ISO-File-in-Linux
Top
MickeJ
n00b
n00b
Posts: 13
Joined: Mon May 29, 2023 7:56 pm

  • Quote

Post by MickeJ » Tue Jul 04, 2023 8:28 pm

pietinger wrote:
MickeJ wrote:[...] Im asking for pointers how to do that.
I have googled "unpack iso" and the first hit was:
https://www.tecmint.com/extract-files-f ... les-linux/

The same with "linux pack to iso" got me:
https://www.wikihow.com/Create-an-ISO-File-in-Linux
Ok so just unpack the ISO to a folder, do the changes, and create a ISO from the same folder? I can do that, i just thought there was some more magic needed to have it working as a boot with file flags/permissions etc. Maybe i am over thinking it... I will try.
Top
szatox
Advocate
Advocate
Posts: 3858
Joined: Tue Aug 27, 2013 12:35 pm

  • Quote

Post by szatox » Tue Jul 04, 2023 10:04 pm

Yoga does have builtin physical keyboard, right?
It seems really weird for it to be completely unworkable by default. Have you tried any live linux?
I'm specifically pointing out liveCD rather than installCD, because they are made with intention of being used as provided, without any modification. Authors of those might go the extra mile towards hardware detection.

Although making your own bootable iso image is not very difficult (and it is a good exercise expanding your toolkit), trying out a disposable tool that already exists is a perfectly valid tactic too.

BTW, you can just do a regular install on that USB drive, exactly the same way you would on any other hard disk instead of specifically creating an installer cd or livecd. It doesn't matter what media you use to perform an installation on your target device, and a regular install is something you're probably already familiar with and will be easier to modify if you need to try different boot options. Or any other changes for that matter.
Top
MickeJ
n00b
n00b
Posts: 13
Joined: Mon May 29, 2023 7:56 pm

  • Quote

Post by MickeJ » Tue Jul 04, 2023 10:55 pm

szatox wrote:Yoga does have builtin physical keyboard, right?
It seems really weird for it to be completely unworkable by default. Have you tried any live linux?
I'm specifically pointing out liveCD rather than installCD, because they are made with intention of being used as provided, without any modification. Authors of those might go the extra mile towards hardware detection.

Although making your own bootable iso image is not very difficult (and it is a good exercise expanding your toolkit), trying out a disposable tool that already exists is a perfectly valid tactic too.

BTW, you can just do a regular install on that USB drive, exactly the same way you would on any other hard disk instead of specifically creating an installer cd or livecd. It doesn't matter what media you use to perform an installation on your target device, and a regular install is something you're probably already familiar with and will be easier to modify if you need to try different boot options. Or any other changes for that matter.
I tried Ubuntu, Fedora, Arch and ClearLinux installation media, meaning downloading them and dd it into a USB. They all boot fine, except keyboard does not work in any of them.
https://wiki.archlinux.org/title/Lenovo ... _9_(Intel)
The keyboard does not work in neither Xorg nor Wayland, only in the TTY. In order to get it working, add i8042.dumbkbd to the kernel parameters. Note that the Caps Lock LED stops turning on after this.
And https://askubuntu.com/questions/1352604 ... lim-7i-pro

This Lenovo slim laptops has some magic keyboard controller apparently, but it can be made to work.

I agree 100% i want this knowledge in my toolkit, you are right. As such im not really asking how to get the keyboard to work i am sure its just figuring out correct kernel options. Its more how to create an working boot, and you pointed out the obvious that i did not think of. I just install to a USB, on my other computer. And then customize the boot option after and use it on the Yoga. I can use a stage 3 i assume. Is this what you meant?
Top
NeddySeagoon
Administrator
Administrator
User avatar
Posts: 56080
Joined: Sat Jul 05, 2003 9:37 am
Location: 56N 3W

  • Quote

Post by NeddySeagoon » Wed Jul 05, 2023 7:22 am

MickeJ,

If you can't press 'e' before the kernel is loaded, kernel parameters can't fix that.

Only grub and the firmware are available at that time.
Kernel parameters may fix it for later.

Can you get into the BIOS settings?
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Top
sMueggli
l33t
l33t
Posts: 627
Joined: Sat Sep 03, 2022 9:22 am

  • Quote

Post by sMueggli » Wed Jul 05, 2023 8:59 am

I guess you just have to create the USB stick as live-medium/live-system. Then you should mount the USB stick and edit the file boot/grub/grub.cfg on the USB stick. As long as the checksum of boot/grub/grub.cfg is not verified, you should not have any trouble.
Top
szatox
Advocate
Advocate
Posts: 3858
Joined: Tue Aug 27, 2013 12:35 pm

  • Quote

Post by szatox » Wed Jul 05, 2023 2:13 pm

I just install to a USB, on my other computer. And then customize the boot option after and use it on the Yoga. I can use a stage 3 i assume. Is this what you meant?
Yes. It behaves pretty much the same way it would after installing on an internal hard drive, but you can use a different (already working) machine to change the default kernel boot options in your bootloader configuration.
As long as the checksum of boot/grub/grub.cfg is not verified, you should not have any trouble.
Is there even a checksum on grub.cfg? It's been a while since I touched grub, but I never noticed it "back in the days".
Top
logrusx
Advocate
Advocate
User avatar
Posts: 3530
Joined: Thu Feb 22, 2018 2:29 pm

  • Quote

Post by logrusx » Wed Jul 05, 2023 7:23 pm

If you have a working computer, after booting the install cd, maybe you can login through ssh and install from there? I'm not sure if ssh is enabled and if it's possible to login with any default user, what'll other fellow forum users say about that?

Another workaround - USB hub.

Best Regards,
Georgi
Top
MickeJ
n00b
n00b
Posts: 13
Joined: Mon May 29, 2023 7:56 pm

  • Quote

Post by MickeJ » Thu Jul 06, 2023 8:30 pm

I am trying to modify the grub.cfg om the Gentoo installation media as suggested in above posts.

But no matter what i try i can not edit the grub.cfg on partition3 on the Gentoo minimal installation media. I get an error trying to save in vim, "read only filesystem"

When i mount the USB with the Gentoo minimal installation (partition3) i get a DMSG kernel log message
hfsplus: Filesystem is marked locked, mounting read-only.
Gentoo seems to be using hfsplus as partition type for the partition3 where the grub.cfg is located. I have spent more time then i dare to admit trying to find out how to mount a hfsplus partition type in RW mode...

Can anyone help me with:

* How to mount the Gentoo installation partition3 in RW mode https://bouncer.gentoo.org/fetch/root/a ... 83202Z.iso

* And when i can do above, where In the grub cfg, where should i add kernel params? (I never used grub, i always added kernelparams directly in the efibootmgr command.)

Code: Select all

set default=0
set gfxpayload=keep
set timeout=10
insmod all_video

menuentry 'Boot LiveCD (kernel: gentoo)' --class gnu-linux --class os {
	linux /boot/gentoo dokeymap looptype=squashfs loop=/image.squashfs cdroot
	initrd /boot/gentoo.igz
}

menuentry 'Boot LiveCD (kernel: gentoo) (cached)' --class gnu-linux --class os {
	linux /boot/gentoo dokeymap looptype=squashfs loop=/image.squashfs cdroot docache
	initrd /boot/gentoo.igz
}

if [ "x$grub_platform" = xpc ]; then
  menuentry "Memtest86+ 64bit BIOS" {
    linux "/memtest64.bios"
  }
fi
if [ "x$grub_platform" = xefi ]; then
  menuentry "Memtest86+ 64bit UEFI" {
    chainloader "/memtest.efi64"
  }
fi

At this time i have a USB hub staring at me on the desk with a superior smile, but i refuse to give up with the initial plan because i am collecting skillz i did not have before.
Top
sokhapkin
n00b
n00b
Posts: 63
Joined: Thu Jan 13, 2005 2:36 pm
Location: N Ft Myers, FL

  • Quote

Post by sokhapkin » Sat Jul 08, 2023 1:15 am

MickeJ wrote:I am trying to modify the grub.cfg om the Gentoo installation media as suggested in above posts.
...
At this time i have a USB hub staring at me on the desk with a superior smile, but i refuse to give up with the initial plan because i am collecting skillz i did not have before.
I nice solution for non-existent problem. Just use USB hub.
Top
sMueggli
l33t
l33t
Posts: 627
Joined: Sat Sep 03, 2022 9:22 am

  • Quote

Post by sMueggli » Sat Jul 08, 2023 1:39 pm

I was wrongly assuming that the /boot directory on the USB stick is a normal directory and writeable.

I was testing today and it really looks like you need to unpack the iso, change the file and repack the iso.
Top
MickeJ
n00b
n00b
Posts: 13
Joined: Mon May 29, 2023 7:56 pm

  • Quote

Post by MickeJ » Sat Jul 08, 2023 4:14 pm

sokhapkin wrote:I nice solution for non-existent problem. Just use USB hub.
You missing the point, i want to learn what i wrote in this thread subject. Your goals is not my goals, we are not the same.

I get it, subject is hard/people are busy so "Repack the install ISO" response is best i will get for now. No worries Ubuntu wrote a guide i can use as pointers
Top
Post Reply

20 posts • Page 1 of 1

Return to “Installing Gentoo”

Jump to
  • Assistance
  • ↳   News & Announcements
  • ↳   Frequently Asked Questions
  • ↳   Installing Gentoo
  • ↳   Multimedia
  • ↳   Desktop Environments
  • ↳   Networking & Security
  • ↳   Kernel & Hardware
  • ↳   Portage & Programming
  • ↳   Gamers & Players
  • ↳   Other Things Gentoo
  • ↳   Unsupported Software
  • Discussion & Documentation
  • ↳   Documentation, Tips & Tricks
  • ↳   Gentoo Chat
  • ↳   Gentoo Forums Feedback
  • ↳   Duplicate Threads
  • International Gentoo Users
  • ↳   中文 (Chinese)
  • ↳   Dutch
  • ↳   Finnish
  • ↳   French
  • ↳   Deutsches Forum (German)
  • ↳   Diskussionsforum
  • ↳   Deutsche Dokumentation
  • ↳   Greek
  • ↳   Forum italiano (Italian)
  • ↳   Forum di discussione italiano
  • ↳   Risorse italiane (documentazione e tools)
  • ↳   Polskie forum (Polish)
  • ↳   Instalacja i sprzęt
  • ↳   Polish OTW
  • ↳   Portuguese
  • ↳   Documentação, Ferramentas e Dicas
  • ↳   Russian
  • ↳   Scandinavian
  • ↳   Spanish
  • ↳   Other Languages
  • Architectures & Platforms
  • ↳   Gentoo on ARM
  • ↳   Gentoo on PPC
  • ↳   Gentoo on Sparc
  • ↳   Gentoo on Alternative Architectures
  • ↳   Gentoo on AMD64
  • ↳   Gentoo for Mac OS X (Portage for Mac OS X)
  • Board index
  • All times are UTC
  • Delete cookies

© 2001–2026 Gentoo Foundation, Inc.

Powered by phpBB® Forum Software © phpBB Limited

Privacy Policy

 

 

magic