Alternative methods for inserting preseed files

ago agostino.russo at gmail.com
Tue Nov 13 01:57:13 GMT 2007


I'd suggest the following approach:

1. Create an empty virtual device as target for the installation as
virtual disk 1.
2. Create a boot device with grub in there (also in MBR) as virtual disk 2.
3. Add the following folders/files to virtual disk 2

/boot/vmlinuz #extracted from ISO
/boot/initrd.gz #extracted from ISO
/boot/grub/menu.lst
/vmware/preseed.cfg
/vmware/override_files/any_file_you_want
/vmware/override_files/early_command.sh
/vmware/override_files/success_command.sh

4. In menu.lst have the first entry such as

title Install Ubuntu
root (hd1,0)
kernel /boot/vmlinuz xforcevesa boot=casper
find_preseed=/vmware/preseed.cfg quiet splash ro -- automatic-ubiquity
initrd /boot/initrd.gz
boot

5. In preseed command have the following lines:

d-i preseed/early_command string [ -x
/root/tmp/override_files/early_command.sh ] &&
/root/tmp/override_files/early_command.sh

ubiquity    ubiquity/success_command string [ -x
/vmware/success_command.sh ] && /vmware/success_command.sh

#Add an appropriate recipe targeting disk1

6. Now you can place any script you want in
/vmware/override_files/early_command.sh to customize the installer
behaviour on top of what you have in preseed.cfg. Note that files in
override_files will be in /root/tmp/override_files, you can use that
to provide custom packages and/or replace installer files.

Early_command.sh is executed in casper-bottom, before chrooting. Add
"cp -a /root/tmp/override_files /root/vmware" in there.
Success_command.sh is executed at the end of ubiquity installer.
Booting off virtual disk 2 will load the initrd in there, which in
turn will look for and mount the CD, then your customizations will
take effect, then it will go on with ubiquity in automatic mode, and
finally success_command.sh will be executed. The above should work
also with an ISO adding the extra boot argument
"find_iso=/path/to/iso" (provided the device containing the ISO can be
accessed from within the VM).

Hope it helps,


Ago


On Nov 9, 2007 8:45 PM, Joshua Kwan <jkwan at vmware.com> wrote:
> Hi ubuntu-installer,
>
> I'm an intern at VMware currently working on a feature that will allow
> users to automatically install Ubuntu from CDs they have. It's kind of
> an odd feature because it specifically targets people who don't have
> ISOs lying around and just wish to install Linux from a CD that they
> have. It is the analogue of a feature in VMware Fusion that can
> automatically install Windows given a CD key, a user name and a
> password.
>
> We want to minimize the amount of time it takes to get the installation
> process started, so copying the contents of the CD to a local disk and
> remastering it with the proper ISOLINUX arguments and preseed files is
> undesirable, though if it's the only option to get this working with
> Gutsy it can be done.
>
> Currently, I'm using a hack that involves copying the kernel and the
> ramdisk from the source CD, along with its ISOLINUX configuration and a
> customized preseed file with a desired username and password. After
> modifying the ISOLINUX configuration to include the appropriate
> arguments for using the preseed file on the CD, we load it up into a
> virtual CD-ROM drive next to the pristine Ubuntu CD. The system is
> booted from our CD, but the ramdisk finds the Ubuntu CD and continues
> the boot procedure from that.
>
> The problem here lies in getting the Ubuntu CD to find the preseed file
> that is on the boot CD. This happens to work transparently with
> Anaconda-based installers and it's possible to install RHEL with this
> method. However, as far as I can tell, there are only two ways to
> accomplish this in Gutsy:
>
> 1. Remaster the Ubuntu CD with the preseed file on it.
> 2. Put it on a web server and use the hack above to specify the correct
>    URL.
>
> (1) is undesirable for reasons mentioned above, and (2) requires a lot
> of extra legwork and is another point of potential security concerns
> because it's a process that runs on the host machine. Additionally, I
> tried it once and there was a problem where the installer tried to
> retrieve the preseed file from the web server *before* DHCP had acquired a
> lease, so it failed. So especially if it's unreliable, I don't want to do it.
>
> So (1) seems like the only viable option, but I'm reaching out to this
> list just in case there's something I missed. Basically I just need a
> way to mount an extra device into the installer environment at a point
> during the installation before it tries to get to the preseed file.
>
> I'd appreciate any ideas this list might have.
>
> Thanks,
>
> Josh
>
>
> --
> Ubuntu-installer mailing list
> Ubuntu-installer at lists.ubuntu.com
> Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-installer
>



More information about the Ubuntu-installer mailing list