From patchwork Tue Jun 11 09:25:56 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Aleksandar Nikolic X-Patchwork-Id: 44891 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 87AB6C27C65 for ; Tue, 11 Jun 2024 09:26:25 +0000 (UTC) Received: from mail-ej1-f53.google.com (mail-ej1-f53.google.com [209.85.218.53]) by mx.groups.io with SMTP id smtpd.web10.5215.1718097975952478763 for ; Tue, 11 Jun 2024 02:26:16 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@gmail.com header.s=20230601 header.b=aW41s/XY; spf=pass (domain: gmail.com, ip: 209.85.218.53, mailfrom: aleksandar.nikolic010@gmail.com) Received: by mail-ej1-f53.google.com with SMTP id a640c23a62f3a-a6ef46d25efso421235466b.0 for ; Tue, 11 Jun 2024 02:26:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1718097974; x=1718702774; darn=lists.openembedded.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=4qKHPr/6pcE0tRSzLUMIMF7kj0beWPvpDOfVwGlC4ys=; b=aW41s/XYKhoS8Yhampl5Xrp3Na2Y7lWKYmKkfvdyXw0Fdg0YyZse2R/MIqzKE7sqiP nmlV6f4ezTNxvbKpQ+GxCJWu3TtOewNc3xrAEnk+1bCYe2U29ABB+27R3birA0mUb0Dy TbPAUpOKHia5sPIGxcpxxqh9VDzFSR7h1U2FbSXGajXYnNK1l14kSOTart9acwWFhnbk ROpSJUJSuoEGhA0sMkefGtxYX5R2pq1xx51NcJJu9QGwCAaF0NgBY2uUh7KU8Bk74AOg mraZnA18bqZDLXkaGXo1FEFXZPNhlVCERvLmrl777ysw0XvrihbsW3vLIOQNTpBWfjMH ShIg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718097974; x=1718702774; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=4qKHPr/6pcE0tRSzLUMIMF7kj0beWPvpDOfVwGlC4ys=; b=pESDzcpgUoNwa5pzMFDBovhK4AMf8CfCUdkgVx9Odo4UCk+6PBzFzLkR3wDXT7GU29 lXGjAQuiKzR+3ZctaRQYc3Cgaf4yPfysdPq+5IFA8iWCFZBhJfgxYgSoT7xWxgiDT+Gk 4vA3dOHP4aheG0pdTzXevGf9T48wQy7e1YvWWrfMVDb6831axaXJXypt3ft3solgM9Xz 06Mr4R1zoFcJXy0J6H8tAFIOslOFgJLmLmRfpR/RW3P29kzy/PKjP1rQJdj/JtxDNq1w cclcaShjJMqYXhDJQpxxyZPiRYYyO7h13jR9fJEp5ZsWFbtKYeBnq5krtHyKFPLwDOz7 2Hrw== X-Gm-Message-State: AOJu0YwR2lvdACx5cxxAUbNg030sHkarM9MYTLBuoJBND89XelIKiBXq a+/Vdwr2FjVQs8bqzAdN9n+oP71STd0IDMCY+A5Dj2z6+6ldpIFi+J1VeHJMiK8= X-Google-Smtp-Source: AGHT+IHOTQkTc9Z9yBdSu3/IstJBZCXdaay8gJph/iY+2wdn4pSzsriqx6z0HcvuVsqLkKXoU08A9g== X-Received: by 2002:a17:907:9862:b0:a6e:fa35:8d44 with SMTP id a640c23a62f3a-a6efa358effmr538423166b.75.1718097974073; Tue, 11 Jun 2024 02:26:14 -0700 (PDT) Received: from an.. ([2a02:810d:640:170::d5f]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a6e23c9f22asm570173966b.171.2024.06.11.02.26.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 11 Jun 2024 02:26:13 -0700 (PDT) From: Aleksandar Nikolic X-Google-Original-From: Aleksandar Nikolic To: openembedded-core@lists.openembedded.org Cc: Aleksandar Nikolic Subject: [PATCH 1/3] install-buildtools: remove md5 checksum validation Date: Tue, 11 Jun 2024 11:25:56 +0200 Message-Id: <20240611092558.513238-2-an010@live.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240611092558.513238-1-an010@live.com> References: <20240611092558.513238-1-an010@live.com> MIME-Version: 1.0 List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Tue, 11 Jun 2024 09:26:25 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/200498 From: Aleksandar Nikolic No need to validate with the md5 checksum, as the file is not even uploaded to the Yocto release webpage (the download never failed due to a wrong indentation of an else statement). For validation purposes, use the sha256 checksum only. Signed-off-by: Aleksandar Nikolic --- scripts/install-buildtools | 27 ++++++++++----------------- 1 file changed, 10 insertions(+), 17 deletions(-) diff --git a/scripts/install-buildtools b/scripts/install-buildtools index 2218f3ffac..a34474ea84 100755 --- a/scripts/install-buildtools +++ b/scripts/install-buildtools @@ -238,19 +238,15 @@ def main(): # Verify checksum if args.check: logger.info("Fetching buildtools installer checksum") - checksum_type = "" - for checksum_type in ["md5sum", "sha256sum"]: - check_url = "{}.{}".format(buildtools_url, checksum_type) - checksum_filename = "{}.{}".format(filename, checksum_type) - tmpbuildtools_checksum = os.path.join(tmpsdk_dir, checksum_filename) - ret = subprocess.call("wget -q -O %s %s" % - (tmpbuildtools_checksum, check_url), shell=True) - if ret == 0: - break - else: - if ret != 0: - logger.error("Could not download file from %s" % check_url) - return ret + checksum_type = "sha256sum" + check_url = "{}.{}".format(buildtools_url, checksum_type) + checksum_filename = "{}.{}".format(filename, checksum_type) + tmpbuildtools_checksum = os.path.join(tmpsdk_dir, checksum_filename) + ret = subprocess.call("wget -q -O %s %s" % + (tmpbuildtools_checksum, check_url), shell=True) + if ret != 0: + logger.error("Could not download file from %s" % check_url) + return ret regex = re.compile(r"^(?P[0-9a-f]+)\s+(?P.*/)?(?P.*)$") with open(tmpbuildtools_checksum, 'rb') as f: original = f.read() @@ -263,10 +259,7 @@ def main(): logger.error("Filename does not match name in checksum") return 1 checksum = m.group('checksum') - if checksum_type == "md5sum": - checksum_value = md5_file(tmpbuildtools) - else: - checksum_value = sha256_file(tmpbuildtools) + checksum_value = sha256_file(tmpbuildtools) if checksum == checksum_value: logger.info("Checksum success") else: From patchwork Tue Jun 11 09:25:57 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Aleksandar Nikolic X-Patchwork-Id: 44893 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 85C73C27C5E for ; Tue, 11 Jun 2024 09:26:25 +0000 (UTC) Received: from mail-ej1-f50.google.com (mail-ej1-f50.google.com [209.85.218.50]) by mx.groups.io with SMTP id smtpd.web11.5276.1718097977574736512 for ; Tue, 11 Jun 2024 02:26:17 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@gmail.com header.s=20230601 header.b=OTCBTgIf; spf=pass (domain: gmail.com, ip: 209.85.218.50, mailfrom: aleksandar.nikolic010@gmail.com) Received: by mail-ej1-f50.google.com with SMTP id a640c23a62f3a-a6266ffdba8so432906366b.1 for ; Tue, 11 Jun 2024 02:26:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1718097976; x=1718702776; darn=lists.openembedded.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=Ztjrd1C/aQAR/QtnX9LzXzDVRvZ2pTZdez1KxPKjmc4=; b=OTCBTgIfbbFXZs6CYuA2zN01wX4Mft4ZyHX9Scy3A4sfUbaos/2MGnz1uNwB4t7LgK KEVNI3ddx5Lek+gM8+JrnrYev/GDWorK4Rx1nrHmekW6NvA1cw5qzQospoY002MEONId nemOvO8PwDfVoAcLSg6qysZ6DfCviG0k89quVpNJ9f2tpZgn819aZ4Dbj1DpRuCBeQvq 2cRk4ODiM9nzPr3UEMYRpsrZCHjirvsUYmWUMGs7RjJT8Vqaz1uWKkPbSRqYVvjz5tUm uMaznkmaxziFE6gUkbhKlNIs1lQsICOlAVkZgqy1LdvbRzI0DYA3LVqJ2Ie2LJ3yf4Nj qrHg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718097976; x=1718702776; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Ztjrd1C/aQAR/QtnX9LzXzDVRvZ2pTZdez1KxPKjmc4=; b=WiZjsefxb4GB/TyclDyplYlJIi+p1d4+CGM6frg1y91j0Xmz7BeodlsLyITAe9P4yg YcVZ+Pz3yCTViDeaX1RmyCOCuPLuTSVMt5Z1UO6pCv2c+1pWk2v/0eJzWHHfifNnI1YY kX7VIZlhCTC9Gk2uNbK8Ojl/VowduLM6YoQ9RAkzYPr6fqTfWgPs1QwXjePsvQf3tLI+ fGwXRLz4y/CvSTd7I6eSD6SkJk2/K3aAhXG/u6p/uEod7JrQS7Pbo6rhU6EgDNCGdQbI AznOoKwS8eJo/gmZaCztMbY4fPoBF6NkaZWTDUb3Z1o434GgVs309J7RsPG5YUz9g8Ff ViMQ== X-Gm-Message-State: AOJu0YyyyyQFRJngxadS9WKi94YxDJ7TGAOEtQP4nwJ2pii+OqIiWOT2 +/5VpidPx/Tyo3+kdz78hd6Ay7+R9/ziltDiHE7M+zCrKfHoInz8Xk2szbeq X-Google-Smtp-Source: AGHT+IFB/vn4UBuYN5SeVrLRuLogz7vqoRUjgypmkXnCtlrCm7sCnv1L3RvrwEdJaW4WyVis8jyJuw== X-Received: by 2002:a17:906:eea:b0:a68:e7df:350b with SMTP id a640c23a62f3a-a6cd7891b58mr739666166b.35.1718097975519; Tue, 11 Jun 2024 02:26:15 -0700 (PDT) Received: from an.. ([2a02:810d:640:170::d5f]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a6e23c9f22asm570173966b.171.2024.06.11.02.26.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 11 Jun 2024 02:26:15 -0700 (PDT) From: Aleksandar Nikolic X-Google-Original-From: Aleksandar Nikolic To: openembedded-core@lists.openembedded.org Cc: Aleksandar Nikolic Subject: [PATCH 2/3] install-buildtools: fix "test installation" step Date: Tue, 11 Jun 2024 11:25:57 +0200 Message-Id: <20240611092558.513238-3-an010@live.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240611092558.513238-1-an010@live.com> References: <20240611092558.513238-1-an010@live.com> MIME-Version: 1.0 List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Tue, 11 Jun 2024 09:26:25 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/200499 From: Aleksandar Nikolic The "Test installation" step fails with some harmless error messages (see [1]). This can however make a user think that the buildtools have not been installed correctly. Two reasons for the error messages: - some envvars in the environment-setup--pokysdk-linux file start and end with double quotes (e.g., PATH) and are as such written into python os.environ. This leads that their usage is not valid later when testing the installation. This patch removes the double quotes before writing, if they are present. - if installation directory (install_dir), given through the option --directory, is given as a relative path, checking if the path to a tool (e.g., gcc) in buildtools starts it will always fail. This patch converts the install_dir variable to an absolute path. [1] ERROR: Something went wrong: tar not found in ./build-tools ERROR: Something went wrong: installation failed Signed-off-by: Aleksandar Nikolic --- scripts/install-buildtools | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/scripts/install-buildtools b/scripts/install-buildtools index a34474ea84..4f85fe87d4 100755 --- a/scripts/install-buildtools +++ b/scripts/install-buildtools @@ -102,6 +102,16 @@ def sha256_file(filename): import hashlib return _hasher(hashlib.sha256(), filename) +def remove_quotes(var): + """ + If a variable starts and ends with double quotes, remove them. + Assumption: if a variable starts with double quotes, it must also + end with them. + """ + if var[0] == '"': + var = var[1:-1] + return var + def main(): global DEFAULT_INSTALL_DIR @@ -273,7 +283,7 @@ def main(): os.chmod(tmpbuildtools, st.st_mode | stat.S_IEXEC) logger.debug(os.stat(tmpbuildtools)) if args.directory: - install_dir = args.directory + install_dir = os.path.abspath(args.directory) ret = subprocess.call("%s -d %s -y" % (tmpbuildtools, install_dir), shell=True) else: @@ -294,7 +304,7 @@ def main(): if match: env_var = match.group('env_var') logger.debug("env_var: %s" % env_var) - env_val = match.group('env_val') + env_val = remove_quotes(match.group('env_val')) logger.debug("env_val: %s" % env_val) os.environ[env_var] = env_val From patchwork Tue Jun 11 09:25:58 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Aleksandar Nikolic X-Patchwork-Id: 44892 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 86B3BC41513 for ; Tue, 11 Jun 2024 09:26:25 +0000 (UTC) Received: from mail-ed1-f48.google.com (mail-ed1-f48.google.com [209.85.208.48]) by mx.groups.io with SMTP id smtpd.web10.5216.1718097978931872460 for ; Tue, 11 Jun 2024 02:26:19 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@gmail.com header.s=20230601 header.b=bKdSe80D; spf=pass (domain: gmail.com, ip: 209.85.208.48, mailfrom: aleksandar.nikolic010@gmail.com) Received: by mail-ed1-f48.google.com with SMTP id 4fb4d7f45d1cf-57c5c51cb89so1046780a12.2 for ; Tue, 11 Jun 2024 02:26:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1718097977; x=1718702777; darn=lists.openembedded.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=LkcYvP7RhfO92yKvaDZE+mR/dyscgqJwuwVwE4iC/7Y=; b=bKdSe80DCnKq4prZQ6HNORmakaExww/v8qxOf10rSVAoJw6hU34GTw3+/y4JpEuaYv h11+g71tBj2Hqi/I4NOjZD1eHvZTuRUBZKGM7VZSkG4efKHb82Fme0iEgdqLDfFLeRBS kEbIVIQQVTjbddWbbb8QJugGNrywU9XYY/3bvrZoCUuJ8HfOt8bqc4smc3WYHAiN8wSI 30KC5G2LgwW0ufmuiHN0UYOWtjJZQwC0z5qtkg+BLodMqZlkTSE1cjf58oL6+woM0R8p gTWpvInOid7C8aatH0R+IrPVKd/Faj42jgORjF5PnT/UagVNYVq22ccqRvOZsTayoGe+ ePSg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718097977; x=1718702777; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=LkcYvP7RhfO92yKvaDZE+mR/dyscgqJwuwVwE4iC/7Y=; b=lo88dGELZ2YmvWMoachdyJ5AN0c9xLKabltQNh9xWIw0iJTuFhH2dU6WJ/K8Vx9T3K KKTsCJcJ3IPDgWHuJHpHR5FM8lBURw9vzrHQDebAposHYp6SNEFkpjmoYHknBUhKmPjG xRWudli9OqSfBki1Yp3KhxtkMZMeuTCCYxp+3KwTUDkjjjT+9k5DO1+MVfkIv6l/09a5 S5Kt/8yozc32lYZK+phHj/LI+K5A+qxb+vSXXDCuzFSDngcimd82fr4eVjmc/vJF/V7Q oDkNRnTvfzzIXZ60lrfA0XI6qLQN0MPwM0reAdsAf8RwpU5semrrAOX9qYK+ndrf+b8N a44w== X-Gm-Message-State: AOJu0Yxlhr8SE8FLW6UzZeiiyGatmIlNYC34HX1PmkG4+MNAnLCP8d8E PfBeV/z6+FTz6P2TAguoXZcvP0LshbIskeZ9ALlIDBclSZlhiRxQjhVpcS1i X-Google-Smtp-Source: AGHT+IEM1RA8lCZYLP8ZWq+ZD+9fXv9T1lMwf8H4518Y2QMhWA6U9s0zE6LWtDQvBoQ6YGSeCbYwAQ== X-Received: by 2002:a17:906:b096:b0:a6f:185b:6406 with SMTP id a640c23a62f3a-a6f185b6507mr448400566b.69.1718097976972; Tue, 11 Jun 2024 02:26:16 -0700 (PDT) Received: from an.. ([2a02:810d:640:170::d5f]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a6e23c9f22asm570173966b.171.2024.06.11.02.26.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 11 Jun 2024 02:26:16 -0700 (PDT) From: Aleksandar Nikolic X-Google-Original-From: Aleksandar Nikolic To: openembedded-core@lists.openembedded.org Cc: Aleksandar Nikolic Subject: [PATCH 3/3] install-buildtools: update base-url, release and installer version Date: Tue, 11 Jun 2024 11:25:58 +0200 Message-Id: <20240611092558.513238-4-an010@live.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240611092558.513238-1-an010@live.com> References: <20240611092558.513238-1-an010@live.com> MIME-Version: 1.0 List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Tue, 11 Jun 2024 09:26:25 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/200500 From: Aleksandar Nikolic Update the following default values: - DEFAULT_BASE_URL (https instead of http) - DEFAULT_RELEASE (5.0.1) - DEFAULT_INSTALLER_VERSION (5.0.1) Signed-off-by: Aleksandar Nikolic --- scripts/install-buildtools | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/scripts/install-buildtools b/scripts/install-buildtools index 4f85fe87d4..5b86c13077 100755 --- a/scripts/install-buildtools +++ b/scripts/install-buildtools @@ -56,9 +56,9 @@ PROGNAME = 'install-buildtools' logger = scriptutils.logger_create(PROGNAME, stream=sys.stdout) DEFAULT_INSTALL_DIR = os.path.join(os.path.split(scripts_path)[0],'buildtools') -DEFAULT_BASE_URL = 'http://downloads.yoctoproject.org/releases/yocto' -DEFAULT_RELEASE = 'yocto-4.1' -DEFAULT_INSTALLER_VERSION = '4.1' +DEFAULT_BASE_URL = 'https://downloads.yoctoproject.org/releases/yocto' +DEFAULT_RELEASE = 'yocto-5.0.1' +DEFAULT_INSTALLER_VERSION = '5.0.1' DEFAULT_BUILDDATE = '202110XX' # Python version sanity check