From 07a2c835049d9cc5ab97f81783d275565fc91d52 Mon Sep 17 00:00:00 2001
From: Christopher Spinrath <christopher.spinrath@rwth-aachen.de>
Date: Thu, 4 Sep 2014 22:14:03 +0200
Subject: [PATCH] =?UTF-8?q?Legacy=20Skripte,=20mit=20denen=20UCK=20automat?=
 =?UTF-8?q?isiert=20wurde=20hinzugef=C3=BCgt.?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 legacy_scripts/customize        | 88 +++++++++++++++++++++++++++++++++
 legacy_scripts/customize_common | 41 +++++++++++++++
 legacy_scripts/customize_initrd | 73 +++++++++++++++++++++++++++
 legacy_scripts/customize_iso    | 37 ++++++++++++++
 4 files changed, 239 insertions(+)
 create mode 100755 legacy_scripts/customize
 create mode 100755 legacy_scripts/customize_common
 create mode 100755 legacy_scripts/customize_initrd
 create mode 100755 legacy_scripts/customize_iso

diff --git a/legacy_scripts/customize b/legacy_scripts/customize
new file mode 100755
index 0000000..235ef6e
--- /dev/null
+++ b/legacy_scripts/customize
@@ -0,0 +1,88 @@
+#!/bin/bash
+
+#is this true for all uck versions??
+SCRIPT_DIR=`dirname "$0"`
+
+#source common functions (e.g. patch_all)
+if [ -e "$SCRIPT_DIR/customize_common" ]; then
+	source "$SCRIPT_DIR/customize_common"
+fi
+
+function prepare_install()
+{
+	#if [ -e "$SCRIPT_DIR/lip_sources.list" ]; then
+	#	cp -v "$SCRIPT_DIR/lip_sources.list" "/etc/apt/sources.list"
+	#fi
+	
+	#moved to liprepoctl.sh 
+	#echo "# offline repository of the linux install party
+#deb [ trusted=yes ] file:/cdrom/archives precise lip" > /etc/apt/sources.list.d/lipoffline.list
+
+	#uncomment if newest texlive is not part of your distribution
+	#add-apt-repository -y ppa:texlive-backports/ppa
+
+	apt-get update
+}
+
+function install_packages()
+{
+	apt-get upgrade --assume-yes --force-yes
+	apt-get install aptitude -y
+
+	#aptitude full-upgrade -y # make sure we have the newest versions
+	# Some daily images do not have a kernel ?!?
+	
+	#uncomment this if you remaster a daily build (fix kernel version!)
+	#aptitude reinstall linux-image-generic-lts-raring -y
+	#apt-cache depends linux-image-generic-lts-raring | tail -n+2 | awk '{print $NF}' | xargs aptitude reinstall -y 
+
+	aptitude install firefox thunderbird kfind kompare xloadimage gpsd-clients kde-config-gtk-style -y
+	aptitude install automake cmake aspell-de build-essential ffmpeg htop hunspell  lvm2 mencoder screen tofrodos efibootmgr gdisk linux-headers vlc moreutils network-manager-vpnc vim -y # install general packages
+	aptitude install --without-recommends mdadm -y # install mdadm without mailserver
+	aptitude install chktex cm-super context dvidvi dvipng feynmf fragmaster info lacheck latex-beamer latex-cjk-all latexdiff latexmk latex-sanskrit latex-xcolor lcdf-typetools lmodern pgf prosper psutils purifyeps t1utils tex4ht tex-gyre texinfo texlive-base texlive-bibtex-extra texlive-binaries texlive-extra-utils texlive-fonts-extra texlive-fonts-recommended texlive-font-utils texlive-formats-extra texlive-games texlive-generic-extra texlive-generic-recommended texlive-humanities texlive-lang-english texlive-lang-german texlive-latex-base texlive-latex-extra texlive-latex-recommended texlive-luatex texlive-math-extra texlive-metapost texlive-music texlive-omega texlive-pictures texlive-plain-extra texlive-pstricks texlive-publishers texlive-science texlive-xetex tipa xindy -y
+	aptitude install hunspell-de-de language-pack-de language-pack-support-de wngerman wogerman wswiss poppler-data libreoffice-l10n-de libreoffice-help-de hyphen-de mythes-de thunderbird-locale-de firefox-locale-de -y # install german language support
+	
+	MISSING_LANG_PKG="$(check-language-support -l de_DE)"
+	MISSING_LANG_PKG="$(check-language-support -l en_US) $MISSING_LANG_PKG" # check for missing packages for de_DE and en_US
+	
+	if [ -n "$MISSING_LANG_PKG" ]; then
+		aptitude install $MISSING_LANG_PKG -y
+	fi
+	
+	EXTRA_LANG_PKG="$(dpkg-query --show | cut -f1 | grep -E '^(language-pack|language-support|firefox-locale|thunderbird-locale|libreoffice-help|libreoffice-l10n)' | grep -Ev "[-](de|en)\>")" # remove extra language packages
+
+	if [ -n "$EXTRA_LANG_PKG" ]; then
+		aptitude purge $EXTRA_LANG_PKG -y
+	fi
+	
+	install_debs "$SCRIPT_DIR/debs/"
+}
+
+function finalize()
+{
+	echo -n "Europe/Berlin" > /etc/timezone
+	
+	rm -rf /var/crash/*
+}
+
+function install_kde_defaults()
+{
+	mkdir -p /etc/skel/.kde/share/config/
+	cp "$SCRIPT_DIR/kde_config/"* /etc/skel/.kde/share/config/
+}
+
+prepare_install
+install_packages
+
+install_kde_defaults
+#moved to initrd
+#cp "$SCRIPT_DIR/no-bootloader-icon/ubiquity-gtkui-no-bootloader.desktop" /usr/share/applications/
+
+#patch rootfs
+patch_all "$SCRIPT_DIR/rootfs-patches/" "/"
+
+#i.e. required for applying default-wallpaper patch
+#echo "compiling glib2 schemas..."
+#glib-compile-schemas /usr/share/glib-2.0/schemas
+
+finalize
diff --git a/legacy_scripts/customize_common b/legacy_scripts/customize_common
new file mode 100755
index 0000000..9e7bd58
--- /dev/null
+++ b/legacy_scripts/customize_common
@@ -0,0 +1,41 @@
+#!/bin/bash
+
+function patch_all()
+{
+	PATCH_DIR="$1"
+	TARGET_DIR="$2"
+
+	if [ ! -d "$PATCH_DIR" ]; then
+		echo "Nothing to patch here!"
+		return 0
+	fi
+	
+	if [ -z "$TARGET_DIR" ]; then
+		echo "No target directory given, assuming /"
+		TARGET_DIR="/"
+	fi
+
+        echo "Patching $TARGET_DIR ..."
+        for p in "$PATCH_DIR/"*
+        do
+                cat "$p" | patch -d "$TARGET_DIR" -p1
+        done
+        echo "done."
+}
+
+function install_debs()
+{
+        DEB_DIR="$1"
+
+        if [ ! -d "$DEB_DIR" ]; then
+                echo "Nothing to install here!"
+                return 0
+        fi
+
+        for p in "$DEB_DIR/"*
+        do
+		echo "installing $p..."
+                dpkg -i "$p"
+		echo "done."
+        done
+}
diff --git a/legacy_scripts/customize_initrd b/legacy_scripts/customize_initrd
new file mode 100755
index 0000000..aa9d92e
--- /dev/null
+++ b/legacy_scripts/customize_initrd
@@ -0,0 +1,73 @@
+#!/bin/bash
+
+###################################################################################
+# UCK - Ubuntu Customization Kit                                                  #
+# Copyright (C) 2006-2010 UCK Team                                                #
+#                                                                                 #
+# UCK is free software: you can redistribute it and/or modify                     #
+# it under the terms of the GNU General Public License as published by            #
+# the Free Software Foundation, either version 3 of the License, or               #
+# (at your option) any later version.                                             #
+#                                                                                 #
+# UCK is distributed in the hope that it will be useful,                          #
+# but WITHOUT ANY WARRANTY; without even the implied warranty of                  #
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the                   #
+# GNU General Public License for more details.                                    #
+#                                                                                 #
+# You should have received a copy of the GNU General Public License               #
+# along with UCK.  If not, see <http://www.gnu.org/licenses/>.                    #
+###################################################################################
+
+REMASTER_HOME=$1
+REMASTER_DIR="$REMASTER_HOME/remaster-root"
+INITRD_REMASTER_DIR="$REMASTER_HOME/remaster-initrd"
+
+echo "Using REMASTER_DIR=$REMASTER_DIR, INITRD_REMASTER_DIR=$INITRD_REMASTER_DIR"
+
+IRD="$INITRD_REMASTER_DIR"
+SCRIPT_DIR="`dirname $0`"
+
+if [ -e "$SCRIPT_DIR/customize_common" ]; then
+        source "$SCRIPT_DIR/customize_common"
+fi
+
+function install_nmtelekinese()
+{
+	mkdir -p "$IRD/lip/nm"
+	cp "$SCRIPT_DIR/nmtelekinese/nmtelekinese.desktop" "$IRD/lip/nm"
+	cp "$SCRIPT_DIR/nmtelekinese/nmtelekinese.py" "$IRD/lip/nm"
+	cp "$SCRIPT_DIR/nmtelekinese/26mopsmops" "$IRD/scripts/casper-bottom/"
+	chmod +x "$IRD/scripts/casper-bottom/26mopsmops"
+}
+
+function install_libnsa()
+{
+        mkdir -p "$IRD/lip/libnsa"
+        cp "$SCRIPT_DIR/libnsa/libnsa.desktop" "$IRD/lip/libnsa"
+        cp "$SCRIPT_DIR/libnsa/libnsa.sh" "$IRD/lip/libnsa"
+        cp "$SCRIPT_DIR/libnsa/26libnsa" "$IRD/scripts/casper-bottom/"
+        chmod +x "$IRD/lip/libnsa/libnsa.sh"
+        chmod +x "$IRD/scripts/casper-bottom/26libnsa"
+}
+
+function add_no_bootloader_icon()
+{
+	mkdir -p "$IRD/lip/no-bootloader-icon"
+	cp "$SCRIPT_DIR/no-bootloader-icon/ubiquity-kdeui.desktop" "$IRD/lip/no-bootloader-icon/"
+#	cp "$SCRIPT_DIR/no-bootloader-icon/ubiquity-kdeui-no-bootloader.desktop" "$IRD/lip/no-bootloader-icon/"
+
+	cp "$SCRIPT_DIR/no-bootloader-icon/25adduser" "$IRD/scripts/casper-bottom/"
+	chmod +x "$IRD/scripts/casper-bottom/25adduser"
+}
+
+mkdir -p "$IRD/lip"
+install_nmtelekinese
+#install_libnsa
+add_no_bootloader_icon
+
+#copy custom lip hook
+cp "$SCRIPT_DIR/initrd_hook/24liphook" "$IRD/scripts/casper-bottom/"
+chmod +x "$IRD/scripts/casper-bottom/24liphook"
+cp "$SCRIPT_DIR/initrd_hook/ORDER" "$IRD/scripts/casper-bottom/"
+
+patch_all "$SCRIPT_DIR/initrd-patches/" "$IRD"
diff --git a/legacy_scripts/customize_iso b/legacy_scripts/customize_iso
new file mode 100755
index 0000000..4565c03
--- /dev/null
+++ b/legacy_scripts/customize_iso
@@ -0,0 +1,37 @@
+#!/bin/bash
+SCRIPT_DIR=`dirname "$0"`
+REMASTER_HOME=${1:-~/tmp}
+ISO_REMASTER_DIR="$REMASTER_HOME/remaster-iso"
+REMASTER_DIR="$REMASTER_HOME/remaster-root"
+ISO_DESCRIPTION_PREFIX_FILE="$SCRIPT_DIR/iso_description_prefix"
+
+if [ -e "$SCRIPT_DIR/customize_common" ]; then
+        source "$SCRIPT_DIR/customize_common"
+fi
+
+function create_md5sums()
+{
+	pushd "$REMASTER_DIR"
+	find . -type f -print0 | sort -z | xargs -0 md5sum > "$REMASTER_HOME/rootfs.md5"
+	popd
+}
+
+function write_iso_description()
+{
+	ISO_ARCH="32Bit"
+	if [ "$(uname -m)" == "x86_64" ]; then 
+		ISO_ARCH="64Bit"
+	fi
+
+	ISO_PREFIX="LIP ISO"
+	if [ -e "$ISO_DESCRIPTION_PREFIX_FILE" ]; then
+		ISO_PREFIX="$(cat $ISO_DESCRIPTION_PREFIX_FILE)"
+	fi
+
+	echo "$ISO_PREFIX $ISO_ARCH" > "$SCRIPT_DIR/iso_description"
+}
+
+#create_md5sums
+
+write_iso_description
+patch_all "$SCRIPT_DIR/iso-patches/" "$ISO_REMASTER_DIR/"
-- 
GitLab