NSLU2-Linux
view · edit · print · history

HowTo.RecoverBrokenDebianKernel History

Hide minor edits - Show changes to markup

August 08, 2008, at 03:57 AM by Stephen Blackheath --
Added lines 90-105:

My second lenny problem

The boot stalled here...

Checking root file system...fsck 1.40-WIP (14-Nov-2006)
/dev/sda3: Superblock last mount time is in the future.  FIXED.
/dev/sda3: clean, 1904722/36519936 files, 49665341/73013416 blocks
done.
EXT3 FS on sda3, internal journal
x1205 0-006f: rtc intf: dev (254:0)
Setting the system clock..

I was able to fix this by getting rid of /etc/rcS.d/S11hwclock.sh (by mounting my disk on a PC). This will get reverted if the package gets upgraded, though.

August 08, 2008, at 03:30 AM by Stephen Blackheath --
Changed line 89 from:

This takes a long long time on the NSLU2. Reinstalling the kernel with "apt-get --reinstall install <version>" is simpler and will also work but it is very very slow, and I am trying to save you the hours it took me.

to:

This takes a long long time on the NSLU2 (about 10 mins). Reinstalling the kernel with "apt-get --reinstall install <version>" is simpler and will also work but it is very very slow, and I am trying to save you the hours it took me.

August 08, 2008, at 03:30 AM by Stephen Blackheath --
Changed lines 5-6 from:

Install and start the Debian installer, according to these instructions:

to:

Install and start the Debian installer, according to these instructions (use the unslug2 method):

Changed lines 86-88 from:

update-initramfs -c -k 2.6.18-6-ixp4xx@]

This takes a long long time on the NSLU2. Reinstalling the kernel with "apt-get --reinstall install <version>" should also work but I am trying to save you time.

to:

update-initramfs -c -k 2.6.18-6-ixp4xx flash-kernel@]

This takes a long long time on the NSLU2. Reinstalling the kernel with "apt-get --reinstall install <version>" is simpler and will also work but it is very very slow, and I am trying to save you the hours it took me.

August 08, 2008, at 03:11 AM by Stephen Blackheath --
Changed lines 60-61 from:

Create a file called /etc/initramfs-tools/hooks/fix-gcc which contains the following text:

to:

Create a file called /etc/initramfs-tools/hooks/fixgcc which contains the following text:

Changed lines 81-87 from:

chmod +x /etc/initramfs-tools/hooks/fix-gcc

Now your kernel installs should work. This command should re-generate a corrected initrd and write it to flash (the kernel version may need to be different):

dpkg-reconfigure linux-image-2.6.18-6-ixp4xx

This takes a long long time on the NSLU2.

to:

chmod +x /etc/initramfs-tools/hooks/fixgcc

Now your kernel installs should work. This command should re-generate a corrected initrd and write it to flash (the kernel version may need to be different - use "dpkg --list | grep linux-image"):

rm /boot/initrd.img-2.6.18-6-ixp4xx
update-initramfs -c -k 2.6.18-6-ixp4xx

This takes a long long time on the NSLU2. Reinstalling the kernel with "apt-get --reinstall install <version>" should also work but I am trying to save you time.

August 08, 2008, at 03:06 AM by Stephen Blackheath --
Changed lines 56-57 from:

This bug - which is supposed to be fixed - describes it.

to:

The following bug report describes this problem perfectly. This is supposed to be fixed but it looks like a regression to me.

Changed lines 60-87 from:
to:

Create a file called /etc/initramfs-tools/hooks/fix-gcc which contains the following text:

#!/bin/sh
PREREQ=""
prereqs()
{
   echo "$PREREQ"
}

case $1 in
prereqs)
   prereqs
   exit 0
   ;;
esac

cp /lib/libgcc_s.so.1 ${DESTDIR}/lib

Mark it executable with

chmod +x /etc/initramfs-tools/hooks/fix-gcc

Now your kernel installs should work. This command should re-generate a corrected initrd and write it to flash (the kernel version may need to be different):

dpkg-reconfigure linux-image-2.6.18-6-ixp4xx

This takes a long long time on the NSLU2.

August 08, 2008, at 02:44 AM by Stephen Blackheath --
Changed lines 1-2 from:

= How I recovered my broken Debian kernel using the install image =

to:

How I recovered my broken Debian kernel using the install image

Changed lines 19-20 from:
  • Once you're in the shell, type the stuff below, because certain things need to be set up right for installation of kernels to work.
to:
  • Once you're in the shell, type the stuff below, because certain things need to be set up right for installation of kernels to work. You can omit the "mknod"s if you have already done them.
Changed line 49 from:

NET: Registered protocol family 1

to:

[@NET: Registered protocol family 1

Changed lines 54-60 from:

libgcc_s.so.1 must be installed for pthread_cancel to workKernel panic - not syn cing: Attempted to kill init!

to:

libgcc_s.so.1 must be installed for pthread_cancel to workKernel panic - not syncing: Attempted to kill init!@]

This bug - which is supposed to be fixed - describes it.

http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=426395

August 08, 2008, at 12:47 AM by Stephen Blackheath -- Instructions for how I fixed my broken Debian kernel
Added lines 1-54:

= How I recovered my broken Debian kernel using the install image =

I broke my Debian kernel with an upgrade to lenny. Here's how I got it into a "recovery mode" where I was able to re-install the kernel.

Install and start the Debian installer, according to these instructions:

http://www.cyrius.com/debian/nslu2/install.html

Once your Debian installer is up, do this:

  • Choose your language
  • Choose your Debian mirror
  • Choose your distribution - stable, testing, etc (it shouldn't matter which one)
  • Let it download its startup stuff
  • Under "Download installer components", select "[*] ext3-modules-2.6.18-6-ixp4xx-di: EXT3? filesystem support" and "[*] usb-storage-modules-2.6.18-6-ixp4xx-di: USB storage support".
  • Let it install those.
  • When it gets to "Partition disks", go down to "Go back" using the TAB key and press ENTER.
  • At the menu, choose "Execute a shell".
  • Once you're in the shell, type the stuff below, because certain things need to be set up right for installation of kernels to work.
~ # dmesg | tail
sda: assuming drive cache: write through
SCSI device sda: 625142448 512-byte hdwr sectors (320073 MB)
sda: Write Protect is off
sda: Mode Sense: 00 00 00 00
sda: assuming drive cache: write through
 sda: sda1 sda2 sda3
sd 0:0:0:0: Attached scsi disk sda
~ # mount -t ext3 /dev/sda3 /mnt     <-- substitute your Linux partition for /dev/sda3
~ # umount /proc
~ # echo none /mnt/proc proc defaults 0 0 >> /etc/fstab
~ # mount /mnt/proc
~ # cd /mnt/dev
/mnt/dev # mknod mtdblock0 b 31 0
/mnt/dev # mknod mtdblock1 b 31 1
/mnt/dev # mknod mtdblock2 b 31 2
/mnt/dev # mknod mtdblock3 b 31 3
/mnt/dev # mknod mtdblock4 b 31 4
/mnt/dev # mknod mtdblock5 b 31 5
/mnt/dev # chroot /mnt
sh-3.1# 

If all went well, you now have a system that looks like your running system, and you can install Debian kernels using apt-get.

Postscript: My lenny problem

I have the luxury of a serial port (AddASerialPort) and the error was this:

NET: Registered protocol family 1 NET: Registered protocol family 17 Time: OSTS clocksource has been installed. x1205 0-006f: setting the system clock to 2008-08-07 14:02:33 (1218117753) Freeing init memory: 92K libgcc_s.so.1 must be installed for pthread_cancel to workKernel panic - not syn cing: Attempted to kill init!

view · edit · print · history · Last edited by Stephen Blackheath.
Originally by Stephen Blackheath.
Page last modified on August 08, 2008, at 03:57 AM