LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 12-08-2014, 01:34 PM   #1
haziz
Member
 
Registered: Jan 2012
Location: /dev/null
Distribution: Slackware, Fedora, Debian, Arch, Ubuntu
Posts: 101

Rep: Reputation: 4
How do you set up an Initrd for a different kernel?


I did read Patrick's initrd instructions and have done some googling but am still unclear as to the answer. How do I setup an initrd for a completely different kernel from what I am running? For eg after compiling my own kernel (let's call it vmlinuz.my-kernel.3.18)?
 
Old 12-08-2014, 01:56 PM   #2
moisespedro
Senior Member
 
Registered: Nov 2013
Location: Brazil
Distribution: Slackware
Posts: 1,223

Rep: Reputation: 195Reputation: 195
When you run:

Code:
/usr/share/mkinitrd/mkinitrd_command_generator.sh
You get something like this, right?

Code:
mkinitrd -c -k 3.17.2-smp -f ext4 -r /dev/sdb6 -m mbcache:jbd2:ext4 -u -o /boot/initrd.gz
Notice the -k switch, it refers to the directory entry under /lib/modules:

Code:
root@slack:~# ls -la /lib/modules/
total 32
drwxr-xr-x 6 root root  4096 Dez  4 19:24 ./
drwxr-xr-x 7 root root 12288 Dez  4 19:24 ../
drwxr-xr-x 3 root root  4096 Nov 19 22:58 3.10.17/
drwxr-xr-x 3 root root  4096 Nov 19 22:58 3.10.17-smp/
drwxr-xr-x 3 root root  4096 Dez  4 19:31 3.17.2-smp/
drwxr-xr-x 3 root root  4096 Dez  4 11:26 3.17.2-smp-zram/
In this case is refering to 3.17.2-smp (the kernel I am using now).

I could generate an initrd for 3.10.17, for example, by issuing:
Code:
mkinitrd -c -k 3.10.17 -f ext4 -r /dev/sdb6 -m mbcache:jbd2:ext4 -u -o /boot/initrd.gz
Don't forget to change the output (the -o switch) so you don't overwrite initrds.
 
3 members found this post helpful.
Old 12-08-2014, 08:01 PM   #3
haziz
Member
 
Registered: Jan 2012
Location: /dev/null
Distribution: Slackware, Fedora, Debian, Arch, Ubuntu
Posts: 101

Original Poster
Rep: Reputation: 4
Quote:
Originally Posted by moisespedro View Post
When you run:

Code:
/usr/share/mkinitrd/mkinitrd_command_generator.sh
You get something like this, right?

Code:
mkinitrd -c -k 3.17.2-smp -f ext4 -r /dev/sdb6 -m mbcache:jbd2:ext4 -u -o /boot/initrd.gz
My custom kernel has "haziz-generic-3.18.0" appended using make menuconfig. Do I use mkinitrd -c -k haziz-generic-3.18.0 or just 3.18.0?

Code:
mkinitrd -c -k haziz-generic-3.18.0 -f ext4 -r /dev/sdb6 -m mbcache:jbd2:ext4 -u -o /boot/initrd.gz
or just

Code:
mkinitrd -c -k 3.18.0 -f ext4 -r /dev/sdb6 -m mbcache:jbd2:ext4 -u -o /boot/initrd.gz
Sorry if this seems like a very basic question.

Last edited by haziz; 12-08-2014 at 08:17 PM.
 
1 members found this post helpful.
Old 12-08-2014, 08:50 PM   #4
moisespedro
Senior Member
 
Registered: Nov 2013
Location: Brazil
Distribution: Slackware
Posts: 1,223

Rep: Reputation: 195Reputation: 195
Issue a:

Code:
ls -la /lib/modules
And see how the entry is listed there. It probably looks like 3.18.0-haziz-generic.

EDIT: It is usually something like: kernelversion-whatyouappended, just at look at mine, for example, "3.17.2-smp-zram", smp-zram is the custom append.

Last edited by moisespedro; 12-08-2014 at 08:54 PM.
 
Old 12-09-2014, 04:42 AM   #5
haziz
Member
 
Registered: Jan 2012
Location: /dev/null
Distribution: Slackware, Fedora, Debian, Arch, Ubuntu
Posts: 101

Original Poster
Rep: Reputation: 4
Quote:
Originally Posted by moisespedro View Post
Issue a:

Code:
ls -la /lib/modules
And see how the entry is listed there. It probably looks like 3.18.0-haziz-generic.

EDIT: It is usually something like: kernelversion-whatyouappended, just at look at mine, for example, "3.17.2-smp-zram", smp-zram is the custom append.
Thanks I did figure it out using exactly your method. I did generate the initrd, which seems functional but the generic kernel still panics. The huge kernel (both the stock kernel and a 3.18 compile) boot (obviously without an initrd).
 
Old 12-09-2014, 06:27 AM   #6
moisespedro
Senior Member
 
Registered: Nov 2013
Location: Brazil
Distribution: Slackware
Posts: 1,223

Rep: Reputation: 195Reputation: 195
Well, maybe you open another thread? Post more details about it.
 
Old 12-09-2014, 10:46 AM   #7
cynwulf
Senior Member
 
Registered: Apr 2005
Posts: 2,727

Rep: Reputation: 2367Reputation: 2367Reputation: 2367Reputation: 2367Reputation: 2367Reputation: 2367Reputation: 2367Reputation: 2367Reputation: 2367Reputation: 2367Reputation: 2367
You need to include an initrd stanza in the bootloader configuration, just generating the initrd is not enough, did you do this?
 
Old 12-09-2014, 01:21 PM   #8
moisespedro
Senior Member
 
Registered: Nov 2013
Location: Brazil
Distribution: Slackware
Posts: 1,223

Rep: Reputation: 195Reputation: 195
In case you use LILO you could do something like this:

Code:
root@slack:~# /usr/share/mkinitrd/mkinitrd_command_generator.sh -l /boot/vmlinuz-generic-3.10.17
It will generate what you should paste into /etc/lilo.conf, like this:

Code:
# Linux bootable partition config begins
# initrd created with 'mkinitrd -c -k 3.10.17 -f ext4 -r /dev/sdb6 -m mbcache:jbd2:ext4 -u -o /boot/initrd.gz'
image = /boot/vmlinuz-generic-3.10.17
initrd = /boot/initrd.gz
root = /dev/sdb6
label = 3.10.17
read-only
# Linux bootable partition config ends
Point the -l switch to whatever is your kernel image, don't forget to edit the "initrd =" in /etc/lilo.conf to point to your initrd.
Then you run 'lilo -v'.
 
3 members found this post helpful.
  


Reply



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
for vmlinuz + initrd, append CML how to set root=??? kevin616 Linux - Newbie 0 10-21-2014 08:46 PM
how to set up initrd with aufs poscogrubb Linux - Virtualization and Cloud 0 12-15-2009 07:13 PM
Kernel WITHOUT initrd crispyleif Linux - Newbie 13 07-24-2009 07:26 AM
RHEL 4 : how can I make initrd for kernel version different fromthe base kernel shpandya Red Hat 3 03-13-2009 11:26 PM
Help with Initrd (Kernel 2.6.13 and lvm2) Zmyrgel Slackware 5 07-26-2006 04:55 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 05:16 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