From dd9ec7a4fb42ac197185b453bc5cad118ca21fb3 Mon Sep 17 00:00:00 2001 From: Jason Andryuk Date: Fri, 11 Mar 2022 10:05:08 -0500 Subject: [PATCH 1/2] Add extra-manifest support Allow stashing files from the build into a top-level extra folder on the iso. They aren't installed on the system, but are included. Use build-*/conf/extra-manifest to install stuff. Paths are relative from build/tmp-glibc/deploy. Example extra-manifest: # Source file from build and destination filename # src dst xenclient-dom0/mk-dbd-up.sh mk-dbd-up.sh xenclient-dom0/data.dbd-up data.dbd-up Signed-off-by: Jason Andryuk --- cmds/deploy | 2 ++ cmds/stage | 26 ++++++++++++++++++++++++++ 2 files changed, 28 insertions(+) diff --git a/cmds/deploy b/cmds/deploy index 7155f85..a988034 100755 --- a/cmds/deploy +++ b/cmds/deploy @@ -14,6 +14,7 @@ deploy_iso_legacy() { -boot-info-table \ -r -J -l -V "OpenXT ${OPENXT_RELEASE} installer." \ "${STAGING_DIR}/iso" \ + "${STAGING_DIR}/extra" \ "${STAGING_DIR}/repository" then echo "genisoimage failed." @@ -56,6 +57,7 @@ deploy_iso() { -f \ -quiet \ "${STAGING_DIR}/iso" \ + "${STAGING_DIR}/extra" \ "${STAGING_DIR}/repository" echo "ISO created: $iso_path" diff --git a/cmds/stage b/cmds/stage index f034bca..9433f02 100755 --- a/cmds/stage +++ b/cmds/stage @@ -277,6 +277,32 @@ stage_iso() { if [ -e "${IMAGES_DIR}/${isohdp_src}" ]; then stage_build_output "${isohdp_src}" "${isohdp_dst}" fi + + stage_extra_iso +} + +stage_extra_iso() { + local src + local dst + local dest_dir="$STAGING_DIR/extra/extra" + + # Need a placeholder, even if empty, so xorriso doesn't error out. + mkdir -p $STAGING_DIR/extra/ + + if [ ! -r "$CONF_DIR/extra-manifest" ] ; then + return + fi + + while read src dst ; do + if [ -z "${src%%#*}" ]; then + continue + fi + + src="$IMAGES_DIR/$src" + dst="$dest_dir/$dst" + mkdir -p "$(dirname "$dst")" + cp -rv -L -T "$src" "$dst" + done < "$CONF_DIR/extra-manifest" } # Usage: stage_pxe From 6d0341a93faa219b2d39fb8e56c0471a83e45d47 Mon Sep 17 00:00:00 2001 From: Jason Andryuk Date: Wed, 7 Dec 2022 11:07:03 -0500 Subject: [PATCH 2/2] deploy: Make "extra" directory conditional Only add the "extra" directory when extra-manifest is present. xorriso fails when a non-existant directory is present, so only inlucde it when its populated. Signed-off-by: Jason Andryuk --- cmds/deploy | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/cmds/deploy b/cmds/deploy index a988034..a6d37b5 100755 --- a/cmds/deploy +++ b/cmds/deploy @@ -7,6 +7,11 @@ deploy_iso_legacy() { local iso_name="openxt-installer.iso" local iso_path="${DEPLOY_DIR}/${iso_name}" + local STAGING_EXTRA="" + if [ -e "$CONF_DIR/extra-manifest" ] ; then + STAGING_EXTRA="${STAGING_DIR}/extra" + fi + if ! genisoimage -o "${iso_path}" \ -b "isolinux/isolinux.bin" -c "isolinux/boot.cat" \ -no-emul-boot \ @@ -14,7 +19,7 @@ deploy_iso_legacy() { -boot-info-table \ -r -J -l -V "OpenXT ${OPENXT_RELEASE} installer." \ "${STAGING_DIR}/iso" \ - "${STAGING_DIR}/extra" \ + $STAGING_EXTRA \ "${STAGING_DIR}/repository" then echo "genisoimage failed." @@ -34,6 +39,11 @@ deploy_iso() { local iso_name="openxt-installer.iso" local iso_path="${DEPLOY_DIR}/${iso_name}" + local STAGING_EXTRA="" + if [ -e "$CONF_DIR/extra-manifest" ] ; then + STAGING_EXTRA="${STAGING_DIR}/extra" + fi + if ! command_sane "xorriso" "libisoburn"; then return 1 fi @@ -57,7 +67,7 @@ deploy_iso() { -f \ -quiet \ "${STAGING_DIR}/iso" \ - "${STAGING_DIR}/extra" \ + $STAGING_EXTRA \ "${STAGING_DIR}/repository" echo "ISO created: $iso_path"