perf(convert): reduce rootfs copies from 3 to 1#110
Open
Conversation
|
@imlk0 ,您好,您的请求已接收,请耐心等待结果。 |
|
@imlk0 ,您好,未检测到有镜像需要构建,如需重新检测请评论 /start 。 |
…napshots Replace the intermediate rootfs.img file and final qemu-img convert step with qcow2 overlay/snapshot architecture. The source image is modified through a writable overlay (source-mod), then forked into two independent snapshots (source-read for verity hash, source-write for dracut). This eliminates two full rootfs copies (~17s dd + ~32s qemu-img convert). Additional fixes: - Fix RPM version detection: rpm -q outputs error to stdout on uninstalled packages, which was captured as the version string - Fix unbound boot_part variable when source has no separate boot partition
Deprecate in-place device conversion in favor of file-based (--in/--out) conversion only. All device-mode code paths and conditional branches are removed, simplifying the codebase. Changes: - Remove operate_on_device variable and all conditional branches - Remove device-mode validation, confirmation prompt, and cleanup logic - Keep --device/-d flag but emit a deprecation warning - Remove --wipe-freed-space option (emit deprecation warning if used) - Update help text to reflect deprecation - Update docs: quick-start.md, quick-start_zh.md — replace --device examples with --in/--out and add deprecation notes (since v0.7.0)
|
@imlk0 ,您好,您的请求已接收,请耐心等待结果。 |
|
@imlk0 ,您好,未检测到有镜像需要构建,如需重新检测请评论 /start 。 |
|
@imlk0 ,您好,您的请求已接收,请耐心等待结果。 |
|
@imlk0 ,您好,未检测到有镜像需要构建,如需重新检测请评论 /start 。 |
|
@imlk0 ,您好,您的请求已接收,请耐心等待结果。 |
|
@imlk0 ,您好,未检测到有镜像需要构建,如需重新检测请评论 /start 。 |
Remove "Example 5: Encrypt a Real System Disk" section which duplicated Example 1 after the --device removal. Renumber remaining examples (4: KBS, 5: KMS). Update prerequisites and troubleshooting to remove real-disk mentions. Add deprecation note at the top of both quick-start docs.
|
@imlk0 ,您好,您的请求已接收,请耐心等待结果。 |
|
@imlk0 ,您好,未检测到有镜像需要构建,如需重新检测请评论 /start 。 |
Replace ~70 lines of duplicated mount/unmount code with a single call to setup_chroot_mounts, adding optional boot_override_part and efi_override_part parameters to handle the update_initrd's output-device mount needs.
|
@imlk0 ,您好,您的请求已接收,请耐心等待结果。 |
|
@imlk0 ,您好,未检测到有镜像需要构建,如需重新检测请评论 /start 。 |
|
@imlk0 ,您好,您的请求已接收,请耐心等待结果。 |
|
@imlk0 ,您好,未检测到有镜像需要构建,如需重新检测请评论 /start 。 |
|
@imlk0 ,您好,您的请求已接收,请耐心等待结果。 |
|
@imlk0 ,您好,未检测到有镜像需要构建,如需重新检测请评论 /start 。 |
- Add function-level shellcheck disable=SC2154 on step:update_initrd and step::prepare_output_and_snapshots (variables set in main() and used in these step functions) - Remove unused output_boot_part_num variable - Remove duplicate log::step from step::prepare_output_and_snapshots and step::copy_partitions (main() already logs the step)
|
@imlk0 ,您好,您的请求已接收,请耐心等待结果。 |
|
@imlk0 ,您好,未检测到有镜像需要构建,如需重新检测请评论 /start 。 |
Use guestfish to write EFI content directly to qcow2 file, bypassing the NBD kernel page cache invalidation issue that caused FAT32 filesystem data to be lost on qemu-nbd disconnect. Also fix EFI partition detection in external.rs where the lsblk FSTYPE column addition broke the partition filter, and add partprobe to ensure partition device nodes are created after NBD connect.
|
@imlk0 ,您好,您的请求已接收,请耐心等待结果。 |
|
@imlk0 ,您好,未检测到有镜像需要构建,如需重新检测请评论 /start 。 |
- Remove early mkfs.vfat + mount + cp for EFI partition in UKI mode; EFI is now dd'd in copy_partitions and restored via guestfish after NBD disconnect to avoid writeback-cache data loss. - Save partition UUIDs with blkid before parted rm/mkpart operations, restore them with sgdisk -u afterward to preserve GPT GUIDs.
|
@imlk0 ,您好,您的请求已接收,请耐心等待结果。 |
|
@imlk0 ,您好,未检测到有镜像需要构建,如需重新检测请评论 /start 。 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
rootfs.imgfile and finalqemu-img convertstep with a qcow2 overlay/snapshot architecture, reducing full rootfs copies from 3 → 1source-mod), then forked into two independent snapshots (source-readfor verity hash,source-writefor dracut initrd generation)--device/operate_on_devicesupport: deprecate in-place device conversion in favor of file-based (--in/--out) onlyrpm -qoutputs error to stdout on uninstalled packages, which was captured as the version stringboot_partvariable when source has no separate boot partition--wipe-freed-spaceoption (no longer needed with qcow2 overlay architecture)Test plan