phase2: sanitize SDK host command symlinks
authorJo-Philipp Wich <jo@mein.io>
Thu, 18 Jul 2019 13:30:31 +0000 (15:30 +0200)
committerJo-Philipp Wich <jo@mein.io>
Thu, 18 Jul 2019 13:30:31 +0000 (15:30 +0200)
The SDK archive might contain symlinks like

  staging_dir/host/bin/gcc -> /builder/arc770_generic/ccache_cc.sh

which may result in host compile failures when a slave has been used
for both phase1 and phase2 builds.

Add a new step which purges such links when running the SDK until
buildroot is eventually fixed to not put suhc links into the archive
in the first place.

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
phase2/master.cfg

index 6b8214b8de83651114ed53fc867c98eb539fa060..74fc9b485435a31aed8042d726d0dd85e4a4ce6e 100644 (file)
@@ -353,6 +353,12 @@ for arch in arches:
                command = "rsync --checksum -av sdk_update/ sdk/ && rm -rf sdk_update",
                haltOnFailure = True))
 
+       factory.addStep(ShellCommand(
+               name = "cleancmdlinks",
+               description = "Sanitizing host command symlinks",
+               command = "sdk/staging_dir/host/bin/ -type l -exec sh -c 'case $(readlink {}) in /bin/*|/usr/bin/*) true;; /*) rm -vf {};; esac' \\;",
+               haltOnFailure = True))
+
        factory.addStep(StringDownload(
                name = "writeversionmk",
                s = 'TOPDIR:=${CURDIR}\n\ninclude $(TOPDIR)/include/version.mk\n\nversion:\n\t@echo $(VERSION_NUMBER)\n',