From 077e940a015d50236a8959d8fbb1dcae12e3a03e Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Yader=20Vel=C3=A1squez?= <yajosev@gmail.com>
Date: Sun, 4 Dec 2011 16:10:19 -0600
Subject: [PATCH] switch to module-setup

Ported to module-setup.sh the new system to install the functionality
that the module implements, instead of check_ and install_ scripts
that are deprecated.
---
 05olpc-busybox/Makefile.am           |   12 +--------
 05olpc-busybox/check_                |    4 ---
 05olpc-busybox/install_              |   16 ------------
 05olpc-busybox/module-setup.sh       |   20 +++++++++++++++
 30olpc-activation/Makefile.am        |   12 +--------
 30olpc-activation/check_             |    6 ----
 30olpc-activation/install_           |   38 ----------------------------
 30olpc-activation/module-setup.sh    |   45 ++++++++++++++++++++++++++++++++++
 30olpc-boot/Makefile.am              |   12 +--------
 30olpc-boot/check_                   |    6 ----
 30olpc-boot/install_                 |   31 -----------------------
 30olpc-boot/module-setup.sh          |   36 +++++++++++++++++++++++++++
 30olpc-common/Makefile.am            |   12 +--------
 30olpc-common/check_                 |    4 ---
 30olpc-common/install_               |    4 ---
 30olpc-common/module-setup.sh        |   10 +++++++
 30olpc-customization/Makefile.am     |   12 +--------
 30olpc-customization/check_          |    5 ----
 30olpc-customization/install_        |   12 ---------
 30olpc-customization/module-setup.sh |   18 +++++++++++++
 30olpc-python/Makefile.am            |   12 +--------
 30olpc-python/check_                 |    4 ---
 30olpc-python/install_               |   10 -------
 30olpc-python/module-setup.sh        |   14 ++++++++++
 95olpc-mtd/Makefile.am               |   12 +--------
 95olpc-mtd/check_                    |    4 ---
 95olpc-mtd/install_                  |    6 ----
 95olpc-mtd/module-setup.sh           |   11 ++++++++
 28 files changed, 161 insertions(+), 227 deletions(-)
 delete mode 100755 05olpc-busybox/check_
 delete mode 100755 05olpc-busybox/install_
 create mode 100644 05olpc-busybox/module-setup.sh
 delete mode 100755 30olpc-activation/check_
 delete mode 100755 30olpc-activation/install_
 create mode 100644 30olpc-activation/module-setup.sh
 delete mode 100755 30olpc-boot/check_
 delete mode 100755 30olpc-boot/install_
 create mode 100644 30olpc-boot/module-setup.sh
 delete mode 100755 30olpc-common/check_
 delete mode 100755 30olpc-common/install_
 create mode 100644 30olpc-common/module-setup.sh
 delete mode 100755 30olpc-customization/check_
 delete mode 100755 30olpc-customization/install_
 create mode 100644 30olpc-customization/module-setup.sh
 delete mode 100755 30olpc-python/check_
 delete mode 100755 30olpc-python/install_
 create mode 100644 30olpc-python/module-setup.sh
 delete mode 100755 95olpc-mtd/check_
 delete mode 100755 95olpc-mtd/install_
 create mode 100644 95olpc-mtd/module-setup.sh

diff --git a/05olpc-busybox/Makefile.am b/05olpc-busybox/Makefile.am
index 6d36034..6666a3b 100644
--- a/05olpc-busybox/Makefile.am
+++ b/05olpc-busybox/Makefile.am
@@ -1,12 +1,2 @@
 dmoddir = $(DRACUT_MODDIR)/05olpc-busybox
-dist_dmod_SCRIPTS = check_ install_
-
-# Ugh. automake doesnt like files called "install" or "check" because it
-# provides default rules with those names.
-install-data-hook:
-	mv $(DESTDIR)/$(dmoddir)/check{_,}
-	mv $(DESTDIR)/$(dmoddir)/install{_,}
-
-uninstall-hook:
-	rm -f $(DESTDIR)/$(dmoddir)/{check,install}
-
+dist_dmod_SCRIPTS = module-setup.sh
diff --git a/05olpc-busybox/check_ b/05olpc-busybox/check_
deleted file mode 100755
index 7dc97ca..0000000
--- a/05olpc-busybox/check_
+++ /dev/null
@@ -1,4 +0,0 @@
-#!/bin/bash
-# Return 255 so that this module is only included when explicitly
-# requested by the configuration (RH#707423)
-exit 255
diff --git a/05olpc-busybox/install_ b/05olpc-busybox/install_
deleted file mode 100755
index 1f3920f..0000000
--- a/05olpc-busybox/install_
+++ /dev/null
@@ -1,16 +0,0 @@
-#!/bin/bash
-
-inst busybox /sbin/busybox
-
-# List of shell programs that we use in other official dracut modules, that
-# must be supported by the busybox installed on the host system
-progs="echo grep usleep [ rmmod insmod mount uname umount setfont kbd_mode stty gzip bzip2 chvt readlink blkid dd losetup tr sed seq ps more cat rm free ping netstat vi ping6 fsck ip hostname basename mknod mkdir pidof sleep chroot ls cp mv dmesg mkfifo less ln modprobe flock"
-
-# FIXME: switch_root should be in the above list, but busybox version hangs
-# (using busybox-1.15.1-7.fc14.i686 at the time of writing)
-
-for i in $progs; do
-	path=$(find_binary "$i")
-	ln -s /sbin/busybox "$initdir/$path"
-done
-
diff --git a/05olpc-busybox/module-setup.sh b/05olpc-busybox/module-setup.sh
new file mode 100644
index 0000000..1e64a87
--- /dev/null
+++ b/05olpc-busybox/module-setup.sh
@@ -0,0 +1,20 @@
+#!/bin/bash
+check() {
+	return 255
+}
+
+install() {
+	inst busybox /sbin/busybox
+
+	# List of shell programs that we use in other official dracut modules, that
+	# must be supported by the busybox installed on the host system
+	progs="echo grep usleep [ rmmod insmod mount uname umount setfont kbd_mode stty gzip bzip2 chvt readlink blkid dd losetup tr sed seq ps more cat rm free ping netstat vi ping6 fsck ip hostname basename mknod mkdir pidof sleep chroot ls cp mv dmesg mkfifo less ln modprobe flock"
+
+	# FIXME: switch_root should be in the above list, but busybox version hangs
+	# (using busybox-1.15.1-7.fc14.i686 at the time of writing)
+
+	for i in $progs; do
+		path=$(find_binary "$i")
+		ln -s /sbin/busybox "$initdir/$path"
+	done
+}
diff --git a/30olpc-activation/Makefile.am b/30olpc-activation/Makefile.am
index b580ac3..8261895 100644
--- a/30olpc-activation/Makefile.am
+++ b/30olpc-activation/Makefile.am
@@ -1,13 +1,3 @@
 dmoddir = $(DRACUT_MODDIR)/30olpc-activation
-dist_dmod_SCRIPTS = check_ install_ activate.py greplease.py
+dist_dmod_SCRIPTS = module-setup.sh activate.py greplease.py
 dist_dmod_DATA = filesystems
-
-# Ugh. automake doesnt like files called "install" or "check" because it
-# provides default rules with those names.
-install-data-hook:
-	mv $(DESTDIR)/$(dmoddir)/check{_,}
-	mv $(DESTDIR)/$(dmoddir)/install{_,}
-
-uninstall-hook:
-	rm -f $(DESTDIR)/$(dmoddir)/{check,install}
-
diff --git a/30olpc-activation/check_ b/30olpc-activation/check_
deleted file mode 100755
index 22897f1..0000000
--- a/30olpc-activation/check_
+++ /dev/null
@@ -1,6 +0,0 @@
-#!/bin/bash
-[[ $1 = -d ]] && echo "olpc-python olpc-common olpc-boot"
-
-# Return 255 so that this module is only included when explicitly
-# requested by the configuration (RH#707423)
-exit 255
diff --git a/30olpc-activation/install_ b/30olpc-activation/install_
deleted file mode 100755
index 130deaf..0000000
--- a/30olpc-activation/install_
+++ /dev/null
@@ -1,38 +0,0 @@
-#!/bin/bash
-
-dracut_install iwconfig
-dracut_install iwlist
-dracut_install ip
-
-python_libdir=$(python -c "from distutils.sysconfig import get_python_lib; print get_python_lib(1)")
-
-for i in activate.py greplease.py olpc_act_gui_server.py; do
-	inst "$moddir"/"$i" /usr/libexec/initramfs-olpc/"$i"
-done
-
-inst "$moddir"/olpc_act_gui_client.py "$python_libdir"/olpc_act_gui_client.py
-
-for i in pyvt.so pyfb.so ipv6util.so; do
-	inst /usr/lib/dracut-modules-olpc/"$i" "$python_libdir"/"$i"
-done
-
-for i in "$moddir"/act-gui-images/*; do
-	inst "$i" /usr/share/olpc-act-gui/images/$(basename "$i")
-done
-
-dracut_install "$python_libdir"/bitfrost/__init__.py
-dracut_install "$python_libdir"/bitfrost/leases/__init__.py
-dracut_install "$python_libdir"/bitfrost/leases/core.py
-dracut_install "$python_libdir"/bitfrost/leases/keys.py
-dracut_install "$python_libdir"/bitfrost/leases/crypto.py
-dracut_install "$python_libdir"/bitfrost/leases/errors.py
-dracut_install "$python_libdir"/bitfrost/util/__init__.py
-dracut_install "$python_libdir"/bitfrost/util/json.py
-dracut_install "$python_libdir"/bitfrost/util/pyverify.so
-
-instmods vfat usb_storage usb8xxx libertas libertas_sdio ohci_hcd ehci_hcd sdhci sd
-dracut_install -o /lib/firmware/usb8388.bin
-dracut_install -o /lib/firmware/sd8686.bin
-dracut_install -o /lib/firmware/sd8686_helper.bin
-
-inst "$moddir"/filesystems /etc/filesystems
diff --git a/30olpc-activation/module-setup.sh b/30olpc-activation/module-setup.sh
new file mode 100644
index 0000000..4278cc6
--- /dev/null
+++ b/30olpc-activation/module-setup.sh
@@ -0,0 +1,45 @@
+#!/bin/bash
+
+check() {
+	[[ $1 = -d ]] && echo "olpc-python olpc-common olpc-boot"
+	return 255
+}
+
+install() {
+	dracut_install iwconfig
+	dracut_install iwlist
+	dracut_install ip
+
+	python_libdir=$(python -c "from distutils.sysconfig import get_python_lib; print get_python_lib(1)")
+
+	for i in activate.py greplease.py olpc_act_gui_server.py; do
+		inst "$moddir"/"$i" /usr/libexec/initramfs-olpc/"$i"
+	done
+
+	inst "$moddir"/olpc_act_gui_client.py "$python_libdir"/olpc_act_gui_client.py
+
+	for i in pyvt.so pyfb.so ipv6util.so; do
+		inst /usr/lib/dracut-modules-olpc/"$i" "$python_libdir"/"$i"
+	done
+
+	for i in "$moddir"/act-gui-images/*; do
+		inst "$i" /usr/share/olpc-act-gui/images/$(basename "$i")
+	done
+
+	dracut_install "$python_libdir"/bitfrost/__init__.py
+	dracut_install "$python_libdir"/bitfrost/leases/__init__.py
+	dracut_install "$python_libdir"/bitfrost/leases/core.py
+	dracut_install "$python_libdir"/bitfrost/leases/keys.py
+	dracut_install "$python_libdir"/bitfrost/leases/crypto.py
+	dracut_install "$python_libdir"/bitfrost/leases/errors.py
+	dracut_install "$python_libdir"/bitfrost/util/__init__.py
+	dracut_install "$python_libdir"/bitfrost/util/json.py
+	dracut_install "$python_libdir"/bitfrost/util/pyverify.so
+
+	instmods vfat usb_storage usb8xxx libertas libertas_sdio ohci_hcd ehci_hcd sdhci sd
+	dracut_install -o /lib/firmware/usb8388.bin
+	dracut_install -o /lib/firmware/sd8686.bin
+	dracut_install -o /lib/firmware/sd8686_helper.bin
+
+	inst "$moddir"/filesystems /etc/filesystems
+}
diff --git a/30olpc-boot/Makefile.am b/30olpc-boot/Makefile.am
index 64f06fd..3bb2f3a 100644
--- a/30olpc-boot/Makefile.am
+++ b/30olpc-boot/Makefile.am
@@ -1,14 +1,4 @@
 dmoddir = $(DRACUT_MODDIR)/30olpc-boot
-dist_dmod_SCRIPTS = check_ install_
+dist_dmod_SCRIPTS = module-setup.sh
 dist_dmod_DATA = olpc-boot-premount.sh olpc-boot-prepivot.sh \
 	olpc-boot-cmdline.sh
-
-# Ugh. automake doesnt like files called "install" or "check" because it
-# provides default rules with those names.
-install-data-hook:
-	mv $(DESTDIR)/$(dmoddir)/check{_,}
-	mv $(DESTDIR)/$(dmoddir)/install{_,}
-
-uninstall-hook:
-	rm -f $(DESTDIR)/$(dmoddir)/{check,install}
-
diff --git a/30olpc-boot/check_ b/30olpc-boot/check_
deleted file mode 100755
index 12c51c7..0000000
--- a/30olpc-boot/check_
+++ /dev/null
@@ -1,6 +0,0 @@
-#!/bin/bash
-[[ $1 = -d ]] && echo "olpc-common"
-
-# Return 255 so that this module is only included when explicitly
-# requested by the configuration (RH#707423)
-exit 255
diff --git a/30olpc-boot/install_ b/30olpc-boot/install_
deleted file mode 100755
index f27d646..0000000
--- a/30olpc-boot/install_
+++ /dev/null
@@ -1,31 +0,0 @@
-#!/bin/bash
-
-# cmdline hook must be installed to run after 10parse-root-opts but before
-# 95parse-block
-inst_hook cmdline 20 "$moddir"/olpc-boot-cmdline.sh
-
-inst_hook pre-mount 10 "$moddir"/olpc-boot-premount.sh
-inst_hook pre-pivot 10 "$moddir"/olpc-boot-prepivot.sh
-
-progs="dd rm mv ln sync sleep poweroff umount readlink dirname basename mktemp"
-
-for i in $progs; do
-        path=$(find_binary "$i")
-        [ -e "$initdir/$path" ] && continue
-        ln -s /sbin/busybox "$initdir/$path"
-done
-
-dracut_install ubiattach
-
-# mount points used by initramfs code
-mkdir -p "$initdir"/ofw
-mkdir -p "$initdir"/mnt/usb
-mkdir -p "$initdir"/mnt/sd
-
-inst /usr/lib/dracut-modules-olpc/cprl /usr/libexec/initramfs-olpc/cprl
-
-# Disable dracut's fstab-checking, not appropriate for us
-# http://dev.laptop.org/ticket/10394
-mkdir -p ${initdir}/etc
-echo " rd_NO_FSTAB fastboot" >> ${initdir}/etc/cmdline
-
diff --git a/30olpc-boot/module-setup.sh b/30olpc-boot/module-setup.sh
new file mode 100644
index 0000000..ae25d61
--- /dev/null
+++ b/30olpc-boot/module-setup.sh
@@ -0,0 +1,36 @@
+#!/bin/bash
+check() {
+	[[ $1 = -d ]] && echo "olpc-common"
+	return 255
+}
+
+install() {
+	# cmdline hook must be installed to run after 10parse-root-opts but before
+	# 95parse-block
+	inst_hook cmdline 20 "$moddir"/olpc-boot-cmdline.sh
+
+	inst_hook pre-mount 10 "$moddir"/olpc-boot-premount.sh
+	inst_hook pre-pivot 10 "$moddir"/olpc-boot-prepivot.sh
+
+	progs="dd rm mv ln sync sleep poweroff umount readlink dirname basename mktemp"
+
+	for i in $progs; do
+			path=$(find_binary "$i")
+			[ -e "$initdir/$path" ] && continue
+			ln -s /sbin/busybox "$initdir/$path"
+	done
+
+	dracut_install ubiattach
+
+	# mount points used by initramfs code
+	mkdir -p "$initdir"/ofw
+	mkdir -p "$initdir"/mnt/usb
+	mkdir -p "$initdir"/mnt/sd
+
+	inst /usr/lib/dracut-modules-olpc/cprl /usr/libexec/initramfs-olpc/cprl
+
+	# Disable dracut's fstab-checking, not appropriate for us
+	# http://dev.laptop.org/ticket/10394
+	mkdir -p ${initdir}/etc
+	echo " rd_NO_FSTAB fastboot" >> ${initdir}/etc/cmdline
+}
diff --git a/30olpc-common/Makefile.am b/30olpc-common/Makefile.am
index bfeb890..dd00f97 100644
--- a/30olpc-common/Makefile.am
+++ b/30olpc-common/Makefile.am
@@ -1,13 +1,3 @@
 dmoddir = $(DRACUT_MODDIR)/30olpc-common
-dist_dmod_SCRIPTS = check_ install_
+dist_dmod_SCRIPTS = module-setup.sh
 dist_dmod_DATA = olpc-sd.rules olpc-net.rules
-
-# Ugh. automake doesnt like files called "install" or "check" because it
-# provides default rules with those names.
-install-data-hook:
-	mv $(DESTDIR)/$(dmoddir)/check{_,}
-	mv $(DESTDIR)/$(dmoddir)/install{_,}
-
-uninstall-hook:
-	rm -f $(DESTDIR)/$(dmoddir)/{check,install}
-
diff --git a/30olpc-common/check_ b/30olpc-common/check_
deleted file mode 100755
index 7dc97ca..0000000
--- a/30olpc-common/check_
+++ /dev/null
@@ -1,4 +0,0 @@
-#!/bin/bash
-# Return 255 so that this module is only included when explicitly
-# requested by the configuration (RH#707423)
-exit 255
diff --git a/30olpc-common/install_ b/30olpc-common/install_
deleted file mode 100755
index 0952277..0000000
--- a/30olpc-common/install_
+++ /dev/null
@@ -1,4 +0,0 @@
-#!/bin/bash
-mkdir -p "$initdir"/etc/udev/rules.d
-inst "$moddir"/olpc-sd.rules /etc/udev/rules.d/10-olpc-sd.rules
-inst "$moddir"/olpc-net.rules /etc/udev/rules.d/10-olpc-net.rules
diff --git a/30olpc-common/module-setup.sh b/30olpc-common/module-setup.sh
new file mode 100644
index 0000000..e20cf73
--- /dev/null
+++ b/30olpc-common/module-setup.sh
@@ -0,0 +1,10 @@
+#!/bin/bash
+check() {
+	return 255
+}
+
+install() {
+	mkdir -p "$initdir"/etc/udev/rules.d
+	inst "$moddir"/olpc-sd.rules /etc/udev/rules.d/10-olpc-sd.rules
+	inst "$moddir"/olpc-net.rules /etc/udev/rules.d/10-olpc-net.rules
+}
diff --git a/30olpc-customization/Makefile.am b/30olpc-customization/Makefile.am
index 14c38cd..063657e 100644
--- a/30olpc-customization/Makefile.am
+++ b/30olpc-customization/Makefile.am
@@ -1,12 +1,2 @@
 dmoddir = $(DRACUT_MODDIR)/30olpc-customization
-dist_dmod_SCRIPTS = check_ install_ process.py unpack.py
-
-# Ugh. automake doesnt like files called "install" or "check" because it
-# provides default rules with those names.
-install-data-hook:
-	mv $(DESTDIR)/$(dmoddir)/check{_,}
-	mv $(DESTDIR)/$(dmoddir)/install{_,}
-
-uninstall-hook:
-	rm -f $(DESTDIR)/$(dmoddir)/{check,install}
-
+dist_dmod_SCRIPTS = module-setup.sh process.py unpack.py
diff --git a/30olpc-customization/check_ b/30olpc-customization/check_
deleted file mode 100755
index 8f1b14b..0000000
--- a/30olpc-customization/check_
+++ /dev/null
@@ -1,5 +0,0 @@
-#!/bin/bash
-[[ $1 = -d ]] && echo "olpc-python olpc-common udev-rules"
-#change to 255, for allow to include this module only when
-#the dracut configuration request it.(#707423)
-exit 255
diff --git a/30olpc-customization/install_ b/30olpc-customization/install_
deleted file mode 100755
index f6f07d0..0000000
--- a/30olpc-customization/install_
+++ /dev/null
@@ -1,12 +0,0 @@
-#!/bin/bash
-dracut_install poweroff mount umount unzip modprobe
-
-mkdir -p "$initdir"/sysroot
-mkdir -p "$initdir"/sys
-mkdir -p "$initdir"/mnt/usb
-
-instmods vfat usb_storage ohci_hcd ehci_hcd sdhci sd
-
-inst "$moddir"/unpack.py /init
-inst "$moddir"/process.py /process.py
-
diff --git a/30olpc-customization/module-setup.sh b/30olpc-customization/module-setup.sh
new file mode 100644
index 0000000..4d29d29
--- /dev/null
+++ b/30olpc-customization/module-setup.sh
@@ -0,0 +1,18 @@
+#!/bin/bash
+check() {    
+	[[ $1 = -d ]] && echo "olpc-python olpc-common udev-rules"
+	return 255
+}
+
+install() {
+	dracut_install poweroff mount umount unzip modprobe
+
+	mkdir -p "$initdir"/sysroot
+	mkdir -p "$initdir"/sys
+	mkdir -p "$initdir"/mnt/usb
+
+	instmods vfat usb_storage ohci_hcd ehci_hcd sdhci sd
+
+	inst "$moddir"/unpack.py /init
+	inst "$moddir"/process.py /process.py
+}
diff --git a/30olpc-python/Makefile.am b/30olpc-python/Makefile.am
index 437a2e5..919833b 100644
--- a/30olpc-python/Makefile.am
+++ b/30olpc-python/Makefile.am
@@ -1,14 +1,4 @@
 dmoddir = $(DRACUT_MODDIR)/30olpc-python
-dist_dmod_SCRIPTS = check_ install_
+dist_dmod_SCRIPTS = module-setup.sh
 dist_dmod_DATA = python-contents.txt
 dist_noinst_SCRIPTS = list-python-files.sh
-
-# Ugh. automake doesnt like files called "install" or "check" because it
-# provides default rules with those names.
-install-data-hook:
-	mv $(DESTDIR)/$(dmoddir)/check{_,}
-	mv $(DESTDIR)/$(dmoddir)/install{_,}
-
-uninstall-hook:
-	rm -f $(DESTDIR)/$(dmoddir)/{check,install}
-
diff --git a/30olpc-python/check_ b/30olpc-python/check_
deleted file mode 100755
index 7dc97ca..0000000
--- a/30olpc-python/check_
+++ /dev/null
@@ -1,4 +0,0 @@
-#!/bin/bash
-# Return 255 so that this module is only included when explicitly
-# requested by the configuration (RH#707423)
-exit 255
diff --git a/30olpc-python/install_ b/30olpc-python/install_
deleted file mode 100755
index b73e6b5..0000000
--- a/30olpc-python/install_
+++ /dev/null
@@ -1,10 +0,0 @@
-#!/bin/bash
-
-old_ifs=$IFS
-IFS="
-"
-for line in $(<"$moddir"/python-contents.txt); do
-	inst $line
-done
-IFS=$old_ifs
-
diff --git a/30olpc-python/module-setup.sh b/30olpc-python/module-setup.sh
new file mode 100644
index 0000000..e4f8563
--- /dev/null
+++ b/30olpc-python/module-setup.sh
@@ -0,0 +1,14 @@
+#!/bin/bash
+check() {
+	return 255
+}
+
+install() {
+	old_ifs=$IFS
+	IFS="
+	"
+	for line in $(<"$moddir"/python-contents.txt); do
+		inst $line
+	done
+	IFS=$old_ifs
+}
diff --git a/95olpc-mtd/Makefile.am b/95olpc-mtd/Makefile.am
index 652c628..e7056b0 100644
--- a/95olpc-mtd/Makefile.am
+++ b/95olpc-mtd/Makefile.am
@@ -1,13 +1,3 @@
 dmoddir = $(DRACUT_MODDIR)/95olpc-mtd
-dist_dmod_SCRIPTS = install_ check_
+dist_dmod_SCRIPTS = module-setup.sh 
 dist_dmod_DATA = mount-mtd.sh  mtd-genrules.sh  parse-mtd.sh
-
-# Ugh. automake doesnt like files called "install" or "check" because it
-# provides default rules with those names.
-install-data-hook:
-	mv $(DESTDIR)/$(dmoddir)/check{_,}
-	mv $(DESTDIR)/$(dmoddir)/install{_,}
-
-uninstall-hook:
-	rm -f $(DESTDIR)/$(dmoddir)/{check,install}
-
diff --git a/95olpc-mtd/check_ b/95olpc-mtd/check_
deleted file mode 100755
index 7dc97ca..0000000
--- a/95olpc-mtd/check_
+++ /dev/null
@@ -1,4 +0,0 @@
-#!/bin/bash
-# Return 255 so that this module is only included when explicitly
-# requested by the configuration (RH#707423)
-exit 255
diff --git a/95olpc-mtd/install_ b/95olpc-mtd/install_
deleted file mode 100755
index 49cf872..0000000
--- a/95olpc-mtd/install_
+++ /dev/null
@@ -1,6 +0,0 @@
-#!/bin/sh
-dracut_install umount
-inst_hook cmdline 95 "$moddir/parse-mtd.sh"
-inst_hook pre-udev 30 "$moddir/mtd-genrules.sh"
-inst_hook mount 99 "$moddir/mount-mtd.sh"
-
diff --git a/95olpc-mtd/module-setup.sh b/95olpc-mtd/module-setup.sh
new file mode 100644
index 0000000..4097075
--- /dev/null
+++ b/95olpc-mtd/module-setup.sh
@@ -0,0 +1,11 @@
+#!/bin/bash
+check() {
+	return 255
+}
+
+install() {
+	dracut_install umount
+	inst_hook cmdline 95 "$moddir/parse-mtd.sh"
+	inst_hook pre-udev 30 "$moddir/mtd-genrules.sh"
+	inst_hook mount 99 "$moddir/mount-mtd.sh"
+}
-- 
1.7.7.3

