LinuxQuestions.org
Review your favorite Linux distribution.
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 06-19-2021, 07:07 AM   #1
3rensho
Senior Member
 
Registered: Mar 2008
Location: Deutschland
Distribution: Slackware64-current
Posts: 1,023

Rep: Reputation: 615Reputation: 615Reputation: 615Reputation: 615Reputation: 615Reputation: 615
(Another) mkinird question


I have been building generic kernels on 64-current for a while now and all runs just fine when I build my initrd.gz using "mkinitrd -c -R -k $kerno -m ext4"(no quotes) in a short script where I prompt for the kernel version. If I use the mkinitrd shell script in /usr/share to generate a mkinitrd.conf in /etc and then generate my initrd.gz using mkinitrd -c -F at a command prompt from the /boot directory it generated the initrd.gz but the system won't boot, stopping shortly after the boot starts saying that it can't find /mnt. The mkinitrd.conf file is -

Code:
cat mkinitrd.conf
#
# mkinitrd_command_generator.sh revision 1.45
#
# This script will now make a recommendation about the command to use
# in case you require an initrd image to boot a kernel that does not
# have support for your storage or root filesystem built in
# (such as the Slackware 'generic' kernels').
# A suitable 'mkinitrd' command will be:

mkinitrd -c -k 5.12.12 -f ext4 -r /dev/md126 -m xhci-pci:ohci-pci:ehci-pci:xhci-hcd:uhci-hcd:ehci-hcd:hid:usbhid:i2c-hid:hid_generic:hid-asus:hid-cherry:hid-logitech:hid-logitech-dj:hid-logitech-hidpp:hid-lenovo:hid-microsoft:hid_multitouch:jbd2:mbcache:crc32c_intel:crc32c_generic:ext4 -R -u -o /boot/initrd.gz
This is exactly what happened some time ago when I tried to boot a generic kernel and had not read the man page thoroughly for mkinitrd and had neglected to add the -R command line parameter to reflect that it is a raid system. The mkinitrd.conf file does however include a -R so that should not be the problem.

I'm Probably missing something obvious but can't see forrest for trees at this point. Thanks in advance.
 
Old 06-19-2021, 07:33 AM   #2
GazL
LQ Veteran
 
Registered: May 2008
Posts: 6,897

Rep: Reputation: 5019Reputation: 5019Reputation: 5019Reputation: 5019Reputation: 5019Reputation: 5019Reputation: 5019Reputation: 5019Reputation: 5019Reputation: 5019Reputation: 5019
That's not a mkinitrd.conf file you've generated. It's a script containing a mkinitrd command.

A mkinitrd.conf will look something like this:
Code:
# mkinitrd.conf.sample
# See "man mkinitrd.conf" for details on the syntax of this file
#
#SOURCE_TREE="/boot/initrd-tree"
CLEAR_TREE="1"
#OUTPUT_IMAGE="/boot/initrd.gz"
#KERNEL_VERSION="$(uname -r)"
KEYMAP="uk"
# MODULE_LIST="xhci-pci:ohci-pci:ehci-pci:xhci-hcd:uhci-hcd:ehci-hcd:hid:usbhid:i2c-hid:hid_generic:hid-asus:hid-cherry:hid-logitech:hid-logitech-dj:hid-logitech-hidpp:hid-lenovo:hid-microsoft:hid_multitouch"
MODULE_LIST="ext4:xhci-pci:xhci-hcd:usbhid:hid-generic"
LUKSDEV="/dev/sda4"
ROOTDEV="/dev/sysvg/lvslack"
ROOTFS="ext4"
LVM="1"
MICROCODE_ARCH='/boot/intel-ucode-local.cpio'

Last edited by GazL; 06-19-2021 at 07:36 AM.
 
1 members found this post helpful.
Old 06-19-2021, 07:49 AM   #3
chrisretusn
Senior Member
 
Registered: Dec 2005
Location: Philippines
Distribution: Slackware64-current
Posts: 2,971

Rep: Reputation: 1548Reputation: 1548Reputation: 1548Reputation: 1548Reputation: 1548Reputation: 1548Reputation: 1548Reputation: 1548Reputation: 1548Reputation: 1548Reputation: 1548
To add to what GazL said, use this command to generate a proper mkinitrd.conf file. This is what is generated on this computer.

Code:
/usr/share/mkinitrd/mkinitrd_command_generator.sh -c
SOURCE_TREE="/boot/initrd-tree"
CLEAR_TREE="1"
OUTPUT_IMAGE="/boot/initrd.gz"
KERNEL_VERSION="5.12.12"
KEYMAP="us"
MODULE_LIST="jbd2:mbcache:crc32c_intel:crc32c_generic:ext4"
LUKSDEV=""
ROOTDEV="/dev/sda1"
ROOTFS="ext4"
RESUMEDEV=""
RAID=""
LVM=""
UDEV="1"
WAIT="1"
This is what I use on this computer.
Code:
cat /etc/mkinitrd.conf
SOURCE_TREE="/boot/initrd-tree"
CLEAR_TREE="1"
OUTPUT_IMAGE="/boot/initrd.gz"
KEYMAP="us"
MODULE_LIST="jbd2:mbcache:ext4"
LUKSDEV=""
ROOTDEV="/dev/sda1"
ROOTFS="ext4"
RESUMEDEV=""
RAID=""
LVM=""
UDEV="1"
WAIT="1"
My laptop has a very long line for the MODULE_LIST entry similar to GazL's
 
2 members found this post helpful.
Old 06-19-2021, 07:52 AM   #4
GazL
LQ Veteran
 
Registered: May 2008
Posts: 6,897

Rep: Reputation: 5019Reputation: 5019Reputation: 5019Reputation: 5019Reputation: 5019Reputation: 5019Reputation: 5019Reputation: 5019Reputation: 5019Reputation: 5019Reputation: 5019
Quote:
Originally Posted by chrisretusn View Post
My laptop has a very long line for the MODULE_LIST entry similar to GazL's
Yes, mkinitrd_command_generation does go overboard with included modules, as can be seen by the commented out line in my example, compared to what I actually need below it.
 
Old 06-19-2021, 08:06 AM   #5
3rensho
Senior Member
 
Registered: Mar 2008
Location: Deutschland
Distribution: Slackware64-current
Posts: 1,023

Original Poster
Rep: Reputation: 615Reputation: 615Reputation: 615Reputation: 615Reputation: 615Reputation: 615
Oh, OK. Thanks for your responses. Will give it a shot. Knew I had somehow totally messed up.
 
Old 06-19-2021, 08:29 AM   #6
3rensho
Senior Member
 
Registered: Mar 2008
Location: Deutschland
Distribution: Slackware64-current
Posts: 1,023

Original Poster
Rep: Reputation: 615Reputation: 615Reputation: 615Reputation: 615Reputation: 615Reputation: 615
Can't believe I could be so DOOF (German for dumb ass)! Thank you gentlemen. Major dumb shit here. Did as you described and of course it worked like a charm. Thank you again. Will have RTFM tatooed on the inside of my eyelids.
 
Old 06-19-2021, 08:43 AM   #7
chrisretusn
Senior Member
 
Registered: Dec 2005
Location: Philippines
Distribution: Slackware64-current
Posts: 2,971

Rep: Reputation: 1548Reputation: 1548Reputation: 1548Reputation: 1548Reputation: 1548Reputation: 1548Reputation: 1548Reputation: 1548Reputation: 1548Reputation: 1548Reputation: 1548
Quote:
Originally Posted by 3rensho View Post
Can't believe I could be so DOOF (German for dumb ass)! Thank you gentlemen. Major dumb shit here. Did as you described and of course it worked like a charm. Thank you again. Will have RTFM tatooed on the inside of my eyelids.
Hey we all do DOOF things every now and then. Glad it all sorted out.
 
Old 06-19-2021, 10:03 AM   #8
Paulo2
Member
 
Registered: Aug 2012
Distribution: Slackware64 15.0 (started with 13.37). Testing -current in a spare partition.
Posts: 928

Rep: Reputation: 515Reputation: 515Reputation: 515Reputation: 515Reputation: 515Reputation: 515
Are you booting from a usb disk? I'm asking because of the presence of usb modules in your modules list.
I think you missed the -w option, usb needs some time to be recognized.
In the chrisretusn's config file it is 'WAIT=1'
 
Old 06-19-2021, 10:43 AM   #9
3rensho
Senior Member
 
Registered: Mar 2008
Location: Deutschland
Distribution: Slackware64-current
Posts: 1,023

Original Poster
Rep: Reputation: 615Reputation: 615Reputation: 615Reputation: 615Reputation: 615Reputation: 615
Quote:
Originally Posted by Paulo2 View Post
Are you booting from a usb disk? I'm asking because of the presence of usb modules in your modules list.
I think you missed the -w option, usb needs some time to be recognized.
In the chrisretusn's config file it is 'WAIT=1'
No, booting from regular hard disk raid. Will refine the config script in the future to remove some of the unnecessary modules. This was just a first go to get it running with a .conf file.
 
Old 06-19-2021, 01:11 PM   #10
philanc
Member
 
Registered: Jan 2011
Posts: 308

Rep: Reputation: 273Reputation: 273Reputation: 273
Quote:
Originally Posted by 3rensho View Post
Will have RTFM tatooed on the inside of my eyelids.
Of course I get the joke, but still, the idea of tattooing something inside eyelids just made me cringe!
 
Old 06-20-2021, 04:32 AM   #11
chrisretusn
Senior Member
 
Registered: Dec 2005
Location: Philippines
Distribution: Slackware64-current
Posts: 2,971

Rep: Reputation: 1548Reputation: 1548Reputation: 1548Reputation: 1548Reputation: 1548Reputation: 1548Reputation: 1548Reputation: 1548Reputation: 1548Reputation: 1548Reputation: 1548
Quote:
Originally Posted by GazL View Post
Yes, mkinitrd_command_generation does go overboard with included modules, as can be seen by the commented out line in my example, compared to what I actually need below it.
Yes indeed, I edit out mine as well.
 
Old 06-21-2021, 10:54 AM   #12
eduardr
Member
 
Registered: Sep 2011
Distribution: Slackware64 14.2+ (-current)
Posts: 106

Rep: Reputation: Disabled
I like to reformat my sections to make it easier to follow, for example

Code:
# mkinitrd.conf

#~~~~~~~~~~~~~~~~#
# Basic settings #
#~~~~~~~~~~~~~~~~#

#SOURCE_TREE="/boot/initrd-tree"
CLEAR_TREE="1"
#OUTPUT_IMAGE="/boot/initrd.gz"
#KERNEL_VERSION="$(uname -r)"
#KEYMAP="us"
#MODULE_LIST="ext4"
#LUKSDEV="/dev/sda2"
#LUKSTRIM="/dev/sda2" # verify support with 'hdparm -I $dev | grep TRIM'
#LUKSKEY="LABEL=TRAVELSTICK:/keys/alienbob.luks"
ROOTDEV="/dev/disk/by-label/root"
ROOTFS="ext4"
#RESUMEDEV="/dev/sda2"
RAID="1"
#LVM="0"
UDEV="1"
#MODCONF="0"
#MICROCODE_ARCH="/boot/intel-ucode.cpio"
#WAIT="1"


#~~~~~~~~~~~~~~~~#
# Kernel modules #
#~~~~~~~~~~~~~~~~#

# Initialize empty module list
MODULE_LIST=""

# CRC32C perf on CPU's with SSE4.2
MODULE_LIST+="crc32c-intel:"

# USB support
MODULE_LIST+="ehci-pci:"
MODULE_LIST+="ohci-pci:"
MODULE_LIST+="uhci-hcd:"
MODULE_LIST+="xhci-pci:"

# USB HID support
MODULE_LIST+="hid:"
MODULE_LIST+="usbhid:"
MODULE_LIST+="i2c-hid:"
MODULE_LIST+="hid_generic:"
MODULE_LIST+="hid-asus:"
MODULE_LIST+="hid-cherry:"
MODULE_LIST+="hid-lenovo:"
MODULE_LIST+="hid-logitech:"
MODULE_LIST+="hid-logitech-dj:"
MODULE_LIST+="hid-logitech-hidpp:"
MODULE_LIST+="hid-microsoft:"
MODULE_LIST+="hid_multitouch:"

# USB mass storage support
MODULE_LIST+="usb-storage:"

# LSI MegaRAID SAS support
MODULE_LIST+="megaraid_sas:"

# LSI Fusion MPT parallel SCSI support
MODULE_LIST+="mptspi:"

# LSI Fusion MPT SAS 1.0 support
MODULE_LIST+="mptsas:"

# LSI Fusion MPT SAS 2.0/3.0 support
MODULE_LIST+="mpt3sas:"

# Linux Ext4 file system support
MODULE_LIST+="ext4:"
 
  


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
[SOLVED] Update from fc5 to fc9 kernel panic, no initrd, mkinird fails jslavranchuk Fedora 1 06-14-2008 02:24 AM
Another Nvidia drivers question from another extreme noob Gosnell Linux - Newbie 3 11-06-2003 11:11 PM
Another newbie, another distro question Keep Skankin Linux - Distributions 8 06-11-2003 09:45 PM
Another newb, another problem... Fishbu Slackware 5 03-08-2003 09:56 PM
Another day, another question tha_newbfather Linux - Newbie 6 02-28-2002 04:15 PM

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

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