Skip to main content

Grub2 on soekris net4801

Outline
I. Requirements
II. Compile via source
III. Installation on target device
IV. Grub configuration
V. Soekris net4801 configuration
VI. Minicom configuration
VII. Related resource - Debian/GNU Linux installation

Requirements
- Download grub2 (latest alpha! build is 1.94)
- build-essential (glibc6, gcc4, make, etc), depends on your Linux installation
- minicom for terminal emulation
- I am installing grub2 on a cf.

Installation via source
- Download grub2.
- Auto-configure with serial enabled and install root directory set to /usr/local:
./configure --prefix=/usr/local --enable-serial

- Build:
make

- Install binaries and libraries:
make install

Installation on target boot device
* grub-install - installs grub2 on your device
* grub-setup - set up images to boot from your device

- grub-install: (grub-install --help to see available options)

Example:
grub-install --root-directory=/media/usbdisk /dev/sdb1


Note 1: Make sure that you are using the binary that you just compiled and installed. Earlier, I indicated /usr/local as my prefix. In this case, the binaries can be found in /usr/local/bin and /usr/local/sbin.

Note 2: When I run the command, I get the following errors:
grub-probefs: error: Cannot get the real path of `/dev/fd0'
Auto-detection of a filesystem module failed.
Please specify the module with the option `--modules' explicitly.

The fix is to explicitly indicate the module ext2 (I am installing on an ext2 filesystem) and skip the floppy probing. I skip the floppy probing my copying a device.map without the /dev/fd0 mapping to the folder indicated in --root-directory=. This command copies the device.map to its proper location:
cp /its_dir/device.map /media/usbdisk/boot/grub

My device.map looks like this:
(hd0)   /dev/hda
(hd1) /dev/sdb

The working command is as follows:

./grub-install --modules=ext2 --root-directory=/media/usbdisk /dev/sdb1


- grub-setup:

Example:
grub-setup -d /media/usbdisk/boot/grub -v -r "(hd1,0)" \ 
-m /media/usbdisk/boot/grub/device.map "(hd1)"

Note: Grub has a different naming scheme for devices. hd1 is mapped to /dev/sdb as indicated in device.map. The 0 (zero) denotes the first partition of /dev/sdb (i.e. /dev/sdb1).

Grub configuration
Sample grub configuration file in /{root_device_dir}/boot/grub/grub.cfg
#serial --unit=0 --speed=19200 --word=8 --parity=no --stop=1
#terminal serial

# Timeout for menu
#set timeout=10

# Set default boot entry as Entry 0
set default=0

# Entry 0 - Load Linux kernel
menuentry "My Linux Kernel on (hd0,1)" {
set root=(hd0,1)
linux /vmlinuz root=/dev/hda2 console=ttyS0,9600
initrd /initrd
}

# Entry 1 - Chainload another bootloader
menuentry "Chainload my OS" {
set root=(hd0,3)
chainloader +1
}


Note: Uncomment the first two lines if you want a serial terminal for grub2. Refer to the Grub2 documentation for the available commands.

Soekris net4801 configuration
The default baud rate of grub2 is 9600. You can set the parameter in the Monitor (Ctrl+P) using the command:
set ConSpeed=9600.

Minicom configuration
This is the content of my minicom configuration file in /etc/minicom/minirc.dfl:

pu port             /dev/ttyS0
#pu baudrate 115200
#pu baudrate 19200
pu baudrate 9600
pu bits 8
pu parity N
pu stopbits 1
pu rtscts No
pu xonxoff No


NOTE: The last two lines are important to disable the software and hardware flow control in minicom.

It's now time to boot!

Related Resources
To install an OS, you can follow this documentation to install Debian GNU/Linux.

Comments

Popular posts from this blog

Resetting admin password in IBM System p5 510 Express ASMI

These are the steps in resetting the admin password: 0. Re-route stored static in your body via an ESD wrist strap to a metallic element. 1. Look for the 2 toggle switches and service processor batt. The batt should be in front of the Power Supply 1 and Power Supply 2 (codes: E1 and E2, see Rear Location Codes on the cover plate). The "very tiny" toggle switches should be in the area of P1-C14 slot. I forgot the exact sequence but it should be a combination of the ff. step (2): 2. Remove the battery, toggle the switches to the opposite direction. Allows some time for the caps to discharge. 3. Move back the toggle switches and put back the batt in its place. 4. Assign your PC to Class C subnet (i.e. masked 255.255.255.0 ): IPaddr: 192.168.2.x for HMC1 or IPaddr: 192.168.3.x for HMC2 5. Ping HMC1 or HMC2. Access the web interface using the default address: http://192.168.2.147 (for HMC1) or http://192.168.3.147 (for HMC2) Note: Sometimes you have to force the https protocol:

Zenoss: monitor free VMWare ESXi version

We confirmed that the free ESXi version does not allow SNMP gets, only traps. The original script was taken from here: http://communities.vmware.com/docs/DOC-7170 Modified script: http://mirakulo.com/pub/esxi/check_esx_wbmem.py We added Fan and power supply, hinted from this page: http://www.stephenjc.com/2009/01/whatsup-vmware-esxi-monitor-these.html Use this guide to add the Data source: http://www.zenoss.com/community/docs/howtos/create-modify-nagios-templates Added as template under: /Devices /Server /VMWare /ESXi /Templates /esxi-monitor /check_esx_wbmem Name: check_esx_wbmem Source Type: Command Enable true Use SSH false Component: blank Event class: /VMWare/ESXi Severity: Error Cycle time: 60 Parser: auto Command template: /usr/local/zenoss/python/bin/python /opt/zenoss/libexec/check_esx_wbmem.py https://${dev/manageIp}:5989 root passwd To bind this template to ESXi nodes, go to the device: Example: /Devices /Server /VMWare /ESXi /esxi-01.prod.corp.org then to its temp

ld: unrecognized option '--hash-style=both'

gcc -Wl,-Map=contiki.map,-export-dynamic testv6.co obj_linux-native/socketdev_listener.o \ contiki-linux-native.a -o testv6.linux-native /usr/local/bin/ld: unrecognized option '--hash-style=both' /usr/local/bin/ld: use the --help option for usage information collect2: ld returned 1 exit status If you look closely, the error is something related to the local gcc not using the host's linker (ld). $ which gcc /usr/bin/gcc $ which ld /usr/local/bin/ld For some reason, I messed my compiler path. To synchronized gcc to use the host's dynamic linker (i.e. /usr/bin/ld ), set the environment variable COMPILER_PATH to /usr/bin . $ export COMPILER_PATH=/usr/bin $ echo $COMPILER_PATH /usr/bin $ gcc -print-prog-name=ld /usr/bin/ld