Try using isoinfo(1) to extract an ISO image identifier
authorDaniel Richard G <skunk@iSKUNK.ORG>
Fri, 7 Apr 2023 04:07:46 +0000 (00:07 -0400)
committerDaniel Richard G <skunk@iSKUNK.ORG>
Sat, 8 Apr 2023 01:28:04 +0000 (21:28 -0400)
42_grml
debian/control

diff --git a/42_grml b/42_grml
index b951465..e8e8200 100755 (executable)
--- a/42_grml
+++ b/42_grml
@@ -74,10 +74,17 @@ get_dependencies() {
     break
   done
   echo $dependencies
-
 }
 
-
+get_iso_identifier() {
+  local iso="$1"
+  local id=
+  if isoinfo --version >/dev/null 2>&1 ; then
+    id=$(isoinfo -d -i "${iso}" | grep '^Volume id:' | sed -e 's/^[^:]*: *//')
+    [ -n "${id}" ] || id=$(isoinfo -d -i "${iso}" | grep '^Application id:' | sed -e 's/^[^:]*: *//')
+  fi
+  echo "${id}"
+}
 
 iso_list=""
 for file in "${ISO_LOCATION}"/*.iso ; do
@@ -111,7 +118,12 @@ for grmliso in $iso_list ; do
   esac
 
   echo "Found Grml ISO image: $grmliso" >&2
-  title="Grml Rescue System ($grml)"
+  iso_id=$(get_iso_identifier "${grmliso}")
+  if [ -n "${iso_id}" ] ; then
+    title="${iso_id} (${grml})"
+  else
+    title="Grml Rescue System (${grml})"
+  fi
   grub_prep=$(prepare_grub_to_access_device "$device" | sed -e "s/^/        /")
 
   cat << EOF
index 402399f..d371e64 100644 (file)
@@ -23,6 +23,7 @@ Depends:
  ${shlibs:Depends},
 Recommends:
  debian-keyring,
+ genisoimage,
  gpgv,
  wget,
 Description: Integrates Grml ISO booting into GRUB