LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 02-14-2017, 03:46 AM   #1
suicida
LQ Newbie
 
Registered: May 2004
Posts: 6

Rep: Reputation: 0
Question Restoring kernel from Slackware image


Hey,

It's been a while since i've played with the kernel and last night i was trying to trim the kernel that comes by default with Slackware and now i can't boot none of the kernels, i suspect this is because i made a make module_install install.

- Are there any specific directories that i can restore from the slackware installation image to restore the kernel function?
- Also, is anyone aware of a way to find out what is required for my system?
- Could someone share a .config for the Thinkpad t430?
- Can i test the new kernel image without run the module_install? I'm asking this because i would assume kernel-huge has all the required modules installed already and that it would be just a matter of having the new one load those modules.
 
Old 02-14-2017, 05:59 AM   #2
aragorn2101
Member
 
Registered: Dec 2012
Location: Mauritius
Distribution: Slackware
Posts: 567

Rep: Reputation: 301Reputation: 301Reputation: 301Reputation: 301
All Slackware packages are found at http://packages.slackware.com/.

From a, you'll need:
- kernel-firmware
- kernel-generic
- kernel-huge
- kernel-modules

From k, you'll get the kernel source. Packages are all in txz format.

Then, you boot with something else, mount your Slackware filesystem at a mount point, chroot into the filesystem, remove the damaged packages and install the good ones.
 
Old 02-14-2017, 06:55 AM   #3
suicida
LQ Newbie
 
Registered: May 2004
Posts: 6

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by aragorn2101 View Post
All Slackware packages are found at http://packages.slackware.com/.

From a, you'll need:
- kernel-firmware
- kernel-generic
- kernel-huge
- kernel-modules

From k, you'll get the kernel source. Packages are all in txz format.

Then, you boot with something else, mount your Slackware filesystem at a mount point, chroot into the filesystem, remove the damaged packages and install the good ones.
Thanks for the help! Is there a way to test the new kernel without affecting the old one?
 
Old 02-15-2017, 04:36 AM   #4
aragorn2101
Member
 
Registered: Dec 2012
Location: Mauritius
Distribution: Slackware
Posts: 567

Rep: Reputation: 301Reputation: 301Reputation: 301Reputation: 301
Quote:
Originally Posted by suicida View Post
Thanks for the help! Is there a way to test the new kernel without affecting the old one?
If the versions are different, yes. Since then, the new kernel will not be taking the place of the old one. But if you want to replace the kernel, then I think, no.

Actually, if you could place the kernel image (vmlinuz, generic or huge) under another name at /boot and add an entry to lilo.conf or grub.cfg; then just the kernel image is a different one, but /etc/rc.modules will then report errors because the modules will be missing. You could experiment with that and see.
 
Old 02-15-2017, 05:42 AM   #5
GazL
LQ Veteran
 
Registered: May 2008
Posts: 6,896

Rep: Reputation: 5018Reputation: 5018Reputation: 5018Reputation: 5018Reputation: 5018Reputation: 5018Reputation: 5018Reputation: 5018Reputation: 5018Reputation: 5018Reputation: 5018
When you make your custom kernel configuration, set CONFIG_LOCALVERSION to a string of your choosing (it's under the 'general' section if I remember rightly). That way your modules-directory will be given a unique name that won't clash with the stock modules even if it's a rebuild of the same version of the kernel. I use '-local'. I also use the same string for my vmlinuz file, so I have
Code:
test@ws1:~$ ls -l /boot/vmlinuz* /lib/modules/
-rw-r--r-- 1 root root 5509104 Feb 14 23:55 /boot/vmlinuz-4.9.10-local
lrwxrwxrwx 1 root root      26 Feb 14 23:59 /boot/vmlinuz-4.9.y-local -> /boot/vmlinuz-4.9.10-local

/lib/modules/:
total 4
drwxr-xr-x 3 root root 4096 Feb 14 23:59 4.9.10-local
I don't have the stock kernels installed, but you can see from above that if I did, they wouldn't clash.
 
Old 02-16-2017, 11:10 AM   #6
suicida
LQ Newbie
 
Registered: May 2004
Posts: 6

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by aragorn2101 View Post
If the versions are different, yes. Since then, the new kernel will not be taking the place of the old one. But if you want to replace the kernel, then I think, no.

Actually, if you could place the kernel image (vmlinuz, generic or huge) under another name at /boot and add an entry to lilo.conf or grub.cfg; then just the kernel image is a different one, but /etc/rc.modules will then report errors because the modules will be missing. You could experiment with that and see.
The kernel version is the same one, i'm just trying to trim the modules on the huge kernel that comes with slackware and the way i've been doing is build the image and move it to /boot/ and grub-mkconfig -o /boot/grub/grub.cfg but because i kept getting kernel panics i thought i was doing something wrong so i decided to do it as if i was installing a new kernel and i end up screwing the whole system. I guess i'll have to keep trying until i get the modules right.
 
Old 02-17-2017, 02:42 AM   #7
itsgregman
Member
 
Registered: Jan 2008
Location: North Carolina
Distribution: Slackware 14.1
Posts: 211

Rep: Reputation: 77
Did you create an initrd for your trimmed kernel?
Why try and remove modules from the huge kernel instead of just using the generic with an initrd?
I'm not sure I understand what you were trying to do so those may be stupid questions but I'm just curious.
 
Old 02-17-2017, 05:31 AM   #8
colorpurple21859
LQ Veteran
 
Registered: Jan 2008
Location: florida panhandle
Distribution: Slackware Debian, Fedora, others
Posts: 7,344

Rep: Reputation: 1587Reputation: 1587Reputation: 1587Reputation: 1587Reputation: 1587Reputation: 1587Reputation: 1587Reputation: 1587Reputation: 1587Reputation: 1587Reputation: 1587
First do as Gazl says and set a local user string during the configuration and name your new kernel and map with the local string included in the name.
Second compile the drivers needed to boot your system into the kernel, not as modules, so an initrd won't be needed.
Third using grub as the boot loader will make it easier to switch between your non working new kernel and the stock kernel till you get things right on your new kernel. By using grub won't have to remember to rerun lilo after each try to get it to work.

Last edited by colorpurple21859; 02-17-2017 at 05:36 AM.
 
  


Reply

Tags
config, kernel, panic, thinkpad


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
prerequisites for restoring dd OS image procfs Linux - Newbie 2 08-21-2014 04:36 AM
Using 'dd' and 'gzip' to create a disk image. Restoring image: can't find lvm_root. skiman1979 Linux - Desktop 2 02-25-2012 05:42 AM
Restoring an image on VMware NetRock Linux - Virtualization and Cloud 1 12-13-2011 02:07 PM
restoring image using clonezilla in citrix VM amondre Linux - Server 0 03-22-2011 07:10 AM
Restoring a split HD image drt1245 Linux - Software 12 12-14-2005 07:11 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 10:21 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration