summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDirk von Suchodoletz2009-01-13 20:31:08 +0100
committerDirk von Suchodoletz2009-01-13 20:31:08 +0100
commitaa6626925eff26751e156bf392256298dad07a34 (patch)
tree099f88ce68a4e3bef1cab26385d2d51e6c6c6709
parent * test commit (diff)
downloadcore-aa6626925eff26751e156bf392256298dad07a34.tar.gz
core-aa6626925eff26751e156bf392256298dad07a34.tar.xz
core-aa6626925eff26751e156bf392256298dad07a34.zip
Adding a new plugin "wlanboot". Just first checkin - untested ...
git-svn-id: http://svn.openslx.org/svn/openslx/openslx/trunk@2474 95ad53e4-c205-0410-b2fa-d234c58c8868
-rw-r--r--os-plugins/plugins/wlanboot/OpenSLX/OSPlugin/wlanboot.pm118
-rw-r--r--os-plugins/plugins/wlanboot/XX_wlanboot.sh23
-rwxr-xr-xos-plugins/plugins/wlanboot/files/bin/iwconfigbin0 -> 17640 bytes
-rwxr-xr-xos-plugins/plugins/wlanboot/files/bin/iweventbin0 -> 13540 bytes
-rwxr-xr-xos-plugins/plugins/wlanboot/files/bin/iwgetidbin0 -> 9344 bytes
-rwxr-xr-xos-plugins/plugins/wlanboot/files/bin/iwlistbin0 -> 25884 bytes
-rwxr-xr-xos-plugins/plugins/wlanboot/files/bin/iwprivbin0 -> 9384 bytes
-rwxr-xr-xos-plugins/plugins/wlanboot/files/bin/iwspybin0 -> 9372 bytes
-rw-r--r--os-plugins/plugins/wlanboot/files/bin/iwtest1
-rw-r--r--os-plugins/plugins/wlanboot/files/firmware/README8
-rwxr-xr-xos-plugins/plugins/wlanboot/init-hooks/10-nw-if-config/wlanboot.sh36
-rw-r--r--os-plugins/plugins/x11vnc/XX_x11vnc.sh4
12 files changed, 188 insertions, 2 deletions
diff --git a/os-plugins/plugins/wlanboot/OpenSLX/OSPlugin/wlanboot.pm b/os-plugins/plugins/wlanboot/OpenSLX/OSPlugin/wlanboot.pm
new file mode 100644
index 00000000..441254b3
--- /dev/null
+++ b/os-plugins/plugins/wlanboot/OpenSLX/OSPlugin/wlanboot.pm
@@ -0,0 +1,118 @@
+# Copyright (c) 2009 - OpenSLX GmbH
+#
+# This program is free software distributed under the GPL version 2.
+# See http://openslx.org/COPYING
+#
+# If you have any feedback please consult http://openslx.org/feedback and
+# send your suggestions, praise, or complaints to feedback@openslx.org
+#
+# General information about OpenSLX can be found at http://openslx.org/
+# -----------------------------------------------------------------------------
+# wlanboot.pm
+# - an wlanboot extension to the stage3 system
+# -----------------------------------------------------------------------------
+package OpenSLX::OSPlugin::wlanboot;
+
+use strict;
+use warnings;
+
+use base qw(OpenSLX::OSPlugin::Base);
+
+use OpenSLX::Basics;
+use OpenSLX::Utils;
+
+################################################################################
+# if you have any questions regarding the concept of OS-plugins and their
+# implementation, please drop a mail to: ot@openslx.com, or join the IRC-channel
+# '#openslx' (on freenode).
+################################################################################
+sub new
+{
+ my $class = shift;
+
+ my $self = {
+ name => 'wlanboot',
+ };
+
+ return bless $self, $class;
+}
+
+sub getInfo
+{
+ my $self = shift;
+
+ return {
+ description => unshiftHereDoc(<<' End-of-Here'),
+ wlanboot is an extension for stage 3
+ End-of-Here
+ precedence => 50,
+ };
+}
+
+sub getAttrInfo
+{ # returns a hash-ref with information about all attributes supported
+ # by this specific plugin
+ my $self = shift;
+
+ # This default configuration will be added as attributes to the default
+ # system, such that it can be overruled for any specific system by means
+ # of slxconfig.
+ return {
+ # attribute 'active' is mandatory for all plugins
+ 'wlanboot::active' => {
+ applies_to_systems => 1,
+ applies_to_clients => 0,
+ description => unshiftHereDoc(<<' End-of-Here'),
+ should the 'wlanboot'-plugin be executed during boot?
+ End-of-Here
+ content_regex => qr{^(0|1)$},
+ content_descr => '1 means active - 0 means inactive',
+ default => '1',
+ },
+ };
+}
+
+sub installationPhase
+{
+ my $self = shift;
+ my $info = shift;
+
+ my $pluginRepoPath = $info->{'plugin-repo-path'};
+ my $pluginTempPath = $info->{'plugin-temp-path'};
+ my $openslxBasePath = $info->{'openslx-base-path'};
+ my $openslxConfigPath = $info->{'openslx-config-path'};
+ my $attrs = $info->{'plugin-attrs'};
+
+ my $filesDir = "$openslxBasePath/lib/plugins/wlanboot/files";
+
+ return;
+}
+
+sub removalPhase
+{
+ my $self = shift;
+ my $info = shift;
+
+ my $pluginRepoPath = $info->{'plugin-repo-path'};
+ my $pluginTempPath = $info->{'plugin-temp-path'};
+
+ return;
+}
+
+sub copyRequiredFilesIntoInitramfs
+{
+ my $self = shift;
+ my $targetPath = shift;
+ my $attrs = shift;
+ my $makeInitRamFSEngine = shift;
+ my $pluginRepoPath = $info->{'plugin-repo-path'};
+
+ $makeInitRamFSEngine->addCMD(
+ "cp -p $pluginRepoPath/files/bin/* $targetPath/bin/"
+ );
+ $makeInitRamFSEngine->addCMD(
+ "cp -a $pluginRepoPath/files/firmware $targetPath/lib"
+ );
+}
+
+1;
diff --git a/os-plugins/plugins/wlanboot/XX_wlanboot.sh b/os-plugins/plugins/wlanboot/XX_wlanboot.sh
new file mode 100644
index 00000000..d8ede9c7
--- /dev/null
+++ b/os-plugins/plugins/wlanboot/XX_wlanboot.sh
@@ -0,0 +1,23 @@
+# Copyright (c) 2009 - OpenSLX GmbH
+#
+# This program/file is free software distributed under the GPL version 2.
+# See http://openslx.org/COPYING
+#
+# If you have any feedback please consult http://openslx.org/feedback and
+# send your feedback to feedback@openslx.org
+#
+# General information about OpenSLX can be found at http://openslx.org
+#
+# stage3 part of 'wlanboot' plugin - the runlevel script
+#
+# script is included from init via the "." load function - thus it has all
+# variables and functions available
+
+if [ -e /initramfs/plugin-conf/wlanboot.conf ]; then
+ . /initramfs/plugin-conf/wlanboot.conf
+ if [ $wlanboot_active -ne 0 ]; then
+ [ $DEBUGLEVEL -gt 0 ] && echo "executing the 'wlanboot' os-plugin ...";
+ [ $DEBUGLEVEL -gt 0 ] && echo "done with 'wlanboot' os-plugin ...";
+
+ fi
+fi
diff --git a/os-plugins/plugins/wlanboot/files/bin/iwconfig b/os-plugins/plugins/wlanboot/files/bin/iwconfig
new file mode 100755
index 00000000..ebe4b5af
--- /dev/null
+++ b/os-plugins/plugins/wlanboot/files/bin/iwconfig
Binary files differ
diff --git a/os-plugins/plugins/wlanboot/files/bin/iwevent b/os-plugins/plugins/wlanboot/files/bin/iwevent
new file mode 100755
index 00000000..20b6293a
--- /dev/null
+++ b/os-plugins/plugins/wlanboot/files/bin/iwevent
Binary files differ
diff --git a/os-plugins/plugins/wlanboot/files/bin/iwgetid b/os-plugins/plugins/wlanboot/files/bin/iwgetid
new file mode 100755
index 00000000..6a51e3f9
--- /dev/null
+++ b/os-plugins/plugins/wlanboot/files/bin/iwgetid
Binary files differ
diff --git a/os-plugins/plugins/wlanboot/files/bin/iwlist b/os-plugins/plugins/wlanboot/files/bin/iwlist
new file mode 100755
index 00000000..de811e46
--- /dev/null
+++ b/os-plugins/plugins/wlanboot/files/bin/iwlist
Binary files differ
diff --git a/os-plugins/plugins/wlanboot/files/bin/iwpriv b/os-plugins/plugins/wlanboot/files/bin/iwpriv
new file mode 100755
index 00000000..73f711db
--- /dev/null
+++ b/os-plugins/plugins/wlanboot/files/bin/iwpriv
Binary files differ
diff --git a/os-plugins/plugins/wlanboot/files/bin/iwspy b/os-plugins/plugins/wlanboot/files/bin/iwspy
new file mode 100755
index 00000000..48ff6db1
--- /dev/null
+++ b/os-plugins/plugins/wlanboot/files/bin/iwspy
Binary files differ
diff --git a/os-plugins/plugins/wlanboot/files/bin/iwtest b/os-plugins/plugins/wlanboot/files/bin/iwtest
new file mode 100644
index 00000000..c6846702
--- /dev/null
+++ b/os-plugins/plugins/wlanboot/files/bin/iwtest
@@ -0,0 +1 @@
+test file for plugin wlanboot.
diff --git a/os-plugins/plugins/wlanboot/files/firmware/README b/os-plugins/plugins/wlanboot/files/firmware/README
new file mode 100644
index 00000000..0845746d
--- /dev/null
+++ b/os-plugins/plugins/wlanboot/files/firmware/README
@@ -0,0 +1,8 @@
+Put all the required firmwares of WLAN adapters you would like to use in
+your setup here into this subdirectory. They are copied into the InitRamFS
+to be present for device configuration via modprobe/mdev in stage3.
+
+For more information on the "wlanboot" plugin have a look at the project
+page!
+
+The OpenSLX Team
diff --git a/os-plugins/plugins/wlanboot/init-hooks/10-nw-if-config/wlanboot.sh b/os-plugins/plugins/wlanboot/init-hooks/10-nw-if-config/wlanboot.sh
new file mode 100755
index 00000000..169e567d
--- /dev/null
+++ b/os-plugins/plugins/wlanboot/init-hooks/10-nw-if-config/wlanboot.sh
@@ -0,0 +1,36 @@
+# Copyright (c) 2009 - OpenSLX GmbH
+#
+# This program/file is free software distributed under the GPL version 2.
+# See http://openslx.org/COPYING
+#
+# If you have any feedback please consult http://openslx.org/feedback and
+# send your feedback to feedback@openslx.org
+#
+# General information about OpenSLX can be found at http://openslx.org
+#
+# stage3 init-hook 10 of 'wlanboot' plugin - firing up the wlan connection
+
+if [ $wlanboot_active -ne 0 ]; then
+ # get essid for WLAN boot
+ for source in /proc/cmdline /etc/initramfs-setup ; do
+ essid=$(grep essid $source)
+ if [ -n "$essid" ] ; then
+ essid=${essid#essid=}
+ break
+ fi
+ done
+ # do WLAN specific settings, definition of wlan interface name and wireless
+ # connect
+ wlanif=$(iwconfig 2>/dev/null|sed -n "/ESSID:/p"|sed "s/ .*//")
+ if [ -n "$if" ] ; then
+ ip link set dev ${wlanif} up
+ if iwconfig ${wlanif} mode managed essid "${essid}"; then
+ nwif=${wlanif}
+ else
+ error " Unable to configure the WLAN interface."
+ fi
+ else
+ error " No wireless LAN capable interface found. Did you provide the \
+proper kernel\n modules and firmware?"
+fi
+
diff --git a/os-plugins/plugins/x11vnc/XX_x11vnc.sh b/os-plugins/plugins/x11vnc/XX_x11vnc.sh
index 0f076914..3970e468 100644
--- a/os-plugins/plugins/x11vnc/XX_x11vnc.sh
+++ b/os-plugins/plugins/x11vnc/XX_x11vnc.sh
@@ -1,5 +1,5 @@
-# Copyright (c) 2007..2008 - RZ Uni Freiburg
-# Copyright (c) 2008 - OpenSLX GmbH
+# Copyright (c) 2007..2009 - RZ Uni Freiburg
+# Copyright (c) 2009 - OpenSLX GmbH
#
# This program/file is free software distributed under the GPL version 2.
# See http://openslx.org/COPYING