[molecules] drop unused spec files and scripts

This commit is contained in:
Fabio Erculiani
2014-11-29 21:27:54 +00:00
parent d8642e328f
commit 886d5baff6
6 changed files with 0 additions and 278 deletions
@@ -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
-20
View File
@@ -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