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

Re: [Xen-devel] [PATCH OSSTEST v5 04/24] Debian: refactor code to add preseed commands to the preseed file




> -----Original Message-----
> From: Ian Campbell [mailto:ian.campbell@xxxxxxxxxx]
> Sent: Friday, May 01, 2015 7:07 PM
> To: ian.jackson@xxxxxxxxxxxxx
> Cc: Hu, Robert; Pang, LongtaoX; xen-devel@xxxxxxxxxxxxx
> Subject: Re: [Xen-devel] [PATCH OSSTEST v5 04/24] Debian: refactor code to add
> preseed commands to the preseed file
> 
> On Wed, 2015-04-29 at 03:32 +0100, Ian Campbell wrote:
> > On Wed, 2015-04-15 at 11:35 +0100, Ian Campbell wrote:
> >
> > > diff --git a/ts-debian-hvm-install b/ts-debian-hvm-install
> > > index cfd5144..95fce9a 100755
> > > --- a/ts-debian-hvm-install
> > > +++ b/ts-debian-hvm-install
> > > @@ -77,6 +77,9 @@ d-i preseed/late_command string \\
> > >          in-target mkdir -p /root/.ssh; \\
> > >          in-target sh -c "echo -e '$authkeys'> 
> > > /root/.ssh/authorized_keys";
> > >  END
> > > +
> > > +    $preseed_file .= preseed_hook_cmds();
> >
> > Longtao reused this patch for his nestedhvm testing series and
> > discovered a bug. The use of preseed_hook_cmds shadows the
> > preseed/late_command which is just visible here in the patch context
> > meaning that the authorized keys and update-rc.d are not actually run.
> >
> > The code snippet needs to use a "preseed_hook_command($ho,
> > 'late_command', $sfx, <<END);" type thing instead.
> >
> > I'll fix this up in the next iteration.
> 
> I intend to squash the following incremental patch into "Debian:
> refactor code to add preseed commands to the preseed file" in the next
> posting. I've not yet tested it, I'll kick something off over the
> weekend and hopefully repost next week.
> 
> commit c663ce9b76dc3b2c2e1d900d65b58f50f2ee36c5
> Author: Ian Campbell <ian.campbell@xxxxxxxxxx>
> Date:   Fri May 1 12:01:47 2015 +0100
> 
>     squash!Debian: refactor code to add preseed commands to the preseed file
> 
>     v6: Use preseed_hook_command rather than an "d-i preseed/late_comman"
>     entry in the preseed file in ts-debian-hvm-install. The former is
>     overwritten by the result of preseed_hook_cmds.
> 
> diff --git a/ts-debian-hvm-install b/ts-debian-hvm-install
> index 0085d82..98e5d76 100755
> --- a/ts-debian-hvm-install
> +++ b/ts-debian-hvm-install
> @@ -69,10 +69,11 @@ d-i partman-auto/expert_recipe string \\
>                  .
> 
>  d-i apt-setup/cdrom/set-first boolean false
> +END
> 
> -d-i preseed/late_command string \\
> -        in-target mkdir -p /boot/efi/EFI/boot; \\
> -        in-target cp /boot/efi/EFI/debian/grubx64.efi
> /boot/efi/EFI/boot/bootx64.efi ;\\
> +preseed_hook_command($ho, 'late_command', '', <<END);
> +        in-target mkdir -p /boot/efi/EFI/boot
> +        in-target cp /boot/efi/EFI/debian/grubx64.efi
> /boot/efi/EFI/boot/bootx64.efi
>  END
> 
>      $preseed_file .= preseed_hook_cmds();
> 
I have verified this squash patch in my environment.
After push in this patch based on your former v5_patch [04,05,06], the 
'late_command' work fine. 
So, I could add ' in-target sed -i 's/^deb *cdrom/#&/g' /etc/apt/sources.list;' 
code in late_command to disable 'cdrom' entry to make HTTP URL entry available 
in sources.list for L1 hvm guest.


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.