[elbe-devel] [PATCH 1/2] dump: follow symlinks, when the archive is unpacked

Torben Hohn torben.hohn at linutronix.de
Thu Jun 6 09:35:22 CEST 2019


In buster, /lib is a link to /usr/lib. When an archive contains file
in /lib, this link is deleted, and /lib only contains the archive
contents. This makes /lib/ld-linux.so become inaccessible.

All subsequents tries to chroot into the RFS yield an error, which
is ignored by elbe (mostly in finetuning).

------------------------------------------------------------------------------
running cmd +chroot /var/cache/elbe/65f77d9b-07f6-43f2-b7bf-4890d90153c8/target /bin/sh with STDIN echo 'GRUB_GFXPAYLOAD_LINUX=text' | tee -a /etc/default/grub+
------------------------------------------------------------------------------
chroot: failed to run command '/bin/sh': No such file or directory
------------------------------------------------------------------------------

Command failed with errorcode 127
Finetuning Error, trying to continue anyways
running cmd +chroot /var/cache/elbe/65f77d9b-07f6-43f2-b7bf-4890d90153c8/target /bin/sh with STDIN sed -i -e 's/RPCNFSDCOUNT=8/RPCNFSDCOUNT="8 --nfs-version 2"/' /etc/default/nfs-kernel-server+
------------------------------------------------------------------------------
chroot: failed to run command '/bin/sh': No such file or directory
------------------------------------------------------------------------------

the first error that is not ignored, is when "update-initramfs" during
grub install.

running cmd +chroot /var/cache/elbe/65f77d9b-07f6-43f2-b7bf-4890d90153c8/imagemnt  update-initramfs -u -k all+
------------------------------------------------------------------------------
chroot: failed to run command 'update-initramfs': No such file or directory
------------------------------------------------------------------------------

Command failed with errorcode 127
running cmd +umount /var/cache/elbe/65f77d9b-07f6-43f2-b7bf-4890d90153c8/imagemnt/dev+
------------------------------------------------------------------------------
------------------------------------------------------------------------------

running cmd +umount /var/cache/elbe/65f77d9b-07f6-43f2-b7bf-4890d90153c8/imagemnt/proc+
------------------------------------------------------------------------------
------------------------------------------------------------------------------

running cmd +umount /var/cache/elbe/65f77d9b-07f6-43f2-b7bf-4890d90153c8/imagemnt/sys+
------------------------------------------------------------------------------
------------------------------------------------------------------------------

running cmd +umount /dev/mapper/poop0p2+
------------------------------------------------------------------------------
------------------------------------------------------------------------------

running cmd +umount /dev/mapper/poop0p3+
------------------------------------------------------------------------------
------------------------------------------------------------------------------

running cmd +kpartx -d /dev/poop0+
------------------------------------------------------------------------------
------------------------------------------------------------------------------

running cmd +losetup -d /dev/poop0+
------------------------------------------------------------------------------
------------------------------------------------------------------------------

running cmd +mv "/var/cache/elbe/65f77d9b-07f6-43f2-b7bf-4890d90153c8/filesystems/0"/* "/var/cache/elbe/65f77d9b-07f6-43f2-b7bf-4890d90153c8/target/"+
------------------------------------------------------------------------------
------------------------------------------------------------------------------

Build failed
Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/elbepack/asyncworker.py", line 158, in execute
    skip_pbuild=self.skip_pbuilder)
  File "/usr/lib/python2.7/dist-packages/elbepack/elbeproject.py", line 580, in build
    self.targetfs.part_target(self.builddir, grub_version, grub_fw_type)
  File "/usr/lib/python2.7/dist-packages/elbepack/efilesystem.py", line 316, in part_target
    grub_fw_type)
  File "/usr/lib/python2.7/dist-packages/elbepack/hdimg.py", line 639, in do_hdimg
    grub_fw_type)
  File "/usr/lib/python2.7/dist-packages/elbepack/hdimg.py", line 531, in do_image_hd
    grub.install(target)
  File "/usr/lib/python2.7/dist-packages/elbepack/hdimg.py", line 218, in install
    self.outf.do("chroot %s  update-initramfs -u -k all" % imagemnt)
  File "/usr/lib/python2.7/dist-packages/elbepack/asciidoclog.py", line 62, in do
    raise CommandError(cmd, ret)
CommandError
---------------------------------------------------------------------------

fix it by making tar follow symlinks, when unpacking the archive. (-h)

Signed-off-by: Torben Hohn <torben.hohn at linutronix.de>
---
 elbepack/dump.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/elbepack/dump.py b/elbepack/dump.py
index 3464fdaac..d73b37895 100644
--- a/elbepack/dump.py
+++ b/elbepack/dump.py
@@ -208,7 +208,7 @@ def elbe_report(xml, buildenv, cache, reportname, errorname, targetfs):
 
     if xml.has("archive") and not xml.text("archive") is None:
         with xml.archive_tmpfile() as fp:
-            outf.do('tar xvfj "%s" -C "%s"' % (fp.name, targetfs.path))
+            outf.do('tar xvfj "%s" -h -C "%s"' % (fp.name, targetfs.path))
         mt_index_postarch = targetfs.mtime_snap()
     else:
         mt_index_postarch = mt_index
-- 
2.11.0




More information about the elbe-devel mailing list