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

Re: Netinst with preseed



Charles Chambers <cchamb2@gmail.com> writes:

> On 05/27/2015 07:20 AM, Philip Hands wrote:
>> Charles Chambers <cchamb2@gmail.com> writes:
>>
>>> Hi, Phil:
>>>
>>> And I've looked further.
>>>
>>> There's a step by step out there that describes the following steps:
>>>
>>> 1)  Wipe USB drive.
>>>
>>> 2)  Copy (via dd) boot.img to it.
>> I'm guessing that boot.img is an image of a VFAT file system, with
>> something like grub4dos on it (which supports booting ISO images from
>> the filesystem).
>>
>> That's a completely different thing from dd-ing the ISO itself.
>>
>> For it to work, the ISO needs to be able to find it's own image on any
>> old file system (which ours are built to do).
>>
>> If that floats your boat, fine.
>
> The boot.img is extracted from boot.img.gz, which is found at, for
> example, here:
>
> http://ftp.debian.org/debian/dists/wheezy/main/installer-amd64/current/images/hd-media/

Ah, righto.  No, that's just a VFAT file system image, with syslinux on
it to make it bootable -- it's effectively a Floppy image, which most
BIOSs will accept on a USB stick as an oversized floppy, and therefore
try to boot.

I think fdisk is just being confused by the data near the start of that
(look at the numbers in the fdisk output, and you'll see that they're
nonsense).

...
>> You could resize it to get at the whole drive (to answer 1) ).
>
> Delete /dev/sdb2-4?

There are no partitions -- it's a file system slapped straight onto the
device.  You'd need to resize the vfat, for which I believe you could
use the package 'fatresize' -- although I'm doubtful that you're on the
right track, so before you bother with that you'd want to check that it
does actually boot and detect the preseed.cfg

>> I'm not sure that we look at the filesystem containing the ISO, when
>> it's been loop-mounted (as would be the case here, assuming it works) in
>> order to find a default preseed, but I guess that it's going to be
>> mounted on /hd-media, so if not at least you ought to be able to specify
>> it by it's path.
>>
>> As for question 3) well, you're copying (dd) a file system to the stick, and
>> then copying an ISO into that file system, so you get no partitions.
>
> Don't file systems exist only in partitions?

No.

> The file system comes in when you dd boot.img, and it creates four
> partitions.

No, it doesn't.

> On the fdisk output, I have accomplished step 2.  Kparted
> and Gparted both agree at that same point that there are no partitions,
> but fdisk shows 4 partitions, thus none can be added.  I'm assuming that
> the four partitions are embedded in boot.img and created as part of the
> dd operation.

fdisk is just being confused, which is why you're mounting the device
itself.

>>  I was describing dd-ing the ISO directly to the stick. Our ISO images
>> contain a partition table and boot loader as a bit of magic to make the
>> stick bootable. It turns out that one seems to be able to add
>> partitions, which is what I was on about.
>
> I can double check that, but IIRC I tried and could not. 
>
>> The remaining issue would be getting the new partition mounted, and the
>> preseed.cfg therein used, preferably automatically.
>
> The objective is a unattended USB install with an edittable preseed.cfg,
> and optionally additional packages and firmware files included on the
> media.  Windows does it with a customizable unattended.txt (I think) and
> a system integration tool to select the installation options.

If you're using netinst, then the machine must have networking, in which
case you might want to consider specifying the preseed as a URL -- then
you can edit the preseed on your HTTP server, and never need to update
the USB stick.

In fact, if you have the relevant control of your network, you could
probably dispense with the USB stick and use PXE booting instead.

You may find this helpful:

  http://hands.com/d-i/

in particular the url= stuff.

It's also possible to modify the menu presented at boot, if you remaster
the ISO, which you might want to do in order to make it (dangerously) do
an automated install without prompts.  Look in the isolinux directory.

Cheers, Phil.
-- 
|)|  Philip Hands  [+44 (0)20 8530 9560]  HANDS.COM Ltd.
|-|  http://www.hands.com/    http://ftp.uk.debian.org/
|(|  Hugo-Klemm-Strasse 34,   21075 Hamburg,    GERMANY

Attachment: signature.asc
Description: PGP signature


Reply to: