2010-09-17 13:40:17 +02:00
|
|
|
#!/bin/bash
|
|
|
|
|
2012-07-25 13:21:49 +02:00
|
|
|
/usr/sbin/env-update
|
2012-07-25 13:23:32 +02:00
|
|
|
. /etc/profile
|
2012-07-25 13:21:49 +02:00
|
|
|
|
|
|
|
# Path to molecules.git dir
|
|
|
|
SABAYON_MOLECULE_HOME="${SABAYON_MOLECULE_HOME:-/sabayon}"
|
|
|
|
export SABAYON_MOLECULE_HOME
|
2010-09-17 13:40:17 +02:00
|
|
|
|
|
|
|
remaster_type="${1}"
|
2012-07-25 13:21:49 +02:00
|
|
|
isolinux_source="${SABAYON_MOLECULE_HOME}/remaster/minimal_isolinux.cfg"
|
2011-03-17 23:56:38 +01:00
|
|
|
isolinux_destination="${CDROOT_DIR}/isolinux/txt.cfg"
|
2010-09-17 13:40:17 +02:00
|
|
|
|
|
|
|
if [ "${remaster_type}" = "KDE" ] || [ "${remaster_type}" = "GNOME" ]; then
|
2012-07-25 13:21:49 +02:00
|
|
|
isolinux_source="${SABAYON_MOLECULE_HOME}/remaster/standard_isolinux.cfg"
|
2010-09-17 13:40:17 +02:00
|
|
|
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
|
2012-07-25 13:21:49 +02:00
|
|
|
isolinux_source="${SABAYON_MOLECULE_HOME}/remaster/serverbase_isolinux.cfg"
|
2012-08-30 18:22:53 +02:00
|
|
|
elif [ "${remaster_type}" = "HardenedServer" ]; then
|
|
|
|
echo "HardenedServer 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_MOLECULE_HOME}/remaster/hardenedserver_isolinux.cfg"
|
2010-09-17 13:40:17 +02:00
|
|
|
fi
|
|
|
|
cp "${isolinux_source}" "${isolinux_destination}" || exit 1
|
|
|
|
|
|
|
|
ver=${RELEASE_VERSION}
|
|
|
|
[[ -z "${ver}" ]] && ver=${CUR_DATE}
|
2011-05-14 12:46:52 +02:00
|
|
|
[[ -z "${ver}" ]] && ver="6"
|
2010-09-17 13:40:17 +02:00
|
|
|
|
|
|
|
sed -i "s/__VERSION__/${ver}/g" "${isolinux_destination}"
|
|
|
|
sed -i "s/__FLAVOUR__/${remaster_type}/g" "${isolinux_destination}"
|
|
|
|
|
2011-01-22 20:46:13 +01:00
|
|
|
kms_string=""
|
|
|
|
# should KMS be enabled?
|
|
|
|
if [ -f "${CHROOT_DIR}/.enable_kms" ]; then
|
|
|
|
rm "${CHROOT_DIR}/.enable_kms"
|
|
|
|
kms_string="radeon.modeset=1"
|
2012-01-18 14:05:53 +01:00
|
|
|
else
|
|
|
|
# enable vesafb-tng then
|
|
|
|
kms_string="video=vesafb:ywrap,mtrr:3"
|
2011-01-22 20:46:13 +01:00
|
|
|
fi
|
|
|
|
sed -i "s/__KMS__/${kms_string}/g" "${isolinux_destination}"
|
|
|
|
|
2010-09-17 13:40:17 +02:00
|
|
|
sabayon_pkgs_file="${CHROOT_DIR}/etc/sabayon-pkglist"
|
|
|
|
if [ -f "${sabayon_pkgs_file}" ]; then
|
|
|
|
cp "${sabayon_pkgs_file}" "${CDROOT_DIR}/pkglist"
|
|
|
|
if [ -n "${ISO_PATH}" ]; then # molecule 0.9.6 required
|
|
|
|
# copy pkglist over to ISO path + pkglist
|
2011-01-22 20:46:13 +01:00
|
|
|
cp "${sabayon_pkgs_file}" "${ISO_PATH}".pkglist
|
2010-09-17 13:40:17 +02:00
|
|
|
fi
|
|
|
|
fi
|
2012-01-13 23:39:51 +01:00
|
|
|
|
|
|
|
# copy back.jpg to proper location
|
|
|
|
isolinux_img="${CHROOT_DIR}/usr/share/backgrounds/isolinux/back.jpg"
|
|
|
|
if [ -f "${isolinux_img}" ]; then
|
|
|
|
cp "${isolinux_img}" "${CDROOT_DIR}/isolinux/" || exit 1
|
|
|
|
fi
|
2012-09-03 23:27:34 +02:00
|
|
|
|
|
|
|
# Generate livecd.squashfs.md5
|
2012-09-03 23:38:54 +02:00
|
|
|
"${SABAYON_MOLECULE_HOME}"/scripts/pre_iso_script_livecd_hash.sh
|