LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 07-07-2009, 11:16 AM   #1
whirler
LQ Newbie
 
Registered: Nov 2008
Posts: 9

Rep: Reputation: 0
Boot issue with newly compiled kernel 2.6.15.7


I checked through the forums and couldn't find any posts with my issue in it so if anyone knows of a post where my problem was solved please point me in the right direction. So, about my problem.

I installed Ubuntu 6.06 because I needed a version of Linux that ran a slightly older kernel (it came with 2.6.15 I belive). I'm installing some software that requires me to have the full source tree of my running kernel available so I decided to compile a new kernel.

I selected 2.6.15.7 because I know for sure that the software I want to compile will compile under that kernel (someone I know has already gotten it working on another machine). I successfully went through the following steps to compile the kernel:

1. download source to /home directory
2. unpacked tarball and then ran make mrproper
3. ran make menuconfig and made sure the config looked good
4. after saving the config from menuconfig I ran make and then make install
5. ran mkinitramfs -o initrd.img-2.6.15.7
6. updated my grub config (menu.lst)
7. tried booting the maching which didn't work becaues I forgot to build modules
8. booted to stock kernel and ran make modules and make modules_install
9. tried booting into new kernel again but this time got different errors which is where I'm stuck now

The errors are:
Code:
WARNING: Couldn't open directory /lib/modules/2.6.15.7: No such file or directory.
and

Code:
FATAL: Could not open /lib/modules/2.6.15.7/modules.dep.temp for writing: no such file or directory
These two errors remain on the screen for a while and then I eventually get this:

Code:
ALERT! /dev/hda1 does not exist. Dropping to a shell!
Does anyone know what I may have done wrong that is preventing my compiled kernel from seeing /dev/hda1? I suspect that's why it can't find the /lib/modules/2.6.15.7 directory. I'm fairly certain that /dev/hda1 is the correct device to reference in my grub configuration because that is what the kernel that works on my system is referencing in grub.

At the present I have relocated my kernel source to /usr/src/linux and corrected the "build" and "source" symlinks in /lib/modules/2.6.15.7 to point to /usr/src/linux. I also changed the "initrd.img" and "vmlinuz" symlinks in / to point to the initrd.img and vmlinuz for my compiled kernel in the /boot directory.
 
Old 07-07-2009, 11:29 AM   #2
Uncle_Theodore
Member
 
Registered: Dec 2007
Location: Charleston WV, USA
Distribution: Slackware 12.2, Arch Linux Amd64
Posts: 896

Rep: Reputation: 71
Looks like you forgot to either enable your HD controller support in your kernel configuration.
 
Old 07-07-2009, 11:38 AM   #3
whirler
LQ Newbie
 
Registered: Nov 2008
Posts: 9

Original Poster
Rep: Reputation: 0
I'll check through my configuration and see what I set for the HD controller. Also, I was looking at something else in my configuration and noticed that I had Ext3 support set to compile as a module instead of being built-in.

The help section said that if your / partition uses ext3 (mine does) it is risky compiling the kernel with ext3 support as a module. Could that have been where I messed up?
 
Old 07-07-2009, 11:57 AM   #4
Uncle_Theodore
Member
 
Registered: Dec 2007
Location: Charleston WV, USA
Distribution: Slackware 12.2, Arch Linux Amd64
Posts: 896

Rep: Reputation: 71
It could, but I thought you said you created an initrd that, in theory, should include the module for your filesystem. What is in there?
 
Old 07-07-2009, 12:31 PM   #5
whirler
LQ Newbie
 
Registered: Nov 2008
Posts: 9

Original Poster
Rep: Reputation: 0
I did create an initrd image. Are you wondering what's in it? Here is the contents of my initrd.img-2.6.15.7:

Code:
#!/bin/sh

mkdir /sys
mkdir /proc
mkdir /tmp
mkdir -p /var/lock
mount -t sysfs none /sys
mount -t proc none /proc

# Note that this only becomes /dev on the real filesystem if udev's scripts
# are used; which they will be, but it's worth pointing out
mount -t tmpfs -o mode=0755 udev /dev
touch /dev/.initramfs-tools
mkdir /dev/.initramfs
mknod /dev/console c 5 1 
mknod /dev/null c 1 3

# Export the dpkg architecture
export DPKG_ARCH=
. /conf/arch.conf

# Bring in the main config
. /conf/initramfs.conf
for i in conf/conf.d/*; do
	[ -f ${i} ] && . ${i}
done
. /scripts/functions

# Parse command line options
export break=
export init=/sbin/init
export quiet=n
export readonly=y
export ROOT=
export resume=${RESUME}
export rootmnt=/root
export debug=
for x in $(cat /proc/cmdline); do
	case $x in
	init=*)
		init=${x#init=}
		;;
	root=*)
		ROOT=${x#root=}
		case $ROOT in
		LABEL=*)
			ROOT="/dev/disk/by-label/${ROOT#LABEL=}"
			;;
		UUID=*)
			ROOT="/dev/disk/by-uuid/${ROOT#UUID=}"
			;;
		esac
		;;
	nfsroot=*)
		NFSROOT=${x#nfsroot=}
		;;
	boot=*)
		BOOT=${x#boot=}
		;;
	resume=*)
		resume=${x#resume=}
		;;
	quiet)
		quiet=y
		;;
	ro)
		readonly=y
		;;
	rw)
		readonly=n
		;;
	debug)
		debug=y
		exec >/tmp/initramfs.debug 2>&1
		set -x
		;;
	break=*)
		break=${x#break=}
		;;
	break)
		break=premount
		;;
	esac
done

depmod -a
maybe_break top

# Don't do log messages here to avoid confusing usplash
run_scripts /scripts/init-top

. /scripts/${BOOT}
parse_numeric ${ROOT}

maybe_break modules
log_begin_msg "Loading essential drivers..."
load_modules
log_end_msg

maybe_break premount
[ "$quiet" != "y" ] && log_begin_msg "Running /scripts/init-premount"
run_scripts /scripts/init-premount
[ "$quiet" != "y" ] && log_end_msg

maybe_break mount
log_begin_msg "Mounting root file system..."
mountroot
log_end_msg

maybe_break bottom
[ "$quiet" != "y" ] && log_begin_msg "Running /scripts/init-bottom"
run_scripts /scripts/init-bottom
[ "$quiet" != "y" ] && log_end_msg

# Move virtual filesystems over to the real filesystem
mount -n -o move /sys ${rootmnt}/sys
mount -n -o move /proc ${rootmnt}/proc

while [ ! -x ${rootmnt}${init} ]; do
	panic "Target filesystem doesn't have ${init}"
done

maybe_break init

# Unset the problematic debug variable and chain to real filesystem
unset debug
exec run-init ${rootmnt} ${init} "$@" <${rootmnt}/dev/console >${rootmnt}/dev/console
 
Old 07-07-2009, 02:07 PM   #6
Uncle_Theodore
Member
 
Registered: Dec 2007
Location: Charleston WV, USA
Distribution: Slackware 12.2, Arch Linux Amd64
Posts: 896

Rep: Reputation: 71
I don't quite get it... /boot/initrd.gz is a binary file. The corresponding tree in my case, for example, looks like this

Code:
ls /boot/initrd-tree/
bin  init   lib         mnt   rootdev  sys
dev  initrd-name  load_kernel_modules  proc   rootfs   wait-for-root
etc  keymap   luksdev        resumedev  sbin
and
Code:
cat /boot/initrd-tree/load_kernel_modules 
# 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:

insmod -v /lib/modules/$(uname -r)/kernel/fs/reiserfs/reiserfs.ko
loads the reiserfs module that I need for my root partition.
 
Old 07-07-2009, 04:14 PM   #7
whirler
LQ Newbie
 
Registered: Nov 2008
Posts: 9

Original Poster
Rep: Reputation: 0
My initrd image is a binary file as well. I had to make a copy of it in a different directory and run it through some commands (cpio was one of them...I forget the rest). The result was a plain text script like the one I included in my post.

Where do I go to see the corresponding tree like you showed? I don't have an initrd-tree directory under /boot. Maybe we're using different distros? I have Ubuntu installed.

Also, I removed and then recompiled the kernel this time including support for ext3 as a built-in feature instead of a module and I still got the same errors when I tried to boot into that kernel.
 
  


Reply


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
Newly compiled kernel won't boot nivantha Linux - Kernel 3 09-14-2006 03:02 AM
Newly Compiled Linux does not seem to Boot binarybob0001 Linux - Newbie 2 12-02-2004 07:05 PM
newly compiled kernel, boot fails class_struggle Linux - Newbie 2 07-30-2004 09:10 AM
uh-oh; boot problem in newly compiled 2.6.0 kernel with GRUB tombomb300 Linux - Newbie 10 01-28-2004 11:58 AM
Newly compiled 2.6-test11 Does not boot Xylon Slackware 3 12-26-2003 12:18 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

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