Skip to content
This repository was archived by the owner on Aug 5, 2022. It is now read-only.

Commit aac8937

Browse files
authored
Merge pull request #160 from mythi/installer
refkit-installer-image: image-installer fixes
2 parents 3da7ad8 + ddb8cce commit aac8937

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

Diff for: meta-refkit/recipes-image/images/refkit-installer-image.bb

+9-5
Original file line numberDiff line numberDiff line change
@@ -47,18 +47,16 @@ REFKIT_INSTALLER_UEFI_COMBO () {
4747

4848
# Might be with or without p in the middle (sda1 vs mmcblk0p1).
4949
partition=
50-
for i in $output*$gdisk_pnum; do
50+
for i in $output$gdisk_pnum $output'p'$gdisk_pnum; do
5151
if [ -e "$i" ]; then
5252
if [ "$partition" ]; then
5353
fatal "partition #$gdisk_pnum in $output not unique?!"
5454
fi
5555
partition=$i
56-
else
57-
fatal "$output*$gdisk_pnum not found in $output"
5856
fi
5957
done
6058
if [ ! "$partition" ]; then
61-
fatal "could not identify parition #$gdisk_pnum in $output"
59+
fatal "could not identify partition #$gdisk_pnum in $output"
6260
fi
6361

6462
if [ "$uuid" ]; then
@@ -146,6 +144,9 @@ REFKIT_INSTALLER_UEFI_COMBO () {
146144
if ! execute cp -r "$rootfs/boot/EFI_internal_storage" "$output_mountpoint/EFI"; then
147145
fatal "copying EFI files failed"
148146
fi
147+
if ! execute cp "$rootfs/boot/rmc.db" "$output_mountpoint/"; then
148+
fatal "copying RMC db failed"
149+
fi
149150
fi
150151
if ! sync; then
151152
fatal "syncing data failed"
@@ -160,13 +161,14 @@ REFKIT_INSTALLER_UEFI_COMBO () {
160161

161162
confirm_install || return 1
162163

164+
input_loopdev=
163165
input_mountpoint=
164166
input_mounted=
165167

166168
cleanup_install_image () {
167169
[ "$input_mounted" ] && execute umount "$input_mountpoint"
168170
[ "$input_mountpoint" ] && rmdir "$input_mountpoint"
169-
[ "$input" ] && execute kpartx -d "$input"
171+
[ "$input_loopdev" ] && execute kpartx -d "$input_loopdev" && losetup -d "$input_loopdev"
170172
remove_cleanup cleanup_install_image
171173
}
172174
add_cleanup cleanup_install_image
@@ -176,6 +178,8 @@ REFKIT_INSTALLER_UEFI_COMBO () {
176178
loopdev=$(execute kpartx -sav "$input" | tail -1 | sed -e 's/^\(add map \)*\([^ ]*\).*/\2/')
177179
if [ ! "$loopdev" ]; then
178180
fatal "kpartx failed for $input"
181+
else
182+
input_loopdev="/dev/${loopdev%%p[0-9]}"
179183
fi
180184
if ! input_mountpoint=$(mktemp -dt input-rootfs.XXXXXX); then
181185
fatal "could not create mount point"

0 commit comments

Comments
 (0)