Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Customizing a kernel starting with a genkernel config
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware
View previous topic :: View next topic  
Author Message
Foszoe
n00b
n00b


Joined: 08 Mar 2016
Posts: 6

PostPosted: Tue Mar 15, 2016 5:01 am    Post subject: Customizing a kernel starting with a genkernel config Reply with quote

I have an Acer Aspire laptop that am dual booting Gentoo and Windows on. I have used Gentoo on a desktop but its 6 years old so I am learning quite a bit from the hardware changes. I always used manual kernel builds in the past, but on this lap top I used genkernel to get up and running a bit quicker.It is also my first exposure to an UEFI system and Grub2. I did use grub legacy on the desktop.

I wanted to go back to running a manual kernel without the initramfs since that is what I was used to so I was going to leave the initramfs removal for last and just remove unneeded modules first because I am familiar with that then I planned to turn off the initramfs in the kernel once I had a kernel with only the modules needed for my laptop.

I zcatted the running genkernel config into the /usr/src/Linux/ directory and made several iterations of removing unnecessary drivers etc for my system. Of course I finally ran into one where it appears I broke it because of some initramfs error it appears as I was dropped into a busybox shell asking for the root fs. I wasn't sure how to tell it what it wanted to know, but I didn't figure it to be big deal because I would just boot with my .old kernel and revisit the changes again.

When I rebooted using the old kernel though, I did not observe the usual Font size change from large to small that I was accustomed to seeing when other kernels had successfully booted. I also "observed" right before the login: prompt 3 red ERROR messages flash by, but when I paged up they were nowhere to be seen. They would have been right after the statement zero modules autoloaded. The sound system no longer worked with the old kernel and I was not able to startx. so the errors may have been something related.

I then tried taking the config.old file and rebuilding the kernel from it since it was originally a good config but I still had the same issues. The only way I have been able to get back to "normal" is to run genkernel again and start over but at some point I ran into the same issue so I am stumped.

can someone point me in the right direction?
Back to top
View user's profile Send private message
frankenputer
n00b
n00b


Joined: 09 Mar 2016
Posts: 26

PostPosted: Tue Mar 15, 2016 6:27 am    Post subject: Reply with quote

Quote:
I wanted to go back to running a manual kernel without the initramfs since that is what I was used to so I was going to leave the initramfs removal for last and just remove unneeded modules first because I am familiar with that then I planned to turn off the initramfs in the kernel once I had a kernel with only the modules needed for my laptop.


I would start with compiling the most generic kernel via genkernel and find out which modules are used by my system using following technique:

modprobed-db:
Quote:
simply use the system (insert USB sticks, use hardware that requires modules, mount filesystems that require modules, etc.)


No you don't have to install the above program, all you need is to borrow the modprobe command.

lsmod|gawk '{print $1}' > system-modules.txt
Code:

lsmod|wc -l
modprobe -a $(sed ':a;N;$!ba;s/\n/ /g' system-modules.txt)
cd /usr/src/linux
make -jX localmodconfig
make -jX menuconfig     # work your way - trial and error
make -jX
make -jX modules_install
make -jX install


Update your boot, and since there is no initramfs grub2 wont include the initrd line.

Boot with the new kernel,
Code:
lsmod|wc -l
&& enjoy the extended battery life.

Project page: https://github.com/graysky2/modprobed-db
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum