On Wed, 2010-02-10 at 15:22 -0200, Lucas Meneghel Rodrigues wrote: > On Wed, 2010-02-10 at 21:59 +0530, yogi wrote: > > >From 0aa8ed40de86eb8ad5b324177b2e0986e1c32c77 Mon Sep 17 00:00:00 2001 > > From: yogananth subramanian <anantyog@xxxxxxxxxxxxxxxxxx> > > Date: Wed, 10 Feb 2010 09:45:58 -0500 > > Subject: [PATCH 3/5] kvm test: unattended: add support for parallel > > install of suse and other guest OS > > > > File extension of the unattended file ".suse", in case of Sles is > > used to identify the guest OS. > > Since the netboot image path and the kernel name differs for > > both sles and Rhel, its important to identify the type of > > guest being installed. > > Just some quick comments on this one, because those are important to > complete what I asked, which is split the patchsets in 2. > > > The funtion "create_boot_floppy()" is called during initialization > > ranther from the funtion "setup", since its important to indentify > > the OS type being installed duiring initializatoin. > > > > Signed-off-by: yogananth subramanian <anantyog@xxxxxxxxxxxxxxxxxx> > > --- > > client/tests/kvm/scripts/unattended.py | 30 > > +++++++++++++++++++++++------- > > 1 files changed, 23 insertions(+), 7 deletions(-) > > > > diff --git a/client/tests/kvm/scripts/unattended.py > > b/client/tests/kvm/scripts/unattended.py > > index 87a8973..2257abf 100755 > > --- a/client/tests/kvm/scripts/unattended.py > > +++ b/client/tests/kvm/scripts/unattended.py > > @@ -59,8 +59,9 @@ class UnattendedInstall(object): > > self.cdrom_iso = os.path.join(kvm_test_dir, cdrom_iso) > > self.floppy_mount = tempfile.mkdtemp(prefix='floppy_', > > dir='/tmp') > > self.cdrom_mount = tempfile.mkdtemp(prefix='cdrom_', > > dir='/tmp') > > - self.floppy_img = os.path.join(images_dir, 'floppy.img') > > - > > + flopy_name = os.path.basename(os.environ['KVM_TEST_floppy']) > > + self.floppy_img = os.path.join(images_dir, flopy_name) > > + self.create_boot_floppy() > > > > def create_boot_floppy(self): > > """ > > @@ -93,8 +94,12 @@ class UnattendedInstall(object): > > shutil.copyfile(setup_file_path, setup_file_dest) > > elif self.unattended_file.endswith('.ks'): > > dest_fname = 'ks.cfg' > > + self.os = "redhat" > > elif self.unattended_file.endswith('.xml'): > > dest_fname = "autounattend.xml" > > + elif self.unattended_file.endswith('.suse'): > > + dest_fname = "autoinst.xml" > > + self.os = "suse" > > Perhaps .suse as a file extension should be avoided, as having the XML > extension will help people with their source code editors, let's keep it > an .xml file and take advantage of the fact that windows unattended > install does not use TFTP setup at all, so we can just verify if > self.tftp_root contains a non-empty string to tell apart windows files > and SUSE files. > > > dest = os.path.join(self.floppy_mount, dest_fname) > > > > @@ -160,10 +165,22 @@ class UnattendedInstall(object): > > if os.system(m_cmd): > > raise SetupError('Could not mount CD image %s.' % > > self.cdrom_iso) > > > > - p = os.path.join('images', 'pxeboot') > > - pxe_dir = os.path.join(self.cdrom_mount, p) > > - pxe_image = os.path.join(pxe_dir, 'vmlinuz') > > - pxe_initrd = os.path.join(pxe_dir, 'initrd.img') > > + if self.os == "redhat": > > + kernel = 'vmlinuz' > > + initrd = 'initrd.img' > > + p = os.path.join('images', 'pxeboot') > > + pxe_dir = os.path.join(self.cdrom_mount, p) > > + else : > > + kernel = 'linux' > > + initrd = 'initrd' > > + p = os.path.join('boot/x86_64', 'loader') > > + pxe_dir = os.path.join(self.cdrom_mount, p) > > + if not os.path.isdir(pxe_dir): > > + p = os.path.join('boot/i386', 'loader') > > + pxe_dir = os.path.join(self.cdrom_mount, p) > > As Ryan pointed out, on the above block we could just make use of the > configuration system and put the locations for kernel and initrd there, > making the code generic. sure, will do that and since we are adding kernal and initrd locations to the config file, we could add their locations (images/pxeboot or boot/x86-64) too, this avoids the need to determine the type of OS and to use the .suse extension. > > > + pxe_image = os.path.join(pxe_dir, kernel) > > + pxe_initrd = os.path.join(pxe_dir, initrd) > > > > if not os.path.isdir(pxe_dir): > > raise SetupError('The ISO image does not have a %s dir. The > > script ' > > @@ -229,7 +246,6 @@ class UnattendedInstall(object): > > print " floppy_img: " + str(self.floppy_img) > > print " finish_program: " + str(self.finish_program) > > > > - self.create_boot_floppy() > > if self.tftp_root: > > self.setup_pxe_boot() > > self.cleanup() > > -- To unsubscribe from this list: send the line "unsubscribe kvm" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html