[elbe-devel] [PATCH v2 02/13] use qemu from backports instead of self packaged

Torben Hohn torben.hohn at linutronix.de
Wed Dec 6 14:08:21 CET 2017


On Wed, Dec 06, 2017 at 01:43:04PM +0100, John Ogness wrote:
> On 2017-12-05, Torben Hohn <torben.hohn at linutronix.de> wrote:
> >> diff --git a/elbepack/init/default-init.xml b/elbepack/init/default-init.xml
> >> index e1f61ed7..2df7a3f7 100644
> >> --- a/elbepack/init/default-init.xml
> >> +++ b/elbepack/init/default-init.xml
> >> @@ -42,6 +42,7 @@
> >>  		<pkg-list>
> >>  			<pkg>openssh-server</pkg>
> >>  			<pkg>debootstrap/jessie-backports</pkg>
> >> +			<pkg>qemu-user-static/jessie-backports</pkg>
> >
> > Please do not use this syntax here.
> > We have a dbsfed syntax for this:
> > <pkg origin="jessie-backports">qemu-user-static</pkg>
> 
> I think this is a good idea. But requires extending XML schema:

sorry. the field is called pin.
this name is not good... but i believe thats what its used for.

we currently have this:

------------------------------------------------------------
% for n in pkgs:
%  if "pin" in n.et.attrib.keys():
Package: ${n.et.text}
Pin: release a=${n.et.attrib["pin"]}
Pin-Priority: 991
------------------------------------------------------------

do we really want a= or o= ? 
or both ? 
See: man apt_preferences

-----------------------------------------------------------------------------
      the Archive: or Suite: line
           names the archive to which all the packages in the directory
           tree belong. For example, the line "Archive: stable" or "Suite:
           stable" specifies that all of the packages in the directory
           tree below the parent of the Release file are in a stable
           archive. Specifying this value in the APT preferences file
           would require the line:

               Pin: release a=stable

       the Codename: line
           names the codename to which all the packages in the directory
           tree belong. For example, the line "Codename: stretch"
           specifies that all of the packages in the directory tree below
           the parent of the Release file belong to a version named
           stretch. Specifying this value in the APT preferences file
           would require the line:

               Pin: release n=stretch

       the Version: line
           names the release version. For example, the packages in the
           tree might belong to Debian release version 8. Note that there
           is normally no version number for the testing and unstable
           distributions because they have not been released yet.
           Specifying this in the APT preferences file would require one
           of the following lines.

               Pin: release v=8
               Pin: release a=stable, v=8
               Pin: release 8
-----------------------------------------------------------------------------

It seems that all of these map to the apt-get /target-release option.

> 
> diff --git a/schema/dbsfed.xsd b/schema/dbsfed.xsd
> index 964a5ab4..5798b621 100644
> --- a/schema/dbsfed.xsd
> +++ b/schema/dbsfed.xsd
> @@ -1878,6 +1878,13 @@
>              </documentation>
>            </annotation>
>          </attribute>
> +        <attribute name="origin" type="string" use="optional">
> +          <annotation>
> +            <documentation>
> +              alternate target release of the package
> +            </documentation>
> +          </annotation>
> +        </attribute>
>          <attribute name="auto" type="boolean" use="optional">
>            <annotation>
>              <documentation>
> 
> > this needs a bit different logic in 
> >
> > elbepack/init/preseed.cfg.mako, but it would change from this:
> > ----------------------------------------------------------------------------------------------------------
> > % for n in pkgs:
> > % if n.tag == "pkg":
> > %   if prj.has("mirror/primary_host") or not prj.node("mirror/cdrom") or n.et.text.find('/') == -1:
> > ${n.et.text} \
> > %   else:
> > ${n.et.text[:n.et.text.find('/')]} \
> > %   endif
> > % endif
> > % endfor
> > ----------------------------------------------------------------------------------------------------------
> >
> > to something like this:
> >
> > ----------------------------------------------------------------------------------------------------------
> > % for n in pkgs:
> > % if n.tag == "pkg":
> > %   if prj.has("mirror/primary_host") and n.et.attrib.has_key ("origin"):
> > ${n.et.text}/${n.et.attrib["origin"]} \
> > %   elif  n.et.attrib.has_key ("version"): 
> > ${n.et.text}=${n.et.attrib["version"] \
> > %   else
> > ${n.et.text} \
> > %   endif
> > % endif
> > % endfor
> > ----------------------------------------------------------------------------------------------------------
> >
> > depending a bot on whether we want/need version locking.
> >
> > But this is probably necessary for aptly multiversion mirrors.
> 
> I think if version is specified, it should take precedence over the
> target release.
> 
> And since elbe 2.x is already using the unfavorable target release
> syntax in its default-init.xml, we should probably support it. Here is
> what my (tested) version of the code would look like.
> 
> d-i pkgsel/include string rng-tools btrfs-tools openssh-client \
> debathena-transform-lighttpd \
> elbe-soap elbe-buildenv qemu-elbe-user-static \
> ## add extra packages specified in initvm xml
> % for n in pkgs:
> %   if n.tag == "pkg":
> %     if not prj.has("mirror/primary_host") and n.et.text.find('/') > 0:
> ##      Installing initvm from bin-cdrom.iso and a target release was
> ##      specified in the element text. This is how target releases were
> ##      specified for elbe 2.x. The target release must be stripped
> ##      because it is not included as a separate release in the
> ##      bin-cdrom.iso repository. The desired package is available in
> ##      the main release of the bin-cdrom.iso repository.
> ${n.et.text[:n.et.text.find('/')]}\
> %     else:
> ${n.et.text}\
> %     endif
> ##
> %     if prj.has("mirror/primary_host"):
> ##      When not installing initvm from bin-cdrom.iso, add a specified
> ##      version _or_ origin using apt syntax. Version has precedence.
> %       if n.et.attrib.has_key("version"):
> =${n.et.attrib["version"]}\
> %       elif n.et.attrib.has_key("origin"):
> /${n.et.attrib["origin"]}\
> %       endif
> %     endif
>  \
> %   endif
> % endfor
> 
> Should I create a new patch for this?
> 
> Also, note that I have not proposed adding "origin" support to the
> target installation. I assume the necessary change would be in
> preferences.mako, but I wasn't sure how it should look. Something like
> this?
> 
> diff --git a/elbepack/makofiles/preferences.mako
> b/elbepack/makofiles/preferences.mako
> index 0ed2af8b..4d999d4a 100644
> --- a/elbepack/makofiles/preferences.mako
> +++ b/elbepack/makofiles/preferences.mako
> @@ -46,5 +46,10 @@ Package: ${n.et.text}
>  %  if "version" in n.et.attrib.keys():
>  Package: ${n.et.text}
>  Pin: version ${n.et.attrib["version"]}
>  Pin-Priority: 1001
>  
> +%  elif "origin" in n.et.attrib.keys():
> +Package: ${n.et.text}
> +Pin: origin ${n.et.attrib["origin"]}
> +Pin-Priority: 1001
> +
>  %  endif
>  % endfor
> 
> 
> John Ogness

-- 
Mit freundlichen Grüßen
Torben Hohn

Linutronix GmbH

Standort: Bremen

Phone: +49 7556 25 999 18; Fax.: +49 7556 25 999 99

Firmensitz / Registered Office: D-88690 Uhldingen, Bahnhofstr. 3
Registergericht / Local District Court: Amtsgericht Freiburg i. Br.; HRB
Nr. / Trade register no.: 700 806

Geschäftsführer / Managing Directors: Heinz Egger, Thomas Gleixner

Eine Bitte von uns: Sollten Sie diese E-Mail irrtümlich erhalten haben,
benachrichtigen Sie uns in diesem Falle bitte sobald wie es Ihnen
möglich ist, durch Antwort-Mail. Vielen Dank!
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 473 bytes
Desc: Digital signature
URL: <http://lists.linutronix.de/pipermail/elbe-devel/attachments/20171206/6cbdbf17/attachment-0001.sig>


More information about the elbe-devel mailing list