If you own a Lemote Fuloong and run Debian Wheezy on it, you may have the problem that this wonderful little piece of machinery spends ten minutes loading the initrd. Don't get me wrong. I love this machine because it only consumes 11 watts of power or something while idling (while still loading GNU emacs in about five seconds and being able to run the Galaxy screensaver), but on the other hand it might be worthwhile getting it to boot faster than this. The solution is to compile GRUB 2.00.
This may work with other distros too of course with proper adjustments.
Note that this shouldn't damage your system. Your system isn't depending on GRUB to boot anyway, and all we're gonna do is remove GRUB completely and replace it with a newer version. We won't touch the kernel or the initrd or anything but GRUB and /boot/boot.cfg. The new version of GRUB ends up in /usr/local/, out of the way of your other system files.
First, back up /boot/boot.cfg and place it somewhere where you know you can access it with say the minimal command line that the Debian installation boot image will give you after you boot it from a USB flash drive. Note that you can't mount an external drive with that command line. You might want to boot the installation image (or whatever) and test that you can indeed restore the file to the boot partition before you even start this operation. Personally I'd back up everything else too that's important as a general precaution.
Now uninstall everything that has to do with GRUB to avoid conflicts with the new GRUB install. I purged everything that contained GRUB in its name and the dependencies of those packages and thus got rid of the default Debian configuration of GRUB as well. As it turns out, GRUB generates a working config file perfectly fine without any customization. Also it's nice to know that the config isn't full of references to missing files. Purge the remaining config files of uninstalled packages like this if you didn't do that:
Download the sources from ftp://ftp.gnu.org/pub/gnu/grub/
, then install the following dependencies before trying to run ./configure:
build-essential (To compile programs)
Now, as a normal user, start compiling and installing:
cd <path to where you saved GRUB 2.00>
tar -zxf grub-2.00.tar.gz
At this point GRUB is installed. You must configure it as root:
grub-install --directory /usr/local/lib/grub/mipsel-loongson/
This should have generated the file /boot/grub.elf which is the file that will be loaded by PMON on boot instead of the Linux kernel. Now you need /boot/boot.cfg to make PMON do just that:
title Boot with GRUB
Finally you need /boot/grub/grub.cfg:
grub-mkconfig > /boot/grub/grub.cfg
This should generate a clean minimal boot configuration. Now your Fuloong should boot with GRUB 2.00. If you have any problems, check that you did uninstall everything that had to do with GRUB before starting. Hopefully you'll have a better experience with this machine from now on.