[Pkg-xen-devel] [PATCH 04/12] debian/rules: Adjust boot shuffling script for POSIX

Elliott Mitchell ehem+debian at m5p.com
Fri Sep 18 02:13:47 BST 2020


On Thu, Sep 17, 2020 at 05:01:21PM +0100, Ian Jackson wrote:
> Elliott Mitchell writes ("[PATCH 04/12] debian/rules: Adjust boot shuffling script for POSIX"):
> > Often /bin/sh is distinctly faster than Bash, so move to the better
> > interpreter.  Simplify variable usage to conform.
> 
> See my previous comment.
> 
> Your argument here is "it's faster".  Have you done benchmarks ?  I
> suspect changing everything to sh probably takes off a few
> milliseconds from a half-hour-long Xen package build.

I suspect it is more than that, but will concede it is pretty trivial.

I do stand on the point using a simpler approaches, which /bin/sh forces,
often results in more reliable output.

> > diff --git a/debian/shuffle-boot-files b/debian/shuffle-boot-files
> > index f7492c0c72..8e4ed7e64c 100755
> > --- a/debian/shuffle-boot-files
> > +++ b/debian/shuffle-boot-files
> > @@ -1,4 +1,4 @@
> > -#!/bin/bash
> > +#!/bin/sh
> >  
> >  set -e
> >  
> > @@ -26,6 +26,7 @@ verstring=$(readlink debian/tmp/boot/xen.gz ||
> >  verstring=${verstring##*/}
> >  verstring=${verstring%.gz}
> >  
> > -for f in `cd $t/boot && find * -type f -print`; do
> > -	cp -v $t/boot/$f $dest/${f/$verstring/xen-$version-$flavour}
> > +find "$t/boot" -type f -print | while read f
> > +do
> > +	cp -v "$f" "$dest${f#$t/boot}"
> >  done
> 
> (1) I'm not sure this does precisely the same thing as before
> (2) even the amount of time I have just spent staring at it was
> wasted because there is no need for this change.

Appears I did in fact goof somewhat in my implementation.  Upon looking
closer though it appears the script needs an update anyway and the
question becomes what should the new output look like?

At this point the hypervisor build output filenames are stable.  They
include more of the version, ie "4.14.0" instead of "4.14", but that is
reasonable.  The architecture is not included in the filenames though.

If as documented in the script it is no longer possible to install both
i386 and amd64 (or armhf and arm64) flavors at the same time, then having
the architecture in the filenames is dubious.

Is it worthwhile stripping the patch level off the filenames?


-- 
(\___(\___(\______          --=> 8-) EHM <=--          ______/)___/)___/)
 \BS (    |         ehem+sigmsg at m5p.com  PGP 87145445         |    )   /
  \_CS\   |  _____  -O #include <stddisclaimer.h> O-   _____  |   /  _/
8A19\___\_|_/58D2 7E3D DDF4 7BA6 <-PGP-> 41D1 B375 37D0 8714\_|_/___/5445





More information about the Pkg-xen-devel mailing list