Johannes
Rescue system for use with USB sticks and TFTP
October 22, 2010 06:54PM
I've made a few small changes to the buildroot configuration to produce a rescue system which runs in RAM and can be loaded from USB or the network. The zip file contains the kernel "uImage-rescue" and the root filesystem "uInitrd-rescue". It also contains the modified buildroot configuration and corresponding md5 hashes for file integrity verification.

Booting the rescue system is accomplished by using uBoot to load the kernel and the root filesystem into RAM and calling bootm with the two addresses. For example, the following sequence will load the rescue system from the root directory of an ext2 (or ext3) formatted USB stick (in position 1):
usb start
ext2load usb 0:1 0x800000 uImage-rescue
ext2load usb 0:1 0xe00000 uInitrd-rescue
setenv bootargs console=$console $mtdparts
bootm 0x800000 0xe00000

Another option is to simply rename the files to uImage and uInitrd and place them in the root directory of an ext2 (or ext3) formatted USB stick. Jeff's boot loader configuration will then load the rescue system like a normal USB-installed system.

The kernel supports network console. It is enabled like this:
setenv bootargs netconsole=6666@10.0.0.3/eth0,6666@10.0.0.2/12:23:34:45:56:67 $mtdparts
where 10.0.0.3 is the IP address of the Dockstar, 10.0.0.2 is the IP address of the machine which displays the console output and 12:23:34:45:56:67 is the MAC address corresponding to that machine. Replace these values with the ones which are right for your network.

Since the system runs completely in RAM, all changes are lost after a reboot. This includes password changes and the autogenerated SSH host keys. The result is that the only user "root" always uses the password "root" and the host keys are always different, which triggers a security breach warning in the SSH client. Under these circumstances, SSH can not prevent man-in-the-middle attacks and anyone who can guess the root/root login can get full control over your Dockstar. You should therefore not use this system when TCP port 22 on the Dockstar can be reached from a public network (the internet, open wireless LAN, etc.).

Get the RAM based rescue system here:
http://www.sendspace.com/file/d6ffyd
The md5 hash of the zip file is 7f225435709cd0ffbb3619f86af42986.
Re: Rescue system for use with USB sticks and TFTP
October 23, 2010 02:48PM
This is a great idea! I'd be happy to give you space on this site to host this. Send me an email and I'll get you an account.

-- Jeff
Johannes
Re: Rescue system for use with USB sticks and TFTP
October 23, 2010 03:37PM
Permission granted to download the file and host it here. It's all open source anyway. I only changed a few configuration options to get Initrd support and a cpio.gz of the root filesystem. I also removed two unneeded gettys and a useless tail process from inittab and /usr/sbin/debootstrap and /usr/share/debootstrap because they didn't work. Your debian installation script reinstalls working versions on demand. The modified buildroot configuration is in the archive.
Johannes
Re: Rescue system for use with USB sticks and TFTP
October 30, 2010 01:58PM
New version: http://www.sendspace.com/file/afgz0q
(MD5: 495a32cbb2818111d7dc437805d2630e)

The buildroot configuration now comes with a patch which must be applied to the buildroot environment to prevent it from overriding the initial ramdisk support in the kernel configuration. The only other change is that I added microperl to the selection of packages.

With microperl installed, debootstrap works without externally compiled package details. Debootstrap itself is not part of the rescue system. Download the deb package to /tmp and extract it manually:
cd / ; mount -o remount,rw / ; ar p /tmp/debootstrap*.deb data.tar.gz | tar xvz
Then follow any debootstrap tutorial you like.

How to use Knoppix 6.2 and buildroot-dockstar-rescue_2010-10-29.tgz to compile your own kernel/initrd: (some Unix knowledge required)

You'll need about 4GB of hard disk space and the computer will be busy for hours.

Knoppix 6.2 is based on Debian and comes with package management tools, but since it's tuned for live-CD usage, there's a little tweaking to be done beforehand.

First become root:

su

Then use your favorite editor to edit /etc/apt/apt.conf.d/00knoppix and add this "APT::Cache-Limit 40000000;" (without the quotes).
Then:

apt-get update
apt-get install flex bison uboot-mkimage

Now you'll need to mount a filesystem with at least 4GB of free space. For example, mkdir /buildroot ; mount /dev/sda1 /buildroot ; cd /buildroot. If you're using a fresh virtual hard disk in a VM, you'll have to use fdisk and mkfs with appropriate parameters first.

Get the ZIP linked at the top of this comment and unpack it: unzip dockstar-rescue-system_2010-10-29.zip
Get the buildroot distribution from http://buildroot.uclibc.org/downloads/buildroot-2010.08.tar.gz
and unpack it: tar xzf buildroot-2010.08.tar.gz
cd buildroot-2010.08
Unpack the buildroot configuration: tar -xzf ../buildroot-dockstar-rescue_2010-10-29.tgz. That will give you a subfolder called "custom". Apply the patch: patch -p1 -i custom/buildroot-patch
Copy the configuration: cp custom/buildroot-config .config

The next step (literally) takes hours and fills 4GB of hard disk space: make

When it's all done, the kernel is in output/images/uImage (in ready-to-use uboot kernel image format) and the other files in output/images are the root file system in various forms. The rootfs.cpio.gz one is almost ready to be used as ramdisk. To use it with uboot, add the necessary header:
mkimage -A arm -O linux -T ramdisk -C gzip -a 0 -e 0 -n initramfs -d output/images/rootfs.cpio.gz output/images/uInitrd

Alternatively you can use bzip2 on rootfs.cpio and turn the result into an initrd image:
mkimage -A arm -O linux -T ramdisk -C bzip2 -a 0 -e 0 -n initramfs -d output/images/rootfs.cpio.bz2 output/images/uInitrd

That's all.
SebastianG
Re: Rescue system for use with USB sticks and TFTP
November 15, 2010 03:40PM
Thx! This modified rescue system for USB and tftp recently saved my ass (and quite a lot of work) ;)
Martin
Re: Rescue system for use with USB sticks and TFTP
February 25, 2011 04:30PM
Hi, I was wondering if I could get a little help, I am fairly lost.

I have installed openwrt (with their bootloader) but can't get it to work the way I wanted so I decided to switch to debian, however I can't seem to install your uboot that uses usb so I'm trying to do this restore so that I can run dockstar.debian-squeeze.sh

I have transferred the rescue files to an ext3 usb drive but it doesn't seem to be able to access the files, though it does show that it can see the partition so I tried doing wget from dropbox but I just get all these errors, my goal is to just get the correct bootloader and get squeeze on so I can run usbip on my dockstar.

This is the error I get when I try to run uInitrd-rescue


root@OpenWrt:/tmp# wget http://dl.dropbox.com/u/839/uInitrd-rescue
Connecting to dl.dropbox.com (184.72.226.9:80)
uInitrd-rescue 100% |********************************************************| 17009k 00:00:00 ETA
root@OpenWrt:/tmp# chmod +x uInitrd-rescue
root@OpenWrt:/tmp# ./uInitrd-rescue
./uInitrd-rescue: line 3: Ĥ: not found
./uInitrd-rescue: line 3: VØÏþ© Å\ÅSØinitramf¿uÁLÜKs#GrGò®µ,íz²9ÉyØ@#DJþ°u³ÕvXm²sû¶ÕM¨G´ó9-v: not found
./uInitrd-rescue: line 1: syntax error: unexpected word (expecting ")")
root@OpenWrt:/tmp# PuTTYPuTTY

and the error I get when I try to run uImage-rescue (sorry I didn't know which one to run first or... exactly what I was supposed to be doing)


0
./uImage-rescue: line 23: ºÿ0âeP
âUáèÿÿ:: not found
./uImage-rescue: line 24: ç
0 á: not found
./uImage-rescue: line 25: 0Øå4À
./uImage-rescue: line 26: syntax error: unexpected "("
root@OpenWrt:/tmp# PuTTYPuTTYPuTTYPuTTYPuTTYPuTTYPuTTYPuTTYPuTTYPuTTYPuTTYPuTTYPuTTYPuTTYPuTTYPuTTYPuTTYP
uTTYPuTTYPuTTYPuTTYPuTTYPuTTYPuTTYPuTTY
Martin
Re: Rescue system for use with USB sticks and TFTP
February 25, 2011 09:21PM
please disregard my last message (I don't see a way to delete it)

I solved my issues by installing mtd-utils in my openwrt installation which finally allowed the uboot sh script script to change things inside of openwrt, then went in with a serial connection and got the rescue system running in memory and then got debian installed with the sh script.

Thank you for providing such excellent tools
Re: Rescue system for use with USB sticks and TFTP
May 01, 2011 09:08AM
I received a refurbed (and not properly booting) dockstar off ebay, got it hooked up to serial and want to load the rescue system in memory so that I can then install it onto the flash but I am receiving this error when the ram rescue image boots


done, booting the kernel.

Error: unrecognized/unsupported machine ID (r1 = 0x0000020f).

(I assume this is the best method to eventually get to the point that I can run debian from a flash drive, the dockstar currently won't get past the original uboot, but stops with some crc error when it tries to boot pogoplug, this is how I received it.)



Edited 1 time(s). Last edit at 05/01/2011 09:10AM by a5m0.
Re: Rescue system for use with USB sticks and TFTP
August 27, 2011 08:07PM
To start this rescue system from a tftp server, here are the commands to execute from uboot, assuming your tftp server is hosting both uinitrd & uImage and is accessible @192.168.1.1

setenv ipaddr 192.168.1.50
setenv netmask 255.255.255.0
setenv serverip 192.168.1.1

tftp 0x800000 uImage-rescue
tftp 0xe00000 uInitrd-rescue

setenv bootargs console=$console $mtdparts
bootm 0x800000 0xe00000
Re: Rescue system for use with USB sticks and TFTP
August 28, 2011 07:34PM
tsunulukai Wrote:
-------------------------------------------------------
> To start this rescue system from a tftp server,
> here are the commands to execute from uboot,
> assuming your tftp server is hosting both uinitrd
> & uImage and is accessible @192.168.1.1
>
> setenv ipaddr 192.168.1.50
> setenv netmask 255.255.255.0
> setenv serverip 192.168.1.1
>
> tftp 0x800000 uImage-rescue
> tftp 0xe00000 uInitrd-rescue
>
> setenv bootargs console=$console $mtdparts
> bootm 0x800000 0xe00000


thanks those were how I had gotten to the previous point, meaning after I ran bootm, then I received the error about unsupported machineid
Re: Rescue system for use with USB sticks and TFTP
August 30, 2011 12:05PM
Then you have to enter one of the following commands before "bootm" :

setenv arcNumber 2097
setenv arcNumber 2998
setenv arcNumber 3089

Those 3 arc numbers are respectively the "Generic Pogoplug ID", which doesn't support the dockstar led, the "Dockstar ID" and the "Goflex Net ID". The last two only works with newer kernels that now have support for those arcNumbers.

It should normally always work using the first one. The latter can only be used if you can provide a recent kernel.

Greetz,
Re: Rescue system for use with USB sticks and TFTP
September 22, 2011 06:39PM
Sweet - nice job!

I will take delivery of my Pogoplug EO2 (Kirkwood) in just a few days, and I must say that I'm happy with what you all have done here...
Author:

Your Email:


Subject:


Spam prevention:
Please, enter the code that you see below in the input field. This is for blocking bots that try to post this form automatically. If the code is hard to read, then just try to guess it right. If you enter the wrong code, a new image is created and you get another chance to enter it right.
Message: