2010-09-17 13:40:17 +02:00
|
|
|
#!/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
|
|
|
|
|
2011-03-02 15:22:38 +01:00
|
|
|
# if it exists
|
|
|
|
if [ -f "/etc/init.d/hald" ]; then
|
|
|
|
rc-update del hald boot
|
|
|
|
rc-update del hald
|
|
|
|
rc-update add hald boot
|
|
|
|
fi
|
2010-09-17 13:40:17 +02:00
|
|
|
|
|
|
|
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
|
|
|
|
}
|
|
|
|
|
|
|
|
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
|
|
|
|
}
|
|
|
|
|
2011-09-03 09:17:50 +02:00
|
|
|
switch_kernel() {
|
|
|
|
local from_kernel="${1}"
|
|
|
|
local to_kernel="${2}"
|
|
|
|
|
|
|
|
kernel-switcher switch "${to_kernel}"
|
|
|
|
if [ "${?}" != "0" ]; then
|
|
|
|
return 1
|
|
|
|
fi
|
|
|
|
equo remove "${from_kernel}"
|
|
|
|
if [ "${?}" != "0" ]; then
|
|
|
|
return 1
|
|
|
|
fi
|
|
|
|
return 0
|
|
|
|
}
|
|
|
|
|
2010-09-21 10:04:04 +02:00
|
|
|
setup_displaymanager() {
|
|
|
|
# determine what is the login manager
|
2010-09-23 09:23:03 +02:00
|
|
|
if [ -n "$(equo match --installed gnome-base/gdm -qv)" ]; then
|
2010-09-21 10:04:04 +02:00
|
|
|
sed -i 's/DISPLAYMANAGER=".*"/DISPLAYMANAGER="gdm"/g' /etc/conf.d/xdm
|
2010-09-23 09:23:03 +02:00
|
|
|
elif [ -n "$(equo match --installed lxde-base/lxdm -qv)" ]; then
|
2010-09-21 10:04:04 +02:00
|
|
|
sed -i 's/DISPLAYMANAGER=".*"/DISPLAYMANAGER="lxdm"/g' /etc/conf.d/xdm
|
2010-09-23 09:23:03 +02:00
|
|
|
elif [ -n "$(equo match --installed kde-base/kdm -qv)" ]; then
|
2010-09-21 10:04:04 +02:00
|
|
|
sed -i 's/DISPLAYMANAGER=".*"/DISPLAYMANAGER="kdm"/g' /etc/conf.d/xdm
|
|
|
|
else
|
|
|
|
sed -i 's/DISPLAYMANAGER=".*"/DISPLAYMANAGER="xdm"/g' /etc/conf.d/xdm
|
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
2010-11-26 13:26:42 +01:00
|
|
|
setup_networkmanager() {
|
|
|
|
rc-update del NetworkManager default
|
|
|
|
rc-update del NetworkManager
|
|
|
|
rc-update add NetworkManager default
|
|
|
|
}
|
|
|
|
|
2010-10-03 11:29:43 +02:00
|
|
|
gforensic_remove_skel_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/.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
|
2011-02-03 20:37:16 +01:00
|
|
|
rm -r /etc/skel/.gconf/apps/gset-compiz
|
2010-10-03 11:29:43 +02:00
|
|
|
}
|
2010-09-21 09:54:06 +02:00
|
|
|
|
2011-01-22 20:46:13 +01:00
|
|
|
setup_oss_gfx_drivers() {
|
|
|
|
# do not tweak eselect mesa, keep defaults
|
|
|
|
|
2011-03-17 23:56:38 +01:00
|
|
|
# This file is polled by the txt.cfg
|
|
|
|
# (isolinux config file) setup script
|
2011-01-22 20:46:13 +01:00
|
|
|
touch /.enable_kms
|
|
|
|
}
|
|
|
|
|
2011-08-13 15:43:41 +02:00
|
|
|
has_proprietary_drivers() {
|
|
|
|
local is_nvidia=$(equo match --installed x11-drivers/nvidia-drivers -qv)
|
|
|
|
if [ -n "${is_nvidia}" ]; then
|
|
|
|
return 0
|
|
|
|
fi
|
|
|
|
local is_ati=$(equo match --installed x11-drivers/ati-drivers -qv)
|
|
|
|
if [ -n "${is_ati}" ]; then
|
|
|
|
return 0
|
|
|
|
fi
|
|
|
|
return 1
|
|
|
|
}
|
|
|
|
|
2011-01-22 20:46:13 +01:00
|
|
|
setup_proprietary_gfx_drivers() {
|
|
|
|
# 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 match --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
|
2011-07-26 17:56:52 +02:00
|
|
|
ACCEPT_LICENSE="NVIDIA" equo install --fetch --nodeps =x11-drivers/nvidia-drivers-96.43.20*$kernel_tag
|
2011-01-22 20:46:13 +01:00
|
|
|
# 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/
|
|
|
|
|
|
|
|
# if we ship with ati-drivers, we have KMS disabled by default.
|
|
|
|
# and better set driver arch to classic
|
|
|
|
eselect mesa set r600 classic
|
|
|
|
}
|
|
|
|
|
2010-09-17 13:40:17 +02:00
|
|
|
if [ "$1" = "lxde" ]; then
|
2010-11-26 13:26:42 +01:00
|
|
|
setup_networkmanager
|
2010-09-17 13:40:17 +02:00
|
|
|
# Fix ~/.dmrc to have it load LXDE
|
|
|
|
echo "[Desktop]" > /etc/skel/.dmrc
|
|
|
|
echo "Session=LXDE" >> /etc/skel/.dmrc
|
|
|
|
remove_desktop_files
|
2010-09-21 10:04:04 +02:00
|
|
|
setup_displaymanager
|
2010-09-17 13:40:17 +02:00
|
|
|
# properly tweak lxde autostart tweak, adding --desktop option
|
|
|
|
sed -i 's/pcmanfm -d/pcmanfm -d --desktop/g' /etc/xdg/lxsession/LXDE/autostart
|
|
|
|
setup_cpufrequtils
|
2011-08-13 15:43:41 +02:00
|
|
|
has_proprietary_drivers && setup_proprietary_gfx_drivers || setup_oss_gfx_drivers
|
2010-09-17 13:40:17 +02:00
|
|
|
elif [ "$1" = "e17" ]; then
|
2011-01-10 11:03:59 +01:00
|
|
|
setup_networkmanager
|
2010-09-17 13:40:17 +02:00
|
|
|
# Fix ~/.dmrc to have it load E17
|
|
|
|
echo "[Desktop]" > /etc/skel/.dmrc
|
|
|
|
echo "Session=enlightenment" >> /etc/skel/.dmrc
|
|
|
|
remove_desktop_files
|
2010-12-04 18:10:34 +01:00
|
|
|
# E17 spin has chromium installed
|
2010-09-21 10:04:04 +02:00
|
|
|
setup_displaymanager
|
2010-10-24 10:22:58 +02:00
|
|
|
# Not using lxdm for now
|
2010-09-17 13:40:17 +02:00
|
|
|
# TODO: improve the lines below
|
|
|
|
# Make sure enlightenment is selected in lxdm
|
2010-10-24 10:22:58 +02:00
|
|
|
# sed -i '/lxdm-greeter-gtk/ a\\nlast_session=enlightenment.desktop\nlast_lang=' /etc/lxdm/lxdm.conf
|
2010-09-17 13:40:17 +02:00
|
|
|
# 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
|
2011-08-13 15:43:41 +02:00
|
|
|
has_proprietary_drivers && setup_proprietary_gfx_drivers || setup_oss_gfx_drivers
|
2010-09-17 13:40:17 +02:00
|
|
|
elif [ "$1" = "xfce" ]; then
|
2010-11-26 13:26:42 +01:00
|
|
|
setup_networkmanager
|
2011-09-04 13:04:45 +02:00
|
|
|
# Fix ~/.dmrc to have it load Xfce
|
2010-09-17 13:40:17 +02:00
|
|
|
echo "[Desktop]" > /etc/skel/.dmrc
|
|
|
|
echo "Session=xfce" >> /etc/skel/.dmrc
|
|
|
|
remove_desktop_files
|
|
|
|
setup_cpufrequtils
|
2010-09-21 10:04:04 +02:00
|
|
|
setup_displaymanager
|
2011-08-13 15:43:41 +02:00
|
|
|
has_proprietary_drivers && setup_proprietary_gfx_drivers || setup_oss_gfx_drivers
|
2010-09-17 13:40:17 +02:00
|
|
|
elif [ "$1" = "fluxbox" ]; then
|
2010-11-26 13:26:42 +01:00
|
|
|
setup_networkmanager
|
2010-09-17 13:40:17 +02:00
|
|
|
# Fix ~/.dmrc to have it load Fluxbox
|
|
|
|
echo "[Desktop]" > /etc/skel/.dmrc
|
|
|
|
echo "Session=fluxbox" >> /etc/skel/.dmrc
|
|
|
|
remove_desktop_files
|
2010-09-21 10:04:04 +02:00
|
|
|
setup_displaymanager
|
2010-09-17 13:40:17 +02:00
|
|
|
setup_cpufrequtils
|
2011-08-13 15:43:41 +02:00
|
|
|
has_proprietary_drivers && setup_proprietary_gfx_drivers || setup_oss_gfx_drivers
|
2010-09-17 13:40:17 +02:00
|
|
|
elif [ "$1" = "gnome" ]; then
|
2010-11-26 13:26:42 +01:00
|
|
|
setup_networkmanager
|
2010-09-17 13:40:17 +02:00
|
|
|
# Fix ~/.dmrc to have it load GNOME
|
|
|
|
echo "[Desktop]" > /etc/skel/.dmrc
|
|
|
|
echo "Session=gnome" >> /etc/skel/.dmrc
|
|
|
|
rc-update del system-tools-backends boot
|
|
|
|
rc-update add system-tools-backends default
|
2010-09-21 10:04:04 +02:00
|
|
|
setup_displaymanager
|
2010-09-17 13:40:17 +02:00
|
|
|
setup_sabayon_mce
|
2011-08-13 15:43:41 +02:00
|
|
|
has_proprietary_drivers && setup_proprietary_gfx_drivers || setup_oss_gfx_drivers
|
2010-10-03 11:29:43 +02:00
|
|
|
elif [ "$1" = "gforensic" ]; then
|
2010-11-26 13:26:42 +01:00
|
|
|
setup_networkmanager
|
2010-10-03 11:29:43 +02:00
|
|
|
# Fix ~/.dmrc to have it load GNOME
|
|
|
|
echo "[Desktop]" > /etc/skel/.dmrc
|
|
|
|
echo "Session=gnome" >> /etc/skel/.dmrc
|
|
|
|
rc-update del system-tools-backends boot
|
|
|
|
rc-update add system-tools-backends default
|
|
|
|
setup_displaymanager
|
|
|
|
setup_sabayon_mce
|
|
|
|
gforensic_remove_skel_stuff
|
2011-03-13 18:06:00 +01:00
|
|
|
setup_cpufrequtils
|
2011-08-13 15:43:41 +02:00
|
|
|
has_proprietary_drivers && setup_proprietary_gfx_drivers || setup_oss_gfx_drivers
|
2011-02-03 20:37:16 +01:00
|
|
|
elif [ "$1" = "kforensic" ]; then
|
|
|
|
setup_networkmanager
|
|
|
|
# Fix ~/.dmrc to have it load KDE
|
|
|
|
echo "[Desktop]" > /etc/skel/.dmrc
|
|
|
|
echo "Session=KDE-4" >> /etc/skel/.dmrc
|
|
|
|
rc-update del system-tools-backends boot
|
|
|
|
rc-update add system-tools-backends default
|
|
|
|
setup_displaymanager
|
|
|
|
setup_sabayon_mce
|
|
|
|
gforensic_remove_skel_stuff
|
2011-03-13 18:06:00 +01:00
|
|
|
setup_cpufrequtils
|
2011-08-13 15:43:41 +02:00
|
|
|
has_proprietary_drivers && setup_proprietary_gfx_drivers || setup_oss_gfx_drivers
|
2010-09-17 13:40:17 +02:00
|
|
|
elif [ "$1" = "kde" ]; then
|
2010-11-26 13:26:42 +01:00
|
|
|
setup_networkmanager
|
2010-09-17 13:40:17 +02:00
|
|
|
# Fix ~/.dmrc to have it load KDE
|
|
|
|
echo "[Desktop]" > /etc/skel/.dmrc
|
|
|
|
echo "Session=KDE-4" >> /etc/skel/.dmrc
|
2010-09-21 10:04:04 +02:00
|
|
|
setup_displaymanager
|
2010-09-17 13:40:17 +02:00
|
|
|
setup_sabayon_mce
|
2011-03-13 18:06:00 +01:00
|
|
|
setup_cpufrequtils
|
2011-08-13 15:43:41 +02:00
|
|
|
has_proprietary_drivers && setup_proprietary_gfx_drivers || setup_oss_gfx_drivers
|
2011-08-31 13:00:27 +02:00
|
|
|
elif [ "$1" = "awesome" ]; then
|
|
|
|
setup_networkmanager
|
|
|
|
# Fix ~/.dmrc to have it load Awesome
|
|
|
|
echo "[Desktop]" > /etc/skel/.dmrc
|
|
|
|
echo "Session=awesome" >> /etc/skel/.dmrc
|
2011-09-03 09:17:50 +02:00
|
|
|
switch_kernel "sys-kernel/linux-sabayon" "sys-kernel/linux-fusion"
|
2011-08-31 13:00:27 +02:00
|
|
|
remove_desktop_files
|
|
|
|
setup_displaymanager
|
|
|
|
setup_cpufrequtils
|
|
|
|
has_proprietary_drivers && setup_proprietary_gfx_drivers || setup_oss_gfx_drivers
|
2010-09-17 13:40:17 +02:00
|
|
|
fi
|
|
|
|
|
2010-10-24 10:13:20 +02:00
|
|
|
# Make sure that pango stuff is properly configured
|
|
|
|
# It happens with E17 lives, for sure there is something broken
|
|
|
|
# somewhere.
|
|
|
|
if [ -x "/usr/bin/pango-querymodules" ]; then
|
2010-10-24 19:50:22 +02:00
|
|
|
if [ "$(uname -m)" = "x86_64" ]; then
|
|
|
|
/usr/bin/pango-querymodules > "/etc/pango/x86_64-pc-linux-gnu/pango.modules"
|
|
|
|
else
|
|
|
|
/usr/bin/pango-querymodules > "/etc/pango/pango.modules"
|
|
|
|
fi
|
2010-10-24 10:13:20 +02:00
|
|
|
fi
|
|
|
|
|
2010-10-03 21:57:15 +02:00
|
|
|
# Setup SAMBA config file
|
|
|
|
if [ -f /etc/samba/smb.conf.default ]; then
|
|
|
|
cp -p /etc/samba/smb.conf.default /etc/samba/smb.conf
|
|
|
|
fi
|
|
|
|
|
2010-09-17 13:40:17 +02:00
|
|
|
# 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
|
|
|
|
|
2011-05-15 10:30:49 +02:00
|
|
|
# beanshell app, not wanted in our start menu
|
|
|
|
rm -f /usr/share/applications/bsh-console-bsh.desktop
|
|
|
|
|
2011-05-15 10:54:19 +02:00
|
|
|
# drop gnome-system-log desktop file (broken)
|
|
|
|
rm -f /usr/share/applications/gnome-system-log.desktop
|
|
|
|
|
2010-09-17 13:40:17 +02:00
|
|
|
# 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
|
2010-09-21 09:54:06 +02:00
|
|
|
# we have new Flash, don't need it anymore
|
|
|
|
# nspluginwrapper_autoinstall
|
2010-09-17 13:40:17 +02:00
|
|
|
|
|
|
|
# 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
|
2011-06-24 16:14:07 +02:00
|
|
|
rm /var/lib/entropy/client/database/*/sabayon-weekly -rf
|
2010-09-17 13:40:17 +02:00
|
|
|
equo rescue vacuum
|
|
|
|
|
2011-07-01 22:35:15 +02:00
|
|
|
# restore original repositories.conf (all mirrors were filtered for speed)
|
|
|
|
cp /etc/entropy/repositories.conf.example /etc/entropy/repositories.conf || exit 1
|
|
|
|
|
2010-09-17 13:40:17 +02:00
|
|
|
# cleanup log dir
|
|
|
|
rm /var/lib/entropy/logs -rf
|
|
|
|
|
|
|
|
# Generate openrc cache
|
2011-07-06 10:58:26 +02:00
|
|
|
touch /lib/rc/init.d/softlevel
|
2010-09-17 13:40:17 +02:00
|
|
|
/etc/init.d/savecache start
|
|
|
|
/etc/init.d/savecache zap
|
|
|
|
|
|
|
|
ldconfig
|
|
|
|
ldconfig
|
|
|
|
umount /proc
|
|
|
|
|
|
|
|
emaint --fix world
|
|
|
|
|
2010-09-25 00:39:16 +02:00
|
|
|
rm -rf /var/lib/entropy/*cache*
|
|
|
|
|
2011-08-31 11:43:03 +02:00
|
|
|
# remove entropy pid file
|
|
|
|
rm -f /var/run/entropy/entropy.lock
|
|
|
|
|
2010-09-17 13:40:17 +02:00
|
|
|
exit 0
|