Difference between revisions of "Freelink+UBoot+kernel2.6 on Kurobox"

From NAS-Central Buffalo - The Linkstation Wiki
Jump to: navigation, search
m (Updating Flash Memory and the boot partition)
m
 
(One intermediate revision by one user not shown)
Line 33: Line 33:
  
 
<pre>
 
<pre>
cd /mnt/<br>
+
cd /mnt/
mv /mnt/share/u-boot-lsppchd-flash-1.2.0-r2.bin u-boot-lsppchd-flash-1.2.0-r2.bin<br>
+
mv /mnt/share/u-boot-lsppchd-flash-1.2.0-r2.bin u-boot-lsppchd-flash-1.2.0-r2.bin
mv /mnt/share/firmimg.bin firmimg.bin<br>
+
mv /mnt/share/firmimg.bin firmimg.bin
mv/mnt/share/tmpimage-FL-1-21-LS1.tgz tmpimage-FL-1-21-LS1.tgz<br>
+
mv/mnt/share/tmpimage-FL-1-21-LS1.tgz tmpimage-FL-1-21-LS1.tgz
 
</pre>
 
</pre>
  
Line 102: Line 102:
  
  
{{Template:Articles|Kurobox|Freelink|UBoot|Kernel}}
+
{{Template:Articles|Kurobox|FreeLink|UBoot|Kernel}}

Latest revision as of 01:02, 6 October 2010

Contents

Putting UBoot, Freelink and a 2.6 Kernel on an original Kurobox

I have had a Kurobox for some time now and it has served well as a basic file server. I have been wanting to upgrade it, but didn't know enough Linux to feel comfortable attacking the task. Also, the thought of putting together all the pieces seemed a bit daunting. With the recent advent of nearly automatic upgrades to uboot and modern Debian distributions, plus the ability to upgrade the kernel, it seems like now is the time to quit procrastinating and get started. While information on doing this in the Kurobox domain has been pretty skethcy, all the pieces are there under the linkstation headings. This page just puts several of those pieces together in a single place and makes it easier to find for Kurbox enthusiasts. Of course this only applies to the original Kurobox which is not around anymore but I see there are still people asking about this here and there, so I am getting this howto off of my personal page and into a findable place related to the kuro.

The Plan

  1. Update Kuro to uboot and Mindbender's firmware image
  2. Install Freelink (Debian Linux)
  3. Update the kernel to a 2.6 variety.


Resources

The primary resource is NAS-Central and the wonderful people who are behind it. I started by asking in the forums. Here is the thread that this page is based on. It shows the false starts and mis-steps that I will leave out here in order to keep things readable and usable. My thanks to Andre, mindbender, and davy_gravy for their help and patience with this Linux newbie. This wiki is also a treasure trove of information and searches have often led me to a page with just the information I needed. It is good to see it growing and maturing.


How to install LNI uboot + 2.4.33.3-firmimg.bin + freelink to the original kurobox/LS1

Here are Mindbender's directions from the forum thread with annotations and hints based on my experience added.

Prerequisites:

Things to do to get the Kurobox ready and software needed.

This may be the time or place to install a new bigger drive in the Kurobox. It will wake up in EM-Mode and you should be able to work from there. I didn't do it that way, I had a working box, but planned on expanding the size of the boot partition. I didn't think about expanding it until I was well into the process and found that expanding it when I did, later on, may have been better than doing so before starting. Your results may differ, you could do it now. I will describe what I did when I get to that point in the upgrade process.

Next we need the uboot, flash kernel, and Freelink code. Mindbender shows getting it like this:

cd /mnt/
wget http://downloads.nas-central.org/LS1_PPC/Bootloader/Uboot/Precompiled/u-boot-lsppchd-flash-1.2.0-r2.bin
wget http://downloads.nas-central.org/ALL_LS_KB_PPC/Bootloader/UBoot/FirmimgBins/linux-2.4.33.3-list.mg.2-v3/firmimg.bin
wget http://downloads.nas-central.org/LS1_PPC/Distributions/Freelink/TmpImages/tmpimage-FL-1-21-LS1.tgz

That is downloading the uboot binary + the 2.4.33.3 firmimg.bin and the freelink rootfs to /mnt/ which should be the point to which /dev/hda3 should be mounted.

Since my kurobox was only slightly updated, wget was not available to me. Instead I downloaded those files to my PC and then put them on the share drive of the kuro using windows networking. I then logged into the Kuro using telnet and moved them to the suggested directory. If you are working with a new drive, this may not be an option. The Kurobox supports ftp, and that is another way to get the files onto the box.

cd /mnt/
mv /mnt/share/u-boot-lsppchd-flash-1.2.0-r2.bin u-boot-lsppchd-flash-1.2.0-r2.bin
mv /mnt/share/firmimg.bin firmimg.bin
mv/mnt/share/tmpimage-FL-1-21-LS1.tgz tmpimage-FL-1-21-LS1.tgz

Now the code is where it belongs.

Here is a link to the flash map of the LS1/kurobox original. http://buffalo.nas-central.org/index.php/Information/PPCFlashROM
There you will see the bootloader-device is "/dev/fl2" and the firmimg.bin device is "/dev/fl1".

Updating Flash Memory and the boot partition

You can install the latest uboot without compiling by flashing the binary to /dev/fl2
see http://buffalo.nas-central.org/index.php?title=U-boot_bootloader#Flashing_U-Boot_from_Linux for the full up directions and warnings. This process was too daunting for me to try previously, so I am very glad that Mindbender provided the software and instructions to just do it.

This is the critical part of this guide. in case anything goes wrong when flashing uboot you will need jtag to recover the box. Be warned! It worked for me on three boxes. It worked for me with no trouble either, but you should know you are doing this at your own risk, you really can brick your Kurobox.

installing uboot to /dev/fl2

dd if=u-boot-lsppchd-flash-1.2.0-r2.bin of=/dev/fl2 bs=1k

In case you have cmp on board of your currently installed execute the cmp command also to be completely sure that it worked.
I did not have cmp and did not compare. I ran into issues later and was able to compare from Freelink (as installed below) and found that Flashing worked flawlessly. If you do wish to compare, install it to your kurobox before beginning.

:# cmp u-boot-lsppchd-flash-1.2.0-r2.bin /dev/fl2<br>
:cmp: EOF on u-boot-lsppchd-flash-1.2.0-r2.bin

EOF on the file means it was a good comparison. The flash device doesn't end at the end of file, so this result is expected. Everything up to the end of file compared successfully.

installing the 2.4.33.3 firmimg.bin to /dev/fl1
If you do this uboot update, I also recommend you flash the 2.4.33.3/telnet/ftp-enabled firmimg.bin to flash. This has the functionality you are used to having on your kurobox. This is an updated flash kernel that has some nice features that really makes many tasks a breeze compared to the kuro's old EM-Mode
EM_Welcome_Screen.JPG
This is the kernel that will be used in EM-Mode and when you do a "two flash" uboot startup.

dd if=firmimg.bin of=/dev/fl1 bs=1k

Again, if you have cmp onboard, use it to make sure everything was written correctly.

Do both of the above flash operations at the same time without rebooting. Then when you reboot you will see the box behaving differently. It should behave as shown in this youtube video by Mindbender:

http://www.youtube.com/watch?v=pTPrrUYd8O8

Watch the video closely keeping your eyes on the disk fault light. It will blink 1, 2 or 3 times to indicate which boot mode it will execute when the entry timer expires. Each time you press the power button, the number of flashes will increment. If you do nothing it will boot "single flash". At this point in the upgrade you effectively can only boot to 2 and 3 blink mode as you only have a bootable kernel in flash, but not on the hard drive in the /boot directory (that's why you are flashing the 2.4.33.3-firmimg.bin, btw. If you don`t install the flash kernel, and reboot uboot will have problems finding a kernel to boot. The 1-blink mode will work as well, but in reality it will be 2 blink mode as it defaults to the flash kernel if no kernel is found in /boot on the hard drive. The Kurobox software does not have a /boot directory, so this is exactly what happens. A blank disk would also do the same.

Installing freelink to /dev/hda1
Once you have booted into EM mode with uboot (three flashes of the Disk Fail light during the uboot portion of startup), you can install freelink to /dev/hda1. Login via telnet, seeing the above welcome screen, and then you can do several things. The first thing I did was to repartition the hard drive. I used fdisk and mke2fs to create a 5GiB root partition, a 256MiB swap partition and left the rest of th 200GB hard drive for the working partition. Good generic directions can be found at Convert your PPC LinkStation into a full-blown Debian system. Once the partitions are right, it was necessary to ftp the tmpimage-FL-1-21-LS1.tgz file to the kuro again as shown in the pre-requisites above. Now it is time to install freelink on the hard drive.

mount_disk<br>
cd /mnt/hda1<br>
rm -r *<br>
tar xzvf ../hda3/tmpimage-FL-1-21-LS1.tgz<br>

That should be all, when you reboot again you will be running Freelink.
This is now the beginning, Freelink needs configuring and addition of all the software you will want to make the box functional as a NAS and media server. I had tried to configure it using freelinkomatix but had some troubles and had to back up to the step shown here and start over using the manual direction at Freelink - Convert the LinkStation into a Full-fledged Debian Linux Server, starting with step 3.


Update to a 2.6-kernel

The last desirable thing to do is to update to a late 2.6 by running andre`s webinstaller with variant-uboot mode: http://hvkls.dyndns.org/downloads/documentation/README-webinstaller.html

This did not go well for me at first. Here is my expanded set of directions that worked better.

Update Freelink before updating the kernel to 2.6
I found that the web installer failed and asked me to reinstall several items using apt-get when I ran it on a virgin Freelink installation. When I tried to do the re-installs, apt-get cried foul and failed saying I needed to run apt-get update first. Upon running that, it had a failure and recommended running it again. the second apt-get update worked with no error messages and then the re-installs worked fine. After all of that, the web-installer ran without a hitch.