From mboxrd@z Thu Jan 1 00:00:00 1970 X-GM-THRID: 7368376248872992768 Date: Tue, 21 May 2024 00:17:29 -0700 (PDT) From: Srinuvasan Arjunan To: isar-users Message-Id: <82a46e4c-b868-47af-8a6a-2f4f3ce08961n@googlegroups.com> In-Reply-To: <20240513070452.137039-1-srinuvasan.a@siemens.com> References: <20240513070452.137039-1-srinuvasan.a@siemens.com> Subject: Re: [PATCH] meta/*,meta-isar/*,scripts/*: make script report all potential errors MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="----=_Part_128425_528894875.1716275849143" X-TUID: IY/P8ahm82JR ------=_Part_128425_528894875.1716275849143 Content-Type: multipart/alternative; boundary="----=_Part_128426_2081981497.1716275849143" ------=_Part_128426_2081981497.1716275849143 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Hi All, Any Update? Thanks, Srinu On Monday, May 13, 2024 at 12:33:04=E2=80=AFPM UTC+5:30 srinuv...@siemens.c= om wrote: > From: Srinuvasan A > > Let us try and make sure that all bits we have are executed as expected. > > Signed-off-by: Srinuvasan A > --- > .../recipes-initramfs/initramfs-example/files/example.hook | 2 ++ > .../recipes-initramfs/initramfs-example/files/example.script | 2 ++ > meta/recipes-core/isar-bootstrap/files/chroot-setup.sh | 2 ++ > .../initramfs-tee-ftpm-hook/files/tee-ftpm.hook | 3 +++ > .../initramfs-tee-ftpm-hook/files/tee-ftpm.script | 3 +++ > .../initramfs-tee-supplicant-hook/files/tee-supplicant.hook | 3 +++ > .../initramfs-tee-supplicant-hook/files/tee-supplicant.script | 3 +++ > meta/recipes-support/enable-fsck/files/postinst | 2 ++ > .../initramfs-fsck-hook/files/initramfs.fsck.ext4.hook | 3 +++ > meta/recipes-support/isar-exclude-docs/files/postinst | 2 ++ > scripts/isar-buildenv-internal | 3 +++ > scripts/isar-setup-builddir | 2 ++ > scripts/vm_smoke_test | 2 ++ > 13 files changed, 32 insertions(+) > > diff --git=20 > a/meta-isar/recipes-initramfs/initramfs-example/files/example.hook=20 > b/meta-isar/recipes-initramfs/initramfs-example/files/example.hook > index 0d84e7a9..ba848c92 100644 > --- a/meta-isar/recipes-initramfs/initramfs-example/files/example.hook > +++ b/meta-isar/recipes-initramfs/initramfs-example/files/example.hook > @@ -3,6 +3,8 @@ > # > # See "HOOK SCRIPTS" in initramfs-tools(7) for details. > > +set -e > + > PREREQ=3D"" > prereqs() > { > diff --git=20 > a/meta-isar/recipes-initramfs/initramfs-example/files/example.script=20 > b/meta-isar/recipes-initramfs/initramfs-example/files/example.script > index 784fad9c..c55e9ea7 100644 > --- a/meta-isar/recipes-initramfs/initramfs-example/files/example.script > +++ b/meta-isar/recipes-initramfs/initramfs-example/files/example.script > @@ -3,6 +3,8 @@ > # > # See "BOOT SCRIPTS" in initramfs-tools(7) for details. > > +set -e > + > PREREQ=3D"" > prereqs() > { > diff --git a/meta/recipes-core/isar-bootstrap/files/chroot-setup.sh=20 > b/meta/recipes-core/isar-bootstrap/files/chroot-setup.sh > index 41500110..f451f525 100644 > --- a/meta/recipes-core/isar-bootstrap/files/chroot-setup.sh > +++ b/meta/recipes-core/isar-bootstrap/files/chroot-setup.sh > @@ -15,6 +15,8 @@ > # > # SPDX-License-Identifier: GPL-2.0 > > +set -e > + > usage() { > cat <<-EOF 1>&2 > Script to setup and cleanup chroot environments. > diff --git=20 > a/meta/recipes-initramfs/initramfs-tee-ftpm-hook/files/tee-ftpm.hook=20 > b/meta/recipes-initramfs/initramfs-tee-ftpm-hook/files/tee-ftpm.hook > index b7f78592..e80f00b4 100644 > --- a/meta/recipes-initramfs/initramfs-tee-ftpm-hook/files/tee-ftpm.hook > +++ b/meta/recipes-initramfs/initramfs-tee-ftpm-hook/files/tee-ftpm.hook > @@ -6,6 +6,9 @@ > # > # SPDX-License-Identifier: MIT > # > + > +set -e > + > PREREQ=3D"tee-supplicant" > prereqs() > { > diff --git=20 > a/meta/recipes-initramfs/initramfs-tee-ftpm-hook/files/tee-ftpm.script=20 > b/meta/recipes-initramfs/initramfs-tee-ftpm-hook/files/tee-ftpm.script > index 053fb046..3355a7e0 100644 > --- a/meta/recipes-initramfs/initramfs-tee-ftpm-hook/files/tee-ftpm.scrip= t > +++ b/meta/recipes-initramfs/initramfs-tee-ftpm-hook/files/tee-ftpm.scrip= t > @@ -6,6 +6,9 @@ > # > # SPDX-License-Identifier: MIT > # > + > +set -e > + > PREREQ=3D"tee-supplicant" > prereqs() > { > diff --git=20 > a/meta/recipes-initramfs/initramfs-tee-supplicant-hook/files/tee-supplica= nt.hook=20 > b/meta/recipes-initramfs/initramfs-tee-supplicant-hook/files/tee-supplica= nt.hook > index 0af277b1..3e6adbed 100644 > ---=20 > a/meta/recipes-initramfs/initramfs-tee-supplicant-hook/files/tee-supplica= nt.hook > +++=20 > b/meta/recipes-initramfs/initramfs-tee-supplicant-hook/files/tee-supplica= nt.hook > @@ -6,6 +6,9 @@ > # > # SPDX-License-Identifier: MIT > # > + > +set -e > + > PREREQ=3D"" > prereqs() > { > diff --git=20 > a/meta/recipes-initramfs/initramfs-tee-supplicant-hook/files/tee-supplica= nt.script=20 > b/meta/recipes-initramfs/initramfs-tee-supplicant-hook/files/tee-supplica= nt.script > index fcb84817..ac01d7ec 100644 > ---=20 > a/meta/recipes-initramfs/initramfs-tee-supplicant-hook/files/tee-supplica= nt.script > +++=20 > b/meta/recipes-initramfs/initramfs-tee-supplicant-hook/files/tee-supplica= nt.script > @@ -6,6 +6,9 @@ > # > # SPDX-License-Identifier: MIT > # > + > +set -e > + > PREREQ=3D"" > prereqs() > { > diff --git a/meta/recipes-support/enable-fsck/files/postinst=20 > b/meta/recipes-support/enable-fsck/files/postinst > index 1c4c3bdb..67c51fc5 100644 > --- a/meta/recipes-support/enable-fsck/files/postinst > +++ b/meta/recipes-support/enable-fsck/files/postinst > @@ -1,3 +1,5 @@ > #!/bin/sh > > +set -e > + > systemctl enable enable-fsck.service > diff --git=20 > a/meta/recipes-support/initramfs-fsck-hook/files/initramfs.fsck.ext4.hook= =20 > b/meta/recipes-support/initramfs-fsck-hook/files/initramfs.fsck.ext4.hook > index 1bccc817..259b73b4 100644 > ---=20 > a/meta/recipes-support/initramfs-fsck-hook/files/initramfs.fsck.ext4.hook > +++=20 > b/meta/recipes-support/initramfs-fsck-hook/files/initramfs.fsck.ext4.hook > @@ -4,6 +4,9 @@ > # SPDX-License-Identifier: MIT > > #!/bin/sh > + > +set -e > + > PREREQ=3D"" > > prereqs() > diff --git a/meta/recipes-support/isar-exclude-docs/files/postinst=20 > b/meta/recipes-support/isar-exclude-docs/files/postinst > index 78e5d583..21b817d8 100644 > --- a/meta/recipes-support/isar-exclude-docs/files/postinst > +++ b/meta/recipes-support/isar-exclude-docs/files/postinst > @@ -3,5 +3,7 @@ > # time and do not need to be "the first" package > # what we delete needs to be in sync with the dpkg configuration we ship > > +set -e > + > find /usr/share/man/ ! -type d -exec rm -f {} \; > find /usr/share/doc/ ! -type d ! -name "copyright" ! -name "changelog.*"= =20 > -exec rm -f {} \; > diff --git a/scripts/isar-buildenv-internal=20 > b/scripts/isar-buildenv-internal > index 1f609a5e..817387cf 100755 > --- a/scripts/isar-buildenv-internal > +++ b/scripts/isar-buildenv-internal > @@ -20,6 +20,9 @@ > # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA > > # It is assumed ISARROOT is already defined when this is called > + > +set -e > + > if [ -z "$ISARROOT" ]; then > echo >&2 "Error: ISARROOT is not defined!" > return 1 > diff --git a/scripts/isar-setup-builddir b/scripts/isar-setup-builddir > index e5939b47..79179a01 100755 > --- a/scripts/isar-setup-builddir > +++ b/scripts/isar-setup-builddir > @@ -19,6 +19,8 @@ > # along with this program; if not, write to the Free Software > # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA > > +set -e > + > if [ -z "$BUILDDIR" ]; then > echo >&2 "Error: The build directory (BUILDDIR) must be set!" > exit 1 > diff --git a/scripts/vm_smoke_test b/scripts/vm_smoke_test > index 5c16d863..f69b05c2 100755 > --- a/scripts/vm_smoke_test > +++ b/scripts/vm_smoke_test > @@ -3,6 +3,8 @@ > # This software is a part of ISAR. > # Copyright (C) 2015-2018 ilbers GmbH > > +set -e > + > VERBOSE=3D"--show=3Dtest" > TIMEOUT=3D300 > > --=20 > 2.34.1 > > ------=_Part_128426_2081981497.1716275849143 Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: quoted-printable Hi All,

Any Update?

Thanks,=
Srinu

On Monday, May 13, 2024 at 12:33:04=E2=80=AFPM UTC= +5:30 srinuv...@siemens.com wrote:
From: Srinuvasan A <srinuv...@siemens.com>

Let us try and make sure that all bits we have are executed as expected= .

Signed-off-by: Srinuvasan A <srinuv...@siemens.com>
---
.../recipes-initramfs/initramfs-example/files/example.hook | 2 ++
.../recipes-initramfs/initramfs-example/files/example.script | 2 ++
meta/recipes-core/isar-bootstrap/files/chroot-setup.sh | 2 ++
.../initramfs-tee-ftpm-hook/files/tee-ftpm.hook | 3 +++
.../initramfs-tee-ftpm-hook/files/tee-ftpm.script | 3 +++
.../initramfs-tee-supplicant-hook/files/tee-supplicant.hook | 3 +++
.../initramfs-tee-supplicant-hook/files/tee-supplicant.script | 3 +++
meta/recipes-support/enable-fsck/files/postinst | 2 ++
.../initramfs-fsck-hook/files/initramfs.fsck.ext4.hook | 3 +++
meta/recipes-support/isar-exclude-docs/files/postinst | 2 ++
scripts/isar-buildenv-internal | 3 +++
scripts/isar-setup-builddir | 2 ++
scripts/vm_smoke_test | 2 ++
13 files changed, 32 insertions(+)

diff --git a/meta-isar/recipes-initramfs/initramfs-example/files/exampl= e.hook b/meta-isar/recipes-initramfs/initramfs-example/files/example.hook
index 0d84e7a9..ba848c92 100644
--- a/meta-isar/recipes-initramfs/initramfs-example/files/example.hook
+++ b/meta-isar/recipes-initramfs/initramfs-example/files/example.hook
@@ -3,6 +3,8 @@
#
# See "HOOK SCRIPTS" in initramfs-tools(7) for details.
=20
+set -e
+
PREREQ=3D""
prereqs()
{
diff --git a/meta-isar/recipes-initramfs/initramfs-example/files/exampl= e.script b/meta-isar/recipes-initramfs/initramfs-example/files/example.scri= pt
index 784fad9c..c55e9ea7 100644
--- a/meta-isar/recipes-initramfs/initramfs-example/files/example.scrip= t
+++ b/meta-isar/recipes-initramfs/initramfs-example/files/example.scrip= t
@@ -3,6 +3,8 @@
#
# See "BOOT SCRIPTS" in initramfs-tools(7) for details.
=20
+set -e
+
PREREQ=3D""
prereqs()
{
diff --git a/meta/recipes-core/isar-bootstrap/files/chroot-setup.sh b/m= eta/recipes-core/isar-bootstrap/files/chroot-setup.sh
index 41500110..f451f525 100644
--- a/meta/recipes-core/isar-bootstrap/files/chroot-setup.sh
+++ b/meta/recipes-core/isar-bootstrap/files/chroot-setup.sh
@@ -15,6 +15,8 @@
#
# SPDX-License-Identifier: GPL-2.0
=20
+set -e
+
usage() {
=09cat <<-EOF 1>&2
=09=09Script to setup and cleanup chroot environments.
diff --git a/meta/recipes-initramfs/initramfs-tee-ftpm-hook/files/tee-f= tpm.hook b/meta/recipes-initramfs/initramfs-tee-ftpm-hook/files/tee-ftpm.ho= ok
index b7f78592..e80f00b4 100644
--- a/meta/recipes-initramfs/initramfs-tee-ftpm-hook/files/tee-ftpm.hoo= k
+++ b/meta/recipes-initramfs/initramfs-tee-ftpm-hook/files/tee-ftpm.hoo= k
@@ -6,6 +6,9 @@
#
# SPDX-License-Identifier: MIT
#
+
+set -e
+
PREREQ=3D"tee-supplicant"
prereqs()
{
diff --git a/meta/recipes-initramfs/initramfs-tee-ftpm-hook/files/tee-f= tpm.script b/meta/recipes-initramfs/initramfs-tee-ftpm-hook/files/tee-ftpm.= script
index 053fb046..3355a7e0 100644
--- a/meta/recipes-initramfs/initramfs-tee-ftpm-hook/files/tee-ftpm.scr= ipt
+++ b/meta/recipes-initramfs/initramfs-tee-ftpm-hook/files/tee-ftpm.scr= ipt
@@ -6,6 +6,9 @@
#
# SPDX-License-Identifier: MIT
#
+
+set -e
+
PREREQ=3D"tee-supplicant"
prereqs()
{
diff --git a/meta/recipes-initramfs/initramfs-tee-supplicant-hook/files= /tee-supplicant.hook b/meta/recipes-initramfs/initramfs-tee-supplicant-hook= /files/tee-supplicant.hook
index 0af277b1..3e6adbed 100644
--- a/meta/recipes-initramfs/initramfs-tee-supplicant-hook/files/tee-su= pplicant.hook
+++ b/meta/recipes-initramfs/initramfs-tee-supplicant-hook/files/tee-su= pplicant.hook
@@ -6,6 +6,9 @@
#
# SPDX-License-Identifier: MIT
#
+
+set -e
+
PREREQ=3D""
prereqs()
{
diff --git a/meta/recipes-initramfs/initramfs-tee-supplicant-hook/files= /tee-supplicant.script b/meta/recipes-initramfs/initramfs-tee-supplicant-ho= ok/files/tee-supplicant.script
index fcb84817..ac01d7ec 100644
--- a/meta/recipes-initramfs/initramfs-tee-supplicant-hook/files/tee-su= pplicant.script
+++ b/meta/recipes-initramfs/initramfs-tee-supplicant-hook/files/tee-su= pplicant.script
@@ -6,6 +6,9 @@
#
# SPDX-License-Identifier: MIT
#
+
+set -e
+
PREREQ=3D""
prereqs()
{
diff --git a/meta/recipes-support/enable-fsck/files/postinst b/meta/rec= ipes-support/enable-fsck/files/postinst
index 1c4c3bdb..67c51fc5 100644
--- a/meta/recipes-support/enable-fsck/files/postinst
+++ b/meta/recipes-support/enable-fsck/files/postinst
@@ -1,3 +1,5 @@
#!/bin/sh
=20
+set -e
+
systemctl enable enable-fsck.service
diff --git a/meta/recipes-support/initramfs-fsck-hook/files/initramfs.f= sck.ext4.hook b/meta/recipes-support/initramfs-fsck-hook/files/initramfs.fs= ck.ext4.hook
index 1bccc817..259b73b4 100644
--- a/meta/recipes-support/initramfs-fsck-hook/files/initramfs.fsck.ext= 4.hook
+++ b/meta/recipes-support/initramfs-fsck-hook/files/initramfs.fsck.ext= 4.hook
@@ -4,6 +4,9 @@
# SPDX-License-Identifier: MIT
=20
#!/bin/sh
+
+set -e
+
PREREQ=3D""
=20
prereqs()
diff --git a/meta/recipes-support/isar-exclude-docs/files/postinst b/me= ta/recipes-support/isar-exclude-docs/files/postinst
index 78e5d583..21b817d8 100644
--- a/meta/recipes-support/isar-exclude-docs/files/postinst
+++ b/meta/recipes-support/isar-exclude-docs/files/postinst
@@ -3,5 +3,7 @@
# time and do not need to be "the first" package
# what we delete needs to be in sync with the dpkg configuration we sh= ip
=20
+set -e
+
find /usr/share/man/ ! -type d -exec rm -f {} \;
find /usr/share/doc/ ! -type d ! -name "copyright" ! -name &= quot;changelog.*" -exec rm -f {} \;
diff --git a/scripts/isar-buildenv-internal b/scripts/isar-buildenv-int= ernal
index 1f609a5e..817387cf 100755
--- a/scripts/isar-buildenv-internal
+++ b/scripts/isar-buildenv-internal
@@ -20,6 +20,9 @@
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307= USA
=20
# It is assumed ISARROOT is already defined when this is called
+
+set -e
+
if [ -z "$ISARROOT" ]; then
echo >&2 "Error: ISARROOT is not defined!"
return 1
diff --git a/scripts/isar-setup-builddir b/scripts/isar-setup-builddir
index e5939b47..79179a01 100755
--- a/scripts/isar-setup-builddir
+++ b/scripts/isar-setup-builddir
@@ -19,6 +19,8 @@
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307= USA
=20
+set -e
+
if [ -z "$BUILDDIR" ]; then
echo >&2 "Error: The build directory (BUILDDIR) must b= e set!"
exit 1
diff --git a/scripts/vm_smoke_test b/scripts/vm_smoke_test
index 5c16d863..f69b05c2 100755
--- a/scripts/vm_smoke_test
+++ b/scripts/vm_smoke_test
@@ -3,6 +3,8 @@
# This software is a part of ISAR.
# Copyright (C) 2015-2018 ilbers GmbH
=20
+set -e
+
VERBOSE=3D"--show=3Dtest"
TIMEOUT=3D300
=20
--=20
2.34.1

------=_Part_128426_2081981497.1716275849143-- ------=_Part_128425_528894875.1716275849143--