-
Notifications
You must be signed in to change notification settings - Fork 59
/
Copy path0112-init-wait-for-partition-and-retry-scan.patch
65 lines (58 loc) · 2 KB
/
0112-init-wait-for-partition-and-retry-scan.patch
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Arjan van de Ven <[email protected]>
Date: Wed, 17 May 2017 01:52:11 +0000
Subject: [PATCH] init: wait for partition and retry scan
As Clear Linux boots fast the device is not ready when
the mounting code is reached, so a retry device scan will
be performed every 0.5 sec for at least 40 sec
and synchronize the async task.
Signed-off-by: Miguel Bernal Marin <[email protected]>
---
init/do_mounts.c | 16 ++++++++++++++--
1 file changed, 14 insertions(+), 2 deletions(-)
diff --git a/init/do_mounts.c b/init/do_mounts.c
index 762b534978d9..107b96927049 100644
--- a/init/do_mounts.c
+++ b/init/do_mounts.c
@@ -613,7 +623,9 @@ void __init prepare_namespace(void)
* For example, it is not atypical to wait 5 seconds here
* for the touchpad of a laptop to initialize.
*/
+ async_synchronize_full();
wait_for_device_probe();
+ async_synchronize_full();
md_run_setup();
--
https://clearlinux.org
--- linux-6.5.1/block/early-lookup.c~ 2023-09-02 07:13:30.000000000 +0000
+++ linux-6.5.1/block/early-lookup.c 2023-09-18 14:16:34.721720093 +0000
@@ -243,8 +243,18 @@
*/
int __init early_lookup_bdev(const char *name, dev_t *devt)
{
- if (strncmp(name, "PARTUUID=", 9) == 0)
- return devt_from_partuuid(name + 9, devt);
+ if (strncmp(name, "PARTUUID=", 9) == 0) {
+ int res;
+ int needtowait = 40<<1;
+ res = devt_from_partuuid(name + 9, devt);
+ if (!res) return res;
+ while (res && needtowait) {
+ msleep(500);
+ res = devt_from_partuuid(name + 9, devt);
+ needtowait--;
+ }
+ return res;
+ }
if (strncmp(name, "PARTLABEL=", 10) == 0)
return devt_from_partlabel(name + 10, devt);
if (strncmp(name, "/dev/", 5) == 0)
--- linux-6.5.1/block/early-lookup.c~ 2023-09-18 14:16:34.000000000 +0000
+++ linux-6.5.1/block/early-lookup.c 2023-09-18 14:27:32.042046852 +0000
@@ -5,6 +5,7 @@
*/
#include <linux/blkdev.h>
#include <linux/ctype.h>
+#include <linux/delay.h>
struct uuidcmp {
const char *uuid;