From b6cf4b0fa33620b8493836ba097b49b90b9cb9f6 Mon Sep 17 00:00:00 2001 From: Natanael Copa Date: Fri, 24 Dec 2010 15:38:44 +0000 Subject: main/mkinifs: allow the lvm be ontop of raid --- ...01-init-support-lvm-ontop-of-raid-devices.patch | 63 ++++++++++++++++++++++ main/mkinitfs/APKBUILD | 25 ++++++--- 2 files changed, 81 insertions(+), 7 deletions(-) create mode 100644 main/mkinitfs/0001-init-support-lvm-ontop-of-raid-devices.patch (limited to 'main/mkinitfs') diff --git a/main/mkinitfs/0001-init-support-lvm-ontop-of-raid-devices.patch b/main/mkinitfs/0001-init-support-lvm-ontop-of-raid-devices.patch new file mode 100644 index 000000000..fe28fdfa6 --- /dev/null +++ b/main/mkinitfs/0001-init-support-lvm-ontop-of-raid-devices.patch @@ -0,0 +1,63 @@ +From d869559037802dcef6e2cd8551ab3ac0ececf690 Mon Sep 17 00:00:00 2001 +From: Natanael Copa +Date: Fri, 24 Dec 2010 15:31:54 +0000 +Subject: [PATCH] init: support lvm ontop of raid devices + +--- + initramfs-init.in | 19 ++++++++++++------- + 1 files changed, 12 insertions(+), 7 deletions(-) + +diff --git a/initramfs-init.in b/initramfs-init.in +index 81b7150..d140d75 100755 +--- a/initramfs-init.in ++++ b/initramfs-init.in +@@ -173,6 +173,14 @@ setup_inittab_console(){ + done + } + ++# start lvm if exists ++start_lvm() { ++ [ -x /sbin/lvm ] || return ++ modprobe dm-mod ++ lvm vgscan --mknodes --ignorelockingfailure >/dev/null 2>&1 &&\ ++ lvm vgchange --ignorelockingfailure -a y >/dev/null 2>&1 ++} ++ + # gotta start from somewhere :) + echo "Alpine Init $VERSION" + +@@ -260,13 +268,6 @@ scan_drivers + scan_drivers + eend 0 + +-# start lvm if exists +-if [ -x /sbin/lvm ]; then +- modprobe dm-mod +- lvm vgscan --mknodes --ignorelockingfailure >/dev/null 2>&1 &&\ +- lvm vgchange --ignorelockingfailure -a y >/dev/null 2>&1 +-fi +- + # check if root=... was set + if [ -n "$KOPT_root" ]; then + if [ "$SINGLEMODE" = "yes" ]; then +@@ -282,6 +283,7 @@ if [ -n "$KOPT_root" ]; then + raidautorun "$KOPT_root" + ;; + esac ++ start_lvm + ebegin "Mounting root" + retry_mount -o ro $KOPT_root $sysroot 2>/dev/null + eend $? +@@ -297,6 +299,9 @@ if [ -n "$KOPT_root" ]; then + exec /bin/busybox sh + fi + ++# incase we have alpine_dev on raid device... ++start_lvm ++ + # we only want to wait for usb if really needed at this point + if [ -z "${ALPINE_DEV##*usb*}" ]; then + wait_usb +-- +1.7.3.4 + diff --git a/main/mkinitfs/APKBUILD b/main/mkinitfs/APKBUILD index 03edd8f64..4d04a1f05 100644 --- a/main/mkinitfs/APKBUILD +++ b/main/mkinitfs/APKBUILD @@ -1,15 +1,16 @@ # Maintainer: Natanael Copa pkgname=mkinitfs pkgver=2.2.0 -pkgrel=0 +pkgrel=1 pkgdesc="Tool to generate initramfs images for Alpine" url=http://git.alpinelinux.org/cgit/mkinitfs depends="busybox apk-tools>=2.0" triggers="$pkgname.trigger:/usr/share/kernel/*" source="http://git.alpinelinux.org/cgit/$pkgname/snapshot/$pkgname-$pkgver.tar.bz2 + 0001-init-support-lvm-ontop-of-raid-devices.patch eglibc.patch " -arch="x86 x86_64" +arch="all" license="GPL-2" prepare() { @@ -17,11 +18,20 @@ prepare() { # If we are using eglibc/glibc we need to include eglibc libs # instead of uclibc libs. - case "$CHOST" in - *-gnu) - patch -p1 -i "$srcdir"/eglibc.patch || return 1 - ;; - esac + for i in $source; do + case $i in + eglibc.patch) + case "$CHOST" in + *-gnu) + patch -p1 -i "$srcdir"/eglibc.patch || return 1 + ;; + esac + ;; + *.patch) + patch -p1 -i "$srcdir"/$i || return 1 + ;; + esac + done } build() { @@ -34,4 +44,5 @@ package() { make install DESTDIR="$pkgdir" || return 1 } md5sums="b3abed1ee80ae69947350b795c7211e5 mkinitfs-2.2.0.tar.bz2 +eeb2edd5c5db0b00d10eea57132e0249 0001-init-support-lvm-ontop-of-raid-devices.patch e59c2f7de496fe430b07e32fd812ebe0 eglibc.patch" -- cgit v1.2.3