summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDirk von Suchodoletz2008-02-29 22:50:06 +0100
committerDirk von Suchodoletz2008-02-29 22:50:06 +0100
commit7d4d42c6f5d6834174fccf356e35d43b5bd89338 (patch)
tree479f95e284279067561daa00cf763e0cb440bd5b
parentCleanups and fixes, see #191 ... (diff)
downloadcore-7d4d42c6f5d6834174fccf356e35d43b5bd89338.tar.gz
core-7d4d42c6f5d6834174fccf356e35d43b5bd89338.tar.xz
core-7d4d42c6f5d6834174fccf356e35d43b5bd89338.zip
Trying on another export type -> dnbd2 ...
git-svn-id: http://svn.openslx.org/svn/openslx/trunk@1585 95ad53e4-c205-0410-b2fa-d234c58c8868
-rwxr-xr-xinitramfs/cdboot/mkcdboot4
-rwxr-xr-xinitramfs/initrd-stuff/init5
-rw-r--r--installer/OpenSLX/OSExport/BlockDevice/DNBD2.pm102
3 files changed, 107 insertions, 4 deletions
diff --git a/initramfs/cdboot/mkcdboot b/initramfs/cdboot/mkcdboot
index cefe7f09..4787f27a 100755
--- a/initramfs/cdboot/mkcdboot
+++ b/initramfs/cdboot/mkcdboot
@@ -7,8 +7,8 @@
#
# General information about OpenSLX can be found at http://openslx.org
#
-# Script for generating an InitRamFS for using a demo CD/DVD instead of
-# PXE/linux boot functionality
+# Script for generating an InitRamFS for using a demo CD/DVD (via kexec
+# mechanism) instead of PXE/linux boot functionality
BUILDDIR=/tmp/slxcdboot
SLX_SHARE_PATH=/opt/openslx/share
diff --git a/initramfs/initrd-stuff/init b/initramfs/initrd-stuff/init
index f47092cc..a6979800 100755
--- a/initramfs/initrd-stuff/init
+++ b/initramfs/initrd-stuff/init
@@ -441,7 +441,7 @@ if [ -n "${bldmod}" ] ; then
fi
done
usleep 100
- echo noop > /sys/block/nbd0/queue/scheduler
+ echo deadline > /sys/block/nbd0/queue/scheduler
# switch off unneeded block read ahead
echo "0" > /sys/block/nbd0/queue/read_ahead_kb
;;
@@ -450,7 +450,8 @@ if [ -n "${bldmod}" ] ; then
RDEV=/dev/vnbd0
waitfor "${RDEV}" 20000 || error "$init_nbddev"
# check for others in machine-setup and then kernel cmdline
- rootfs="$(sed -n "/rootfs=/p" /etc/machine-setup|sed "s,rootfs=,,;s,\",,g") "
+ rootfs="$(sed -n "/rootfs=/p" /etc/initramfs-setup| \
+ sed "s,rootfs=,,;s,\",,g") "
[ -z "$rootfs" ] && \
rootfs="$(cat /proc/cmdline|sed "s,.*rootfs=\",,;s,\".*,,") "
i=0
diff --git a/installer/OpenSLX/OSExport/BlockDevice/DNBD2.pm b/installer/OpenSLX/OSExport/BlockDevice/DNBD2.pm
new file mode 100644
index 00000000..69462e5c
--- /dev/null
+++ b/installer/OpenSLX/OSExport/BlockDevice/DNBD2.pm
@@ -0,0 +1,102 @@
+# Copyright (c) 2006, 2008 - 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/
+# -----------------------------------------------------------------------------
+# DNBD2.pm
+# - provides DNBD2+Squashfs-specific overrides of the
+# OpenSLX::OSExport::BlockDevice API.
+# -----------------------------------------------------------------------------
+package OpenSLX::OSExport::BlockDevice::DNBD2;
+
+use strict;
+use warnings;
+
+use base qw(OpenSLX::OSExport::BlockDevice::Base);
+
+use File::Basename;
+use OpenSLX::Basics;
+use OpenSLX::ConfigDB qw(:support);
+use OpenSLX::OSExport::BlockDevice::Base 1;
+use OpenSLX::Utils;
+
+################################################################################
+### interface methods
+################################################################################
+sub new
+{
+ my $class = shift;
+ my $self = {'name' => 'dnbd2',};
+ return bless $self, $class;
+}
+
+sub initialize
+{
+ my $self = shift;
+ my $engine = shift;
+ my $fs = shift;
+
+ $self->{'engine'} = $engine;
+ $self->{'fs'} = $fs;
+ return;
+}
+
+sub getExportPort
+{
+ my $self = shift;
+ my $openslxDB = shift;
+
+ return $openslxDB->incrementGlobalCounter('next-dnbd2-server-port');
+}
+
+sub generateExportURI
+{
+ my $self = shift;
+ my $export = shift;
+
+ my $serverIP = $export->{server_ip} || '';
+ my $server
+ = length($serverIP) ? $serverIP : generatePlaceholderFor('serverip');
+ $server .= ":$export->{port}" if length($export->{port});
+
+ return "dnbd2://$server";
+}
+
+sub requiredBlockDeviceModules
+{
+ my $self = shift;
+
+ return qw( dnbd2 );
+}
+
+sub requiredBlockDeviceTools
+{
+ my $self = shift;
+
+ return qw( );
+}
+
+sub showExportConfigInfo
+{
+ my $self = shift;
+ my $export = shift;
+
+ print(('#' x 80) . "\n");
+ print _tr(
+ "Please make sure you start a corresponding dnbd2-server:\n\t%s\n",
+ "Create or modify a config file like /etc/dnbd2/server.conf, looking like:",
+ "$server",
+ "$export->{port}",
+ "$self->{fs}->{'export-path'}
+ "dnbd2-server /etc/dnbd2/server.conf"
+ );
+ print(('#' x 80) . "\n");
+ return;
+}
+
+1;