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

John Ogness john.ogness at linutronix.de
Wed Dec 6 13:43:04 CET 2017


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:

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



More information about the elbe-devel mailing list