initial data commit, yay!
This commit is contained in:
57
scripts/cdroot.py
Executable file
57
scripts/cdroot.py
Executable file
@@ -0,0 +1,57 @@
|
||||
#!/usr/bin/python
|
||||
import os, shutil, time
|
||||
from datetime import datetime
|
||||
|
||||
source_chroot_dir = os.getenv('SOURCE_CHROOT_DIR')
|
||||
chroot_dir = os.getenv('CHROOT_DIR')
|
||||
cdroot_dir = os.getenv('CDROOT_DIR')
|
||||
boot_dir = os.path.join(chroot_dir, "boot")
|
||||
cdroot_boot_dir = os.path.join(cdroot_dir, "boot")
|
||||
|
||||
boot_kernel = [x for x in os.listdir(boot_dir) if x.startswith("kernel-")]
|
||||
if boot_kernel:
|
||||
boot_kernel = os.path.join(boot_dir, sorted(boot_kernel)[0])
|
||||
shutil.copy2(boot_kernel, os.path.join(cdroot_boot_dir, "sabayon"))
|
||||
|
||||
boot_ramfs = [x for x in os.listdir(boot_dir) if x.startswith("initramfs-")]
|
||||
if boot_ramfs:
|
||||
boot_ramfs = os.path.join(boot_dir, sorted(boot_ramfs)[0])
|
||||
shutil.copy2(boot_ramfs, os.path.join(cdroot_boot_dir, "sabayon.igz"))
|
||||
|
||||
|
||||
# Write build info
|
||||
build_info_file = os.path.join(cdroot_dir, "BUILD_INFO")
|
||||
build_date = str(datetime.fromtimestamp(time.time()))
|
||||
bf = open(build_info_file, "w")
|
||||
bf.write("Sabayon ISO image build information\n")
|
||||
bf.write("Built on: %s\n" % (build_date,))
|
||||
bf.flush()
|
||||
bf.close()
|
||||
|
||||
def replace_version(path):
|
||||
release_version = os.getenv("RELEASE_VERSION", "HEAD")
|
||||
cf = open(path, "r")
|
||||
new_cf = []
|
||||
for line in cf.readlines():
|
||||
line = line.replace("__VERSION__", release_version)
|
||||
new_cf.append(line)
|
||||
cf.close()
|
||||
cf_new = open(path+".cdroot", "w")
|
||||
cf_new.writelines(new_cf)
|
||||
cf_new.flush()
|
||||
cf_new.close()
|
||||
os.rename(path+".cdroot", path)
|
||||
|
||||
# Change isolinux.cfg and isolinux.txt to match version
|
||||
isolinux_cfg = os.path.join(cdroot_dir, "isolinux/isolinux.cfg")
|
||||
isolinux_txt = os.path.join(cdroot_dir, "isolinux/isolinux.txt")
|
||||
replace_version(isolinux_cfg)
|
||||
replace_version(isolinux_txt)
|
||||
|
||||
# Copy pkglist over, if exists
|
||||
sabayon_pkgs_file = os.path.join(chroot_dir, "etc/sabayon-pkglist")
|
||||
if os.path.isfile(sabayon_pkgs_file):
|
||||
shutil.copy2(sabayon_pkgs_file, os.path.join(cdroot_dir, "pkglist"))
|
||||
iso_path = os.getenv("ISO_PATH")
|
||||
if iso_path:
|
||||
shutil.copy2(sabayon_pkgs_file, iso_path+".pkglist")
|
||||
153
scripts/daily_iso_build.sh
Executable file
153
scripts/daily_iso_build.sh
Executable file
@@ -0,0 +1,153 @@
|
||||
#!/bin/bash
|
||||
|
||||
for arg in $@
|
||||
do
|
||||
[[ "${arg}" = "--push" ]] && DO_PUSH="1"
|
||||
[[ "${arg}" = "--stdout" ]] && DO_STDOUT="1"
|
||||
if [ "${arg}" = "--pushonly" ]; then
|
||||
DO_PUSH="1"
|
||||
DRY_RUN="1"
|
||||
fi
|
||||
done
|
||||
|
||||
CUR_DATE=$(date -u +%Y%m%d)
|
||||
LOG_FILE="/var/log/molecule/autobuild-${CUR_DATE}-${$}.log"
|
||||
|
||||
# to make ISO remaster spec files working (pre_iso_script)
|
||||
export CUR_DATE
|
||||
export ETP_NONINTERACTIVE=1
|
||||
|
||||
echo "DO_PUSH=${DO_PUSH}"
|
||||
echo "DRY_RUN=${DRY_RUN}"
|
||||
echo "LOG_FILE=${LOG_FILE}"
|
||||
|
||||
SOURCE_SPECS=(
|
||||
"sabayon-x86-spinbase.spec"
|
||||
"sabayon-amd64-spinbase.spec"
|
||||
)
|
||||
SOURCE_SPECS_ISO=(
|
||||
"Sabayon_Linux_SpinBase_DAILY_x86.iso"
|
||||
"Sabayon_Linux_SpinBase_DAILY_amd64.iso"
|
||||
)
|
||||
|
||||
REMASTER_SPECS=(
|
||||
"sabayon-amd64-gnome.spec"
|
||||
"sabayon-x86-gnome.spec"
|
||||
"sabayon-amd64-kde.spec"
|
||||
"sabayon-x86-kde.spec"
|
||||
|
||||
"sabayon-amd64-lxde.spec"
|
||||
"sabayon-x86-lxde.spec"
|
||||
"sabayon-amd64-xfce.spec"
|
||||
"sabayon-x86-xfce.spec"
|
||||
"sabayon-amd64-e17.spec"
|
||||
"sabayon-x86-e17.spec"
|
||||
"sabayon-amd64-corecdx.spec"
|
||||
"sabayon-x86-corecdx.spec"
|
||||
"sabayon-amd64-serverbase.spec"
|
||||
"sabayon-x86-serverbase.spec"
|
||||
"sabayon-x86-gforensic.spec"
|
||||
)
|
||||
REMASTER_SPECS_ISO=(
|
||||
"Sabayon_Linux_DAILY_amd64_G.iso"
|
||||
"Sabayon_Linux_DAILY_x86_G.iso"
|
||||
"Sabayon_Linux_DAILY_amd64_K.iso"
|
||||
"Sabayon_Linux_DAILY_x86_K.iso"
|
||||
"Sabayon_Linux_DAILY_amd64_LXDE.iso"
|
||||
"Sabayon_Linux_DAILY_x86_LXDE.iso"
|
||||
"Sabayon_Linux_DAILY_amd64_XFCE.iso"
|
||||
"Sabayon_Linux_DAILY_x86_XFCE.iso"
|
||||
"Sabayon_Linux_DAILY_amd64_E17.iso"
|
||||
"Sabayon_Linux_DAILY_x86_E17.iso"
|
||||
"Sabayon_Linux_CoreCDX_DAILY_amd64.iso"
|
||||
"Sabayon_Linux_CoreCDX_DAILY_x86.iso"
|
||||
"Sabayon_Linux_ServerBase_DAILY_amd64.iso"
|
||||
"Sabayon_Linux_ServerBase_DAILY_x86.iso"
|
||||
"Sabayon_Linux_Gforensic_DAILY_x86.iso"
|
||||
)
|
||||
|
||||
REMASTER_OPENVZ_SPECS=(
|
||||
"sabayon-amd64-spinbase-openvz-template.spec"
|
||||
"sabayon-x86-spinbase-openvz-template.spec"
|
||||
)
|
||||
REMASTER_OPENVZ_SPECS_TAR=(
|
||||
"Sabayon_Linux_SpinBase_DAILY_amd64_openvz.tar.gz"
|
||||
"Sabayon_Linux_SpinBase_DAILY_x86_openvz.tar.gz"
|
||||
)
|
||||
|
||||
[[ -d "/sabayon/molecules/daily" ]] || mkdir -p /sabayon/molecules/daily
|
||||
[[ -d "/var/log/molecule" ]] || mkdir -p /var/log/molecule
|
||||
|
||||
|
||||
move_to_pkg_sabayon_org() {
|
||||
if [ -n "${DO_PUSH}" ] || [ -f /sabayon/DO_PUSH ]; then
|
||||
rm -f /sabayon/DO_PUSH
|
||||
rsync -av --partial --delete-excluded /sabayon/iso_rsync/*DAILY* \
|
||||
entropy@pkg.sabayon.org:/sabayon/rsync/rsync.sabayon.org/iso/daily
|
||||
fi
|
||||
}
|
||||
|
||||
build_sabayon() {
|
||||
if [ -z "${DRY_RUN}" ]; then
|
||||
rm -rf /sabayon/molecules/daily/*.spec
|
||||
rm -rf /sabayon/molecules/daily/remaster/*.spec
|
||||
|
||||
for i in ${!SOURCE_SPECS[@]}
|
||||
do
|
||||
src="/sabayon/molecules/${SOURCE_SPECS[i]}"
|
||||
dst="/sabayon/molecules/daily/${SOURCE_SPECS[i]}"
|
||||
cp "${src}" "${dst}" -p || exit 1
|
||||
echo >> "${dst}"
|
||||
echo "inner_source_chroot_script: /sabayon/scripts/inner_source_chroot_update.sh" >> "${dst}"
|
||||
# tweak iso image name
|
||||
sed -i "s/^#.*destination_iso_image_name/destination_iso_image_name:/" "${dst}" || exit 1
|
||||
sed -i "s/destination_iso_image_name.*/destination_iso_image_name: ${SOURCE_SPECS_ISO[i]}/" "${dst}" || exit 1
|
||||
# tweak release version
|
||||
sed -i "s/release_version.*/release_version: ${CUR_DATE}/" "${dst}" || exit 1
|
||||
echo "${dst}: iso: ${SOURCE_SPECS_ISO[i]} date: ${CUR_DATE}"
|
||||
done
|
||||
|
||||
for i in ${!REMASTER_SPECS[@]}
|
||||
do
|
||||
src="/sabayon/molecules/${REMASTER_SPECS[i]}"
|
||||
dst="/sabayon/molecules/daily/remaster/${REMASTER_SPECS[i]}"
|
||||
cp "${src}" "${dst}" -p || exit 1
|
||||
# tweak iso image name
|
||||
sed -i "s/^#.*destination_iso_image_name/destination_iso_image_name:/" "${dst}" || exit 1
|
||||
sed -i "s/destination_iso_image_name.*/destination_iso_image_name: ${REMASTER_SPECS_ISO[i]}/" "${dst}" || exit 1
|
||||
# tweak release version
|
||||
sed -i "s/release_version.*/release_version: ${CUR_DATE}/" "${dst}" || exit 1
|
||||
echo "${dst}: iso: ${REMASTER_SPECS_ISO[i]} date: ${CUR_DATE}"
|
||||
done
|
||||
|
||||
for i in ${!REMASTER_OPENVZ_SPECS[@]}
|
||||
do
|
||||
src="/sabayon/molecules/${REMASTER_OPENVZ_SPECS[i]}"
|
||||
dst="/sabayon/molecules/daily/remaster/${REMASTER_OPENVZ_SPECS[i]}"
|
||||
cp "${src}" "${dst}" -p || exit 1
|
||||
# tweak tar name
|
||||
sed -i "s/^#.*tar_name/tar_name:/" "${dst}" || exit 1
|
||||
sed -i "s/tar_name.*/tar_name: ${REMASTER_OPENVZ_SPECS_TAR[i]}/" "${dst}" || exit 1
|
||||
# tweak release version
|
||||
sed -i "s/release_version.*/release_version: ${CUR_DATE}/" "${dst}" || exit 1
|
||||
echo "${dst}: iso: ${REMASTER_OPENVZ_SPECS_TAR[i]} date: ${CUR_DATE}"
|
||||
done
|
||||
|
||||
molecule --nocolor /sabayon/molecules/daily/*.spec && \
|
||||
molecule --nocolor /sabayon/molecules/daily/remaster/*.spec && \
|
||||
cp /sabayon/iso/*DAILY* /sabayon/iso_rsync/ && \
|
||||
( date > /sabayon/iso_rsync/RELEASE_DATE_DAILY ) && \
|
||||
/sabayon/scripts/make_torrents.sh
|
||||
fi
|
||||
}
|
||||
|
||||
if [ -n "${DO_STDOUT}" ]; then
|
||||
build_sabayon && move_to_pkg_sabayon_org
|
||||
else
|
||||
( build_sabayon && move_to_pkg_sabayon_org ) &> "/var/log/molecule/autobuild-${CUR_DATE}-${$}.log"
|
||||
fi
|
||||
|
||||
CUR_DAY=$(date -u +%d)
|
||||
if [ "${CUR_DAY}" = "01" ]; then
|
||||
rm -rf /sabayon/pkgcache/*
|
||||
fi
|
||||
35
scripts/generic_pre_iso_script.sh
Executable file
35
scripts/generic_pre_iso_script.sh
Executable file
@@ -0,0 +1,35 @@
|
||||
#!/bin/bash
|
||||
|
||||
/usr/sbin/env-update && source /etc/profile
|
||||
|
||||
remaster_type="${1}"
|
||||
isolinux_source="/sabayon/remaster/minimal_isolinux.cfg"
|
||||
isolinux_destination="${CDROOT_DIR}/isolinux/isolinux.cfg"
|
||||
|
||||
if [ "${remaster_type}" = "KDE" ] || [ "${remaster_type}" = "GNOME" ]; then
|
||||
isolinux_source="/sabayon/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"
|
||||
fi
|
||||
cp "${isolinux_source}" "${isolinux_destination}" || exit 1
|
||||
|
||||
ver=${RELEASE_VERSION}
|
||||
[[ -z "${ver}" ]] && ver=${CUR_DATE}
|
||||
[[ -z "${ver}" ]] && ver="5.3"
|
||||
|
||||
sed -i "s/__VERSION__/${ver}/g" "${isolinux_destination}"
|
||||
sed -i "s/__FLAVOUR__/${remaster_type}/g" "${isolinux_destination}"
|
||||
|
||||
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
|
||||
cp "${sabayon_pkgs_file}" "${ISO_PATH}".pkglist
|
||||
fi
|
||||
fi
|
||||
5
scripts/gforensic_pre_iso_script.sh
Executable file
5
scripts/gforensic_pre_iso_script.sh
Executable file
@@ -0,0 +1,5 @@
|
||||
#!/bin/bash
|
||||
GFORENSIC_DIR="/sabayon/remaster/gforensic"
|
||||
cp "${GFORENSIC_DIR}"/isolinux/isolinux.cfg "${CDROOT_DIR}/isolinux/isolinux.cfg"
|
||||
cp "${GFORENSIC_DIR}"/isolinux/back.jpg "${CDROOT_DIR}/isolinux/back.jpg"
|
||||
cp "${GFORENSIC_DIR}"/isolinux/isolinux.txt "${CDROOT_DIR}/isolinux/back.txt"
|
||||
14
scripts/gforensic_remaster_post.sh
Executable file
14
scripts/gforensic_remaster_post.sh
Executable file
@@ -0,0 +1,14 @@
|
||||
#!/bin/sh
|
||||
|
||||
# execute parent script
|
||||
/sabayon/scripts/remaster_post.sh
|
||||
|
||||
GFORENSIC_DIR="/sabayon/remaster/gforensic"
|
||||
# setup skel and background
|
||||
cp "${GFORENSIC_DIR}"/usr/share/backgrounds/sabayon-forensic.png "${CHROOT_DIR}/usr/share/backgrounds/sabayonlinux.png"
|
||||
cp "${GFORENSIC_DIR}"/usr/share/backgrounds/sabayon-forensic.jpg "${CHROOT_DIR}/usr/share/backgrounds/sabayonlinux.jpg"
|
||||
cp "${GFORENSIC_DIR}"/usr/share/backgrounds/kgdm.jpg ${CHROOT_DIR}/usr/share/backgrounds/kgdm.jpg
|
||||
cp "${GFORENSIC_DIR}"/files/org.freedesktop.udisks.policy "${CHROOT_DIR}/usr/share/polkit-1/actions/org.freedesktop.udisks.policy"
|
||||
cp "${GFORENSIC_DIR}"/files/xorg.conf.kjs "${CHROOT_DIR}/etc/X11/xorg.conf.kjs"
|
||||
cp "${GFORENSIC_DIR}"/etc/skel/.gconf/desktop/gnome/interface/%gconf.xml "${CHROOT_DIR}/etc/skel/.gconf/desktop/gnome/interface/%gconf.xml"
|
||||
cp "${GFORENSIC_DIR}"/etc/skel/.gconf/apps/nautilus/preferences/%gconf.xml "${CHROOT_DIR}/etc/skel/.gconf/apps/nautilus/preferences/%gconf.xml"
|
||||
98
scripts/inner_chroot_script.sh
Executable file
98
scripts/inner_chroot_script.sh
Executable file
@@ -0,0 +1,98 @@
|
||||
#!/bin/bash
|
||||
|
||||
source /etc/profile
|
||||
/usr/sbin/env-update && source /etc/profile
|
||||
|
||||
# Setup locale to en_US
|
||||
echo LANG=\"en_US.UTF-8\" > /etc/env.d/02locale
|
||||
echo LANGUAGE=\"en_US.UTF-8\" >> /etc/env.d/02locale
|
||||
echo LC_ALL=\"en_US.UTF-8\" >> /etc/env.d/02locale
|
||||
|
||||
# remove SSH keys
|
||||
rm -rf /etc/ssh/*_key*
|
||||
|
||||
# better remove postfix package manager generated
|
||||
# SSL certificates
|
||||
rm -rf /etc/ssl/postfix/server.*
|
||||
|
||||
# make sure postfix only listens on localhost
|
||||
echo "inet_interfaces = localhost" >> /etc/postfix/main.cf
|
||||
# do not add it yet to runlevel
|
||||
# rc-update add postfix default
|
||||
|
||||
# allow root logins to the livecd by default
|
||||
# turn bashlogin shells to actual login shells
|
||||
sed -i 's:exec -l /bin/bash:exec -l /bin/bash -l:' /bin/bashlogin
|
||||
|
||||
# enable cd eject on shutdown/reboot
|
||||
rc-update add cdeject shutdown
|
||||
|
||||
# setup sudoers
|
||||
[ -e /etc/sudoers ] && sed -i '/NOPASSWD: ALL/ s/^# //' /etc/sudoers
|
||||
|
||||
# setup opengl in /etc (if configured)
|
||||
eselect opengl set xorg-x11 &> /dev/null
|
||||
|
||||
# touch /etc/asound.state
|
||||
touch /etc/asound.state
|
||||
|
||||
update-pciids
|
||||
update-usbids
|
||||
|
||||
echo -5 | etc-update
|
||||
mount -t proc proc /proc
|
||||
/lib/rc/bin/rc-depend -u
|
||||
|
||||
echo "Vacuum cleaning client db"
|
||||
equo rescue vacuum
|
||||
|
||||
# Generate openrc cache
|
||||
/etc/init.d/savecache start
|
||||
/etc/init.d/savecache zap
|
||||
|
||||
ldconfig
|
||||
ldconfig
|
||||
umount /proc
|
||||
|
||||
equo deptest --pretend
|
||||
emaint --fix world
|
||||
|
||||
# copy Portage config from sabayonlinux.org entropy repo to system
|
||||
cp /var/lib/entropy/client/database/*/sabayonlinux.org/standard/*/*/package.mask /etc/portage/package.mask
|
||||
cp /var/lib/entropy/client/database/*/sabayonlinux.org/standard/*/*/package.unmask /etc/portage/package.unmask
|
||||
cp /var/lib/entropy/client/database/*/sabayonlinux.org/standard/*/*/package.use /etc/portage/package.use
|
||||
cp /var/lib/entropy/client/database/*/sabayonlinux.org/standard/*/*/make.conf /etc/make.conf
|
||||
|
||||
# Update sabayon overlay
|
||||
layman -d sabayon
|
||||
rm -rf /var/lib/layman/sabayon
|
||||
|
||||
# Reset users' password
|
||||
echo "root:" | chpasswd
|
||||
|
||||
# protect /var/tmp
|
||||
touch /var/tmp/.keep
|
||||
touch /tmp/.keep
|
||||
chmod 777 /var/tmp
|
||||
chmod 777 /tmp
|
||||
|
||||
# Looks like screen directories are missing
|
||||
if [ ! -d "/var/run/screen" ]; then
|
||||
mkdir /var/run/screen
|
||||
chmod 775 /var/run/screen
|
||||
chown root:utmp /var/run/screen
|
||||
fi
|
||||
|
||||
# Regenerate Fluxbox menu
|
||||
if [ -x "/usr/bin/fluxbox-generate_menu" ]; then
|
||||
fluxbox-generate_menu -o /etc/skel/.fluxbox/menu
|
||||
fi
|
||||
|
||||
equo query list installed -qv > /etc/sabayon-pkglist
|
||||
|
||||
rm -rf /var/tmp/entropy/*
|
||||
rm -rf /var/lib/entropy/logs
|
||||
rm -rf /var/lib/entropy/glsa
|
||||
rm -rf /var/lib/entropy/tmp
|
||||
|
||||
exit 0
|
||||
20
scripts/inner_source_chroot_update.sh
Executable file
20
scripts/inner_source_chroot_update.sh
Executable file
@@ -0,0 +1,20 @@
|
||||
#!/bin/bash
|
||||
|
||||
source /etc/profile
|
||||
env-update
|
||||
source /etc/profile
|
||||
|
||||
# Setup environment vars
|
||||
export ETP_NONINTERACTIVE=1
|
||||
if [ -d "/usr/portage/licenses" ]; then
|
||||
export ACCEPT_LICENSE="$(ls /usr/portage/licenses -1 | xargs)"
|
||||
fi
|
||||
|
||||
export ETP_NOINTERACTIVE=1
|
||||
export FORCE_EAPI=2
|
||||
equo update || ( sleep 1200 && equo update ) || exit 1
|
||||
equo upgrade || exit 1
|
||||
echo "-5" | equo conf update
|
||||
rm -rf /var/lib/entropy/client/packages
|
||||
|
||||
equo query list installed -qv > /etc/sabayon-pkglist
|
||||
16
scripts/make_torrents.sh
Executable file
16
scripts/make_torrents.sh
Executable file
@@ -0,0 +1,16 @@
|
||||
#!/bin/sh
|
||||
|
||||
/usr/sbin/env-update && source /etc/profile
|
||||
|
||||
announce_url="http://tracker.sabayon.org/tracker.php/announce"
|
||||
iso_dir="/sabayon/iso"
|
||||
cd "${iso_dir}"
|
||||
|
||||
for iso_file in "${iso_dir}"/*.{iso,tar.gz}; do
|
||||
iso_name="${iso_file/.iso}"
|
||||
iso_name="${iso_name/.tar.gz}"
|
||||
torrent_file="${iso_file}.torrent"
|
||||
[[ -f "${torrent_file}" ]] && rm "${torrent_file}"
|
||||
iso_file_name="$(basename ${iso_file})"
|
||||
mktorrent-borg -nd -a "${announce_url}" -n "${iso_name}" -o "${torrent_file}" "${iso_file_name}" || exit 1
|
||||
done
|
||||
221
scripts/remaster_generic_inner_chroot_script_after.sh
Executable file
221
scripts/remaster_generic_inner_chroot_script_after.sh
Executable file
@@ -0,0 +1,221 @@
|
||||
#!/bin/bash
|
||||
|
||||
# do not remove these
|
||||
/usr/sbin/env-update
|
||||
source /etc/profile
|
||||
|
||||
eselect opengl set xorg-x11 &> /dev/null
|
||||
|
||||
# automatically start xdm
|
||||
rc-update del xdm default
|
||||
rc-update del xdm boot
|
||||
rc-update add xdm boot
|
||||
|
||||
# consolekit must be run at boot level
|
||||
rc-update add consolekit boot
|
||||
|
||||
rc-update del hald boot
|
||||
rc-update del hald
|
||||
rc-update add hald boot
|
||||
|
||||
rc-update del NetworkManager default
|
||||
rc-update del NetworkManager
|
||||
rc-update add NetworkManager default
|
||||
|
||||
rc-update del music boot
|
||||
rc-update add music default
|
||||
|
||||
rc-update del sabayon-mce default
|
||||
|
||||
rc-update add nfsmount default
|
||||
|
||||
# Always startup this
|
||||
rc-update add virtualbox-guest-additions boot
|
||||
|
||||
remove_desktop_files() {
|
||||
rm /etc/skel/Desktop/WorldOfGooDemo-world-of-goo-demo.desktop
|
||||
rm /etc/skel/Desktop/fusion-icon.desktop
|
||||
rm /etc/skel/Desktop/xbmc.desktop
|
||||
}
|
||||
|
||||
setup_cpufrequtils() {
|
||||
rc-update add cpufrequtils default
|
||||
}
|
||||
|
||||
setup_sabayon_mce() {
|
||||
rc-update add sabayon-mce boot
|
||||
# not needed, done by app-misc/sabayon-mce pkg
|
||||
# Sabayon Media Center user setup
|
||||
# source /sbin/sabayon-functions.sh
|
||||
# sabayon_setup_live_user "sabayonmce"
|
||||
}
|
||||
|
||||
nspluginwrapper_autoinstall() {
|
||||
if [ -x /usr/bin/nspluginwrapper ]; then
|
||||
echo "Auto installing 32bit ns plugins..."
|
||||
nspluginwrapper -a -i
|
||||
ls /usr/lib/nsbrowser/plugins
|
||||
|
||||
# Remove wrappers if equivalent 64-bit plugins exist
|
||||
# TODO: May be better to patch nspluginwrapper so it doesn't create
|
||||
# duplicate wrappers in the first place...
|
||||
local DIR64="/usr/lib/nsbrowser/plugins/"
|
||||
for f in "${DIR64}"/npwrapper.*.so; do
|
||||
local PLUGIN=${f##*/npwrapper.}
|
||||
if [[ -f ${DIR64}/${PLUGIN} ]]; then
|
||||
echo " Removing duplicate wrapper for native 64-bit ${PLUGIN}"
|
||||
nspluginwrapper -r "${f}"
|
||||
fi
|
||||
done
|
||||
fi
|
||||
}
|
||||
|
||||
if [ "$1" = "lxde" ]; then
|
||||
# Fix ~/.dmrc to have it load LXDE
|
||||
echo "[Desktop]" > /etc/skel/.dmrc
|
||||
echo "Session=LXDE" >> /etc/skel/.dmrc
|
||||
remove_desktop_files
|
||||
sed -i 's/DISPLAYMANAGER=".*"/DISPLAYMANAGER="gdm"/g' /etc/conf.d/xdm
|
||||
# properly tweak lxde autostart tweak, adding --desktop option
|
||||
sed -i 's/pcmanfm -d/pcmanfm -d --desktop/g' /etc/xdg/lxsession/LXDE/autostart
|
||||
setup_cpufrequtils
|
||||
elif [ "$1" = "e17" ]; then
|
||||
# Fix ~/.dmrc to have it load E17
|
||||
echo "[Desktop]" > /etc/skel/.dmrc
|
||||
echo "Session=enlightenment" >> /etc/skel/.dmrc
|
||||
remove_desktop_files
|
||||
sed -i 's/DISPLAYMANAGER=".*"/DISPLAYMANAGER="lxdm"/g' /etc/conf.d/xdm
|
||||
# TODO: improve the lines below
|
||||
# Make sure enlightenment is selected in lxdm
|
||||
sed -i '/lxdm-greeter-gtk/ a\\nlast_session=enlightenment.desktop\nlast_lang=' /etc/lxdm/lxdm.conf
|
||||
# Fix ~/.gtkrc-2.0 for some nice icons in gtk
|
||||
echo 'gtk-icon-theme-name="Tango" gtk-theme-name="Xfce"' | tr " " "\n" > /etc/skel/.gtkrc-2.0
|
||||
setup_cpufrequtils
|
||||
elif [ "$1" = "xfce" ]; then
|
||||
# Fix ~/.dmrc to have it load XFCE
|
||||
echo "[Desktop]" > /etc/skel/.dmrc
|
||||
echo "Session=xfce" >> /etc/skel/.dmrc
|
||||
remove_desktop_files
|
||||
setup_cpufrequtils
|
||||
sed -i 's/DISPLAYMANAGER=".*"/DISPLAYMANAGER="gdm"/g' /etc/conf.d/xdm
|
||||
elif [ "$1" = "fluxbox" ]; then
|
||||
# Fix ~/.dmrc to have it load Fluxbox
|
||||
echo "[Desktop]" > /etc/skel/.dmrc
|
||||
echo "Session=fluxbox" >> /etc/skel/.dmrc
|
||||
remove_desktop_files
|
||||
sed -i 's/DISPLAYMANAGER=".*"/DISPLAYMANAGER="gdm"/g' /etc/conf.d/xdm
|
||||
setup_cpufrequtils
|
||||
elif [ "$1" = "gnome" ]; then
|
||||
# Fix ~/.dmrc to have it load GNOME
|
||||
echo "[Desktop]" > /etc/skel/.dmrc
|
||||
echo "Session=gnome" >> /etc/skel/.dmrc
|
||||
SHIP_NVIDIA_LEGACY="1"
|
||||
rc-update del system-tools-backends boot
|
||||
rc-update add system-tools-backends default
|
||||
sed -i 's/DISPLAYMANAGER=".*"/DISPLAYMANAGER="gdm"/g' /etc/conf.d/xdm
|
||||
setup_sabayon_mce
|
||||
elif [ "$1" = "kde" ]; then
|
||||
# Fix ~/.dmrc to have it load KDE
|
||||
echo "[Desktop]" > /etc/skel/.dmrc
|
||||
echo "Session=KDE-4" >> /etc/skel/.dmrc
|
||||
SHIP_NVIDIA_LEGACY="1"
|
||||
sed -i 's/DISPLAYMANAGER=".*"/DISPLAYMANAGER="kdm"/g' /etc/conf.d/xdm
|
||||
setup_sabayon_mce
|
||||
fi
|
||||
|
||||
if [ -n "${SHIP_NVIDIA_LEGACY}" ]; then
|
||||
# Prepare NVIDIA legacy drivers infrastructure
|
||||
|
||||
if [ ! -d "/install-data/drivers" ]; then
|
||||
mkdir -p /install-data/drivers
|
||||
fi
|
||||
myuname=$(uname -m)
|
||||
mydir="x86"
|
||||
if [ "$myuname" == "x86_64" ]; then
|
||||
mydir="amd64"
|
||||
fi
|
||||
kernel_tag="#$(equo query installed -qv sys-kernel/linux-sabayon | sort | head -n 1 | cut -d"-" -f 4 | sed 's/ //g')-sabayon"
|
||||
|
||||
rm -rf /var/lib/entropy/client/packages/packages*/${mydir}/*/x11-drivers*
|
||||
ACCEPT_LICENSE="NVIDIA" equo install --fetch --nodeps =x11-drivers/nvidia-drivers-173*$kernel_tag
|
||||
ACCEPT_LICENSE="NVIDIA" equo install --fetch --nodeps =x11-drivers/nvidia-drivers-96*$kernel_tag
|
||||
# not working with >=xorg-server-1.5
|
||||
# ACCEPT_LICENSE="NVIDIA" equo install --fetch --nodeps ~x11-drivers/nvidia-drivers-71.86.*$kernel_tag
|
||||
mv /var/lib/entropy/client/packages/packages-nonfree/${mydir}/*/x11-drivers\:nvidia-drivers*.tbz2 /install-data/drivers/
|
||||
|
||||
# Add fusion icon to desktop
|
||||
if [ -f "/usr/share/applications/fusion-icon.desktop" ]; then
|
||||
cp /usr/share/applications/fusion-icon.desktop /etc/skel/Desktop/
|
||||
fi
|
||||
fi
|
||||
|
||||
# fix clamav shit if available
|
||||
clamav_avail=$(equo query installed app-antivirus/clamav -q)
|
||||
if [ -n "${clamav_avail}" ]; then
|
||||
if [ ! -d "/var/log/clamav" ]; then
|
||||
mkdir -p /var/log/clamav
|
||||
chown clamav:clamav /var/log/clamav
|
||||
fi
|
||||
touch /var/log/clamav/freshclam.log
|
||||
chown clamav:clamav /var/log/clamav/freshclam.log
|
||||
fi
|
||||
|
||||
# if Sabayon GNOME, drop qt-gui bins
|
||||
gnome_panel=$(qlist -ICve gnome-base/gnome-panel)
|
||||
if [ -n "${gnome_panel}" ]; then
|
||||
find /usr/share/applications -name "*qt-gui*.desktop" | xargs rm
|
||||
fi
|
||||
# we don't want this on our ISO
|
||||
rm -f /usr/share/applications/sandbox.desktop
|
||||
|
||||
# Remove wicd from autostart
|
||||
rm -f /usr/share/autostart/wicd-tray.desktop /etc/xdg/autostart/wicd-tray.desktop
|
||||
|
||||
# EXPERIMENTAL, clean icon cache files
|
||||
for file in `find /usr/share/icons -name "icon-theme.cache"`; do
|
||||
rm $file
|
||||
done
|
||||
|
||||
# Fixup nsplugins
|
||||
nspluginwrapper_autoinstall
|
||||
|
||||
# Update package list
|
||||
equo query list installed -qv > /etc/sabayon-pkglist
|
||||
|
||||
# Setup basic GTK theme for root user
|
||||
if [ ! -f "/root/.gtkrc-2.0" ]; then
|
||||
echo "include \"/usr/share/themes/Clearlooks/gtk-2.0/gtkrc\"" > /root/.gtkrc-2.0
|
||||
fi
|
||||
|
||||
# Regenerate Fluxbox menu
|
||||
if [ -x "/usr/bin/fluxbox-generate_menu" ]; then
|
||||
fluxbox-generate_menu -o /etc/skel/.fluxbox/menu
|
||||
fi
|
||||
|
||||
layman -d sabayon
|
||||
rm -rf /var/lib/layman/sabayon
|
||||
|
||||
|
||||
echo -5 | equo conf update
|
||||
mount -t proc proc /proc
|
||||
/lib/rc/bin/rc-depend -u
|
||||
|
||||
echo "Vacuum cleaning client db"
|
||||
rm /var/lib/entropy/client/database/*/sabayonlinux.org -rf
|
||||
equo rescue vacuum
|
||||
|
||||
# cleanup log dir
|
||||
rm /var/lib/entropy/logs -rf
|
||||
|
||||
# Generate openrc cache
|
||||
/etc/init.d/savecache start
|
||||
/etc/init.d/savecache zap
|
||||
|
||||
ldconfig
|
||||
ldconfig
|
||||
umount /proc
|
||||
|
||||
equo deptest --pretend
|
||||
emaint --fix world
|
||||
|
||||
exit 0
|
||||
25
scripts/remaster_gforensic_inner_chroot_script_after.sh
Executable file
25
scripts/remaster_gforensic_inner_chroot_script_after.sh
Executable file
@@ -0,0 +1,25 @@
|
||||
#!/bin/sh
|
||||
|
||||
# call parent script first
|
||||
/sabayon/scripts/remaster_generic_inner_chroot_script_after.sh $@
|
||||
|
||||
# do custom stuff
|
||||
#remove desktop icons
|
||||
rm /etc/skel/Desktop/*
|
||||
#remove no longer needed folders/files
|
||||
rm -r /etc/skel/.fluxbox
|
||||
rm -r /etc/skel/.e
|
||||
rm -r /etc/skel/.kde4
|
||||
rm -r /etc/skel/.mozilla
|
||||
rm -r /etc/skel/.emerald
|
||||
rm -r /etc/skel/.xchat2
|
||||
rm -r /etc/skel/.config/compiz
|
||||
rm -r /etc/skel/.config/lxpanel
|
||||
rm -r /etc/skel/.config/pcmanfm
|
||||
rm -r /etc/skel/.config/Thunar
|
||||
rm -r /etc/skel/.config/xfce4
|
||||
rm -r /etc/skel/.gconf/apps/compiz
|
||||
rm -r /etc/skel/.gconf/apps/gset-compiz
|
||||
rm /etc/skel/.config/menus/applications-kmenuedit.menu
|
||||
rm /etc/skel/.kderc
|
||||
|
||||
7
scripts/remaster_post.sh
Executable file
7
scripts/remaster_post.sh
Executable file
@@ -0,0 +1,7 @@
|
||||
#!/bin/sh
|
||||
PKGS_DIR="/sabayon/pkgcache"
|
||||
CHROOT_PKGS_DIR="${CHROOT_DIR}/var/lib/entropy/client/packages"
|
||||
|
||||
echo "Merging back packages"
|
||||
cp "${CHROOT_PKGS_DIR}"/* "${PKGS_DIR}"/ -Ra
|
||||
rm -rf "${CHROOT_PKGS_DIR}"{,-nonfree,-restricted}/*
|
||||
11
scripts/remaster_pre.sh
Executable file
11
scripts/remaster_pre.sh
Executable file
@@ -0,0 +1,11 @@
|
||||
#!/bin/sh
|
||||
PKGS_DIR="/sabayon/pkgcache"
|
||||
CHROOT_PKGS_DIR="${CHROOT_DIR}/var/lib/entropy/client/packages"
|
||||
|
||||
[[ ! -d "${PKGS_DIR}" ]] && mkdir -p "${PKGS_DIR}"
|
||||
[[ ! -d "${CHROOT_PKGS_DIR}" ]] && mkdir -p "${CHROOT_PKGS_DIR}"
|
||||
|
||||
echo "Mounting packages over"
|
||||
rm -rf "${CHROOT_PKGS_DIR}"/*
|
||||
cp ${PKGS_DIR}/* "${CHROOT_PKGS_DIR}"/ -Ra
|
||||
exit 0
|
||||
10
scripts/spinbase_openvz_pre_tar_script.sh
Executable file
10
scripts/spinbase_openvz_pre_tar_script.sh
Executable file
@@ -0,0 +1,10 @@
|
||||
#!/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
|
||||
6
scripts/tar_generic_inner_chroot_script_after.sh
Executable file
6
scripts/tar_generic_inner_chroot_script_after.sh
Executable file
@@ -0,0 +1,6 @@
|
||||
#!/bin/bash
|
||||
|
||||
/usr/sbin/env-update && source /etc/profile
|
||||
|
||||
# Generate list of installed packages
|
||||
equo query list installed -qv > /etc/sabayon-pkglist
|
||||
Reference in New Issue
Block a user