LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
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-12-2013, 09:53 PM   #1
chexmix
Member
 
Registered: Apr 2002
Location: Arlington, MA
Distribution: Slackware, Debian, OpenBSD
Posts: 246
Blog Entries: 16

Rep: Reputation: 25
Question mkinitrd_command_generator.sh doesn't recognize kernel file ...?


Hi --

I just updated my netbook to Slack64-current, with the 3.9.5 kernel. I couldn't seem to get mkinitrd_command_generator.sh to work correctly while 3.8.13 was still running, so I rebooted (I don't run LILO as this is a dual-boot machine with Debian ... I use grub). I knew I would have to boot using the Slack 14 DVD (since I hadn't created an initrd), but I'd done this before, so did not worry too much ...

However, when I rebooted using the disc and attempted to build an initrd, I got the following:

Code:
root@catbutt:/usr/share/mkinitrd# ./mkinitrd_command_generator.sh /boot/vmlinuz-generic-3.9.5
File '/boot/vmlinuz-generic-3.9.5' does not look like it is a kernel file!
and indeed, behold:

Code:
root@catbutt:/boot# file vmlinuz-generic-3.9.5
vmlinuz-generic-3.9.5: x86 boot sector
... huh?

Never seen the like. I mean, sure, I can see where the line in the script is that's generating that message, but ...

... I guess I'm wondering how I convince not only mkinitrd_command_generator.sh, but the file command / my system that that file is indeed a kernel file.

Any advice would be welcome. This has me confused.

Thx,

Glenn
 
Old 06-12-2013, 10:18 PM   #2
kfritz
Member
 
Registered: Aug 2006
Distribution: Slackware, OpenBSD, CentOS, Ubuntu
Posts: 99

Rep: Reputation: 31
Similar results here running in a VM:

Code:
root@sl64-current:~# file /boot/vmlinuz-huge-3.9.5 
/boot/vmlinuz-huge-3.9.5: x86 boot sector
root@sl64-current:~# file /boot/vmlinuz-generic-3.9.5 
/boot/vmlinuz-generic-3.9.5: x86 boot sector
root@sl64-current:~# /usr/share/mkinitrd/mkinitrd_command_generator.sh /boot/vmlinuz-huge-3.9.5 
File '/boot/vmlinuz-huge-3.9.5' does not look like it is a kernel file!
root@sl64-current:~# uname -a
Linux sl64-current 3.8.13 #2 SMP Sun May 12 17:23:24 CDT 2013 x86_64 QEMU Virtual CPU version 1.2.0 AuthenticAMD GNU/Linux
So, I don't think you muffed anything.
 
Old 06-13-2013, 01:07 AM   #3
nivieru
Member
 
Registered: Feb 2008
Posts: 78

Rep: Reputation: 14
You should try
Code:
/usr/share/mkinitrd/mkinitrd_command_generator.sh -k 3.9.5
It worked for me.
 
1 members found this post helpful.
Old 06-13-2013, 06:20 AM   #4
Alien Bob
Slackware Contributor
 
Registered: Sep 2005
Location: Eindhoven, The Netherlands
Distribution: Slackware
Posts: 8,559

Rep: Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106
Thanks for reporting this.

The 'file' utility changed its output message... bad bad.
This patch to the script will make it work again (for old as well as new Slackware versions):

Code:
$ diff -uar source/a/mkinitrd/mkinitrd_command_generator.sh{.orig,}
--- source/a/mkinitrd/mkinitrd_command_generator.sh.orig        2012-12-11 23:28:40.000000000 +0100
+++ source/a/mkinitrd/mkinitrd_command_generator.sh     2013-06-13 13:16:00.480483900 +0200
@@ -380,7 +380,7 @@
           KFILE=$(basename $KFILE)
         fi
         KFILE=${KFILEPATH}/$KFILE
-        if [ -z "$(file $KFILE | grep 'Linux kernel x86 boot')" ]; then
+        if [ -z "$(file $KFILE | grep -E 'Linux kernel x86 boot|x86 boot sector')" ]; then
           echo "File '$KFILE' does not look like it is a kernel file!"
           exit 1
         fi
I will notify Pat so that he can apply this to the Slackware tree.

Eric
 
Old 06-13-2013, 09:56 AM   #5
eloi
Member
 
Registered: Nov 2010
Posts: 227

Rep: Reputation: 61
Hi chexmix,

Learning to use mkinitrd directly is easier .

If the kernel you pass to mkinitrd options is not present, mkinitrd will tell
you with an error message.

Once you know what you *specifically* need and how to do it, write a shell
script yourself. If it takes you more than 30 lines you're giving more
importance to your creation than to the function it was created to.

For example, I don't use LVM or RAID so this is all what I need in my desktop
after a fresh Slackware installation (the awk string contains one space and one
tab between the square brackets):

Code:
#!/bin/sh
# Slackware: generate initrd and set generic kernel in lilo

[ `whoami` != "root" ] && echo "You must be root" && exit 1

kernel=`uname -r`
file=`awk '/[	 ]+\/[	 ]+/ { print $3 }' /etc/fstab`
root=`awk '/[	 ]+\/[	 ]+/ { print $1 }' /etc/fstab`
swap=`awk '/swap/ { print $1 }' /etc/fstab`

rm /boot/{vmlinuz,System.map,config}
ln -s /boot/vmlinuz-generic-$kernel /boot/vmlinuz
ln -s /boot/System.map-generic-$kernel /boot/System.map
ln -s /boot/config-generic-$kernel /boot/config

grep 'initrd\ *=\ */boot/initrd.gz' /etc/lilo.conf >/dev/null ||
sed -i '/Linux bootable partition config ends/iinitrd=\/boot\/initrd.gz' \
	/etc/lilo.conf

mkinitrd -c -k $kernel -f $file -m $file -r $root -h $swap && lilo

exit 0
And being simple is useful like a memory-aid too. When you are in front of a
problem like the one you describe you easily figure out how to workaround it.

Using free software does not free you, your mind does.


Walter

Last edited by eloi; 06-16-2013 at 11:58 AM.
 
Old 06-13-2013, 12:04 PM   #6
Alien Bob
Slackware Contributor
 
Registered: Sep 2005
Location: Eindhoven, The Netherlands
Distribution: Slackware
Posts: 8,559

Rep: Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106
I do not think you ever need mkinitrd_commandline_generator.sh with a simple setup like yours.
The script is obviously not meant for you but for others with a more complex setup (LVM, RAID, LUKS, USB keyboard, exotic controllers etc).

Eric
 
Old 06-13-2013, 01:00 PM   #7
volkerdi
Slackware Maintainer
 
Registered: Dec 2002
Location: Minnesota
Distribution: Slackware! :-)
Posts: 2,498

Rep: Reputation: 8450Reputation: 8450Reputation: 8450Reputation: 8450Reputation: 8450Reputation: 8450Reputation: 8450Reputation: 8450Reputation: 8450Reputation: 8450Reputation: 8450
Quote:
Originally Posted by Alien Bob View Post
I do not think you ever need mkinitrd_commandline_generator.sh with a simple setup like yours.
It's a useful script for anyone wanting to use the generic kernel, and I do think it's better to run the generic kernel than the huge one to get all the unused drivers out of the system memory.
 
1 members found this post helpful.
Old 06-13-2013, 04:27 PM   #8
01micko
Member
 
Registered: Mar 2009
Location: Gold Coast, Queensland, Australia
Distribution: Puppy, Slackware
Posts: 92

Rep: Reputation: 18
FWIW, running the generic kernel makes a noticeable speed difference on my compaq-cq60 laptop (-current).
 
Old 06-13-2013, 07:56 PM   #9
Poprocks
Member
 
Registered: Sep 2003
Location: Toronto, Canada
Distribution: Slackware
Posts: 522

Rep: Reputation: 279Reputation: 279Reputation: 279
I've never noticed a difference in speed myself, but it's nice to be able to unload and reload non-behaving device drivers (doesn't happen often, but it does happen) by way of reloading modules rather than rebooting the entire system.
 
Old 06-13-2013, 08:11 PM   #10
TobiSGD
Moderator
 
Registered: Dec 2009
Location: Germany
Distribution: Whatever fits the task best
Posts: 17,148
Blog Entries: 2

Rep: Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886
Usually I run the mkinitrd_commandline_generator.sh only one time on a new machine, then I just enter the options it provides into /etc/mkinitrd.conf and use mkinitrd directly with the -k and -F options. Works all the time.

Last edited by TobiSGD; 06-14-2013 at 05:04 AM.
 
Old 06-14-2013, 02:57 AM   #11
eloi
Member
 
Registered: Nov 2010
Posts: 227

Rep: Reputation: 61
It's the approach I suggest in human language what is useful, the idea. The script is just an example.
 
Old 06-14-2013, 07:11 AM   #12
chexmix
Member
 
Registered: Apr 2002
Location: Arlington, MA
Distribution: Slackware, Debian, OpenBSD
Posts: 246

Original Poster
Blog Entries: 16

Rep: Reputation: 25
Many thanks to everyone who replied. Lots of food for thought and practice.

I issued

Code:
/usr/share/mkinitrd/mkinitrd_command_generator.sh -k 3.9.5
per nivieru and it worked swell.

If my reporting this helped the world's best Linux distro (or anyone who uses it) in a small way, that makes me happy.
 
Old 06-17-2013, 05:31 AM   #13
eloi
Member
 
Registered: Nov 2010
Posts: 227

Rep: Reputation: 61
The Barrel of Shit Theory vs. The Flush Toilet Theory - Part II

Perhaps this talk about stuff by George Carlin is better than me to explain where is the bug:

http://youtu.be/MvgN5gCuLac

---
Just a clarification for the readers of this forum.

The Barrel of Shit Theory vs the Flush Toilet Theory (that I've already used on other thread) is just a funny metaphor that used a school teacher I had in my young years referring to thinking. Using it I am advocating the KISS Unix philosophy that Slackware supposedly follows.

Last edited by eloi; 06-18-2013 at 03:29 AM. Reason: Added clarification
 
Old 06-17-2013, 06:08 AM   #14
Alien Bob
Slackware Contributor
 
Registered: Sep 2005
Location: Eindhoven, The Netherlands
Distribution: Slackware
Posts: 8,559

Rep: Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106
Quote:
Originally Posted by eloi View Post
Perhaps this talk about stuff by George Carlin is better than me to explain where is the bug:

http://youtu.be/MvgN5gCuLac
First, the bug was discussed, a patch was created and submitted already.
Second, I take offense to the phrase "Barrel of Shit" when you refer to this bug that you are not willing to discuss.
For you, only one answer remains: *PLONK*

Eric
 
3 members found this post helpful.
  


Reply

Tags
current, kernel, mkinitrd


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
GRUB2 doesn't recognize grub.cfg file dragos240 Linux From Scratch 3 07-27-2010 10:16 AM
Kernel doesn't recognize my touchpad? kenneho Linux - Newbie 1 11-06-2008 02:10 PM
Slack 10.1 kernel 2.6.10 doesn´t recognize CDrom little_ball Slackware 4 08-15-2005 11:33 AM
New kernel doesn't recognize my modem's UART Kanaflloric Linux - Hardware 0 09-28-2004 10:54 PM

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

All times are GMT -5. The time now is 08:05 PM.

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