Skip to content

Commit db96eca

Browse files
committed
capsule_cabinet.sh: improve logging
Upstream-Status: Inappropriate (Dasharo downstream) Change-Id: I874ddda52eace5d830aa2460578e80bf37e01d96 Signed-off-by: Michał Kopeć <michal.kopec@3mdeb.com>
1 parent 243c446 commit db96eca

1 file changed

Lines changed: 14 additions & 12 deletions

File tree

capsule_cabinet.sh

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,20 @@ function die() {
88
exit 1
99
}
1010

11+
if [ $# -ne 1 ]; then
12+
die "Incorrect number of input parameters specified: $# (expected: 1)"
13+
fi
14+
15+
if [ -z $1 ]; then
16+
die "No input capsule specified"
17+
fi
18+
19+
if [ ! -f $1 ]; then
20+
die "File $1 not found"
21+
fi
22+
1123
if [ ! -f .config ]; then
12-
die "no '.config' file in current directory"
24+
die "No '.config' file in current directory"
1325
fi
1426

1527
# import coreboot's config file replacing $(...) with ${...}
@@ -20,15 +32,7 @@ while read -r line; do
2032
done <<< "$(sed 's/\$(\([^)]\+\))/${\1}/g' .config)"
2133

2234
if [ "$CONFIG_DRIVERS_EFI_UPDATE_CAPSULES" != y ]; then
23-
die "current board configuration lacks support of update capsules"
24-
fi
25-
26-
if [ -z $1 ]; then
27-
die "No input capsule specified"
28-
fi
29-
30-
if [ ! -f $1 ]; then
31-
die "File $1 not found"
35+
die "Current board configuration lacks support of update capsules"
3236
fi
3337

3438
capsule=$1
@@ -70,8 +74,6 @@ cat > "${archive_dir}/firmware.metainfo.xml" << EOF
7074
7175
EOF
7276

73-
cat "$archive_dir/firmware.metainfo.xml"
74-
7577
cp $capsule $archive_dir/firmware.bin
7678

7779
pushd $archive_dir &> /dev/null

0 commit comments

Comments
 (0)