From f30771f0e231fb50efee5c3821912ab97b690abe Mon Sep 17 00:00:00 2001 From: Zane Bitter Date: Thu, 18 Dec 2025 06:24:55 +1300 Subject: [PATCH 1/2] Upgrade go-diskfs from v1.4.1 to v1.7.0 Update to diskfs v1.7.0 to prepare for using the upstream fix for ISO 9660 filename extension truncation (PR #315). API changes: - diskfs.Create() no longer takes diskfs.Raw parameter - disk.Disk.File field replaced with disk.Disk.Backend All tests pass with the updated API. Assisted-by: Claude Code --- go.mod | 3 ++- go.sum | 6 ++++-- pkg/isoeditor/isoutil.go | 4 ++-- 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/go.mod b/go.mod index e2701124..e04cad03 100644 --- a/go.mod +++ b/go.mod @@ -6,7 +6,7 @@ toolchain go1.25.5 require ( github.com/cavaliercoder/go-cpio v0.0.0-20180626203310-925f9528c45e - github.com/diskfs/go-diskfs v1.4.1 + github.com/diskfs/go-diskfs v1.7.0 github.com/erofs/go-erofs v0.0.0-20250726210804-e84d089fc453 github.com/go-chi/chi/v5 v5.0.12 github.com/golang/mock v1.6.0 @@ -26,6 +26,7 @@ require ( ) require ( + github.com/anchore/go-lzo v0.1.0 // indirect github.com/beorn7/perks v1.0.1 // indirect github.com/cespare/xxhash/v2 v2.2.0 // indirect github.com/djherbis/times v1.6.0 // indirect diff --git a/go.sum b/go.sum index 63106cba..aad5b002 100644 --- a/go.sum +++ b/go.sum @@ -1,3 +1,5 @@ +github.com/anchore/go-lzo v0.1.0 h1:NgAacnzqPeGH49Ky19QKLBZEuFRqtTG9cdaucc3Vncs= +github.com/anchore/go-lzo v0.1.0/go.mod h1:3kLx0bve2oN1iDwgM1U5zGku1Tfbdb0No5qp1eL1fIk= github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM= github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw= github.com/cavaliercoder/go-cpio v0.0.0-20180626203310-925f9528c45e h1:hHg27A0RSSp2Om9lubZpiMgVbvn39bsUmW9U5h0twqc= @@ -8,8 +10,8 @@ github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ3 github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/diskfs/go-diskfs v1.4.1 h1:iODgkzHLmvXS+1VDztpW53T+dQm8GQzi20y9yUd5UCA= -github.com/diskfs/go-diskfs v1.4.1/go.mod h1:+tOkQs8CMMog6Nvljg8DGIxEXrgL48iyT3OM3IlSz74= +github.com/diskfs/go-diskfs v1.7.0 h1:vonWmt5CMowXwUc79jWyGrf2DIMeoOjkLlMnQYGVOs8= +github.com/diskfs/go-diskfs v1.7.0/go.mod h1:LhQyXqOugWFRahYUSw47NyZJPezFzB9UELwhpszLP/k= github.com/djherbis/times v1.6.0 h1:w2ctJ92J8fBvWPxugmXIv7Nz7Q3iDMKNx9v5ocVH20c= github.com/djherbis/times v1.6.0/go.mod h1:gOHeRAz2h+VJNZ5Gmc/o7iD9k4wW7NMVqieYCY99oc0= github.com/elliotwutingfeng/asciiset v0.0.0-20230602022725-51bbb787efab h1:h1UgjJdAAhj+uPL68n7XASS6bU+07ZX1WJvVS2eyoeY= diff --git a/pkg/isoeditor/isoutil.go b/pkg/isoeditor/isoutil.go index 078e4be2..f869a447 100644 --- a/pkg/isoeditor/isoutil.go +++ b/pkg/isoeditor/isoutil.go @@ -104,7 +104,7 @@ func Create(outPath string, workDir string, volumeLabel string) error { // we were writing to a particular partition on a device, but we are // not so the minimum iso size will work for us here minISOSize := 38 * 1024 - d, err := diskfs.Create(outPath, int64(minISOSize), diskfs.Raw, diskfs.SectorSizeDefault) + d, err := diskfs.Create(outPath, int64(minISOSize), diskfs.SectorSizeDefault) if err != nil { return err } @@ -353,7 +353,7 @@ func ReadFileFromISO(isoPath, filePath string) ([]byte, error) { // Gets directly the ISO 9660 filesystem (equivalent to GetFileSystem(0)). func GetISO9660FileSystem(d *disk.Disk) (filesystem.FileSystem, error) { - return iso9660.Read(d.File, d.Size, 0, 0) + return iso9660.Read(d.Backend, d.Size, 0, 0) } // fileEntry represents a single file to be added to a CPIO archive From 79361b7f11e9f18fdb58f9242bef2e738a11723e Mon Sep 17 00:00:00 2001 From: Zane Bitter Date: Thu, 18 Dec 2025 06:25:11 +1300 Subject: [PATCH 2/2] OCPBUGS-64929: Update to diskfs master with ISO 9660 extension fix Upgrade to diskfs master (commit 58541aa) which includes the fix to properly truncate file extensions to 3 characters for ISO 9660 Level 1 compatibility. This fixes the issue where coreos-installer couldn't find kargs.json because diskfs was creating KARGS.JSON (invalid 4-char extension) instead of KARGS.JSO (valid 3-char extension). With this fix, diskfs now correctly creates ISO 9660 short names with truncated extensions, making minimal ISOs compatible with tools like coreos-installer that access files using their ISO 9660 short names. Assisted-by: Claude Code --- go.mod | 4 ++-- go.sum | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/go.mod b/go.mod index e04cad03..e43441dc 100644 --- a/go.mod +++ b/go.mod @@ -6,7 +6,7 @@ toolchain go1.25.5 require ( github.com/cavaliercoder/go-cpio v0.0.0-20180626203310-925f9528c45e - github.com/diskfs/go-diskfs v1.7.0 + github.com/diskfs/go-diskfs v1.7.1-0.20251217162235-58541aa8f559 github.com/erofs/go-erofs v0.0.0-20250726210804-e84d089fc453 github.com/go-chi/chi/v5 v5.0.12 github.com/golang/mock v1.6.0 @@ -42,7 +42,7 @@ require ( github.com/prometheus/common v0.48.0 // indirect github.com/prometheus/procfs v0.12.0 // indirect github.com/rogpeppe/go-internal v1.11.0 // indirect - github.com/ulikunitz/xz v0.5.11 // indirect + github.com/ulikunitz/xz v0.5.15 // indirect golang.org/x/net v0.33.0 // indirect golang.org/x/sys v0.28.0 // indirect golang.org/x/text v0.21.0 // indirect diff --git a/go.sum b/go.sum index aad5b002..77d3ef54 100644 --- a/go.sum +++ b/go.sum @@ -10,8 +10,8 @@ github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ3 github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/diskfs/go-diskfs v1.7.0 h1:vonWmt5CMowXwUc79jWyGrf2DIMeoOjkLlMnQYGVOs8= -github.com/diskfs/go-diskfs v1.7.0/go.mod h1:LhQyXqOugWFRahYUSw47NyZJPezFzB9UELwhpszLP/k= +github.com/diskfs/go-diskfs v1.7.1-0.20251217162235-58541aa8f559 h1:rJpHpZwao2igQ9blNiq9xnxwRxExD8tbwhIDaLxydvQ= +github.com/diskfs/go-diskfs v1.7.1-0.20251217162235-58541aa8f559/go.mod h1:02SN/PNyJRmOlwuJ8FcE1OkPFcMPvAoFUZCAvsE3Ty4= github.com/djherbis/times v1.6.0 h1:w2ctJ92J8fBvWPxugmXIv7Nz7Q3iDMKNx9v5ocVH20c= github.com/djherbis/times v1.6.0/go.mod h1:gOHeRAz2h+VJNZ5Gmc/o7iD9k4wW7NMVqieYCY99oc0= github.com/elliotwutingfeng/asciiset v0.0.0-20230602022725-51bbb787efab h1:h1UgjJdAAhj+uPL68n7XASS6bU+07ZX1WJvVS2eyoeY= @@ -108,8 +108,8 @@ github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcU github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= github.com/thoas/go-funk v0.9.3 h1:7+nAEx3kn5ZJcnDm2Bh23N2yOtweO14bi//dvRtgLpw= github.com/thoas/go-funk v0.9.3/go.mod h1:+IWnUfUmFO1+WVYQWQtIJHeRRdaIyyYglZN7xzUPe4Q= -github.com/ulikunitz/xz v0.5.11 h1:kpFauv27b6ynzBNT/Xy+1k+fK4WswhN/6PN5WhFAGw8= -github.com/ulikunitz/xz v0.5.11/go.mod h1:nbz6k7qbPmH4IRqmfOplQw/tblSgqTqBwxkY0oWt/14= +github.com/ulikunitz/xz v0.5.15 h1:9DNdB5s+SgV3bQ2ApL10xRc35ck0DuIX/isZvIk+ubY= +github.com/ulikunitz/xz v0.5.15/go.mod h1:nbz6k7qbPmH4IRqmfOplQw/tblSgqTqBwxkY0oWt/14= github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.3.5/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=