From d8a80c98f4ef982c42b6be4d37fbadcf37bcab1c Mon Sep 17 00:00:00 2001 From: Fabio Erculiani Date: Mon, 15 Aug 2011 09:43:23 +0200 Subject: [PATCH] [molecules] add post_iso_script hook --- molecules/3rdparty/mcs.common | 3 +++ molecules/corecdx.common | 3 +++ molecules/e17.common | 3 +++ molecules/gaming.common | 3 +++ molecules/gnome.common | 3 +++ molecules/kde.common | 3 +++ molecules/lxde.common | 3 +++ molecules/sabayon-x86-gforensic.spec | 3 +++ molecules/sabayon-x86-kforensic.spec | 3 +++ molecules/serverbase.common | 3 +++ molecules/spinbase.common | 3 +++ molecules/xfce.common | 3 +++ scripts/generic_post_iso_script.sh | 22 ++++++++++++++++++++++ 13 files changed, 58 insertions(+) create mode 100755 scripts/generic_post_iso_script.sh diff --git a/molecules/3rdparty/mcs.common b/molecules/3rdparty/mcs.common index f54dcca..2aef519 100644 --- a/molecules/3rdparty/mcs.common +++ b/molecules/3rdparty/mcs.common @@ -36,6 +36,9 @@ extra_mkisofs_parameters: -b isolinux/isolinux.bin -c isolinux/boot.cat # Pre-ISO building script. Hook to be able to copy kernel images in place, for example pre_iso_script: /sabayon/scripts/3rdparty/mcs_pre_iso_script.sh +# Post-ISO building script, called after ISO image generation. +post_iso_script: /sabayon/scripts/generic_post_iso_script.sh + # Destination directory for the ISO image path (MANDATORY) destination_iso_directory: /sabayon/iso diff --git a/molecules/corecdx.common b/molecules/corecdx.common index dd42c93..c42e693 100644 --- a/molecules/corecdx.common +++ b/molecules/corecdx.common @@ -35,6 +35,9 @@ extra_mkisofs_parameters: -b isolinux/isolinux.bin -c isolinux/boot.cat # Pre-ISO building script. Hook to be able to copy kernel images in place, for example pre_iso_script: /sabayon/scripts/generic_pre_iso_script.sh CoreCDX +# Post-ISO building script, called after ISO image generation. +post_iso_script: /sabayon/scripts/generic_post_iso_script.sh + # Destination directory for the ISO image path (MANDATORY) destination_iso_directory: /sabayon/iso diff --git a/molecules/e17.common b/molecules/e17.common index d10891d..a4ed545 100644 --- a/molecules/e17.common +++ b/molecules/e17.common @@ -35,6 +35,9 @@ extra_mkisofs_parameters: -b isolinux/isolinux.bin -c isolinux/boot.cat # Pre-ISO building script. Hook to be able to copy kernel images in place, for example pre_iso_script: /sabayon/scripts/generic_pre_iso_script.sh E17 +# Post-ISO building script, called after ISO image generation. +post_iso_script: /sabayon/scripts/generic_post_iso_script.sh + # Destination directory for the ISO image path (MANDATORY) destination_iso_directory: /sabayon/iso diff --git a/molecules/gaming.common b/molecules/gaming.common index 249680d..f7c7864 100644 --- a/molecules/gaming.common +++ b/molecules/gaming.common @@ -39,6 +39,9 @@ extra_mkisofs_parameters: -b isolinux/isolinux.bin -c isolinux/boot.cat -allow-l # Pre-ISO building script. Hook to be able to copy kernel images in place, for example pre_iso_script: /sabayon/scripts/generic_pre_iso_script.sh "Gaming Edition" +# Post-ISO building script, called after ISO image generation. +post_iso_script: /sabayon/scripts/generic_post_iso_script.sh + # Destination directory for the ISO image path (MANDATORY) destination_iso_directory: /sabayon/iso diff --git a/molecules/gnome.common b/molecules/gnome.common index 871aa84..9caf6e5 100644 --- a/molecules/gnome.common +++ b/molecules/gnome.common @@ -35,6 +35,9 @@ extra_mkisofs_parameters: -b isolinux/isolinux.bin -c isolinux/boot.cat # Pre-ISO building script. Hook to be able to copy kernel images in place, for example pre_iso_script: /sabayon/scripts/generic_pre_iso_script.sh GNOME +# Post-ISO building script, called after ISO image generation. +post_iso_script: /sabayon/scripts/generic_post_iso_script.sh + # Destination directory for the ISO image path (MANDATORY) destination_iso_directory: /sabayon/iso diff --git a/molecules/kde.common b/molecules/kde.common index f228549..25c3668 100644 --- a/molecules/kde.common +++ b/molecules/kde.common @@ -35,6 +35,9 @@ extra_mkisofs_parameters: -b isolinux/isolinux.bin -c isolinux/boot.cat # Pre-ISO building script. Hook to be able to copy kernel images in place, for example pre_iso_script: /sabayon/scripts/generic_pre_iso_script.sh KDE +# Post-ISO building script, called after ISO image generation. +post_iso_script: /sabayon/scripts/generic_post_iso_script.sh + # Destination directory for the ISO image path (MANDATORY) destination_iso_directory: /sabayon/iso diff --git a/molecules/lxde.common b/molecules/lxde.common index 500a905..7f82560 100644 --- a/molecules/lxde.common +++ b/molecules/lxde.common @@ -35,6 +35,9 @@ extra_mkisofs_parameters: -b isolinux/isolinux.bin -c isolinux/boot.cat # Pre-ISO building script. Hook to be able to copy kernel images in place, for example pre_iso_script: /sabayon/scripts/generic_pre_iso_script.sh LXDE +# Post-ISO building script, called after ISO image generation. +post_iso_script: /sabayon/scripts/generic_post_iso_script.sh + # Destination directory for the ISO image path (MANDATORY) destination_iso_directory: /sabayon/iso diff --git a/molecules/sabayon-x86-gforensic.spec b/molecules/sabayon-x86-gforensic.spec index 6a3ef30..b806b87 100644 --- a/molecules/sabayon-x86-gforensic.spec +++ b/molecules/sabayon-x86-gforensic.spec @@ -55,6 +55,9 @@ extra_mkisofs_parameters: -b isolinux/isolinux.bin -c isolinux/boot.cat # Pre-ISO building script. Hook to be able to copy kernel images in place, for example # pre_iso_script: /sabayon/scripts/cdroot.py +# Post-ISO building script, called after ISO image generation. +post_iso_script: /sabayon/scripts/generic_post_iso_script.sh + # Destination directory for the ISO image path (MANDATORY) destination_iso_directory: /sabayon/iso diff --git a/molecules/sabayon-x86-kforensic.spec b/molecules/sabayon-x86-kforensic.spec index 7cd90b0..33bb85a 100644 --- a/molecules/sabayon-x86-kforensic.spec +++ b/molecules/sabayon-x86-kforensic.spec @@ -55,6 +55,9 @@ extra_mkisofs_parameters: -b isolinux/isolinux.bin -c isolinux/boot.cat # Pre-ISO building script. Hook to be able to copy kernel images in place, for example # pre_iso_script: /sabayon/scripts/cdroot.py +# Post-ISO building script, called after ISO image generation. +post_iso_script: /sabayon/scripts/generic_post_iso_script.sh + # Destination directory for the ISO image path (MANDATORY) destination_iso_directory: /sabayon/iso diff --git a/molecules/serverbase.common b/molecules/serverbase.common index 5f3074d..c108f03 100644 --- a/molecules/serverbase.common +++ b/molecules/serverbase.common @@ -35,6 +35,9 @@ extra_mkisofs_parameters: -b isolinux/isolinux.bin -c isolinux/boot.cat # Pre-ISO building script. Hook to be able to copy kernel images in place, for example pre_iso_script: /sabayon/scripts/generic_pre_iso_script.sh ServerBase +# Post-ISO building script, called after ISO image generation. +post_iso_script: /sabayon/scripts/generic_post_iso_script.sh + # Destination directory for the ISO image path (MANDATORY) destination_iso_directory: /sabayon/iso diff --git a/molecules/spinbase.common b/molecules/spinbase.common index e66c208..37345ff 100644 --- a/molecules/spinbase.common +++ b/molecules/spinbase.common @@ -32,6 +32,9 @@ extra_mkisofs_parameters: -b isolinux/isolinux.bin -c isolinux/boot.cat # Pre-ISO building script. Hook to be able to copy kernel images in place, for example pre_iso_script: /sabayon/scripts/cdroot.py +# Post-ISO building script, called after ISO image generation. +post_iso_script: /sabayon/scripts/generic_post_iso_script.sh + # Destination directory for the ISO image path destination_iso_directory: /sabayon/iso diff --git a/molecules/xfce.common b/molecules/xfce.common index 8478942..6427b62 100644 --- a/molecules/xfce.common +++ b/molecules/xfce.common @@ -35,6 +35,9 @@ extra_mkisofs_parameters: -b isolinux/isolinux.bin -c isolinux/boot.cat # Pre-ISO building script. Hook to be able to copy kernel images in place, for example pre_iso_script: /sabayon/scripts/generic_pre_iso_script.sh XFCE +# Post-ISO building script, called after ISO image generation. +post_iso_script: /sabayon/scripts/generic_post_iso_script.sh + # Destination directory for the ISO image path (MANDATORY) destination_iso_directory: /sabayon/iso diff --git a/scripts/generic_post_iso_script.sh b/scripts/generic_post_iso_script.sh new file mode 100755 index 0000000..1ea5f34 --- /dev/null +++ b/scripts/generic_post_iso_script.sh @@ -0,0 +1,22 @@ +#!/bin/bash +# Update ISO image in order to make it USB bootable +# out of the box +# +# Available env vars: +# ISO_PATH = path to generated ISO +# ISO_CHECKSUM_PATH = path to generated md5 for ISO +# +# This script requires isohybrid (which comes from syslinux package) + +/usr/sbin/env-update && source /etc/profile + +echo +echo "Spawning isohybrid for:" +echo "ISO_PATH = ${ISO_PATH}" +echo "ISO_CHECKSUM_PATH = ${ISO_CHECKSUM_PATH}" +echo + +isohybrid "${ISO_PATH}" || exit 1 +md5sum "${ISO_PATH}" > "${ISO_CHECKSUM_PATH}" +exit ${?} +