diff options
author | Natanael Copa <ncopa@alpinelinux.org> | 2015-12-16 10:15:11 +0000 |
---|---|---|
committer | Natanael Copa <ncopa@alpinelinux.org> | 2015-12-16 11:03:08 +0000 |
commit | 3904e0a61646e55b3b41c78e995211f247acee14 (patch) | |
tree | e42002a9bac10f91eec2ba1a73770e74231e4450 /main | |
parent | 768efaf81cc9be8b8d98e2ddf0b3a984477a23f0 (diff) | |
download | aports-3904e0a61646e55b3b41c78e995211f247acee14.tar.bz2 aports-3904e0a61646e55b3b41c78e995211f247acee14.tar.xz |
main/mkinitfs: fix usb settle delay at boot
Diffstat (limited to 'main')
-rw-r--r-- | main/mkinitfs/APKBUILD | 10 | ||||
-rw-r--r-- | main/mkinitfs/git.patch | 55 |
2 files changed, 48 insertions, 17 deletions
diff --git a/main/mkinitfs/APKBUILD b/main/mkinitfs/APKBUILD index f70c0ede97..c24380f29f 100644 --- a/main/mkinitfs/APKBUILD +++ b/main/mkinitfs/APKBUILD @@ -1,8 +1,8 @@ # Maintainer: Natanael Copa <ncopa@alpinelinux.org> pkgname=mkinitfs -pkgver=2.8.0_git20151025 +pkgver=2.8.0_git20151216 _ver=${pkgver%_git*} -pkgrel=1 +pkgrel=0 pkgdesc="Tool to generate initramfs images for Alpine" url="http://git.alpinelinux.org/cgit/mkinitfs" makedepends="kmod-dev util-linux-dev cryptsetup-dev linux-headers" @@ -37,8 +37,8 @@ package() { make install DESTDIR="$pkgdir" || return 1 } md5sums="1a321336d97b22257349ddd36884ec34 mkinitfs-2.8.0.tar.xz -56af089f7c606e13cb65a3cf32d4bfb8 git.patch" +56f7bf0af2d4262d60a91d335bb44073 git.patch" sha256sums="5ffe4c5ec9e0ff4581e5b24301fd30d0964120d6b30ee78ea79f31ff48eeab73 mkinitfs-2.8.0.tar.xz -a3e823b10669cf7ef62bed3e7e4f662d157484a4f7449bea5b95cf9afefc1a15 git.patch" +057a4c8be2867db925ac4aa5af18b9a7457d5f2d44f0fdb058270c3ad908d690 git.patch" sha512sums="c103003f95c7d7d94daa41d0a81b210a0208c93d77203978554fb127a21e2f143b56990865fc53e2c5c732ef663603b297da63d31f915b1e3a3e0f3818aa8f2e mkinitfs-2.8.0.tar.xz -a5d15f34954c27c7b4ae5a2e9dab16b33b8360c29e9083d9a43947241a4e606d7acfe244f01b6e29c6977e81194e579e511f38aba963b732bd5e86c555ced15d git.patch" +6680ccff560306e6708c94f822d7415616ce920807ab33a26228ab73ed0cbf27c44adf58fe90f590ecab86a72d1f37f2375059bff5775e760bb2a68aa1634111 git.patch" diff --git a/main/mkinitfs/git.patch b/main/mkinitfs/git.patch index 14842a85e9..ef27ea474d 100644 --- a/main/mkinitfs/git.patch +++ b/main/mkinitfs/git.patch @@ -208,6 +208,24 @@ index 8adf4df..6f28294 100644 /usr/sbin/accton /usr/sbin/sa - +diff --git a/features.d/btrfs.modules b/features.d/btrfs.modules +index b5a271f..a114111 100644 +--- a/features.d/btrfs.modules ++++ b/features.d/btrfs.modules +@@ -1,2 +1,5 @@ + kernel/crypto/crc32c* ++kernel/arch/*/crypto/crc32* ++kernel/arch/*/crypto/crc32* ++kernel/crypto/crc32* + kernel/fs/btrfs +diff --git a/features.d/cryptsetup.modules b/features.d/cryptsetup.modules +index 9b63cd3..1469be7 100644 +--- a/features.d/cryptsetup.modules ++++ b/features.d/cryptsetup.modules +@@ -1,2 +1,3 @@ + kernel/crypto/* ++kernel/arch/*/crypto/* + kernel/drivers/md/dm-crypt.ko diff --git a/features.d/kms.files b/features.d/kms.files deleted file mode 100644 index 9d198b2..0000000 @@ -238,6 +256,15 @@ index fa74c10..b0e6c22 100644 kernel/drivers/block/virtio* kernel/drivers/virtio +kernel/drivers/net/virtio_net* +diff --git a/features.d/xfs.modules b/features.d/xfs.modules +index f577bf3..2b7fd53 100644 +--- a/features.d/xfs.modules ++++ b/features.d/xfs.modules +@@ -1 +1,4 @@ ++kernel/arch/*/crypto/crc32* ++kernel/arch/*/crypto/crc32* ++kernel/crypto/crc32* + kernel/fs/xfs diff --git a/initramfs-init.in b/initramfs-init.in index 934fe92..cdf50b9 100755 --- a/initramfs-init.in @@ -915,10 +942,10 @@ index 04dc99c..c5f6434 100755 rc=$? diff --git a/nlplug-findfs.c b/nlplug-findfs.c new file mode 100644 -index 0000000..27b9ce2 +index 0000000..7d1511e --- /dev/null +++ b/nlplug-findfs.c -@@ -0,0 +1,1017 @@ +@@ -0,0 +1,1021 @@ + +/* + * Copy me if you can. @@ -962,7 +989,8 @@ index 0000000..27b9ce2 +#include "arg.h" + +#define DEFAULT_EVENT_TIMEOUT 250 -+#define USB_STORAGE_TIMEOUT 2000 ++/* usb mass storage needs 1 sec to settle */ ++#define USB_STORAGE_TIMEOUT 1000 + +#define FOUND_DEVICE 0x1 +#define FOUND_BOOTREPO 0x2 @@ -1108,7 +1136,6 @@ index 0000000..27b9ce2 + char *devname; + char *major; + char *minor; -+ char *driver; + char devnode[256]; + char *envp[64]; +}; @@ -1191,7 +1218,7 @@ index 0000000..27b9ce2 + return fd; +} + -+static int load_kmod(const char *modalias) ++static int load_kmod(const char *modalias, char *driver, size_t len) +{ + static struct kmod_ctx *ctx = NULL; + struct kmod_list *list = NULL; @@ -1228,6 +1255,8 @@ index 0000000..27b9ce2 + fmt = "module '%s' failed"; + } + dbg(fmt, kmod_module_get_name(mod)); ++ if (driver) ++ strncpy(driver, kmod_module_get_name(mod), len); + kmod_module_unref(mod); + } + kmod_module_unref_list(list); @@ -1339,7 +1368,7 @@ index 0000000..27b9ce2 +static void start_cryptsetup(struct ueventconf *conf) +{ + dbg("starting cryptsetup %s -> %s", conf->crypt_devnode, conf->crypt_name); -+ load_kmod("dm-crypt"); ++ load_kmod("dm-crypt", NULL, 0); + pthread_create(&conf->cryptsetup_tid, NULL, cryptsetup_thread, conf); + conf->running_threads |= CRYPTSETUP_THREAD; +} @@ -1613,12 +1642,16 @@ index 0000000..27b9ce2 + return 0; + + if (ev->modalias != NULL && strcmp(ev->action, "add") == 0) { -+ load_kmod(ev->modalias); ++ char buf[128]; ++ memset(buf, 0, sizeof(buf)); ++ load_kmod(ev->modalias, buf, sizeof(buf)-1); + conf->modalias_count++; + -+ } else if (ev->driver != NULL && strcmp(ev->driver, "usb-storage") == 0) { -+ conf->timeout += timeout_increment; -+ timeout_increment = 0; ++ /* increase timeout so usb drives gets time to settle */ ++ if (strcmp(buf, "usb_storage") == 0) { ++ conf->timeout += timeout_increment; ++ timeout_increment = 0; ++ } + + } else if (ev->devname != NULL) { + if (conf->program_argv[0] != NULL) { @@ -1691,8 +1724,6 @@ index 0000000..27b9ce2 + ev.major = value; + } else if (envcmp(key, "MINOR")) { + ev.minor = value; -+ } else if (envcmp(key, "DRIVER")) { -+ ev.driver = value; + } + + if (!envcmp(key, "PATH")) |