From mboxrd@z Thu Jan 1 00:00:00 1970 X-GM-THRID: 7278939938131804160 X-Received: by 2002:a05:6512:3987:b0:500:c709:5845 with SMTP id j7-20020a056512398700b00500c7095845mr9248827lfu.4.1695373826164; Fri, 22 Sep 2023 02:10:26 -0700 (PDT) X-BeenThere: isar-users@googlegroups.com Received: by 2002:a05:600c:3c81:b0:405:8e:cdfc with SMTP id bg1-20020a05600c3c8100b00405008ecdfcls149393wmb.1.-pod-prod-09-eu; Fri, 22 Sep 2023 02:10:24 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGnNC6eAIOVjt+9Bb13JhHwefzz0I6M3JCS4CjjIJyDbWo/g/fxFPGReCjnr6nJ2H4eHe6w X-Received: by 2002:a5d:530e:0:b0:31a:e744:1297 with SMTP id e14-20020a5d530e000000b0031ae7441297mr6323832wrv.50.1695373824026; Fri, 22 Sep 2023 02:10:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695373824; cv=none; d=google.com; s=arc-20160816; b=GA5nwwTyftbG/yVPDL66M6GmiXkAaJGqv9McfKkT33Sv9ib043Ma8k5EJvRafZlejX LnS8aOFvy3jm8kxI1HlaBmh5QUcK7AdA0GEEUPKdUS65DW3mRVvBxukG7I+zq7Q6PbGu gyJO69BgYzUlKl1Fuw/lk/0Ord9Jb2P38e16DwxT5eOZNdSgZyRSa7C1q8OL/t3k9YCZ hBW8zMY0G5SAF5tr/ZP0sl7sbX48nwtYiPoZ6TxIuWlct19FQ7KghuWqNlNmxZNrLdON F8Hhdgfn3vEYA5YN4XmNjja9iuWdQaw974N28pyijqlQiokOfyJw6UmvAeUjbyouxOnl 2WTg== 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=Wjt6bplkHtbk2Q2H42ebKQ7BHr3+YtybcFkMeSrL/Bc=; fh=7tclEdh7YbwSQowgJ6LNq720O7H5HTEaqj22NJWRE2E=; b=x/TnNX2lIVeOJdgXRQe5p7TrLzUyQto2XXABH6IDae6ZpCwW8xAhoMF4W+g7IeY51j DaT3H7LodbY2q+qvyDYH2ZrivrfzlZZz7TZYVDCqiJtpnwGh7XTGonuDg1Zt9aFVH4sD aXZ67esLOwt8gfFAJWI3exP4LcZ8qDRQDmPwtxBqnLhbypbt+p88PR0xXuuM6/VMsT/W 0sXpgvkJQK9r6VeUUyG6U8dloaLaJZmcYoVGZP7Ij8VnCI3QeKBuVSihVpb4ZeYMoKfu LxWGSJSFwTFw0qkJGKoGtHv53O+Pbzt/KaZF1KvUAyKFIjwIOJwKuxZU1otmU7nL8Rv2 wsvw== 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 Return-Path: Received: from shymkent.ilbers.de (shymkent.ilbers.de. [85.214.156.166]) by gmr-mx.google.com with ESMTPS id e3-20020adffc43000000b0031ac9fda4c5si220195wrs.8.2023.09.22.02.10.23 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 22 Sep 2023 02:10:23 -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; 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 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 38M9A3ZG031991 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Fri, 22 Sep 2023 11:10:23 +0200 From: Uladzimir Bely To: isar-users@googlegroups.com Subject: [PATCH v4 13/13] scripts: Add a script to generate kas yaml configs Date: Fri, 22 Sep 2023 11:10:03 +0200 Message-Id: <20230922091003.20763-14-ubely@ilbers.de> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20230922091003.20763-1-ubely@ilbers.de> References: <20230922091003.20763-1-ubely@ilbers.de> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED 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-TUID: ubn+uoI7Rl3G 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..3b4568b7 --- /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") + +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$//') + +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") + +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 -- 2.20.1