[molecule/examples] add more example files
This commit is contained in:
Binary file not shown.
Executable
+54
@@ -0,0 +1,54 @@
|
||||
#!/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"))
|
||||
Executable
+18
@@ -0,0 +1,18 @@
|
||||
#!/bin/bash
|
||||
ver=${RELEASE_VERSION}
|
||||
[[ -z "${ver}" ]] && ver=${CUR_DATE}
|
||||
[[ -z "${ver}" ]] && ver="5.3"
|
||||
|
||||
sed -i "s/__VERSION__/${ver}/g" "${CDROOT_DIR}/isolinux/isolinux.cfg"
|
||||
sed -i "s/gentoo=nox//g" "${CDROOT_DIR}/isolinux/isolinux.cfg"
|
||||
sed -i "s/nox//g" "${CDROOT_DIR}/isolinux/isolinux.cfg"
|
||||
sed -i "s/installer-text/installer-gui/g" "${CDROOT_DIR}/isolinux/isolinux.cfg"
|
||||
sed -i "s/text-install/gui-install/g" "${CDROOT_DIR}/isolinux/isolinux.cfg"
|
||||
# splashutils is stupid and gives black screen at the end of the boot if X is not there
|
||||
# sed -i "s/splash=verbose/splash=silent/g" "${CDROOT_DIR}/isolinux/isolinux.cfg"
|
||||
sed -i "s/CoreCD/CoreCDX/g" "${CDROOT_DIR}/isolinux/isolinux.cfg"
|
||||
|
||||
sabayon_pkgs_file="${CHROOT_DIR}/etc/sabayon-pkglist"
|
||||
if [ -f "${sabayon_pkgs_file}" ]; then
|
||||
cp "${sabayon_pkgs_file}" "${CDROOT_DIR}/pkglist"
|
||||
fi
|
||||
Executable
+14
@@ -0,0 +1,14 @@
|
||||
#!/bin/bash
|
||||
cp /sabayon/remaster/remaster_isolinux.cfg "${CDROOT_DIR}/isolinux/isolinux.cfg"
|
||||
ver=${RELEASE_VERSION}
|
||||
[[ -z "${ver}" ]] && ver=${CUR_DATE}
|
||||
[[ -z "${ver}" ]] && ver="5.3"
|
||||
|
||||
sed -i "s/__VERSION__/${ver}/g" "${CDROOT_DIR}/isolinux/isolinux.cfg"
|
||||
sed -i "s/__FLAVOUR__/${1}/g" "${CDROOT_DIR}/isolinux/isolinux.cfg"
|
||||
|
||||
sabayon_pkgs_file="${CHROOT_DIR}/etc/sabayon-pkglist"
|
||||
if [ -f "${sabayon_pkgs_file}" ]; then
|
||||
cp "${sabayon_pkgs_file}" "${CDROOT_DIR}/pkglist"
|
||||
fi
|
||||
|
||||
Executable
+142
@@ -0,0 +1,142 @@
|
||||
#!/bin/bash
|
||||
|
||||
/usr/sbin/env-update
|
||||
source /etc/profile
|
||||
|
||||
for arg in $*; do
|
||||
[[ "${arg}" = "spinbase" ]] && SPINBASE="1"
|
||||
done
|
||||
|
||||
# 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*
|
||||
|
||||
# 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
|
||||
|
||||
# setup sudoers
|
||||
[ -e /etc/sudoers ] && sed -i '/NOPASSWD: ALL/ s/^# //' /etc/sudoers
|
||||
|
||||
# setup opengl in /etc (if configured)
|
||||
[[ -z "${SPINBASE}" ]] && eselect opengl set xorg-x11
|
||||
|
||||
# touch /etc/asound.state
|
||||
touch /etc/asound.state
|
||||
|
||||
update-pciids
|
||||
update-usbids
|
||||
|
||||
if [ -z "${SPINBASE}" ]; 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/packages*/${mydir}/5/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
|
||||
# testing xorg-server-1.5 support
|
||||
# ACCEPT_LICENSE="NVIDIA" equo install --fetch --nodeps ~x11-drivers/nvidia-drivers-71.86.*$kernel_tag
|
||||
mv /var/lib/entropy/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
|
||||
|
||||
# EXPERIMENTAL, clean icon cache files
|
||||
for file in `find /usr/share/icons -name "icon-theme.cache"`; do
|
||||
rm $file
|
||||
done
|
||||
|
||||
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
|
||||
|
||||
# remove anaconda .git
|
||||
rm /opt/anaconda/.git -rf
|
||||
rm /opt/anaconda/usr/share/anaconda/po/*.po -rf
|
||||
|
||||
|
||||
# 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
|
||||
[[ -z "${SPINBASE}" ]] && cp /var/lib/entropy/client/database/*/sabayonlinux.org/standard/*/*/make.conf /etc/make.conf
|
||||
|
||||
# Update sabayon overlay
|
||||
layman -s sabayon
|
||||
if [ -z "${SPINBASE}" ]; then
|
||||
layman -d sabayon
|
||||
rm -rf /var/lib/layman/sabayon
|
||||
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
|
||||
|
||||
# Reset users' password
|
||||
echo "sabayonuser:" | chpasswd
|
||||
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
|
||||
|
||||
# Revert to blocked entropy repo URL
|
||||
sed -i 's/pkgbuild.sabayon.org/pkg.sabayon.org/g' /etc/entropy/repositories.conf
|
||||
|
||||
# Tweak user groups
|
||||
usermod -a -G lpadmin sabayonuser
|
||||
|
||||
# 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
|
||||
exit 0
|
||||
+22
@@ -0,0 +1,22 @@
|
||||
#!/bin/bash
|
||||
|
||||
source /etc/profile
|
||||
env-update
|
||||
source /etc/profile
|
||||
|
||||
layman -s sabayon
|
||||
|
||||
# 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/packages*
|
||||
|
||||
equo query list installed -qv > /etc/sabayon-pkglist
|
||||
@@ -0,0 +1,59 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Use gdm by default
|
||||
sed -i 's/DISPLAYMANAGER=".*"/DISPLAYMANAGER="gdm"/g' /etc/conf.d/xdm
|
||||
|
||||
# automatically start xdm
|
||||
rc-update del xdm
|
||||
rc-update add xdm boot
|
||||
rc-update del hald
|
||||
rc-update add hald default
|
||||
rc-update del NetworkManager
|
||||
rc-update add NetworkManager default
|
||||
|
||||
echo -5 | equo conf update
|
||||
|
||||
# remove stuff from Skel we don't have
|
||||
rm /etc/skel/Desktop/WorldOfGooDemo-world-of-goo-demo.desktop
|
||||
rm /etc/skel/Desktop/fusion-icon.desktop
|
||||
rm /etc/skel/Desktop/xbmc.desktop
|
||||
|
||||
if [ "$1" = "lxde" ]; then
|
||||
# Fix ~/.dmrc to have it load LXDE
|
||||
echo "[Desktop]" > /etc/skel/.dmrc
|
||||
echo "Session=LXDE" >> /etc/skel/.dmrc
|
||||
elif [ "$1" = "xfce" ]; then
|
||||
# Fix ~/.dmrc to have it load XFCE
|
||||
echo "[Desktop]" > /etc/skel/.dmrc
|
||||
echo "Session=xfce" >> /etc/skel/.dmrc
|
||||
elif [ "$1" = "fluxbox" ]; then
|
||||
# Fix ~/.dmrc to have it load Fluxbox
|
||||
echo "[Desktop]" > /etc/skel/.dmrc
|
||||
echo "Session=fluxbox" >> /etc/skel/.dmrc
|
||||
fi
|
||||
|
||||
# Update package list
|
||||
equo query list installed -qv > /etc/sabayon-pkglist
|
||||
|
||||
# We installed feh and now use it to set a background!
|
||||
echo "@feh --bg-scale /usr/share/backgrounds/sabayonlinux.png" >> /etc/xdg/lxsession/LXDE/autostart
|
||||
|
||||
rm /var/lib/entropy/client/database/*/sabayonlinux.org -rf
|
||||
equo rescue vacuum
|
||||
|
||||
rm -rf /opt/anaconda*
|
||||
|
||||
# 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
|
||||
|
||||
exit 0
|
||||
Executable
+7
@@ -0,0 +1,7 @@
|
||||
#!/bin/sh
|
||||
PKGS_DIR="/sabayon/remaster/pkgs"
|
||||
CHROOT_PKGS_DIR="${CHROOT_DIR}/var/lib/entropy/packages"
|
||||
|
||||
echo "Merging back packages"
|
||||
cp "${CHROOT_PKGS_DIR}"/* "${PKGS_DIR}"/ -Ra
|
||||
rm -rf "${CHROOT_PKGS_DIR}"{,-nonfree,-restricted}/*
|
||||
Executable
+11
@@ -0,0 +1,11 @@
|
||||
#!/bin/sh
|
||||
PKGS_DIR="/sabayon/remaster/pkgs"
|
||||
CHROOT_PKGS_DIR="${CHROOT_DIR}/var/lib/entropy/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
|
||||
Reference in New Issue
Block a user