Skip to content

Commit

Permalink
Allow install disk overwrite from cmdline
Browse files Browse the repository at this point in the history
Add rd.kiwi.oem.installdevice=DEVICE. Configures the disk device
that should be used in an OEM installation. This overwrites any
other oem device setting, e.g device filter or maxdisk and just
continues the installation on the given device. However, the
device must exist and must be a block special.
  • Loading branch information
schaefi committed Nov 22, 2023
1 parent 488be00 commit 771bb72
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,12 @@ the available kernel boot parameters for this modules:
OS deployment is `/dev/sdj`. With `rd.kiwi.oem.maxdisk=500G` the
deployment will land on that RAID disk.

``rd.kiwi.oem.installdevice``
Configures the disk device that should be used in an OEM
installation. This overwrites any other oem device setting, e.g device
filter or maxdisk and just continues the installation on the given
device. However, the device must exist and must be a block special.

``rd.live.overlay.size``
Tells a live ISO image the size for the `tmpfs` filesystem that is used
for the `overlayfs` mount process. If the write area of the overlayfs
Expand Down
21 changes: 21 additions & 0 deletions dracut/modules.d/90kiwi-dump/kiwi-dump-image.sh
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ function get_disk_list {
max_disk=0
kiwi_oemmultipath_scan=$(bool "${kiwi_oemmultipath_scan}")
kiwi_oem_maxdisk=$(getarg rd.kiwi.oem.maxdisk=)
kiwi_oem_installdevice=$(getarg rd.kiwi.oem.installdevice=)
if [ -n "${kiwi_oem_maxdisk}" ]; then
max_disk=$(binsize_to_bytesize "${kiwi_oem_maxdisk}") || max_disk=0
fi
Expand Down Expand Up @@ -107,6 +108,26 @@ function get_disk_list {
fi
list_items="${list_items} ${disk_device} ${disk_size}"
done
if [ -n "${kiwi_oem_installdevice}" ];then
# install device overwritten by cmdline.
local device=${kiwi_oem_installdevice}
local device_meta
local device_size
if [ ! -e "${device}" ];then
local no_dev="Given device ${device} does not exist"
report_and_quit "${no_dev}"
fi
if [ ! -b "${device}" ];then
local no_block_dev="Given device ${device} is not a block special"
report_and_quit "${no_block_dev}"
fi
device_meta=$(
eval lsblk "${blk_opts}" "${kiwi_oem_installdevice}" |\
grep -E "disk|raid" | tr ' ' ":"
)
device_size=$(echo "${device_meta}" | cut -f2 -d:)
list_items="${device} ${device_size}"
fi
if [ -z "${list_items}" ];then
local no_device_text="No device(s) for installation found"
report_and_quit "${no_device_text}"
Expand Down

0 comments on commit 771bb72

Please sign in to comment.