Re: New partman-multipath udeb
On Thu, Feb 28, 2008 at 03:21:48AM +0100, Frans Pop wrote:
> However, /usr/lib/post-base-installer.d/ is perfect as that is run after
> debootstrap but before kernel installation. It works the same as
> finish-install.d: just dump a script in there and it'll get executed.
> Because of when it is executed, you can do everything in the same script:
> run apt-install and copy the config and bindings. And everything will
> already be in place when the kernel is installed and the initramfs is
> generated.
Does this look better. If so, I'll apply this.
-- Guido
>From c2d814d99b6c916f53cf03289fb41e8e4a0f4145 Mon Sep 17 00:00:00 2001
From: Guido Guenther <agx@sigxcpu.org>
Date: Sat, 8 Mar 2008 21:10:44 +0100
Subject: [PATCH] move finish-install and finish.d stuff into post-base-installer.d/60multipath
saves the slow update-initramfs run, thanks to Frans Pop for the suggestion
---
debian/dirs | 1 -
debian/partman-multipath.install | 1 +
debian/rules | 4 +---
finish-install | 21 ---------------------
finish.d/_numbers | 1 -
finish.d/aptinstall_multipath | 9 ---------
post-base-installer.d/60multipath | 21 +++++++++++++++++++++
7 files changed, 23 insertions(+), 35 deletions(-)
delete mode 100644 debian/dirs
create mode 100644 debian/partman-multipath.install
delete mode 100755 finish-install
delete mode 100644 finish.d/_numbers
delete mode 100755 finish.d/aptinstall_multipath
create mode 100755 post-base-installer.d/60multipath
diff --git a/debian/dirs b/debian/dirs
deleted file mode 100644
index f9cd2dd..0000000
--- a/debian/dirs
+++ /dev/null
@@ -1 +0,0 @@
-/usr/lib/finish-install.d/
diff --git a/debian/partman-multipath.install b/debian/partman-multipath.install
new file mode 100644
index 0000000..1ab8f4d
--- /dev/null
+++ b/debian/partman-multipath.install
@@ -0,0 +1 @@
+post-base-installer.d/60multipath usr/lib/post-base-installer.d/
diff --git a/debian/rules b/debian/rules
index 4a70082..98fa561 100755
--- a/debian/rules
+++ b/debian/rules
@@ -23,13 +23,11 @@ install: build
dh_installdirs
debian/install-rc init.d
debian/install-rc commit.d
- debian/install-rc finish.d
- install -m 755 finish-install \
- ${CURDIR}/debian/${PACKAGE}/usr/lib/finish-install.d/70multipath
binary-indep: build install
dh_testdir
dh_testroot
+ dh_install
dh_installdebconf
dh_fixperms
dh_installdeb
diff --git a/finish-install b/finish-install
deleted file mode 100755
index b31a31d..0000000
--- a/finish-install
+++ /dev/null
@@ -1,21 +0,0 @@
-#!/bin/sh
-
-set -e
-
-if [ $(multipath -l | grep '^mpath[0-9]\+' | wc -l) -eq 0 ]; then
- exit 0
-fi
-
-if [ -r /etc/multipath.conf ]; then
- cp /etc/multipath.conf /target/etc/multipath.conf
-fi
-
-# copy over the persistent binding
-if [ -r /var/lib/multipath/bindings ]; then
- mkdir -p /target/var/lib/multipath
- cp /var/lib/multipath/bindings /target/var/lib/multipath/
-fi
-
-# The initrd must contain these files:
-chroot /target update-initramfs -u
-
diff --git a/finish.d/_numbers b/finish.d/_numbers
deleted file mode 100644
index 29ec3a7..0000000
--- a/finish.d/_numbers
+++ /dev/null
@@ -1 +0,0 @@
-70 aptinstall_multipath
diff --git a/finish.d/aptinstall_multipath b/finish.d/aptinstall_multipath
deleted file mode 100755
index 8bf7fe0..0000000
--- a/finish.d/aptinstall_multipath
+++ /dev/null
@@ -1,9 +0,0 @@
-#!/bin/sh
-
-set -e
-
-# install multipath-tools-boot in /target if needed
-if [ $(multipath -l | grep '^mpath[0-9]\+ ' | wc -l) -gt 0 ]; then
- apt-install multipath-tools-boot || true
-fi
-
diff --git a/post-base-installer.d/60multipath b/post-base-installer.d/60multipath
new file mode 100755
index 0000000..cb21b60
--- /dev/null
+++ b/post-base-installer.d/60multipath
@@ -0,0 +1,21 @@
+#!/bin/sh
+
+set -e
+
+if [ $(multipath -l | grep '^mpath[0-9]\+' | wc -l) -eq 0 ]; then
+ exit 0
+fi
+
+apt-install multipath-tools-boot || true
+
+if [ -r /etc/multipath.conf ]; then
+ cp /etc/multipath.conf /target/etc/multipath.conf
+fi
+
+# copy over the persistent binding
+if [ -r /var/lib/multipath/bindings ]; then
+ mkdir -p /target/var/lib/multipath
+ cp /var/lib/multipath/bindings /target/var/lib/multipath/
+fi
+
+# the initramfs will be updated by the kernel installation
--
1.5.4.3
Reply to: