Linux Kernel 2.6 Bootloader for Buffalo Linkstation/KuroBox/HG/HS/Terastation | hvkls.dyndns.org
|
![]()
|
Search · Suche
|
Version: Mon, 03 Mar 2008 18:58:57 CET
Policy Regeln
|
Search Suche
- USE AT YOUR OWN RISK
-
- Overview
- All PPC Linkstations, Kuro Boxes, Kuro HGs, and the Terastation (experimental/needs additional setup), are supported by the bootloader, if running a Buffalo (Stock Firmware, OpenLink, Sylver) or Debian (FreeLink) style init system; also Gentoo's BSD style. Additionally, theres is support for both LS2 (MIPSEL) custom 2.4 and 2.6 kernels, though no LS2 kernels themselves are provided here.
- The "bootloader" is, technically speaking, a kernel loader: The system boots into the Buffalo kernel in the Flash ROM, then checks your LS flavor and loads the special kernel module
/boot/loader*.o, which in turn boots the new kernel/boot/vmlinux.bin*./boot/insmod.{ppc,mipsel}are included in newer versions, for compatibility with systems without kernel 2.4 support. - The process is fail-safe to our best knowledge: The operation is performed on a read-only file system. If booting the new kernel fails, the old one simply continues booting; or your next boot will take you back to the old kernel. Errors are logged, if possible.
- If the U-Boot bootloader is detected, the kernel loader will quit silently, which makes it 100% compatible. —
- The bootloader itself is controlled in two phases, the first shall be used by the system only, the second by the user.
-
- System control phase
-
- Overview
- On startup, the bootloader checks for the presence of the file
/boot/try_new_kernel. - Former versions expected
/boot/try_new_kernel[A-ZA-Z]. The files are initially created for you in/boot. They have to contain echo -n "vmlinux.bin*" > /boot/try_new_kernel*- with * expanding to "" (empty string; this is the recent version); LS, HG, II, KB, KG, KO, or TS respectively (see below).
- If the file reflecting the target system doesn't exist, or contains unexpected content, or a file
/boot/try_new_kernel*.runningexists, the old kernel continues booting. If it does, the root filesystem is remounted read-write, the control file is moved to/boot/try_new_kernel*.running, and the root filesystem is remounted read-only. Thereafter, an attempt to load the new kernel is made. If this attempt is successful,/boot/try_new_kernel*is restored on shutdown and reboot. - Do not interfere unless you have to, which is only the case if your first boot into the new kernel failed, or your system wasn't able to run complete its reboot or shutdown procedure (e.g., due to a power outage, see below).
- Recovering from Failures
- In case you have to recover from a power failure or other event which prevented the system from running its shutdown or reboot scripts, you can run the toggle scripts, which basically strip
.runningfrom thetry_new_kernel*files, and fill them with the expected content. - If it worked, the box should reboot into kernel
2.6. If it doesn't, run cd /boot/
/bin/rm try_new_kernel*
/bin/uname -a | /bin/grep -E "[0-9] #" && NEWSTYLE="true" || NEWSTYLE="false"
if ${NEWSTYLE} ; then
/bin/echo -n "vmlinux.bin" > try_new_kernel
else
/bin/echo -n "vmlinux. bin" > try_new_kernel
rm *running 2>/dev/null
ls -1 loader* | sed -e "s/^.*loader\(.*\)\.o$/\1/" | while read a ; do echo -n "vmlinux.bin${a}" > try_new_kernel${a} ; done
fi
reboot- No action is performed if
/boot/uImageor/boot/vmlinux.UBootare detected. The kernel loader assumes you've got the U-Boot bootloader installed, and quits silently.
-
- User control phase
-
- Overview
- In a second step, the bootloader reads
/etc/default/boot_new.shand/etc/default/boot_new.sh_localto determine what system it runs on. You can configure theNO_STARTvariable here but should not have to touch the others, unless your system is a Terastation. - Toggling kernel 2.4 and 2.6
- Several methods are available. The scripts below perform a change from
NO_START="0"toNO_START="1"in/etc/default/boot_new.sh, which is usually enough, plus run the recovery commands just in case. The LS will boot into kernel2.4from the next system start up on. You can switch between the two settings whenever you want. -
- From the command line:
/usr/local/sbin/kernel24.sh/usr/local/sbin/kernel26.sh- Opening a
URL(requires OpenLink, or FreeLink with aCGIenabled server, if youcp -a /www/cgi-bin/kernel2*.cgito yourCGIdirectory (Debian standard:/usr/lib/cgi-bin/): http://linkstation/cgi-bin/kernel24.cgihttp://linkstation/cgi-bin/kernel26.cgi- Note: The
CGIscripts runSUID root.
-
- Logging
- Errors will be written to
/boot/boot.log, if possible.