Skip to content

Commit 9c5bb43

Browse files
author
Josef Ottl
committed
fix: root repartitioning for root on raid: do not device lock not yet started RaidDev, set partition type to fd for raid, assemble once after repart with devicesize update
1 parent 8b360ce commit 9c5bb43

File tree

2 files changed

+18
-2
lines changed

2 files changed

+18
-2
lines changed

dracut/modules.d/55kiwi-repart/kiwi-repart-disk.sh

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,9 +124,19 @@ function repart_standard_disk {
124124
d ${kiwi_RootPart}
125125
n p:lxroot ${kiwi_RootPart} . ${root_part_size}
126126
"
127+
if mdraid_system; then
128+
command_query="
129+
d ${kiwi_RootPart}
130+
n p:lxraid ${kiwi_RootPart} . ${root_part_size}
131+
t ${kiwi_RootPart} fd
132+
"
133+
fi
127134
if ! create_partitions "${disk}" "${command_query}";then
128135
die "Failed to create partition table"
129136
fi
137+
if mdraid_system; then
138+
update_devicesize_mdraid
139+
fi
130140
# finalize table changes
131141
finalize_disk_repart
132142
}

dracut/modules.d/59kiwi-lib/kiwi-mdraid-lib.sh

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,18 @@ function deactivate_mdraid {
1919

2020
function activate_mdraid {
2121
declare kiwi_RaidDev=${kiwi_RaidDev}
22-
set_device_lock "${kiwi_RaidDev}" \
23-
mdadm --assemble --scan "${kiwi_RaidDev}"
22+
mdadm --assemble --scan "${kiwi_RaidDev}"
2423
wait_for_storage_device "${kiwi_RaidDev}"
2524
set_root_map "${kiwi_RaidDev}"
2625
}
2726

27+
function update_devicesize_mdraid {
28+
declare kiwi_RaidDev=${kiwi_RaidDev}
29+
mdadm --assemble --scan "${kiwi_RaidDev}" --update=devicesize
30+
wait_for_storage_device "${kiwi_RaidDev}"
31+
deactivate_mdraid
32+
}
33+
2834
function resize_mdraid {
2935
declare kiwi_RaidDev=${kiwi_RaidDev}
3036
set_device_lock "${kiwi_RaidDev}" \

0 commit comments

Comments
 (0)