From 2b6400a106d4effe5222d7507881c17a9352bcf1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Piotr=20Kr=C3=B3l?= Date: Tue, 18 Jun 2024 00:59:59 +0200 Subject: [PATCH 01/99] dts-base-image: add lshw MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Piotr Król --- meta-dts-distro/recipes-dts/images/dts-base-image.inc | 1 + 1 file changed, 1 insertion(+) diff --git a/meta-dts-distro/recipes-dts/images/dts-base-image.inc b/meta-dts-distro/recipes-dts/images/dts-base-image.inc index 0615ff9c..128fa6d9 100644 --- a/meta-dts-distro/recipes-dts/images/dts-base-image.inc +++ b/meta-dts-distro/recipes-dts/images/dts-base-image.inc @@ -16,6 +16,7 @@ IMAGE_INSTALL:append = " \ libxcrypt-compat \ alsa-utils-aplay \ hw-probe \ + lshw \ " # Enable local auto-login of the root user (local = serial port and From 400c96002c37568b91dae9d5037bad9ccc0339be Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Piotr=20Kr=C3=B3l?= Date: Tue, 25 Jun 2024 12:08:59 +0200 Subject: [PATCH 02/99] meta-dts-distro: add python3-roca-detect MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Piotr Król --- .../python/python3-roca-detect_git_1.2.12.bb | 45 +++++++++++++++++++ .../packagegroups/packagegroup-dts.bb | 1 + 2 files changed, 46 insertions(+) create mode 100644 meta-dts-distro/recipes-devtool/python/python3-roca-detect_git_1.2.12.bb diff --git a/meta-dts-distro/recipes-devtool/python/python3-roca-detect_git_1.2.12.bb b/meta-dts-distro/recipes-devtool/python/python3-roca-detect_git_1.2.12.bb new file mode 100644 index 00000000..bd15657b --- /dev/null +++ b/meta-dts-distro/recipes-devtool/python/python3-roca-detect_git_1.2.12.bb @@ -0,0 +1,45 @@ +# Recipe created by recipetool +# This is the basis of a recipe and may need further editing in order to be fully functional. +# (Feel free to remove these comments when editing.) + +SUMMARY = "ROCA key detector / fingerprinter tool" +HOMEPAGE = "https://github.com/crocs-muni/roca" +# NOTE: License in setup.py/PKGINFO is: MIT +# WARNING: the following LICENSE and LIC_FILES_CHKSUM values are best guesses - it is +# your responsibility to verify that the values are complete and correct. +LICENSE = "MIT" +LIC_FILES_CHKSUM = "file://LICENSE;md5=2a6b12210371b9201fd100ff0cbef45a" + +SRC_URI = "git://github.com/crocs-muni/roca;protocol=https;branch=master" + +# Modify these as desired +PV = "v1.2.12+git" +SRCREV = "df6071d502f68701427f8b1d409cab22055ad1b7" + +S = "${WORKDIR}/git" + +inherit setuptools3 + +# WARNING: the following rdepends are determined through basic analysis of the +# python sources, and might not be 100% accurate. +RDEPENDS:${PN} += "python3-compression python3-core python3-crypt python3-datetime python3-io python3-json python3-logging python3-math python3-netclient python3-unittest" + +# WARNING: We were unable to map the following python package/module +# dependencies to the bitbake packages which include them: +# apk_parse.apk +# coloredlogs +# cryptography.hazmat.backends +# cryptography.hazmat.backends.openssl.backend +# cryptography.hazmat.backends.openssl.x509 +# cryptography.hazmat.primitives +# cryptography.hazmat.primitives.asymmetric.rsa +# cryptography.hazmat.primitives.serialization +# cryptography.x509 +# cryptography.x509.base +# cryptography.x509.oid +# future.utils +# jks +# past.builtins +# pgpdump.data +# pgpdump.packet +# pkg_resources diff --git a/meta-dts-distro/recipes-dts/packagegroups/packagegroup-dts.bb b/meta-dts-distro/recipes-dts/packagegroups/packagegroup-dts.bb index 9d907a97..eacb03fd 100644 --- a/meta-dts-distro/recipes-dts/packagegroups/packagegroup-dts.bb +++ b/meta-dts-distro/recipes-dts/packagegroups/packagegroup-dts.bb @@ -55,4 +55,5 @@ RDEPENDS:${PN}-tools-dts = " \ RDEPENDS:${PN}-python = " \ python3-binwalk \ python3-uefi-firmware \ + python3-roca-detect \ " From 3c3461f2ad5d789d491e5ff2e4f9d9038fa8426e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Piotr=20Kr=C3=B3l?= Date: Thu, 27 Jun 2024 11:51:59 +0200 Subject: [PATCH 03/99] meta-dts-distro: add rdepends for python3-roca-detect MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Piotr Król --- .../recipes-devtool/python/python3-roca-detect_git_1.2.12.bb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/meta-dts-distro/recipes-devtool/python/python3-roca-detect_git_1.2.12.bb b/meta-dts-distro/recipes-devtool/python/python3-roca-detect_git_1.2.12.bb index bd15657b..2670b303 100644 --- a/meta-dts-distro/recipes-devtool/python/python3-roca-detect_git_1.2.12.bb +++ b/meta-dts-distro/recipes-devtool/python/python3-roca-detect_git_1.2.12.bb @@ -22,7 +22,7 @@ inherit setuptools3 # WARNING: the following rdepends are determined through basic analysis of the # python sources, and might not be 100% accurate. -RDEPENDS:${PN} += "python3-compression python3-core python3-crypt python3-datetime python3-io python3-json python3-logging python3-math python3-netclient python3-unittest" +RDEPENDS:${PN} += "python3-compression python3-core python3-crypt python3-datetime python3-io python3-json python3-logging python3-math python3-netclient python3-unittest python3-future python3-coloredlogs" # WARNING: We were unable to map the following python package/module # dependencies to the bitbake packages which include them: From 2c593d7b97f58d831eeba3b26c7e5d4bbfb0fd20 Mon Sep 17 00:00:00 2001 From: Maciej Pijanowski Date: Thu, 27 Jun 2024 17:09:55 +0200 Subject: [PATCH 04/99] Revert "dts: Remove separate EC update when updating Dasharo" This reverts commit 1b1e70f83b40d7229d06cebbe6eea06a8ec32499. We needs this **after** we publish releases with auto EC update for all boards. --- .../dts/dasharo-deploy/dasharo-deploy | 72 ++++++++++++++----- .../recipes-dts/dts/dts/dts-functions.sh | 4 +- 2 files changed, 55 insertions(+), 21 deletions(-) diff --git a/meta-dts-distro/recipes-dts/dts/dasharo-deploy/dasharo-deploy b/meta-dts-distro/recipes-dts/dts/dasharo-deploy/dasharo-deploy index 7736460e..f0843358 100755 --- a/meta-dts-distro/recipes-dts/dts/dasharo-deploy/dasharo-deploy +++ b/meta-dts-distro/recipes-dts/dts/dasharo-deploy/dasharo-deploy @@ -462,6 +462,13 @@ install() { fi } +update_ec() { + verify_artifacts ec + echo "Updating EC..." + $DASHARO_ECTOOL flash "$EC_UPDATE_FILE" &>> $ERR_LOG_FILE + error_check "Failed to update EC firmware" +} + update() { local _can_switch_to_heads="false" @@ -482,11 +489,21 @@ update() { BIOS_HASH_LINK=$BIOS_HASH_LINK_COMM BIOS_SIGN_LINK=$BIOS_SIGN_LINK_COMM BIOS_LINK=$BIOS_LINK_COMM + if [ "$HAVE_EC" == "true" ]; then + EC_HASH_LINK=$EC_HASH_LINK_COMM + EC_SIGN_LINK=$EC_SIGN_LINK_COMM + EC_LINK=$EC_LINK_COMM + fi UPDATE_VERSION=$DASHARO_REL_VER else BIOS_HASH_LINK=$BIOS_HASH_LINK_DES BIOS_SIGN_LINK=$BIOS_SIGN_LINK_DES BIOS_LINK=$BIOS_LINK_DES + if [ "$HAVE_EC" == "true" ]; then + EC_HASH_LINK=$EC_HASH_LINK_DES + EC_SIGN_LINK=$EC_SIGN_LINK_DES + EC_LINK=$EC_LINK_DES + fi UPDATE_VERSION=$DASHARO_REL_VER_DES fi else @@ -496,6 +513,11 @@ update() { BIOS_HASH_LINK=$BIOS_HASH_LINK_COMM BIOS_SIGN_LINK=$BIOS_SIGN_LINK_COMM BIOS_LINK=$BIOS_LINK_COMM + if [ "$HAVE_EC" == "true" ]; then + EC_HASH_LINK=$EC_HASH_LINK_COMM + EC_SIGN_LINK=$EC_SIGN_LINK_COMM + EC_LINK=$EC_LINK_COMM + fi UPDATE_VERSION=$DASHARO_REL_VER fi if [ -v HAVE_HEADS_FW ] && [ "$DASHARO_FLAVOR" != "Dasharo (coreboot+heads)" ]; then @@ -528,6 +550,11 @@ update() { BIOS_HASH_LINK=$BIOS_HASH_LINK_COMM BIOS_SIGN_LINK=$BIOS_SIGN_LINK_COMM BIOS_LINK=$BIOS_LINK_COMM + if [ "$HAVE_EC" == "true" ]; then + EC_HASH_LINK=$EC_HASH_LINK_COMM + EC_SIGN_LINK=$EC_SIGN_LINK_COMM + EC_LINK=$EC_LINK_COMM + fi UPDATE_VERSION=$DASHARO_REL_VER if [ -v HAVE_HEADS_FW ] && [ "$DASHARO_FLAVOR" != "Dasharo (coreboot+heads)" ]; then print_green "Dasharo heads firmware version is available. If you are interested," @@ -676,25 +703,32 @@ update() { print_green "Successfully updated Dasharo firmware." fi - echo -n "Syncing disks... " - sync - echo "Done." - echo "The computer will reboot automatically in 5 seconds" - sleep 0.5 - echo "Rebooting in 5s:" - echo "5..." - sleep 1 - echo "4..." - sleep 1 - echo "3..." - sleep 1 - echo "2..." - sleep 1 - echo "1..." - sleep 0.5 - echo "Rebooting" - sleep 1 - ${CMD_REBOOT} + if [ "$HAVE_EC" == "true" ]; then + echo "Updating Embedded Controller firmware. Your computer will power off automatically when done." + update_ec # Ends in a reset, does not exit + else + echo -n "Syncing disks... " + sync + echo "Done." + echo "The computer will reboot automatically in 5 seconds" + sleep 0.5 + echo "Rebooting in 5s:" + echo "5..." + sleep 1 + echo "4..." + sleep 1 + echo "3..." + sleep 1 + echo "2..." + sleep 1 + echo "1..." + sleep 0.5 + echo "Rebooting" + sleep 1 + ${CMD_REBOOT} + fi + + } restore() { diff --git a/meta-dts-distro/recipes-dts/dts/dts/dts-functions.sh b/meta-dts-distro/recipes-dts/dts/dts/dts-functions.sh index 09486aa1..cfe2b9af 100644 --- a/meta-dts-distro/recipes-dts/dts/dts/dts-functions.sh +++ b/meta-dts-distro/recipes-dts/dts/dts/dts-functions.sh @@ -796,7 +796,7 @@ download_artifacts() { curl -s -L -f "$BIOS_SIGN_LINK" -o $BIOS_SIGN_FILE error_check "Cannot access $FW_STORE_URL while downloading signature. Please check your internet connection" - if [ "$HAVE_EC" == "true" ] && [ -v EC_LINK ]; then + if [ "$HAVE_EC" == "true" ]; then curl -s -L -f "$EC_LINK" -o "$EC_UPDATE_FILE" error_check "Cannot access $FW_STORE_URL while downloading binary. Please check your internet connection" @@ -818,7 +818,7 @@ download_artifacts() { curl -s -L -f -u "$USER_DETAILS" -H "$CLOUD_REQUEST" "$BIOS_SIGN_LINK" -o $BIOS_SIGN_FILE error_check "Cannot access $FW_STORE_URL_DES while downloading signature. Please check your internet connection and credentials" - if [ "$HAVE_EC" == "true" ] && [ -v EC_LINK ]; then + if [ "$HAVE_EC" == "true" ]; then if [ -v EC_LINK_COMM ] && [ ${EC_LINK} == ${EC_LINK_COMM} ]; then curl -s -L -f "$EC_LINK" -o "$EC_UPDATE_FILE" error_check "Cannot access $FW_STORE_URL while downloading binary. Please From 652f2434a7a9bee855d48aa72b6bfab8ddeb21b9 Mon Sep 17 00:00:00 2001 From: Maciej Pijanowski Date: Thu, 27 Jun 2024 17:18:20 +0200 Subject: [PATCH 05/99] CHANGELOG.md: add v1.2.22 Signed-off-by: Maciej Pijanowski --- CHANGELOG.md | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 108d3373..464c9443 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,17 @@ All notable changes to the DTS project will be documented in this file. +## v1.2.22 - 2024-06-27 + +* Extended Dasharo zero-touch initial deployment on PCEngines APU2 platforms for + [DES](https://docs.dasharo.com/ways-you-can-help-us/#become-a-dasharo-entry-subscription-subscriber) + users with SeaBIOS firmware variant, in addition to UEFI variant. +* Increase supported Dasharo (coreboot + heads) version from v0.9.0 to v0.9.1 + for NovaCustom NV4x 12th Gen series +* Include new tools into the image: `python3-roca-detect`, `iperf3`, `lshw` +* Fix [Dell Optiplex 7010 initial deployment](https://github.com/Dasharo/dasharo-issues/issues/706) +* Update versions of coreboot-utils + ## v1.2.21 - 2024-03-29 * Added Dasharo zero-touch initial deployment on PCEngines APU2 platforms for From c59ebecd42964824ea91af7977121cf4699f9039 Mon Sep 17 00:00:00 2001 From: Maciej Pijanowski Date: Thu, 27 Jun 2024 17:38:20 +0200 Subject: [PATCH 06/99] dasharo-deploy: preserve settings for seabios initial deploy Signed-off-by: Maciej Pijanowski --- .../recipes-dts/dts/dasharo-deploy/dasharo-deploy | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/meta-dts-distro/recipes-dts/dts/dasharo-deploy/dasharo-deploy b/meta-dts-distro/recipes-dts/dts/dasharo-deploy/dasharo-deploy index f0843358..b78cbc1c 100755 --- a/meta-dts-distro/recipes-dts/dts/dasharo-deploy/dasharo-deploy +++ b/meta-dts-distro/recipes-dts/dts/dasharo-deploy/dasharo-deploy @@ -428,7 +428,13 @@ install() { fi echo "Installing Dasharo firmware..." - $FLASHROM -p "$PROGRAMMER_BIOS" ${FLASH_CHIP_SELECT} ${FLASHROM_ADD_OPT_REGIONS} -w "$BIOS_UPDATE_FILE" >> $FLASHROM_LOG_FILE 2>> $ERR_LOG_FILE + # FIXME: It seems we do not have an easy way to add some flasrhom extra args + # globally for specific platform and variant + local _flashrom_extra_args="" + if [ "${BIOS_LINK}" = "${BIOS_LINK_DES_SEABIOS}" ]; then + _flashrom_extra_args = "--fmap -i COREBOOT" + fi + $FLASHROM -p "$PROGRAMMER_BIOS" ${FLASH_CHIP_SELECT} ${FLASHROM_ADD_OPT_REGIONS} -w "$BIOS_UPDATE_FILE" "${_flashrom_extra_args}" >> $FLASHROM_LOG_FILE 2>> $ERR_LOG_FILE error_check "Failed to install Dasharo firmware" print_green "Successfully installed Dasharo firmware" From c61b14971764b2f0661d360b55c452e51eacf921 Mon Sep 17 00:00:00 2001 From: Maciej Pijanowski Date: Thu, 27 Jun 2024 18:33:19 +0200 Subject: [PATCH 07/99] dts-functions: support seabios in check_se_creds() Signed-off-by: Maciej Pijanowski --- meta-dts-distro/recipes-dts/dts/dts/dts-functions.sh | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/meta-dts-distro/recipes-dts/dts/dts/dts-functions.sh b/meta-dts-distro/recipes-dts/dts/dts/dts-functions.sh index cfe2b9af..c053a77c 100644 --- a/meta-dts-distro/recipes-dts/dts/dts/dts-functions.sh +++ b/meta-dts-distro/recipes-dts/dts/dts/dts-functions.sh @@ -691,6 +691,7 @@ check_flash_chip() { check_se_creds() { local _check_dwn_req_resp_uefi="0" local _check_dwn_req_resp_heads="0" + local _check_dwn_req_resp_seabios="0" local _check_logs_req_resp="0" CLOUDSEND_LOGS_URL=$(sed -n '1p' < ${SE_credential_file} | tr -d '\n') CLOUDSEND_DOWNLOAD_URL=$(sed -n '2p' < ${SE_credential_file} | tr -d '\n') @@ -699,7 +700,7 @@ check_se_creds() { board_config TEST_LOGS_URL="https://cloud.3mdeb.com/index.php/s/${CLOUDSEND_LOGS_URL}/authenticate/showShare" - if [ ! -v BIOS_LINK_DES ] && [ ! -v HEADS_LINK_DES ]; then + if [ ! -v BIOS_LINK_DES ] && [ ! -v HEADS_LINK_DES ] && [ ! -v BIOS_LINK_DES_SEABIOS ]; then error_exit "There is no Dasharo Entry Subscription available for your platform!" fi @@ -710,9 +711,12 @@ check_se_creds() { if [ -v HEADS_LINK_DES ]; then _check_dwn_req_resp_heads=$(curl -L -I -s -f -u "$USER_DETAILS" -H "$CLOUD_REQUEST" "$HEADS_LINK_DES" -o /dev/null -w "%{http_code}") fi + if [ -v BIOS_LINK_DES_SEABIOS ]; then + _check_dwn_req_resp_seabios=$(curl -L -I -s -f -u "$USER_DETAILS" -H "$CLOUD_REQUEST" "$BIOS_LINK_DES_SEABIOS" -o /dev/null -w "%{http_code}") + fi _check_logs_req_resp=$(curl -L -I -s -f -H "$CLOUD_REQUEST" "$TEST_LOGS_URL" -o /dev/null -w "%{http_code}") - if [ ${_check_dwn_req_resp_uefi} -eq 200 ] || [ ${_check_dwn_req_resp_heads} -eq 200 ]; then + if [ ${_check_dwn_req_resp_uefi} -eq 200 ] || [ ${_check_dwn_req_resp_heads} -eq 200 ] || [ ${_check_dwn_req_resp_seabios} -eq 200 ]; then if [ ${_check_logs_req_resp} -eq 200 ]; then return 0 else From 73333676c1058a960a05c0a3e50ad234a1bd1777 Mon Sep 17 00:00:00 2001 From: Maciej Pijanowski Date: Thu, 27 Jun 2024 22:15:41 +0200 Subject: [PATCH 08/99] dasharo-deploy: fix flashrom_extra_args Signed-off-by: Maciej Pijanowski --- meta-dts-distro/recipes-dts/dts/dasharo-deploy/dasharo-deploy | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/meta-dts-distro/recipes-dts/dts/dasharo-deploy/dasharo-deploy b/meta-dts-distro/recipes-dts/dts/dasharo-deploy/dasharo-deploy index b78cbc1c..03aac319 100755 --- a/meta-dts-distro/recipes-dts/dts/dasharo-deploy/dasharo-deploy +++ b/meta-dts-distro/recipes-dts/dts/dasharo-deploy/dasharo-deploy @@ -432,9 +432,9 @@ install() { # globally for specific platform and variant local _flashrom_extra_args="" if [ "${BIOS_LINK}" = "${BIOS_LINK_DES_SEABIOS}" ]; then - _flashrom_extra_args = "--fmap -i COREBOOT" + _flashrom_extra_args="--fmap -i COREBOOT" fi - $FLASHROM -p "$PROGRAMMER_BIOS" ${FLASH_CHIP_SELECT} ${FLASHROM_ADD_OPT_REGIONS} -w "$BIOS_UPDATE_FILE" "${_flashrom_extra_args}" >> $FLASHROM_LOG_FILE 2>> $ERR_LOG_FILE + $FLASHROM -p "$PROGRAMMER_BIOS" ${FLASH_CHIP_SELECT} ${FLASHROM_ADD_OPT_REGIONS} -w "$BIOS_UPDATE_FILE" ${_flashrom_extra_args} >> $FLASHROM_LOG_FILE 2>> $ERR_LOG_FILE error_check "Failed to install Dasharo firmware" print_green "Successfully installed Dasharo firmware" From 377e0b637fa894194ad2949dfc141e36f3bb30b0 Mon Sep 17 00:00:00 2001 From: Maciej Pijanowski Date: Thu, 27 Jun 2024 22:58:07 +0200 Subject: [PATCH 09/99] dts-distro.conf: bump to v1.2.23 Signed-off-by: Maciej Pijanowski --- meta-dts-distro/conf/distro/dts-distro.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/meta-dts-distro/conf/distro/dts-distro.conf b/meta-dts-distro/conf/distro/dts-distro.conf index d12bce28..709120df 100644 --- a/meta-dts-distro/conf/distro/dts-distro.conf +++ b/meta-dts-distro/conf/distro/dts-distro.conf @@ -4,7 +4,7 @@ DISTRO = "dts-distro" # distro name DISTRO_NAME = "Dasharo Tools Suite" -DISTRO_VERSION = "1.2.22" +DISTRO_VERSION = "1.2.23" SDK_VENDOR = "-dtssdk" MAINTAINER = "3mdeb Sp. z o. o. " From 4b030b6a7ff755a1ad6987f9b3fdd1c07c2a537d Mon Sep 17 00:00:00 2001 From: Maciej Pijanowski Date: Thu, 27 Jun 2024 23:00:42 +0200 Subject: [PATCH 10/99] CHANGELOG.md: v1.2.23 Signed-off-by: Maciej Pijanowski --- CHANGELOG.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 464c9443..1e5c0c60 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,10 @@ All notable changes to the DTS project will be documented in this file. +## v1.2.23 - 2024-06-27 + +* Hotfix for PC Engines SeaBIOS firmware variant deployment + ## v1.2.22 - 2024-06-27 * Extended Dasharo zero-touch initial deployment on PCEngines APU2 platforms for From 2d570406b7c97c8cb810f6f918f97167aa68f681 Mon Sep 17 00:00:00 2001 From: Tymoteusz Burak Date: Mon, 8 Jul 2024 16:01:56 +0200 Subject: [PATCH 11/99] workflows: get DTS_VER from tag not dts-distro.conf --- .github/workflows/ci.yml | 26 ++++++++++++++++++++------ .github/workflows/develop.yml | 26 ++++++++++++++++++++------ 2 files changed, 40 insertions(+), 12 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 67b0cc70..c22dcffe 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -66,12 +66,26 @@ jobs: id: dts-ver shell: bash run: | - DTS_VER=v`cat meta-dts/meta-dts-distro/conf/distro/dts-distro.conf | grep DISTRO_VERSION | tr -d "\" [A-Z]_="` - echo "DTS_VER=${DTS_VER}" >> $GITHUB_OUTPUT + # Extract tag version from GITHUB_REF + TAG=${GITHUB_REF#refs/tags/} + DTS_VER=$(echo "${TAG}" | sed -E 's/^v//') + echo "DTS_VER=${DTS_VER}" >> $GITHUB_ENV + - name: Validate DTS_VER + if: ${{ success() }} + shell: bash + run: | + # Retrieve DTS_VER from previous step + DTS_VER_EXPECTED="${{ env.DTS_VER }}" + DTS_VER_ACTUAL=$(cat meta-dts/meta-dts-distro/conf/distro/dts-distro.conf | grep DISTRO_VERSION | tr -d "\" [A-Z]_=") + + if [ "${DTS_VER_EXPECTED}" != "${DTS_VER_ACTUAL}" ]; then + echo "Tag (${DTS_VER_EXPECTED}) does not match version (${DTS_VER_ACTUAL}) in `meta-dts/meta-dts-distro/conf/distro/dts-distro.conf`" + exit 1 + fi - name: Deploy DTS on boot.dasharo.com shell: bash run: | - DTS_VER="${{steps.dts-ver.outputs.DTS_VER}}" + DTS_VER="${{ env.DTS_VER }}" ssh -i ~/.ssh/dts-ci-key builder@10.1.40.2 "mkdir -p boot/dts/${DTS_VER}" cd build/tmp/deploy/images/genericx86-64/ cp bzImage bzImage-${DTS_VER} @@ -91,7 +105,7 @@ jobs: - name: Deploy sha256 on boot.dasharo.com shell: bash run: | - DTS_VER="${{steps.dts-ver.outputs.DTS_VER}}" + DTS_VER="${{ env.DTS_VER }}" cd build/tmp/deploy/images/genericx86-64/ sha256sum bzImage-${DTS_VER} > bzImage-${DTS_VER}.sha256 sha256sum dts-base-image-${DTS_VER}.cpio.gz > dts-base-image-${DTS_VER}.cpio.gz.sha256 @@ -110,12 +124,12 @@ jobs: - name: Update iPXE menu shell: bash run: | - ./meta-dts/scripts/generate-ipxe-menu.sh ${{steps.dts-ver.outputs.DTS_VER}} + ./meta-dts/scripts/generate-ipxe-menu.sh ${{ env.DTS_VER }} scp -i ~/.ssh/dts-ci-key dts.ipxe builder@10.1.40.2:boot/dts/ - name: Trigger signing shell: bash run: | - DTS_VER="${{steps.dts-ver.outputs.DTS_VER}}" + DTS_VER="${{ env.DTS_VER }}" git clone ssh://git@git.3mdeb.com:2222/3mdeb/dts-release-cicd-pipeline.git cd dts-release-cicd-pipeline echo ${DTS_VER} > LATEST_RELEASE diff --git a/.github/workflows/develop.yml b/.github/workflows/develop.yml index ab4b2aca..52ff0eae 100644 --- a/.github/workflows/develop.yml +++ b/.github/workflows/develop.yml @@ -65,12 +65,26 @@ jobs: id: dts-ver shell: bash run: | - DTS_VER=v`cat meta-dts/meta-dts-distro/conf/distro/dts-distro.conf | grep DISTRO_VERSION | tr -d "\" [A-Z]_="` - echo "DTS_VER=${DTS_VER}" >> $GITHUB_OUTPUT + # Extract tag version from GITHUB_REF + TAG=${GITHUB_REF#refs/tags/} + DTS_VER=$(echo "${TAG}" | sed -E 's/^v//') + echo "DTS_VER=${DTS_VER}" >> $GITHUB_ENV + - name: Validate DTS_VER + if: ${{ success() }} + shell: bash + run: | + # Retrieve DTS_VER from previous step + DTS_VER_EXPECTED="${{ env.DTS_VER }}" + DTS_VER_ACTUAL=$(cat meta-dts/meta-dts-distro/conf/distro/dts-distro.conf | grep DISTRO_VERSION | tr -d "\" [A-Z]_=") + + if [ "${DTS_VER_EXPECTED}" != "${DTS_VER_ACTUAL}" ]; then + echo "Tag (${DTS_VER_EXPECTED}) does not match version (${DTS_VER_ACTUAL}) in `meta-dts/meta-dts-distro/conf/distro/dts-distro.conf`" + exit 1 + fi - name: Deploy DTS on boot.dasharo.com shell: bash run: | - DTS_VER="${{steps.dts-ver.outputs.DTS_VER}}" + DTS_VER="${{ env.DTS_VER }}" ssh -i ~/.ssh/dts-ci-key builder@10.1.40.2 "mkdir -p boot/dts/${DTS_VER}" cd build/tmp/deploy/images/genericx86-64/ cp bzImage bzImage-${DTS_VER} @@ -86,7 +100,7 @@ jobs: - name: Deploy sha256 on boot.dasharo.com shell: bash run: | - DTS_VER="${{steps.dts-ver.outputs.DTS_VER}}" + DTS_VER="${{ env.DTS_VER }}" cd build/tmp/deploy/images/genericx86-64/ sha256sum bzImage-${DTS_VER} > bzImage-${DTS_VER}.sha256 sha256sum dts-base-image-${DTS_VER}.cpio.gz > dts-base-image-${DTS_VER}.cpio.gz.sha256 @@ -101,12 +115,12 @@ jobs: - name: Update iPXE menu shell: bash run: | - ./meta-dts/scripts/generate-ipxe-menu.sh ${{steps.dts-ver.outputs.DTS_VER}} + ./meta-dts/scripts/generate-ipxe-menu.sh DTS_VER="${{ env.DTS_VER }}" scp -i ~/.ssh/dts-ci-key dts-rc.ipxe builder@10.1.40.2:boot/dts/ - name: Trigger signing shell: bash run: | - DTS_VER="${{steps.dts-ver.outputs.DTS_VER}}" + DTS_VER="${{ env.DTS_VER }}" git clone ssh://git@git.3mdeb.com:2222/3mdeb/dts-release-cicd-pipeline.git cd dts-release-cicd-pipeline echo ${DTS_VER} > LATEST_RELEASE From 367b1465d8cab2b082be92244b9ec8ce1c25623c Mon Sep 17 00:00:00 2001 From: Daniil Klimuk Date: Wed, 3 Apr 2024 10:57:41 +0200 Subject: [PATCH 12/99] kas-uefi-sb: change meta-secure-core origin Repository jiazhang0/meta-secure-core is archived since 07.02.2023, change to active Wind-River/meta-secure-core. Signed-off-by: Daniil Klimuk --- kas-uefi-sb.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kas-uefi-sb.yml b/kas-uefi-sb.yml index d846539d..22a406b2 100644 --- a/kas-uefi-sb.yml +++ b/kas-uefi-sb.yml @@ -11,7 +11,7 @@ target: repos: meta-secure-core: - url: https://github.com/jiazhang0/meta-secure-core + url: https://github.com/Wind-River/meta-secure-core refspec: fa438247c3e61d7f746687d85ef3b0dd66dc6b3f layers: meta-efi-secure-boot: From d83d594dde28d2af673cf8edbc552e3cdb07133d Mon Sep 17 00:00:00 2001 From: Daniil Klimuk Date: Wed, 3 Apr 2024 11:10:28 +0200 Subject: [PATCH 13/99] distro: kernel: linux-yocto: remove efi-ext.scc from KERNEL_FEATURES efi-ext.scc is being added in meta-secure-core/meta-efi-secure-boot and sets, among other configurations, configuration CONFIG_EFI_VARS to m which conflicts with efivars.cfg that sets the config to y. Signed-off-by: Daniil Klimuk --- meta-dts-distro/recipes-kernel/kernel/linux-yocto_%.bbappend | 3 +++ 1 file changed, 3 insertions(+) diff --git a/meta-dts-distro/recipes-kernel/kernel/linux-yocto_%.bbappend b/meta-dts-distro/recipes-kernel/kernel/linux-yocto_%.bbappend index 0f1c3b39..f5c4fc77 100644 --- a/meta-dts-distro/recipes-kernel/kernel/linux-yocto_%.bbappend +++ b/meta-dts-distro/recipes-kernel/kernel/linux-yocto_%.bbappend @@ -19,3 +19,6 @@ SRC_URI:append = " \ file://ntfs-enable.cfg \ file://exfat-enable.cfg \ " + +KERNEL_FEATURES:remove:x86 = " ${@bb.utils.contains('DISTRO_FEATURES', 'efi-secure-boot', '${efi_secure_boot_sccs}', '', d)}" +KERNEL_FEATURES:remove:x86-64 = " ${@bb.utils.contains('DISTRO_FEATURES', 'efi-secure-boot', '${efi_secure_boot_sccs}', '', d)}" From dd76b019813209acb7a7476228fb859dd953e006 Mon Sep 17 00:00:00 2001 From: Tymoteusz Date: Thu, 4 Apr 2024 12:36:20 +0200 Subject: [PATCH 14/99] dts: dts-functions: make dts not use ICMP for network connection check A fix for Dasharo/dasharo-issues#752. The core of the problem revolved around the use of the ping command for network connectivity verification, which relied on ICMP packets. This approach posed limitations in environments where ICMP packets are blocked or filtered, leading to false negatives in connectivity checks. The implementation replaces ping with `wget --spider` that is used to check for `cloud.3mdeb.com` access without downloading content. By using wget, the script now supports environments where ICMP is not an option Signed-off-by: Tymoteusz Burak --- meta-dts-distro/recipes-dts/dts/dts/dts-functions.sh | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/meta-dts-distro/recipes-dts/dts/dts/dts-functions.sh b/meta-dts-distro/recipes-dts/dts/dts/dts-functions.sh index c053a77c..757c9ac8 100644 --- a/meta-dts-distro/recipes-dts/dts/dts/dts-functions.sh +++ b/meta-dts-distro/recipes-dts/dts/dts/dts-functions.sh @@ -137,7 +137,10 @@ check_network_connection() { echo 'Waiting for network connection ...' n="10" while : ; do - ping -c 3 cloud.3mdeb.com > /dev/null 2>&1 && break + if wget --spider cloud.3mdeb.com > /dev/null 2>&1; then + echo 'Network connection established.' + return 0 + fi n=$((n-1)) if [ "${n}" == "0" ]; then echo 'No network connection to 3mdeb cloud, please recheck Ethernet connection' @@ -145,7 +148,6 @@ check_network_connection() { fi sleep 1 done - return 0 } ## Supported boards configuration From edb950164fb9c77c0e62ce961fc45b26b028c6f9 Mon Sep 17 00:00:00 2001 From: Daniil Klimuk Date: Mon, 8 Apr 2024 11:41:39 +0200 Subject: [PATCH 15/99] distro: recipes-dts: move DTS scripts to another repo Move all DTS scripts to another repo and add as git package. Signed-off-by: Daniil Klimuk --- .../dts-scripts/dts-scripts_git.bb | 44 + .../recipes-dts/dts/dasharo-deploy.bb | 23 - .../dts/dasharo-deploy/dasharo-deploy | 907 ------------------ meta-dts-distro/recipes-dts/dts/dts.bb | 40 - .../recipes-dts/dts/dts/cloud_list | 58 -- meta-dts-distro/recipes-dts/dts/dts/dts | 227 ----- meta-dts-distro/recipes-dts/dts/dts/dts-boot | 14 - .../recipes-dts/dts/dts/dts-environment.sh | 91 -- .../recipes-dts/dts/dts/dts-profile.sh | 5 - .../recipes-dts/dts/dts/ec_transition | 130 --- .../packagegroups/packagegroup-dts.bb | 4 +- .../recipes-dts/reports/dasharo-hcl-report.bb | 30 - .../dasharo-hcl-report/dasharo-hcl-report | 370 ------- .../recipes-dts/reports/touchpad-info.bb | 23 - .../reports/touchpad-info/touchpad-info | 42 - 15 files changed, 45 insertions(+), 1963 deletions(-) create mode 100644 meta-dts-distro/recipes-dts/dts-scripts/dts-scripts_git.bb delete mode 100644 meta-dts-distro/recipes-dts/dts/dasharo-deploy.bb delete mode 100755 meta-dts-distro/recipes-dts/dts/dasharo-deploy/dasharo-deploy delete mode 100644 meta-dts-distro/recipes-dts/dts/dts.bb delete mode 100755 meta-dts-distro/recipes-dts/dts/dts/cloud_list delete mode 100644 meta-dts-distro/recipes-dts/dts/dts/dts delete mode 100644 meta-dts-distro/recipes-dts/dts/dts/dts-boot delete mode 100644 meta-dts-distro/recipes-dts/dts/dts/dts-environment.sh delete mode 100644 meta-dts-distro/recipes-dts/dts/dts/dts-profile.sh delete mode 100644 meta-dts-distro/recipes-dts/dts/dts/ec_transition delete mode 100644 meta-dts-distro/recipes-dts/reports/dasharo-hcl-report.bb delete mode 100755 meta-dts-distro/recipes-dts/reports/dasharo-hcl-report/dasharo-hcl-report delete mode 100644 meta-dts-distro/recipes-dts/reports/touchpad-info.bb delete mode 100644 meta-dts-distro/recipes-dts/reports/touchpad-info/touchpad-info diff --git a/meta-dts-distro/recipes-dts/dts-scripts/dts-scripts_git.bb b/meta-dts-distro/recipes-dts/dts-scripts/dts-scripts_git.bb new file mode 100644 index 00000000..eef78397 --- /dev/null +++ b/meta-dts-distro/recipes-dts/dts-scripts/dts-scripts_git.bb @@ -0,0 +1,44 @@ +SUMMARY = "Dasharo Tools Suite scripts." +SECTION = "tools" +HOMEPAGE = "https://github.com/Dasharo/dts-v2" + +LICENSE = "MIT" +LIC_FILES_CHKSUM = "file://LICENSE;md5=575ab8837c52eafc7b9eb8b244072bc7" + +SRCREV = "13dad8ea6901cf921de0dd45d464bea3535892e0" +SRC_URI = "git://github.com/Dasharo/dts-v2;protocol=https;branch=main" + +PV = "0.1+git${SRCPV}" + +S = "${WORKDIR}/git" + +RDEPENDS:${PN} = " \ + packagegroup-coreboot-utils \ + flashrom \ + iasl \ + tar \ + i2c-tools \ + i2c-tools-misc \ + bash \ + dmidecode \ + acpi-call-dkms \ + iotools \ +" + +do_install () { + install -d ${D}/${sbindir} + install -m 0755 ${S}/scripts/dts ${D}/${sbindir} + install -m 0755 ${S}/scripts/dts-boot ${D}/${sbindir} + install -m 0755 ${S}/scripts/ec_transition ${D}/${sbindir} + install -m 0755 ${S}/scripts/cloud_list ${D}/${sbindir} + install -m 0755 ${S}/scripts/dasharo-deploy ${D}/${sbindir} + install -m 0755 ${S}/reports/dasharo-hcl-report ${D}/${sbindir} + install -m 0755 ${S}/reports/touchpad-info ${D}/${sbindir} + install -m 0664 ${S}/include/dts-environment.sh ${D}/${sbindir} + install -m 0664 ${S}/include/dts-functions.sh ${D}/${sbindir} + + # install profile dropin so the DTS_ENV and DTS_FUNCS variables are set when + # loged via SSH + install -d ${D}${sysconfdir}/profile.d/ + install -m 0755 ${S}/scripts/dts-profile.sh ${D}${sysconfdir}/profile.d/ +} diff --git a/meta-dts-distro/recipes-dts/dts/dasharo-deploy.bb b/meta-dts-distro/recipes-dts/dts/dasharo-deploy.bb deleted file mode 100644 index 45591719..00000000 --- a/meta-dts-distro/recipes-dts/dts/dasharo-deploy.bb +++ /dev/null @@ -1,23 +0,0 @@ -DESCRIPTION = "Dasharo Deploy Tools" -SECTION = "tools" -HOMEPAGE = "https://docs.dasharo.com" - -LICENSE = "MIT" - -LIC_FILES_CHKSUM = "file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420" - -SRC_URI = " \ - file://dasharo-deploy \ -" - -S = "${WORKDIR}" - -RDEPENDS:${PN} = " \ - bash \ - packagegroup-coreboot-utils \ -" - -do_install () { - install -d ${D}/${sbindir} - install -m 0755 ${S}/dasharo-deploy ${D}/${sbindir} -} diff --git a/meta-dts-distro/recipes-dts/dts/dasharo-deploy/dasharo-deploy b/meta-dts-distro/recipes-dts/dts/dasharo-deploy/dasharo-deploy deleted file mode 100755 index 03aac319..00000000 --- a/meta-dts-distro/recipes-dts/dts/dasharo-deploy/dasharo-deploy +++ /dev/null @@ -1,907 +0,0 @@ -#!/usr/bin/env bash - -source $DTS_ENV -source $DTS_FUNCS - -[ -z "$BOARD_VENDOR" ] && error_exit "BOARD_VENDOR not given" -[ -z "$SYSTEM_MODEL" ] && error_exit "SYSTEM_MODEL not given" - -CMD="$1" -FUM="$2" - -ask_for_version() { - while : ; do - echo - echo "Please, select Dasharo firmware version to install" - - # -v: True if the shell variable varname is set (has been assigned a value). - if [ -v BIOS_HASH_LINK_COMM ]; then - echo " c) Community version" - fi - if [ -v BIOS_HASH_LINK_DES ]; then - if [ -v DES_IS_LOGGED ]; then - echo " d) DES version (coreboot + UEFI)" - else - echo " DES version (coreboot + UEFI) available, if you are interested, please visit https://shop.3mdeb.com/product-category/dasharo-entry-subscription/" - fi - fi - if [ -v BIOS_HASH_LINK_DES_SEABIOS ]; then - if [ -v DES_IS_LOGGED ]; then - echo " s) DES version (coreboot + SeaBIOS)" - else - echo " DES version (coreboot + SeaBIOS) available, if you are interested, please visit https://shop.3mdeb.com/product-category/dasharo-entry-subscription/" - fi - fi - echo " b) Back to main menu" - echo - read -r -p "Enter an option: " OPTION - echo - - case ${OPTION} in - c|C|comm|community|COMMUNITY|COMM|Community) - if [ -v BIOS_HASH_LINK_COMM ]; then - BIOS_LINK=$BIOS_LINK_COMM - BIOS_HASH_LINK=$BIOS_HASH_LINK_COMM - BIOS_SIGN_LINK=$BIOS_SIGN_LINK_COMM - if [ -v EC_HASH_LINK_COMM ]; then - EC_LINK=$EC_LINK_COMM - EC_HASH_LINK=$EC_HASH_LINK_COMM - EC_SIGN_LINK=$EC_SIGN_LINK_COMM - fi - echo "Community version selected" - break - else - error_exit "Bad option or resignation. Returning to main menu..." - fi - ;; - d|D|des|DES|Des) - if [ -v BIOS_HASH_LINK_DES ]; then - BIOS_LINK=$BIOS_LINK_DES - BIOS_HASH_LINK=$BIOS_HASH_LINK_DES - BIOS_SIGN_LINK=$BIOS_SIGN_LINK_DES - if [ -v EC_HASH_LINK_DES ]; then - EC_LINK=$EC_LINK_DES - EC_HASH_LINK=$EC_HASH_LINK_DES - EC_SIGN_LINK=$EC_SIGN_LINK_DES - fi - echo "Dasharo Entry Subscription (coreboot + edk2) version selected" - break - else - error_exit "Bad option. Returning to main menu..." - fi - ;; - s|S|sea|seabios|SeaBIOS) - if [ -v BIOS_HASH_LINK_DES_SEABIOS ]; then - BIOS_LINK=$BIOS_LINK_DES_SEABIOS - BIOS_HASH_LINK=$BIOS_HASH_LINK_DES_SEABIOS - BIOS_SIGN_LINK=$BIOS_SIGN_LINK_DES_SEABIOS - echo "Dasharo Entry Subscription (coreboot + SeaBIOS) version selected" - break - else - error_exit "Bad option. Returning to main menu..." - fi - ;; - b|B) - echo "Returning to main menu..." - exit 0 - ;; - *) - ;; - esac - done -} - -display_flashing_warning() { - while : ; do - echo - print_warning "Please verify detected hardware!" - echo - - if [ -v BOARD_VENDOR ]; then - echo "Board vendor: $BOARD_VENDOR" - fi - if [ -v SYSTEM_MODEL ]; then - echo "System model: $SYSTEM_MODEL" - fi - if [ -v BOARD_MODEL ]; then - echo "Board model: $BOARD_MODEL" - fi - echo - read -r -p "Does it match your actual specification? (Y|n) " OPTION - echo - - case ${OPTION} in - yes|y|Y|Yes|YES) - break - ;; - n|N) - echo "Returning to main menu..." - exit 0 - ;; - *) - ;; - esac - done - - while : ; do - echo "Following firmware will be used to install Dasharo" - if [ -v BIOS_HASH_LINK ]; then - local _bios_hash="$(cat $BIOS_HASH_FILE | cut -d ' ' -f 1)" - echo "Dasharo BIOS firmware:" - echo " - link: $BIOS_LINK" - echo " - hash: $_bios_hash" - fi - if [ -v EC_HASH_LINK ]; then - local _ec_hash="$(cat $EC_HASH_FILE | cut -d ' ' -f 1)" - echo "Dasharo EC firmware:" - echo " - link: $EC_LINK" - echo " - hash: $_ec_hash" - fi - echo - echo "You can learn more about this release on: https://docs.dasharo.com/" - - if check_if_dasharo; then - echo - read -r -p "Do you want to update Dasharo firmware on your hardware? (Y|n) " OPTION - echo - else - echo - read -r -p "Do you want to install Dasharo firmware on your hardware? (Y|n) " OPTION - echo - fi - - case ${OPTION} in - yes|y|Y|Yes|YES) - break - ;; - n|N) - echo "Returning to main menu..." - exit 0 - ;; - *) - ;; - esac - done -} - -backup() { - rm -rf "$FW_BACKUP_DIR" - mkdir -p "$FW_BACKUP_DIR" - - echo "Backing up BIOS firmware and store it locally..." - echo "Remember that firmware is also backed up in HCL report." - check_intel_regions - if [ $BOARD_HAS_FD_REGION -ne 0 ]; then - # Use safe defaults. Descriptor may contain additional regions not detected - # by flashrom and will return failure when attempted to be read. BIOS and - # Flash descriptor regions should always be readable. If not, then we have - # some ugly case, hard to deal with. - FLASHROM_ADD_OPT_READ="--ifd -i fd -i bios" - if [ $BOARD_HAS_ME_REGION -ne 0 ] && [ $BOARD_ME_REGION_LOCKED -eq 0 ]; then - # ME region is not locked, read it as well - FLASHROM_ADD_OPT_READ+=" -i me" - fi - if [ $BOARD_HAS_GBE_REGION -ne 0 ] && [ $BOARD_GBE_REGION_LOCKED -eq 0 ]; then - # GBE region is present and not locked, read it as well - FLASHROM_ADD_OPT_READ+=" -i gbe" - fi - else - # No descriptor, probably safe to read everything - FLASHROM_ADD_OPT_READ="" - fi - $FLASHROM -p "$PROGRAMMER_BIOS" ${FLASH_CHIP_SELECT} -r "${FW_BACKUP_DIR}"/rom.bin ${FLASHROM_ADD_OPT_READ} >> $FLASHROM_LOG_FILE 2>> $ERR_LOG_FILE - error_check "Failed to read BIOS firmware backup" - - if [ "$HAVE_EC" == "true" ]; then - echo "Checking for Open Source Embedded Controller firmware" - $DASHARO_ECTOOL info >> $ERR_LOG_FILE 2>&1 - if [ $? -eq 0 ]; then - echo "Device has already Open Source Embedded Controller firmware, do not backup EC..." - else - echo "Backing up EC firmware..." - $FLASHROM -p "$PROGRAMMER_EC" ${FLASH_CHIP_SELECT} -r "${FW_BACKUP_DIR}"/ec.bin >> $FLASHROM_LOG_FILE 2>> $ERR_LOG_FILE - error_check "Failed to read EC firmware backup" - fi - fi - - echo "Saving backup to: $FW_BACKUP_TAR" - tar --gzip -cf "$FW_BACKUP_TAR" "$FW_BACKUP_DIR" - error_check "Failed to create firmware backup archive" - rm -rf "${FW_BACKUP_DIR}" - - echo "Successfully backed up firmware locally at: $FW_BACKUP_TAR" -} - -romhole_migration() { - cbfstool $BIOS_UPDATE_FILE layout -w | grep -q "ROMHOLE" || return - - $FLASHROM -p "$PROGRAMMER_BIOS" ${FLASH_CHIP_SELECT} -r /tmp/rom.bin --ifd -i bios >> $FLASHROM_LOG_FILE 2>> $ERR_LOG_FILE - error_check "Failed to read current firmware to migrate MSI ROMHOLE" - if check_if_dasharo; then - cbfstool /tmp/rom.bin layout -w | grep -q "ROMHOLE" || return - # This one is rather unlikely to fail, but just in case print a warning - cbfstool /tmp/rom.bin read -r ROMHOLE -f /tmp/romhole.bin 2> /dev/null - if [ $? -ne 0 ]; then - print_warning "Failed to migrate MSI ROMHOLE, your platform's unique SMBIOS/DMI data may be lost" - return - fi - else - dd if=/tmp/rom.bin of=/tmp/romhole.bin skip=$((0x17C0000)) bs=128K count=1 iflag=skip_bytes > /dev/null 2>&1 - fi - - cbfstool "$BIOS_UPDATE_FILE" write -r ROMHOLE -f /tmp/romhole.bin -u 2> /dev/null -} - -smbios_migration() { - echo -n "$(dmidecode -s system-uuid)" > $SYSTEM_UUID_FILE - echo -n "$(dmidecode -s baseboard-serial-number)" > $SERIAL_NUMBER_FILE - - COREBOOT_SEC=$(cbfstool $BIOS_UPDATE_FILE layout -w | grep "COREBOOT") - FW_MAIN_A_SEC=$(cbfstool $BIOS_UPDATE_FILE layout -w | grep "FW_MAIN_A") - FW_MAIN_B_SEC=$(cbfstool $BIOS_UPDATE_FILE layout -w | grep "FW_MAIN_B") - - if [ -n "$COREBOOT_SEC" ]; then - # if the migration can be done there for sure will be COREBOOT section - echo "Beginning SMBIOS migration process..." - echo "Migrate to COREBOOT section." - cbfstool $BIOS_UPDATE_FILE add -f $SERIAL_NUMBER_FILE -n serial_number -t raw -r COREBOOT - cbfstool $BIOS_UPDATE_FILE add -f $SYSTEM_UUID_FILE -n system_uuid -t raw -r COREBOOT - fi - - if [ -n "$FW_MAIN_A_SEC" ]; then - echo "Migrate to FW_MAIN_A section." - cbfstool $BIOS_UPDATE_FILE expand -r FW_MAIN_A - cbfstool $BIOS_UPDATE_FILE add -f $SERIAL_NUMBER_FILE -n serial_number -t raw -r FW_MAIN_A - cbfstool $BIOS_UPDATE_FILE add -f $SYSTEM_UUID_FILE -n system_uuid -t raw -r FW_MAIN_A - cbfstool $BIOS_UPDATE_FILE truncate -r FW_MAIN_A - fi - - if [ -n "$FW_MAIN_B_SEC" ]; then - echo "Migrate to FW_MAIN_B section." - cbfstool $BIOS_UPDATE_FILE expand -r FW_MAIN_B - cbfstool $BIOS_UPDATE_FILE add -f $SERIAL_NUMBER_FILE -n serial_number -t raw -r FW_MAIN_B - cbfstool $BIOS_UPDATE_FILE add -f $SYSTEM_UUID_FILE -n system_uuid -t raw -r FW_MAIN_B - cbfstool $BIOS_UPDATE_FILE truncate -r FW_MAIN_B - fi -} - -smmstore_migration() { - echo -n "Backing up firmware configuration... " - $FLASHROM -p "$PROGRAMMER_BIOS" ${FLASH_CHIP_SELECT} -r /tmp/dasharo_dump.rom ${FLASHROM_ADD_OPT_READ} --fmap -i FMAP -i SMMSTORE >> $FLASHROM_LOG_FILE 2>> $ERR_LOG_FILE - cbfstool /tmp/dasharo_dump.rom read -r SMMSTORE -f /tmp/smmstore.bin >> $ERR_LOG_FILE 2>&1 || \ - print_warning "Failed! Default settings will be used." - cbfstool "$BIOS_UPDATE_FILE" write -r SMMSTORE -f /tmp/smmstore.bin -u >> $ERR_LOG_FILE 2>&1 || \ - print_warning "Failed! Default settings will be used." - print_green Done. -} - -bootsplash_migration() { - $FLASHROM -p "$PROGRAMMER_BIOS" ${FLASH_CHIP_SELECT} -r /tmp/dasharo_dump.rom ${FLASHROM_ADD_OPT_READ} --fmap -i FMAP -i BOOTSPLASH >> $FLASHROM_LOG_FILE 2>> $ERR_LOG_FILE - # If no custom logo, return from bootsplash_migration early and don't show - # unnecessary messages - cbfstool /tmp/dasharo_dump.rom extract -r BOOTSPLASH -n logo.bmp -f /tmp/logo.bmp >> $ERR_LOG_FILE 2>&1 || return 1 - echo -n "Backing up custom boot logo... " - dcu logo $BIOS_UPDATE_FILE -l /tmp/logo.bmp >> $ERR_LOG_FILE 2>&1 || \ - print_warning "Failed! Default boot splash will be used." || return 1 - print_green Done. -} - -resign_binary() { - if [ "$HAVE_VBOOT" -eq 0 ]; then - download_keys - sign_firmware.sh $BIOS_UPDATE_FILE $KEYS_DIR $RESIGNED_BIOS_UPDATE_FILE - error_check "Cannot resign binary file. Please, make sure if you have proper keys. Aborting..." - BIOS_UPDATE_FILE="$RESIGNED_BIOS_UPDATE_FILE" - fi -} - -check_vboot_keys() { - if [ "$HAVE_VBOOT" -eq 0 ]; then - # If we flash whole BIOS region, no need to check if keys match - grep -q "\--ifd" <<< "$FLASHROM_ADD_OPT_UPDATE" && grep -q "\-i bios" <<< "$FLASHROM_ADD_OPT_UPDATE" && return - # No FMAP flashing? Also skip - grep -q "\--fmap" <<< "$FLASHROM_ADD_OPT_UPDATE" || return - - BINARY_KEYS=$(CBFSTOOL=$(which cbfstool) futility show $BIOS_UPDATE_FILE| grep -i 'key sha1sum') - - if [ $BOARD_HAS_FD_REGION -eq 0 ]; then - FLASHROM_ADD_OPT_READ="" - else - FLASHROM_ADD_OPT_READ="--ifd -i bios" - fi - echo "Checking vboot keys." - $FLASHROM -p "$PROGRAMMER_BIOS" ${FLASH_CHIP_SELECT} ${FLASHROM_ADD_OPT_READ} -r /tmp/bios.bin > /dev/null 2>/dev/null - if [ $? -eq 0 ] && [ -f "/tmp/bios.bin" ]; then - FLASH_KEYS=$(CBFSTOOL=$(which cbfstool) futility show /tmp/bios.bin | grep -i 'key sha1sum') - diff <(echo "$BINARY_KEYS") <(echo "$FLASH_KEYS") > /dev/null 2>&1 - # If keys are different we must additionally flash at least GBB region as well - if [ $? -ne 0 ]; then - FLASHROM_ADD_OPT_UPDATE+=" -i GBB" - fi - fi - fi -} - -blob_transmission() { - echo "Extracting the UEFI image from BIOS update" - wget -O "$DBT_BIOS_UPDATE_FILENAME" --user-agent='Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1)' "$DBT_BIOS_UPDATE_URL" >> $ERR_LOG_FILE 2>&1 - error_file_check "$DBT_BIOS_UPDATE_FILENAME" "Failed to download BIOS for $SYSTEM_MODEL. Please make sure Ethernet cable is connected and try again." - - sha256sum --check <(echo "$DBT_BIOS_UPDATE_HASH") - error_check "Failed SHA-256 sum check on the downloaded BIOS for $SYSTEM_MODEL" - - binwalk --run-as=root -e "$DBT_BIOS_UPDATE_FILENAME" -C /tmp >> $ERR_LOG_FILE 2>&1 - error_file_check "$DBT_UEFI_IMAGE" "Failed to extract UEFI image from BIOS update" - - uefi-firmware-parser -e "$DBT_UEFI_IMAGE" -O >> $ERR_LOG_FILE 2>&1 - - if [ -n "$SINIT_ACM_FILENAME" ] && [ -n "$SINIT_ACM_URL" ]; then - echo "Downloading the Intel SINIT ACM" - wget -O "$SINIT_ACM_FILENAME" "$SINIT_ACM_URL" >> $ERR_LOG_FILE 2>&1 - error_file_check "$SINIT_ACM_FILENAME" "Failed to download Intel SINIT ACM. Please make sure Ethernet cable is connected and try again." - - # Intel does not provide hash of the package, use SHA256 we know is good - sha256sum --check <(echo "$SINIT_ACM_HASH") - error_check "Failed SHA-256 sum check on the downloaded Intel SINIT ACM." - - unzip -o "$SINIT_ACM_FILENAME" -d /tmp >> $ERR_LOG_FILE 2>&1 - error_check "Failed to decompress Intel SINIT ACM package." - fi - - echo "Beginning Dasharo Blobs Transmission process..." - - if [ -n "$SCH5545_FW" ]; then - error_file_check "$SCH5545_FW" "Failed to find SCH5545 EC firmware binary." - echo -n "Adding SCH5545 EC firmware..." - cbfstool "$BIOS_UPDATE_FILE" add -f "$SCH5545_FW" -n sch5545_ecfw.bin -t raw - print_green "Done" - fi - - if [ -n "$ACM_BIN" ]; then - error_file_check "$ACM_BIN" "Failed to find BIOS ACM binary." - echo -n "Adding BIOS ACM..." - cbfstool "$BIOS_UPDATE_FILE" add -f "$ACM_BIN" -n txt_bios_acm.bin -t raw - print_green "Done" - fi - - if [ -n "$SINIT_ACM" ]; then - error_file_check "$SINIT_ACM" "Failed to find Intel SINIT ACM binary." - echo -n "Adding SINIT ACM..." - cbfstool "$BIOS_UPDATE_FILE" add -f "$SINIT_ACM" -n txt_sinit_acm.bin -t raw - print_green "Done" - fi -} - -install_ec() { - verify_artifacts ec - echo "Installing EC..." - $FLASHROM -p "$PROGRAMMER_EC" ${FLASH_CHIP_SELECT} -w "$EC_UPDATE_FILE" >> $FLASHROM_LOG_FILE 2>> $ERR_LOG_FILE - error_check "Failed to install Dasharo EC firmware" - echo "Successfully installed Dasharo EC firmware" -} - -install() { - ask_for_version - download_artifacts - display_flashing_warning - check_flash_lock - verify_artifacts bios - - check_intel_regions - check_blobs_in_binary $BIOS_UPDATE_FILE - check_if_me_disabled - set_intel_regions_update_params "-N --ifd -i bios" - - if [ "$HAVE_EC" == "true" ]; then - echo "Checking for Open Source Embedded Controller firmware" - $DASHARO_ECTOOL info >> $ERR_LOG_FILE 2>&1 - if [ $? -eq 0 ]; then - echo "Device has already Open Source Embedded Controller firmware, do not flash EC..." - else - _ec_fw_version=$($FLASHROM -p "$PROGRAMMER_EC" ${FLASH_CHIP_SELECT} | grep "Mainboard EC Version" | tr -d ' ' | cut -d ':' -f 2) - if [ "$_ec_fw_version" != "$COMPATIBLE_EC_FW_VERSION" ]; then - print_warning "EC version: $_ec_fw_version is not supported, update required" - install_ec - fi - fi - fi - - cbfstool "$BIOS_UPDATE_FILE" extract -r COREBOOT -n config -f "$BIOS_UPDATE_CONFIG_FILE" - grep "CONFIG_VBOOT=y" "$BIOS_UPDATE_CONFIG_FILE" - HAVE_VBOOT="$?" - - if [ "$NEED_ROMHOLE_MIGRATION" = "true" ]; then - romhole_migration - fi - - if [ "$NEED_BOOTSPLASH_MIGRATION" = "true" ]; then - bootsplash_migration - fi - - if [ "$NEED_SMBIOS_MIGRATION" = "true" ]; then - smbios_migration - resign_binary - fi - - if [ "$NEED_BLOB_TRANSMISSION" = "true" ]; then - blob_transmission - fi - - echo "Installing Dasharo firmware..." - # FIXME: It seems we do not have an easy way to add some flasrhom extra args - # globally for specific platform and variant - local _flashrom_extra_args="" - if [ "${BIOS_LINK}" = "${BIOS_LINK_DES_SEABIOS}" ]; then - _flashrom_extra_args="--fmap -i COREBOOT" - fi - $FLASHROM -p "$PROGRAMMER_BIOS" ${FLASH_CHIP_SELECT} ${FLASHROM_ADD_OPT_REGIONS} -w "$BIOS_UPDATE_FILE" ${_flashrom_extra_args} >> $FLASHROM_LOG_FILE 2>> $ERR_LOG_FILE - error_check "Failed to install Dasharo firmware" - - print_green "Successfully installed Dasharo firmware" - - echo -n "Syncing disks... " - sync - echo "Done." - if [ "$NEED_EC_RESET" = "true" ]; then - echo "The computer will shut down automatically in 5 seconds" - else - echo "The computer will reboot automatically in 5 seconds" - fi - sleep 0.5 - echo "Rebooting in 5s:" - echo "5..." - sleep 1 - echo "4..." - sleep 1 - echo "3..." - sleep 1 - echo "2..." - sleep 1 - echo "1..." - sleep 0.5 - echo "Rebooting" - sleep 1 - if [ "$NEED_EC_RESET" = "true" ]; then - it5570_shutdown - else - ${CMD_REBOOT} - fi -} - -update_ec() { - verify_artifacts ec - echo "Updating EC..." - $DASHARO_ECTOOL flash "$EC_UPDATE_FILE" &>> $ERR_LOG_FILE - error_check "Failed to update EC firmware" -} - -update() { - local _can_switch_to_heads="false" - - check_if_ac - error_check "Firmware update process interrupted on user request." - - echo "Checking for the latest Dasharo update available..." - echo "Current Dasharo version: $DASHARO_VERSION" - if [ -v DES_IS_LOGGED ]; then - if [ -v DASHARO_REL_VER_DES ]; then - if [ "$DASHARO_FLAVOR" != "Dasharo (coreboot+heads)" ]; then - echo "Latest available Dasharo version: $DASHARO_REL_VER_DES" - fi - curl -sfI -u "$USER_DETAILS" -H "$CLOUD_REQUEST" "$BIOS_LINK_DES" -o /dev/null - if [ $? -ne 0 ]; then - echo "Current DES credentials do not match the current platform/firmware flavor." - echo "Latest possible and available update is $DASHARO_REL_VER" - BIOS_HASH_LINK=$BIOS_HASH_LINK_COMM - BIOS_SIGN_LINK=$BIOS_SIGN_LINK_COMM - BIOS_LINK=$BIOS_LINK_COMM - if [ "$HAVE_EC" == "true" ]; then - EC_HASH_LINK=$EC_HASH_LINK_COMM - EC_SIGN_LINK=$EC_SIGN_LINK_COMM - EC_LINK=$EC_LINK_COMM - fi - UPDATE_VERSION=$DASHARO_REL_VER - else - BIOS_HASH_LINK=$BIOS_HASH_LINK_DES - BIOS_SIGN_LINK=$BIOS_SIGN_LINK_DES - BIOS_LINK=$BIOS_LINK_DES - if [ "$HAVE_EC" == "true" ]; then - EC_HASH_LINK=$EC_HASH_LINK_DES - EC_SIGN_LINK=$EC_SIGN_LINK_DES - EC_LINK=$EC_LINK_DES - fi - UPDATE_VERSION=$DASHARO_REL_VER_DES - fi - else - if [ "$DASHARO_FLAVOR" != "Dasharo (coreboot+heads)" ]; then - echo "Latest available Dasharo version: $DASHARO_REL_VER" - fi - BIOS_HASH_LINK=$BIOS_HASH_LINK_COMM - BIOS_SIGN_LINK=$BIOS_SIGN_LINK_COMM - BIOS_LINK=$BIOS_LINK_COMM - if [ "$HAVE_EC" == "true" ]; then - EC_HASH_LINK=$EC_HASH_LINK_COMM - EC_SIGN_LINK=$EC_SIGN_LINK_COMM - EC_LINK=$EC_LINK_COMM - fi - UPDATE_VERSION=$DASHARO_REL_VER - fi - if [ -v HAVE_HEADS_FW ] && [ "$DASHARO_FLAVOR" != "Dasharo (coreboot+heads)" ]; then - # Check if given SE credentials give access to heads, if not, - # then it means DES is for regualar releases - curl -sfI -u "$USER_DETAILS" -H "$CLOUD_REQUEST" "$HEADS_LINK_DES" -o /dev/null - if [ $? -ne 0 ]; then - print_warning "Dasharo Heads firmware version is available, but your" - print_warning "subscription does not give you the access to this firmware." - print_warning "If you are interested, please visit https://shop.3mdeb.com/product-category/dasharo-entry-subscription/" - else - # Access to the heads FW is possible, allow to switch to heads - _can_switch_to_heads="true" - print_green "Dasharo Heads firmware version is available and your subscription" - print_green "gives you access to this firmware." - fi - elif [ -v HAVE_HEADS_FW ] && [ "$DASHARO_FLAVOR" == "Dasharo (coreboot+heads)" ]; then - # Set the switch flag to offer switch back - echo "Latest available Dasharo version: $HEADS_REL_VER_DES" - _can_switch_to_heads="true" - fi - else - if [ -v DASHARO_REL_VER_DES ]; then - print_green "DES version (coreboot + UEFI) available, if you are interested" - print_green "please visit https://shop.3mdeb.com/product-category/dasharo-entry-subscription/" - fi - if [ "$DASHARO_FLAVOR" != "Dasharo (coreboot+heads)" ]; then - echo "Latest available Dasharo version: $DASHARO_REL_VER" - fi - BIOS_HASH_LINK=$BIOS_HASH_LINK_COMM - BIOS_SIGN_LINK=$BIOS_SIGN_LINK_COMM - BIOS_LINK=$BIOS_LINK_COMM - if [ "$HAVE_EC" == "true" ]; then - EC_HASH_LINK=$EC_HASH_LINK_COMM - EC_SIGN_LINK=$EC_SIGN_LINK_COMM - EC_LINK=$EC_LINK_COMM - fi - UPDATE_VERSION=$DASHARO_REL_VER - if [ -v HAVE_HEADS_FW ] && [ "$DASHARO_FLAVOR" != "Dasharo (coreboot+heads)" ]; then - print_green "Dasharo heads firmware version is available. If you are interested," - print_green "please provide your subscription credentials in the main DTS menu" - print_green "and select 'Update Dasharo firmware' again to check if you are eligible." - elif [ -v HAVE_HEADS_FW ] && [ "$DASHARO_FLAVOR" == "Dasharo (coreboot+heads)" ]; then - # Set the switch flag to offer switch back - _can_switch_to_heads="true" - fi - fi - - handle_fw_switching $_can_switch_to_heads - - if [[ "$UPDATE_VERSION" == "1.1.1" && \ - ( "$BOARD_MODEL" == "PRO Z690-A WIFI DDR4(MS-7D25)" || \ - "$BOARD_MODEL" == "PRO Z690-A DDR4(MS-7D25)" || \ - "$BOARD_MODEL" == "PRO Z690-A (MS-7D25)" || \ - "$BOARD_MODEL" == "PRO Z690-A WIFI (MS-7D25)" ) ]]; then - - cpu_gen_check=$(lscpu | grep -F "Model name" | grep -E "\-(13|14)[0-9]{3}" | wc -l) - - if [ $cpu_gen_check -ne 0 ]; then - echo "You have a 13th gen or above CPU and are trying to flash Dasharo v1.1.1 on a MSI PRO Z690-A DDR4 or DDR5 board" - echo "That version does not support gen 13 and above CPU. Therefore we cannot continue with flashing." - error_exit "Aborting update process..." - fi - - fi - - while : ; do - echo - read -r -p "Are you sure you want to proceed with update? (Y|n) " OPTION - echo - - case ${OPTION} in - yes|y|Y|Yes|YES) - break - ;; - n|N) - error_exit "Aborting update process..." - ;; - *) - ;; - esac - done - - download_artifacts - if [ ! "$FUM" == "fum" ]; then - display_flashing_warning - fi - check_flash_lock - - verify_artifacts bios - - if [ "$HAVE_EC" == "true" ]; then - $DASHARO_ECTOOL info >> $ERR_LOG_FILE 2>&1 - error_check "Device does not have Dasharo EC firmware - cannot continue update!" - fi - - if [ "$NEED_SMMSTORE_MIGRATION" = "true" ]; then - smmstore_migration - fi - - if [ "$NEED_BOOTSPLASH_MIGRATION" = "true" ]; then - bootsplash_migration - fi - - cbfstool "$BIOS_UPDATE_FILE" extract -r COREBOOT -n config -f "$BIOS_UPDATE_CONFIG_FILE" - grep -q "CONFIG_VBOOT=y" "$BIOS_UPDATE_CONFIG_FILE" - HAVE_VBOOT="$?" - - check_intel_regions - check_blobs_in_binary $BIOS_UPDATE_FILE - check_if_me_disabled - set_flashrom_update_params $BIOS_UPDATE_FILE - set_intel_regions_update_params "-N --ifd" - check_vboot_keys - - echo "Updating Dasharo firmware..." - print_warning "This may take several minutes. Please be patient and do not power off your computer or touch the keyboard!" - - # FLASHROM_ADD_OPT_UPDATE_OVERRIDE takes priority over auto-detected update params. - # It set only by platform-specific and firmware version-specific conditions - if [ -v FLASHROM_ADD_OPT_UPDATE_OVERRIDE ]; then - # To standardize the operation of the FLASHROM_ADD_OPT_UPDATE_OVERRIDE flag, - # by default it contains only the bios section, below we verify the - # downloaded binary and add more sections when they were detected after - # using the `check_blobs_in_binary` function. - set_intel_regions_update_params "$FLASHROM_ADD_OPT_UPDATE_OVERRIDE" - FLASHROM_ADD_OPT_UPDATE_OVERRIDE="$FLASHROM_ADD_OPT_REGIONS" - $FLASHROM -p "$PROGRAMMER_BIOS" ${FLASH_CHIP_SELECT} ${FLASHROM_ADD_OPT_UPDATE_OVERRIDE} -w "$BIOS_UPDATE_FILE" >> $FLASHROM_LOG_FILE 2>> $ERR_LOG_FILE - error_check "Failed to update Dasharo firmware" - else - $FLASHROM -p "$PROGRAMMER_BIOS" ${FLASH_CHIP_SELECT} ${FLASHROM_ADD_OPT_UPDATE} -w "$BIOS_UPDATE_FILE" >> $FLASHROM_LOG_FILE 2>> $ERR_LOG_FILE - error_check "Failed to update Dasharo firmware" - - if [ $BINARY_HAS_RW_B -eq 0 ]; then - echo "Updating second firmware partition..." - $FLASHROM -p "$PROGRAMMER_BIOS" ${FLASH_CHIP_SELECT} --fmap -N -i RW_SECTION_B -w "$BIOS_UPDATE_FILE" >> $FLASHROM_LOG_FILE 2>> $ERR_LOG_FILE - error_check "Failed to update second firmware partition" - fi - fi - - # We use FLASHROM_ADD_OPT_REGIONS for updating ME and IFD. - # If FLASHROM_ADD_OPT_REGIONS remains the same after - # set_intel_regions_update_params or is cleared, it means - # we either cannot update any region, or were not allowed to, - # or platform has no descriptor. - if [ "$FLASHROM_ADD_OPT_REGIONS" != "-N --ifd" ] && [ "$FLASHROM_ADD_OPT_REGIONS" != "" ]; then - UPDATE_STRING="" - grep -q "\-i fd" <<< "$FLASHROM_ADD_OPT_REGIONS" - UPDATE_IFD=$? - grep -q "\-i me" <<< "$FLASHROM_ADD_OPT_REGIONS" - UPDATE_ME=$? - if [ $UPDATE_IFD -eq 0 ]; then - UPDATE_STRING+="Flash Descriptor" - if [ $UPDATE_ME -eq 0 ]; then - UPDATE_STRING+=" and " - fi - fi - if [ $UPDATE_ME -eq 0 ]; then - UPDATE_STRING+="Managment Engine" - fi - echo "Updating $UPDATE_STRING" - $FLASHROM -p "$PROGRAMMER_BIOS" ${FLASH_CHIP_SELECT} ${FLASHROM_ADD_OPT_REGIONS} -w "$BIOS_UPDATE_FILE" >> $FLASHROM_LOG_FILE 2>> $ERR_LOG_FILE - error_check "Failed to update $UPDATE_STRING" - fi - - if [ ! -z "$SWITCHING_TO" ]; then - # Any post-branch-switch messaging should go here - case "$SWITCHING_TO" in - "uefi") - print_green "Successfully switched to Dasharo UEFI firmware." - print_warning "You may need to re-create boot manager entries!" - ;; - "heads") - print_green "Successfully switched to Dasharo Heads firmware." - print_warning "On first boot you will see a warning about unsealing TOTP secrets." - print_warning "This is expected. Run OEM Factory Reset / Re-Ownership to finish deploying Heads." - ;; - esac - echo "Press any key to continue" # Make sure the user acknowledges. - read -n 1 -r input - else - # Regular update flow - print_green "Successfully updated Dasharo firmware." - fi - - if [ "$HAVE_EC" == "true" ]; then - echo "Updating Embedded Controller firmware. Your computer will power off automatically when done." - update_ec # Ends in a reset, does not exit - else - echo -n "Syncing disks... " - sync - echo "Done." - echo "The computer will reboot automatically in 5 seconds" - sleep 0.5 - echo "Rebooting in 5s:" - echo "5..." - sleep 1 - echo "4..." - sleep 1 - echo "3..." - sleep 1 - echo "2..." - sleep 1 - echo "1..." - sleep 0.5 - echo "Rebooting" - sleep 1 - ${CMD_REBOOT} - fi - - -} - -restore() { - while : ; do - echo - echo "Restoring firmware from HCL report." - echo "Take note that this will only restore BIOS firmware, no EC." - echo "Please select one of available options." - - echo " 1) Check for HCL report stored locally" - if [ -n "${DES_IS_LOGGED}" ]; then - echo " 2) Check for HCL report stored on 3mdeb cloud" - fi - echo " b) Back to main menu" - echo - read -r -p "Enter an option: " OPTION - echo - - # HCL report should be named as in dasharo-hcl-report so we can find - # the package based on uuid saved in name, we need to check two options - # with and without MAC address - uuid_string=`cat /sys/class/net/$(ip route show default | awk '/default/ {print $5}')/address` - # if above gives error then there is no internet connection and first - # part of uuid should be blank - if [ ! $? -eq 0 ]; then - uuid_string="" - fi - uuid_string+="_$(dmidecode -s system-product-name)" - uuid_string+="_$(dmidecode -s system-manufacturer)" - uuid=`uuidgen -n @x500 -N $uuid_string -s` - - case ${OPTION} in - 1) - echo - echo "Searching for HCL report on device..." - - HCL_REPORT_PACKAGE="$(find / -name "*$uuid*" | head -n1)" - if [ ! -z $HCL_REPORT_PACKAGE ]; then - tar -zxf "$HCL_REPORT_PACKAGE" -C /tmp - echo "Restoring BIOS firmware..." - if [ -f "/tmp/logs/rom.bin" ]; then - print_green "Found $HCL_REPORT_PACKAGE" - read -p "Do you want to restore firmware from the given HCL report? [N/y] " - case ${REPLY} in - yes|y|Y|Yes|YES) - # Ideally we would like to write the entire flash when restoring, - # but in reality we may face locked or unaccessible regions. - # To be on the safe side, flash whatever can be flashed by determining - # what is writable. - check_flash_lock - check_intel_regions - check_blobs_in_binary /tmp/logs/rom.bin - check_if_me_disabled - set_intel_regions_update_params "-N --ifd -i bios" - $FLASHROM -p "$PROGRAMMER_BIOS" ${FLASH_CHIP_SELECT} ${FLASHROM_ADD_OPT_REGIONS} -w "/tmp/logs/rom.bin" >> $FLASHROM_LOG_FILE 2>> $ERR_LOG_FILE - error_check "Failed to restore BIOS firmware! You can try one more time." - print_green "Successfully restored firmware" - echo "Returning to main menu..." - exit 0 - ;; - *) - echo "Returning to main menu..." - exit 0 - ;; - esac - else - print_error "Report does not have firmware backup!" - fi - else - print_warning "No HCL report found, cannot restore firmware" - echo "Returning to main menu..." - exit 0 - fi - ;; - 2) - echo - echo "Searching for HCL report on cloud..." - - ${CMD_CLOUD_LIST} $uuid - error_check "Could not download HCL report from cloud." - - HCL_REPORT_PACKAGE="$(find / -name *$uuid* | head -n1)" - tar -zxf "$HCL_REPORT_PACKAGE" -C /tmp - echo "Restoring BIOS firmware..." - if [ -f "/tmp/logs/rom.bin" ]; then - # Ideally we would like to write the entire flash when restoring, - # but in reality we may face locked or unaccessible regions. - # To be on the safe side, flash whatever can be flashed by determining - # what is writable. - check_flash_lock - check_intel_regions - check_blobs_in_binary /tmp/logs/rom.bin - check_if_me_disabled - set_intel_regions_update_params "-N --ifd -i bios" - flashrom -p "$PROGRAMMER_BIOS" ${FLASH_CHIP_SELECT} ${FLASHROM_ADD_OPT_REGIONS} -w "/tmp/logs/rom.bin" >> $FLASHROM_LOG_FILE 2>> $ERR_LOG_FILE - error_check "Failed to restore BIOS firmware! You can try one more time." - print_green "Successfully restored firmware" - else - print_error "Report does not have firmware backup!" - fi - ;; - b|B) - echo "Returning to main menu..." - exit 0 - ;; - *) - ;; - esac - done -} - -usage() { - echo "Usage:" - echo " $0 install - Install Dasharo on this device" - echo " $0 backup - Backup current firmware" - echo " $0 restore - Restore from a previously saved backup" -} - -# for FUM we start in dasharo-deploy so we need to verify that we have internet -# connection to download shasums in board_config -if [ "$FUM" == "fum" ]; then - check_network_connection -fi - -board_config -check_flash_chip -if [ -v PLATFORM_SIGN_KEY ]; then - get_signing_keys -fi - -case "$CMD" in - install) - if check_if_dasharo; then - error_exit "Dasharo Firmware is already installed. This script is only for\r - initial deployment of Dasharo Firmware. Aborting..." - fi - backup - install - ;; - update) - if [ "$FUM" == "fum" ]; then - echo "Firmware Update Mode detected; proceed with automatic update in 5 seconds" - echo "Updating in 5s:" - echo "5..." - sleep 1 - echo "4..." - sleep 1 - echo "3..." - sleep 1 - echo "2..." - sleep 1 - echo "1..." - sleep 0.5 - fi - update - ;; - backup) - backup - ;; - restore) - if ! check_if_dasharo; then - error_exit "Dasharo Firmware is not installed. This script is only for\r - restoring original firmware on platforms that runs Dasharo Firmware. Aborting..." - fi - restore - ;; - *) - usage - ;; -esac diff --git a/meta-dts-distro/recipes-dts/dts/dts.bb b/meta-dts-distro/recipes-dts/dts/dts.bb deleted file mode 100644 index 6542d422..00000000 --- a/meta-dts-distro/recipes-dts/dts/dts.bb +++ /dev/null @@ -1,40 +0,0 @@ -DESCRIPTION = "Dasharo Tools Suite" -SECTION = "tools" -HOMEPAGE = "https://docs.dasharo.com" - -LICENSE = "MIT" - -LIC_FILES_CHKSUM = "file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420" - -SRC_URI = " \ - file://dts \ - file://dts-boot \ - file://dts-profile.sh \ - file://ec_transition \ - file://cloud_list \ - file://dts-environment.sh \ - file://dts-functions.sh \ -" - -S = "${WORKDIR}" - -RDEPENDS:${PN} = " \ - bash \ - dasharo-hcl-report \ - iotools \ -" - -do_install () { - install -d ${D}/${sbindir} - install -m 0755 ${S}/dts ${D}/${sbindir} - install -m 0755 ${S}/dts-boot ${D}/${sbindir} - install -m 0755 ${S}/ec_transition ${D}/${sbindir} - install -m 0755 ${S}/cloud_list ${D}/${sbindir} - install -m 0664 ${S}/dts-environment.sh ${D}/${sbindir} - install -m 0664 ${S}/dts-functions.sh ${D}/${sbindir} - - # install profile dropin so the DTS_ENV and DTS_FUNCS variables are set when - # loged via SSH - install -d ${D}${sysconfdir}/profile.d/ - install -m 0755 ${WORKDIR}/dts-profile.sh ${D}${sysconfdir}/profile.d/ -} diff --git a/meta-dts-distro/recipes-dts/dts/dts/cloud_list b/meta-dts-distro/recipes-dts/dts/dts/cloud_list deleted file mode 100755 index e5831318..00000000 --- a/meta-dts-distro/recipes-dts/dts/dts/cloud_list +++ /dev/null @@ -1,58 +0,0 @@ -#!/usr/bin/env bash - -TMP_RESPONSE="/tmp/webdav_response" -TMP_LIST="/tmp/cloud_list" -HW_UUID="$1" - -### Error checks -print_error() { - echo -e "$RED""$1""$COLOR_OFF" -} - -error_exit() { - _error_msg="$1" - print_error "$_error_msg" - exit 1 -} - -error_check() { - _error_code=$? - _error_msg="$1" - [ "$_error_code" -ne 0 ] && error_exit "$_error_msg : ($_error_code)" -} - -USER_DETAILS="$CLOUDSEND_LOGS_URL:$CLOUDSEND_PASSWORD" -CLOUD_REQUEST="X-Requested-With: XMLHttpRequest" - -tmpURL="https://cloud.3mdeb.com/public.php/webdav/" - -curl -L -f -u "$USER_DETAILS" -H "$CLOUD_REQUEST" -X PROPFIND "$tmpURL" -o "$TMP_RESPONSE" -error_check "Cannot access list of files on cloud." - -# parse response -sed -i 's/\://g' "$TMP_RESPONSE" -sed -i 's/\?//g' "$TMP_RESPONSE" -sed -i 's//&\n&\n/g' "$TMP_RESPONSE" -sed -i 's#<&/dresponse>#<&/dresponse>&\n#g' "$TMP_RESPONSE" - -# create line per record -grep "public.php/webdav/" "$TMP_RESPONSE" > "$TMP_LIST" -# remove xml tags -sed -i 's#/dhref.*#\/dhref>#' "$TMP_LIST" -sed -i 's#<*dresponse>##g' "$TMP_LIST" -sed -i 's###g' "$TMP_LIST" -sed -i 's###g' "$TMP_LIST" -sed -i 's#/public.php/webdav/##g' "$TMP_LIST" - -# get first, oldest HCL report with given UUID in name -HCL_REPORT_NAME=$(cat $TMP_LIST | grep -m1 $HW_UUID) - -# download HCL report -tmpURL="https://cloud.3mdeb.com/public.php/webdav/$HCL_REPORT_NAME" -curl -L -f -u "$USER_DETAILS" -H "$CLOUD_REQUEST" -X GET "$tmpURL" -o /$HCL_REPORT_NAME -if [ -f /$HCL_REPORT_NAME ]; then - echo "Report downloaded" -else - echo "Report not found!" - exit 1 -fi diff --git a/meta-dts-distro/recipes-dts/dts/dts/dts b/meta-dts-distro/recipes-dts/dts/dts/dts deleted file mode 100644 index 53bf5346..00000000 --- a/meta-dts-distro/recipes-dts/dts/dts/dts +++ /dev/null @@ -1,227 +0,0 @@ -#!/usr/bin/env bash - -source $DTS_ENV -source $DTS_FUNCS - -trap : 2 -trap : 3 - -check_os_version() { - local os_version=$(grep "VERSION_ID" ${OS_VERSION_FILE} | cut -d "=" -f 2-) - echo " DTS version v${os_version}" -} - -print_disclaimer() { -echo -e \ -"Please note that the report is not anonymous, but we will use it only for\r -backup and future improvement of the Dasharo product. Every log is encrypted\r -and sent over HTTPS, so security is assured.\r -If you still have doubts, you can skip HCL report generation.\r\n -What is inside the HCL report? We gather information about:\r - - PCI, Super I/O, GPIO, EC, audio, and Intel configuration,\r - - MSRs, CMOS NVRAM, CPU info, DIMMs, state of touchpad, SMBIOS and ACPI tables,\r - - Decoded BIOS information, full firmware image backup, kernel dmesg,\r - - IO ports, input bus types, and topology - including I2C and USB,\r -\r -You can find more info about HCL in docs.dasharo.com/glossary\r" -} - -print_banner() { -echo ' ____ __ ______ __ _____ _ __' -echo ' / __ \____ ______/ /_ ____ __________ /_ __/___ ____ / /____ / ___/__ __(_) /'____ -echo ' / / / / __ `/ ___/ __ \/ __ `/ ___/ __ \ / / / __ \/ __ \/ / ___/ \__ \/ / / / / __/ _ \' -echo ' / /_/ / /_/ (__ ) / / / /_/ / / / /_/ / / / / /_/ / /_/ / (__ ) ___/ / /_/ / / /_/ __/' -echo '/_____/\__,_/____/_/ /_/\__,_/_/ \____/ /_/ \____/\____/_/____/ /____/\__,_/_/\__/\___/' -echo -} - -print_banner - -logs_sent="${LOGS_SENT:-}" - -while : ; do - # Each time the main menu is displayed, check for DES credentials and export - # them, if file exists - if [ -e "${SE_credential_file}" ]; then - export CLOUDSEND_LOGS_URL=$(sed -n '1p' < ${SE_credential_file} | tr -d '\n') - export CLOUDSEND_DOWNLOAD_URL=$(sed -n '2p' < ${SE_credential_file} | tr -d '\n') - export CLOUDSEND_PASSWORD=$(sed -n '3p' < ${SE_credential_file} | tr -d '\n') - export USER_DETAILS="$CLOUDSEND_DOWNLOAD_URL:$CLOUDSEND_PASSWORD" - export DES_IS_LOGGED="true" - else - export CLOUDSEND_LOGS_URL="$BASE_CLOUDSEND_LOGS_URL" - export CLOUDSEND_PASSWORD="$BASE_CLOUDSEND_PASSWORD" - unset CLOUDSEND_DOWNLOAD_URL - unset DES_IS_LOGGED - fi - - echo - check_os_version - echo - echo " 1) Dasharo HCL report - dump hardware information from this device" - if ! check_if_dasharo; then - echo " 2) Install Dasharo firmware" - fi - if check_if_dasharo; then - echo " 3) Restore firmware from Dasharo HCL report" - fi - if [ -n "${DES_IS_LOGGED}" ]; then - echo " 4) Edit your DES keys" - echo " Logs key : " ${CLOUDSEND_LOGS_URL} - echo " Download key: " ${CLOUDSEND_DOWNLOAD_URL} - echo " Password : " ${CLOUDSEND_PASSWORD} - else - echo " 4) Load your DES keys" - fi - if check_if_dasharo; then - echo " 5) Check and apply Dasharo firmware updates" - fi - if systemctl is-active sshd.socket > /dev/null 2>&1; then - echo " 8) Stop SSH server" - else - echo " 8) Start SSH server" - fi - echo " 9) Shell" - echo " 10) Power off system" - echo " 11) Reboot system" - echo - read -p "Enter an option: " OPTION - echo - - case ${OPTION} in - 1) - print_disclaimer - read -p "Do you want to support Dasharo development by sending us logs with your hardware configuration? [N/y] " - case ${REPLY} in - yes|y|Y|Yes|YES) - export SEND_LOGS="true" - echo "Thank you for contributing to the Dasharo development!" - ;; - *) - export SEND_LOGS="false" - echo "Logs will be saved in root directory." - echo "Please consider supporting Dasharo by sending the logs next time." - ;; - esac - if [ "${SEND_LOGS}" == "true" ]; then - # DEPLOY_REPORT variable is used in dasharo-hcl-report to determine - # which logs should be printed in the terminal, in the future whole - # dts scripting should get some LOGLEVEL and maybe dumping working - # logs to file - export DEPLOY_REPORT="false" - check_network_connection && ${CMD_DASHARO_HCL_REPORT} && logs_sent="1" - else - export DEPLOY_REPORT="false" - ${CMD_DASHARO_HCL_REPORT} - fi - ;; - 2) - if ! check_if_dasharo; then - if check_network_connection; then - echo "Preparing ..." - if [ -z "${logs_sent}" ]; then - export SEND_LOGS="true" - export DEPLOY_REPORT="true" - if ! ${CMD_DASHARO_HCL_REPORT}; then - echo -e "Unable to connect to cloud.3mdeb.com for submitting the - \rHCL report. Please recheck your internet connection." - else - logs_sent="1" - fi - fi - fi - fi - - if [ -n "${logs_sent}" ]; then - ${CMD_DASHARO_DEPLOY} install - fi - ;; - 3) - if check_if_dasharo; then - ${CMD_DASHARO_DEPLOY} restore - fi - ;; - 4) - echo "" - read -p "Enter logs key: " 'TMP_CLOUDSEND_LOGS_URL' - echo "" - read -p "Enter firmware download key: " 'TMP_CLOUDSEND_DOWNLOAD_URL' - echo "" - read -p "Enter password: " 'TMP_CLOUDSEND_PASSWORD' - - echo ${TMP_CLOUDSEND_LOGS_URL} > ${SE_credential_file} - echo ${TMP_CLOUDSEND_DOWNLOAD_URL} >> ${SE_credential_file} - echo ${TMP_CLOUDSEND_PASSWORD} >> ${SE_credential_file} - - print_green "Dasharo DES credentials have been saved" - echo "Verifying Dasharo DES credentials..." - - check_se_creds - if [ $? -eq 0 ]; then - print_green "Verification of the Dasharo DES was successful. They are valid and will be used." - else - echo -e "Something may be wrong with the DES credentials. Please use option 4 to change the DES keys - \rand make sure that there is no typo." - rm ${SE_credential_file} - export CLOUDSEND_LOGS_URL="$BASE_CLOUDSEND_LOGS_URL" - export CLOUDSEND_PASSWORD="$BASE_CLOUDSEND_PASSWORD" - unset CLOUDSEND_DOWNLOAD_URL - unset DES_IS_LOGGED - fi - ;; - 5) - if check_if_dasharo; then - # For NovaCustom TGL laptops with Dasharo version lower than 1.3.0, - # we shall run the ec_transition script instead. See: - # https://docs.dasharo.com/variants/novacustom_nv4x_tgl/releases/#v130-2022-10-18 - if [ "$BOARD_VENDOR" = "Notebook" ]; then - case "$SYSTEM_MODEL" in - "NS50_70MU"|"NV4XMB,ME,MZ") - compare_versions $DASHARO_VERSION 1.3.0 - if [ $? -eq 1 ]; then - # For Dasharo version lesser than 1.3.0 - print_warning "Detected NovaCustom hardware with version < 1.3.0" - print_warning "Need to perform EC transition after which the platform will turn off" - print_warning "Then, please power it on and proceed with update again" - print_warning "EC transition procedure will start in 5 seconds" - sleep 5 - ${CMD_EC_TRANSITION} - error_check "Could not perform EC transition" - fi - # Continue with regular update process for Dasharo version - # greater or equal 1.3.0 - ;; - esac - fi - - # Use regular update process for everything else - ${CMD_DASHARO_DEPLOY} update - fi - ;; - 8) - if systemctl is-active sshd.socket > /dev/null 2>&1; then - print_green "Turning off the SSH server..." - systemctl stop sshd.socket - else - print_warning "Starting SSH server!" - print_warning "Now you can log in into the system using root account." - print_warning "Stopping server will not drop all connected sessions." - systemctl start sshd.socket - print_green "Listening on IPs: $(ip -br -f inet a show scope global | grep UP | awk '{ print $3 }' | tr '\n' ' ')" - fi - ;; - 9) - echo "Entering shell, to leave type exit and press Enter or press LCtrl+D" - echo "" - ${CMD_SHELL} - ;; - 10) - ${CMD_POWEROFF} - ;; - 11) - ${CMD_REBOOT} - ;; - *) - ;; - esac -done diff --git a/meta-dts-distro/recipes-dts/dts/dts/dts-boot b/meta-dts-distro/recipes-dts/dts/dts/dts-boot deleted file mode 100644 index a1be141a..00000000 --- a/meta-dts-distro/recipes-dts/dts/dts/dts-boot +++ /dev/null @@ -1,14 +0,0 @@ -#!/bin/bash - -SBIN_DIR="/usr/sbin" -FUM_EFIVAR="/sys/firmware/efi/vars/FirmwareUpdateMode-d15b327e-ff2d-4fc1-abf6-c12bd08c1359" - -export DTS_FUNCS="$SBIN_DIR/dts-functions.sh" -export DTS_ENV="$SBIN_DIR/dts-environment.sh" - -if [ -d $FUM_EFIVAR ]; then - $SBIN_DIR/dasharo-deploy update fum -else - $SBIN_DIR/dts -fi - diff --git a/meta-dts-distro/recipes-dts/dts/dts/dts-environment.sh b/meta-dts-distro/recipes-dts/dts/dts/dts-environment.sh deleted file mode 100644 index 9baa8185..00000000 --- a/meta-dts-distro/recipes-dts/dts/dts/dts-environment.sh +++ /dev/null @@ -1,91 +0,0 @@ -#!/usr/bin/env bash - -# Text Reset -COLOR_OFF='\033[0m' -RED='\033[0;31m' -YELLOW='\033[0;33m' -GREEN='\033[0;32m' - -BOARD_VENDOR="${BOARD_VENDOR:-$(dmidecode -s system-manufacturer)}" -SYSTEM_MODEL="${SYSTEM_MODEL:-$(dmidecode -s system-product-name)}" -BOARD_MODEL="${BOARD_MODEL:-$(dmidecode -s baseboard-product-name)}" - -BIOS_VENDOR="${BIOS_VENDOR:-$(dmidecode -s bios-vendor)}" -BIOS_VERSION="${BIOS_VERSION:-$(dmidecode -s bios-version)}" -DASHARO_VERSION="$(echo $BIOS_VERSION | cut -d ' ' -f 3 | tr -d 'v')" -DASHARO_FLAVOR="$(echo $BIOS_VERSION | cut -d ' ' -f 1,2)" - -# path to temporary files, created while deploying or updating Dasharo firmware -BIOS_UPDATE_FILE="/tmp/biosupdate.rom" -EC_UPDATE_FILE="/tmp/ecupdate.rom" -BIOS_HASH_FILE="/tmp/bioshash.sha256" -EC_HASH_FILE="/tmp/echash.sha256" -BIOS_SIGN_FILE="/tmp/biossignature.sig" -EC_SIGN_FILE="/tmp/ecsignature.sig" -BIOS_UPDATE_CONFIG_FILE="/tmp/biosupdate_config" -RESIGNED_BIOS_UPDATE_FILE="/tmp/biosupdate_resigned.rom" -SYSTEM_UUID_FILE="/tmp/system_uuid.txt" -SERIAL_NUMBER_FILE="/tmp/serial_number.txt" - -# default value for flash chip related information -FLASH_CHIP_SELECT="" -FLASH_CHIP_SIZE="" - -# dasharo-deploy backup cmd related variables, do we still use and need this as -# backup is placed in HCL? -ROOT_DIR="/" -FW_BACKUP_NAME="fw_backup" -FW_BACKUP_DIR="${ROOT_DIR}${FW_BACKUP_NAME}" -FW_BACKUP_TAR="${FW_BACKUP_DIR}.tar.gz" -FW_BACKUP_TAR="$(echo "$FW_BACKUP_TAR" | sed 's/\ /_/g')" - -# path to system files -ERR_LOG_FILE="/var/local/dts-err.log" -FLASHROM_LOG_FILE="/var/local/flashrom.log" -FLASH_INFO_FILE="/tmp/flash_info" -OS_VERSION_FILE="/etc/os-release" -KEYS_DIR="/tmp/devkeys" - -# path to system commands -CMD_POWEROFF="/sbin/poweroff" -CMD_REBOOT="/sbin/reboot" -CMD_SHELL="/bin/bash" -CMD_DASHARO_HCL_REPORT="/usr/sbin/dasharo-hcl-report" -CMD_NCMENU="/usr/sbin/novacustom_menu" -CMD_DASHARO_DEPLOY="/usr/sbin/dasharo-deploy" -CMD_CLOUD_LIST="/usr/sbin/cloud_list" -CMD_EC_TRANSITION="/usr/sbin/ec_transition" - -# default values for flashrom programmer -FLASHROM="${FLASHROM:-flashrom}" -PROGRAMMER_BIOS="internal" -PROGRAMMER_EC="ite_ec" - -DASHARO_ECTOOL="${DASHARO_ECTOOL:-dasharo_ectool}" - -# variables defining Dasharo specific entries in DMI tables, used to check if -# Dasharo FW is already installed -DASHARO_VENDOR="3mdeb" -DASHARO_NAME="Dasharo" - -# most the time one flash chipset will be detected, for other cases (like for -# ASUS KGPE-D16) we will test the following list in check_flash_chip function -FLASH_CHIP_LIST="W25Q64BV/W25Q64CV/W25Q64FV W25Q64JV-.Q W25Q128.V..M" - -# Dasharo Supporters Entrance variables -SE_credential_file="/etc/cloud-pass" -FW_STORE_URL="${FW_STORE_URL_DEV:-https://dl.3mdeb.com/open-source-firmware/Dasharo}" -FW_STORE_URL_DES="https://cloud.3mdeb.com/public.php/webdav" -CLOUD_REQUEST="X-Requested-With: XMLHttpRequest" - -## base values -BASE_CLOUDSEND_LOGS_URL="39d4biH4SkXD8Zm" -BASE_CLOUDSEND_PASSWORD="1{\[\k6G" -DEPLOY_REPORT="false" - -# set custom localization for PGP keys -if [ -d /home/root/.dasharo-gnupg ]; then - GNUPGHOME=/home/root/.dasharo-gnupg - - export GNUPGHOME -fi diff --git a/meta-dts-distro/recipes-dts/dts/dts/dts-profile.sh b/meta-dts-distro/recipes-dts/dts/dts/dts-profile.sh deleted file mode 100644 index 89fa0387..00000000 --- a/meta-dts-distro/recipes-dts/dts/dts/dts-profile.sh +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/sh - -SBIN_DIR="/usr/sbin" -export DTS_FUNCS="$SBIN_DIR/dts-functions.sh" -export DTS_ENV="$SBIN_DIR/dts-environment.sh" diff --git a/meta-dts-distro/recipes-dts/dts/dts/ec_transition b/meta-dts-distro/recipes-dts/dts/dts/ec_transition deleted file mode 100644 index 019a79d8..00000000 --- a/meta-dts-distro/recipes-dts/dts/dts/ec_transition +++ /dev/null @@ -1,130 +0,0 @@ -#!/usr/bin/env bash - -source $DTS_ENV -source $DTS_FUNCS - -check_network_connection() { - echo 'Waiting for network connection ...' - n="5" - while : ; do - ping -c 3 cloud.3mdeb.com > /dev/null 2>&1 && break - n=$((n-1)) - if [ "${n}" == "0" ]; then - error_exit "No network connection to 3mdeb cloud, please recheck Ethernet connection" - fi - sleep 1 - done -} - -board_config() { - case "$BOARD_VENDOR" in - "Notebook") - case "$SYSTEM_MODEL" in - "NS50_70MU") - HAVE_EC="true" - NEED_EC_RESET="true" - COMPATIBLE_EC_FW_VERSION="2022-08-31_cbff21b" - EC_HASH="d1001465cea74a550914c14f0c8f901b14827a3b5fa0b612ae6d11594ac2b405 /tmp/ecupdate.rom" - BIOS_HASH="d4c30660c53bac505997de30b9eac4c5ac15f3212c62366730dc2ca3974bba18 /tmp/biosupdate.rom" - PROGRAMMER_BIOS="internal" - PROGRAMMER_EC="ite_ec" - BIOS_LINK="https://cloud.3mdeb.com/index.php/s/SKpqSNzfFNY7AbK/download" - EC_LINK="https://cloud.3mdeb.com/index.php/s/GK2KbXaYprkCCWM/download" - ;; - "NV4XMB,ME,MZ") - HAVE_EC="true" - NEED_EC_RESET="true" - COMPATIBLE_EC_FW_VERSION="2022-10-07_c662165" - EC_HASH="7a75fd9afd81012f7c1485cc335298979509e5929d931d898465fbddb4ce105c /tmp/ecupdate.rom" - BIOS_HASH="7271b638c87cba658162931f55bdaa6987eb5b0555075ce8e2297a79a505c8b0 /tmp/biosupdate.rom" - PROGRAMMER_BIOS="internal:boardmismatch=force" - PROGRAMMER_EC="ite_ec:boardmismatch=force,romsize=128K,autoload=disable" - BIOS_LINK="https://cloud.3mdeb.com/index.php/s/3cjkJSWBzPfb5SP/download" - EC_LINK="https://cloud.3mdeb.com/index.php/s/9S5Tmy6kwFjpcNm/download" - ;; - *) - error_exit "Board model $SYSTEM_MODEL is currently not supported" - ;; - esac - ;; - *) - error_exit "Board vendor: $BOARD_VENDOR is currently not supported" - ;; - esac -} - -check_for_opensource_firmware() -{ - echo "Checking for opensource firmware" - $DASHARO_ECTOOL info >> /dev/null 2>&1 - if [ $? -eq 0 ]; then - error_exit "Device has already Open Source Embedded Controller firmware, aborting..." - fi -} - -download_files() -{ - check_network_connection - BIOS_UPDATE_FILE="/tmp/biosupdate.rom" - EC_UPDATE_FILE="/tmp/ecupdate.rom" - wget -O $EC_UPDATE_FILE $EC_LINK - error_check "Cannot download EC update file. Aborting..." - wget -O $BIOS_UPDATE_FILE $BIOS_LINK - error_check "Cannot download FW update file. Aborting..." - echo "Successfully downloaded EC and FW files." -} - -update_ec() { - sha256sum --check <(echo "$EC_HASH") - error_check "Failed to download EC firmware update" - - echo "Updating EC..." - $FLASHROM -p ${PROGRAMMER_EC} -w /tmp/ecupdate.rom >> $FLASHROM_LOG_FILE 2>> $ERR_LOG_FILE - error_check "Failed to update EC firmware" - - echo "Successfully updated EC firmware" -} - -install() { - sha256sum --check <(echo "$BIOS_HASH") - error_check "Failed to verify Dasharo firmware" - - if [ "$HAVE_EC" == "true" ]; then - _ec_fw_version=$($FLASHROM -p ${PROGRAMMER_EC} | grep "Mainboard EC Version" | tr -d ' ' | cut -d ':' -f 2) - - if [ "$_ec_fw_version" != "$COMPATIBLE_EC_FW_VERSION" ]; then - echo "EC version: $_ec_fw_version is not supported, update required" - update_ec - fi - fi - - echo "Installing Dasharo firmware..." - $FLASHROM -p ${PROGRAMMER_BIOS} --ifd -i bios -w /tmp/biosupdate.rom >> $FLASHROM_LOG_FILE 2>> $ERR_LOG_FILE - error_check "Failed to install Dasharo firmware" - - echo "Successfully installed Dasharo firmware" - - echo "Powering off" - sleep 1 - if [ "$NEED_EC_RESET" = "true" ]; then - it5570_shutdown - else - ${CMD_POWEROFF} - fi -} - -usage() { - echo "Usage:" - echo " $0 " - exit 1 -} - -ROOT_DIR="/" - -[ -z "$BOARD_VENDOR" ] && error_exit "BOARD_VENDOR not given" -[ -z "$SYSTEM_MODEL" ] && error_exit "SYSTEM_MODEL not given" - -check_for_opensource_firmware -board_config -download_files -install diff --git a/meta-dts-distro/recipes-dts/packagegroups/packagegroup-dts.bb b/meta-dts-distro/recipes-dts/packagegroups/packagegroup-dts.bb index eacb03fd..4a1c18f2 100644 --- a/meta-dts-distro/recipes-dts/packagegroups/packagegroup-dts.bb +++ b/meta-dts-distro/recipes-dts/packagegroups/packagegroup-dts.bb @@ -43,13 +43,11 @@ RDEPENDS:${PN}-tools-base = " \ RDEPENDS:${PN}-tools-dts = " \ mei-amt-check \ cloudsend \ - dasharo-deploy \ - dasharo-hcl-report \ - dts \ dasharo-ectool \ txt-suite \ bg-suite \ dasharo-configuration-utility \ + dts-scripts \ " RDEPENDS:${PN}-python = " \ diff --git a/meta-dts-distro/recipes-dts/reports/dasharo-hcl-report.bb b/meta-dts-distro/recipes-dts/reports/dasharo-hcl-report.bb deleted file mode 100644 index 0b7471fd..00000000 --- a/meta-dts-distro/recipes-dts/reports/dasharo-hcl-report.bb +++ /dev/null @@ -1,30 +0,0 @@ -DESCRIPTION = "Dasharo HCL Report" -SECTION = "tools" -HOMEPAGE = "https://github.com/Dasharo/jubilant-octo-train/blob/master/config/includes.chroot/usr/bin/dasharo-hcl-report" - -LICENSE = "MIT" - -LIC_FILES_CHKSUM = "file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420" - -SRC_URI = " \ - file://dasharo-hcl-report \ -" - -S = "${WORKDIR}" - -RDEPENDS:${PN} = " \ - packagegroup-coreboot-utils \ - flashrom \ - iasl \ - tar \ - i2c-tools \ - i2c-tools-misc \ - bash \ - touchpad-info \ - dmidecode \ -" - -do_install () { - install -d ${D}/${sbindir} - install -m 0755 ${S}/dasharo-hcl-report ${D}/${sbindir} -} diff --git a/meta-dts-distro/recipes-dts/reports/dasharo-hcl-report/dasharo-hcl-report b/meta-dts-distro/recipes-dts/reports/dasharo-hcl-report/dasharo-hcl-report deleted file mode 100755 index 96f33354..00000000 --- a/meta-dts-distro/recipes-dts/reports/dasharo-hcl-report/dasharo-hcl-report +++ /dev/null @@ -1,370 +0,0 @@ -#!/usr/bin/env bash - -source $DTS_ENV -source $DTS_FUNCS - -update_result() { - TOOL=$1 - ERRORFILE=$2 - LOGFILE=`printf $2 | sed 's/[.].*$//' && echo ".log"` - - # check if status was set as a unknown - if [ ! -v $3 ]; then - echo -e [$YELLOW"UNKNOWN"$COLOR_OFF]"\t"$TOOL >> result - return - fi - - ERR=$(stat -c%s "$ERRORFILE" 2> /dev/null) - LOG=$(stat -c%s "$LOGFILE" 2> /dev/null) - - # if ERR or LOG var is empty, set it to 1 so we will go into UNKNOWN state - if [ -z "$LOG" ]; then - LOG=1 - fi - if [ -z "$ERR" ]; then - ERR=1 - fi - # specific check for firmware dump - if [ $LOGFILE == "logs/flashrom_read.log" ]; then - if [ $LOG -ne 0 ] && [ -f "logs/rom.bin" ]; then - echo -e [$GREEN"OK"$COLOR_OFF]"\t\t"$TOOL >> result - else - echo -e [$RED"ERROR"$COLOR_OFF]"\t\t"$TOOL >> result - fi - return - fi - - # generic checks - if [ $LOG -ne 0 ] && [ $ERR -eq 0 ]; then - echo -e [$GREEN"OK"$COLOR_OFF]"\t\t"$TOOL >> result - elif [ $LOG -eq 0 ] && [ $ERR -ne 0 ]; then - echo -e [$RED"ERROR"$COLOR_OFF]"\t\t"$TOOL >> result - else - echo -e [$YELLOW"UNKNOWN"$COLOR_OFF]"\t"$TOOL >> result - fi -} - -CMD_DASHARO_DEPLOY="/usr/sbin/dasharo-deploy" - -if [ "$(id -u)" -ne 0 ]; then - echo "This script must be started as root!" - exit 1 -fi - -if [ -d logs ]; then - rm -rf logs -fi - -FULL_UPLOAD_URL="https://cloud.3mdeb.com/index.php/s/"${CLOUDSEND_LOGS_URL} - -check_flash_chip - -mkdir logs -if [ $DEPLOY_REPORT = "false" ]; then - echo "Getting hardware information. It will take a few minutes..." -fi -# echo "Dumping PCI configuration space and topology..." -lspci -nnvvvxxxx > logs/lspci.log 2> logs/lspci.err.log -update_result "PCI configuration space and topology" logs/lspci.err.log -printf '## |\r' - -# echo "Dumping USB devices and topology..." -lsusb -vvv > logs/lsusb.log 2> logs/lsusb.err.log -update_result "USB devices and topology" logs/lsusb.err.log -printf '#### |\r' - -# echo "Dumping Super I/O configuration..." -superiotool -deV > logs/superiotool.log 2> logs/superiotool.err.log -update_result "Super I/O configuration" logs/superiotool.err.log -printf '###### |\r' - -# echo "Dumping Embedded Controller configuration (this may take a while if EC is not present)..." -ectool -ip > logs/ectool.log 2> logs/ectool.err.log -update_result "EC configuration" logs/ectool.err.log -printf '######## |\r' - -# echo "Dumping MSRs..." -msrtool > logs/msrtool.log 2> logs/msrtool.err.log -update_result "MSRs" logs/msrtool.err.log -printf '########## |\r' - -# echo "Dumping SMBIOS tables..." -dmidecode > logs/dmidecode.log 2> logs/dmidecode.err.log -update_result "SMBIOS tables" logs/dmidecode.err.log -printf '############ |\r' - -# echo "Decoding BIOS information..." -biosdecode > logs/biosdecode.log 2> logs/biosdecode.err.log -update_result "BIOS information" logs/biosdecode.err.log -printf '############## |\r' - -# echo "Extracting CMOS NVRAM..." -nvramtool -x > logs/nvramtool.log 2> logs/nvramtool.err.log -update_result "CMOS NVRAM" logs/nvramtool.err.log -printf '################ |\r' - -# echo "Dumping Intel configuration registers..." -inteltool -a > logs/inteltool.log 2> logs/inteltool.err.log -update_result "Intel configuration registers" logs/inteltool.err.log -printf '################## |\r' - -# echo "Generating GPIO configuration C header files for coreboot..." -intelp2m -file logs/inteltool.log -fld cb -i -p snr -o logs/gpio_snr.h > logs/intelp2m.log 2> logs/intelp2m.err.log -intelp2m -file logs/inteltool.log -fld cb -i -p cnl -o logs/gpio_cnl.h >> logs/intelp2m.log 2>> logs/intelp2m.err.log -intelp2m -file logs/inteltool.log -fld cb -i -p apl -o logs/gpio_apl.h >> logs/intelp2m.log 2>> logs/intelp2m.err.log -intelp2m -file logs/inteltool.log -fld cb -i -p lbg -o logs/gpio_lbg.h >> logs/intelp2m.log 2>> logs/intelp2m.err.log -update_result "GPIO configuration C header files" logs/intelp2m.err.log -printf '#################### |\r' - -# echo "Dumping kernel dmesg..." -dmesg > logs/dmesg.log 2> logs/dmesg.err.log -update_result "kernel dmesg" logs/dmesg.err.log -printf '###################### |\r' - -# echo "Dumping ACPI tables..." -acpidump > logs/acpidump.log 2> logs/acpidump.err.log -update_result "ACPI tables" logs/acpidump.err.log -printf '######################## |\r' - -# echo "Dumping Audio devices configuration..." - -# This is a workaround to soundcard's files absence in short time after booting. -# Thread is continued here https://github.com/Dasharo/dasharo-issues/issues/247 -for t in {1..12} -do - SND_HW_FILES=/sys/class/sound/card0/hw*/init_pin_configs - SND_CODEC_FILES=/proc/asound/card0/codec#* - SND_HW_FILE=`echo $SND_HW_FILES | cut -d ' ' -f 1` - SND_CODEC_FILE=`echo $SND_CODEC_FILES | cut -d ' ' -f 1` - - if [ -f "$SND_HW_FILE" ] && [ -f "$SND_CODEC_FILE" ]; then - break - else - sleep 5 - if [ $t -eq 12 ]; then - if [ $DEPLOY_REPORT = "false" ]; then - echo "Sound card files are missing!" - fi - fi - fi -done - -for x in /sys/class/sound/card0/hw*; do cat "$x/init_pin_configs" > logs/pin_"$(basename "$x")" 2> logs/pin_"$(basename "$x")".err.log; done -for x in /proc/asound/card0/codec#*; do cat "$x" > logs/"$(basename "$x")" 2> logs/"$(basename "$x")".err.log; done -update_result "Audio devices configuration" 0 UNKNOWN -printf '########################## |\r' - -# echo "Dumping CPU info..." -cat /proc/cpuinfo > logs/cpuinfo.log 2> logs/cpuinfo.err.log -update_result "CPU info" logs/cpuinfo.err.log -printf '############################ |\r' - -# echo "Dumping I/O ports..." -cat /proc/ioports > logs/ioports.log 2> logs/ioports.err.log -update_result "I/O ports" logs/ioports.err.log -printf '############################## |\r' - -# echo "Dumping input bus types..." -cat /sys/class/input/input*/id/bustype > logs/input_bustypes.log -update_result "Input bus types" logs/ioports.err.log -printf '################################ |\r' - -# echo "Trying to read firmware image with flashrom..." -# Some regions may be not available so we need to use specific regions to read -check_intel_regions -if [ $BOARD_HAS_FD_REGION -eq 0 ]; then - # No descriptor, probably safe to read everything - FLASHROM_ADD_OPT_READ=" " -else - # Use safe defaults. Descriptor may contain additional regions not detected - # by flashrom and will return failure when attempted to be read. BIOS and - # Flash descriptor regions should always be readable. If not, then we have - # some ugly case, hard to deal with. - FLASHROM_ADD_OPT_READ="--ifd -i fd -i bios" - if [ $BOARD_HAS_ME_REGION -eq 0 ] && [ $BOARD_ME_REGION_LOCKED -ne 0 ]; then - # ME region is not locked, read it as well - FLASHROM_ADD_OPT_READ+=" -i me" - fi - if [ $BOARD_HAS_GBE_REGION -eq 0 ] && [ $BOARD_GBE_REGION_LOCKED -ne 0 ]; then - # GBE region is present and not locked, read it as well - FLASHROM_ADD_OPT_READ+=" -i gbe" - fi -fi - -$FLASHROM -V -p internal:laptop=force_I_want_a_brick ${FLASH_CHIP_SELECT} -r logs/rom.bin ${FLASHROM_ADD_OPT_READ} > logs/flashrom_read.log 2> logs/flashrom_read.err.log -if [ $? -ne 0 ]; then - echo "CRITICAL ERROR: cannot dump firmware" -fi -update_result "Firmware image" logs/flashrom_read.err.log -printf '################################## |\r' - -# echo "Probing all I2C buses..." -MAX_I2C_ID=$(i2cdetect -l | awk 'BEGIN{c1=0} //{c1++} END{print "",--c1}') -for bus in $(seq 0 "$MAX_I2C_ID"); -do - echo "I2C bus number: $bus" >> logs/i2cdetect.log 2>> logs/i2cdetect.err.log - i2cdetect -y "$bus" >> logs/i2cdetect.log 2>> logs/i2cdetect.err.log -done -update_result "I2C bus" logs/i2cdetect.err.log -printf '#################################### |\r' - -# echo "Decompiling ACPI tables..." -mkdir -p logs/acpi -if pushd logs/acpi &> /dev/null; then - acpixtract -a ../acpidump.log &>/dev/null - iasl -d ./*.dat &>/dev/null - popd &> /dev/null -fi -update_result "ACPI tables" 0 UNKNOWN -printf '###################################### |\r' - -# echo "Getting touchpad information..." -touchpad-info > logs/touchpad.log 2> logs/touchpad.err.log -update_result "Touchpad information" logs/touchpad.err.log -printf '######################################## |\r' - -# echo "Getting DIMMs information..." -decode-dimms > logs/decode-dimms.log 2> logs/decode-dimms.err.log -update_result "DIMMs information" logs/decode-dimms.err.log -printf '########################################## |\r' - -# echo "Getting CBMEM table..." -cbmem > logs/cbmem.log 2> logs/cbmem.err.log -update_result "CBMEM table information" logs/cbmem.err.log -printf '############################################ |\r' - -# echo "Getting TPM information..." -find `realpath /sys/class/tpm/tpm*` -type f -print -exec cat {} \; > logs/tpm_version.log 2> logs/tpm_version.err.log -update_result "TPM information" logs/tpm_version.err.log -printf '############################################# |\r' - -# echo "Checking AMT..." -mei-amt-check > logs/amt-check.log 2> logs/amt-check.err.log -update_result "AMT information" logs/amt-check.err.log -printf '############################################### |\r' - -# echo "Checking ME..." -intelmetool -m > logs/intelmetool.log 2> logs/intelmetool.err.log -update_result "ME information" logs/intelmetool.err.log -printf '################################################ |\r' - -printf '################################################## |\r' -printf '#################################################### |\r' -printf '###################################################### |\r' -printf '######################################################## |\r' -printf '########################################################## |\r' -printf '############################################################ |\r' -printf '############################################################## |\r' -printf '################################################################ |\r' -printf '################################################################## |\r' -printf '###################################################################|\r' -# next two echo cmds helps with printing -echo -echo - -echo "Results of getting data:" >> result -echo -e "\nLegend:" >> result -echo -e [$GREEN"OK"$COLOR_OFF]"\t\t Data get successfully" >> result -echo -e [$YELLOW"UNKNOWN"$COLOR_OFF]"\t Result is unknown" >> result -echo -e [$RED"ERROR"$COLOR_OFF]"\t\t Error during getting data\n" >> result - -mv result logs/result -if [ $DEPLOY_REPORT = "false" ]; then - cat logs/result -fi - -# Create name for generated report -filename="$(dmidecode -s system-manufacturer)" -filename+=" $(dmidecode -s system-product-name)" -filename+=" $(dmidecode -s bios-version)" - -# MAC address of device that is used to connect the internet -# it could return none only when there is no internet connection but -# in those cases report will be stored locally only -uuid_string=`cat /sys/class/net/$(ip route show default | head -1 | awk '/default/ {print $5}')/address` -# next two values are hardware related so they will be always the same -uuid_string+="_$(dmidecode -s system-product-name)" -uuid_string+="_$(dmidecode -s system-manufacturer)" - -# using values from above should generate the same uuid all the time if only -# the MAC address will not change -uuid=`uuidgen -n @x500 -N $uuid_string -s` - -filename+="_$uuid" -filename+="_$(date +'%Y_%m_%d_%H_%M_%S_%N')" -filename="${filename// /_}" -filename="${filename//\//_}" - -if [ $DEPLOY_REPORT = "false" ]; then - echo "Creating archive with logs..." -fi - -# remove MAC address from logs as sensitive data -MAC_ADDR=`cat /sys/class/net/$(ip route show default | head -1 | awk '/default/ {print $5}')/address` -grep -rl "${MAC_ADDR}" logs > /dev/null && grep -rl "${MAC_ADDR}" logs | xargs sed -i 's/'${MAC_ADDR}'/MAC ADDRESS REMOVED/g' -tar -zcf "$filename.tar.gz" logs/* -rm -rf logs - -if [ $DEPLOY_REPORT = "false" ]; then - echo "Done! Logs saved to: $(readlink -f $filename.tar.gz)" -fi - -if [ "$SEND_LOGS" = "true" ]; then - if [ $DEPLOY_REPORT = "false" ]; then - echo "Sending logs to 3mdeb cloud..." - CLOUDSEND_OPTS="-e" - else - CLOUDSEND_OPTS="-e -q" - fi - cloudsend.sh \ - ${CLOUDSEND_OPTS} \ - $(readlink -f $filename.tar.gz) \ - ${FULL_UPLOAD_URL} - if [ "$?" -ne "0" ]; then - echo "Failed to send logs to the cloud" - if [ -a "${CMD_DASHARO_DEPLOY}" ]; then - echo -e "Something may be wrong with credentials. Please use option 4 to change DES keys - \rand make sure that there is no typo." - fi - exit 1 - fi - if [ $DEPLOY_REPORT = "false" ]; then - echo "Thank you for supporting Dasharo!" - fi -fi - -echo -e \ -"-----------------------------------------------------------------------------\r -Would you like to contribute to the \"Hardware for Linux\" project?\r -it is an open source project that that anonymously collects hardware details\r -of Linux-powered computers over the world and helps people to collaboratively\r -debug hardware related issues, check for Linux-compatibility and find drivers.\r ------------------------------------------------------------------------------\r -You can find more about it here:\r -https://linux-hardware.org/\r -https://github.com/linuxhw/hw-probe\r ------------------------------------------------------------------------------\r -Do you want to participate in this project?\r -(if you answer \"yes\", then command hw-probe --all --upload will be ran, in \r -order to participate)\r -" - -read -p "[N/y] " -case ${REPLY} in - yes|y|Y|Yes|YES) - /usr/bin/hw-probe -all -upload - if [ $? -eq 0 ]; then - echo "Thank you for contributing to the \"Hardware for Linux\" project!" - else - echo "couldn't probe/upload. Check your internet connection..." - exit 1 - fi - ;; - *) - echo -e \ - "Please consider contributing to the \"Hardware for Linux\" project in the future.\r - All you have to do is run this command:\r - hw-probe --all --upload\r - " - ;; -esac diff --git a/meta-dts-distro/recipes-dts/reports/touchpad-info.bb b/meta-dts-distro/recipes-dts/reports/touchpad-info.bb deleted file mode 100644 index fe473f8e..00000000 --- a/meta-dts-distro/recipes-dts/reports/touchpad-info.bb +++ /dev/null @@ -1,23 +0,0 @@ -SUMMARY = "Touchpad info script" -DESCRIPTION = "Gets information on the touchpad devices. Currently supports only Clevo devices" -SECTION = "tools" -HOMEPAGE = "https://github.com/3mdeb/fwdump-docker/blob/touchpad_info/scripts/get_touchpad_info.sh" - -LICENSE = "MIT" - -LIC_FILES_CHKSUM = "file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420" - -SRC_URI = "file://touchpad-info" - -S = "${WORKDIR}" - -RDEPENDS:${PN} = " \ - bash \ - i2c-tools \ - acpi-call-dkms \ -" - -do_install () { - install -d ${D}/${sbindir} - install -m 0755 ${S}/touchpad-info ${D}/${sbindir} -} diff --git a/meta-dts-distro/recipes-dts/reports/touchpad-info/touchpad-info b/meta-dts-distro/recipes-dts/reports/touchpad-info/touchpad-info deleted file mode 100644 index 5186fe3f..00000000 --- a/meta-dts-distro/recipes-dts/reports/touchpad-info/touchpad-info +++ /dev/null @@ -1,42 +0,0 @@ -#!/usr/bin/env bash -# A script to dump info about the touchpad - -if ! dmesg | grep hid-multitouch | grep "I2C HID" > /dev/null; then - echo "No I2C touchpads detected. Exiting" - exit 2 -fi - -devname=$(dmesg | grep hid-multitouch | awk 'NF>1{print $NF}') -hid=$(cat "/sys/bus/i2c/devices/$devname/firmware_node/hid") -path=$(cat "/sys/bus/i2c/devices/$devname/firmware_node/path") - -ACPI_CALL_PATH="/proc/acpi/call" - -if [ ! -f "$ACPI_CALL_PATH" ]; then - echo "File ${ACPI_CALL_PATH} doesn\'t exist. Exiting" - exit 3 -fi - -echo "$path._DSM bF7F6DF3C67425545AD05B30A3D8938DE 1 1" > ${ACPI_CALL_PATH} -descriptor_offset=$(tr -d '\0' < ${ACPI_CALL_PATH} | cut -d 'c' -f 1) - -i2c_row=$(i2cdetect -y -r 0 | grep UU) -i2c_col=0 -for x in $i2c_row -do - if [ "$x" = 'UU' ]; then - break; - fi - i2c_col=$(($i2c_col + 1)) -done - -i2c_addr=$(echo "$i2c_row" | cut -d ":" -f 1) -i2c_col=$(printf '%s\n' $(($i2c_col - 1))) -i2c_addr=$(printf '%s\n' $(($i2c_addr + $i2c_col))) - -echo "Found touchpad at: $path:" -echo -echo "HID: $hid" -echo "I2C address: 0x$i2c_addr" -echo "Descriptor address: $descriptor_offset" -echo From 4cee3dd5003f2768468b4a2029bb2b47d714bf4a Mon Sep 17 00:00:00 2001 From: Daniil Klimuk Date: Tue, 9 Apr 2024 12:38:33 +0200 Subject: [PATCH 16/99] distro: recipes-dts: dts-scripts: do_install via Makefile Signed-off-by: Daniil Klimuk --- .../dts-scripts/dts-scripts_git.bb | 21 +++++-------------- 1 file changed, 5 insertions(+), 16 deletions(-) diff --git a/meta-dts-distro/recipes-dts/dts-scripts/dts-scripts_git.bb b/meta-dts-distro/recipes-dts/dts-scripts/dts-scripts_git.bb index eef78397..1b759e22 100644 --- a/meta-dts-distro/recipes-dts/dts-scripts/dts-scripts_git.bb +++ b/meta-dts-distro/recipes-dts/dts-scripts/dts-scripts_git.bb @@ -5,7 +5,7 @@ HOMEPAGE = "https://github.com/Dasharo/dts-v2" LICENSE = "MIT" LIC_FILES_CHKSUM = "file://LICENSE;md5=575ab8837c52eafc7b9eb8b244072bc7" -SRCREV = "13dad8ea6901cf921de0dd45d464bea3535892e0" +SRCREV = "c57dc8c60d73ccd0f540148e46be73221ecc67bb" SRC_URI = "git://github.com/Dasharo/dts-v2;protocol=https;branch=main" PV = "0.1+git${SRCPV}" @@ -25,20 +25,9 @@ RDEPENDS:${PN} = " \ iotools \ " -do_install () { - install -d ${D}/${sbindir} - install -m 0755 ${S}/scripts/dts ${D}/${sbindir} - install -m 0755 ${S}/scripts/dts-boot ${D}/${sbindir} - install -m 0755 ${S}/scripts/ec_transition ${D}/${sbindir} - install -m 0755 ${S}/scripts/cloud_list ${D}/${sbindir} - install -m 0755 ${S}/scripts/dasharo-deploy ${D}/${sbindir} - install -m 0755 ${S}/reports/dasharo-hcl-report ${D}/${sbindir} - install -m 0755 ${S}/reports/touchpad-info ${D}/${sbindir} - install -m 0664 ${S}/include/dts-environment.sh ${D}/${sbindir} - install -m 0664 ${S}/include/dts-functions.sh ${D}/${sbindir} +do_configure[noexec] = "1" +do_compile[noexec] = "1" - # install profile dropin so the DTS_ENV and DTS_FUNCS variables are set when - # loged via SSH - install -d ${D}${sysconfdir}/profile.d/ - install -m 0755 ${S}/scripts/dts-profile.sh ${D}${sysconfdir}/profile.d/ +do_install () { + oe_runmake install DESTDIR="${D}" } From c8b709150baa11f0f5b749f36be4def110654ba7 Mon Sep 17 00:00:00 2001 From: Maciej Pijanowski Date: Wed, 10 Apr 2024 11:26:03 +0200 Subject: [PATCH 17/99] dts-scripts_git.bb: relicense to Apache-2.0 Signed-off-by: Maciej Pijanowski --- .../recipes-dts/dts-scripts/dts-scripts_git.bb | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/meta-dts-distro/recipes-dts/dts-scripts/dts-scripts_git.bb b/meta-dts-distro/recipes-dts/dts-scripts/dts-scripts_git.bb index 1b759e22..86f4ee04 100644 --- a/meta-dts-distro/recipes-dts/dts-scripts/dts-scripts_git.bb +++ b/meta-dts-distro/recipes-dts/dts-scripts/dts-scripts_git.bb @@ -1,12 +1,12 @@ SUMMARY = "Dasharo Tools Suite scripts." SECTION = "tools" -HOMEPAGE = "https://github.com/Dasharo/dts-v2" +HOMEPAGE = "https://github.com/Dasharo/dts-scripts" -LICENSE = "MIT" -LIC_FILES_CHKSUM = "file://LICENSE;md5=575ab8837c52eafc7b9eb8b244072bc7" +LICENSE = "Apache-2.0" +LIC_FILES_CHKSUM = "file://LICENSES/Apache-2.0.txt;md5=c846ebb396f8b174b10ded4771514fcc " -SRCREV = "c57dc8c60d73ccd0f540148e46be73221ecc67bb" -SRC_URI = "git://github.com/Dasharo/dts-v2;protocol=https;branch=main" +SRCREV = "3870e7b944d88d68821d7cdd83d70d6959348ed8" +SRC_URI = "git://github.com/Dasharo/dts-scripts;protocol=https;branch=main" PV = "0.1+git${SRCPV}" From 7672292295d4719249e81ae3c121b15c1e4f8e1e Mon Sep 17 00:00:00 2001 From: Daniil Klimuk Date: Tue, 16 Apr 2024 09:22:31 +0200 Subject: [PATCH 18/99] distro: dts-scripts: bump revision Signed-off-by: Daniil Klimuk --- meta-dts-distro/recipes-dts/dts-scripts/dts-scripts_git.bb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/meta-dts-distro/recipes-dts/dts-scripts/dts-scripts_git.bb b/meta-dts-distro/recipes-dts/dts-scripts/dts-scripts_git.bb index 86f4ee04..ebaef7c8 100644 --- a/meta-dts-distro/recipes-dts/dts-scripts/dts-scripts_git.bb +++ b/meta-dts-distro/recipes-dts/dts-scripts/dts-scripts_git.bb @@ -5,7 +5,7 @@ HOMEPAGE = "https://github.com/Dasharo/dts-scripts" LICENSE = "Apache-2.0" LIC_FILES_CHKSUM = "file://LICENSES/Apache-2.0.txt;md5=c846ebb396f8b174b10ded4771514fcc " -SRCREV = "3870e7b944d88d68821d7cdd83d70d6959348ed8" +SRCREV = "6718d85302bf0422dbc969c816e78394044ac744" SRC_URI = "git://github.com/Dasharo/dts-scripts;protocol=https;branch=main" PV = "0.1+git${SRCPV}" From 2be55791aaaa3271803bddfb293956addd21c8a1 Mon Sep 17 00:00:00 2001 From: Daniil Klimuk Date: Wed, 22 May 2024 14:05:23 +0200 Subject: [PATCH 19/99] distro: support: hidapi: delete This recipe was not used in the builds, instead recipe from meta-openembedded is being used. Surplus metadata should be deleted. Refs: https://github.com/Dasharo/dasharo-issues/issues/770 https://github.com/Dasharo/dasharo-issues/issues/769 Signed-off-by: Daniil Klimuk --- .../recipes-support/hidapi/hidapi_1.4.1.bb | 21 ------------------- 1 file changed, 21 deletions(-) delete mode 100644 meta-dts-distro/recipes-support/hidapi/hidapi_1.4.1.bb diff --git a/meta-dts-distro/recipes-support/hidapi/hidapi_1.4.1.bb b/meta-dts-distro/recipes-support/hidapi/hidapi_1.4.1.bb deleted file mode 100644 index db9a861a..00000000 --- a/meta-dts-distro/recipes-support/hidapi/hidapi_1.4.1.bb +++ /dev/null @@ -1,21 +0,0 @@ -inherit cargo - -SRC_URI += "gitsm://git@github.com/ruabmbua/hidapi-rs.git;protocol=ssh;nobranch=1" -SRCREV = "f39c5e17a50ada9f8b631dbbc2c4d262553e5602" -S = "${WORKDIR}/git" -CARGO_SRC_DIR = "" -PV:append = ".AUTOINC+f39c5e17a5" - -SRC_URI += " \ - crate://crates.io/cc/1.0.73 \ - crate://crates.io/libc/0.2.132 \ - crate://crates.io/pkg-config/0.3.25 \ -" - -LIC_FILES_CHKSUM = " \ - file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420 \ -" - -SUMMARY = "Rust-y wrapper around hidapi" -HOMEPAGE = "https://github.com/ruabmbua/hidapi-rs" -LICENSE = "MIT" From 514c5638dd8be883a6947cd74869dceb7bdbb766 Mon Sep 17 00:00:00 2001 From: Daniil Klimuk Date: Wed, 22 May 2024 14:41:06 +0200 Subject: [PATCH 20/99] distro: kernel: acpi-call-dkms: change license to GPLv3 This package provides license statement in README.md, but Yocto needs it to be a separate file. Refs: https://github.com/nix-community/acpi_call/blob/fe9dc95a83a95e4826c1a7c809d41c2f16de40a6/README.md?plain=1#L68 Signed-off-by: Daniil Klimuk --- .../kernel/acpi-call-dkms_git.bb | 8 +- .../files/0001-GPLv3-licence-file-added.patch | 28 ++ .../0001-LGPLv2-licence-file-added.patch | 359 ------------------ 3 files changed, 31 insertions(+), 364 deletions(-) create mode 100644 meta-dts-distro/recipes-kernel/kernel/files/0001-GPLv3-licence-file-added.patch delete mode 100644 meta-dts-distro/recipes-kernel/kernel/files/0001-LGPLv2-licence-file-added.patch diff --git a/meta-dts-distro/recipes-kernel/kernel/acpi-call-dkms_git.bb b/meta-dts-distro/recipes-kernel/kernel/acpi-call-dkms_git.bb index 9f4ec722..d920008a 100644 --- a/meta-dts-distro/recipes-kernel/kernel/acpi-call-dkms_git.bb +++ b/meta-dts-distro/recipes-kernel/kernel/acpi-call-dkms_git.bb @@ -1,16 +1,14 @@ SUMMARY = "A kernel simple module that enables you to call ACPI methods by writing the method name followed by arguments to /proc/acpi/call." DESCRIPTION = "${SUMMARY}" -LICENSE = "CLOSED" - -LICENSE = "LGPLv2 | LGPLv2.1" -LIC_FILES_CHKSUM = "file://COPYING;md5=751419260aa954499f7abaabaa882bbe" +LICENSE = "GPL-3.0-only" +LIC_FILES_CHKSUM = "file://LICENSE;md5=025e46592215127e8c98b397ff29a037" inherit module SRC_URI = "git://github.com/nix-community/acpi_call.git;branch=master;protocol=https \ file://0001-Makefile-fixing-build-errrors.patch \ - file://0001-LGPLv2-licence-file-added.patch \ + file://0001-GPLv3-licence-file-added.patch \ " SRCREV = "fe9dc95a83a95e4826c1a7c809d41c2f16de40a6" diff --git a/meta-dts-distro/recipes-kernel/kernel/files/0001-GPLv3-licence-file-added.patch b/meta-dts-distro/recipes-kernel/kernel/files/0001-GPLv3-licence-file-added.patch new file mode 100644 index 00000000..33743afc --- /dev/null +++ b/meta-dts-distro/recipes-kernel/kernel/files/0001-GPLv3-licence-file-added.patch @@ -0,0 +1,28 @@ +Author: Daniil Klimuk +Date: Wed May 22 14:35:18 2024 +0200 + + LICENSE: add GPLv3 license + + This repo specifies license in README.md file, but Yocto needs license + to be provided as a separate file. This statement was exctracted + from the README file. + + Signed-off-by: Daniil Klimuk + +diff --git a/LICENSE b/LICENSE +new file mode 100644 +index 000000000000..6e4fe59cdcba +--- /dev/null ++++ b/LICENSE +@@ -0,0 +1,11 @@ ++Copyright (c) 2010: Michal Kottman ++ ++This program is free software: you can redistribute it and/or modify ++it under the terms of the GNU General Public License as published by ++the Free Software Foundation, either version 3 of the License, or ++(at your option) any later version. ++ ++This program is distributed in the hope that it will be useful, ++but WITHOUT ANY WARRANTY; without even the implied warranty of ++MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++GNU General Public License for more details. diff --git a/meta-dts-distro/recipes-kernel/kernel/files/0001-LGPLv2-licence-file-added.patch b/meta-dts-distro/recipes-kernel/kernel/files/0001-LGPLv2-licence-file-added.patch deleted file mode 100644 index cbd46a40..00000000 --- a/meta-dts-distro/recipes-kernel/kernel/files/0001-LGPLv2-licence-file-added.patch +++ /dev/null @@ -1,359 +0,0 @@ -From c0bed7aa920dc81ba39b9c04cd21c9a24c7d66e8 Mon Sep 17 00:00:00 2001 -From: Kas User -Date: Mon, 16 May 2022 11:15:37 +0000 -Subject: [PATCH] LGPLv2 licence file added - -Signed-off-by: Kas User ---- - COPYING | 339 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ - 1 file changed, 339 insertions(+) - create mode 100644 COPYING - -diff --git a/COPYING b/COPYING -new file mode 100644 -index 0000000..d511905 ---- /dev/null -+++ b/COPYING -@@ -0,0 +1,339 @@ -+ GNU GENERAL PUBLIC LICENSE -+ Version 2, June 1991 -+ -+ Copyright (C) 1989, 1991 Free Software Foundation, Inc., -+ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA -+ Everyone is permitted to copy and distribute verbatim copies -+ of this license document, but changing it is not allowed. -+ -+ Preamble -+ -+ The licenses for most software are designed to take away your -+freedom to share and change it. By contrast, the GNU General Public -+License is intended to guarantee your freedom to share and change free -+software--to make sure the software is free for all its users. This -+General Public License applies to most of the Free Software -+Foundation's software and to any other program whose authors commit to -+using it. (Some other Free Software Foundation software is covered by -+the GNU Lesser General Public License instead.) You can apply it to -+your programs, too. -+ -+ When we speak of free software, we are referring to freedom, not -+price. Our General Public Licenses are designed to make sure that you -+have the freedom to distribute copies of free software (and charge for -+this service if you wish), that you receive source code or can get it -+if you want it, that you can change the software or use pieces of it -+in new free programs; and that you know you can do these things. -+ -+ To protect your rights, we need to make restrictions that forbid -+anyone to deny you these rights or to ask you to surrender the rights. -+These restrictions translate to certain responsibilities for you if you -+distribute copies of the software, or if you modify it. -+ -+ For example, if you distribute copies of such a program, whether -+gratis or for a fee, you must give the recipients all the rights that -+you have. You must make sure that they, too, receive or can get the -+source code. And you must show them these terms so they know their -+rights. -+ -+ We protect your rights with two steps: (1) copyright the software, and -+(2) offer you this license which gives you legal permission to copy, -+distribute and/or modify the software. -+ -+ Also, for each author's protection and ours, we want to make certain -+that everyone understands that there is no warranty for this free -+software. If the software is modified by someone else and passed on, we -+want its recipients to know that what they have is not the original, so -+that any problems introduced by others will not reflect on the original -+authors' reputations. -+ -+ Finally, any free program is threatened constantly by software -+patents. We wish to avoid the danger that redistributors of a free -+program will individually obtain patent licenses, in effect making the -+program proprietary. To prevent this, we have made it clear that any -+patent must be licensed for everyone's free use or not licensed at all. -+ -+ The precise terms and conditions for copying, distribution and -+modification follow. -+ -+ GNU GENERAL PUBLIC LICENSE -+ TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION -+ -+ 0. This License applies to any program or other work which contains -+a notice placed by the copyright holder saying it may be distributed -+under the terms of this General Public License. The "Program", below, -+refers to any such program or work, and a "work based on the Program" -+means either the Program or any derivative work under copyright law: -+that is to say, a work containing the Program or a portion of it, -+either verbatim or with modifications and/or translated into another -+language. (Hereinafter, translation is included without limitation in -+the term "modification".) Each licensee is addressed as "you". -+ -+Activities other than copying, distribution and modification are not -+covered by this License; they are outside its scope. The act of -+running the Program is not restricted, and the output from the Program -+is covered only if its contents constitute a work based on the -+Program (independent of having been made by running the Program). -+Whether that is true depends on what the Program does. -+ -+ 1. You may copy and distribute verbatim copies of the Program's -+source code as you receive it, in any medium, provided that you -+conspicuously and appropriately publish on each copy an appropriate -+copyright notice and disclaimer of warranty; keep intact all the -+notices that refer to this License and to the absence of any warranty; -+and give any other recipients of the Program a copy of this License -+along with the Program. -+ -+You may charge a fee for the physical act of transferring a copy, and -+you may at your option offer warranty protection in exchange for a fee. -+ -+ 2. You may modify your copy or copies of the Program or any portion -+of it, thus forming a work based on the Program, and copy and -+distribute such modifications or work under the terms of Section 1 -+above, provided that you also meet all of these conditions: -+ -+ a) You must cause the modified files to carry prominent notices -+ stating that you changed the files and the date of any change. -+ -+ b) You must cause any work that you distribute or publish, that in -+ whole or in part contains or is derived from the Program or any -+ part thereof, to be licensed as a whole at no charge to all third -+ parties under the terms of this License. -+ -+ c) If the modified program normally reads commands interactively -+ when run, you must cause it, when started running for such -+ interactive use in the most ordinary way, to print or display an -+ announcement including an appropriate copyright notice and a -+ notice that there is no warranty (or else, saying that you provide -+ a warranty) and that users may redistribute the program under -+ these conditions, and telling the user how to view a copy of this -+ License. (Exception: if the Program itself is interactive but -+ does not normally print such an announcement, your work based on -+ the Program is not required to print an announcement.) -+ -+These requirements apply to the modified work as a whole. If -+identifiable sections of that work are not derived from the Program, -+and can be reasonably considered independent and separate works in -+themselves, then this License, and its terms, do not apply to those -+sections when you distribute them as separate works. But when you -+distribute the same sections as part of a whole which is a work based -+on the Program, the distribution of the whole must be on the terms of -+this License, whose permissions for other licensees extend to the -+entire whole, and thus to each and every part regardless of who wrote it. -+ -+Thus, it is not the intent of this section to claim rights or contest -+your rights to work written entirely by you; rather, the intent is to -+exercise the right to control the distribution of derivative or -+collective works based on the Program. -+ -+In addition, mere aggregation of another work not based on the Program -+with the Program (or with a work based on the Program) on a volume of -+a storage or distribution medium does not bring the other work under -+the scope of this License. -+ -+ 3. You may copy and distribute the Program (or a work based on it, -+under Section 2) in object code or executable form under the terms of -+Sections 1 and 2 above provided that you also do one of the following: -+ -+ a) Accompany it with the complete corresponding machine-readable -+ source code, which must be distributed under the terms of Sections -+ 1 and 2 above on a medium customarily used for software interchange; or, -+ -+ b) Accompany it with a written offer, valid for at least three -+ years, to give any third party, for a charge no more than your -+ cost of physically performing source distribution, a complete -+ machine-readable copy of the corresponding source code, to be -+ distributed under the terms of Sections 1 and 2 above on a medium -+ customarily used for software interchange; or, -+ -+ c) Accompany it with the information you received as to the offer -+ to distribute corresponding source code. (This alternative is -+ allowed only for noncommercial distribution and only if you -+ received the program in object code or executable form with such -+ an offer, in accord with Subsection b above.) -+ -+The source code for a work means the preferred form of the work for -+making modifications to it. For an executable work, complete source -+code means all the source code for all modules it contains, plus any -+associated interface definition files, plus the scripts used to -+control compilation and installation of the executable. However, as a -+special exception, the source code distributed need not include -+anything that is normally distributed (in either source or binary -+form) with the major components (compiler, kernel, and so on) of the -+operating system on which the executable runs, unless that component -+itself accompanies the executable. -+ -+If distribution of executable or object code is made by offering -+access to copy from a designated place, then offering equivalent -+access to copy the source code from the same place counts as -+distribution of the source code, even though third parties are not -+compelled to copy the source along with the object code. -+ -+ 4. You may not copy, modify, sublicense, or distribute the Program -+except as expressly provided under this License. Any attempt -+otherwise to copy, modify, sublicense or distribute the Program is -+void, and will automatically terminate your rights under this License. -+However, parties who have received copies, or rights, from you under -+this License will not have their licenses terminated so long as such -+parties remain in full compliance. -+ -+ 5. You are not required to accept this License, since you have not -+signed it. However, nothing else grants you permission to modify or -+distribute the Program or its derivative works. These actions are -+prohibited by law if you do not accept this License. Therefore, by -+modifying or distributing the Program (or any work based on the -+Program), you indicate your acceptance of this License to do so, and -+all its terms and conditions for copying, distributing or modifying -+the Program or works based on it. -+ -+ 6. Each time you redistribute the Program (or any work based on the -+Program), the recipient automatically receives a license from the -+original licensor to copy, distribute or modify the Program subject to -+these terms and conditions. You may not impose any further -+restrictions on the recipients' exercise of the rights granted herein. -+You are not responsible for enforcing compliance by third parties to -+this License. -+ -+ 7. If, as a consequence of a court judgment or allegation of patent -+infringement or for any other reason (not limited to patent issues), -+conditions are imposed on you (whether by court order, agreement or -+otherwise) that contradict the conditions of this License, they do not -+excuse you from the conditions of this License. If you cannot -+distribute so as to satisfy simultaneously your obligations under this -+License and any other pertinent obligations, then as a consequence you -+may not distribute the Program at all. For example, if a patent -+license would not permit royalty-free redistribution of the Program by -+all those who receive copies directly or indirectly through you, then -+the only way you could satisfy both it and this License would be to -+refrain entirely from distribution of the Program. -+ -+If any portion of this section is held invalid or unenforceable under -+any particular circumstance, the balance of the section is intended to -+apply and the section as a whole is intended to apply in other -+circumstances. -+ -+It is not the purpose of this section to induce you to infringe any -+patents or other property right claims or to contest validity of any -+such claims; this section has the sole purpose of protecting the -+integrity of the free software distribution system, which is -+implemented by public license practices. Many people have made -+generous contributions to the wide range of software distributed -+through that system in reliance on consistent application of that -+system; it is up to the author/donor to decide if he or she is willing -+to distribute software through any other system and a licensee cannot -+impose that choice. -+ -+This section is intended to make thoroughly clear what is believed to -+be a consequence of the rest of this License. -+ -+ 8. If the distribution and/or use of the Program is restricted in -+certain countries either by patents or by copyrighted interfaces, the -+original copyright holder who places the Program under this License -+may add an explicit geographical distribution limitation excluding -+those countries, so that distribution is permitted only in or among -+countries not thus excluded. In such case, this License incorporates -+the limitation as if written in the body of this License. -+ -+ 9. The Free Software Foundation may publish revised and/or new versions -+of the General Public License from time to time. Such new versions will -+be similar in spirit to the present version, but may differ in detail to -+address new problems or concerns. -+ -+Each version is given a distinguishing version number. If the Program -+specifies a version number of this License which applies to it and "any -+later version", you have the option of following the terms and conditions -+either of that version or of any later version published by the Free -+Software Foundation. If the Program does not specify a version number of -+this License, you may choose any version ever published by the Free Software -+Foundation. -+ -+ 10. If you wish to incorporate parts of the Program into other free -+programs whose distribution conditions are different, write to the author -+to ask for permission. For software which is copyrighted by the Free -+Software Foundation, write to the Free Software Foundation; we sometimes -+make exceptions for this. Our decision will be guided by the two goals -+of preserving the free status of all derivatives of our free software and -+of promoting the sharing and reuse of software generally. -+ -+ NO WARRANTY -+ -+ 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY -+FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN -+OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES -+PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED -+OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF -+MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS -+TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE -+PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, -+REPAIR OR CORRECTION. -+ -+ 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING -+WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR -+REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, -+INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING -+OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED -+TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY -+YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER -+PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE -+POSSIBILITY OF SUCH DAMAGES. -+ -+ END OF TERMS AND CONDITIONS -+ -+ How to Apply These Terms to Your New Programs -+ -+ If you develop a new program, and you want it to be of the greatest -+possible use to the public, the best way to achieve this is to make it -+free software which everyone can redistribute and change under these terms. -+ -+ To do so, attach the following notices to the program. It is safest -+to attach them to the start of each source file to most effectively -+convey the exclusion of warranty; and each file should have at least -+the "copyright" line and a pointer to where the full notice is found. -+ -+ -+ Copyright (C) -+ -+ This program is free software; you can redistribute it and/or modify -+ it under the terms of the GNU General Public License as published by -+ the Free Software Foundation; either version 2 of the License, or -+ (at your option) any later version. -+ -+ This program is distributed in the hope that it will be useful, -+ but WITHOUT ANY WARRANTY; without even the implied warranty of -+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ GNU General Public License for more details. -+ -+ You should have received a copy of the GNU General Public License along -+ with this program; if not, write to the Free Software Foundation, Inc., -+ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. -+ -+Also add information on how to contact you by electronic and paper mail. -+ -+If the program is interactive, make it output a short notice like this -+when it starts in an interactive mode: -+ -+ Gnomovision version 69, Copyright (C) year name of author -+ Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. -+ This is free software, and you are welcome to redistribute it -+ under certain conditions; type `show c' for details. -+ -+The hypothetical commands `show w' and `show c' should show the appropriate -+parts of the General Public License. Of course, the commands you use may -+be called something other than `show w' and `show c'; they could even be -+mouse-clicks or menu items--whatever suits your program. -+ -+You should also get your employer (if you work as a programmer) or your -+school, if any, to sign a "copyright disclaimer" for the program, if -+necessary. Here is a sample; alter the names: -+ -+ Yoyodyne, Inc., hereby disclaims all copyright interest in the program -+ `Gnomovision' (which makes passes at compilers) written by James Hacker. -+ -+ , 1 April 1989 -+ Ty Coon, President of Vice -+ -+This General Public License does not permit incorporating your program into -+proprietary programs. If your program is a subroutine library, you may -+consider it more useful to permit linking proprietary applications with the -+library. If this is what you want to do, use the GNU Lesser General -+Public License instead of this License. --- -2.20.1 - From 5f4ff7c04f87b08582a3a68d6ccf21f7536f20ce Mon Sep 17 00:00:00 2001 From: Maciej Pijanowski Date: Tue, 14 May 2024 21:58:12 +0200 Subject: [PATCH 21/99] update layers to scarthgap Signed-off-by: Maciej Pijanowski --- kas/common.yml | 6 +++--- meta-dts-distro/conf/layer.conf | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/kas/common.yml b/kas/common.yml index 44c1cbcd..7895d4a0 100644 --- a/kas/common.yml +++ b/kas/common.yml @@ -8,7 +8,7 @@ repos: poky: url: https://git.yoctoproject.org/git/poky - refspec: 00c04394cbc5ecaced7cc1bc8bc8787e621f987d + refspec: d71d1c02ff622e00d6fa5ca9ce44a4e567691dce layers: meta: meta-poky: @@ -16,7 +16,7 @@ repos: meta-openembedded: url: https://git.openembedded.org/meta-openembedded - refspec: 0b78362654262145415df8211052442823b9ec9b + refspec: a72010b414ee3d73888ac9cb4e310e8f05e13aea layers: meta-oe: meta-networking: @@ -24,7 +24,7 @@ repos: meta-security: url: https://git.yoctoproject.org/git/meta-security - refspec: c79262a30bd385f5dbb009ef8704a1a01644528e + refspec: 11ea91192d43d7c2b0b95a93aa63ca7e73e38034 layers: meta-tpm: diff --git a/meta-dts-distro/conf/layer.conf b/meta-dts-distro/conf/layer.conf index c597c0be..a9424ab2 100644 --- a/meta-dts-distro/conf/layer.conf +++ b/meta-dts-distro/conf/layer.conf @@ -17,4 +17,4 @@ LAYERDEPENDS_dts-distro = " \ openembedded-layer \ " -LAYERSERIES_COMPAT_dts-distro = "honister kirkstone master" +LAYERSERIES_COMPAT_dts-distro = "scarthgap master" From 95a9d9c2ce9e09b7c256e1d3e3e71970f44b08af Mon Sep 17 00:00:00 2001 From: Maciej Pijanowski Date: Tue, 14 May 2024 21:58:42 +0200 Subject: [PATCH 22/99] dts-distro.conf: add usrmerge to DISTRO_FEATURES Signed-off-by: Maciej Pijanowski --- meta-dts-distro/conf/distro/dts-distro.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/meta-dts-distro/conf/distro/dts-distro.conf b/meta-dts-distro/conf/distro/dts-distro.conf index 709120df..7cbc3868 100644 --- a/meta-dts-distro/conf/distro/dts-distro.conf +++ b/meta-dts-distro/conf/distro/dts-distro.conf @@ -14,7 +14,7 @@ TARGET_VENDOR = "-dts" # distro features # DISTRO_FEATURES_DEFAULT ?= "acl alsa argp bluetooth ext2 ipv4 ipv6 largefile pcmcia usbgadget usbhost wifi xattr nfs zeroconf pci 3g nfc x11 vfat" # POKY_DEFAULT_DISTRO_FEATURES = "largefile opengl ptest multiarch wayland vulkan" -DISTRO_FEATURES = "${DISTRO_FEATURES_DEFAULT} systemd tpm tpm2" +DISTRO_FEATURES = "${DISTRO_FEATURES_DEFAULT} systemd usrmerge tpm tpm2" # explictely use systemd and disable sysvinit completely VIRTUAL-RUNTIME_init_manager = "systemd" From f88836b8554a06264322bf320aedc834c8600aa4 Mon Sep 17 00:00:00 2001 From: Maciej Pijanowski Date: Tue, 14 May 2024 21:59:08 +0200 Subject: [PATCH 23/99] packagegroup-dts.bb: s/bmap-tools/bmaptool Signed-off-by: Maciej Pijanowski --- meta-dts-distro/recipes-dts/packagegroups/packagegroup-dts.bb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/meta-dts-distro/recipes-dts/packagegroups/packagegroup-dts.bb b/meta-dts-distro/recipes-dts/packagegroups/packagegroup-dts.bb index 4a1c18f2..323ae225 100644 --- a/meta-dts-distro/recipes-dts/packagegroups/packagegroup-dts.bb +++ b/meta-dts-distro/recipes-dts/packagegroups/packagegroup-dts.bb @@ -33,7 +33,7 @@ RDEPENDS:${PN}-tests = " \ RDEPENDS:${PN}-tools-base = " \ packagegroup-coreboot-utils \ packagegroup-core-tools-debug \ - bmap-tools \ + bmaptool \ flashrom \ fwupd \ me-cleaner \ From da6331048bc3d72b96a6d7dedfd2677c720a5196 Mon Sep 17 00:00:00 2001 From: Maciej Pijanowski Date: Tue, 14 May 2024 21:59:32 +0200 Subject: [PATCH 24/99] dasharo-ectoo: add sha256sums for cargo deps Signed-off-by: Maciej Pijanowski --- .../dasharo-ectool/dasharo-ectool_0.3.8.bb | 23 +++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/meta-dts-distro/recipes-support/dasharo-ectool/dasharo-ectool_0.3.8.bb b/meta-dts-distro/recipes-support/dasharo-ectool/dasharo-ectool_0.3.8.bb index 07b35360..725cd618 100644 --- a/meta-dts-distro/recipes-support/dasharo-ectool/dasharo-ectool_0.3.8.bb +++ b/meta-dts-distro/recipes-support/dasharo-ectool/dasharo-ectool_0.3.8.bb @@ -32,6 +32,29 @@ SRC_URI += " \ crate://crates.io/winapi/0.3.9 \ " +SRC_URI[atty-0.2.14.sha256sum] = "d9b39be18770d11421cdb1b9947a45dd3f37e93092cbf377614828a319d5fee8" +SRC_URI[autocfg-1.1.0.sha256sum] = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" +SRC_URI[bitflags-1.3.2.sha256sum] = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" +SRC_URI[cc-1.0.79.sha256sum] = "50d30906286121d95be3d479533b458f87493b30a4b5f79a607db8f5d11aa91f" +SRC_URI[clap-3.2.23.sha256sum] = "71655c45cb9845d3270c9d6df84ebe72b4dad3c2ba3f7023ad47c144e4e473a5" +SRC_URI[clap_lex-0.2.4.sha256sum] = "2850f2f5a82cbf437dd5af4d49848fbdfc27c157c3d010345776f952765261c5" +SRC_URI[downcast-rs-1.2.0.sha256sum] = "9ea835d29036a4087793836fa931b08837ad5e957da9e23886b29586fb9b6650" +SRC_URI[hashbrown-0.12.3.sha256sum] = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" +SRC_URI[hermit-abi-0.1.19.sha256sum] = "62b467343b94ba476dcb2500d242dadbb39557df889310ac77c5d99100aaac33" +SRC_URI[hidapi-1.5.0.sha256sum] = "798154e4b6570af74899d71155fb0072d5b17e6aa12f39c8ef22c60fb8ec99e7" +SRC_URI[indexmap-1.9.2.sha256sum] = "1885e79c1fc4b10f0e172c475f458b7f7b93061064d98c3293e98c5ba0c8b399" +SRC_URI[libc-0.2.139.sha256sum] = "201de327520df007757c1f0adce6e827fe8562fbc28bfd9c15571c66ca1f5f79" +SRC_URI[os_str_bytes-6.4.1.sha256sum] = "9b7820b9daea5457c9f21c69448905d723fbd21136ccf521748f23fd49e723ee" +SRC_URI[pkg-config-0.3.26.sha256sum] = "6ac9a59f73473f1b8d852421e59e64809f025994837ef743615c6d0c5b305160" +SRC_URI[redox_hwio-0.1.6.sha256sum] = "8eb516ad341a84372b5b15a5a35cf136ba901a639c8536f521b108253d7fce74" +SRC_URI[strsim-0.10.0.sha256sum] = "73473c0e59e6d5812c5dfe2a064a6444949f089e20eec9a2e5506596494e4623" +SRC_URI[termcolor-1.2.0.sha256sum] = "be55cf8942feac5c765c2c993422806843c9a9a45d4d5c407ad6dd2ea95eb9b6" +SRC_URI[textwrap-0.16.0.sha256sum] = "222a222a5bfe1bba4a77b45ec488a741b3cb8872e5e499451fd7d0129c9c7c3d" +SRC_URI[winapi-i686-pc-windows-gnu-0.4.0.sha256sum] = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" +SRC_URI[winapi-util-0.1.5.sha256sum] = "70ec6ce85bb158151cae5e5c87f95a8e97d2c0c4b001223f33a334e3ce5de178" +SRC_URI[winapi-x86_64-pc-windows-gnu-0.4.0.sha256sum] = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" +SRC_URI[winapi-0.3.9.sha256sum] = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" + DEPENDS += "hidapi" LIC_FILES_CHKSUM = " \ file://tool/LICENSE;md5=af209eac18ec76ed06fb2839a906b1ad \ From 301de10e344205bb51b65879fcd9d3ede4df1765 Mon Sep 17 00:00:00 2001 From: Maciej Pijanowski Date: Mon, 13 May 2024 12:38:06 +0200 Subject: [PATCH 25/99] iotools: allow overriding CC Otherwise, the host gcc was used Signed-off-by: Maciej Pijanowski --- .../0001-Makefile-allow-overriding-CC.patch | 26 +++++++++++++++++++ .../recipes-support/iotools/iotools_git.bb | 5 +++- 2 files changed, 30 insertions(+), 1 deletion(-) create mode 100644 meta-dts-distro/recipes-support/iotools/iotools/0001-Makefile-allow-overriding-CC.patch diff --git a/meta-dts-distro/recipes-support/iotools/iotools/0001-Makefile-allow-overriding-CC.patch b/meta-dts-distro/recipes-support/iotools/iotools/0001-Makefile-allow-overriding-CC.patch new file mode 100644 index 00000000..619d0cc5 --- /dev/null +++ b/meta-dts-distro/recipes-support/iotools/iotools/0001-Makefile-allow-overriding-CC.patch @@ -0,0 +1,26 @@ +From c64770eaa13ccc82181d07b97547a0c1cfb419ab Mon Sep 17 00:00:00 2001 +From: Maciej Pijanowski +Date: Mon, 13 May 2024 12:35:57 +0200 +Subject: [PATCH] Makefile: allow overriding CC + +Signed-off-by: Maciej Pijanowski +--- + Makefile | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/Makefile b/Makefile +index 4cd2f4f142c6..fb3dd41d5dfe 100644 +--- a/Makefile ++++ b/Makefile +@@ -17,7 +17,7 @@ + VER_MAJOR = 1 + VER_MINOR = 6 + +-CC=$(CROSS_COMPILE)gcc ++CC ?= $(CROSS_COMPILE)gcc + + # build options + DEBUG ?= 1 +-- +2.45.0 + diff --git a/meta-dts-distro/recipes-support/iotools/iotools_git.bb b/meta-dts-distro/recipes-support/iotools/iotools_git.bb index 45e198cf..77733377 100644 --- a/meta-dts-distro/recipes-support/iotools/iotools_git.bb +++ b/meta-dts-distro/recipes-support/iotools/iotools_git.bb @@ -3,7 +3,10 @@ DESCRIPTION = "The iotools package provides a set of simple command line tools \ LICENSE = "GPL-2.0-only" LIC_FILES_CHKSUM = "file://COPYING;md5=751419260aa954499f7abaabaa882bbe" -SRC_URI = "git://github.com/adurbin/iotools;protocol=https;branch=master" +SRC_URI = " \ + git://github.com/adurbin/iotools;protocol=https;branch=master \ + file://0001-Makefile-allow-overriding-CC.patch \ + " PV = "1.0+git${SRCPV}" SRCREV = "18949fdc4dedb1da3f51ee83a582b112fb9f2c71" From d7f4fbdd43ca2608e214fcfa5f476812bffdf268 Mon Sep 17 00:00:00 2001 From: Maciej Pijanowski Date: Tue, 14 May 2024 21:53:38 +0200 Subject: [PATCH 26/99] kas/common.yml: enable buildstats class Signed-off-by: Maciej Pijanowski --- kas/common.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/kas/common.yml b/kas/common.yml index 7895d4a0..d71eadda 100644 --- a/kas/common.yml +++ b/kas/common.yml @@ -50,3 +50,5 @@ local_conf_header: HALT,/tmp,10M,1K" skip_linux_firmware: | MACHINE_EXTRA_RRECOMMENDS:remove ="linux-firmware" + build_stats: | + USER_CLASSES += "buildstats" From b85771ebf87503d6820412c8001b9b019a518259 Mon Sep 17 00:00:00 2001 From: Maciej Pijanowski Date: Tue, 14 May 2024 21:54:24 +0200 Subject: [PATCH 27/99] acpi-call-dkms: fix kernel module installation on scarthgap Signed-off-by: Maciej Pijanowski --- .../recipes-kernel/kernel/acpi-call-dkms_git.bb | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/meta-dts-distro/recipes-kernel/kernel/acpi-call-dkms_git.bb b/meta-dts-distro/recipes-kernel/kernel/acpi-call-dkms_git.bb index d920008a..f7a9d973 100644 --- a/meta-dts-distro/recipes-kernel/kernel/acpi-call-dkms_git.bb +++ b/meta-dts-distro/recipes-kernel/kernel/acpi-call-dkms_git.bb @@ -15,14 +15,11 @@ SRCREV = "fe9dc95a83a95e4826c1a7c809d41c2f16de40a6" S = "${WORKDIR}/git" -# The inherit of module.bbclass will automatically name module packages with -# "kernel-module-" prefix as required by the oe-core build environment. - -RPROVIDES:${PN} += "acpi_call" +# On scarthgap, the kernel-module prefix was not added automatically anymore. +# The module was not packaged at all by default. +# PACKAGES += "kernel-module-acpi-call" +# FILES:kernel-module-acpi-call = "/${nonarch_base_libdir}/modules" +RPROVIDES:${PN} += "kernel-module-mdio-netlink" +MODULES_INSTALL_TARGET = "install" KERNEL_MODULE_AUTOLOAD += "acpi_call" - -do_install() { - install -d ${D}/lib/modules/${KERNEL_VERSION} - install ${S}/acpi_call.ko ${D}/lib/modules/${KERNEL_VERSION} -} From 0fe17c61a02e762f3462cae14ab4edf76c4f6bc3 Mon Sep 17 00:00:00 2001 From: Maciej Pijanowski Date: Tue, 14 May 2024 21:54:55 +0200 Subject: [PATCH 28/99] iotools: disable DEBUG by default Signed-off-by: Maciej Pijanowski --- meta-dts-distro/recipes-support/iotools/iotools_git.bb | 2 ++ 1 file changed, 2 insertions(+) diff --git a/meta-dts-distro/recipes-support/iotools/iotools_git.bb b/meta-dts-distro/recipes-support/iotools/iotools_git.bb index 77733377..4f107f8b 100644 --- a/meta-dts-distro/recipes-support/iotools/iotools_git.bb +++ b/meta-dts-distro/recipes-support/iotools/iotools_git.bb @@ -14,6 +14,8 @@ SRCREV = "18949fdc4dedb1da3f51ee83a582b112fb9f2c71" S = "${WORKDIR}/git" do_compile () { + # By default, iotolls is build with DEBUG=1 (-O0 breaks _FORTIFY_SOURCE) + export DEBUG=0 oe_runmake } From 32cda90a14dd34ef8294ba995fbf79029f450cc3 Mon Sep 17 00:00:00 2001 From: Maciej Pijanowski Date: Tue, 14 May 2024 22:02:01 +0200 Subject: [PATCH 29/99] dts-scripts: update SRCREV Signed-off-by: Maciej Pijanowski --- meta-dts-distro/recipes-dts/dts-scripts/dts-scripts_git.bb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/meta-dts-distro/recipes-dts/dts-scripts/dts-scripts_git.bb b/meta-dts-distro/recipes-dts/dts-scripts/dts-scripts_git.bb index ebaef7c8..94e1cb11 100644 --- a/meta-dts-distro/recipes-dts/dts-scripts/dts-scripts_git.bb +++ b/meta-dts-distro/recipes-dts/dts-scripts/dts-scripts_git.bb @@ -5,7 +5,7 @@ HOMEPAGE = "https://github.com/Dasharo/dts-scripts" LICENSE = "Apache-2.0" LIC_FILES_CHKSUM = "file://LICENSES/Apache-2.0.txt;md5=c846ebb396f8b174b10ded4771514fcc " -SRCREV = "6718d85302bf0422dbc969c816e78394044ac744" +SRCREV = "e59da61c2d8f1da39f5cb4138dddb0277b95a614" SRC_URI = "git://github.com/Dasharo/dts-scripts;protocol=https;branch=main" PV = "0.1+git${SRCPV}" From bb1d25e2be2133e8f558d4a7cb6bc2a71f1435ac Mon Sep 17 00:00:00 2001 From: Maciej Pijanowski Date: Mon, 20 May 2024 16:19:05 +0200 Subject: [PATCH 30/99] dts-scripts: update SRCREV Signed-off-by: Maciej Pijanowski --- meta-dts-distro/recipes-dts/dts-scripts/dts-scripts_git.bb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/meta-dts-distro/recipes-dts/dts-scripts/dts-scripts_git.bb b/meta-dts-distro/recipes-dts/dts-scripts/dts-scripts_git.bb index 94e1cb11..b613e233 100644 --- a/meta-dts-distro/recipes-dts/dts-scripts/dts-scripts_git.bb +++ b/meta-dts-distro/recipes-dts/dts-scripts/dts-scripts_git.bb @@ -5,7 +5,7 @@ HOMEPAGE = "https://github.com/Dasharo/dts-scripts" LICENSE = "Apache-2.0" LIC_FILES_CHKSUM = "file://LICENSES/Apache-2.0.txt;md5=c846ebb396f8b174b10ded4771514fcc " -SRCREV = "e59da61c2d8f1da39f5cb4138dddb0277b95a614" +SRCREV = "019212bf44a5fade576e4d02c9f093cffda6af8e" SRC_URI = "git://github.com/Dasharo/dts-scripts;protocol=https;branch=main" PV = "0.1+git${SRCPV}" From 805dbe92f1be07a1d8bbae6dc733c451a6e0bfaf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Iwanicki?= Date: Fri, 24 May 2024 21:07:26 +0200 Subject: [PATCH 31/99] openssh: fix scp not working (Dasharo/dasharo-issues#840) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Michał Iwanicki --- .../recipes-connectivity/openssh/openssh_%.bbappend | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/meta-dts-distro/recipes-connectivity/openssh/openssh_%.bbappend b/meta-dts-distro/recipes-connectivity/openssh/openssh_%.bbappend index 0defc513..51a273a5 100644 --- a/meta-dts-distro/recipes-connectivity/openssh/openssh_%.bbappend +++ b/meta-dts-distro/recipes-connectivity/openssh/openssh_%.bbappend @@ -1 +1,6 @@ SYSTEMD_AUTO_ENABLE:${PN}-sshd = "disable" + +do_install:append() { + # replace /usr/libexec/sftp-server with internal-sftp. + sed -i -r -e "s|^(Subsystem[[:space:]]*sftp[[:space:]]*)/usr/libexec/sftp-server|\1internal-sftp|" ${D}${sysconfdir}/ssh/sshd_config +} From 4ff0c6b13922af4847fd48e36c980ebb822d8688 Mon Sep 17 00:00:00 2001 From: Pawel Langowski Date: Wed, 5 Jun 2024 14:52:42 +0200 Subject: [PATCH 32/99] README: Add section about cukinia tests Signed-off-by: Pawel Langowski --- README.md | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/README.md b/README.md index ef6f772d..987a2964 100644 --- a/README.md +++ b/README.md @@ -100,6 +100,32 @@ Actions. Whole pipeline of creating `DTS` release consists of two steps. [dts-rc.ipxe](http://boot.dasharo.com/dts/dts-rc.ipxe) is created so the newest rc release is available over iPXE. +## Cukinia tests + +`DTS` utilizes the [cukinia](https://github.com/savoirfairelinux/cukinia) +framework to test various features and tools integrated into the system. You can +execute the tests using the following command in the `DTS` shell: + +```bash +cukinia +``` + +It is recommended that you run the tests when developing `DTS` to make sure that +the features are still working after your changes. + +### Developing cukinia tests + +When integrating new features into `DTS`, one should add tests to check whether +the changes work. The test cases are located in +[meta-dts-distro/recipes-tests/dts-tests/dts-tests/cukinia.conf](./meta-dts-distro/recipes-tests/dts-tests/dts-tests/cukinia.conf). +The following example shows test cases that could be added after adding a new +binary/script to `DTS`. + +```conf +as "Check if script X exists" cukinia_test -x $(which ) +as "Check if script X can be executed" cukinia_cmd --help +``` + ## Testing Dasharo firmware updates from local sources