mkimage() {
local buildsystem="${1}"
- local filename="${2}"
+ local label="${2}"
+ local filename="${3}"
local r=0
# Create a temporary working directory
#-quiet
# The name of the volume
- -volid "${name}"
+ -volid "${label}"
# Set ISO9660 conformance level
-iso-level 3
main() {
local arch="$(uname -m)"
local filename
+ local label
while [ $# -gt 0 ]; do
case "${1}" in
arch="${1#*=}"
;;
+ --label=*)
+ label="${1#*=}"
+ ;;
+
*.iso)
if [ -n "${filename}" ]; then
echo "Filename has already been set" >&2
return 2
fi
+ # Generate a random label if nothing was set
+ if [ -z "${label}" ]; then
+ label="$(make_label)"
+ fi
+
+ # Check if the label is < 16 characters
+ if [ "${#label}" -gt 16 ]; then
+ echo "The label cannot be longer than 16 characters" >&2
+ return 2
+ fi
+
local has_bios_boot="false"
local has_efi_boot="false"
fi
# Make image and delete it if something went wrong
- if ! mkimage "${buildsystem}" "${filename}"; then
+ if ! mkimage "${buildsystem}" "${label}" "${filename}"; then
rm -rf "${buildsystem}" "${filename}"
return 1
fi