[molecules] drop unused spec files and scripts
This commit is contained in:
@@ -1,12 +0,0 @@
|
||||
# Use abs path, otherwise daily builds automagic won't work
|
||||
%env %import ${SABAYON_MOLECULE_HOME:-/sabayon}/molecules/spinbase-amazon-ami-ebs-image.common
|
||||
|
||||
# pre chroot command, example, for 32bit chroots on 64bit system, you always
|
||||
# have to append "linux32" this is useful for inner_chroot_script
|
||||
# prechroot:
|
||||
|
||||
# Path to source ISO file (MANDATORY)
|
||||
%env source_iso: ${SABAYON_MOLECULE_HOME:-/sabayon}/iso/Sabayon_Linux_${ISO_TAG:-DAILY}_amd64_SpinBase.iso
|
||||
|
||||
%env release_version: ${SABAYON_RELEASE:-11}
|
||||
%env tar_name: Sabayon_Linux_${SABAYON_RELEASE:-11}_amd64_SpinBase_Amazon_EBS_ext4_filesystem_image.tar.gz
|
||||
@@ -1,90 +0,0 @@
|
||||
# Define an alternative execution strategy, in this case, the value must be
|
||||
execution_strategy: iso_to_tar
|
||||
|
||||
# Error script command, executed when something went wrong and molecule has
|
||||
# to terminate the execution
|
||||
# Variables exported:
|
||||
# LOOP_DEVICE = loop device (/dev/loopN) currently in use
|
||||
%env error_script: ${SABAYON_MOLECULE_HOME:-/sabayon}/scripts/image_error_script.sh
|
||||
|
||||
# Outer chroot script command, to be executed outside destination chroot before
|
||||
# before entering it (and before inner_chroot_script)
|
||||
%env outer_chroot_script: ${SABAYON_MOLECULE_HOME:-/sabayon}/scripts/remaster_pre.sh
|
||||
|
||||
# Inner chroot script command, to be executed inside destination chroot before
|
||||
# packing it
|
||||
%env inner_chroot_script: ${SABAYON_MOLECULE_HOME:-/sabayon}/scripts/amazon_ebs_image_inner_chroot_script.sh
|
||||
|
||||
# Inner chroot script command, to be executed inside destination chroot after
|
||||
# packages installation and removal
|
||||
%env inner_chroot_script_after: ${SABAYON_MOLECULE_HOME:-/sabayon}/scripts/amazon_ebs_image_inner_chroot_script_after.sh
|
||||
|
||||
# Outer chroot script command, to be executed outside destination chroot before
|
||||
# before entering it (and AFTER inner_chroot_script)
|
||||
%env outer_chroot_script_after: ${SABAYON_MOLECULE_HOME:-/sabayon}/scripts/amazon_ebs_image_remaster_post.sh
|
||||
|
||||
# Pre-tar building script. Hook called before tar file creation
|
||||
# Variables exported:
|
||||
# CHROOT_DIR = path pointing to the working chroot (the one that gets modified)
|
||||
# TAR_PATH = path pointing to the destination tar file
|
||||
# TAR_CHECKSUM_PATH = path pointing to the destination tar file checksum (md5)
|
||||
%env pre_tar_script: ${SABAYON_MOLECULE_HOME:-/sabayon}/scripts/amazon_ebs_image_pre_tar_script.sh
|
||||
|
||||
# Destination directory for the image path (MANDATORY)
|
||||
%env destination_tar_directory: ${SABAYON_MOLECULE_HOME:-/sabayon}/images
|
||||
|
||||
# Compression method (default is: gz). Supported compression methods: gz, bz2
|
||||
# compression_method: gz
|
||||
|
||||
# Specify an alternative tar file name (tar file name will be automatically
|
||||
# produced otherwise)
|
||||
# tar_name:
|
||||
|
||||
# Alternative ISO file mount command (default is: mount -o loop -t iso9660)
|
||||
# iso_mounter:
|
||||
|
||||
# Alternative ISO umounter command (default is: umount)
|
||||
# iso_umounter:
|
||||
|
||||
# Alternative squashfs file mount command (default is: mount -o loop -t squashfs)
|
||||
# squash_mounter:
|
||||
|
||||
# Alternative ISO squashfs umount command (default is: umount)
|
||||
# squash_umounter:
|
||||
|
||||
# List of packages that would be removed from chrooted system (comma separated)
|
||||
packages_to_remove:
|
||||
app-admin/anaconda,
|
||||
net-misc/networkmanager,
|
||||
net-firewall/ufw,
|
||||
sys-kernel/linux-sabayon,
|
||||
sys-boot/grub:2
|
||||
|
||||
# Custom shell call to packages removal (default is: equo remove)
|
||||
# custom_packages_remove_cmd:
|
||||
|
||||
# List of packages that would be added from chrooted system (comma separated)
|
||||
packages_to_add:
|
||||
app-admin/aws-rds-tools,
|
||||
app-admin/aws-iam-tools,
|
||||
app-admin/ec2-ami-tools,
|
||||
app-admin/ec2-api-tools,
|
||||
app-admin/eselect-bzimage,
|
||||
sys-kernel/linux-ec2,
|
||||
sys-process/atop
|
||||
|
||||
# Custom shell call to packages add (default is: equo install)
|
||||
# custom_packages_add_cmd:
|
||||
|
||||
# Custom command for updating repositories (default is: equo update)
|
||||
# repositories_update_cmd:
|
||||
|
||||
# Determine whether repositories update should be run (if packages_to_add is set)
|
||||
# (default is: no), values are: yes, no.
|
||||
# execute_repositories_update: no
|
||||
|
||||
# Directories to remove completely (comma separated)
|
||||
# paths_to_remove:
|
||||
|
||||
# Directories to empty (comma separated)
|
||||
# paths_to_empty:
|
||||
@@ -1,35 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
/usr/sbin/env-update
|
||||
. /etc/profile
|
||||
|
||||
# make sure there is no stale pid file around that prevents entropy from running
|
||||
rm -f /var/run/entropy/entropy.lock
|
||||
|
||||
export FORCE_EAPI=2
|
||||
updated=0
|
||||
for ((i=0; i < 42; i++)); do
|
||||
equo update && {
|
||||
updated=1;
|
||||
break;
|
||||
}
|
||||
if [ ${i} -gt 6 ]; then
|
||||
sleep 3600 || exit 1
|
||||
else
|
||||
sleep 1200 || exit 1
|
||||
fi
|
||||
done
|
||||
if [ "${updated}" = "0" ]; then
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# disable all mirrors but GARR
|
||||
for repo_conf in /etc/entropy/repositories.conf.d/entropy_*; do
|
||||
# skip .example files
|
||||
if [[ "${repo_conf}" =~ .*\.example$ ]]; then
|
||||
echo "skipping ${repo_conf}"
|
||||
continue
|
||||
fi
|
||||
sed -n -e "/^pkg = .*pkg.sabayon.org/p" -e "/^repo = .*pkg.sabayon.org/p" \
|
||||
-e "/garr.it/p" -e "/^\[.*\]$/p" -i "${repo_conf}"
|
||||
done
|
||||
@@ -1,111 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
/usr/sbin/env-update
|
||||
. /etc/profile
|
||||
|
||||
sd_enable() {
|
||||
[[ -x /usr/bin/systemctl ]] && \
|
||||
systemctl --no-reload -f enable "${1}.service"
|
||||
}
|
||||
|
||||
sd_disable() {
|
||||
[[ -x /usr/bin/systemctl ]] && \
|
||||
systemctl --no-reload -f disable "${1}.service"
|
||||
}
|
||||
|
||||
echo
|
||||
echo "Configuring AMI root filesystem"
|
||||
echo "Ext4 is the expected filesystem type"
|
||||
echo "/dev/sda1 is the expected root filesystem partition"
|
||||
echo "ec2-user is the expected user"
|
||||
echo
|
||||
|
||||
# setup networking, make sure networkmanager is gone
|
||||
sd_enable NetworkManager
|
||||
sd_enable ModemManager
|
||||
|
||||
# drop other useless services
|
||||
sd_disable sabayonlive
|
||||
|
||||
# Enable ssh
|
||||
sd_enable sshd
|
||||
# Enable cron
|
||||
sd_enable vixie-cron
|
||||
|
||||
# delete root password, only ssh allowed
|
||||
passwd -d root
|
||||
|
||||
# create ec2-user
|
||||
useradd -d /home/ec2-user -k /etc/skel -g users -G wheel,disk,crontab \
|
||||
-m ec2-user || exit 1
|
||||
|
||||
# enable passwordless sudo for ec2-user
|
||||
echo -e "\n# molecule generated rule\nec2-user ALL=NOPASSWD: ALL" \
|
||||
>> /etc/sudoers
|
||||
|
||||
# setup fstab
|
||||
echo "# molecule generated fstab
|
||||
LABEL=/ / ext4 defaults 1 1
|
||||
none /dev/shm tmpfs defaults 0 0" > /etc/fstab
|
||||
|
||||
# setup networking, reset /etc/conf.d/net
|
||||
echo > /etc/conf.d/net
|
||||
|
||||
echo -5 | equo conf update
|
||||
mount -t proc proc /proc
|
||||
|
||||
export ETP_NONINTERACTIVE=1
|
||||
|
||||
# setup kernel
|
||||
eselect bzimage set 1 || exit 1
|
||||
|
||||
rm -f /boot/grub/grub.{cfg,conf}*
|
||||
echo "
|
||||
default=0
|
||||
fallback=1
|
||||
timeout=3
|
||||
hiddenmenu
|
||||
|
||||
title Sabayon Linux AMI (PV)
|
||||
root (hd0)
|
||||
kernel /boot/bzImage root=LABEL=/ console=hvc0 rootfstype=ext4
|
||||
initrd /boot/Initrd
|
||||
" > /boot/grub/grub.conf
|
||||
( cd /boot/grub && ln -sf grub.conf menu.lst ) || exit 1
|
||||
|
||||
# Generate list of installed packages
|
||||
equo query list installed -qv > /etc/sabayon-pkglist
|
||||
|
||||
echo "Vacuum cleaning client db"
|
||||
rm /var/lib/entropy/client/database/*/sabayonlinux.org -rf
|
||||
rm /var/lib/entropy/client/database/*/sabayon-weekly -rf
|
||||
equo rescue vacuum
|
||||
|
||||
# restore original repositories.conf (all mirrors were filtered for speed)
|
||||
cp /etc/entropy/repositories.conf.example /etc/entropy/repositories.conf || exit 1
|
||||
for repo_conf in /etc/entropy/repositories.conf.d/entropy_*.example; do
|
||||
new_repo_conf="${repo_conf%.example}"
|
||||
cp "${repo_conf}" "${new_repo_conf}"
|
||||
done
|
||||
|
||||
# cleanup log dir
|
||||
rm /var/lib/entropy/logs -rf
|
||||
# cleanup install-data dir
|
||||
rm -rf /install-data
|
||||
|
||||
ldconfig
|
||||
ldconfig
|
||||
umount /proc
|
||||
|
||||
|
||||
# remove hw hash
|
||||
rm -f /etc/entropy/.hw.hash
|
||||
# remove entropy pid file
|
||||
rm -f /var/run/entropy/entropy.lock
|
||||
|
||||
# remove /run/* and /var/lock/*
|
||||
# systemd mounts them using tmpfs
|
||||
rm -rf /run/*
|
||||
rm -rf /var/lock/*
|
||||
|
||||
exit 0
|
||||
@@ -1,10 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
# Copy packages list outside tarball
|
||||
pkglist_file="${CHROOT_DIR}/etc/sabayon-pkglist"
|
||||
if [ -f "${pkglist_file}" ]; then
|
||||
tar_dirname=$(dirname "${TAR_PATH}")
|
||||
if [ -d "${tar_dirname}" ]; then
|
||||
cp "${pkglist_file}" "${TAR_PATH}.pkglist"
|
||||
fi
|
||||
fi
|
||||
@@ -1,20 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
# Path to molecules.git dir
|
||||
SABAYON_MOLECULE_HOME="${SABAYON_MOLECULE_HOME:-/sabayon}"
|
||||
export SABAYON_MOLECULE_HOME
|
||||
|
||||
# execute parent script
|
||||
"${SABAYON_MOLECULE_HOME}"/scripts/remaster_post.sh
|
||||
if [ "${?}" != "0" ]; then
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Setup provisioning script for Amazon EC2 to load at startup
|
||||
EC2_DIR="${SABAYON_MOLECULE_HOME}/remaster/ec2_image"
|
||||
PROV_SCRIPT="ebs.ec2.start"
|
||||
cp -p "${EC2_DIR}/${PROV_SCRIPT}" "${CHROOT_DIR}/etc/local.d/" || exit 1
|
||||
chown root:root "${CHROOT_DIR}/etc/local.d/${PROV_SCRIPT}" || exit 1
|
||||
chmod 744 "${CHROOT_DIR}/etc/local.d/${PROV_SCRIPT}" || exit 1
|
||||
|
||||
exit 0
|
||||
Reference in New Issue
Block a user