[scripts] move hardcoded "/sabayon" path to SABAYON_MOLECULE_HOME env var

This commit is contained in:
Fabio Erculiani
2012-07-25 13:21:49 +02:00
parent d2d0beabc0
commit af53d90d23
22 changed files with 144 additions and 54 deletions
+9 -4
View File
@@ -1,20 +1,25 @@
#!/bin/bash
/usr/sbin/env-update && source /etc/profile
/usr/sbin/env-update
source /etc/profile
# Path to molecules.git dir
SABAYON_MOLECULE_HOME="${SABAYON_MOLECULE_HOME:-/sabayon}"
export SABAYON_MOLECULE_HOME
remaster_type="${1}"
isolinux_source="/sabayon/remaster/minimal_isolinux.cfg"
isolinux_source="${SABAYON_MOLECULE_HOME}/remaster/minimal_isolinux.cfg"
isolinux_destination="${CDROOT_DIR}/isolinux/txt.cfg"
if [ "${remaster_type}" = "KDE" ] || [ "${remaster_type}" = "GNOME" ]; then
isolinux_source="/sabayon/remaster/standard_isolinux.cfg"
isolinux_source="${SABAYON_MOLECULE_HOME}/remaster/standard_isolinux.cfg"
elif [ "${remaster_type}" = "ServerBase" ]; then
echo "ServerBase trigger, copying server kernel over"
boot_kernel=$(find "${CHROOT_DIR}/boot" -name "kernel-*" | sort | head -n 1)
boot_ramfs=$(find "${CHROOT_DIR}/boot" -name "initramfs-*" | sort | head -n 1)
cp "${boot_kernel}" "${CDROOT_DIR}/boot/sabayon" || exit 1
cp "${boot_ramfs}" "${CDROOT_DIR}/boot/sabayon.igz" || exit 1
isolinux_source="/sabayon/remaster/serverbase_isolinux.cfg"
isolinux_source="${SABAYON_MOLECULE_HOME}/remaster/serverbase_isolinux.cfg"
fi
cp "${isolinux_source}" "${isolinux_destination}" || exit 1