294.6. isoimagewriter-26.08.2
ISO Image Writer — writes a disk image to a USB stick, checking a known distribution's signature
| Version | 26.08.2, release 1 |
| Shelf | disk — Block devices: partitioning, RAID, LVM, block encryption, SMART, NVMe, recovery, image writing and async I/O |
| Phase | 44_apps (Applications), 61 of 422 in build order |
| Licence | GPL-3.0-or-later |
| Homepage | https://apps.kde.org/isoimagewriter/ |
| Build time | 0.3 SBU |
| Installed size | 523.4 KiB in 8 files |
| Recipe | ports/core/disk/isoimagewriter/kpkgbuild |
About
ISO Image Writer writes an ISO or raw disk image to a USB stick: it lists the removable drives, writes the image block by block with a progress bar, and before writing checks the signature of an image from a distribution it knows. It is the program that opens a disk image by default on KDOS, and the way to write a KDOS installer stick from the desktop.
Sources
isoimagewriter-26.08.2.tar.xz(465.2 KiB)
sha2568cc5a8df149b32e9473a6a3d4355840d77fd80210d7e90ae98329c5be9c9f954
upstream: https://download.kde.org/stable/release-service/26.08.2/src/isoimagewriter-26.08.2.tar.xz
archive copy: sources-1/disk--isoimagewriter-26.08.2.tar.xz
Dependencies
Depends on: cmake, ninja, extra-cmake-modules, qt6-qtbase, ki18n, kcoreaddons, kwidgetsaddons, kiconthemes, karchive, kcrash, solid, gpgmepp, qgpgme, udisks2.
Required by (1): kde-gear-core.
Patches
build.sh applies these; kpkg applies nothing by itself.
status-wrap.patch lets the status line under the USB drive field wrap, gives it the stretch of the row it shares with the Create button, and reserves two lines of height for it. Upstream leaves it on one line, so at the window’s default width a sentence such as “Could not find the key to verify the ISO image”, which every image from an unknown distribution shows, is cut off where the button begins. The row is otherwise as tall as the button, and the main window does not grow for a label’s height-for-width, so without the reserved height a wrapped sentence loses the bottom of its second line. It is to be offered upstream as a merge request against utilities/isoimagewriter.
live-medium.patch makes four changes to the drive list and the write, and is to be offered upstream against utilities/isoimagewriter as one merge request.
The list skips a block device whose org.freedesktop.UDisks2.Block property HintIgnore is true. That is udev’s UDISKS_IGNORE, which fs/etc/udev/rules.d/70-kdos-live-medium.rules sets on the medium the live session runs from, and which Dolphin and the Device Notifier already honour. Upstream lists every removable or USB drive, so the running stick is offered as a target, and choosing it fails at OpenDevice because the system holds it open. The rule marks the disk mounted at /mnt/iso and its partitions; under Ventoy that is the /dev/mapper/ventoy mapping, so the Ventoy stick beneath it is still listed, and choosing it fails at OpenDevice with that reason.
The list is sorted by UDisks2 object path. Upstream walks the GetManagedObjects reply in hash order, which differs in every process, so the order of the drives and the one selected first change from launch to launch.
Each drive is named by its /dev node (Block.Device) rather than its UDisks2 object path, so the list reads /dev/sdb - QEMU HARDDISK (8.0 GiB) and two sticks of one model stay apart; the object path is still what the D-Bus calls use. The confirmation before writing names the chosen drive by the same text, where upstream says only “the USB drive”.
The OpenDevice reply and the open of its descriptor are checked, and a failure is reported as “Could not open /dev/sdX:” followed by UDisks2’s or Qt’s reason. Upstream writes on with no descriptor and reports only “The last block was not fully written (-1 of 1,048,576 bytes)”.
live-medium.patch— Hide the running medium, name drives by /dev node, report open errorsISO Image Writer lists every removable or USB block device UDisks2 reports, in the hash order of its GetManagedObjects reply, names each by its UDisks2 object path, and writes on when OpenDevice fails.
- Skip a block device whose org.freedesktop.UDisks2.Block HintIgnore is true (udev's UDISKS_IGNORE), the mark a system puts on the medium it runs from; Dolphin and the Device Notifier already hide it. - List the devices in object-path order, so the list and the drive selected first are the same on every launch. - Show each drive by its /dev node (Block.Device), not its object path: "/dev/sdb - QEMU HARDDISK (8.0 GiB)". - Check the OpenDevice reply and the QFile open, and report the error text ("Could not open /dev/sda: ...") instead of failing on the first block with "-1 of 1,048,576 bytes". - Name the chosen drive, by the same display name, in the confirmation before writing.
status-wrap.patch— Wrap the status line beside the Create buttonThe status label under the USB drive field holds a whole sentence, such as "Could not find the key to verify the ISO image", in a row it shares with the Create button. Without word wrap the sentence is cut where the button begins at the window's default width. Wrap it, give it the row's stretch so the button keeps its own width on the right, and reserve two lines of height so a wrapped sentence is not cut at the bottom of a row sized for the button.
Installation
From the repository root, inside the build container, this is the line kdosbuild runs for the port:
script/chroot/exec.sh bash -c 'source script/phases/44_apps/phase.env && kpkg install isoimagewriter'
What kpkg does
kpkg runs these steps, in this order, as root inside the chroot. The port directory is /ports/core/disk/isoimagewriter.
1. Verify every declared source. Each file a sha256 = line names, found in the port directory or in /var/cache/kpkg/sources, must hash to its line; a mismatch stops the build before anything is unpacked.
cd /ports/core/disk/isoimagewriter
echo '8cc5a8df149b32e9473a6a3d4355840d77fd80210d7e90ae98329c5be9c9f954 isoimagewriter-26.08.2.tar.xz' | sha256sum -c -
2. Unpack. The work directory is emptied and the first source is unpacked into $SRC with its top directory stripped; any later tarball lands unstripped beside it in $SRC_ROOT, and a file that is not a tarball is copied into $SRC.
SRC_ROOT=/var/cache/kpkg/work/isoimagewriter
SRC=$SRC_ROOT/isoimagewriter-26.08.2
PKG=$SRC_ROOT/pkg
rm -rf "$SRC_ROOT"
mkdir -p "$SRC" "$PKG"
tar --no-same-permissions --warning=no-unknown-keyword -xf isoimagewriter-26.08.2.tar.xz -C "$SRC" --strip-components=1
Every config.guess and config.sub older than automake’s is then replaced with automake’s, so a configure script recognises the musl target.
3. Build. build.sh is sourced in a subshell under set -e, from $SRC, with name, version, release and the five paths PKGNAME, PORT_SRC, SRC_ROOT, SRC and PKG set as shell variables. Its body, verbatim:
patch -p1 -i "$PORT_SRC/status-wrap.patch"
patch -p1 -i "$PORT_SRC/live-medium.patch"
cmake -S . -B build -G Ninja \
-D CMAKE_INSTALL_PREFIX=/usr \
-D KDE_INSTALL_LIBDIR=lib \
-D CMAKE_BUILD_TYPE=Release \
-D KDE_INSTALL_USE_QT_SYS_PATHS=ON \
-D BUILD_TESTING=OFF \
-D KF_SKIP_PO_PROCESSING=ON \
-D CMAKE_REQUIRE_FIND_PACKAGE_Gpgmepp=ON \
-D CMAKE_REQUIRE_FIND_PACKAGE_QGpgmeQt6=ON \
-Wno-dev
cmake --build build
DESTDIR=$PKG cmake --install build
The switches, and why each is set:
-D CMAKE_REQUIRE_FIND_PACKAGE_Gpgmepp=ON— With-D CMAKE_REQUIRE_FIND_PACKAGE_QGpgmeQt6=ON: make gpgmepp and qgpgme requirements. Upstream looks for both quietly and compiles the signature check only when QGpgme is found; without it every image is written unchecked.-D KF_SKIP_PO_PROCESSING=ON— Skips building the interface translations, which the package-wide English-only rule would remove anyway (see Size and language policy).
The common switches of each build system are explained in the Flag glossary.
4. Package. kpkg removes libtool archives, the info directory index, mimeinfo.cache and every fonts.dir from $PKG, copies the source’s licence files into /usr/share/licenses/isoimagewriter, prunes what the image does not ship, lints the tree and rolls it reproducibly:
tar --sort=name --format=gnu --numeric-owner --owner=0 --group=0 \
--mtime=@$SOURCE_DATE_EPOCH \
--use-compress-program='xz -9 -T0 --block-size=32MiB --no-adjust' \
-cf isoimagewriter-26.08.2-1.tar.xz -C "$PKG" .
5. Adopt. kpkgadd installs the package’s files over the root, refusing a path another package owns, records the file list in /var/lib/kpkg/db/isoimagewriter, and runs the triggers its paths call for.
Contents
Installed programs: isoimagewriter.
Installed directories: /usr/share/isoimagewriter, /usr/share/licenses/isoimagewriter.
Notes
The check is by file name and covers KDE neon and Arch Linux (a detached .sig beside the image, against the keys the port installs in /usr/share/isoimagewriter), Kubuntu and Ubuntu (a signed SHA256SUMS), and Debian and Netrunner (a checksum the person pastes in). Any other image is reported as not a known distribution’s and can still be written. A KDOS image is one of them: the status line reads “Could not find the key to verify the ISO image”, and kdos verify kdos-<version>.iso, with the release’s SHA256SUMS and SHA256SUMS.sig beside it, checks the image and the list’s signature against the KDOS release key.
The device is opened through UDisks2’s OpenDevice call on the system bus, so udisks2, in depends for run time, must be running, and polkit decides the org.freedesktop.udisks2.open-device action: fs/etc/polkit-1/rules.d/50-kdos.rules grants it to the wheel group, and anyone else is asked for an administrator’s password.