summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSebastian Schmelzer2009-01-27 02:14:34 +0100
committerSebastian Schmelzer2009-01-27 02:14:34 +0100
commitba6255dc003bc9d6375202c83d4f375c72863cbc (patch)
treede61eef6661e817d7584d523a6a366326dce8972
parentFirst design studies on new PreBoot environment: mconf examples and (diff)
downloadcore-ba6255dc003bc9d6375202c83d4f375c72863cbc.tar.gz
core-ba6255dc003bc9d6375202c83d4f375c72863cbc.tar.xz
core-ba6255dc003bc9d6375202c83d4f375c72863cbc.zip
* fix debian buildpackage stuff .. :)
git-svn-id: http://svn.openslx.org/svn/openslx/openslx/trunk@2528 95ad53e4-c205-0410-b2fa-d234c58c8868
-rw-r--r--Makefile17
-rwxr-xr-xpackaging/dpkg/builddebianpackage17
-rw-r--r--packaging/dpkg/default_files/control11
-rwxr-xr-xpackaging/dpkg/default_files/deinstall.sh7
-rwxr-xr-xpackaging/dpkg/default_files/install.sh14
-rw-r--r--packaging/dpkg/default_files/ld4-inst.141
-rw-r--r--packaging/dpkg/default_files/mkdxsinitrd.181
-rwxr-xr-xpackaging/dpkg/default_files/postinst41
-rwxr-xr-xpackaging/dpkg/default_files/postrm6
-rwxr-xr-xpackaging/dpkg/default_files/preinst35
10 files changed, 108 insertions, 162 deletions
diff --git a/Makefile b/Makefile
index 0f437922..3f8abd39 100644
--- a/Makefile
+++ b/Makefile
@@ -83,8 +83,8 @@ $(USR_BIN_PATH)/*" \
release-tarball:
@export OPENSLX_SVN_SNAPSHOT=0; \
make tarball
-
-install: check-upgrade
+
+dep-check:
@if test "${TRACE_INSTALLATION}" = "1"; then set -x; fi; \
echo "Checking installation requirements..."; \
echo $$(date) >${SLX_INSTALL_LOG}; \
@@ -132,7 +132,11 @@ supported."; \
if ! which rsync >/dev/null 2>&1; then \
echo " rsync is required, please install it."; \
exit 1; \
- fi; \
+ fi;
+
+
+plain-install:
+ @if test "${TRACE_INSTALLATION}" = "1"; then set -x; fi; \
echo "Installing OpenSLX project files"; \
mkdir -p $(SLX_BUILD_PATH)$(SLX_CONFIG_PATH)/boot-env/pxe/themes \
-p $(SLX_BUILD_PATH)$(SLX_BASE_PATH)/lib \
@@ -197,8 +201,11 @@ supported."; \
$(SLX_BUILD_PATH)$(SLX_CONFIG_PATH)/boot-env/pxe/; \
cp -p tools/mksquashfs $(SLX_BUILD_PATH)$(SLX_BASE_PATH)/share/squashfs/; \
tar --exclude=.svn -cp -C initramfs tpm | \
- tar -xp -C $(SLX_BUILD_PATH)$(SLX_BASE_PATH)/share; \
+ tar -xp -C $(SLX_BUILD_PATH)$(SLX_BASE_PATH)/share;
+
+
+postinstall:
@ # create default config folder hierarchy:
@perl -Ilib -e 'use OpenSLX::ConfigFolder; createConfigFolderForDefaultSystem();'
@@ -240,6 +247,8 @@ supported."; \
rm DEFAULT-DB-TYPE; \
echo -n ' '; slxsettings set db-type="$${DEFAULT_DB_TYPE}";
+install: check-upgrade dep-check plain-install postinstall
+
vmware_install:
@# we should read the config file here or better have a separate
@# script for installing vmware related stuff
diff --git a/packaging/dpkg/builddebianpackage b/packaging/dpkg/builddebianpackage
index 5f8bafbd..74b0a294 100755
--- a/packaging/dpkg/builddebianpackage
+++ b/packaging/dpkg/builddebianpackage
@@ -20,22 +20,25 @@ fi
export SLX_BUILD_PATH=/tmp/slx$$
mkdir -p $SLX_BUILD_PATH
# "make install" will install the slx software into $SLX_BUILD_PATH
-if make install; then
+if make plain-install; then
#Create Temporary working directory
mkdir -p $SLX_BUILD_PATH/DEBIAN
- mkdir -p $SLX_BUILD_PATH/usr/share/man/man1
cp packaging/dpkg/default_files/control $SLX_BUILD_PATH/DEBIAN/
- cp packaging/dpkg/default_files/prerm $SLX_BUILD_PATH/DEBIAN/
- cp packaging/dpkg/default_files/postinst $SLX_BUILD_PATH/DEBIAN/
- cp packaging/dpkg/default_files/*.1 $SLX_BUILD_PATH/usr/share/man/man1/
- gzip -9 $SLX_BUILD_PATH/usr/share/man/man1/*
+ cp packaging/dpkg/default_files/pre* $SLX_BUILD_PATH/DEBIAN/
+ cp packaging/dpkg/default_files/post* $SLX_BUILD_PATH/DEBIAN/
+
+ . ./VERSIONS
+
+ #update control file
+ sed -i -e "s/##version##/$OPENSLX_VERSION_STRING/" \
+ -e "s/##size##/$(du -s $SLX_BUILD_PATH | awk '{print $1}')/" \
+ $SLX_BUILD_PATH/DEBIAN/control
#Set permissions
find $SLX_BUILD_PATH -type d|xargs chmod 755
#Create the package
dpkg-deb --build $SLX_BUILD_PATH > /dev/null
- . ./VERSIONS
cd packaging/dpkg
mv $SLX_BUILD_PATH.deb openslx_$OPENSLX_VERSION_STRING.deb
echo "Written 'openslx_$OPENSLX_VERSION_STRING.deb':"
diff --git a/packaging/dpkg/default_files/control b/packaging/dpkg/default_files/control
index f4a8cec6..e0b7372c 100644
--- a/packaging/dpkg/default_files/control
+++ b/packaging/dpkg/default_files/control
@@ -1,11 +1,14 @@
Package: openslx
-Version: 4-1
-Section: base
+Version: ##version##
+Section: admin
Priority: optional
Architecture: all
Depends: bash (>= 3.0), coreutils (>= 5.2.1), sed (>= 4.1.4), mawk (>= 1.3.3),
- findutils (>= 4.2.22), perl (>= 5.8)
-Maintainer: Felix Endres <felix-ld4@256bit.org>
+ findutils (>= 4.2.22)
+Pre-Depends: perl (>= 5.8)
+Installed-Size: ##size##
+Homepage: http://openslx.org
+Maintainer: Sebastian Schmelzer <sebastian.schmelzer@rz.uni-freiburg.de>
Description: Stateles Linux Extensions Server Setup
This project provides a convenient way to setup a server for stateless
(possibly diskless) clients.
diff --git a/packaging/dpkg/default_files/deinstall.sh b/packaging/dpkg/default_files/deinstall.sh
deleted file mode 100755
index 6de275ac..00000000
--- a/packaging/dpkg/default_files/deinstall.sh
+++ /dev/null
@@ -1,7 +0,0 @@
-#!/bin/sh
-# Deinstall dxs
-rm -vrf /usr/share/dxs
-rm -vf /usr/sbin/mkdxsinitrd
-rm -vf /usr/sbin/ld4-inst
-rm -vf /usr/share/man/man1/mkdxsinitrd.1.gz
-echo "Done."
diff --git a/packaging/dpkg/default_files/install.sh b/packaging/dpkg/default_files/install.sh
deleted file mode 100755
index cb090fa7..00000000
--- a/packaging/dpkg/default_files/install.sh
+++ /dev/null
@@ -1,14 +0,0 @@
-#!/bin/sh
-if [ "$EUID" -ne 0 ]; then
- echo "You need to start this installer as user root"
- exit
-fi
-
-cp -Rv dxs /usr/share/
-cp -v man/* /usr/share/man/man1/
-#Create links to provide the scripts to the user
-pushd /usr/sbin > /dev/null
-ln -vs ../share/dxs/installer/ld4-inst
-ln -vs ../share/dxs/initrd/mkdxsinitrd
-popd > /dev/null
-echo "Done."
diff --git a/packaging/dpkg/default_files/ld4-inst.1 b/packaging/dpkg/default_files/ld4-inst.1
deleted file mode 100644
index 9b32b744..00000000
--- a/packaging/dpkg/default_files/ld4-inst.1
+++ /dev/null
@@ -1,41 +0,0 @@
-.\" Man page for ld4-inst
-.\"
-.\" Copyright (C), 2006, Felix Endres
-.\"
-.\" You may distribute under the terms of the GNU General Public
-.\" License as specified in the file COPYING that comes with the man
-.\" distribution.
-.\"
-.\"
-.TH ld4-inst 1 "2006-05-05" "4.0.1" ""
-.LO 1
-.SH NAME
-ld4-inst \- Setup of the bootserver for a diskless client network environment
-.SH SYNTAX
-.B ld4-inst
-
-.SH DESCRIPTION
-ld
-.B ld4-inst
-guides the user through the setup of a server providing the operating system
-template to (diskless) clients booting via PXE.
-
-The steps taken are as follows:
-
-- Ask user about system specifics and desired results
-
-- Create the OS template by rsyncing from an installed instance
-
-- Create the initial ramdisk vor boottime configuration of the clients
-
-- If desired: Configure necessary servers (i.e tftp, nfs)
-
-.SH SEE ALSO
-.BR ld4-inst "(1).
-.SH BUGS
-The project is under heavy development, thus bugs are likely to appear.
-
-Your Feedback is appreciated.
-.SH AUTHOR
-dxs project manager is Dirk von Suchodoletz (dirk.von.suchodoletz@rz.uni-freiburg.de)
-This manpage was written by Felix Endres (felix-dxs@256bit.org)
diff --git a/packaging/dpkg/default_files/mkdxsinitrd.1 b/packaging/dpkg/default_files/mkdxsinitrd.1
deleted file mode 100644
index 4820aef7..00000000
--- a/packaging/dpkg/default_files/mkdxsinitrd.1
+++ /dev/null
@@ -1,81 +0,0 @@
-.\" Man page for mkdxsinitrd
-.\"
-.\" Copyright (C), 2006, Felix Endres
-.\"
-.\" You may distribute under the terms of the GNU General Public
-.\" License as specified in the file COPYING that comes with the man
-.\" distribution.
-.\"
-.\"
-.TH mkdxsinitrd 1 "2006-05-05" "4.0.1" ""
-.LO 1
-.SH NAME
-mkdxsinitrd \- erstellt eine initial ramdisk fuer diskless clients
-.SH SYNTAX
-.B mkdxsinitrd
-.RB [\| \-gh \|]
-.RB [\| \-k
-.IR Kernelversion\|]
-.RB [\| \-i
-.IR Pfad \|]
-.RB [\| \-f
-.IR Module \|]
-.RB [\| \-n
-.IR Module\|]
-.RB [\| \-r
-.IR Pfad \|]
-.RB [\| \-s
-.IR Bildgroesse \|]
-
-.SH BESCHREIBUNG
-Damit Clients ein Betriebssystem nutzen koennen dass ueber ein
-Netzwerk bereitgestellt wird, brauchen diese eine initial ramdisk,
-in der Vorkonfigurationsschritte stattfinden. Diese sind noetig,
-damit das Betriebssystem eine Umgebung vorfindet in der es seine
-gewohnte Initialisierung betreiben kann.
-.B mkdxsinitrd
-erstellt eine solche ramdisk, die von PXE-faehigen zum Booten benutzt
-werden kann.
-
-
-.SH OPTIONEN
-.TP
-.B \-g
-Benutze glibc als Basisbibliothek in der ramdisk.
-.TP
-.B \-h
-Zeige Informationen zur Benutzung.
-.TP
-.BI \-k\ Kernelversion
-.B mkdxsinitrd
-versucht die aktuellste Kernelversion zu finden. Falls dies nicht klappt,
-oder eine andere Kernelversion gewuenscht ist kann diese hier angegeben werden
-(funktioniert natuerlich nur fuer auf dem Hostsystem vorhandene Kernelversionen).
-.TP
-.BI \-i\ Pfad
-Optionale Angabe wo die erstellte ramdisk hingeschrieben werden soll.
-.TP
-.BI \-f\ Modulliste
-Kernelmodule die benutzt werden sollen um das Rootfilesystem ueber das dem Netzwerk zu mounten (z.B. nfs, nbd dnbd).
-.TP
-.BI \-n\ Modulliste
-Kernelmodule zum Betrieb der Clientnetzwerkkarten (z.B. e100 tg3 via-rhine).
-.TP
-.BI \-r\ Pfad
-Pfad zum Wurzelverzeichnis des zu exportierenden Betriebsystems (z.B. /nfsroot).
-.TP
-.BI \-s\ Bildgroesse
-Groessenangabe des splash images.
-.TP
-.BI \-d\ Name
-Name der Distribution der Betriebsystemvorlage
-.TP
-.BI \-v\ Version
-Versionskennung der Distribution der Betriebsystemvorlage
-
-.SH SIEHE AUCH
-.BR ld4-inst "(1).
-.SH FEHLER
-Sicherlich allerhand. Feedback ist sehr willkommen.
-.SH AUTOR
-Felix Endres (felix-dxs@256bit.org)
diff --git a/packaging/dpkg/default_files/postinst b/packaging/dpkg/default_files/postinst
index daa52770..d90f2524 100755
--- a/packaging/dpkg/default_files/postinst
+++ b/packaging/dpkg/default_files/postinst
@@ -2,8 +2,41 @@
set -e
#
if [ "$1" = "configure" ]; then
- if [ -d /usr/doc -a ! -e /usr/doc/dxs -a -d /usr/share/doc/dxs ]; then
- ln -sf ../share/doc/dxs /usr/doc/dxs
- fi
+ # specific database modules are optional, but we tell the user if
+ # support for a database is missing:
+ DEFAULT_DB_TYPE="";
+ if test -e ${SLX_CONFIG_PATH}/settings; then
+ echo "Reading local settings...";
+ . ${SLX_CONFIG_PATH}/settings;
+ fi;
+ for m in ${SLX_DB_TYPE} SQLite mysql; do
+ perl -I/opt/openslx/lib -Ilib -Iconfig-db -e "use OpenSLX::MetaDB::$m";
+ if [ $? -gt 0 ] ; then
+ echo -e " 'DBD::$m' not found (or too old), so $m-databases will not be \
+supported.";
+ else
+ if test "${DEFAULT_DB_TYPE}X" = "X"; then
+ DEFAULT_DB_TYPE=$m;
+ echo " db-type => $m";
+ fi;
+ fi;
+ done;
+ if test "${DEFAULT_DB_TYPE}X" = "X"; then
+ echo " None of the DB-modules is available! Please install one of them.";
+ echo " For SQLite usage:";
+ echo " # aptitude install libdbd-sqlite3-perl";
+ echo " For MySQL usage:";
+ echo " # aptitude install libdbd-mysql-perl";
+ echo " or use CPAN to install the requred perl bindings"
+ else
+ echo ${DEFAULT_DB_TYPE} >/opt/openslx/DEFAULT-DB-TYPE;
+ fi;
+ if ! which rsync >/dev/null 2>&1; then
+ echo " rsync is required, please install it.";
+ echo " # aptitude install rsync";
+ fi;
+
+
+ #
fi
-#
+exit 0;
diff --git a/packaging/dpkg/default_files/postrm b/packaging/dpkg/default_files/postrm
new file mode 100755
index 00000000..ca42ec0c
--- /dev/null
+++ b/packaging/dpkg/default_files/postrm
@@ -0,0 +1,6 @@
+#!/bin/sh
+
+if [ "$1" = "purge" ] ; then
+ rm -rf /etc/opt/openslx >/dev/null || exit $?
+ # add if empty /etc/opt/ remove it as well ..
+fi
diff --git a/packaging/dpkg/default_files/preinst b/packaging/dpkg/default_files/preinst
new file mode 100755
index 00000000..f31c6596
--- /dev/null
+++ b/packaging/dpkg/default_files/preinst
@@ -0,0 +1,35 @@
+#!/bin/sh
+
+if [ "$1" = "install" ]; then
+ MISSING=0
+ MISSING_MODULES=""
+
+ echo ""
+ echo " Preparing installation of OpenSLX! \n"
+ echo " Checking for required perl Modules:"
+ for m in Carp Clone Config::General Cwd DBI Digest::MD5 Encode Fcntl \
+ File::Basename File::Find File::Glob File::Path FindBin \
+ Getopt::Long List::Util Pod::Usage POSIX Socket Storable \
+ Sys::Hostname Term::ReadLine ; do
+
+ echo -n " * $m .. "
+ if ! perl -e "use $m" 2>>/dev/null ; then
+ echo "not found";
+ $MISSING=1;
+ $MISSING_MODULES="$MISSING_MODULES $m";
+ else
+ echo "found"
+ fi;
+ done;
+
+ if [ $MISSING -gt 0 ]; then
+ echo " Some perl Modules couldn't be found:";
+ echo " $MISSING_MODULES";
+ echo " Install them with cpan / aptitude and try again .. \n";
+ exit 1;
+ else
+ echo " All checks successfull. Continue with installation."
+ exit 0;
+ fi;
+fi;
+