Handle partition loading time
This commit is contained in:
parent
28fd9b8640
commit
dd7ff686bb
1 changed files with 18 additions and 8 deletions
|
@ -137,6 +137,7 @@
|
|||
create = lib.strings.concatLines [
|
||||
(appendScript "${toString index}: \"$(${sizeOption})\" type=${mkType type}")
|
||||
# Wait for partition to be detected
|
||||
''echo "Waiting for ${partVar} to appear..."''
|
||||
''
|
||||
while true;
|
||||
do
|
||||
|
@ -326,8 +327,16 @@
|
|||
partitions = (builtins.concatMap (_: (builtins.attrValues _.partitions)) disks);
|
||||
|
||||
mountScript = lib.strings.concatLines (
|
||||
builtins.map
|
||||
(_: builtins.concatStringsSep " " [
|
||||
builtins.concatMap
|
||||
(_: [
|
||||
''echo "Waiting for "${lib.strings.escapeShellArg (partPath _)}" to appear..."''
|
||||
''
|
||||
while true;
|
||||
do
|
||||
[ -b ${lib.strings.escapeShellArg (partPath _)} ] && break
|
||||
done
|
||||
''
|
||||
(builtins.concatStringsSep " " [
|
||||
"sudo"
|
||||
"mount"
|
||||
"--mkdir"
|
||||
|
@ -335,6 +344,7 @@
|
|||
(partPath _)
|
||||
(normalizePath "/${rootDir}/${_.mountPoint}")
|
||||
])
|
||||
])
|
||||
(lib.lists.sortOn
|
||||
(_: normalizePath "/${_.mountPoint}")
|
||||
(builtins.filter (_: _.mountPoint != null) partitions)));
|
||||
|
|
Loading…
Reference in a new issue