LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
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 05-13-2014, 11:44 AM   #1
Sumguy
Member
 
Registered: Jul 2010
Location: Rural Kentucky, USA.
Distribution: BunsenLabs Linux
Posts: 465
Blog Entries: 2

Rep: Reputation: 119Reputation: 119
Can't Get GRUB2 To Boot Slack Generic Kernel


Hey Guys!

New-to-Slack here (AND loving it!)

I've been trying to dual boot my desktop 'puter with Crunchbang as my primary OS and Slack as my secondary (just till I get it set-up with all my stuff and learn a little...)

I'm using the GRUB2 boot-loader in Crunchbang.

Despite running "grub-mkconfig" and "update-grub" and even editing the /boot/grub/grub.cfg file manually, no matter what I do, I can't get it to boot Slackware with the generic kernel.

If I manually edit it to boot with the huge kernel, it boots up fine.

I tried specifying the initrd.gz file for the generic kernel (when the generic kernel was specified, of course)...but no luck. I get various errors when trying to boot the generic kernel- from it just freezing up, to it saying "can not access tty; job control turned off"- but if I go with the huge kernel- no problemo...it boots right up.

It's gotta be something with the way GRUB is configured.... Can anyone help me get it right?
 
Old 05-13-2014, 12:53 PM   #2
xflow7
Member
 
Registered: May 2004
Distribution: Slackware
Posts: 215

Rep: Reputation: 45
Quote:
Originally Posted by Sumguy View Post
Hey Guys!

I tried specifying the initrd.gz file for the generic kernel (when the generic kernel was specified, of course)...but no luck. I get various errors when trying to boot the generic kernel- from it just freezing up, to it saying "can not access tty; job control turned off"- but if I go with the huge kernel- no problemo...it boots right up.
When you say you specified the initrd.gz, did you actually build an initrd.gz suitable for your hardware first or just point to one that already existed on the install? Depending on your hardware, etc. you may need to build it yourself first to make sure it has the right modules included. README.initrd in /boot is a good resource on how to do that.

Dave
 
1 members found this post helpful.
Old 05-13-2014, 01:28 PM   #3
Woodsman
Senior Member
 
Registered: Oct 2005
Distribution: Slackware 14.1
Posts: 3,482

Rep: Reputation: 546Reputation: 546Reputation: 546Reputation: 546Reputation: 546Reputation: 546
Perhaps verify you have Slackware installed correctly. Use something like the GRUB2 Super CD. Then boot into Slackware from there. If you can boot then you have Slackware configured correctly and the problem is the grub configuration on the Crunchbang side. If you can't boot then look at the Slackware configuration.

As another test, you can use the Slackware DVD to boot intto the Slackware partition. Read the screen instructions after the DVD boots.
 
1 members found this post helpful.
Old 05-13-2014, 02:01 PM   #4
Sumguy
Member
 
Registered: Jul 2010
Location: Rural Kentucky, USA.
Distribution: BunsenLabs Linux
Posts: 465

Original Poster
Blog Entries: 2

Rep: Reputation: 119Reputation: 119
Xflow: Yes, I used the mkinitrd command generator to make the initrd.gz. On a previous installation of Slack, using LIL and everything done the same way, the generic kernel would boot up fine (On I couldn't get Crunchbang to function with LILO- it would boot...but be totally frozen)

Woodsman: It boots fine when the generichuge kernel is specified, so it can't be an installation, no?

Last edited by Sumguy; 05-13-2014 at 03:42 PM.
 
Old 05-13-2014, 04:55 PM   #5
Woodsman
Senior Member
 
Registered: Oct 2005
Distribution: Slackware 14.1
Posts: 3,482

Rep: Reputation: 546Reputation: 546Reputation: 546Reputation: 546Reputation: 546Reputation: 546
What was your full mkinitrd command?
 
Old 05-13-2014, 08:07 PM   #6
Richard Cranium
Senior Member
 
Registered: Apr 2009
Location: McKinney, Texas
Distribution: Slackware64 15.0
Posts: 3,858

Rep: Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225
grub2 works fine for me, but I've got an /etc/grub.d/09_slackware_linux script:
Code:
#! /bin/sh
set -e
# grub-mkconfig helper script.
# Copyright (C) 2006,2007,2008,2009,2010  Free Software Foundation, Inc.
#
# GRUB is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# GRUB is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with GRUB.  If not, see <http://www.gnu.org/licenses/>.

prefix="/usr"
exec_prefix="${prefix}"
datarootdir="${prefix}/share"

. "${datarootdir}/grub/grub-mkconfig_lib"

export TEXTDOMAIN=grub
export TEXTDOMAINDIR="${datarootdir}/locale"

CLASS="--class gnu-linux --class gnu --class os"

if [ "x${GRUB_DISTRIBUTOR}" = "x" ] ; then
  OS=GNU/Linux
else
  OS="${GRUB_DISTRIBUTOR} GNU/Linux"
  CLASS="--class $(echo ${GRUB_DISTRIBUTOR} | tr '[A-Z]' '[a-z]') ${CLASS}"
fi

# loop-AES arranges things so that /dev/loop/X can be our root device, but
# the initrds that Linux uses don't like that.
case ${GRUB_DEVICE} in
  /dev/loop/*|/dev/loop[0-9])
    GRUB_DEVICE=`losetup ${GRUB_DEVICE} | sed -e "s/^[^(]*(\([^)]\+\)).*/\1/"`
  ;;
esac

if [ "x${GRUB_DEVICE_UUID}" = "x" ] || [ "x${GRUB_DISABLE_LINUX_UUID}" = "xtrue" ] \
    || ! test -e "/dev/disk/by-uuid/${GRUB_DEVICE_UUID}" ; then
  LINUX_ROOT_DEVICE=${GRUB_DEVICE}
else
  LINUX_ROOT_DEVICE=UUID=${GRUB_DEVICE_UUID}
fi
linux_entry ()
{
  os="$1"
  tag="$2"
  version="$3"
  recovery="$4"
  args="$5"
  if ${recovery} ; then
    title="$(gettext "%s, with Linux %s [%s] (recovery mode)")"
  else
    title="$(gettext "%s, with Linux %s [%s]")"
  fi
  printf "menuentry \"${title}\" ${CLASS} {\n" "${os}" "${version}" "${tag}"
  save_default_entry | sed -e "s/^/\t/"

  # Use ELILO's generic "efifb" when it's known to be available.
  # FIXME: We need an interface to select vesafb in case efifb can't be used.
  if [ "x$GRUB_GFXPAYLOAD_LINUX" = x ]; then
      if grep -qx "CONFIG_FB_EFI=y" /boot/config-${version} 2> /dev/null \
          && grep -qx "CONFIG_VT_HW_CONSOLE_BINDING=y" /boot/config-${version} 2> /dev/null; then
          cat << EOF
        set gfxpayload=keep
EOF
      fi
  else
          cat << EOF
        set gfxpayload=$GRUB_GFXPAYLOAD_LINUX
EOF
  fi

  if [ -z "${prepare_boot_cache}" ]; then
    prepare_boot_cache="$(prepare_grub_to_access_device ${GRUB_DEVICE_BOOT} | sed -e "s/^/\t/")"
  fi
  printf '%s\n' "${prepare_boot_cache}"
  cat << EOF
        echo    $(printf "$(gettext "Loading Linux %s ...")" ${version})
        linux   ${rel_dirname}/${basename} root=${linux_root_device_thisversion} ro ${args}
EOF
  if test -n "${initrd}" ; then
    cat << EOF
        echo    $(gettext "Loading initial ramdisk ...")
        initrd  ${rel_dirname}/${initrd}
EOF
  fi
  cat << EOF
}
EOF
}


process_list ()
{
    mylist="$1"
    tag="$2"
    initrd_allowed="$3"
    while [ "x$mylist" != "x" ] ; do
        linux=`version_find_latest $mylist`
        echo "Found linux image: $linux" >&2
        basename=`basename $linux`
        dirname=`dirname $linux`
        rel_dirname=`make_system_path_relative_to_its_root $dirname`
        version=`echo $basename | sed -e "s,^[^0-9]*-,,g"`
        alt_version=`echo $version | sed -e "s,\.old$,,g"`
        linux_root_device_thisversion="${LINUX_ROOT_DEVICE}"
        initrd=
        if [ "x${initrd_allowed}" = "xtrue" ]; then
            for i in "initrd-${version}.gz" "initrd.gz" \
                "initrd.img-${version}" "initrd-${version}.img" \
                "initrd-${version}" "initrd.img-${alt_version}" \
                "initrd-${alt_version}.img" "initrd-${alt_version}"; do
                if test -e "${dirname}/${i}" ; then
                    initrd="$i"
                    break
                fi
            done
            if test -n "${initrd}" ; then
                echo "Found initrd image: ${dirname}/${initrd}" >&2
            else
                # "UUID=" magic is parsed by initrds.  Since there's no initrd, it can't work here.
                linux_root_device_thisversion=${GRUB_DEVICE}
            fi
        else
            # "UUID=" magic is parsed by initrds.  Since there's no initrd, it can't work here.
            linux_root_device_thisversion=${GRUB_DEVICE}
        fi

        linux_entry "${OS}" "${tag}" "${version}" false \
            "${GRUB_CMDLINE_LINUX} ${GRUB_CMDLINE_LINUX_DEFAULT}"
        if [ "x${GRUB_DISABLE_LINUX_RECOVERY}" != "xtrue" ]; then
            linux_entry "${OS}" "${tag}" "${version}" true \
                "single ${GRUB_CMDLINE_LINUX}"
        fi

        mylist=`echo $mylist | tr ' ' '\n' | grep -vx $linux | tr '\n' ' '`
    done
}

prepare_boot_cache=

list=`for i in /boot/vmlinu[xz]-generic-* /vmlinu[xz]-generic-* ; do
        if grub_file_is_not_garbage "$i" ; then echo -n "$i " ; fi
      done`

process_list "${list}" "generic" "true"

list=`for i in /boot/vmlinu[xz]-huge-* /vmlinu[xz]-huge-* ; do
        if grub_file_is_not_garbage "$i" ; then echo -n "$i " ; fi
      done`
process_list "${list}" "huge" "false"
As you can tell, it is a mutated copy of 10_linux. The mutation is that it attempts to pair a generic kernel with an initrd with a matching name. I haven't tested it on a 32 bit Slackware; only 64 bit.
 
1 members found this post helpful.
Old 05-13-2014, 09:45 PM   #7
Sumguy
Member
 
Registered: Jul 2010
Location: Rural Kentucky, USA.
Distribution: BunsenLabs Linux
Posts: 465

Original Poster
Blog Entries: 2

Rep: Reputation: 119Reputation: 119
Quote:
Originally Posted by Woodsman View Post
What was your full mkinitrd command?
You mean the actual output of the mkinitrd_command_generator.sh?

I'll boot-up Slack later with the huge kernel, and run the generator and post the output here.

Quote:
Originally Posted by Richard Cranium View Post
grub2 works fine for me, but I've got an /etc/grub.d/09_slackware_linux script:

As you can tell, it is a mutated copy of 10_linux. The mutation is that it attempts to pair a generic kernel with an initrd with a matching name. I haven't tested it on a 32 bit Slackware; only 64 bit.
Ah, Mr. Head.... I wouldn't even know what to do with something like that!

I'm sure it's not a GRUB problem, per se- I wanted to keep GRUB, which is why I chose not install LILO when I installed Slack...figuring I could just make a simple configuration to the grub.cfg and get it to boot Slack... I'm probably just overlooking some little detail....but it's one of those things that until you realize what it is, it just drives ya nuts!

If it'll help...

Here's the manually-edited grub.cfg entry that is working for me with the huge kernel:

Code:
menuentry "Linux (on /dev/sda4)" --class gnu-linux --class gnu --class os {
	insmod part_msdos
	insmod reiserfs
	set root='(hd0,msdos4)'
	search --no-floppy --fs-uuid --set=root 1585792e-4a29-4089-9348-00d6e11024b7
	linux /boot/vmlinuz-huge-smp-3.10.17-smp root=/dev/sda4 ro  vt.default_utf8=0 vga = normal
Here's one of many variations I tried to get the generic kernel to boot: [Differences from the above entry bolded to make it easier for others to distinguish]

Code:
menuentry "Linux (on /dev/sda4)" --class gnu-linux --class gnu --class os {
	insmod part_msdos
	insmod reiserfs
	set root='(hd0,msdos4)'
	search --no-floppy --fs-uuid --set=root 1585792e-4a29-4089-9348-00d6e11024b7
	linux /boot/vmlinuz-generic-smp-3.10.17-smp root=/dev/sda4 ro  vt.default_utf8=0 vga = normal
        initrd /boot/initrd.gz
Funny thing is: The first time I ran grub-mkconfig, it picked up all 4 kernels of Slack, and properly labeled them as Slackware, instead of just "Linux" in the menu entries. Of course, only the two huge kernels would boot- as it did not pick up an initrd for the generics- and even when I added the initrd for the corresponding generic, it still didn't boot.

NOW, however, when I run grub-mkconfig, it's only picking up one kernel...and while I see "Slackware" while the mkinitrd is running....when I actually look at the entry it makes in the .cfg...it just says linux...and is not even bootable, until I edit it manually to point to the huge kernel.

I just don't get it!!!

At this point I'm tempted to boot into the huge kernel and install Slack's LILO on the MBR, and try and get LILO to play nice with Crunchbang. Only thing is, if it doesn't work....I'll have to erase the Slack install so I can put something else on that partition that'll run GRUB to allow me to access Crunchbang- which I need for work, currently.

Unless....could I install GRUB2 IN Slackware? (I'd give that a try, but I've never installed a package in Slackware yet....and really don't know what I'm doing yet )
 
Old 05-13-2014, 10:06 PM   #8
Sumguy
Member
 
Registered: Jul 2010
Location: Rural Kentucky, USA.
Distribution: BunsenLabs Linux
Posts: 465

Original Poster
Blog Entries: 2

Rep: Reputation: 119Reputation: 119
Woodsman; this is the output of my mkinitrd generator:

Code:
mkinitrd -c -k 3.10.17-smp -f reiserfs -r /dev/sda4 -m reiserfs -u -o /boot/initrd.gz
 
Old 05-14-2014, 01:02 AM   #9
Richard Cranium
Senior Member
 
Registered: Apr 2009
Location: McKinney, Texas
Distribution: Slackware64 15.0
Posts: 3,858

Rep: Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225
Well, since it is grub that you're using, you can just interactively try things at boot to see what grub really wants to boot slackware.

But maybe it's something else.

What is the output of the command
Code:
cat /boot/initrd-tree/load_kernel_modules
?
 
1 members found this post helpful.
Old 05-14-2014, 01:17 AM   #10
Sumguy
Member
 
Registered: Jul 2010
Location: Rural Kentucky, USA.
Distribution: BunsenLabs Linux
Posts: 465

Original Poster
Blog Entries: 2

Rep: Reputation: 119Reputation: 119
Quote:
Originally Posted by Richard Cranium View Post
Well, since it is grub that you're using, you can just interactively try things at boot to see what grub really wants to boot slackware.

But maybe it's something else.

What is the output of the command
Code:
cat /boot/initrd-tree/load_kernel_modules
?
I think you put your finger on the problem!

Here's the output:

Code:
# This is a script used to load the kernel modules.
# To use it, chmod it 755, and then add the insmod
# lines needed to load your modules, like this:

modprobe -v reiserfs
I don't really understand what it is I should do there.... [Note: I ran the query from Crunchbang after mounting the Slack filesystem] I "get" that I have to change the permissions...but what exactly do I do after I run the modprobe command? (Would that generate a parameter to add to GRUB?)

Last edited by Sumguy; 05-14-2014 at 01:23 AM.
 
Old 05-14-2014, 09:56 AM   #11
Richard Cranium
Senior Member
 
Registered: Apr 2009
Location: McKinney, Texas
Distribution: Slackware64 15.0
Posts: 3,858

Rep: Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225
Well, it was a sneaky test to see if you really had created your initrd via the mkinitrd command that you had posted.

What error do you get when you *do* try to boot off the generic kernel?
 
1 members found this post helpful.
Old 05-14-2014, 10:55 AM   #12
Sumguy
Member
 
Registered: Jul 2010
Location: Rural Kentucky, USA.
Distribution: BunsenLabs Linux
Posts: 465

Original Poster
Blog Entries: 2

Rep: Reputation: 119Reputation: 119
Quote:
Originally Posted by Richard Cranium View Post
Well, it was a sneaky test to see if you really had created your initrd via the mkinitrd command that you had posted.

What error do you get when you *do* try to boot off the generic kernel?
Sneaky, sneaky, sneaky! (Uh-oh...I just "755"ed it...... )

Depending on what scenario of GRUB entries I try, I get different errors...

Most common: It freezes just after the line which says "rest initrd..." and then I'll have to hit the power button to shutdown, as I just get a flashing "__" wehich won't take any input)

or, it'll say "can not access tty, job control turned off". but when it does that, IIRC, I can do a three-finger-salute to reboot.

Just for future reference: If I were going to do that "modprobe -v reiserfs" thing, how exactly would I:

Code:
 and then add the insmod
# lines needed to load your modules, like this:

modprobe -v reiserfs
??? (By running "modprobe -v reiserfs"? if so, do I have to specify the load_kernel_modules file to run it on? [Not going to do it...just for reference. I oftentimes don't quite understand the syntax of these things- I guess the authors assume a certain level of competence on the part of the reader....)

And thank you and everyone else who has responded thus far, for trying to help. (Heh...part of my reason for wanting to use Slackware, is so that I will be forced to learn Linux. I hadn't learnt much in my past 4 years of Ubuntu/Debian/#! use, 'cause everything just worked...or there was a GUI way to do most everything- which is nice when you don't have time to fool around- but ultimately keeps one ignorant. Just the fact that for the last couple weeks I'm doing everything via CLI, is a real step forward for me...)

Last edited by Sumguy; 05-14-2014 at 10:58 AM.
 
Old 05-14-2014, 05:05 PM   #13
Sumguy
Member
 
Registered: Jul 2010
Location: Rural Kentucky, USA.
Distribution: BunsenLabs Linux
Posts: 465

Original Poster
Blog Entries: 2

Rep: Reputation: 119Reputation: 119
I tried booting the generic kernel again, just for the heck of it. This time, I took note of the errors more closely- and lo-and-behold, "kernel panic" was in there. So for some reason, even though I'm specifying the initrd.gz, it ain't working. I also have Slack installed on my laptop- set up the same way, only using LILO...and it boots up the generic kernel just fine.....weird.
 
Old 05-14-2014, 06:19 PM   #14
Richard Cranium
Senior Member
 
Registered: Apr 2009
Location: McKinney, Texas
Distribution: Slackware64 15.0
Posts: 3,858

Rep: Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225
Quote:
Originally Posted by Sumguy View Post
Just for future reference: If I were going to do that "modprobe -v reiserfs" thing, how exactly would I:

Code:
 and then add the insmod
# lines needed to load your modules, like this:

modprobe -v reiserfs
??? (By running "modprobe -v reiserfs"? if so, do I have to specify the load_kernel_modules file to run it on? [Not going to do it...just for reference. I oftentimes don't quite understand the syntax of these things- I guess the authors assume a certain level of competence on the part of the reader....)
If you want to load a module by using the command line, you'd have to be logged in as root and then you can just execute "modprobe module_name". By default, modprobe will use the currently running kernel version to look for the appropriate module.

There are many, many examples in the file /etc/rc.d/rc.modules (which is normally a symbolic link to a kernel specific version).
 
Old 05-14-2014, 06:23 PM   #15
Richard Cranium
Senior Member
 
Registered: Apr 2009
Location: McKinney, Texas
Distribution: Slackware64 15.0
Posts: 3,858

Rep: Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225
Quote:
Originally Posted by Sumguy View Post
I tried booting the generic kernel again, just for the heck of it. This time, I took note of the errors more closely- and lo-and-behold, "kernel panic" was in there. So for some reason, even though I'm specifying the initrd.gz, it ain't working. I also have Slack installed on my laptop- set up the same way, only using LILO...and it boots up the generic kernel just fine.....weird.
Any chance of taking a picture of the screen with the message and posting a link to it here? There are several ways to trigger a kernel panic, so it would be necessary for us to know which way happened to help.
 
  


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] setting up initrd / generic kernel in Grub2...can't load generic Ubunoob001 Slackware 12 03-20-2015 07:32 AM
Help regarding dual boot slack 14 with other Linux (uses grub/grub2 and UUID) Lilgamesh Slackware 5 04-03-2013 02:14 PM
Generic vs Huge kernel in Slack 12 techyranger Slackware 4 01-23-2008 01:30 PM
slack 12, switch to generic kernel from huge kernel, using grub? jaguarrh Slackware 8 09-19-2007 06:29 AM
Slack 11 kernel-generic-2.6.17.13 file sys error during bootup acummings Slackware 2 04-25-2007 10:06 PM

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

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