help-grub
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: creating bootable image with a script


From: Michael Evans
Subject: Re: creating bootable image with a script
Date: Tue, 26 Jan 2010 20:43:54 -0800

On Tue, Jan 26, 2010 at 2:36 PM, Kevin Hunter <address@hidden> wrote:
> Hi List,
>
> I'm currently trying to create a bootable USB disk.
>
> Goal 1: create a bootable disk image with a GPT partition label.
>
> Goal 1 is what is giving me trouble.
>
> Goal 2: script this, so I can create a disk image on the fly and shove
> it out to any random disk
>
> With goal 2, what I want to be able to do is dynamically create disk
> images.  Specifically, I'd like to avoid the step of "mastering" an
> actual disk and then copying over with dd.  I do *not* want to do this:
>
> (1) dd if=/dev/sdb of=./disk.img bs=1M
> (2) dd if=disk.img of=/dev/sdb bs=1M
>
> I want to completely forgo step 1.
>
> I think I'm 9/10ths of the way there.  I have everything except for the
> booting part.  Grub continues to be a mystery to me, and I'm hoping
> someone can educate me.  Here's my script so far:
>
> http://cs.earlham.edu/~kevin/tmp/make_bootable_img.sh
>
> It's an explanatory call for help, so please excuse the lack of error
> handling, and other coding neophyte-isms.
>
> Thanks much!
>
> Kevin
>
>
> _______________________________________________
> Help-grub mailing list
> address@hidden
> http://lists.gnu.org/mailman/listinfo/help-grub
>

This is how I'd do it, without looking at your script.

1) Identify the block device that backs the storage media. (Drop any
partition info, you need the base device to describe the map file)
2) Generate a device.map file that describes the external media as hd0
(which is what it will be when you boot off it).
3) Setup grub as normal on that device, using the device.map file to
inform it where things will be during startup.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]