From patchwork Mon Sep 14 20:41:02 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Heiko Thiery X-Patchwork-Id: 1363895 Return-Path: X-Original-To: incoming-buildroot@patchwork.ozlabs.org Delivered-To: patchwork-incoming-buildroot@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=busybox.net (client-ip=140.211.166.138; helo=whitealder.osuosl.org; envelope-from=buildroot-bounces@busybox.net; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20161025 header.b=HhQ/yv+I; dkim-atps=neutral Received: from whitealder.osuosl.org (smtp1.osuosl.org [140.211.166.138]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4Bqywt5Ls1z9sTC for ; Tue, 15 Sep 2020 06:42:54 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id D8DCB86420; Mon, 14 Sep 2020 20:42:49 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from whitealder.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id ZBfglQQIcVkp; Mon, 14 Sep 2020 20:42:47 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by whitealder.osuosl.org (Postfix) with ESMTP id 9387586388; Mon, 14 Sep 2020 20:42:47 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from fraxinus.osuosl.org (smtp4.osuosl.org [140.211.166.137]) by ash.osuosl.org (Postfix) with ESMTP id 262631BF368 for ; Mon, 14 Sep 2020 20:42:46 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by fraxinus.osuosl.org (Postfix) with ESMTP id 224C285A6E for ; Mon, 14 Sep 2020 20:42:46 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from fraxinus.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id e5PkGqsWGYbJ for ; Mon, 14 Sep 2020 20:42:44 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-wm1-f66.google.com (mail-wm1-f66.google.com [209.85.128.66]) by fraxinus.osuosl.org (Postfix) with ESMTPS id 8436D81A14 for ; Mon, 14 Sep 2020 20:42:44 +0000 (UTC) Received: by mail-wm1-f66.google.com with SMTP id y15so1367615wmi.0 for ; Mon, 14 Sep 2020 13:42:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=UEqPMKrhBeMARWe1N/QguttpWoDV5AVP+g3xCKXhdNQ=; b=HhQ/yv+ITSR9meE2OB73HSqECOXcnNvXziLyq6topXYnDx7UqK2p616Nsrf9fvyZSt 31xhnmd7So4CL6IEyecF7fAYonM9Sx6zrTMeBidrYSUkO3YITA63fpEbRS7XXRyxJ0Vy xEKPAv+SOrk2IKm7lG9MsbMgAD25hSgBuLC/aLItTtvl6LWPF60RiLX2iGrPv3eYHGqM 2tIW7dfatHGZqdlmp9affj5FjepprztrZRWlJQldq9qN/yUsAR/NjsWQBJIhe2l+qQDw mRmCIMl9Otr7ExIlLa7ehWrdGC7WXZ5sFJxp0T4R6AxjtlQkMyOL99BD8POgLrUllG1y BvSQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=UEqPMKrhBeMARWe1N/QguttpWoDV5AVP+g3xCKXhdNQ=; b=I/91MihlWmt+Cn27i+BQLF3DTYBORxgXzai21d9kjhewrCG2FiHKr9K+s79F8xKozv f3RN/TlDNqJ1vkv90fsXse8tIPKCJJehdqXQzZU2AgmCqu/mm60Nq3BhCgHcJmIqlCeM ShaULNFwFZF/UtpZESk2MVeBN6lz5+olO1AGsqlS+umJnnhN8yRCZgrsDruGq68OlFv4 N9sSdW+fSOJaOZoHxSCu5gmUhdHyBl1TCheEMNEiIrBRhBYGAz8Jq0BDg63KDcAHrY4Z 1SsWSdPCGJklKXwU0Qp9odi6FbC+Td8ZeSdd7+SbJe8LaSUq3b18L//4JPRLLsgU+LAK N5iA== X-Gm-Message-State: AOAM533wjnSeZWPZ/8uil2G8sFiS+GhPHpGtihMC+vjmVo9rs9XZhTgP 4ZHa9Iv9CiXcIpbC3oUELBOliQ4lpuJpGw== X-Google-Smtp-Source: ABdhPJyf1xa3oDlzdBe3uhim96j8zlYmFMB7PLjM5o+8YCVpgMeIHEl49rUvSDRU2Yhj4i+y1abcQA== X-Received: by 2002:a1c:2e17:: with SMTP id u23mr1188646wmu.73.1600116162524; Mon, 14 Sep 2020 13:42:42 -0700 (PDT) Received: from t450s.fritz.box (ip5b427139.dynamic.kabel-deutschland.de. [91.66.113.57]) by smtp.gmail.com with ESMTPSA id h186sm21570200wmf.24.2020.09.14.13.42.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 14 Sep 2020 13:42:42 -0700 (PDT) From: Heiko Thiery To: buildroot@buildroot.org Date: Mon, 14 Sep 2020 22:41:02 +0200 Message-Id: <20200914204101.16172-1-heiko.thiery@gmail.com> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 Subject: [Buildroot] [PATCH buildroot-test v2] scripts/autobuild-run: create host-distro file X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.29 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Heiko Thiery , "Yann E . MORIN" , Thomas Petazzoni Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" Sometimes autobuilder failures occur only on a specific distribution. To ease the research for the maintainer/developers add the host distribution information to the result archive. The distribution information comes from '/etc/os-release' (or '/usr/lib/os-release') that seems to be present on the most common distros: Debian: https://manpages.debian.org/buster/systemd/os-release.5.en.html Ubuntu: http://manpages.ubuntu.com/manpages/bionic/man5/os-release.5.html Red Red: https://www.freedesktop.org/software/systemd/man/os-release.html Open-Suse: https://en.opensuse.org/SDB:Find_openSUSE_version Signed-off-by: Heiko Thiery Acked-by: Yann E. MORIN --- v2: - implement comments from Yann - copy the whole file (os-release) as host-distro to the result archive - reword the commit log --- scripts/autobuild-run | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/scripts/autobuild-run b/scripts/autobuild-run index f657d49..d4644d6 100755 --- a/scripts/autobuild-run +++ b/scripts/autobuild-run @@ -699,6 +699,23 @@ class Builder: with open(os.path.join(self.resultdir, "submitter"), "w+") as submitterf: submitterf.write(self.submitter) + def get_os_release_path(): + for p in ['/etc/os-release', '/usr/lib/os-release']: + if os.path.exists(p): + return p + return None + + def save_host_distro_info(): + host_distro = os.path.join(self.resultdir, "host-distro") + os_release = get_os_release_path() + if os_release is None: + with open(host_distro, "w") as f: + f.write('Unknown') + else: + shutil.copyfile(os_release, host_distro) + + save_host_distro_info() + # Yes, shutil.make_archive() would be nice, but it doesn't exist # in Python 2.6. ret = subprocess.call(["tar", "cjf", "results.tar.bz2", "results"],