From mboxrd@z Thu Jan 1 00:00:00 1970 X-GM-THRID: 7107445708784926720 X-Received: by 2002:a63:8541:0:b0:401:9c13:ffca with SMTP id u62-20020a638541000000b004019c13ffcamr4906947pgd.417.1654831159488; Thu, 09 Jun 2022 20:19:19 -0700 (PDT) X-BeenThere: isar-users@googlegroups.com Received: by 2002:a17:902:cf05:b0:162:1098:f1cb with SMTP id i5-20020a170902cf0500b001621098f1cbls14533939plg.11.gmail; Thu, 09 Jun 2022 20:19:18 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwW2nvIZatgJruI4N84ZC2IGkBXlB2uEhoYvX0sB1QOCrewlBV3ZI5b+2lyZ9FOO+pFUSja X-Received: by 2002:a17:90a:b703:b0:1dd:1e2f:97d7 with SMTP id l3-20020a17090ab70300b001dd1e2f97d7mr6552982pjr.62.1654831158105; Thu, 09 Jun 2022 20:19:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1654831158; cv=none; d=google.com; s=arc-20160816; b=oAEgbxV/rPXl6JvQnZfa0GOgesGYTVfPaeNmof3I2gtNjW2Z/Wv8z22k9AQjhRB99t +y+q9H6TmKn5hEN2pvkhsdpYIsJikIxa/PJCLW6vDQ+1cSy0BZs+9dSqnb9L+PwcN2tU uU97qa2TZhOlBlDBtq2l3t8qJwGGYxr8ZGK+0h36dhEVSp5FphydeXujJyLtqEQn1vPD ChjVcoR+OzaHvORYoOZHv3BpxtYSkc9JT6SwM49cY/MKV9qXONYpE4/NSd7NuoJwzZc3 ULSU1uAaHjjYY7Y9uccSEcIU3OtmiqxHsKUJBcxbqf3XvdL9SbhkirrcVNrnkY0kANTA /z4Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:message-id:date:subject:to :from; bh=XdsT89b4vOMn8AdzUEhZgijJaTpGyjIDM/rMLVM2fVk=; b=B8WN7FAXETLwQNZ5IEoNShcbYvxuAWesudWI2ZznRksyW9/AQmwAW3mwSqLD6H5ET9 H6urni+DrcH1Flac0+YMHcP5PJUKtt5L1WhLtebDMP11s6RaCYJtMFJNFlk1bVL0qRkq bFXWEIgqFvkKmfuALSS6HVMqUbUw/nLQCW67mdBWY2o//W0k7BOF2I0HXF9ZmMoAA3bX ObfUVkkjsDnSzb2RZj7+FuDAxvrJsjCMgJOk9ApDjM88xRIjhL3N0FRi4Vr2Ds7ZdCTc 3WIkWtuOgTIQABk5kXcIGijp4MJ+xdz2qcGXKM1TJ17ZYaDMGlNV0WabmvyLO1yYwk9x Bt7g== ARC-Authentication-Results: i=1; gmr-mx.google.com; spf=pass (google.com: domain of ubely@ilbers.de designates 85.214.156.166 as permitted sender) smtp.mailfrom=ubely@ilbers.de Return-Path: Received: from shymkent.ilbers.de (shymkent.ilbers.de. [85.214.156.166]) by gmr-mx.google.com with ESMTPS id k21-20020a6568d5000000b003fce18d58cbsi1068159pgt.0.2022.06.09.20.19.17 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 09 Jun 2022 20:19:17 -0700 (PDT) Received-SPF: pass (google.com: domain of ubely@ilbers.de designates 85.214.156.166 as permitted sender) client-ip=85.214.156.166; Authentication-Results: gmr-mx.google.com; spf=pass (google.com: domain of ubely@ilbers.de designates 85.214.156.166 as permitted sender) smtp.mailfrom=ubely@ilbers.de Received: from baighyz.m.ilbers.de (host-80-81-17-52.static.customer.m-online.net [80.81.17.52]) (authenticated bits=0) by shymkent.ilbers.de (8.15.2/8.15.2/Debian-8+deb9u1) with ESMTPSA id 25A3JF04012045 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Fri, 10 Jun 2022 05:19:15 +0200 From: Uladzimir Bely To: isar-users@googlegroups.com Subject: [PATCH] expand-on-first-boot: Fix early exit in helper script Date: Fri, 10 Jun 2022 05:19:15 +0200 Message-Id: <20220610031915.25529-1-ubely@ilbers.de> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED autolearn=unavailable autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on shymkent.ilbers.de X-TUID: Chc1knabuz9D Changes in 342a751e introduced a regression when error from 'find' makes helper script early exit (with -1 error code) just after an attempt to assign ROOT_DEV_SLAVE variable. So, the last partition remained not resized. Passing 'find' output to 'head -1' masks possible error from 'find' without breaking the logic and continues the script execution. Signed-off-by: Uladzimir Bely --- .../expand-on-first-boot/files/expand-last-partition.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/meta/recipes-support/expand-on-first-boot/files/expand-last-partition.sh b/meta/recipes-support/expand-on-first-boot/files/expand-last-partition.sh index f3e29a1c..934a014f 100755 --- a/meta/recipes-support/expand-on-first-boot/files/expand-last-partition.sh +++ b/meta/recipes-support/expand-on-first-boot/files/expand-last-partition.sh @@ -11,7 +11,7 @@ set -e ROOT_DEV="$(findmnt / -o source -n)" ROOT_DEV_NAME=${ROOT_DEV##*/} -ROOT_DEV_SLAVE=$(find /sys/block/"${ROOT_DEV_NAME}"/slaves -mindepth 1 -print -quit 2>/dev/null) +ROOT_DEV_SLAVE=$(find /sys/block/"${ROOT_DEV_NAME}"/slaves -mindepth 1 -print -quit 2>/dev/null | head -1) if [ -n "${ROOT_DEV_SLAVE}" ]; then ROOT_DEV=/dev/${ROOT_DEV_SLAVE##*/} fi -- 2.20.1