remove not needed files from tree only armv5
This commit is contained in:
@@ -1,40 +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 /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.sabayon.org/p" -e "/garr.it/p" -e "/^branch/p" \
|
||||
-e "/^product/p" -e "/^official-repository-id/p" -e "/^differential-update/p" \
|
||||
-i "${repo_conf}"
|
||||
done
|
||||
|
||||
# mask icedtea, since it pulls it a shitload of deps
|
||||
# prefer icedtea-bin or others
|
||||
equo mask "dev-java/icedtea"
|
||||
@@ -1,108 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
/usr/sbin/env-update
|
||||
. /etc/profile
|
||||
|
||||
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
|
||||
rc-update del NetworkManager boot
|
||||
rc-update del NetworkManager default
|
||||
# add eth0, should get dhcp by default already
|
||||
rc-update add net.eth0 default
|
||||
|
||||
# drop other useless services
|
||||
rc-update del sabayonlive boot
|
||||
rc-update del x-setup boot
|
||||
|
||||
# Enable ssh
|
||||
rc-update add sshd default
|
||||
# Enable cron
|
||||
rc-update add vixie-cron default
|
||||
|
||||
# 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 UTC clock
|
||||
sed -i 's:clock=".*":clock="UTC":' /etc/conf.d/hwclock || exit 1
|
||||
|
||||
# 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
|
||||
|
||||
/lib/rc/bin/rc-depend -u
|
||||
|
||||
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
|
||||
|
||||
# Generate openrc cache
|
||||
[[ -d "/lib/rc/init.d" ]] && touch /lib/rc/init.d/softlevel
|
||||
[[ -d "/run/openrc" ]] && touch /run/openrc/softlevel
|
||||
/etc/init.d/savecache start
|
||||
/etc/init.d/savecache zap
|
||||
|
||||
ldconfig
|
||||
ldconfig
|
||||
umount /proc
|
||||
|
||||
|
||||
# remove hw hash
|
||||
rm -f /etc/entropy/.hw.hash
|
||||
# remove entropy pid file
|
||||
rm -f /var/run/entropy/entropy.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
|
||||
@@ -1,18 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
/usr/sbin/env-update
|
||||
. /etc/profile
|
||||
|
||||
# Setup Desktop links
|
||||
# ARM Images links
|
||||
ln -s "/mnt/cdrom/ARM" "/etc/skel/Desktop/ARM_Images"
|
||||
|
||||
# Tigal Desktop link
|
||||
echo "[Desktop Entry]
|
||||
Encoding=UTF-8
|
||||
Icon=/usr/share/pixmaps/sabayon-weblink.png
|
||||
Type=Link
|
||||
URL=http://www.tigal.com
|
||||
Name=Sponsored by Tigal" > /etc/skel/Desktop/tigal.desktop
|
||||
|
||||
exit 0
|
||||
@@ -1,116 +0,0 @@
|
||||
#!/bin/bash
|
||||
# example call:
|
||||
# amd64_x86_pre_iso_script.sh GNOME 64 32 /path/to/Sabayon_Linux_DAILY_x86_G.iso
|
||||
|
||||
remaster_type="${1}"
|
||||
current_arch="${2}"
|
||||
other_arch="${3}"
|
||||
other_iso_path="${4}"
|
||||
|
||||
/usr/sbin/env-update
|
||||
. /etc/profile
|
||||
|
||||
# Path to molecules.git dir
|
||||
SABAYON_MOLECULE_HOME="${SABAYON_MOLECULE_HOME:-/sabayon}"
|
||||
export SABAYON_MOLECULE_HOME
|
||||
|
||||
pre_iso_signal_handler() {
|
||||
if [ -d "${tmp_dir}" ] && [ -n "${tmp_dir}" ]; then
|
||||
umount -f "${tmp_dir}"
|
||||
umount -f "${tmp_dir}"
|
||||
rmdir "${tmp_dir}"
|
||||
fi
|
||||
}
|
||||
trap "pre_iso_signal_handler" EXIT SIGINT SIGQUIT SIGILL SIGTERM SIGHUP
|
||||
|
||||
if [ ! -f "${other_iso_path}" ]; then
|
||||
echo "${other_iso_path} not found"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
isolinux_destination="${CDROOT_DIR}/isolinux/txt.cfg"
|
||||
isolinux_source="${SABAYON_MOLECULE_HOME}/remaster/minimal_amd64_x86_isolinux.cfg"
|
||||
cp "${isolinux_source}" "${isolinux_destination}" || exit 1
|
||||
|
||||
ver=${RELEASE_VERSION}
|
||||
[[ -z "${ver}" ]] && ver=${CUR_DATE}
|
||||
[[ -z "${ver}" ]] && ver="6"
|
||||
|
||||
sed -i "s/__VERSION__/${ver}/g" "${isolinux_destination}"
|
||||
sed -i "s/__FLAVOUR__/${remaster_type}/g" "${isolinux_destination}"
|
||||
|
||||
kms_string=""
|
||||
# should KMS be enabled?
|
||||
if [ -f "${CHROOT_DIR}/.enable_kms" ]; then
|
||||
rm "${CHROOT_DIR}/.enable_kms"
|
||||
kms_string="radeon.modeset=1"
|
||||
else
|
||||
# enable vesafb-tng then
|
||||
kms_string="video=vesafb:ywrap,mtrr:3"
|
||||
fi
|
||||
sed -i "s/__KMS__/${kms_string}/g" "${isolinux_destination}"
|
||||
|
||||
# setup squashfs loop files
|
||||
mv "${CDROOT_DIR}/livecd.squashfs" "${CDROOT_DIR}/livecd${current_arch}.squashfs" || exit 1
|
||||
# mount other iso image and steal livecd.squashfs
|
||||
tmp_dir=$(mktemp -d --suffix=amd64_x86_pre_iso --tmpdir=/var/tmp 2> /dev/null)
|
||||
if [ -z "${tmp_dir}" ]; then
|
||||
echo "Cannot create temporary directory"
|
||||
exit 1
|
||||
fi
|
||||
# also rename kernel and initramfs inside the CDROOT dir
|
||||
mv "${CDROOT_DIR}/boot/sabayon" "${CDROOT_DIR}/boot/sabayon${current_arch}" || exit 1
|
||||
mv "${CDROOT_DIR}/boot/sabayon.igz" "${CDROOT_DIR}/boot/sabayon${current_arch}.igz" || exit 1
|
||||
|
||||
mount -o loop "${other_iso_path}" "${tmp_dir}" || exit 1
|
||||
other_squashfs_path="${tmp_dir}/livecd.squashfs"
|
||||
if [ ! -f "${other_squashfs_path}" ]; then
|
||||
echo "Cannot find ${other_squashfs_path}"
|
||||
exit 1
|
||||
fi
|
||||
cp "${other_squashfs_path}" "${CDROOT_DIR}/livecd${other_arch}.squashfs" || exit 1
|
||||
# copy kernel and initramfs
|
||||
cp "${tmp_dir}/boot/sabayon" "${CDROOT_DIR}/boot/sabayon${other_arch}" || exit 1
|
||||
cp "${tmp_dir}/boot/sabayon.igz" "${CDROOT_DIR}/boot/sabayon${other_arch}.igz" || exit 1
|
||||
|
||||
# copy back.jpg to proper location
|
||||
isolinux_img="${SABAYON_MOLECULE_HOME}/remaster/embedded_world/back.jpg"
|
||||
if [ -f "${isolinux_img}" ]; then
|
||||
cp "${isolinux_img}" "${CDROOT_DIR}/isolinux/" || exit 1
|
||||
fi
|
||||
|
||||
# copy ARM images on the ISO
|
||||
arm_images_dir="${SABAYON_MOLECULE_HOME}/images"
|
||||
arm_dir="${CDROOT_DIR}/ARM"
|
||||
mkdir -p "${arm_dir}" || exit 1
|
||||
|
||||
beaglebone_image="Sabayon_Linux_9_armv7a_BeagleBone_Base_2GB.img.xz"
|
||||
beagleboard_xm_image="Sabayon_Linux_9_armv7a_BeagleBoard_xM_4GB.img.xz"
|
||||
pandaboard_image="Sabayon_Linux_9_armv7a_PandaBoard_4GB.img.xz"
|
||||
|
||||
# BeagleBone
|
||||
arm_card_dir="${arm_dir}/BeagleBone"
|
||||
arm_card_boot_dir="${SABAYON_MOLECULE_HOME}/boot/arm/beaglebone"
|
||||
mkdir "${arm_card_dir}" -p || exit 1
|
||||
cp "${arm_images_dir}/${beaglebone_image}" "${arm_card_dir}"/ || exit 1
|
||||
cp "${arm_images_dir}/${beaglebone_image}.md5" "${arm_card_dir}"/ || exit 1
|
||||
cp "${arm_card_boot_dir}/README.txt" "${arm_card_dir}"/ || exit 1
|
||||
|
||||
# BeagleBoard xM
|
||||
arm_card_dir="${arm_dir}/BeagleBoard-xM"
|
||||
arm_card_boot_dir="${SABAYON_MOLECULE_HOME}/boot/arm/beagleboard-xm"
|
||||
mkdir "${arm_card_dir}" -p || exit 1
|
||||
cp "${arm_images_dir}/${beaglebone_image}" "${arm_card_dir}"/ || exit 1
|
||||
cp "${arm_images_dir}/${beaglebone_image}.md5" "${arm_card_dir}"/ || exit 1
|
||||
cp "${arm_card_boot_dir}/README.txt" "${arm_card_dir}"/ || exit 1
|
||||
|
||||
# PandaBoard
|
||||
arm_card_dir="${arm_dir}/PandaBoard"
|
||||
arm_card_boot_dir="${SABAYON_MOLECULE_HOME}/boot/arm/pandaboard"
|
||||
mkdir "${arm_card_dir}" -p || exit 1
|
||||
cp "${arm_images_dir}/${beaglebone_image}" "${arm_card_dir}"/ || exit 1
|
||||
cp "${arm_images_dir}/${beaglebone_image}.md5" "${arm_card_dir}"/ || exit 1
|
||||
cp "${arm_card_boot_dir}/README.txt" "${arm_card_dir}"/ || exit 1
|
||||
|
||||
# Generate livecd.squashfs.md5
|
||||
"${SABAYON_MOLECULE_HOME}"/scripts/pre_iso_script_livecd_hash.sh
|
||||
@@ -1,7 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
# Path to molecules.git dir
|
||||
SABAYON_MOLECULE_HOME="${SABAYON_MOLECULE_HOME:-/sabayon}"
|
||||
export SABAYON_MOLECULE_HOME
|
||||
|
||||
exec "${SABAYON_MOLECULE_HOME}"/scripts/mkloopcard.sh "${SABAYON_MOLECULE_HOME}"/scripts/mkloopcard_beaglebone_chroot_hook.sh "$@"
|
||||
@@ -6,4 +6,4 @@ export SABAYON_MOLECULE_HOME
|
||||
|
||||
# rootfs and bootfs tarball is generated by beaglebone image
|
||||
export MAKE_TARBALL="0"
|
||||
exec "${SABAYON_MOLECULE_HOME}"/scripts/mkloopcard.sh "${SABAYON_MOLECULE_HOME}"/scripts/mkloopcard_beagleboard_xm_chroot_hook.sh "$@"
|
||||
exec "${SABAYON_MOLECULE_HOME}"/scripts/mkloopgptdisk.sh "${SABAYON_MOLECULE_HOME}"/scripts/mkloopgptdisk_buffalo_kb_pro_chroot_hook.sh "$@"
|
||||
9
scripts/buffalo_ls_pro_live_image_generator_script.sh
Executable file
9
scripts/buffalo_ls_pro_live_image_generator_script.sh
Executable file
@@ -0,0 +1,9 @@
|
||||
#!/bin/sh
|
||||
|
||||
# Path to molecules.git dir
|
||||
SABAYON_MOLECULE_HOME="${SABAYON_MOLECULE_HOME:-/sabayon}"
|
||||
export SABAYON_MOLECULE_HOME
|
||||
|
||||
# rootfs and bootfs tarball is generated by beaglebone image
|
||||
export MAKE_TARBALL="0"
|
||||
exec "${SABAYON_MOLECULE_HOME}"/scripts/mkloopgptdisk.sh "${SABAYON_MOLECULE_HOME}"/scripts/mkloopgptdisk_buffalo_ls_pro_live_chroot_hook.sh "$@"
|
||||
9
scripts/buffalo_ls_xhl_image_generator_script.sh
Executable file
9
scripts/buffalo_ls_xhl_image_generator_script.sh
Executable file
@@ -0,0 +1,9 @@
|
||||
#!/bin/sh
|
||||
|
||||
# Path to molecules.git dir
|
||||
SABAYON_MOLECULE_HOME="${SABAYON_MOLECULE_HOME:-/sabayon}"
|
||||
export SABAYON_MOLECULE_HOME
|
||||
|
||||
# rootfs and bootfs tarball is generated by beaglebone image
|
||||
export MAKE_TARBALL="0"
|
||||
exec "${SABAYON_MOLECULE_HOME}"/scripts/mkloopgptdisk.sh "${SABAYON_MOLECULE_HOME}"/scripts/mkloopgptdisk_buffalo_ls_xhl_chroot_hook.sh "$@"
|
||||
@@ -1,68 +0,0 @@
|
||||
#!/usr/bin/python
|
||||
import os, shutil, time
|
||||
import subprocess
|
||||
from datetime import datetime
|
||||
|
||||
sabayon_molecule_home = os.getenv("SABAYON_MOLECULE_HOME", "/sabayon")
|
||||
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 txt.cfg and isolinux.txt to match version
|
||||
isolinux_cfg = os.path.join(cdroot_dir, "isolinux/txt.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")
|
||||
|
||||
# copy back.jpg to proper location
|
||||
isolinux_img = os.path.join(chroot_dir, "usr/share/backgrounds/isolinux/back.jpg")
|
||||
if os.path.isfile(isolinux_img):
|
||||
shutil.copy2(isolinux_img, os.path.join(cdroot_dir, "isolinux/back.jpg"))
|
||||
|
||||
iso_md5_script = os.path.join(sabayon_molecule_home, "scripts/pre_iso_script_livecd_hash.sh")
|
||||
exit_st = subprocess.call([iso_md5_script])
|
||||
raise SystemExit(exit_st)
|
||||
@@ -1,39 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
CDROOT=/mnt/cdrom
|
||||
|
||||
CHECK_DISC=$(cat /proc/cmdline | grep checkdisc)
|
||||
if [ -n "${CHECK_DISC}" ]; then
|
||||
echo "Checking Live System Image for defects..."
|
||||
cd "${CDROOT}" || exit 1
|
||||
all_fine=1
|
||||
for shafile in $(find "${CDROOT}" -name "*.sha256"); do
|
||||
target_file="${shafile/.sha256}"
|
||||
echo -en "Checking ${target_file} ... "
|
||||
target_sha=$(sha256sum "${target_file}" 2> /dev/null | cut -d" " -f 1)
|
||||
shafile_sha=$(cat "${shafile}" | cut -d" " -f 1)
|
||||
if [ "${target_sha}" != "${shafile_sha}" ]; then
|
||||
echo
|
||||
echo "target = ${target_sha}"
|
||||
echo "expect = ${shafile_sha}"
|
||||
echo
|
||||
echo "ATTENTION ATTENTION ATTENTION"
|
||||
echo "This Live System won't properly work"
|
||||
echo "Your DVD, USB stick or ISO image is damaged"
|
||||
echo "ATTENTION ATTENTION ATTENTION"
|
||||
all_fine=0
|
||||
break
|
||||
else
|
||||
echo "OK"
|
||||
fi
|
||||
done
|
||||
echo
|
||||
if [ "${all_fine}" = "1" ]; then
|
||||
echo "All fine baby, the Live System is healthy"
|
||||
else
|
||||
echo "Ouch... I am very sorry!"
|
||||
fi
|
||||
echo "Press Enter key (yeah, that one) to reboot"
|
||||
read
|
||||
reboot -f
|
||||
fi
|
||||
@@ -1,14 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
export BOOT_PART_MKFS_ARGS="-L boot"
|
||||
export BOOT_PART_TYPE=ext3
|
||||
export BOOT_PART_TYPE_MBR=83
|
||||
export BOOT_PART_TYPE_INSIDE_ROOT=1
|
||||
export ROOT_PART_TYPE=ext4
|
||||
export MAKE_TARBALL=0
|
||||
|
||||
# Path to molecules.git dir
|
||||
SABAYON_MOLECULE_HOME="${SABAYON_MOLECULE_HOME:-/sabayon}"
|
||||
export SABAYON_MOLECULE_HOME
|
||||
|
||||
exec "${SABAYON_MOLECULE_HOME}"/scripts/mkloopcard.sh "${SABAYON_MOLECULE_HOME}"/scripts/mkloopcard_efikamx_chroot_hook.sh "$@"
|
||||
@@ -1,14 +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 "$@"
|
||||
|
||||
# Christmas TIME !
|
||||
GAMING_XMAS_DIR="${SABAYON_MOLECULE_HOME}/remaster/gaming-xmas"
|
||||
cp "${GAMING_XMAS_DIR}"/sabayonlinux.png "${CHROOT_DIR}/usr/share/backgrounds/sabayonlinux.png"
|
||||
cp "${GAMING_XMAS_DIR}"/sabayonlinux.jpg "${CHROOT_DIR}/usr/share/backgrounds/sabayonlinux.jpg"
|
||||
cp "${GAMING_XMAS_DIR}"/sabayonlinux.jpg "${CHROOT_DIR}/usr/share/backgrounds/kgdm.jpg"
|
||||
@@ -1,25 +0,0 @@
|
||||
#!/bin/bash
|
||||
# Update ISO image in order to make it USB bootable
|
||||
# out of the box
|
||||
#
|
||||
# Available env vars:
|
||||
# ISO_PATH = path to generated ISO
|
||||
# ISO_CHECKSUM_PATH = path to generated md5 for ISO
|
||||
#
|
||||
# This script requires isohybrid (which comes from syslinux package)
|
||||
|
||||
/usr/sbin/env-update
|
||||
. /etc/profile
|
||||
|
||||
echo
|
||||
echo "Spawning isohybrid for:"
|
||||
echo "ISO_PATH = ${ISO_PATH}"
|
||||
echo "ISO_CHECKSUM_PATH = ${ISO_CHECKSUM_PATH}"
|
||||
echo
|
||||
|
||||
isohybrid "${ISO_PATH}" || exit 1
|
||||
cd "$(dirname "${ISO_PATH}")" || exit 1
|
||||
iso_name=$(basename "${ISO_PATH}")
|
||||
md5sum "${iso_name}" > "${ISO_CHECKSUM_PATH}"
|
||||
exit ${?}
|
||||
|
||||
@@ -1,67 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
/usr/sbin/env-update
|
||||
. /etc/profile
|
||||
|
||||
# Path to molecules.git dir
|
||||
SABAYON_MOLECULE_HOME="${SABAYON_MOLECULE_HOME:-/sabayon}"
|
||||
export SABAYON_MOLECULE_HOME
|
||||
|
||||
remaster_type="${1}"
|
||||
isolinux_source="${SABAYON_MOLECULE_HOME}/remaster/minimal_isolinux.cfg"
|
||||
isolinux_destination="${CDROOT_DIR}/isolinux/txt.cfg"
|
||||
|
||||
if [ "${remaster_type}" = "KDE" ] || [ "${remaster_type}" = "GNOME" ]; then
|
||||
isolinux_source="${SABAYON_MOLECULE_HOME}/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_MOLECULE_HOME}/remaster/serverbase_isolinux.cfg"
|
||||
elif [ "${remaster_type}" = "HardenedServer" ]; then
|
||||
echo "HardenedServer 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_MOLECULE_HOME}/remaster/hardenedserver_isolinux.cfg"
|
||||
fi
|
||||
cp "${isolinux_source}" "${isolinux_destination}" || exit 1
|
||||
|
||||
ver=${RELEASE_VERSION}
|
||||
[[ -z "${ver}" ]] && ver=${CUR_DATE}
|
||||
[[ -z "${ver}" ]] && ver="6"
|
||||
|
||||
sed -i "s/__VERSION__/${ver}/g" "${isolinux_destination}"
|
||||
sed -i "s/__FLAVOUR__/${remaster_type}/g" "${isolinux_destination}"
|
||||
|
||||
kms_string=""
|
||||
# should KMS be enabled?
|
||||
if [ -f "${CHROOT_DIR}/.enable_kms" ]; then
|
||||
rm "${CHROOT_DIR}/.enable_kms"
|
||||
kms_string="radeon.modeset=1"
|
||||
else
|
||||
# enable vesafb-tng then
|
||||
kms_string="video=vesafb:ywrap,mtrr:3"
|
||||
fi
|
||||
sed -i "s/__KMS__/${kms_string}/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
|
||||
|
||||
# copy back.jpg to proper location
|
||||
isolinux_img="${CHROOT_DIR}/usr/share/backgrounds/isolinux/back.jpg"
|
||||
if [ -f "${isolinux_img}" ]; then
|
||||
cp "${isolinux_img}" "${CDROOT_DIR}/isolinux/" || exit 1
|
||||
fi
|
||||
|
||||
# Generate livecd.squashfs.md5
|
||||
"${SABAYON_MOLECULE_HOME}"/scripts/pre_iso_script_livecd_hash.sh
|
||||
@@ -1,13 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Path to molecules.git dir
|
||||
SABAYON_MOLECULE_HOME="${SABAYON_MOLECULE_HOME:-/sabayon}"
|
||||
export SABAYON_MOLECULE_HOME
|
||||
|
||||
GFORENSIC_DIR="${SABAYON_MOLECULE_HOME}/remaster/gforensic"
|
||||
cp "${GFORENSIC_DIR}"/isolinux/isolinux.cfg "${CDROOT_DIR}/isolinux/txt.cfg"
|
||||
cp "${GFORENSIC_DIR}"/isolinux/back.jpg "${CDROOT_DIR}/isolinux/back.jpg"
|
||||
cp "${GFORENSIC_DIR}"/isolinux/isolinux.txt "${CDROOT_DIR}/isolinux/isolinux.txt"
|
||||
|
||||
# Generate livecd.squashfs.md5
|
||||
"${SABAYON_MOLECULE_HOME}"/scripts/pre_iso_script_livecd_hash.sh
|
||||
@@ -1,77 +0,0 @@
|
||||
#! /bin/sh
|
||||
# mkcard.sh v0.5
|
||||
# (c) Copyright 2009 Graeme Gregory <dp@xora.org.uk>
|
||||
# Licensed under terms of GPLv2
|
||||
#
|
||||
# Parts of the procudure base on the work of Denys Dmytriyenko
|
||||
# http://wiki.omap.com/index.php/MMC_Boot_Format
|
||||
|
||||
export LC_ALL=C
|
||||
|
||||
if [ $# -ne 1 ]; then
|
||||
echo "Usage: $0 <drive>"
|
||||
exit 1;
|
||||
fi
|
||||
|
||||
DRIVE=$1
|
||||
|
||||
dd if=/dev/zero of=$DRIVE bs=1024 count=1024
|
||||
|
||||
SIZE=`fdisk -l $DRIVE | grep Disk | grep bytes | awk '{print $5}'`
|
||||
|
||||
echo DISK SIZE - $SIZE bytes
|
||||
|
||||
CYLINDERS=`echo $SIZE/255/63/512 | bc`
|
||||
|
||||
echo CYLINDERS - $CYLINDERS
|
||||
|
||||
{
|
||||
echo ,9,0x0C,*
|
||||
echo ,,,-
|
||||
} | sfdisk -D -H 255 -S 63 -C $CYLINDERS $DRIVE
|
||||
|
||||
sleep 1
|
||||
|
||||
|
||||
sfdisk -R $DRIVE
|
||||
|
||||
# handle various device names.
|
||||
# note something like fdisk -l /dev/loop0 | egrep -E '^/dev' | cut -d' ' -f1
|
||||
# won't work due to https://bugzilla.redhat.com/show_bug.cgi?id=649572
|
||||
|
||||
PARTITION1=${DRIVE}1
|
||||
if [ ! -b ${PARTITION1} ]; then
|
||||
PARTITION1=${DRIVE}p1
|
||||
fi
|
||||
|
||||
DRIVE_NAME=`basename $DRIVE`
|
||||
DEV_DIR=`dirname $DRIVE`
|
||||
|
||||
if [ ! -b ${PARTITION1} ]; then
|
||||
PARTITION1=$DEV_DIR/mapper/${DRIVE_NAME}p1
|
||||
fi
|
||||
|
||||
PARTITION2=${DRIVE}2
|
||||
if [ ! -b ${PARTITION2} ]; then
|
||||
PARTITION2=${DRIVE}p2
|
||||
fi
|
||||
if [ ! -b ${PARTITION2} ]; then
|
||||
PARTITION2=$DEV_DIR/mapper/${DRIVE_NAME}p2
|
||||
fi
|
||||
|
||||
|
||||
# now make partitions.
|
||||
if [ -b ${PARTITION1} ]; then
|
||||
umount ${PARTITION1}
|
||||
mkfs.vfat -F 32 -n "boot" ${PARTITION1}
|
||||
else
|
||||
echo "Cant find boot partition in /dev"
|
||||
fi
|
||||
|
||||
if [ -b ${PARITION2} ]; then
|
||||
umount ${PARTITION2}
|
||||
mkfs.ext3 -L "Sabayon" ${PARTITION2}
|
||||
else
|
||||
echo "Cant find rootfs partition in /dev"
|
||||
fi
|
||||
|
||||
@@ -1,106 +0,0 @@
|
||||
#!/bin/sh
|
||||
# This script is executed inside the image chroot before packing up.
|
||||
# Architecture/platform specific code goes here, like kernel install
|
||||
# and configuration
|
||||
|
||||
env-update
|
||||
. /etc/profile
|
||||
|
||||
setup_displaymanager() {
|
||||
# determine what is the login manager
|
||||
if [ -n "$(equo match --installed gnome-base/gdm -qv)" ]; then
|
||||
sed -i 's/DISPLAYMANAGER=".*"/DISPLAYMANAGER="gdm"/g' /etc/conf.d/xdm
|
||||
elif [ -n "$(equo match --installed lxde-base/lxdm -qv)" ]; then
|
||||
sed -i 's/DISPLAYMANAGER=".*"/DISPLAYMANAGER="lxdm"/g' /etc/conf.d/xdm
|
||||
elif [ -n "$(equo match --installed kde-base/kdm -qv)" ]; then
|
||||
sed -i 's/DISPLAYMANAGER=".*"/DISPLAYMANAGER="kdm"/g' /etc/conf.d/xdm
|
||||
else
|
||||
sed -i 's/DISPLAYMANAGER=".*"/DISPLAYMANAGER="xdm"/g' /etc/conf.d/xdm
|
||||
fi
|
||||
}
|
||||
|
||||
setup_desktop_environment() {
|
||||
if [ -f "/usr/share/xsessions/LXDE.desktop" ]; then
|
||||
echo "[Desktop]" > /etc/skel/.dmrc
|
||||
echo "Session=LXDE" >> /etc/skel/.dmrc
|
||||
elif [ -n "/usr/share/xsessions/xfce.desktop" ]; then
|
||||
echo "[Desktop]" > /etc/skel/.dmrc
|
||||
echo "Session=xfce" >> /etc/skel/.dmrc
|
||||
|
||||
else
|
||||
# Fluxbox is always there
|
||||
echo "[Desktop]" > /etc/skel/.dmrc
|
||||
echo "Session=fluxbox" >> /etc/skel/.dmrc
|
||||
fi
|
||||
}
|
||||
|
||||
setup_boot() {
|
||||
# enable sshd by default
|
||||
rc-update add sshd default
|
||||
# enable logger by default
|
||||
rc-update add syslog-ng boot
|
||||
rc-update add vixie-cron boot
|
||||
# enable dbus, of course, and also NetworkManager
|
||||
rc-update add dbus boot
|
||||
rc-update add NetworkManager default
|
||||
rc-update add NetworkManager-setup default
|
||||
rc-update del net.eth0 default
|
||||
|
||||
# start X.Org by default
|
||||
rc-update add xdm default
|
||||
|
||||
# select the first available kernel
|
||||
eselect uimage set 1
|
||||
|
||||
# cleaning up deps
|
||||
rc-update --update
|
||||
}
|
||||
|
||||
setup_startup_caches() {
|
||||
mount -t proc proc /proc
|
||||
/lib/rc/bin/rc-depend -u
|
||||
# Generate openrc cache
|
||||
[[ -d "/lib/rc/init.d" ]] && touch /lib/rc/init.d/softlevel
|
||||
[[ -d "/run/openrc" ]] && touch /run/openrc/softlevel
|
||||
/etc/init.d/savecache start
|
||||
/etc/init.d/savecache zap
|
||||
ldconfig
|
||||
ldconfig
|
||||
umount /proc
|
||||
}
|
||||
|
||||
|
||||
setup_users() {
|
||||
# setup root password to... root!
|
||||
echo root:root | chpasswd
|
||||
# setup normal user "sabayon"
|
||||
(
|
||||
if [ ! -x "/sbin/sabayon-functions.sh" ]; then
|
||||
echo "no /sbin/sabayon-functions.sh found"
|
||||
exit 1
|
||||
fi
|
||||
. /sbin/sabayon-functions.sh
|
||||
sabayon_setup_live_user "sabayon" || exit 1
|
||||
# setup "sabayon" password to... sabayon!
|
||||
echo "sabayon:sabayon" | chpasswd
|
||||
|
||||
# also add "sabayon" to disk group
|
||||
usermod -a -G disk sabayon
|
||||
)
|
||||
}
|
||||
|
||||
setup_serial() {
|
||||
# setup serial login
|
||||
sed -i "s:^s0.*::" /etc/inittab
|
||||
echo "s0:12345:respawn:/sbin/agetty 115200 ttyO2 vt100" >> /etc/inittab
|
||||
}
|
||||
|
||||
setup_displaymanager
|
||||
setup_desktop_environment
|
||||
setup_users
|
||||
setup_boot
|
||||
setup_serial
|
||||
setup_startup_caches
|
||||
|
||||
exit 0
|
||||
|
||||
@@ -1,66 +0,0 @@
|
||||
#!/bin/sh
|
||||
# This script is executed inside the image chroot before packing up.
|
||||
# Architecture/platform specific code goes here, like kernel install
|
||||
# and configuration
|
||||
|
||||
env-update
|
||||
. /etc/profile
|
||||
|
||||
setup_boot() {
|
||||
# enable sshd by default
|
||||
rc-update add sshd default
|
||||
rc-update add syslog-ng boot
|
||||
rc-update add vixie-cron boot
|
||||
rc-update add dbus boot
|
||||
rc-update add NetworkManager default
|
||||
rc-update add NetworkManager-setup default
|
||||
|
||||
# select the first available kernel
|
||||
eselect uimage set 1
|
||||
# cleaning up deps
|
||||
rc-update --update
|
||||
}
|
||||
|
||||
setup_users() {
|
||||
# setup root password to... root!
|
||||
echo root:root | chpasswd
|
||||
# setup normal user "sabayon"
|
||||
(
|
||||
if [ ! -x "/sbin/sabayon-functions.sh" ]; then
|
||||
echo "no /sbin/sabayon-functions.sh found"
|
||||
exit 1
|
||||
fi
|
||||
. /sbin/sabayon-functions.sh
|
||||
sabayon_setup_live_user "sabayon" || exit 1
|
||||
# setup "sabayon" password to... sabayon!
|
||||
echo "sabayon:sabayon" | chpasswd
|
||||
)
|
||||
}
|
||||
|
||||
setup_startup_caches() {
|
||||
mount -t proc proc /proc
|
||||
/lib/rc/bin/rc-depend -u
|
||||
# Generate openrc cache
|
||||
[[ -d "/lib/rc/init.d" ]] && touch /lib/rc/init.d/softlevel
|
||||
[[ -d "/run/openrc" ]] && touch /run/openrc/softlevel
|
||||
/etc/init.d/savecache start
|
||||
/etc/init.d/savecache zap
|
||||
ldconfig
|
||||
ldconfig
|
||||
umount /proc
|
||||
}
|
||||
|
||||
|
||||
setup_serial() {
|
||||
# Setup serial login
|
||||
sed -i "s:^s0.*::" /etc/inittab
|
||||
echo "s0:12345:respawn:/sbin/agetty 115200 ttyO0 vt100" >> /etc/inittab
|
||||
}
|
||||
|
||||
setup_boot
|
||||
setup_users
|
||||
setup_serial
|
||||
setup_startup_caches
|
||||
|
||||
exit 0
|
||||
|
||||
@@ -1,114 +0,0 @@
|
||||
#!/bin/sh
|
||||
# This script is executed inside the image chroot before packing up.
|
||||
# Architecture/platform specific code goes here, like kernel install
|
||||
# and configuration
|
||||
|
||||
env-update
|
||||
. /etc/profile
|
||||
|
||||
setup_displaymanager() {
|
||||
# determine what is the login manager
|
||||
if [ -n "$(equo match --installed gnome-base/gdm -qv)" ]; then
|
||||
sed -i 's/DISPLAYMANAGER=".*"/DISPLAYMANAGER="gdm"/g' /etc/conf.d/xdm
|
||||
elif [ -n "$(equo match --installed lxde-base/lxdm -qv)" ]; then
|
||||
sed -i 's/DISPLAYMANAGER=".*"/DISPLAYMANAGER="lxdm"/g' /etc/conf.d/xdm
|
||||
elif [ -n "$(equo match --installed kde-base/kdm -qv)" ]; then
|
||||
sed -i 's/DISPLAYMANAGER=".*"/DISPLAYMANAGER="kdm"/g' /etc/conf.d/xdm
|
||||
else
|
||||
sed -i 's/DISPLAYMANAGER=".*"/DISPLAYMANAGER="xdm"/g' /etc/conf.d/xdm
|
||||
fi
|
||||
}
|
||||
|
||||
setup_desktop_environment() {
|
||||
if [ -f "/usr/share/xsessions/LXDE.desktop" ]; then
|
||||
echo "[Desktop]" > /etc/skel/.dmrc
|
||||
echo "Session=LXDE" >> /etc/skel/.dmrc
|
||||
elif [ -n "/usr/share/xsessions/xfce.desktop" ]; then
|
||||
echo "[Desktop]" > /etc/skel/.dmrc
|
||||
echo "Session=xfce" >> /etc/skel/.dmrc
|
||||
|
||||
else
|
||||
# Fluxbox is always there
|
||||
echo "[Desktop]" > /etc/skel/.dmrc
|
||||
echo "Session=fluxbox" >> /etc/skel/.dmrc
|
||||
fi
|
||||
}
|
||||
|
||||
setup_boot() {
|
||||
# enable sshd by default
|
||||
rc-update add sshd default
|
||||
# enable logger by default
|
||||
rc-update add syslog-ng boot
|
||||
rc-update add vixie-cron boot
|
||||
# enable dbus, of course, and also NetworkManager
|
||||
rc-update add dbus boot
|
||||
rc-update add NetworkManager default
|
||||
rc-update add NetworkManager-setup default
|
||||
rc-update del net.eth0 default
|
||||
|
||||
# start X.Org by default
|
||||
rc-update add xdm default
|
||||
|
||||
# select the first available kernel
|
||||
eselect uimage set 1
|
||||
|
||||
# cleaning up deps
|
||||
rc-update --update
|
||||
}
|
||||
|
||||
setup_startup_caches() {
|
||||
mount -t proc proc /proc
|
||||
/lib/rc/bin/rc-depend -u
|
||||
# Generate openrc cache
|
||||
[[ -d "/lib/rc/init.d" ]] && touch /lib/rc/init.d/softlevel
|
||||
[[ -d "/run/openrc" ]] && touch /run/openrc/softlevel
|
||||
/etc/init.d/savecache start
|
||||
/etc/init.d/savecache zap
|
||||
ldconfig
|
||||
ldconfig
|
||||
umount /proc
|
||||
}
|
||||
|
||||
|
||||
setup_users() {
|
||||
# setup root password to... root!
|
||||
echo root:root | chpasswd
|
||||
# setup normal user "sabayon"
|
||||
(
|
||||
if [ ! -x "/sbin/sabayon-functions.sh" ]; then
|
||||
echo "no /sbin/sabayon-functions.sh found"
|
||||
exit 1
|
||||
fi
|
||||
. /sbin/sabayon-functions.sh
|
||||
sabayon_setup_live_user "sabayon" || exit 1
|
||||
# setup "sabayon" password to... sabayon!
|
||||
echo "sabayon:sabayon" | chpasswd
|
||||
|
||||
# also add "sabayon" to disk group
|
||||
usermod -a -G disk sabayon
|
||||
)
|
||||
}
|
||||
|
||||
setup_serial() {
|
||||
# setup serial login
|
||||
sed -i "s:^s0.*::" /etc/inittab
|
||||
echo "s0:12345:respawn:/sbin/agetty 115200 ttymxc0 vt100" >> /etc/inittab
|
||||
echo "ttymxc0" >> /etc/securetty
|
||||
}
|
||||
|
||||
setup_fstab() {
|
||||
# add /dev/mmcblk0p1 to /etc/fstab
|
||||
local boot_part_type="${BOOT_PART_TYPE:-ext3}"
|
||||
echo "/dev/mmcblk0p1 /boot ${boot_part_type} noauto 0 1" >> /etc/fstab
|
||||
}
|
||||
|
||||
setup_displaymanager
|
||||
setup_desktop_environment
|
||||
setup_users
|
||||
setup_boot
|
||||
setup_serial
|
||||
setup_fstab
|
||||
setup_startup_caches
|
||||
|
||||
exit 0
|
||||
|
||||
295
scripts/mkloopgptdisk.sh
Executable file
295
scripts/mkloopgptdisk.sh
Executable file
@@ -0,0 +1,295 @@
|
||||
#! /bin/sh
|
||||
# (c) Copyright 2012 Fabio Erculiani <lxnay@sabayon.org>
|
||||
# Licensed under terms of GPLv2
|
||||
|
||||
env-update
|
||||
. /etc/profile
|
||||
|
||||
export LC_ALL=en_US.UTF-8
|
||||
|
||||
# Path to molecules.git dir
|
||||
SABAYON_MOLECULE_HOME="${SABAYON_MOLECULE_HOME:-/sabayon}"
|
||||
export SABAYON_MOLECULE_HOME
|
||||
|
||||
# Expected env variables:
|
||||
# PATHS_TO_REMOVE = ";" separated list of paths to rm -rf
|
||||
# PATHS_TO_EMPTY = ";" separated list of paths to rm -rf (keeping the dir)
|
||||
# RELEASE_STRING
|
||||
# RELEASE_VERSION
|
||||
# RELEASE_DESC
|
||||
# RELEASE_FILE
|
||||
# IMAGE_NAME
|
||||
# DESTINATION_IMAGE_DIR
|
||||
# PACKAGES_TO_ADD
|
||||
# PACKAGES_TO_REMOVE
|
||||
|
||||
if [ ${#} -ne 5 ]; then
|
||||
echo "usage: ${0} <path to regular file containing the image> <size in Mb> <source boot files dir> <source chroot>"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
CHROOT_SCRIPT="${1}"
|
||||
if [ ! -x "${CHROOT_SCRIPT}" ]; then
|
||||
echo "${CHROOT_SCRIPT} is not executable"
|
||||
exit 1
|
||||
fi
|
||||
FILE="${2}"
|
||||
SIZE="${3}"
|
||||
BOOT_DIR="${4}"
|
||||
CHROOT_DIR="${5}"
|
||||
# Should we make a tarball of the rootfs and bootfs?
|
||||
MAKE_TARBALL="${MAKE_TARBALL:-1}"
|
||||
# Boot partition type
|
||||
BOOT_PART_TYPE="${BOOT_PART_TYPE:-ext2}"
|
||||
BOOT_PART_TYPE_GPT="${BOOT_PART_TYPE_GPT:-8300}"
|
||||
BOOT_PART_MKFS_ARGS="${BOOT_PART_MKFS_ARGS:--L Boot -I 128}"
|
||||
# Root partition type
|
||||
ROOT_PART_TYPE="${ROOT_PART_TYPE:-ext4}"
|
||||
ROOT_PART_MKFS_ARGS="${ROOT_PART_MKFS_ARGS:--L SabLink}"
|
||||
# Swap partiton arguments
|
||||
SWAP_PART_MKFS_ARGS="${SWAP_PART_MKFS_ARGS:--L Swap}"
|
||||
# Copy /boot content from Root partition to Boot partition?
|
||||
BOOT_PART_TYPE_INSIDE_ROOT="${BOOT_PART_TYPE_INSIDE_ROOT:-1}"
|
||||
|
||||
cleanup_loopbacks() {
|
||||
cd /
|
||||
sync
|
||||
sync
|
||||
sleep 5
|
||||
sync
|
||||
[[ -n "${tmp_file}" ]] && rm "${tmp_file}" 2> /dev/null
|
||||
[[ -n "${tmp_dir}" ]] && { umount "${tmp_dir}/proc" &> /dev/null; }
|
||||
[[ -n "${tmp_dir}" ]] && { umount "${tmp_dir}" &> /dev/null; rmdir "${tmp_dir}" &> /dev/null; }
|
||||
[[ -n "${boot_tmp_dir}" ]] && { umount "${boot_tmp_dir}" &> /dev/null; rmdir "${boot_tmp_dir}" &> /dev/null; }
|
||||
sleep 1
|
||||
[[ -n "${boot_part}" ]] && losetup -d "${boot_part}" 2> /dev/null
|
||||
[[ -n "${root_part}" ]] && losetup -d "${root_part}" 2> /dev/null
|
||||
[[ -n "${DRIVE}" ]] && losetup -d "${DRIVE}" 2> /dev/null
|
||||
# make sure to have run this
|
||||
[[ -n "${tmp_dir}" ]] && CHROOT_DIR="${tmp_dir}" "${SABAYON_MOLECULE_HOME}"/scripts/mmc_remaster_post.sh
|
||||
}
|
||||
trap "cleanup_loopbacks" 1 2 3 6 9 14 15 EXIT
|
||||
|
||||
# Erase the file
|
||||
echo "Generating the empty image file at ${FILE}"
|
||||
dd if=/dev/zero of="${FILE}" bs=1024000 count="${SIZE}"
|
||||
[[ "$?" != "0" ]] && exit 1
|
||||
|
||||
echo "Configured the loopback partition at ${FILE}"
|
||||
|
||||
# Calculate size using fdisk
|
||||
SIZE=$(sgdisk -p "${FILE}" | grep First | awk '{print $10}')
|
||||
# Magic first partition size, given 300MB below
|
||||
BOOTSIZE="616447"
|
||||
BOOTOFFSET="2048"
|
||||
SWAPSIZE="4194304"
|
||||
|
||||
echo "Disk size : ${SIZE} Sectors"
|
||||
echo "Disk sectors : ${SECTORS}"
|
||||
echo "Magic size : Sector ${BOOTSIZE} (boot part size 300MB)"
|
||||
echo "Start offset : Sector ${BOOTOFFSET}"
|
||||
|
||||
# this will create a first partition that is 300MB long
|
||||
# Starts at sect 2048, ends at sect 616447, each sector is 512bytes
|
||||
sgdisk -n 1:${BOOTOFFSET}:${BOOTSIZE} -t 1:${BOOT_PART_TYPE_GPT} ${FILE}
|
||||
|
||||
# Start of Root is 1 sector after the Boot Part
|
||||
ROOTOFFSET=$((BOOTSIZE+1))
|
||||
# Swap starts 2GB bevore end of Disk
|
||||
SWAPOFFSET=$((SIZE-SWAPSIZE))
|
||||
# root ends 1 sector before swap starts
|
||||
ROOTSIZE=$((SWAPOFFSET-1))
|
||||
sgdisk -n 2:${ROOTOFFSET}:${ROOTSIZE} -t 2:${BOOT_PART_TYPE_GPT} ${FILE}
|
||||
sgdisk -n 3:${SWAPOFFSET}:${SIZE} -t 3:8200 ${FILE}
|
||||
|
||||
echo "create compatibility hybrid MBR"
|
||||
# sgdisk still not support the possibility to make the ee part non 1
|
||||
echo "r
|
||||
h
|
||||
1
|
||||
n
|
||||
83
|
||||
y
|
||||
n
|
||||
w
|
||||
y" | gdisk ${FILE}
|
||||
|
||||
sleep 2
|
||||
|
||||
sgdisk -p "${FILE}"
|
||||
|
||||
# each sector has 512bytes
|
||||
LOOPDEVICE=$(kpartx -v -l "${FILE}" | grep deleted | awk '{print $4}')
|
||||
echo "Loop Device ${LOOPDEVICE}"
|
||||
LOOPNAME=${LOOPDEVICE##*/}
|
||||
echo "Loop Device Name ${LOOPNAME}"
|
||||
|
||||
echo "Create loop devces"
|
||||
# Get two loopback devices first
|
||||
part=$(kpartx -v -a "${FILE}")
|
||||
if [ -z "${part}" ]; then
|
||||
echo "Cannot setup the partitions loopbacks"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
boot_part="/dev/mapper/${LOOPNAME}p1"
|
||||
root_part="/dev/mapper/${LOOPNAME}p2"
|
||||
swap_part="/dev/mapper/${LOOPNAME}p3"
|
||||
|
||||
echo "Boot Partiton at : ${boot_part}"
|
||||
echo "Root Partition at : ${root_part}"
|
||||
|
||||
# Format boot
|
||||
echo "Formatting ${BOOT_PART_TYPE} ${boot_part}..."
|
||||
"mkfs.${BOOT_PART_TYPE}" ${BOOT_PART_MKFS_ARGS} "${boot_part}" || exit 1
|
||||
|
||||
# Format extfs
|
||||
echo "Formatting ${ROOT_PART_TYPE} ${root_part}..."
|
||||
"mkfs.${ROOT_PART_TYPE}" ${ROOT_PART_MKFS_ARGS} "${root_part}" || exit 1
|
||||
|
||||
# Format swap
|
||||
echo "Formatting swap ${swap_part}..."
|
||||
"mkswap" ${SWAP_PART_MKFS_ARGS} "${swap_part}" || exit 1
|
||||
|
||||
boot_tmp_dir=$(mktemp -d)
|
||||
if [[ -z "${boot_tmp_dir}" ]]; then
|
||||
echo "Cannot create temporary dir (boot)"
|
||||
exit 1
|
||||
fi
|
||||
chmod 755 "${boot_tmp_dir}" || exit 1
|
||||
|
||||
tmp_dir=$(mktemp -d)
|
||||
if [[ -z "${tmp_dir}" ]]; then
|
||||
echo "Cannot create temporary dir"
|
||||
exit 1
|
||||
fi
|
||||
chmod 755 "${tmp_dir}" || exit 1
|
||||
|
||||
sleep 2
|
||||
sync
|
||||
|
||||
echo "Setting up the boot directory content, mounting on ${boot_tmp_dir}"
|
||||
mount "${boot_part}" "${boot_tmp_dir}"
|
||||
cp -R "${BOOT_DIR}"/* "${boot_tmp_dir}"/ || exit 1
|
||||
|
||||
echo "Setting up the extfs directory content, mounting on ${tmp_dir}"
|
||||
mount "${root_part}" "${tmp_dir}"
|
||||
rsync -a -H -A -X --delete-during "${CHROOT_DIR}"/ "${tmp_dir}"/ --exclude "/proc/*" --exclude "/sys/*" \
|
||||
--exclude "/dev/pts/*" --exclude "/dev/shm/*" || exit 1
|
||||
|
||||
CHROOT_DIR="${tmp_dir}" "${SABAYON_MOLECULE_HOME}"/scripts/remaster_pre.sh || exit 1
|
||||
|
||||
# Configure 00-board-setup.start
|
||||
source_board_setup="${SABAYON_MOLECULE_HOME}/boot/arm_startup/00-board-setup.start"
|
||||
dest_board_setup="${CHROOT_DIR}/etc/local.d/00-board-setup.start"
|
||||
if [ -f "${source_board_setup}" ]; then
|
||||
echo "Setting up ${dest_board_setup}"
|
||||
cp "${source_board_setup}" "${dest_board_setup}" || exit 1
|
||||
chmod 755 "${dest_board_setup}" || exit 1
|
||||
chown root:root "${dest_board_setup}" || exit 1
|
||||
fi
|
||||
|
||||
# execute PACKAGES_TO_ADD and PACKAGES_TO_REMOVE
|
||||
export ETP_NONINTERACTIVE=1
|
||||
# Entropy doesn't like non-UTF locale encodings
|
||||
export LC_ALL=en_US.UTF-8
|
||||
|
||||
# do I have to run "equo update?"
|
||||
# If we are running outside the DAILY scope, it's
|
||||
# better to do it here. If instead we're doing a
|
||||
# DAILY, this is already done by other scripts.
|
||||
if [ -z "$(basename ${IMAGE_NAME} | grep DAILY)" ]; then
|
||||
FORCE_EAPI=2 chroot "${tmp_dir}" equo update || \
|
||||
FORCE_EAPI=2 chroot "${tmp_dir}" equo update || \
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ -n "${PACKAGES_TO_ADD}" ]; then
|
||||
add_cmd="equo install ${PACKAGES_TO_ADD}"
|
||||
chroot "${tmp_dir}" ${add_cmd} || exit 1
|
||||
fi
|
||||
if [ -n "${PACKAGES_TO_REMOVE}" ]; then
|
||||
rem_cmd="equo remove ${PACKAGES_TO_REMOVE}"
|
||||
chroot "${tmp_dir}" ${rem_cmd} || exit 1
|
||||
fi
|
||||
|
||||
# execute CHROOT_SCRIPT hook inside chroot
|
||||
chroot_script_name=$(basename "${CHROOT_SCRIPT}")
|
||||
target_chroot_script="${tmp_dir}"/"${chroot_script_name}"
|
||||
cp -p "${CHROOT_SCRIPT}" "${target_chroot_script}" || exit 1
|
||||
chmod 700 "${target_chroot_script}" || exit 1
|
||||
chown root "${target_chroot_script}" || exit 1
|
||||
chroot "${tmp_dir}" "/${chroot_script_name}" || exit 1
|
||||
rm -f "${target_chroot_script}"
|
||||
|
||||
CHROOT_DIR="${tmp_dir}" "${SABAYON_MOLECULE_HOME}"/scripts/mmc_remaster_post.sh
|
||||
|
||||
# execute final cleanup of entropy stuff
|
||||
chroot "${tmp_dir}" equo rescue vacuum
|
||||
|
||||
# setup sudoers, enable wheel group
|
||||
if [ -f "${tmp_dir}/etc/sudoers" ]; then
|
||||
echo "# added by Sabayon Molecule" >> "${tmp_dir}/etc/sudoers"
|
||||
echo "%wheel ALL=ALL" >> "${tmp_dir}/etc/sudoers"
|
||||
fi
|
||||
|
||||
export LC_ALL=C
|
||||
|
||||
# work out paths to empty and paths to remove
|
||||
if [ -n "${PATHS_TO_REMOVE}" ]; then
|
||||
set -f
|
||||
for path in $(echo ${PATHS_TO_REMOVE} | tr ";" "\n"); do
|
||||
echo "Removing: ${path}"
|
||||
set +f
|
||||
rm -rf "${tmp_dir}"/${path}
|
||||
set -f
|
||||
done
|
||||
set +f
|
||||
fi
|
||||
if [ -n "${PATHS_TO_EMPTY}" ]; then
|
||||
set -f
|
||||
for path in $(echo ${PATHS_TO_EMPTY} | tr ";" "\n"); do
|
||||
set +f
|
||||
echo "Emptying: ${path}"
|
||||
rm -rf "${tmp_dir}"/"${path}"/*
|
||||
set -f
|
||||
done
|
||||
set +f
|
||||
fi
|
||||
|
||||
if [ -n "${RELEASE_FILE}" ]; then
|
||||
release_file="${tmp_dir}"/"${RELEASE_FILE}"
|
||||
release_dir=$(dirname "${release_file}")
|
||||
[[ ! -d "${release_dir}" ]] && { mkdir -p "${release_dir}" || exit 1; }
|
||||
echo "${RELEASE_STRING} ${RELEASE_VERSION} ${RELEASE_DESC}" > "${release_file}"
|
||||
fi
|
||||
|
||||
# BOOT_PART_TYPE_INSIDE_ROOT
|
||||
if [ -n "${BOOT_PART_TYPE_INSIDE_ROOT}" ]; then
|
||||
echo "Copying data from ${tmp_dir}/boot to ${boot_tmp_dir} as requested..."
|
||||
cp -Rp "${tmp_dir}/boot/"* "${boot_tmp_dir}/" || exit 1
|
||||
fi
|
||||
umount "${boot_tmp_dir}" || exit 1
|
||||
|
||||
|
||||
if [ -n "${DESTINATION_IMAGE_DIR}" ] && [ "${MAKE_TARBALL}" = "1" ]; then
|
||||
# Create the rootfs tarball
|
||||
ROOTFS_TARBALL="${DESTINATION_IMAGE_DIR}/${IMAGE_NAME}.rootfs.tar.xz"
|
||||
echo "Creating the roofs tarball: ${ROOTFS_TARBALL}"
|
||||
tmp_file=$(mktemp --suffix=.tar.xz)
|
||||
[[ -z "${tmp_file}" ]] && exit 1
|
||||
cd "${tmp_dir}" || exit 1
|
||||
tar --numeric-owner --preserve-permissions --same-owner -cJf "${tmp_file}" ./ || exit 1
|
||||
mv "${tmp_file}" "${ROOTFS_TARBALL}" || exit 1
|
||||
chmod 644 "${ROOTFS_TARBALL}" || exit 1
|
||||
cd "$(dirname "${ROOTFS_TARBALL}")" || exit 1
|
||||
md5sum "$(basename "${ROOTFS_TARBALL}")" > "$(basename "${ROOTFS_TARBALL}")".md5
|
||||
fi
|
||||
|
||||
umount "${tmp_dir}" || exit 1
|
||||
|
||||
cleanup_loopbacks
|
||||
|
||||
kpartx -v -d "${FILE}"
|
||||
kpartx -v -d "${FILE}"
|
||||
echo "Your GPT Disk image \"${FILE}\" is ready"
|
||||
109
scripts/mkloopgptdisk_buffalo_kb_pro_chroot_hook.sh
Executable file
109
scripts/mkloopgptdisk_buffalo_kb_pro_chroot_hook.sh
Executable file
@@ -0,0 +1,109 @@
|
||||
#!/bin/sh
|
||||
# This script is executed inside the image chroot before packing up.
|
||||
# Architecture/platform specific code goes here, like kernel install
|
||||
# and configuration
|
||||
|
||||
env-update
|
||||
. /etc/profile
|
||||
|
||||
setup_boot() {
|
||||
# enable sshd by default
|
||||
rc-update add sshd default
|
||||
# enable logger by default
|
||||
rc-update add syslog-ng boot
|
||||
rc-update add vixie-cron boot
|
||||
# Linkstation Pro/Live Deamon
|
||||
rc-update add micro-evtd-boot boot
|
||||
rc-update add micro-evtd default
|
||||
rc-update add vixie-cron boot
|
||||
# enable dbus, of course, and also NetworkManager
|
||||
rc-update add dbus boot
|
||||
|
||||
# we are on eth0 in the ls pro/live/kuro so create the init.d link
|
||||
ln -sf net.lo /etc/init.d/net.eth0
|
||||
rc-update add net.eth0 default
|
||||
|
||||
# select the first available kernel
|
||||
eselect uimage set 1
|
||||
|
||||
# cleaning up deps
|
||||
rc-update --update
|
||||
}
|
||||
|
||||
setup_startup_caches() {
|
||||
mount -t proc proc /proc
|
||||
/lib/rc/bin/rc-depend -u
|
||||
# Generate openrc cache
|
||||
[[ -d "/lib/rc/init.d" ]] && touch /lib/rc/init.d/softlevel
|
||||
[[ -d "/run/openrc" ]] && touch /run/openrc/softlevel
|
||||
/etc/init.d/savecache start
|
||||
/etc/init.d/savecache zap
|
||||
ldconfig
|
||||
ldconfig
|
||||
umount /proc
|
||||
}
|
||||
|
||||
|
||||
setup_users() {
|
||||
# setup root password to... root!
|
||||
echo root:sablink | chpasswd
|
||||
}
|
||||
|
||||
setup_serial() {
|
||||
# setup serial login
|
||||
sed -i "s:^s0.*::" /etc/inittab
|
||||
echo "s0:12345:respawn:/sbin/agetty 115200 ttyS0 vt100" >> /etc/inittab
|
||||
}
|
||||
|
||||
setup_fallback_network() {
|
||||
# setup fallback network
|
||||
echo "" >> /etc/conf.d/net
|
||||
echo "" >> /etc/conf.d/net
|
||||
echo "# Sablink Core Network Config" >> /etc/conf.d/net
|
||||
echo "#" >> /etc/conf.d/net
|
||||
echo "# DHCP IP / route configuration, with fallback to a static IP / route" >> /etc/conf.d/net
|
||||
echo "#" >> /etc/conf.d/net
|
||||
echo "" >> /etc/conf.d/net
|
||||
echo "config_eth0=\"dhcp\"" >> /etc/conf.d/net
|
||||
echo "fallback_eth0=\"192.168.178.103 netmask 255.255.255.0 broadcast 192.168.178.255\"" >> /etc/conf.d/net
|
||||
echo "fallback_route_eth0=\"default via 192.168.178.1\"" >> /etc/conf.d/net
|
||||
echo "" >> /etc/conf.d/net
|
||||
echo "" >> /etc/conf.d/net
|
||||
echo "#" >> /etc/conf.d/net
|
||||
echo "# pure static IP / route configuration, should the above not work even with fallback.." >> /etc/conf.d/net
|
||||
echo "# (in that case, comment the whole DHCP section and uncomment this one)" >> /etc/conf.d/net
|
||||
echo "#" >> /etc/conf.d/net
|
||||
echo "" >> /etc/conf.d/net
|
||||
echo "#config_eth0=\"192.168.11.3 netmask 255.255.255.0 broadcast 192.168.11.255\"" >> /etc/conf.d/net
|
||||
echo "#routes_eth0=\"default via 192.168.11.1\"" >> /etc/conf.d/net
|
||||
echo "" >> /etc/conf.d/net
|
||||
echo "" >> /etc/conf.d/net
|
||||
echo "" >> /etc/conf.d/net
|
||||
echo "#" >> /etc/conf.d/net
|
||||
echo "# DNS configuration" >> /etc/conf.d/net
|
||||
echo "#" >> /etc/conf.d/net
|
||||
echo "" >> /etc/conf.d/net
|
||||
echo "dns_servers_eth0=\"192.168.178.1\"" >> /etc/conf.d/net
|
||||
}
|
||||
|
||||
setup_fstab() {
|
||||
sed -e "s!/BOOT!/sda1!g" -e "s!/ROOT!/sda2!g" -e "s!SWAP!sda3!g" -e "s!ext3!ext4!g" -i /etc/fstab
|
||||
}
|
||||
|
||||
setup_layman() {
|
||||
LAYLIST=$(layman -l | awk '{print $2}' | tr '\n' ' ')
|
||||
for package in ${LAYLIST}; do
|
||||
layman -d ${package}
|
||||
done
|
||||
}
|
||||
|
||||
setup_users
|
||||
setup_boot
|
||||
setup_serial
|
||||
setup_startup_caches
|
||||
setup_fallback_network
|
||||
setup_fstab
|
||||
setup_layman
|
||||
|
||||
exit 0
|
||||
|
||||
109
scripts/mkloopgptdisk_buffalo_ls_pro_live_chroot_hook.sh
Executable file
109
scripts/mkloopgptdisk_buffalo_ls_pro_live_chroot_hook.sh
Executable file
@@ -0,0 +1,109 @@
|
||||
#!/bin/sh
|
||||
# This script is executed inside the image chroot before packing up.
|
||||
# Architecture/platform specific code goes here, like kernel install
|
||||
# and configuration
|
||||
|
||||
env-update
|
||||
. /etc/profile
|
||||
|
||||
setup_boot() {
|
||||
# enable sshd by default
|
||||
rc-update add sshd default
|
||||
# enable logger by default
|
||||
rc-update add syslog-ng boot
|
||||
rc-update add vixie-cron boot
|
||||
# Linkstation Pro/Live Deamon
|
||||
rc-update add micro-evtd-boot boot
|
||||
rc-update add micro-evtd default
|
||||
rc-update add vixie-cron boot
|
||||
# enable dbus, of course, and also NetworkManager
|
||||
rc-update add dbus boot
|
||||
|
||||
# we are on eth0 in the ls pro/live/kuro so create the init.d link
|
||||
ln -sf net.lo /etc/init.d/net.eth0
|
||||
rc-update add net.eth0 default
|
||||
|
||||
# select the first available kernel
|
||||
eselect uimage set 1
|
||||
|
||||
# cleaning up deps
|
||||
rc-update --update
|
||||
}
|
||||
|
||||
setup_startup_caches() {
|
||||
mount -t proc proc /proc
|
||||
/lib/rc/bin/rc-depend -u
|
||||
# Generate openrc cache
|
||||
[[ -d "/lib/rc/init.d" ]] && touch /lib/rc/init.d/softlevel
|
||||
[[ -d "/run/openrc" ]] && touch /run/openrc/softlevel
|
||||
/etc/init.d/savecache start
|
||||
/etc/init.d/savecache zap
|
||||
ldconfig
|
||||
ldconfig
|
||||
umount /proc
|
||||
}
|
||||
|
||||
|
||||
setup_users() {
|
||||
# setup root password to... root!
|
||||
echo root:sablink | chpasswd
|
||||
}
|
||||
|
||||
setup_serial() {
|
||||
# setup serial login
|
||||
sed -i "s:^s0.*::" /etc/inittab
|
||||
echo "s0:12345:respawn:/sbin/agetty 115200 ttyS0 vt100" >> /etc/inittab
|
||||
}
|
||||
|
||||
setup_fallback_network() {
|
||||
# setup fallback network
|
||||
echo "" >> /etc/conf.d/net
|
||||
echo "" >> /etc/conf.d/net
|
||||
echo "# Sablink Core Network Config" >> /etc/conf.d/net
|
||||
echo "#" >> /etc/conf.d/net
|
||||
echo "# DHCP IP / route configuration, with fallback to a static IP / route" >> /etc/conf.d/net
|
||||
echo "#" >> /etc/conf.d/net
|
||||
echo "" >> /etc/conf.d/net
|
||||
echo "config_eth0=\"dhcp\"" >> /etc/conf.d/net
|
||||
echo "fallback_eth0=\"192.168.178.103 netmask 255.255.255.0 broadcast 192.168.178.255\"" >> /etc/conf.d/net
|
||||
echo "fallback_route_eth0=\"default via 192.168.178.1\"" >> /etc/conf.d/net
|
||||
echo "" >> /etc/conf.d/net
|
||||
echo "" >> /etc/conf.d/net
|
||||
echo "#" >> /etc/conf.d/net
|
||||
echo "# pure static IP / route configuration, should the above not work even with fallback.." >> /etc/conf.d/net
|
||||
echo "# (in that case, comment the whole DHCP section and uncomment this one)" >> /etc/conf.d/net
|
||||
echo "#" >> /etc/conf.d/net
|
||||
echo "" >> /etc/conf.d/net
|
||||
echo "#config_eth0=\"192.168.11.3 netmask 255.255.255.0 broadcast 192.168.11.255\"" >> /etc/conf.d/net
|
||||
echo "#routes_eth0=\"default via 192.168.11.1\"" >> /etc/conf.d/net
|
||||
echo "" >> /etc/conf.d/net
|
||||
echo "" >> /etc/conf.d/net
|
||||
echo "" >> /etc/conf.d/net
|
||||
echo "#" >> /etc/conf.d/net
|
||||
echo "# DNS configuration" >> /etc/conf.d/net
|
||||
echo "#" >> /etc/conf.d/net
|
||||
echo "" >> /etc/conf.d/net
|
||||
echo "dns_servers_eth0=\"192.168.178.1\"" >> /etc/conf.d/net
|
||||
}
|
||||
|
||||
setup_fstab() {
|
||||
sed -e "s!/BOOT!/sda1!g" -e "s!/ROOT!/sda2!g" -e "s!SWAP!sda3!g" -e "s!ext3!ext4!g" -i /etc/fstab
|
||||
}
|
||||
|
||||
setup_layman() {
|
||||
LAYLIST=$(layman -l | awk '{print $2}' | tr '\n' ' ')
|
||||
for package in ${LAYLIST}; do
|
||||
layman -d ${package}
|
||||
done
|
||||
}
|
||||
|
||||
setup_users
|
||||
setup_boot
|
||||
setup_serial
|
||||
setup_startup_caches
|
||||
setup_fallback_network
|
||||
setup_fstab
|
||||
setup_layman
|
||||
|
||||
exit 0
|
||||
|
||||
109
scripts/mkloopgptdisk_buffalo_ls_xhl_chroot_hook.sh
Executable file
109
scripts/mkloopgptdisk_buffalo_ls_xhl_chroot_hook.sh
Executable file
@@ -0,0 +1,109 @@
|
||||
#!/bin/sh
|
||||
# This script is executed inside the image chroot before packing up.
|
||||
# Architecture/platform specific code goes here, like kernel install
|
||||
# and configuration
|
||||
|
||||
env-update
|
||||
. /etc/profile
|
||||
|
||||
setup_boot() {
|
||||
# enable sshd by default
|
||||
rc-update add sshd default
|
||||
# enable logger by default
|
||||
rc-update add syslog-ng boot
|
||||
rc-update add vixie-cron boot
|
||||
# Linkstation Pro/Live Deamon
|
||||
rc-update add ntp-client default
|
||||
rc-update add ntpd default
|
||||
rc-update add vixie-cron boot
|
||||
# enable dbus, of course, and also NetworkManager
|
||||
rc-update add dbus boot
|
||||
|
||||
# we are on eth1 in the ls xhl/chl2 so create the init.d link
|
||||
ln -sf net.lo /etc/init.d/net.eth1
|
||||
rc-update add net.eth1 default
|
||||
|
||||
# select the first available kernel
|
||||
eselect uimage set 1
|
||||
|
||||
# cleaning up deps
|
||||
rc-update --update
|
||||
}
|
||||
|
||||
setup_startup_caches() {
|
||||
mount -t proc proc /proc
|
||||
/lib/rc/bin/rc-depend -u
|
||||
# Generate openrc cache
|
||||
[[ -d "/lib/rc/init.d" ]] && touch /lib/rc/init.d/softlevel
|
||||
[[ -d "/run/openrc" ]] && touch /run/openrc/softlevel
|
||||
/etc/init.d/savecache start
|
||||
/etc/init.d/savecache zap
|
||||
ldconfig
|
||||
ldconfig
|
||||
umount /proc
|
||||
}
|
||||
|
||||
|
||||
setup_users() {
|
||||
# setup root password to... root!
|
||||
echo root:sablink | chpasswd
|
||||
}
|
||||
|
||||
setup_serial() {
|
||||
# setup serial login
|
||||
sed -i "s:^s0.*::" /etc/inittab
|
||||
echo "s0:12345:respawn:/sbin/agetty 115200 ttyS0 vt100" >> /etc/inittab
|
||||
}
|
||||
|
||||
setup_fallback_network() {
|
||||
# setup fallback network
|
||||
echo "" >> /etc/conf.d/net
|
||||
echo "" >> /etc/conf.d/net
|
||||
echo "# Sablink Core Network Config" >> /etc/conf.d/net
|
||||
echo "#" >> /etc/conf.d/net
|
||||
echo "# DHCP IP / route configuration, with fallback to a static IP / route" >> /etc/conf.d/net
|
||||
echo "#" >> /etc/conf.d/net
|
||||
echo "" >> /etc/conf.d/net
|
||||
echo "config_eth1=\"dhcp\"" >> /etc/conf.d/net
|
||||
echo "fallback_eth1=\"192.168.178.103 netmask 255.255.255.0 broadcast 192.168.178.255\"" >> /etc/conf.d/net
|
||||
echo "fallback_route_eth1=\"default via 192.168.178.1\"" >> /etc/conf.d/net
|
||||
echo "" >> /etc/conf.d/net
|
||||
echo "" >> /etc/conf.d/net
|
||||
echo "#" >> /etc/conf.d/net
|
||||
echo "# pure static IP / route configuration, should the above not work even with fallback.." >> /etc/conf.d/net
|
||||
echo "# (in that case, comment the whole DHCP section and uncomment this one)" >> /etc/conf.d/net
|
||||
echo "#" >> /etc/conf.d/net
|
||||
echo "" >> /etc/conf.d/net
|
||||
echo "#config_eth1=\"192.168.11.3 netmask 255.255.255.0 broadcast 192.168.11.255\"" >> /etc/conf.d/net
|
||||
echo "#routes_eth1=\"default via 192.168.11.1\"" >> /etc/conf.d/net
|
||||
echo "" >> /etc/conf.d/net
|
||||
echo "" >> /etc/conf.d/net
|
||||
echo "" >> /etc/conf.d/net
|
||||
echo "#" >> /etc/conf.d/net
|
||||
echo "# DNS configuration" >> /etc/conf.d/net
|
||||
echo "#" >> /etc/conf.d/net
|
||||
echo "" >> /etc/conf.d/net
|
||||
echo "dns_servers_eth1=\"192.168.178.1\"" >> /etc/conf.d/net
|
||||
}
|
||||
|
||||
setup_fstab() {
|
||||
sed -e "s!/BOOT!/sda1!g" -e "s!/ROOT!/sda2!g" -e "s!SWAP!sda3!g" -e "s!ext3!ext4!g" -i /etc/fstab
|
||||
}
|
||||
|
||||
setup_layman() {
|
||||
LAYLIST=$(layman -l | awk '{print $2}' | tr '\n' ' ')
|
||||
for package in ${LAYLIST}; do
|
||||
layman -d ${package}
|
||||
done
|
||||
}
|
||||
|
||||
setup_users
|
||||
setup_boot
|
||||
setup_serial
|
||||
setup_startup_caches
|
||||
setup_fallback_network
|
||||
setup_fstab
|
||||
setup_layman
|
||||
|
||||
exit 0
|
||||
|
||||
@@ -1,28 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
/usr/sbin/env-update
|
||||
. /etc/profile
|
||||
|
||||
# FUTURE NOTE:
|
||||
# this might get merged into remaster_generic_inner_chroot_script_after.sh
|
||||
# once the Gaming Edition will be rebased on top of SpinBase, now it's based
|
||||
# based on GNOME.
|
||||
|
||||
# Copy games icons on the desktop
|
||||
for desktop_file in $(grep -rl "Categories=.*Game" /usr/share/applications/*); do
|
||||
desktop_name=$(basename "${desktop_file}")
|
||||
cp "${desktop_file}" "/etc/skel/Desktop/${desktop_name}" || exit 1
|
||||
chmod 755 "/etc/skel/Desktop/${desktop_name}" || exit 1
|
||||
chown root "/etc/skel/Desktop/${desktop_name}" || exit 1
|
||||
done
|
||||
|
||||
echo -5 | equo conf update
|
||||
|
||||
rm /var/lib/entropy/client/database/*/sabayonlinux.org -rf
|
||||
rm /var/lib/entropy/client/database/*/sabayon-weekly -rf
|
||||
equo rescue vacuum
|
||||
# cleanup logs and cache
|
||||
rm /var/lib/entropy/logs -rf
|
||||
rm -rf /var/lib/entropy/*cache*
|
||||
|
||||
exit 0
|
||||
@@ -1,34 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
/usr/sbin/env-update
|
||||
. /etc/profile
|
||||
|
||||
rc-update del installer-gui boot
|
||||
rc-update del x-setup boot
|
||||
rc-update del hald boot
|
||||
rc-update del avahi-daemon default
|
||||
|
||||
# A RUNNING NetworkManager is required by Anaconda !!
|
||||
# re-enable rc_hotplug
|
||||
# sed -i 's:^rc_hotplug=.*:rc_hotplug="*":g' /etc/rc.conf
|
||||
# rc-update del NetworkManager default
|
||||
|
||||
# install-data dir is really not needed
|
||||
rm -rf /install-data
|
||||
|
||||
/lib/rc/bin/rc-depend -u
|
||||
|
||||
# Generate openrc cache
|
||||
[[ -d "/lib/rc/init.d" ]] && touch /lib/rc/init.d/softlevel
|
||||
[[ -d "/run/openrc" ]] && touch /run/openrc/softlevel
|
||||
/etc/init.d/savecache start
|
||||
/etc/init.d/savecache zap
|
||||
|
||||
ldconfig
|
||||
ldconfig
|
||||
|
||||
emaint --fix world
|
||||
|
||||
rm -rf /var/lib/entropy/*cache*
|
||||
|
||||
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,25 +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
|
||||
|
||||
GFORENSIC_DIR="${SABAYON_MOLECULE_HOME}/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/sabayon-forensic.jpg "${CHROOT_DIR}/usr/share/themes/Adwaita/backgrounds/stripes.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/org.freedesktop.udisks2.policy "${CHROOT_DIR}/usr/share/polkit-1/actions/org.freedesktop.udisks2.policy"
|
||||
cp "${GFORENSIC_DIR}"/files/xorg.conf.kjs "${CHROOT_DIR}/etc/X11/xorg.conf.kjs"
|
||||
cp "${GFORENSIC_DIR}"/files/xsettings.xml "${CHROOT_DIR}/etc/skel/.config/xfce4/xfconf/xfce-perchannel-xml/xsettings.xml"
|
||||
cp "${GFORENSIC_DIR}"/files/xfce4-panel.xml "${CHROOT_DIR}/etc/skel/.config/xfce4/xfconf/xfce-perchannel-xml/xfce4-panel.xml"
|
||||
cp "${GFORENSIC_DIR}"/files/helpers.rc "${CHROOT_DIR}/etc/skel/.config/xfce4/helpers.rc"
|
||||
cp "${GFORENSIC_DIR}"/files/rc.lua "${CHROOT_DIR}/etc/xdg/awesome/rc.lua"
|
||||
cp "${GFORENSIC_DIR}"/files/theme.lua "${CHROOT_DIR}/etc/xdg/awesome/themes/default/theme.lua"
|
||||
cp -r "${GFORENSIC_DIR}"/files/OSDark "${CHROOT_DIR}/usr/share/icons/"
|
||||
cp -r "${GFORENSIC_DIR}"/files/NewSlickness-round "${CHROOT_DIR}/usr/share/themes/"
|
||||
@@ -1,13 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Path to molecules.git dir
|
||||
SABAYON_MOLECULE_HOME="${SABAYON_MOLECULE_HOME:-/sabayon}"
|
||||
export SABAYON_MOLECULE_HOME
|
||||
|
||||
GFORENSIC_DIR="${SABAYON_MOLECULE_HOME}/remaster/gforensic"
|
||||
cp "${GFORENSIC_DIR}"/isolinux/isolinux.cfg "${CDROOT_DIR}/isolinux/txt.cfg"
|
||||
cp "${GFORENSIC_DIR}"/isolinux/back.jpg "${CDROOT_DIR}/isolinux/back.jpg"
|
||||
cp "${GFORENSIC_DIR}"/isolinux/isolinux.txt "${CDROOT_DIR}/isolinux/isolinux.txt"
|
||||
|
||||
# Generate livecd.squashfs.md5
|
||||
"${SABAYON_MOLECULE_HOME}"/scripts/pre_iso_script_livecd_hash.sh
|
||||
Reference in New Issue
Block a user