summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorSebastian Schmelzer2010-09-06 18:30:07 +0200
committerSebastian Schmelzer2010-09-06 18:30:07 +0200
commitcbaa974ff10e070d6bbaf840b9ab46da0771f55a (patch)
treeaea110fc3042c6ae50a051fd2b186b290e194901 /tools
parentminor changes (diff)
downloadcore-cbaa974ff10e070d6bbaf840b9ab46da0771f55a.tar.gz
core-cbaa974ff10e070d6bbaf840b9ab46da0771f55a.tar.xz
core-cbaa974ff10e070d6bbaf840b9ab46da0771f55a.zip
creation of install tarballs successfull
Diffstat (limited to 'tools')
-rw-r--r--tools/inc/files.config2
-rw-r--r--tools/inc/files.core11
-rw-r--r--tools/inc/files.share9
-rwxr-xr-xtools/installer145
4 files changed, 159 insertions, 8 deletions
diff --git a/tools/inc/files.config b/tools/inc/files.config
new file mode 100644
index 00000000..f739624a
--- /dev/null
+++ b/tools/inc/files.config
@@ -0,0 +1,2 @@
+f boot-env/syslinux/pxemenu-*.example /boot-env/syslinux/
+f boot-env/syslinux/README.pxe /boot-env/syslinux/
diff --git a/tools/inc/files.core b/tools/inc/files.core
new file mode 100644
index 00000000..38961cee
--- /dev/null
+++ b/tools/inc/files.core
@@ -0,0 +1,11 @@
+f bin/slx* /bin/
+f config-db/slx* /bin/
+f installer/slx* /bin/
+f os-plugins/slx* /bin/
+f tools/uclibc-wrapper /bin/
+d lib/OpenSLX /lib/
+d boot-env/OpenSLX /lib/
+d config-db/OpenSLX /lib/
+d installer/OpenSLX /lib/
+d os-plugins/OpenSLX /lib/
+d os-plugins/plugins /lib/
diff --git a/tools/inc/files.share b/tools/inc/files.share
new file mode 100644
index 00000000..ede02d08
--- /dev/null
+++ b/tools/inc/files.share
@@ -0,0 +1,9 @@
+d initramfs/stage3-stuff /share/initramfs/
+d initramfs/tools /share/ramfstools/
+d initramfs/distro-specs /share/
+d initramfs/uclib-rootfs /share/
+d boot-env /share/
+d initramfs/tpm /share/
+f tools/mksquashfs /share/squashfs/mksquashfs_3_2
+f initramfs/eglibc-packages/mksquashfs/usr/bin/mksquashfs_3_3 /share/squashfs/
+f initramfs/eglibc-packages/mksquashfs/usr/bin/mksquashfs_4 /share/squashfs/
diff --git a/tools/installer b/tools/installer
index 30eda9f0..18401110 100755
--- a/tools/installer
+++ b/tools/installer
@@ -12,6 +12,7 @@ DISTRO=$(lsb_release -i| sed 's/^[^:]*:\t//' | tr '[:upper:]' '[:lower:]')
[ -z $SLX_TEMP_PATH ] && SLX_TEMP_PATH=/tmp
[ -z $SLX_INSTALL_LOG ] && SLX_INSTALL_LOG=install.log
+PREPARE_INSTALL_TARGET="./_install/"
# helper functions:
git_version()
@@ -21,9 +22,22 @@ git_version()
echo $GITVERSION$GITMODIFIED
}
-perl_dep_check()
+check_perl()
{
- echo -n " * checking perl dependencies"
+ echo -n " * checking perl"
+ if ! perl -e '$x=42' 2>>${SLX_INSTALL_LOG} ; then
+ echo -e " [${LightRed}failed${NC}]"
+ echo " Perl is required, please install it.";
+ exit 1;
+ else
+ echo -e " [${LightGreen}ok${NC}]"
+ fi;
+}
+
+
+check_perl_dep()
+{
+ echo -n " * checking perl module dependencies"
PERL_MODULES=$(cat tools/inc/perl.modules.base)
[ -e .perl_modules_missing ] && rm .perl_modules_missing
[ -e .perl_deps_guess ] && rm .perl_deps_guess
@@ -57,20 +71,135 @@ perl_dep_check()
exit 1
fi
else
- echo -e " [${LightGreen}done${NC}]"
+ echo -e " [${LightGreen}ok${NC}]"
fi
}
-make_source_tarball()
+check_perl_db()
+{
+ echo -n " * checking perl db abstraction"
+ DEFAULT_DB_TYPE="";
+ if test -e ${SLX_CONFIG_PATH}/settings; then
+ sed ${SLX_CONFIG_PATH}/settings -e "s,=,=\"," -e "s,$,\"," > /tmp/slxsettings;
+ . /tmp/slxsettings;
+ rm /tmp/slxsettings;
+ fi;
+
+ for m in ${SLX_DB_TYPE} SQLite mysql; do
+ if ! perl -Isrc/lib -Isrc/config-db -e "use OpenSLX::MetaDB::$m" 2>>${SLX_INSTALL_LOG} ; 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 -e " [${LightGreen}ok${NC}]"
+ echo " * selected db backend: $m";
+ break;
+ fi;
+ fi;
+ done;
+ if test "${DEFAULT_DB_TYPE}X" = "X"; then
+ echo -e " [${LightRed}failed${NC}]"
+ echo " None of the DB-modules is available! Please install one of them.";
+ exit 1;
+ else
+ echo $${DEFAULT_DB_TYPE} >DEFAULT-DB-TYPE;
+ fi;
+}
+
+check_helper_apps()
+{
+ echo -n " * checking for required linux tools"
+ if ! which rsync >/dev/null 2>&1; then
+ echo -e " [${LightRed}failed${NC}]"
+ echo " rsync is required, please install it.";
+ exit 1;
+ fi;
+ echo -e " [${LightGreen}ok${NC}]"
+}
+
+_install(){
+ FILE=$1
+ BASE_TARGET=$2
+ ADDOPTS=$3
+ [ "$BASE_TARGET" = "config" ] && BASE_TARGET_PATH=${PREPARE_INSTALL_TARGET}${SLX_CONFIG_PATH}
+ [ "$BASE_TARGET" = "base" ] && BASE_TARGET_PATH=${INSTALL_BASE}
+ while read TYPE SOURCE TARGET; do
+ if [ "$TYPE" = "f" ]; then
+ cp src/${SOURCE} ${BASE_TARGET_PATH}/${TARGET}
+ elif [ "$TYPE" = "d" ]; then
+ SOURCE_DIRNAME=$(echo $SOURCE | sed -e 's,^.*/,,' )
+ SOURCE_BASE=$(echo $SOURCE | sed -e 's,\(^.*/\).*,\1,')
+ [ "$SOURCE_DIRNAME" = "$SOURCE" ] && SOURCE_BASE=""
+ tar -cp $ADDOPTS -C src/${SOURCE_BASE} ${SOURCE_DIRNAME} \
+ | tar -xp -C ${BASE_TARGET_PATH}/$TARGET
+ fi
+ done < $FILE
+
+}
+
+prepare_install()
+{
+ echo -n " * prepare OpenSLX installation"
+ [ "${TRACE_INSTALLATION}" = "1" ] && set -x
+ INSTALL_BASE=${PREPARE_INSTALL_TARGET}${SLX_BASE_PATH}
+ [ -e $PREPARE_INSTALL_TARGET ] && rm -rf $PREPARE_INSTALL_TARGET
+ mkdir -p ${PREPARE_INSTALL_TARGET}
+ mkdir -p ${PREPARE_INSTALL_TARGET}${SLX_CONFIG_PATH}/boot-env/syslinux/themes \
+ -p ${INSTALL_BASE}/lib \
+ -p ${INSTALL_BASE}/bin \
+ -p ${INSTALL_BASE}/share/boot-env \
+ -p ${INSTALL_BASE}/share/initramfs \
+ -p ${INSTALL_BASE}/share/squashfs \
+ -p ${INSTALL_BASE}/share/templates \
+ -p ${INSTALL_BASE}/share/ramfstools \
+ -p ${PREPARE_INSTALL_TARGET}${USR_BIN_PATH};
+
+ # copy license
+ cp COPYING ${INSTALL_BASE}/
+
+ #### copy OpenSLX perl scripts & required modules ####
+ _install ./tools/inc/files.core base
+
+ #### copy OpenSLX shared data ####
+ opts="--exclude=OpenSLX --exclude=*.example --strip-components 1"
+ _install ./tools/inc/files.share base $opts
+
+ #### copy OpenSLX config data ####
+ opts="--exclude=OpenSLX"
+ _install ./tools/inc/files.config config $opts
+
+ echo -e " [${LightGreen}ok${NC}]"
+
+}
+
+make_install_tarball()
{
- echo -n " * create openslx tarball"
+ echo -n " * create OpenSLX install tarball"
VERSIONSTRING="openslx-$(git_version)"
rm -rf $VERSIONSTRING.tar $VERSIONSTRING.tar.*
+ cd $PREPARE_INSTALL_TARGET
+ tar cfj ../$VERSIONSTRING.tbz2 *
+ cd - 2>&1 >/dev/null
+ echo -e " [${LightGreen}ok${NC}]"
+}
+
+make_source_tarball()
+{
+ echo -n " * create OpenSLX source tarball"
+ VERSIONSTRING="openslx-$(git_version)-src"
+ rm -rf $VERSIONSTRING.tar $VERSIONSTRING.tar.*
git archive --format=tar --prefix=$VERSIONSTRING/ -o $VERSIONSTRING.tar HEAD
bzip2 $VERSIONSTRING.tar
- echo -e " [${LightGreen}done${NC}]"
+ echo -e " [${LightGreen}ok${NC}]"
}
-perl_dep_check
-make_source_tarball
+
+
+check_perl
+check_perl_dep
+check_perl_db
+check_helper_apps
+prepare_install
+make_install_tarball
+#make_source_tarballmake_install_tarball
git_version \ No newline at end of file