David Barrett wrote: > Aha, excellent -- with your grub commands I was able to complete my > script.
Thanks for bringing this up. > (Though I'm still not sure where the stage1/2/e2fs_stage1 should > come from -- currently it just copies off the host, which isn't that > clean but works for now.) I have no exact knowledge how GRUB is implemented by I would bet on what those filenames suggest. They are pieces of codes for various stages during grub startup. Note that /boot/grub/stage1 has 512 bytes so that it fits to a single block. Of course, that code cannot due to size constraints but it obviously succeeds in pulling into memory the following stage. Grub must understand particular filesystem to be able to locate kernels on the physical disk so obviously this cannot be implemented within first 512 bytes. Therefore multiple phases. Those are (non-ELF) executable binaries thus some care must be taken when reusing them within QEMU but as long as your PC and QEMU are both i386 (non Spark, non Alpha etc) I think it makes sense that those binaries created for i386 real mode are reusable. The grub itself switches to protected mode before it gives control to the kernel. > I've posted it on my blog and will keep > updating it here: > > http://blog.quinthar.com/2008/07/building-1gb-bootable-qemu-image-using.html > > > As for the magic numbers in the script to make it work for 1GB, here's > how I came up with them for the "dd" command: > > bs = blocksize = 1024 > count = 1GB/bs = (1024*1024*1024)/1024 = 1048576 Ok. I have looked at it and this make sense. The partition cannot start at the very begining of the disk (the very first disk block) block because it would overlap with MBR. The fdisk shows that the partition created this way starts at block 32. Blocks are of 512 byte size. The partition we create this way is thus indeed offset to 32 * 512 = 16384 > > For the "parted" command, I got the numbers by installing with the > netinst ISO onto a 1GB raw file, and then doing "parted test.raw print". > I don't know how the netinst installer came up with those numbers, > but I just copied them. Regardless, it seems like you can pretty much > choose whatever you want; I'm sure there's a whole science behind it. > (Where the "1069" came from I have no idea, as there are only 1024 MB on > disk.) > > For the "loop,offset=16384" that took some guesswork: "parted print" > spit out 16.4K as the start of the first partition, and I guessed that > it was just rounding off 16384 and it worked. > > Regardless, here it is for those of you following along. Thanks for all > your help! > > -david > Have a good day. -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]