fix: exclude oversize El Torito [BOOT] entry during iso extraction - #136
Conversation
- Scan `7z l -slt` before extraction and exclude only [BOOT] entries larger than 4GiB-1 (the FAT32 single file limit) - Parse only Path/Folder/Size so it works with both old p7zip and new 7-Zip - Fall back to no exclusion when the scan fails; small [BOOT] entries are kept Log: Fix making bootable USB from large ISO images whose El Torito [BOOT] entry exceeds the FAT32 file size limit Bug: https://pms.uniontech.com/bug-view-377229.html
Reviewer's GuideBefore extracting an ISO, the implementation scans machine-readable 7-Zip listing output, filters oversized synthetic El Torito [BOOT] files that cannot fit on FAT32, and passes precise exclusions to extraction while preserving compatibility through a no-exclusion fallback. Unit tests cover new and old listing formats plus small boot images. Sequence diagram for excluding oversized El Torito entries during ISO extractionsequenceDiagram
participant SevenZip
participant ListProcess as 7z listing process
participant ExtractProcess as 7z extraction process
SevenZip->>ListProcess: start(l, -slt, archiveFile)
ListProcess-->>SevenZip: Path, Folder, Size output
SevenZip->>SevenZip: parseOversizeBootPaths(sltOutput)
alt oversized [BOOT] file detected
SevenZip->>ExtractProcess: extract archive with -x![BOOT]/path
else scan fails or no oversized entry
SevenZip->>ExtractProcess: extract archive without exclusion
end
ExtractProcess-->>SevenZip: extraction result
Flow diagram for identifying FAT32-incompatible boot entriesflowchart TD
A[7z l -slt archive] --> B[Parse Path, Folder, Size]
B --> C{"File under [BOOT]/?"}
C -- No --> D[Keep entry]
C -- Yes --> E{Size greater than 4GiB - 1?}
E -- No --> D
E -- Yes --> F[Add exact path to exclusion list]
F --> G[Extract ISO with -x! exclusions]
D --> G
A -. scan failure .-> H[Extract without exclusions]
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: LiHua000, lzwind The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
deepin pr auto reviewAI 代码审查报告项目: linuxdeepin/deepin-boot-maker 总体评分:97 分
审查结论: 代码审查通过 代码实现了排除超限 El Torito [BOOT] 条目的功能,逻辑清晰,注释完整,无安全漏洞。仅存在 waitForStarted/waitForFinished 无超时的轻微问题,与现有代码风格一致。 需求分析
修改文件
详细分析1. 语法逻辑(22/25)✓ 语法正确,逻辑清晰代码逻辑分析:
潜在问题:
2. 代码质量(25/25)✓ 代码结构清晰,注释完整代码质量分析:
测试覆盖: 新增 3 个测试用例覆盖了:新版 7-Zip 格式超限条目检测、旧版 p7zip 格式兼容、小条目(低于限制)保留。测试用例设计合理。 3. 代码性能(20/20)✓ 性能良好,资源使用合理性能分析:
4. 代码安全(30/30)✓ 存在0个安全漏洞安全分析:
安全漏洞详情: 未发现安全漏洞 漏洞对比统计:新增漏洞 0 个,减少漏洞 0 个,持平 0 个 改进建议建议 1:为 waitForStarted/waitForFinished 设置超时时间 文件: 当前代码使用无限超时,如果 7z 进程异常挂起会导致应用阻塞: // 修改前:
if (!listProcess.waitForStarted(-1) || !listProcess.waitForFinished(-1)) {
// 修改后:
if (!listProcess.waitForStarted(30000) || !listProcess.waitForFinished(60000)) {
qWarning() << "scan iso timed out, skip [BOOT] exclusion:" << listProcess.errorString();
return result;
}本报告由 AI 代码审查工具自动生成 |
|
/merge |
7z l -sltbefore extraction and exclude only [BOOT] entries larger than 4GiB-1 (the FAT32 single file limit)Log: Fix making bootable USB from large ISO images whose El Torito [BOOT] entry exceeds the FAT32 file size limit
Bug: https://pms.uniontech.com/bug-view-377229.html
Summary by Sourcery
Exclude oversized El Torito boot entries during ISO extraction to support creating bootable FAT32 USB media from large images.
Bug Fixes:
Enhancements:
Tests: