Skip to main content

Grub2 on soekris net4801

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

- 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:

- 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)

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 without the /dev/fd0 mapping to the folder indicated in --root-directory=. This command copies the to its proper location:
cp /its_dir/ /media/usbdisk/boot/grub

My 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:

grub-setup -d /media/usbdisk/boot/grub -v -r "(hd1,0)" \ 
-m /media/usbdisk/boot/grub/ "(hd1)"

Note: Grub has a different naming scheme for devices. hd1 is mapped to /dev/sdb as indicated in 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.


Popular posts from this blog

Globe's HOOQ.TV an (unethical) scam!!

After being terribly disappointed with the subscription stage and after also after a very disappointing test drive (at least Netflix tries to be do-no-evil), I am now very disappointed with the un-subscription of with Globe.

Globe sends me a message:

Hi! We'd like to remind you that your free HOOQ will end in 7 days on 10/27/2015. Upon expiry, your subscription will auto-renew to the paid version for P149 per month. If you don't want the paid version, text HOOQ STOP to 8888. before the expiry date. Thank you!

I send the HOOQ STOP to 888 and received:

Sorry, you have entered an invalid keyword. Please make sure your keyword is correct with no extra characters and spaces. For more info on promos, dial *143#, FREE from your Globe/TM mobile phone.

I called Globe Support (211).

Here's the scam:

- GoSurf 999 comes with the HOOQ Free Plan

- After the Free HOOQ Plan (which you did not use because it sucks) expires, it will auto-renew without your consent (!!! UNETHICAL !!!…

Use Private Internet Access (PIA) in DigitalOcean

tags: PrivateInternetAccess, Digital Ocean, VPS, VPN

This runs the PIA VPN using OpenVPN all from the command line.

sudo apt-get install openvpn network-manager-openvpn Not sure if you need network-manager-openvpn.

sudo wget Extract. Move ca.crt and crl.pem to /etc/openvpn

Move "Hong Kong.ovpn" to "/etc/openvpn/Hong Kong.config" for example.

Modified the following lines.

auth-user-pass /etc/openvpn/login.conf route-up /etc/openvpn/
These are the contents of these files.

# cat /etc/openvpn/login.conf username password
Replace with your username and password.

# cat  #!/bin/bash
ip route flush table 100 ip route flush cache ip rule add from x.x.x.x table 100 ip route add table 100 to y.y.y.y/y dev ethX ip route add table 100 default via z.z.z.z
Replace x.x.x.x with your public IP address, y.y.y.y/y with your subnet. Compute using Hint: Input public IP and netmask, y…

Ubuntu on Intel D945GCLF (with Intel Atom)

The rig: D945GCLF board
Intel Atom @ 1.6GHZ w/HTIt looks like it's a linux kernel bug:
The ethernet controller is:Realtek Semiconductor Co., Ltd. RTL8101E PCI Express Fast Ethernet controller (rev ff) does not seem to work in any of the Ubuntu versions.Fix: recompile the kernel with patchYou can download my patched packages here (currently uploading, let me know if something is missing): I got the .udeb packages because of this warning: dpkg-gencontrol: warning: deb package with udeb specific field Kernel-Versionor you can do the following steps if you don't trust me:
apt-get source linux-source-2.6.24apt-get build-dep linux-source-2.6.24aptitude install install devscripts build-essential fakerootcd linux-2.6.24/Get this patch: -p 1 < patch-r8169.patchdebuild -us -uc -bInstall the kernel that …