Browse Source

* Added hooks for initramfs-tools in order to be able to support booting
from an AoE root device. Thanks, wolfle (closes: #591026).

David Martínez Moreno 8 years ago
parent
commit
18740421c3
5 changed files with 65 additions and 0 deletions
  1. 2 0
      debian/changelog
  2. 2 0
      debian/dirs
  3. 22 0
      debian/hooks_aoe
  4. 37 0
      debian/local-top_aoe
  5. 2 0
      debian/rules

+ 2 - 0
debian/changelog

@@ -32,6 +32,8 @@ aoetools (36-1) UNRELEASED; urgency=low
     - Added aoetools to Provides.
     - Added 'status' action, fixed a bug with LVMGROUPS and clarified the case
       when we don't mount anything because of /etc/default/aoetools.
+  * Added hooks for initramfs-tools in order to be able to support booting
+    from an AoE root device.  Thanks, wolfle (closes: #591026).
 
  -- David Martínez Moreno <ender@debian.org>  Sun, 12 Jan 2014 15:05:34 -0800
 

+ 2 - 0
debian/dirs

@@ -0,0 +1,2 @@
+/usr/share/initramfs-tools/hooks
+/usr/share/initramfs-tools/scripts/local-top

+ 22 - 0
debian/hooks_aoe

@@ -0,0 +1,22 @@
+#!/bin/sh
+ 
+set  -e
+ 
+PREREQ=""
+ 
+prereqs()
+{
+	echo "$PREREQ"
+}
+ 
+case $1 in
+prereqs)
+	prereqs
+	exit 0
+	;;
+esac
+ 
+. /usr/share/initramfs-tools/hook-functions
+ 
+[ -x /sbin/aoe-discover ] && copy_exec /sbin/aoe-discover /sbin
+manual_add_modules aoe

+ 37 - 0
debian/local-top_aoe

@@ -0,0 +1,37 @@
+#!/bin/sh
+ 
+set -e
+ 
+PREREQ="udev"
+ 
+prereqs()
+{
+	echo "$PREREQ"
+}
+ 
+case $1 in
+prereqs)
+	prereqs
+	exit 0
+	;;
+esac
+
+# Bring in the main config
+. /conf/initramfs.conf
+for conf in conf/conf.d/*; do
+        [ -f ${conf} ] && . ${conf}
+done
+. /scripts/functions
+
+configure_networking
+
+# Make sure udev has processed all events from adding the NIC
+# modules before loading aoe
+wait_for_udev 10
+
+modprobe aoe
+
+# Wait until aoe device files have been generated.
+wait_for_udev 10
+
+[ -x /sbin/aoe-discover ] && aoe-discover

+ 2 - 0
debian/rules

@@ -8,6 +8,8 @@
 
 override_dh_auto_install:
 	$(MAKE) install PREFIX=debian/aoetools SBINDIR=debian/aoetools/sbin
+	install debian/hooks_aoe debian/aoetools/usr/share/initramfs-tools/hooks/aoe
+	install debian/local-top_aoe debian/aoetools/usr/share/initramfs-tools/scripts/local-top/aoe
 
 override_dh_installchangelogs:
 	dh_installchangelogs NEWS