From patchwork Fri Sep 11 12:55:28 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Heiko Thiery X-Patchwork-Id: 1362427 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=pdJoen5u; 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 4BnwjR5PMmz9sTS for ; Fri, 11 Sep 2020 22:55:55 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id 2138C87869; Fri, 11 Sep 2020 12:55:52 +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 El3NDUOs9L3d; Fri, 11 Sep 2020 12:55:50 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by whitealder.osuosl.org (Postfix) with ESMTP id 2781987659; Fri, 11 Sep 2020 12:55:50 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from silver.osuosl.org (smtp3.osuosl.org [140.211.166.136]) by ash.osuosl.org (Postfix) with ESMTP id F10261BF35D for ; Fri, 11 Sep 2020 12:55:47 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by silver.osuosl.org (Postfix) with ESMTP id A1B91228EC for ; Fri, 11 Sep 2020 12:55:47 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from silver.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id D5mq-10JhmDs for ; Fri, 11 Sep 2020 12:55:46 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-wr1-f67.google.com (mail-wr1-f67.google.com [209.85.221.67]) by silver.osuosl.org (Postfix) with ESMTPS id 5150920458 for ; Fri, 11 Sep 2020 12:55:46 +0000 (UTC) Received: by mail-wr1-f67.google.com with SMTP id x14so11349442wrl.12 for ; Fri, 11 Sep 2020 05:55:46 -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=TI0O0YQOR98dGSO/iQzvVf0aHiKMwugfftWpCRPdgZI=; b=pdJoen5uqkpP30QRsYQ9iQgsjSo3c2ph4QuQnJMFPFDQOIO5XOiOyc0oto0LyK8d5j cCDbN5YXucFgoL499knKrwJ4f0rVUJMlgsDNDENbY1B++11sUg9WOF0UMbo99g2XNHjw YUrWlQcSfvCpeb+4CxjPBd/b7H0pkwSRlKV9e3/JFMYBsvzWZ+pu1yrMJYk1EThFcPQp hCdhh6MRQ4oVjBvyAF9SRxnhL79OlAUapLCh+CR58ZDvm7oLGjcQ7Idhd/8iHOL+3Aaw Z7mLD3Ucy1Vp899HLEKDFT5X1g6Oi8SKwnKWlHss4xFA8aI7WXFvHnWK1h/USihfxVZ7 JHOg== 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=TI0O0YQOR98dGSO/iQzvVf0aHiKMwugfftWpCRPdgZI=; b=I/xPH0T4VtMESDPrVQuppeDNXQdGOODtXCrwW9Un6TD4DoYThpBzgRw1bjjZyNLnuK 410v0+V2K+Snn2c8e0pbAshTQ9894DanYuGz/sA6XtcQK7gcLmSg+5neBYpFBsEavpvi 0hhLEI0TdH7oVV3uXP8XBJqz4eLCR80PcAqc6AeIJ/qoJOBTarpqifV0mK2QJOUF0V4i tsvJMLq07pJM4uLOxkZIMV9jWTqndSUpzdPSx6Iy8HQOVtt/Sz43ADGfMonpnfPLWOgM ebK2E21xLAoCvJQT1EP8Gu/W/QlSXYwYFrL5OL3/ezEjdfMbXwcO/6LUl2yq0OfLmTRx SyoQ== X-Gm-Message-State: AOAM530yH5t/EaaLThNtRZjETDwKScJK3Wkss0RjGA//6sCQ3hkJAg8W 3Umq4iapP7Hs9VUE89znPw4ziz5xQsc= X-Google-Smtp-Source: ABdhPJzFpMpp+3bHHfd0Yx6X2uADWBQiGAJODRM2ANpX5g3r5i32Yd9T8+MTxRNeUwVBfcSXQOejxA== X-Received: by 2002:adf:81e6:: with SMTP id 93mr1953775wra.412.1599828944216; Fri, 11 Sep 2020 05:55:44 -0700 (PDT) Received: from t450s.fritz.box (ip5b427139.dynamic.kabel-deutschland.de. [91.66.113.57]) by smtp.gmail.com with ESMTPSA id 185sm4435006wma.18.2020.09.11.05.55.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 11 Sep 2020 05:55:43 -0700 (PDT) From: Heiko Thiery To: buildroot@buildroot.org Date: Fri, 11 Sep 2020 14:55:28 +0200 Message-Id: <20200911125527.28267-1-heiko.thiery@gmail.com> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 Subject: [Buildroot] [PATCH buildroot-test] 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" Sometime autobuilder failures occure only on a specific distribution. To ease the research for the maintainer/developers add a file with that information to the result archive. The distribution information comes from '/etc/os-release' and the PRETTY_NAME value is used from This file. This seems to be present on the most common distros: Debian: https://manpages.debian.org/testing/manpages-de/os-release.5.de.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 --- scripts/autobuild-run | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/scripts/autobuild-run b/scripts/autobuild-run index f657d49..273b7e0 100755 --- a/scripts/autobuild-run +++ b/scripts/autobuild-run @@ -699,6 +699,28 @@ class Builder: with open(os.path.join(self.resultdir, "submitter"), "w+") as submitterf: submitterf.write(self.submitter) + def get_host_distro_info(): + """Get the host os distribution info. + + Try to get the host os release description from '/etc/os-release'. + """ + try: + with open("/etc/os-release") as releasef: + regexp = re.compile(r'PRETTY_NAME="(.*)"') + for line in releasef.readlines(): + m = regexp.search(line) + if m: + return m.group(1) + except IOError: + pass + + return "unknown" + + host_distro_info = get_host_distro_info() + + with open(os.path.join(self.resultdir, "host-distro"), "w+") as distrof: + distrof.write(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"],