[elbe-devel] mode 'setsel' in elbe version 1.1

Ludwig Zenz lzenz at dh-electronics.de
Mon Jul 11 14:11:00 CEST 2016


Hello Manuel,

the file /var/cache/elbe/pkg-selections didn't even exist before. The
intention was to create it in a way dpkg can read it.

Your patch fails with the following output:
>>
running cmd +chroot <elbepack.efilesystem.TargetFs object at 0x29e5ed0> dpkg
--clear-selections+
----------------------------------------------------------------------------
--
/bin/sh: 1: cannot open elbepack.efilesystem.TargetFs: No such file
----------------------------------------------------------------------------
--

Command failed with errorcode 2
Build failed
Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/elbepack/asyncworker.py", line 86,
in execute
    self.project.build(skip_pkglist=True, build_bin=self.build_bin,
build_sources=self.build_src)
  File "/usr/lib/python2.7/dist-packages/elbepack/elbeproject.py", line 181,
in build
    self.log, self.get_rpcaptcache() )
  File "/usr/lib/python2.7/dist-packages/elbepack/efilesystem.py", line 104,
in extract_target
    log.chroot (dst, "dpkg --clear-selections")
  File "/usr/lib/python2.7/dist-packages/elbepack/asciidoclog.py", line 83,
in chroot
    self.do( chcmd, **args )
  File "/usr/lib/python2.7/dist-packages/elbepack/asciidoclog.py", line 75,
in do
    raise CommandError(cmd, ret)
CommandError	
<<

I think it must be something with qemu user that log.chroot still does not
handle. After reading some python doc and a look at the class
ChRootFilesystem() I think __enter__ and __exit__ are not called. 

I've made a little demo script to demonstrate:
>>
#!/usr/bin/env python

class test:
    def __init__(self):
        print "__init__"

    def __delete__ (self):
        print "delete()"

    def __enter__(self):
        print "__enter__"
        return self

    def __exit__(self, type, value, traceback):
        print "__exit__"

    def testing(self):
        print "calling testing() ..."

print "only __init__ is called"

mytest = test()
mytest.testing()

print "now __enter__ and __exit__ should be called, too"

with test() as mytest2:
    mytest2.testing()
<<

I don't know the elbe internals. It is just a guess of mine.

Regards,
  Ludwig 

-----Original Message-----
From: Manuel Traut [mailto:manuel.traut at linutronix.de] 
Sent: Monday, July 11, 2016 12:36 PM
To: Ludwig Zenz
Cc: elbe-devel at linutronix.de; Robert Goellner; Christoph Niedermaier
Subject: Re: [elbe-devel] mode 'setsel' in elbe version 1.1

Hi Ludwig,
 
> I needed to build a root file system (arch armel) smaller 256 MB and 
> wanted to use the elbe mode 'setsel'. This mode seems to be broken in 
> elbe version 1.1, at least for armel.
> 
> With the patch attached to this e-mail I've got it working. I would be 
> glad if you would apply this patch to the elbe sources.

Please send a human readable description with your patches.

If i got it right you want to the the following:

 1) adding '   install' to each entry in /var/cache/elbe/pkg-selections
 2) copying the qemu-user emulator before calling log.chroot and removing it
afterwards

---

I attached a patch doing 1) and used 'log.chroot' instead of 'log.do'
because the qemu-user may be different for various architectures and the
log.chroot code is already aware of this.

Can you please test the attached patch?

Regards,
  Manuel
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 4815 bytes
Desc: not available
URL: <http://lists.linutronix.de/pipermail/elbe-devel/attachments/20160711/c86e69a4/attachment.bin>


More information about the elbe-devel mailing list