Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

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.

share|improve this question
    
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

1 Answer 1

up vote 2 down vote accepted

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
share|improve this answer
    
Thanks for the suggestion. I will try this and if it works I will accept your answer. –  mathematician1975 Jan 6 '13 at 12:13

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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