From 3eb541251dedf796307d33b195f2510d506626a7 Mon Sep 17 00:00:00 2001
From: Sebastian Schmelzer
Date: Fri, 22 May 2009 17:27:30 +0000
Subject: add apache config; minor path changes
git-svn-id: http://svn.openslx.org/svn/openslx/openslx/trunk@2865 95ad53e4-c205-0410-b2fa-d234c58c8868
---
boot-env/preboot/conf/apache-openslx-preboot.conf | 16 ++++++++++++++++
boot-env/preboot/http-server/user_settings.pl | 14 ++++++++++++--
boot-env/preboot/preboot.sh | 6 +++---
3 files changed, 31 insertions(+), 5 deletions(-)
create mode 100644 boot-env/preboot/conf/apache-openslx-preboot.conf
diff --git a/boot-env/preboot/conf/apache-openslx-preboot.conf b/boot-env/preboot/conf/apache-openslx-preboot.conf
new file mode 100644
index 00000000..ed7c5082
--- /dev/null
+++ b/boot-env/preboot/conf/apache-openslx-preboot.conf
@@ -0,0 +1,16 @@
+ ScriptAlias /openslx-preboot/cgi-bin/ "/opt/openslx/share/boot-env/preboot/http-server/"
+ Alias /openslx-preboot/ "/srv/openslx/preboot/"
+
+
+ Options -Indexes -ExecCGI FollowSymLinks MultiViews
+ AllowOverride None
+ Order allow,deny
+ allow from all
+
+
+
+ AllowOverride None
+ Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
+ Order allow,deny
+ Allow from all
+
\ No newline at end of file
diff --git a/boot-env/preboot/http-server/user_settings.pl b/boot-env/preboot/http-server/user_settings.pl
index 4f57d8b8..3469dce0 100755
--- a/boot-env/preboot/http-server/user_settings.pl
+++ b/boot-env/preboot/http-server/user_settings.pl
@@ -19,6 +19,15 @@ use CGI;
use CGI::Carp qw(fatalsToBrowser);
use File::Path;
+# add openslx stuff to @INC
+use FindBin;
+use lib "$FindBin::RealBin/../../../../lib";
+use lib "$FindBin::RealBin";
+
+# read default config
+use OpenSLX::Basics;
+openslxInit();
+
# die "*** Taint mode must be active! ***" unless ${^TAINT};
my $cgi = CGI->new;
@@ -30,8 +39,9 @@ my $prebootID = $cgi->param('preboot_id') || '';
die "must give 'system' ($system), 'client' ($client) and 'preboot_id' ($prebootID)!\n"
unless $system && $client && $prebootID;
-my $src = "/srv/openslx/preboot/client-config/$system/default.tgz";
-my $destPath = "/srv/www/openslx/preboot/$prebootID/client-config/$system";
+my $webPath = "$openslxConfig{'public-path'}/preboot";
+my $src = "$webPath/client-config/$system/$prebootID.tgz";
+my $destPath = "$webPath/$prebootID/client-config/$system";
mkpath($destPath);
system(qq{cp $src $destPath/$client.tgz});
diff --git a/boot-env/preboot/preboot.sh b/boot-env/preboot/preboot.sh
index 00e358ba..9ec9e90d 100755
--- a/boot-env/preboot/preboot.sh
+++ b/boot-env/preboot/preboot.sh
@@ -38,8 +38,8 @@ w3m -o confirm_qq=no \
chvt 1
# fetch kernel and initramfs of selected system
-wget -O /tmp/kernel $boot_uri/system/$kernel
-wget -O /tmp/initramfs $boot_uri/system/$initramfs
+wget -O /tmp/kernel $boot_uri/$kernel
+wget -O /tmp/initramfs $boot_uri/$initramfs
# read primary IP configuration to pass it on
. /tmp/ipstuff
@@ -47,5 +47,5 @@ wget -O /tmp/initramfs $boot_uri/system/$initramfs
# start the new kernel with initialramfs and composed cmdline
echo "Booting OpenSLX client $label ..."
kexec -l /tmp/kernel --initrd=/tmp/initramfs \
- --append="$append file=$boot_uri/preboot/${preboot_id}/client-config/${sysname}/${client}.tgz $quiet ip=$ip:$siaddr:$router:$subnet:$dnssrv debug=3"
+ --append="$append file=$boot_uri/${preboot_id}/client-config/${sysname}/${client}.tgz $quiet ip=$ip:$siaddr:$router:$subnet:$dnssrv debug=3"
kexec -e
--
cgit v1.2.3-55-g7522