Skip to contentSkip to conversation

AOE (ATA over Ethernet) boot support?

DISCUSSION Carl D. Roth 3 participants 5 messages Jan 26, 2011 – Feb 5, 2011

lore
Share & tools
lore
#0 lore raw

Is anyone working on this? I have some homebrewed dracut modules to accomplish this and didn't want to duplicate any effort.

Thanks!
C

#1 lore raw

Am 26.01.2011 18:59, schrieb Carl D. Roth:

Quoted 10 lines

Is anyone working on this? I have some homebrewed dracut modules to accomplish this and didn't want to duplicate any effort.

Thanks!
C

--
To unsubscribe from this list: send the line "unsubscribe initramfs" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html

Care to share it? Haven't heard of anyone doing it.

#2 lore raw
Quoted 9 lines · Harald Hoyer

Am 26.01.2011 18:59, schrieb Carl D. Roth:

Quoted 5 lines

Is anyone working on this? I have some homebrewed dracut modules to accomplish this and didn't want to duplicate any effort.

Thanks!
C

Care to share it? Haven't heard of anyone doing it.

Here's a first draft at AOE support in dracut. Sorry for the kludgy posting method, I'm not sure what the best way is to contribute files here.

http://dl.dropbox.com/u/18000815/dracut/95aoe/aoeroot
http://dl.dropbox.com/u/18000815/dracut/95aoe/check
http://dl.dropbox.com/u/18000815/dracut/95aoe/install
http://dl.dropbox.com/u/18000815/dracut/95aoe/installkernel
http://dl.dropbox.com/u/18000815/dracut/95aoe/parse-aoeroot.sh

C

#3 lore raw
Quoted 3 lines · Carl D. Roth

Here's a first draft at AOE support in dracut. Sorry for the kludgy posting method, I'm not sure what the best way is to contribute files here.

Inlined patches relative to HEAD are preferred.

#4 lore raw
Quoted 6 lines · David Dillow
Quoted 3 lines · Carl D. Roth

Here's a first draft at AOE support in dracut. Sorry for the kludgy posting method, I'm not sure what the best way is to contribute files here.

Inlined patches relative to HEAD are preferred.

OK here goes:

From 33bfa0a8741a9a7ff420a1a70121b135f3904a98 Mon Sep 17 00:00:00 2001
From: Carl D. Roth <[email protected]>
Date: Fri, 4 Feb 2011 16:10:54 -0800
Subject: [PATCH] Initial checkin of AOE support.

---
 modules.d/95aoe/aoeroot          |   79 +++++++++++++++++++++++++++++++++
+++++
 modules.d/95aoe/check            |   54 ++++++++++++++++++++++++++
 modules.d/95aoe/install          |    5 ++
 modules.d/95aoe/installkernel    |    2 +
 modules.d/95aoe/parse-aoeroot.sh |   66 +++++++++++++++++++++++++++++++
 5 files changed, 206 insertions(+), 0 deletions(-)
 create mode 100755 modules.d/95aoe/aoeroot
 create mode 100755 modules.d/95aoe/check
 create mode 100755 modules.d/95aoe/install
 create mode 100755 modules.d/95aoe/installkernel
 create mode 100755 modules.d/95aoe/parse-aoeroot.sh
modules.d/95aoe/aoeroot new file +69 -0
new file mode 100755
index 0000000..9b12d7b
@@ -0,0 +1,79 @@
+#!/bin/sh
+#
+##############################
+#
+# aoeroot
+#
+# Adapted from 'nbdroot' and 'iscsiroot'
+#
+# Here we assume that 'root' is specified;
+# we do not make any special attempts to mount it here.
+#
+##############################
+
+. /lib/dracut-lib.sh
+
+PATH=$PATH:/sbin:/usr/sbin
+
+# Huh? Empty $1?
+test -z "$1" && exit 1
+
+# Huh? Empty $2?
+test -z "$2" && exit 1
+
+# Huh? Empty $3?
+test -z "$3" && exit 1
+
+# root is in the form root=aoe:eM.N
+netif="$1"
+aoeroot="$2"
+NEWROOT="$3"
+
+# If it's not aoe we don't continue
+test "${aoeroot%%:*}" = "aoe" || return
+
+aoeroot=${aoeroot#aoe:}
+aoedev=/dev/etherd/$aoeroot
+
+# FIXME: the init script does not export UDEVVERSION
+if test "$UDEVVERSION"; then
+  :
+else
+  UDEVVERSION=$(udevadm --version)
+fi
+
+getarg 'rdbreak=aoeroot' && emergency_shell -n aoeroot "Break (pre) AOE"
+
+# XXX better way to wait for the device to be made?
+i=0
+while true; do
+  test -b $aoedev && break
+  test $i -ge 20 && exit 1
+  aoe-discover
+  if test $UDEVVERSION -ge 143; then
+    udevadm settle --exit-if-exists=$aoedev
+  else
+    sleep 0.1
+  fi
+  i=$(( $i + 1 ))
+done
+
+##############################
+#
+# These next two statements are borrowed from 'iscsiroot';
+# I do not really understand them.
+#
+##############################
+
+# inject new exit_if_exists
+echo 'settle_exit_if_exists="--exit-if-exists=/dev/root"; rm "$job"' > /

initqueue/aoe-settle.sh
+
+# force udevsettle to break
+> /initqueue/work
+
+# now we have a root filesystem somewhere in /dev/etherd/*
+# let the normal block handler handle root=
+
+getarg 'rdbreak=aoeroot' && emergency_shell -n aoeroot "Break (post) AOE" +
+exit 0

modules.d/95aoe/check new file +54 -0

54 lines not on this page · raw message

modules.d/95aoe/install new file +5 -0
new file mode 100755
index 0000000..70ca7a8
@@ -0,0 +1,5 @@
+#!/bin/bash
+inst aoe-discover
+inst aoe-stat
+inst_hook cmdline 90 "$moddir/parse-aoeroot.sh"
+inst "$moddir/aoeroot" "/sbin/aoeroot"
modules.d/95aoe/installkernel new file +2 -0
new file mode 100755
index 0000000..b3db783
@@ -0,0 +1,2 @@
+#!/bin/bash
+instmods aoe
modules.d/95aoe/parse- renamed from modules.d/95aoe/parse-aoeroot.sh +0 -0

aoeroot.sh
new file mode 100755
index 0000000..2afcdcb

modules.d/95aoe/parse-aoeroot.sh new file +36 -0
@@ -0,0 +1,66 @@
+#!/bin/sh
+#
+# Format:
+#
+#   root=aoe:eM.N
+#   root=/dev/etherd/eM.N
+#   [root=*] netroot=aoe:eM.N
+#   [root=*] netroot=/dev/etherd/eM.N
+#
+# root= takes precedence over netroot= if root=iscsi[...]
+#
+
+# Don't continue if root is ok
+test -n "$rootok" && return
+
+# This script is sourced, so root should be set. But let's be paranoid
+test -z "$root" && root=$(getarg root=)
+test -z "$netroot" && netroot=$(getarg netroot=)
+
+case "$root" in
+  /dev/etherd/*)
+    root=aoe:${root#/dev/etherd/}
+  ;;
+esac
+
+case "$netroot" in
+  /dev/etherd/*)
+    netroot=aoe:${netroot#/dev/etherd/}
+  ;;
+esac
+
+# Root takes precedence over netroot
+case "$root" in
+  aoe:*)
+    if test -n "$netroot"; then
+      echo "Warning: root takes precedence over netroot. Ignoring 

netroot"
+ fi
+ netroot=$root
+ ;;
+esac
+
+# If it's not empty or aoe we don't continue
+case "$netroot" in

+  "") ;;
+  aoe:*) ;;
+  *)

+ return
+ ;;
+esac
+
+# If it's not aoe we don't continue
+case "$netroot" in
+ aoe:*) ;;
+ *) return ;;
+esac
+
+# AOE actually supported?
+test -e /sys/devices/virtual/aoe || modprobe aoe || die "aoe requested but kernel/initrd does not support aoe"
+
+# Done, all good!
+rootok=1
+
+# Shut up init error check
+test -z "$root" && root="aoe"
+
+echo '[ -e /dev/root ]' > /initqueue-finished/aoe.sh

Signature · 1 line
1.7.3.5