From patchwork Tue Sep 26 05:37:42 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Uladzimir Bely X-Patchwork-Id: 3127 Return-Path: Received: from shymkent.ilbers.de ([unix socket]) by shymkent (Cyrus 2.5.10-Debian-2.5.10-3+deb9u2) with LMTPA; Tue, 26 Sep 2023 07:37:57 +0200 X-Sieve: CMU Sieve 2.4 Received: from mail-wm1-f63.google.com (mail-wm1-f63.google.com [209.85.128.63]) by shymkent.ilbers.de (8.15.2/8.15.2/Debian-8+deb9u1) with ESMTPS id 38Q5btW7016908 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Tue, 26 Sep 2023 07:37:56 +0200 Received: by mail-wm1-f63.google.com with SMTP id 5b1f17b1804b1-4055ce1e8c4sf25850475e9.0 for ; Mon, 25 Sep 2023 22:37:56 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1695706670; cv=pass; d=google.com; s=arc-20160816; b=akt/HTSx7ffWcQRhaX83BlFMxomEVaJA8ZCxEc/Cgtl+bTHPJ4xsf78LfwMwH7oEgx cKVvMthCSa6J4eP1jrzvSgM84923e1BltsKbwWWqWdhjnCSXBAMzu2L19nF42gHgLmTd sHDWWdWL1w+P2a95zSgcA/kPQx/Op/9Do15lqDoHY9iml6oCappweOI9V0sFnjHaNl7R QX3PSTImtehSxTppGrZx4u+qK2cmDo+Qr+Kq4mXpEiUfFbpdF78jcUNze73PJSSm0A0j 58369fsv4qZ3vL7M6e1+QfjlKdKRCXsNfp6PaXr5PRgMyXFvdWLWaW8SulW2zzCDQUbi NWJQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post :list-id:mailing-list:precedence:mime-version:references:in-reply-to :message-id:date:subject:to:from:sender:dkim-signature; bh=HuD69M2PMK6/rUH8pOqB+6vRMa+VY5DCkMAUqnUnwG4=; fh=7tclEdh7YbwSQowgJ6LNq720O7H5HTEaqj22NJWRE2E=; b=aCnPtR3iy4PYimRMHUWv/B4ag7FL9QQVajZRodOqcMAUnCOk+JEzjovAOi1ecDNUja QQ9XpJdkjZxWVSNMClMHewc50cvhEbyWT2VYMhbGYrm7jzjaKB720CU+vnPn6+f1Mk/z zG5SuP5TqtQnlRVnkmpii1mbOexvdQYsX22XaZupqHMsxmripNZ6HAk6ChqrU0UGZ1PE AHKvnbMrhriOZJCmDehRloxlM65bdtYbvd9UwD0OTD7BcgFC7eliMvNPsSYnItzNv82Y qU7Kq8A/dQ5y0TAA8lEZtWcxFNIEYWgmlT8DcysngNEe2lnpBWVRVx/kZckHSlqUYRzO ZsoQ== ARC-Authentication-Results: i=2; gmr-mx.google.com; spf=pass (google.com: domain of ubely@ilbers.de designates 85.214.156.166 as permitted sender) smtp.mailfrom=ubely@ilbers.de DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlegroups.com; s=20230601; t=1695706670; x=1696311470; darn=isar-build.org; h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post :list-id:mailing-list:precedence:x-original-authentication-results :x-original-sender:mime-version:references:in-reply-to:message-id :date:subject:to:from:sender:from:to:cc:subject:date:message-id :reply-to; bh=HuD69M2PMK6/rUH8pOqB+6vRMa+VY5DCkMAUqnUnwG4=; b=FzRe6Tft4zPrkpMec0BH2re+kTJ2BeTNVSNCTiL7Ui69XpO8tfZd2cIGhlJn1YoG8j Fj0DVy4Uojio14EkK4AdrzRJ/rWig5fQ7D5qqJJWCiigjWDsKYif8TFPwzOVgJgbVHCA pYpCalD7IsIH8o3LBtijrw9KeubybW9sBbJkvil0M3WanbpZiS8Okw57vZ05/lzCKENs W2uIE5mhh8scT5FJZPJ5Xm2OnjaMkZQwUyBX/Zvzr6WtiRLy5fpioS9dCRJuuZeD1x2S 6B1H/lfXxVqXAzK+SEOpyXIJPqLoE2nRUt+BmWLY7LQRx9oWRcXXjHbnmTORChqFJorI uTZQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1695706670; x=1696311470; h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post :x-spam-checked-in-group:list-id:mailing-list:precedence :x-original-authentication-results:x-original-sender:mime-version :references:in-reply-to:message-id:date:subject:to:from:x-beenthere :x-gm-message-state:sender:from:to:cc:subject:date:message-id :reply-to; bh=HuD69M2PMK6/rUH8pOqB+6vRMa+VY5DCkMAUqnUnwG4=; b=BexBodgjarouOWH/3aFC1a3vQ9Zsw3mGVXZVKbhc65SvlTp/ewWUs4zWMiu9QeDMzF jXX4EEubQUaXfMeWy2cEE9wMj968/Gobw0aD+BWhTj/m6jgQz7xHWnkotIO5IBnTeeSn gW69X8RMSIqc8Vrr1C76bG6dFmBn+VSmAExB/pyugHUBLy3numYDEMlexhDjxN92oxp/ T/k63QxjNEycoWOXviMAW0K27BvixTgXuEpqmfgjiTCU0SBUw67lYdsQTKRI+DDVyR28 H5Gc1NxcI4JmuVSduP9Vg85EL6PteknxKHLQKhGDGK8+FfCMAzQkHY0DbxPhPM9PRINb OdPg== Sender: isar-users@googlegroups.com X-Gm-Message-State: AOJu0YwgzPSzInC4rHdlXBV48CWAcLx0iUukIw5Qg6m4g5EbtKW2sBkq efja0x82bfnWflgms7UO8ps= X-Google-Smtp-Source: AGHT+IFIrUZ5+is/i88itgjtdHMp5e0bvh3eP+DKfzr4Zj/MjBECnryKPKOEvhoQfgwz2qOoqkX9Gw== X-Received: by 2002:a05:600c:3ba5:b0:405:3622:382c with SMTP id n37-20020a05600c3ba500b004053622382cmr1063317wms.17.1695706670426; Mon, 25 Sep 2023 22:37:50 -0700 (PDT) X-BeenThere: isar-users@googlegroups.com Received: by 2002:a05:600c:5116:b0:406:3987:be03 with SMTP id o22-20020a05600c511600b004063987be03ls126064wms.1.-pod-prod-00-eu-canary; Mon, 25 Sep 2023 22:37:48 -0700 (PDT) X-Received: by 2002:a5d:65c1:0:b0:314:1096:6437 with SMTP id e1-20020a5d65c1000000b0031410966437mr1068759wrw.19.1695706668631; Mon, 25 Sep 2023 22:37:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695706668; cv=none; d=google.com; s=arc-20160816; b=dgoZbpEvEPbaYDyEt7eNxisvQWbVD8pU6lAKXO102MN26epuMvX3qRwvxYjkRxTe/1 kU1Z3N2ysz4fnU9jId8IvSUjNN6xuBp1d1bULLGZ6OKfRBG8DemDwaDudZ6udKSKSiuf v9ti8FfoJxj/U2Yg3CPc8qA7Y0OO5Cc8CUkrJU4VGN5e9VmBUXF5MhbI2WJFRnrwIuZb LsVIkidfQny4WkwWTuvZ/XV5Pl9UbH7g274aI5c4X83sHd6DLXZErsCYkKGaAOsNirOy i5LOjbis8OrNPSAhuluuxq5By0HRcd/eEA1vNlecBxHLUhGlYRei7bMTOWpTFFp2IVjQ BE8w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from; bh=u3lzeB7ewrJAbHIKDIwU3m63e1agD0ZXOCIe7Ysu5hg=; fh=7tclEdh7YbwSQowgJ6LNq720O7H5HTEaqj22NJWRE2E=; b=QtrAjw4cfRPntT6/jb6xJNmpPAF5K8GJB6kSRDINaQrnU4kB92ouhxKME5NoiZfuyj Ty/2ODajWzno3Ca97VDG9RjBIgdF6q91ZsC2ZIUvb+naKjo25g4m2WZSlEpb0H3uKLmo X5gCaD48BLF6B2GRoUC4snfdQkmzfJy5GAwNKcS1DRF3AawvX/QDSbdWeROrXJP3B3uY 7j9PquAOKMah+d6SwDuGQ0y0YU8eT9K0uKh72dfyD4o4mOApkSDzq5RSnNEm0oN6//5e CNnqShy0w8Vb8ADtCiIIWsoLB/5tfwe9oZSImRsihfL3yKWpjmZ2DQpsIU+vviph4xJz XQdA== ARC-Authentication-Results: i=1; gmr-mx.google.com; spf=pass (google.com: domain of ubely@ilbers.de designates 85.214.156.166 as permitted sender) smtp.mailfrom=ubely@ilbers.de Received: from shymkent.ilbers.de (shymkent.ilbers.de. [85.214.156.166]) by gmr-mx.google.com with ESMTPS id t6-20020a0560001a4600b003233224954esi114739wry.6.2023.09.25.22.37.48 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 25 Sep 2023 22:37:48 -0700 (PDT) Received-SPF: pass (google.com: domain of ubely@ilbers.de designates 85.214.156.166 as permitted sender) client-ip=85.214.156.166; Received: from baighyz.m.ilbers.de (host-80-81-17-52.static.customer.m-online.net [80.81.17.52]) (authenticated bits=0) by shymkent.ilbers.de (8.15.2/8.15.2/Debian-8+deb9u1) with ESMTPSA id 38Q5bhxx016779 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Tue, 26 Sep 2023 07:37:48 +0200 From: Uladzimir Bely To: isar-users@googlegroups.com Subject: [PATCH v5 13/13] scripts: Add a script to generate kas yaml configs Date: Tue, 26 Sep 2023 07:37:42 +0200 Message-Id: <20230926053742.11352-14-ubely@ilbers.de> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20230926053742.11352-1-ubely@ilbers.de> References: <20230926053742.11352-1-ubely@ilbers.de> MIME-Version: 1.0 X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIMWL_WL_MED,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_EF,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RCVD_IN_MSPIKE_H2,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on shymkent.ilbers.de X-Original-Sender: ubely@ilbers.de X-Original-Authentication-Results: gmr-mx.google.com; spf=pass (google.com: domain of ubely@ilbers.de designates 85.214.156.166 as permitted sender) smtp.mailfrom=ubely@ilbers.de Precedence: list Mailing-list: list isar-users@googlegroups.com; contact isar-users+owners@googlegroups.com List-ID: X-Spam-Checked-In-Group: isar-users@googlegroups.com X-Google-Group-Id: 914930254986 List-Post: , List-Help: , List-Archive: , List-Unsubscribe: , X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= The script simplifies generating YAML files for new distros, images, machines and Isar packages and helps to avoid copy-paste typos possible when using manual way. Signed-off-by: Uladzimir Bely --- scripts/generate_yaml.sh | 97 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 97 insertions(+) create mode 100755 scripts/generate_yaml.sh diff --git a/scripts/generate_yaml.sh b/scripts/generate_yaml.sh new file mode 100755 index 00000000..e17d6d3d --- /dev/null +++ b/scripts/generate_yaml.sh @@ -0,0 +1,97 @@ +#!/usr/bin/env bash + +# This software is a part of ISAR. +# Copyright (c) 2023 ilbers GmbH +# Authors: +# Uladzimir Bely + +# +# Script to generate yaml files for kas configuration +# + +set -e + +cd "$(dirname "$0")/.." + +HEADER="\ +# This software is a part of ISAR. +# Copyright (C) 2023 ilbers GmbH + +header: + version: 14" + +# Scan for distro configs, except "debian-common" used only for including + +DISTROS=$(find {meta,meta-isar}/conf/distro -iname *.conf -printf "%f\n" \ + | sed -e 's/.conf$//' | grep -v "debian-common" | sort) + +for distro in ${DISTROS} +do + cat << _EOF_ > kas/distro/${distro}.yaml +${HEADER} + +distro: ${distro} +_EOF_ +done + +# Scan for image recipes + +IMAGES=$(find {meta,meta-isar}/recipes-core/images -iname *.bb -printf "%f\n" \ + | sed -e 's/.bb$//' | sort) + +for image in ${IMAGES} +do + cat << _EOF_ > kas/image/${image}.yaml +${HEADER} + +target: ${image} +_EOF_ +done + +# Scan for machine configs, except "rpi-common" used only for including + +MACHINES=$(find meta-isar/conf/machine -iname *.conf -printf "%f\n" \ + | sed -e 's/.conf$//' | grep -v "rpi-common" | sort) + +for machine in ${MACHINES} +do + cat << _EOF_ > kas/machine/${machine}.yaml +${HEADER} + +machine: ${machine} +_EOF_ +done + +# Generate configs for fixed list of Isar packages + +PKGS=" \ + cowsay \ + enable-fsck \ + example-module \ + example-prebuilt \ + example-raw \ + expand-on-first-boot \ + hello-isar \ + hello \ + isar-disable-apt-cache \ + isar-exclude-docs \ + kselftest \ + samefile \ + sshd-regen-keys \ +" +for pkg in ${PKGS} +do + package=${pkg} + + if [ "${pkg}" == "example-module" ]; then + package=${pkg}-\$\{KERNEL_NAME\} + fi + + cat << _EOF_ > kas/package/pkg_${pkg}.yaml +${HEADER} + +local_conf_header: + package-${pkg}: | + IMAGE_INSTALL:append = " ${package}" +_EOF_ +done