1

I am trying to make a scratch linux installation on a PC board that has an x86 processor running on it. It also has a compact flash drive on it to which I have copied my compiled kernel image. The problem I am having is with the bootloader aspect. I want to use GRUB, but I do not really know how to go about getting it onto the compact flash drive. Most documentation I have found is concerned with installing GRUB after you have a working installation of linux up and running. I had thought about using a USB floppy drive and using that with GRUB on a disc to boot the kernel image and from there try the grub-install approach mentioned in the GRUB documentation pages. Any advice on how to (or how not to) proceed will be gratefully received.

  • It would seem to me that you must have "running system" in which you compiled your kernel on, true? Where have you compiled your kernel on and how did the kernel end up on the CF-Card from there? These infos could clarify what can be the best way to get GRUB on the CF-Card also. – humanityANDpeace Jan 6 '13 at 9:50
  • @humanityANDpeace Yes I have a desktop linux where I built the kernel and a usb flash writer device where I have copied the kernel to. I will try pointing the grub install at the flash drive and see what happens. – mathematician1975 Jan 6 '13 at 12:12
2

Well, it's true, that you need a working installation of linux (well I guess more like *nix and probably not even that). I assume you are following some kind of lfs or similar procedure. In this case you already should be in some kind of unix, to be able to build all the packages and then you can run grub-install from there.

So either grub-install --no-floppy /dev/sd<whatever> or for the minimal approach

grub --no-floppy
grub> root (hd1,0)
grub> setup (hd1)
grub> quit

Both will work from within your old system. I assume your old system to have gotten number 0 and your new one no 1 in grub's scheme. Please make very sure that this is correct, for example to find out what numbers grub gave your devices

grub-mkdevicemap --device-map=device.map
cat device.map

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.