diff --git a/Cargo.lock b/Cargo.lock index 485bcaa2b..c6d165004 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -64,22 +64,22 @@ dependencies = [ [[package]] name = "anstyle-query" -version = "1.1.4" +version = "1.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9e231f6134f61b71076a3eab506c379d4f36122f2af15a9ff04415ea4c3339e2" +checksum = "40c48f72fd53cd289104fc64099abca73db4166ad86ea0b4341abe65af83dadc" dependencies = [ - "windows-sys 0.60.2", + "windows-sys 0.61.2", ] [[package]] name = "anstyle-wincon" -version = "3.0.10" +version = "3.0.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3e0633414522a32ffaac8ac6cc8f748e090c5717661fddeea04219e2344f5f2a" +checksum = "291e6a250ff86cd4a820112fb8898808a366d8f9f58ce16d1f538353ad55747d" dependencies = [ "anstyle", "once_cell_polyfill", - "windows-sys 0.60.2", + "windows-sys 0.61.2", ] [[package]] @@ -90,9 +90,9 @@ checksum = "a23eb6b1614318a8071c9b2521f36b424b2c83db5eb3a0fead4a6c0809af6e61" [[package]] name = "async-compression" -version = "0.4.32" +version = "0.4.36" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5a89bce6054c720275ac2432fbba080a66a2106a44a1b804553930ca6909f4e0" +checksum = "98ec5f6c2f8bc326c994cb9e241cc257ddaba9afa8555a43cffbb5dd86efaa37" dependencies = [ "compression-codecs", "compression-core", @@ -248,7 +248,7 @@ dependencies = [ "etc-merge", "fn-error-context", "hex", - "indicatif 0.18.2", + "indicatif 0.18.3", "indoc", "libc", "liboverdrop", @@ -276,6 +276,7 @@ dependencies = [ "toml", "tracing", "uapi-version", + "unicode-width", "uuid", "xshell", ] @@ -345,9 +346,9 @@ dependencies = [ [[package]] name = "bumpalo" -version = "3.19.0" +version = "3.19.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "46c5e41b57b8bba42a04676d81cb89e9ee8e859a1a66f80a5a72e1cb76b34d43" +checksum = "5dd9dc738b7a8311c7ade152424974d8115f2cdad61e8dab8dac9f2362298510" [[package]] name = "byteorder" @@ -357,15 +358,15 @@ checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" [[package]] name = "bytes" -version = "1.10.1" +version = "1.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d71b6127be86fdcfddb610f7182ac57211d4b18a3e9c82eb2d17662f2227ad6a" +checksum = "b35204fbdc0b3f4446b89fc1ac2cf84a8a68971995d0bf2e925ec7cd960f9cb3" [[package]] name = "camino" -version = "1.2.1" +version = "1.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "276a59bf2b2c967788139340c9f0c5b12d7fd6630315c15c217e559de85d2609" +checksum = "e629a66d692cb9ff1a1c664e41771b3dcaf961985a9774c0eb0bd1b51cf60a48" dependencies = [ "serde_core", ] @@ -415,9 +416,9 @@ dependencies = [ [[package]] name = "cap-std-ext" -version = "4.0.6" +version = "4.0.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7770022cf9ca0e804cdc7725fa6be84a3721e5733ba889b3300689dcdb407fa1" +checksum = "6fe962d42e07c22aec2618191c3683412735b7e6dcd7bab2eec811ab4697c58e" dependencies = [ "cap-primitives", "cap-tempfile", @@ -441,9 +442,9 @@ dependencies = [ [[package]] name = "cc" -version = "1.2.45" +version = "1.2.51" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "35900b6c8d709fb1d854671ae27aeaa9eec2f8b01b364e1619a40da3e6fe2afe" +checksum = "7a0aeaff4ff1a90589618835a598e545176939b97874f7abc7851caa0618f203" dependencies = [ "find-msvc-tools", "jobserver", @@ -453,9 +454,9 @@ dependencies = [ [[package]] name = "cfg-expr" -version = "0.20.4" +version = "0.20.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9acd0bdbbf4b2612d09f52ba61da432140cb10930354079d0d53fafc12968726" +checksum = "21be0e1ce6cdb2ee7fff840f922fb04ead349e5cfb1e750b769132d44ce04720" dependencies = [ "smallvec", "target-lexicon", @@ -489,9 +490,9 @@ dependencies = [ [[package]] name = "clap" -version = "4.5.51" +version = "4.5.54" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4c26d721170e0295f191a69bd9a1f93efcdb0aff38684b61ab5750468972e5f5" +checksum = "c6e6ff9dcd79cff5cd969a17a545d79e84ab086e444102a591e288a8aa3ce394" dependencies = [ "clap_builder", "clap_derive", @@ -499,9 +500,9 @@ dependencies = [ [[package]] name = "clap_builder" -version = "4.5.51" +version = "4.5.54" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "75835f0c7bf681bfd05abe44e965760fea999a5286c6eb2d59883634fd02011a" +checksum = "fa42cf4d2b7a41bc8f663a7cab4031ebafa1bf3875705bfaf8466dc60ab52c00" dependencies = [ "anstream", "anstyle", @@ -527,7 +528,7 @@ dependencies = [ "heck", "proc-macro2", "quote", - "syn 2.0.109", + "syn 2.0.114", ] [[package]] @@ -572,7 +573,7 @@ checksum = "55b672471b4e9f9e95499ea597ff64941a309b2cdbffcc46f2cc5e2d971fd335" [[package]] name = "composefs" version = "0.3.0" -source = "git+https://github.com/containers/composefs-rs?rev=1498349e11d0e4bd545feab533f0b7ab5294ae9a#1498349e11d0e4bd545feab533f0b7ab5294ae9a" +source = "git+https://github.com/containers/composefs-rs?rev=49d4f50d6ba338edca26d799145a1283185f2466#49d4f50d6ba338edca26d799145a1283185f2466" dependencies = [ "anyhow", "hex", @@ -592,7 +593,7 @@ dependencies = [ [[package]] name = "composefs-boot" version = "0.3.0" -source = "git+https://github.com/containers/composefs-rs?rev=1498349e11d0e4bd545feab533f0b7ab5294ae9a#1498349e11d0e4bd545feab533f0b7ab5294ae9a" +source = "git+https://github.com/containers/composefs-rs?rev=49d4f50d6ba338edca26d799145a1283185f2466#49d4f50d6ba338edca26d799145a1283185f2466" dependencies = [ "anyhow", "composefs", @@ -605,7 +606,7 @@ dependencies = [ [[package]] name = "composefs-oci" version = "0.3.0" -source = "git+https://github.com/containers/composefs-rs?rev=1498349e11d0e4bd545feab533f0b7ab5294ae9a#1498349e11d0e4bd545feab533f0b7ab5294ae9a" +source = "git+https://github.com/containers/composefs-rs?rev=49d4f50d6ba338edca26d799145a1283185f2466#49d4f50d6ba338edca26d799145a1283185f2466" dependencies = [ "anyhow", "async-compression", @@ -622,9 +623,9 @@ dependencies = [ [[package]] name = "compression-codecs" -version = "0.4.31" +version = "0.4.35" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ef8a506ec4b81c460798f572caead636d57d3d7e940f998160f52bd254bf2d23" +checksum = "b0f7ac3e5b97fdce45e8922fb05cae2c37f7bbd63d30dd94821dacfd8f3f2bf2" dependencies = [ "compression-core", "flate2", @@ -635,9 +636,9 @@ dependencies = [ [[package]] name = "compression-core" -version = "0.4.29" +version = "0.4.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e47641d3deaf41fb1538ac1f54735925e275eaf3bf4d55c81b137fba797e5cbb" +checksum = "75984efb6ed102a0d42db99afb6c1948f0380d1d91808d5529916e6c08b49d8d" [[package]] name = "console" @@ -653,9 +654,9 @@ dependencies = [ [[package]] name = "console" -version = "0.16.1" +version = "0.16.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b430743a6eb14e9764d4260d4c0d8123087d504eeb9c48f2b2a5e810dd369df4" +checksum = "03e45a4a8926227e4197636ba97a9fc9b00477e9f4bd711395687c5f0734bec4" dependencies = [ "encode_unicode", "libc", @@ -705,9 +706,9 @@ dependencies = [ [[package]] name = "convert_case" -version = "0.7.1" +version = "0.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bb402b8d4c85569410425650ce3eddc7d698ed96d39a73f941b08fb63082f1e7" +checksum = "633458d4ef8c78b72454de2d54fd6ab2e60f9e02be22f3c6104cdc8a4e0fceb9" dependencies = [ "unicode-segmentation", ] @@ -765,9 +766,9 @@ dependencies = [ [[package]] name = "crypto-common" -version = "0.1.6" +version = "0.1.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1bfb12502f3fc46cca1bb51ac28df9d618d813cdc3d2f25b9fe775a34af26bb3" +checksum = "78c8292055d1c1df0cce5d180393dc8cce0abec0a7102adb6c7b1eef6016d60a" dependencies = [ "generic-array", "typenum", @@ -794,7 +795,7 @@ dependencies = [ "proc-macro2", "quote", "strsim", - "syn 2.0.109", + "syn 2.0.114", ] [[package]] @@ -805,7 +806,7 @@ checksum = "fc34b93ccb385b40dc71c6fceac4b2ad23662c7eeb248cf10d529b7e055b6ead" dependencies = [ "darling_core", "quote", - "syn 2.0.109", + "syn 2.0.114", ] [[package]] @@ -826,7 +827,7 @@ dependencies = [ "darling", "proc-macro2", "quote", - "syn 2.0.109", + "syn 2.0.114", ] [[package]] @@ -836,28 +837,29 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ab63b0e2bf4d5928aff72e83a7dace85d7bba5fe12dcc3c5a572d78caffd3f3c" dependencies = [ "derive_builder_core", - "syn 2.0.109", + "syn 2.0.114", ] [[package]] name = "derive_more" -version = "2.0.1" +version = "2.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "093242cf7570c207c83073cf82f79706fe7b8317e98620a47d5be7c3d8497678" +checksum = "d751e9e49156b02b44f9c1815bcb94b984cdcc4396ecc32521c739452808b134" dependencies = [ "derive_more-impl", ] [[package]] name = "derive_more-impl" -version = "2.0.1" +version = "2.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bda628edc44c4bb645fbe0f758797143e4e07926f7ebf4e9bdfbd3d2ce621df3" +checksum = "799a97264921d8623a957f6c3b9011f3b5492f557bbb7a5a19b7fa6d06ba8dcb" dependencies = [ "convert_case", "proc-macro2", "quote", - "syn 2.0.109", + "rustc_version", + "syn 2.0.114", ] [[package]] @@ -872,7 +874,7 @@ version = "0.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "25f104b501bf2364e78d0d3974cbc774f738f5865306ed128e1e0d7499c0ad96" dependencies = [ - "console 0.16.1", + "console 0.16.2", "shell-words", "tempfile", "zeroize", @@ -990,9 +992,9 @@ dependencies = [ [[package]] name = "find-msvc-tools" -version = "0.1.4" +version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "52051878f80a721bb68ebfbc930e07b65ba72f2da88968ea5c06fd6ca3d3a127" +checksum = "645cbb3a84e60b7531617d5ae4e57f7e27308f6445f5abf653209ea76dec8dff" [[package]] name = "flate2" @@ -1013,7 +1015,7 @@ checksum = "2cd66269887534af4b0c3e3337404591daa8dc8b9b2b3db71f9523beb4bafb41" dependencies = [ "proc-macro2", "quote", - "syn 2.0.109", + "syn 2.0.114", ] [[package]] @@ -1088,7 +1090,7 @@ checksum = "162ee34ebcb7c64a8abebc059ce0fee27c2262618d7b60ed8faf72fef13c3650" dependencies = [ "proc-macro2", "quote", - "syn 2.0.109", + "syn 2.0.114", ] [[package]] @@ -1119,9 +1121,9 @@ dependencies = [ [[package]] name = "generic-array" -version = "0.14.9" +version = "0.14.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4bb6743198531e02858aeaea5398fcc883e71851fcbcb5a2f773e2fb6cb1edf2" +checksum = "85649ca51fd72272d7821adaf274ad91c288277713d9c18820d8499a7ff69e9a" dependencies = [ "typenum", "version_check", @@ -1168,7 +1170,7 @@ dependencies = [ "proc-macro-error2", "proc-macro2", "quote", - "syn 2.0.109", + "syn 2.0.114", ] [[package]] @@ -1232,7 +1234,7 @@ dependencies = [ "proc-macro-crate", "proc-macro2", "quote", - "syn 2.0.109", + "syn 2.0.114", ] [[package]] @@ -1278,9 +1280,9 @@ dependencies = [ [[package]] name = "hashbrown" -version = "0.16.0" +version = "0.16.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5419bdc4f6a9207fbeba6d11b604d481addf78ecd10c11ad51e76c2f6482748d" +checksum = "841d1cc9bed7f9236f321df977030373f4a4163ae1a7dbfe1a51a2c1a51d9100" [[package]] name = "heck" @@ -1335,9 +1337,9 @@ checksum = "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39" [[package]] name = "indexmap" -version = "2.12.0" +version = "2.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6717a8d2a5a929a1a2eb43a12812498ed141a0bcfb7e8f7844fbdbe4303bba9f" +checksum = "7714e70437a7dc3ac8eb7e6f8df75fd8eb422675fc7678aff7364301092b1017" dependencies = [ "equivalent", "hashbrown", @@ -1360,11 +1362,11 @@ dependencies = [ [[package]] name = "indicatif" -version = "0.18.2" +version = "0.18.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ade6dfcba0dfb62ad59e59e7241ec8912af34fd29e0e743e3db992bd278e8b65" +checksum = "9375e112e4b463ec1b1c6c011953545c65a30164fbab5b581df32b3abf0dcb88" dependencies = [ - "console 0.16.1", + "console 0.16.2", "portable-atomic", "unicode-width", "unit-prefix", @@ -1425,9 +1427,9 @@ dependencies = [ [[package]] name = "itoa" -version = "1.0.15" +version = "1.0.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4a5f13b858c8d314ee3e8f639011f7ccefe71f97f96e50151fb991f267928e2c" +checksum = "92ecc6618181def0457392ccd0ee51198e065e016d1d527a7ac1b6dc7c1f09d2" [[package]] name = "jobserver" @@ -1441,9 +1443,9 @@ dependencies = [ [[package]] name = "js-sys" -version = "0.3.82" +version = "0.3.83" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b011eec8cc36da2aab2d5cff675ec18454fad408585853910a202391cf9f8e65" +checksum = "464a3709c7f55f1f721e5389aa6ea4e3bc6aba669353300af094b29ffbdde1d8" dependencies = [ "once_cell", "wasm-bindgen", @@ -1457,9 +1459,9 @@ checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe" [[package]] name = "libc" -version = "0.2.177" +version = "0.2.180" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2874a2af47a2325c2001a6e6fad9b16a53b802102b528163885171cf92b15976" +checksum = "bcc35a38544a891a5f7c865aca548a982ccb3b8650a5b06d0fd33a10283c56fc" [[package]] name = "liboverdrop" @@ -1472,13 +1474,13 @@ dependencies = [ [[package]] name = "libredox" -version = "0.1.10" +version = "0.1.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "416f7e718bdb06000964960ffa43b4335ad4012ae8b99060261aa4a8088d5ccb" +checksum = "3d0b95e02c851351f877147b7deea7b1afb1df71b63aa5f8270716e0c5720616" dependencies = [ "bitflags 2.10.0", "libc", - "redox_syscall", + "redox_syscall 0.7.0", ] [[package]] @@ -1513,9 +1515,9 @@ dependencies = [ [[package]] name = "libz-sys" -version = "1.1.22" +version = "1.1.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8b70e7a7df205e92a1a4cd9aaae7898dac0aa555503cc0a649494d0d60e7651d" +checksum = "15d118bbf3771060e7311cc7bb0545b01d08a8b4a7de949198dec1fa0ca1c0f7" dependencies = [ "cc", "pkg-config", @@ -1539,7 +1541,7 @@ checksum = "e5cec0ec4228b4853bb129c84dbf093a27e6c7a20526da046defc334a1b017f7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.109", + "syn 2.0.114", ] [[package]] @@ -1565,9 +1567,9 @@ dependencies = [ [[package]] name = "log" -version = "0.4.28" +version = "0.4.29" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "34080505efa8e45a4b816c349525ebe327ceaa8559756f0356cba97ef3bf7432" +checksum = "5e5032e24019045c762d3c0f28f5b6b8bbf38563a65908389bf7978758920897" [[package]] name = "mandown" @@ -1631,9 +1633,9 @@ dependencies = [ [[package]] name = "mio" -version = "1.1.0" +version = "1.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "69d83b0086dc8ecf3ce9ae2874b2d1290252e2a30720bea58a5c6639b0092873" +checksum = "a69bcab0ad47271a0234d9422b131806bf3968021e5dc9328caf2d4cd58557fc" dependencies = [ "libc", "log", @@ -1701,9 +1703,9 @@ checksum = "830b246a0e5f20af87141b25c173cd1b609bd7779a4617d6ec582abaf90870f3" [[package]] name = "oci-spec" -version = "0.8.3" +version = "0.8.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2eb4684653aeaba48dea019caa17b2773e1212e281d50b6fa759f36fe032239d" +checksum = "fc3da52b83ce3258fbf29f66ac784b279453c2ac3c22c5805371b921ede0d308" dependencies = [ "const_format", "derive_builder", @@ -1784,7 +1786,7 @@ checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c" dependencies = [ "proc-macro2", "quote", - "syn 2.0.109", + "syn 2.0.114", ] [[package]] @@ -1839,7 +1841,7 @@ dependencies = [ "gvariant", "hex", "indexmap", - "indicatif 0.18.2", + "indicatif 0.18.3", "indoc", "io-lifetimes 3.0.1", "libc", @@ -1902,7 +1904,7 @@ checksum = "2621685985a2ebf1c516881c026032ac7deafcda1a2c9b7850dc81e3dfcb64c1" dependencies = [ "cfg-if", "libc", - "redox_syscall", + "redox_syscall 0.5.18", "smallvec", "windows-link", ] @@ -1924,7 +1926,7 @@ checksum = "6e918e4ff8c4549eb882f14b3a4bc8c8bc93de829416eacf579f1207a8fbf861" dependencies = [ "proc-macro2", "quote", - "syn 2.0.109", + "syn 2.0.114", ] [[package]] @@ -1947,9 +1949,9 @@ checksum = "7edddbd0b52d732b21ad9a5fab5c704c14cd949e5e9a1ec5929a24fded1b904c" [[package]] name = "portable-atomic" -version = "1.11.1" +version = "1.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f84267b20a16ea918e43c6a88433c2d54fa145c92a811b5b047ccbe153674483" +checksum = "f89776e4d69bb58bc6993e99ffa1d11f228b839984854c7daeb5d37f87cbe950" [[package]] name = "ppv-lite86" @@ -1988,14 +1990,14 @@ dependencies = [ "proc-macro-error-attr2", "proc-macro2", "quote", - "syn 2.0.109", + "syn 2.0.114", ] [[package]] name = "proc-macro2" -version = "1.0.103" +version = "1.0.105" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5ee95bc4ef87b8d5ba32e8b7714ccc834865276eab0aed5c9958d00ec45f49e8" +checksum = "535d180e0ecab6268a3e718bb9fd44db66bbbc256257165fc699dadf70d16fe7" dependencies = [ "unicode-ident", ] @@ -2032,9 +2034,9 @@ dependencies = [ [[package]] name = "quote" -version = "1.0.42" +version = "1.0.43" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a338cc41d27e6cc6dce6cefc13a0729dfbb81c262b1f519331575dd80ef3067f" +checksum = "dc74d9a594b72ae6656596548f56f667211f8a97b3d4c3d467150794690dc40a" dependencies = [ "proc-macro2", ] @@ -2113,6 +2115,15 @@ dependencies = [ "bitflags 2.10.0", ] +[[package]] +name = "redox_syscall" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "49f3fe0889e69e2ae9e41f4d6c4c0181701d00e4697b356fb1f74173a5e0ee27" +dependencies = [ + "bitflags 2.10.0", +] + [[package]] name = "ref-cast" version = "1.0.25" @@ -2130,7 +2141,7 @@ checksum = "b7186006dcb21920990093f30e3dea63b7d6e977bf1256be20c3563a5db070da" dependencies = [ "proc-macro2", "quote", - "syn 2.0.109", + "syn 2.0.114", ] [[package]] @@ -2181,11 +2192,20 @@ version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "88f8660c1ff60292143c98d08fc6e2f654d722db50410e3f3797d40baaf9d8f3" +[[package]] +name = "rustc_version" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cfcb3a22ef46e85b45de6ee7e79d063319ebb6594faafcf1c225ea92ab6e9b92" +dependencies = [ + "semver", +] + [[package]] name = "rustix" -version = "1.1.2" +version = "1.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cd15f8a2c5551a84d56efdc1cd049089e409ac19a3072d5037a17fd70719ff3e" +checksum = "146c9e247ccc180c1f61615433868c99f3de3ae256a30a43b49f67c2d9171f34" dependencies = [ "bitflags 2.10.0", "errno", @@ -2212,15 +2232,15 @@ checksum = "b39cdef0fa800fc44525c84ccb54a029961a8215f9619753635a9c0d2538d46d" [[package]] name = "ryu" -version = "1.0.20" +version = "1.0.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "28d3b2b1366ec20994f1fd18c3c594f05c5dd4bc44d8bb0c1c632c8d6829481f" +checksum = "a50f4cf475b65d88e057964e0e9bb1f0aa9bbb2036dc65c64596b42932536984" [[package]] name = "schemars" -version = "1.1.0" +version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9558e172d4e8533736ba97870c4b2cd63f84b382a3d6eb063da41b91cce17289" +checksum = "54e910108742c57a770f492731f99be216a52fadd361b06c8fb59d74ccc267d2" dependencies = [ "chrono", "dyn-clone", @@ -2232,14 +2252,14 @@ dependencies = [ [[package]] name = "schemars_derive" -version = "1.1.0" +version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "301858a4023d78debd2353c7426dc486001bddc91ae31a76fb1f55132f7e2633" +checksum = "4908ad288c5035a8eb12cfdf0d49270def0a268ee162b75eeee0f85d155a7c45" dependencies = [ "proc-macro2", "quote", "serde_derive_internals", - "syn 2.0.109", + "syn 2.0.114", ] [[package]] @@ -2281,7 +2301,7 @@ checksum = "d540f220d3187173da220f885ab66608367b6574e925011a9353e4badda91d79" dependencies = [ "proc-macro2", "quote", - "syn 2.0.109", + "syn 2.0.114", ] [[package]] @@ -2292,7 +2312,7 @@ checksum = "18d26a20a969b9e3fdf2fc2d9f21eda6c40e2de84c9408bb5d3b05d499aae711" dependencies = [ "proc-macro2", "quote", - "syn 2.0.109", + "syn 2.0.114", ] [[package]] @@ -2307,22 +2327,22 @@ dependencies = [ [[package]] name = "serde_json" -version = "1.0.145" +version = "1.0.149" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "402a6f66d8c709116cf22f558eab210f5a50187f702eb4d7e5ef38d9a7f1c79c" +checksum = "83fc039473c5595ace860d8c4fafa220ff474b3fc6bfdb4293327f1a37e94d86" dependencies = [ "itoa", "memchr", - "ryu", "serde", "serde_core", + "zmij", ] [[package]] name = "serde_spanned" -version = "1.0.3" +version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e24345aa0fe688594e73770a5f6d1b216508b4f93484c0026d521acd30134392" +checksum = "f8bbf91e5a4d6315eee45e704372590b30e260ee83af6639d64557f51b067776" dependencies = [ "serde_core", ] @@ -2362,9 +2382,9 @@ dependencies = [ [[package]] name = "shell-words" -version = "1.1.0" +version = "1.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "24188a676b6ae68c3b2cb3a01be17fbf7240ce009799bb56d5b1409051e78fde" +checksum = "dc6fe69c597f9c37bfeeeeeb33da3530379845f10be461a66d16d03eca2ded77" [[package]] name = "shlex" @@ -2395,18 +2415,19 @@ dependencies = [ [[package]] name = "signal-hook-registry" -version = "1.4.6" +version = "1.4.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b2a4719bff48cee6b39d12c020eeb490953ad2443b7055bd0b21fca26bd8c28b" +checksum = "c4db69cba1110affc0e9f7bcd48bbf87b3f4fc7c61fc9155afd4c469eb3d6c1b" dependencies = [ + "errno", "libc", ] [[package]] name = "simd-adler32" -version = "0.3.7" +version = "0.3.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d66dc143e6b11c1eddc06d5c423cfc97062865baf299914ab64caa38182078fe" +checksum = "e320a6c5ad31d271ad523dcf3ad13e2767ad8b1cb8f047f75a8aeaf8da139da2" [[package]] name = "similar" @@ -2477,7 +2498,7 @@ dependencies = [ "heck", "proc-macro2", "quote", - "syn 2.0.109", + "syn 2.0.114", ] [[package]] @@ -2499,9 +2520,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.109" +version = "2.0.114" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2f17c7e013e88258aa9543dcbe81aca68a667a9ac37cd69c9fbc07858bfe0e2f" +checksum = "d4d107df263a3013ef9b1879b0df87d706ff80f65a86ea879bd9c31f9b307c2a" dependencies = [ "proc-macro2", "quote", @@ -2565,9 +2586,9 @@ checksum = "df7f62577c25e07834649fc3b39fafdc597c0a3527dc1c60129201ccfcbaa50c" [[package]] name = "tempfile" -version = "3.23.0" +version = "3.24.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2d31c77bdf42a745371d260a26ca7163f1e0924b64afa0b688e61b5a9fa02f16" +checksum = "655da9c7eb6305c55742045d5a8d2037996d61d8de95806335c7c86ce0f82e9c" dependencies = [ "fastrand", "getrandom 0.3.4", @@ -2624,7 +2645,7 @@ checksum = "4fee6c4efc90059e10f81e6d42c60a18f76588c3d74cb83a0b242a2b6c7504c1" dependencies = [ "proc-macro2", "quote", - "syn 2.0.109", + "syn 2.0.114", ] [[package]] @@ -2635,7 +2656,7 @@ checksum = "3ff15c8ecd7de3849db632e14d18d2571fa09dfc5ed93479bc4485c7a517c913" dependencies = [ "proc-macro2", "quote", - "syn 2.0.109", + "syn 2.0.114", ] [[package]] @@ -2655,9 +2676,9 @@ checksum = "e004df4c5f0805eb5f55883204a514cfa43a6d924741be29e871753a53d5565a" [[package]] name = "tokio" -version = "1.48.0" +version = "1.49.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ff360e02eab121e0bc37a2d3b4d4dc622e6eda3a8e5253d5435ecf5bd4c68408" +checksum = "72a2903cd7736441aac9df9d7688bd0ce48edccaadf181c3b90be801e81d3d86" dependencies = [ "bytes", "libc", @@ -2677,14 +2698,14 @@ checksum = "af407857209536a95c8e56f8231ef2c2e2aff839b22e07a1ffcbc617e9db9fa5" dependencies = [ "proc-macro2", "quote", - "syn 2.0.109", + "syn 2.0.114", ] [[package]] name = "tokio-stream" -version = "0.1.17" +version = "0.1.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eca58d7bba4a75707817a2c44174253f9236b2d5fbd055602e9d5c07c139a047" +checksum = "32da49809aab5c3bc678af03902d4ccddea2a87d028d86392a4b1560c6906c70" dependencies = [ "futures-core", "pin-project-lite", @@ -2694,9 +2715,9 @@ dependencies = [ [[package]] name = "tokio-util" -version = "0.7.17" +version = "0.7.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2efa149fe76073d6e8fd97ef4f4eca7b67f599660115591483572e406e165594" +checksum = "9ae9cec805b01e8fc3fd2fe289f89149a9b66dd16786abd8b19cfa7b48cb0098" dependencies = [ "bytes", "futures-core", @@ -2707,9 +2728,9 @@ dependencies = [ [[package]] name = "toml" -version = "0.9.8" +version = "0.9.10+spec-1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f0dc8b1fb61449e27716ec0e1bdf0f6b8f3e8f6b05391e8497b8b6d7804ea6d8" +checksum = "0825052159284a1a8b4d6c0c86cbc801f2da5afd2b225fa548c72f2e74002f48" dependencies = [ "indexmap", "serde_core", @@ -2722,18 +2743,18 @@ dependencies = [ [[package]] name = "toml_datetime" -version = "0.7.3" +version = "0.7.5+spec-1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f2cdb639ebbc97961c51720f858597f7f24c4fc295327923af55b74c3c724533" +checksum = "92e1cfed4a3038bc5a127e35a2d360f145e1f4b971b551a2ba5fd7aedf7e1347" dependencies = [ "serde_core", ] [[package]] name = "toml_edit" -version = "0.23.7" +version = "0.23.10+spec-1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6485ef6d0d9b5d0ec17244ff7eb05310113c3f316f2d14200d4de56b3cb98f8d" +checksum = "84c8b9f757e028cee9fa244aea147aab2a9ec09d5325a9b01e0a49730c2b5269" dependencies = [ "indexmap", "toml_datetime", @@ -2743,24 +2764,24 @@ dependencies = [ [[package]] name = "toml_parser" -version = "1.0.4" +version = "1.0.6+spec-1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c0cbe268d35bdb4bb5a56a2de88d0ad0eb70af5384a99d648cd4b3d04039800e" +checksum = "a3198b4b0a8e11f09dd03e133c0280504d0801269e9afa46362ffde1cbeebf44" dependencies = [ "winnow", ] [[package]] name = "toml_writer" -version = "1.0.4" +version = "1.0.6+spec-1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "df8b2b54733674ad286d16267dcfc7a71ed5c776e4ac7aa3c3e2561f7c637bf2" +checksum = "ab16f14aed21ee8bfd8ec22513f7287cd4a91aa92e44edfe2c17ddd004e92607" [[package]] name = "tracing" -version = "0.1.41" +version = "0.1.44" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "784e0ac535deb450455cbfa28a6f0df145ea1bb7ae51b821cf5e7927fdcfbdd0" +checksum = "63e71662fa4b2a2c3a26f570f037eb95bb1f85397f3cd8076caed2f026a6d100" dependencies = [ "pin-project-lite", "tracing-attributes", @@ -2769,20 +2790,20 @@ dependencies = [ [[package]] name = "tracing-attributes" -version = "0.1.30" +version = "0.1.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "81383ab64e72a7a8b8e13130c49e3dab29def6d0c7d76a03087b3cf71c5c6903" +checksum = "7490cfa5ec963746568740651ac6781f701c9c5ea257c58e057f3ba8cf69e8da" dependencies = [ "proc-macro2", "quote", - "syn 2.0.109", + "syn 2.0.114", ] [[package]] name = "tracing-core" -version = "0.1.34" +version = "0.1.36" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b9d12581f227e93f094d3af2ae690a574abb8a2b9b7a96e7cfe9647b2b617678" +checksum = "db97caf9d906fbde555dd62fa95ddba9eecfd14cb388e4f491a66d74cd5fb79a" dependencies = [ "once_cell", "valuable", @@ -2790,9 +2811,9 @@ dependencies = [ [[package]] name = "tracing-journald" -version = "0.3.1" +version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fc0b4143302cf1022dac868d521e36e8b27691f72c84b3311750d5188ebba657" +checksum = "2d3a81ed245bfb62592b1e2bc153e77656d94ee6a0497683a65a12ccaf2438d0" dependencies = [ "libc", "tracing-core", @@ -2812,9 +2833,9 @@ dependencies = [ [[package]] name = "tracing-subscriber" -version = "0.3.20" +version = "0.3.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2054a14f5307d601f88daf0553e1cbf472acc4f2c51afab632431cdcd72124d5" +checksum = "2f30143827ddab0d256fd843b7a66d164e9f271cfa0dde49142c5ca0ca291f1e" dependencies = [ "matchers", "nu-ansi-term", @@ -2842,9 +2863,9 @@ checksum = "849f6b1fe8a0fb07170737d7f3acf72cac5462fb3f4e86614474a49f7fac3b65" [[package]] name = "unicase" -version = "2.8.1" +version = "2.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "75b844d17643ee918803943289730bec8aac480150456169e647ed0b576ba539" +checksum = "dbc4bc3a9f746d862c45cb89d705aa10f187bb96c76001afab07a0d35ce60142" [[package]] name = "unicode-ident" @@ -2872,9 +2893,9 @@ checksum = "ebc1c04c71510c7f702b52b7c350734c9ff1295c464a03335b00bb84fc54f853" [[package]] name = "unit-prefix" -version = "0.5.1" +version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "323402cff2dd658f39ca17c789b502021b3f18707c91cdf22e3838e1b4023817" +checksum = "81e544489bf3d8ef66c953931f56617f423cd4b5494be343d9b9d3dda037b9a3" [[package]] name = "unsafe-libyaml" @@ -2890,21 +2911,21 @@ checksum = "06abde3611657adf66d383f00b093d7faecc7fa57071cce2578660c9f1010821" [[package]] name = "uuid" -version = "1.18.1" +version = "1.19.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2f87b8aa10b915a06587d0dec516c282ff295b475d94abf425d62b57710070a2" +checksum = "e2e054861b4bd027cd373e18e8d8d8e6548085000e41290d95ce0c373a654b4a" dependencies = [ "getrandom 0.3.4", "js-sys", - "serde", + "serde_core", "wasm-bindgen", ] [[package]] name = "uzers" -version = "0.12.1" +version = "0.12.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4df81ff504e7d82ad53e95ed1ad5b72103c11253f39238bcc0235b90768a97dd" +checksum = "0b8275fb1afee25b4111d2dc8b5c505dbbc4afd0b990cb96deb2d88bff8be18d" dependencies = [ "libc", "log", @@ -2951,9 +2972,9 @@ dependencies = [ [[package]] name = "wasm-bindgen" -version = "0.2.105" +version = "0.2.106" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "da95793dfc411fbbd93f5be7715b0578ec61fe87cb1a42b12eb625caa5c5ea60" +checksum = "0d759f433fa64a2d763d1340820e46e111a7a5ab75f993d1852d70b03dbb80fd" dependencies = [ "cfg-if", "once_cell", @@ -2964,9 +2985,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro" -version = "0.2.105" +version = "0.2.106" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "04264334509e04a7bf8690f2384ef5265f05143a4bff3889ab7a3269adab59c2" +checksum = "48cb0d2638f8baedbc542ed444afc0644a29166f1595371af4fecf8ce1e7eeb3" dependencies = [ "quote", "wasm-bindgen-macro-support", @@ -2974,22 +2995,22 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro-support" -version = "0.2.105" +version = "0.2.106" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "420bc339d9f322e562942d52e115d57e950d12d88983a14c79b86859ee6c7ebc" +checksum = "cefb59d5cd5f92d9dcf80e4683949f15ca4b511f4ac0a6e14d4e1ac60c6ecd40" dependencies = [ "bumpalo", "proc-macro2", "quote", - "syn 2.0.109", + "syn 2.0.114", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-shared" -version = "0.2.105" +version = "0.2.106" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "76f218a38c84bcb33c25ec7059b07847d465ce0e0a76b995e134a45adcb6af76" +checksum = "cbc538057e648b67f72a982e708d485b2efa771e1ac05fec311f9f63e5800db4" dependencies = [ "unicode-ident", ] @@ -3058,7 +3079,7 @@ checksum = "053e2e040ab57b9dc951b72c264860db7eb3b0200ba345b4e4c3b14f67855ddf" dependencies = [ "proc-macro2", "quote", - "syn 2.0.109", + "syn 2.0.114", ] [[package]] @@ -3069,7 +3090,7 @@ checksum = "3f316c4a2570ba26bbec722032c4099d8c8bc095efccdc15688708623367e358" dependencies = [ "proc-macro2", "quote", - "syn 2.0.109", + "syn 2.0.114", ] [[package]] @@ -3254,9 +3275,9 @@ checksum = "d6bbff5f0aada427a1e5a6da5f1f98158182f26556f345ac9e04d36d0ebed650" [[package]] name = "winnow" -version = "0.7.13" +version = "0.7.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "21a0236b59786fed61e2a80582dd500fe61f18b5dca67a4a067d0bc9039339cf" +checksum = "5a5364e9d77fcdeeaa6062ced926ee3381faa2ee02d3eb83a5c27a8825540829" dependencies = [ "memchr", ] @@ -3339,22 +3360,22 @@ checksum = "fdd20c5420375476fbd4394763288da7eb0cc0b8c11deed431a91562af7335d3" [[package]] name = "zerocopy" -version = "0.8.27" +version = "0.8.33" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0894878a5fa3edfd6da3f88c4805f4c8558e2b996227a3d864f47fe11e38282c" +checksum = "668f5168d10b9ee831de31933dc111a459c97ec93225beb307aed970d1372dfd" dependencies = [ "zerocopy-derive", ] [[package]] name = "zerocopy-derive" -version = "0.8.27" +version = "0.8.33" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "88d2b8d9c68ad2b9e4340d7832716a4d21a22a1154777ad56ea55c51a9cf3831" +checksum = "2c7962b26b0a8685668b671ee4b54d007a67d4eaf05fda79ac0ecf41e32270f1" dependencies = [ "proc-macro2", "quote", - "syn 2.0.109", + "syn 2.0.114", ] [[package]] @@ -3363,6 +3384,12 @@ version = "1.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b97154e67e32c85465826e8bcc1c59429aaaf107c1e4a9e53c8d8ccd5eff88d0" +[[package]] +name = "zmij" +version = "1.0.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2fc5a66a20078bf1251bde995aa2fdcc4b800c70b5d92dd2c62abc5c60f679f8" + [[package]] name = "zstd" version = "0.13.3" diff --git a/Cargo.toml b/Cargo.toml index 3a862ca1f..129877546 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -42,9 +42,9 @@ clap = "4.5.4" clap_mangen = { version = "0.2.20" } # Reviewers (including AI tools): The composefs-rs git revision is duplicated for each crate. # If adding/removing crates here, also update docs/Dockerfile.mdbook and docs/src/internals.md. -composefs = { git = "https://github.com/containers/composefs-rs", rev = "1498349e11d0e4bd545feab533f0b7ab5294ae9a", package = "composefs", features = ["rhel9"] } -composefs-boot = { git = "https://github.com/containers/composefs-rs", rev = "1498349e11d0e4bd545feab533f0b7ab5294ae9a", package = "composefs-boot" } -composefs-oci = { git = "https://github.com/containers/composefs-rs", rev = "1498349e11d0e4bd545feab533f0b7ab5294ae9a", package = "composefs-oci" } +composefs = { git = "https://github.com/containers/composefs-rs", rev = "49d4f50d6ba338edca26d799145a1283185f2466", package = "composefs", features = ["rhel9"] } +composefs-boot = { git = "https://github.com/containers/composefs-rs", rev = "49d4f50d6ba338edca26d799145a1283185f2466", package = "composefs-boot" } +composefs-oci = { git = "https://github.com/containers/composefs-rs", rev = "49d4f50d6ba338edca26d799145a1283185f2466", package = "composefs-oci" } fn-error-context = "0.2.1" hex = "0.4.3" indicatif = "0.18.0" diff --git a/crates/lib/src/bootc_composefs/export.rs b/crates/lib/src/bootc_composefs/export.rs index cef2c3ec9..307ee518a 100644 --- a/crates/lib/src/bootc_composefs/export.rs +++ b/crates/lib/src/bootc_composefs/export.rs @@ -3,17 +3,15 @@ use std::{fs::File, os::fd::AsRawFd}; use anyhow::{Context, Result}; use cap_std_ext::cap_std::{ambient_authority, fs::Dir}; use composefs::splitstream::SplitStreamData; +use composefs_oci::open_config; use ocidir::{oci_spec::image::Platform, OciDir}; use ostree_ext::container::skopeo; -use ostree_ext::{container::Transport, oci_spec::image::ImageConfiguration}; +use ostree_ext::container::Transport; use tar::EntryType; use crate::image::get_imgrefs_for_copy; use crate::{ - bootc_composefs::{ - status::{get_composefs_status, get_imginfo}, - update::str_to_sha256digest, - }, + bootc_composefs::status::{get_composefs_status, get_imginfo}, store::{BootedComposefs, Storage}, }; @@ -52,8 +50,7 @@ pub async fn export_repo_to_image( let imginfo = get_imginfo(storage, &depl_verity, None).await?; - let config_name = &imginfo.manifest.config().digest().digest(); - let config_name = str_to_sha256digest(config_name)?; + let config_digest = imginfo.manifest.config().digest().digest(); let var_tmp = Dir::open_ambient_dir("/var/tmp", ambient_authority()).context("Opening /var/tmp")?; @@ -61,12 +58,9 @@ pub async fn export_repo_to_image( let tmpdir = cap_std_ext::cap_tempfile::tempdir_in(&var_tmp)?; let oci_dir = OciDir::ensure(tmpdir.try_clone()?).context("Opening OCI")?; - let mut config_stream = booted_cfs - .repo - .open_stream(&hex::encode(config_name), None) - .context("Opening config stream")?; - - let config = ImageConfiguration::from_reader(&mut config_stream)?; + // Use composefs_oci::open_config to get the config and layer map + let (config, layer_map) = + open_config(&*booted_cfs.repo, config_digest, None).context("Opening config")?; // We can't guarantee that we'll get the same tar stream as the container image // So we create new config and manifest @@ -82,12 +76,12 @@ pub async fn export_repo_to_image( let total_layers = config.rootfs().diff_ids().len(); for (idx, old_diff_id) in config.rootfs().diff_ids().iter().enumerate() { - let layer_sha256 = str_to_sha256digest(old_diff_id)?; - let layer_verity = config_stream.lookup(&layer_sha256)?; + // Look up the layer verity from the map + let layer_verity = layer_map + .get(old_diff_id.as_str()) + .ok_or_else(|| anyhow::anyhow!("Layer {old_diff_id} not found in config"))?; - let mut layer_stream = booted_cfs - .repo - .open_stream(&hex::encode(layer_sha256), Some(layer_verity))?; + let mut layer_stream = booted_cfs.repo.open_stream("", Some(layer_verity), None)?; let mut layer_writer = oci_dir.create_layer(None)?; layer_writer.follow_symlinks(false); @@ -120,7 +114,7 @@ pub async fn export_repo_to_image( let size = header.entry_size()?; - match layer_stream.read_exact(size as usize, ((size + 511) & !511) as usize)? { + match layer_stream.read_exact(size as usize, ((size as usize) + 511) & !511)? { SplitStreamData::External(obj_id) => match header.entry_type() { EntryType::Regular | EntryType::Continuous => { let file = File::from(booted_cfs.repo.open_object(&obj_id)?); diff --git a/crates/lib/src/bootc_composefs/repo.rs b/crates/lib/src/bootc_composefs/repo.rs index f97f76f44..16a735b49 100644 --- a/crates/lib/src/bootc_composefs/repo.rs +++ b/crates/lib/src/bootc_composefs/repo.rs @@ -3,10 +3,7 @@ use std::sync::Arc; use anyhow::{Context, Result}; -use ostree_ext::composefs::{ - fsverity::{FsVerityHashValue, Sha512HashValue}, - util::Sha256Digest, -}; +use ostree_ext::composefs::fsverity::{FsVerityHashValue, Sha512HashValue}; use ostree_ext::composefs_boot::{bootloader::BootEntry as ComposefsBootEntry, BootOps}; use ostree_ext::composefs_oci::{ image::create_filesystem as create_composefs_filesystem, pull as composefs_oci_pull, @@ -26,7 +23,7 @@ pub(crate) fn open_composefs_repo(rootfs_dir: &Dir) -> Result Result<(Sha256Digest, impl FsVerityHashValue)> { +) -> Result<(String, impl FsVerityHashValue)> { let rootfs_dir = &root_setup.physical_root; rootfs_dir @@ -94,11 +91,11 @@ pub(crate) async fn pull_composefs_repo( .await .context("Pulling composefs repo")?; - tracing::info!("ID: {}, Verity: {}", hex::encode(id), verity.to_hex()); + tracing::info!("ID: {id}, Verity: {}", verity.to_hex()); let repo = open_composefs_repo(&rootfs_dir)?; let mut fs: crate::store::ComposefsFilesystem = - create_composefs_filesystem(&repo, &hex::encode(id), None) + create_composefs_filesystem(&repo, &id, None) .context("Failed to create composefs filesystem")?; let entries = fs.transform_for_boot(&repo)?; diff --git a/crates/lib/src/bootc_composefs/update.rs b/crates/lib/src/bootc_composefs/update.rs index d910e7350..409cac6c4 100644 --- a/crates/lib/src/bootc_composefs/update.rs +++ b/crates/lib/src/bootc_composefs/update.rs @@ -1,10 +1,7 @@ use anyhow::{Context, Result}; use camino::Utf8PathBuf; use cap_std_ext::cap_std::fs::Dir; -use composefs::{ - fsverity::{FsVerityHashValue, Sha512HashValue}, - util::{parse_sha256, Sha256Digest}, -}; +use composefs::fsverity::{FsVerityHashValue, Sha512HashValue}; use composefs_boot::BootOps; use composefs_oci::image::create_filesystem; use fn_error_context::context; @@ -28,12 +25,6 @@ use crate::{ store::{BootedComposefs, ComposefsRepository, Storage}, }; -#[context("Getting SHA256 Digest for {id}")] -pub fn str_to_sha256digest(id: &str) -> Result { - let id = id.strip_prefix("sha256:").unwrap_or(id); - Ok(parse_sha256(&id)?) -} - /// Checks if a container image has been pulled to the local composefs repository. /// /// This function verifies whether the specified container image exists in the local @@ -61,10 +52,9 @@ pub(crate) async fn is_image_pulled( let img_config_manifest = get_container_manifest_and_config(&imgref_repr).await?; let img_digest = img_config_manifest.manifest.config().digest().digest(); - let img_sha256 = str_to_sha256digest(&img_digest)?; - // check_stream is expensive to run, but probably a good idea - let container_pulled = repo.check_stream(&img_sha256).context("Checking stream")?; + // NB: add deep checking? + let container_pulled = repo.has_stream(img_digest).context("Checking stream")?; Ok((container_pulled, img_config_manifest)) } diff --git a/crates/lib/src/cfsctl.rs b/crates/lib/src/cfsctl.rs deleted file mode 100644 index 63a005d58..000000000 --- a/crates/lib/src/cfsctl.rs +++ /dev/null @@ -1,372 +0,0 @@ -use std::{ - ffi::OsString, - fs::{create_dir_all, File}, - io::BufWriter, - path::{Path, PathBuf}, - sync::Arc, -}; - -use anyhow::{Context, Result}; -use camino::Utf8PathBuf; -use clap::{Parser, Subcommand}; - -use rustix::fs::CWD; - -use composefs_boot::{write_boot, BootOps}; - -use composefs::{ - dumpfile, - fsverity::{FsVerityHashValue, Sha512HashValue}, - repository::Repository, -}; - -/// cfsctl -#[derive(Debug, Parser)] -#[clap(name = "cfsctl", version)] -pub struct App { - #[clap(long, group = "repopath")] - repo: Option, - #[clap(long, group = "repopath")] - user: bool, - #[clap(long, group = "repopath")] - system: bool, - - /// Sets the repository to insecure before running any operation and - /// prepend '?' to the composefs kernel command line when writing - /// boot entry. - #[clap(long)] - insecure: bool, - - #[clap(subcommand)] - cmd: Command, -} - -#[derive(Debug, Subcommand)] -enum OciCommand { - /// Stores a tar file as a splitstream in the repository. - ImportLayer { - sha256: String, - name: Option, - }, - /// Lists the contents of a tar stream - LsLayer { - /// the name of the stream - name: String, - }, - Dump { - config_name: String, - config_verity: Option, - }, - Pull { - image: String, - name: Option, - }, - ComputeId { - config_name: String, - config_verity: Option, - #[clap(long)] - bootable: bool, - }, - CreateImage { - config_name: String, - config_verity: Option, - #[clap(long)] - bootable: bool, - #[clap(long)] - image_name: Option, - }, - Seal { - config_name: String, - config_verity: Option, - }, - Mount { - name: String, - mountpoint: String, - }, - PrepareBoot { - config_name: String, - config_verity: Option, - #[clap(long, default_value = "/boot")] - bootdir: PathBuf, - #[clap(long)] - entry_id: Option, - #[clap(long)] - cmdline: Vec, - }, -} - -#[derive(Debug, Subcommand)] -enum Command { - /// Take a transaction lock on the repository. - /// This prevents garbage collection from occurring. - Transaction, - /// Reconstitutes a split stream and writes it to stdout - Cat { - /// the name of the stream to cat, either a sha256 digest or prefixed with 'ref/' - name: String, - }, - /// Perform garbage collection - GC, - /// Imports a composefs image (unsafe!) - ImportImage { - reference: String, - }, - /// Commands for dealing with OCI layers - Oci { - #[clap(subcommand)] - cmd: OciCommand, - }, - /// Mounts a composefs, possibly enforcing fsverity of the image - Mount { - /// the name of the image to mount, either a sha256 digest or prefixed with 'ref/' - name: String, - /// the mountpoint - mountpoint: String, - }, - CreateImage { - path: PathBuf, - #[clap(long)] - bootable: bool, - #[clap(long)] - stat_root: bool, - image_name: Option, - }, - ComputeId { - path: PathBuf, - /// Write the dumpfile to the provided target - #[clap(long)] - write_dumpfile_to: Option, - #[clap(long)] - bootable: bool, - #[clap(long)] - stat_root: bool, - }, - CreateDumpfile { - path: PathBuf, - #[clap(long)] - bootable: bool, - #[clap(long)] - stat_root: bool, - }, - ImageObjects { - name: String, - }, -} - -fn verity_opt(opt: &Option) -> Result> { - Ok(opt.as_ref().map(FsVerityHashValue::from_hex).transpose()?) -} - -pub(crate) async fn run_from_iter(args: I) -> Result<()> -where - I: IntoIterator, - I::Item: Into + Clone, -{ - let args = App::parse_from( - std::iter::once(OsString::from("cfs")).chain(args.into_iter().map(Into::into)), - ); - - let repo = if let Some(path) = &args.repo { - let mut r = Repository::open_path(CWD, path)?; - r.set_insecure(args.insecure); - Arc::new(r) - } else if args.user { - let mut r = Repository::open_user()?; - r.set_insecure(args.insecure); - Arc::new(r) - } else { - if args.insecure { - anyhow::bail!("Cannot override insecure state for system repo"); - } - let system_store = crate::cli::get_storage().await?; - system_store.get_ensure_composefs()? - }; - let repo = &repo; - - match args.cmd { - Command::Transaction => { - // just wait for ^C - loop { - std::thread::park(); - } - } - Command::Cat { name } => { - repo.merge_splitstream(&name, None, &mut std::io::stdout())?; - } - Command::ImportImage { reference } => { - let image_id = repo.import_image(&reference, &mut std::io::stdin())?; - println!("{}", image_id.to_id()); - } - Command::Oci { cmd: oci_cmd } => match oci_cmd { - OciCommand::ImportLayer { name, sha256 } => { - let object_id = composefs_oci::import_layer( - &repo, - &composefs::util::parse_sha256(sha256)?, - name.as_deref(), - &mut std::io::stdin(), - )?; - println!("{}", object_id.to_id()); - } - OciCommand::LsLayer { name } => { - composefs_oci::ls_layer(&repo, &name)?; - } - OciCommand::Dump { - ref config_name, - ref config_verity, - } => { - let verity = verity_opt(config_verity)?; - let mut fs = - composefs_oci::image::create_filesystem(&repo, config_name, verity.as_ref())?; - fs.print_dumpfile()?; - } - OciCommand::ComputeId { - ref config_name, - ref config_verity, - bootable, - } => { - let verity = verity_opt(config_verity)?; - let mut fs = - composefs_oci::image::create_filesystem(&repo, config_name, verity.as_ref())?; - if bootable { - fs.transform_for_boot(&repo)?; - } - let id = fs.compute_image_id(); - println!("{}", id.to_hex()); - } - OciCommand::CreateImage { - ref config_name, - ref config_verity, - bootable, - ref image_name, - } => { - let verity = verity_opt(config_verity)?; - let mut fs = - composefs_oci::image::create_filesystem(&repo, config_name, verity.as_ref())?; - if bootable { - fs.transform_for_boot(&repo)?; - } - let image_id = fs.commit_image(&repo, image_name.as_deref())?; - println!("{}", image_id.to_id()); - } - OciCommand::Pull { ref image, name } => { - let (sha256, verity) = - composefs_oci::pull(&repo, image, name.as_deref(), None).await?; - - println!("sha256 {}", hex::encode(sha256)); - println!("verity {}", verity.to_hex()); - } - OciCommand::Seal { - ref config_name, - ref config_verity, - } => { - let verity = verity_opt(config_verity)?; - let (sha256, verity) = composefs_oci::seal(&repo, config_name, verity.as_ref())?; - println!("sha256 {}", hex::encode(sha256)); - println!("verity {}", verity.to_id()); - } - OciCommand::Mount { - ref name, - ref mountpoint, - } => { - composefs_oci::mount(&repo, name, mountpoint, None)?; - } - OciCommand::PrepareBoot { - ref config_name, - ref config_verity, - ref bootdir, - ref entry_id, - ref cmdline, - } => { - let verity = verity_opt(config_verity)?; - let mut fs = - composefs_oci::image::create_filesystem(&repo, config_name, verity.as_ref())?; - let entries = fs.transform_for_boot(&repo)?; - let id = fs.commit_image(&repo, None)?; - - let Some(entry) = entries.into_iter().next() else { - anyhow::bail!("No boot entries!"); - }; - - let cmdline_refs: Vec<&str> = cmdline.iter().map(String::as_str).collect(); - write_boot::write_boot_simple( - &repo, - entry, - &id, - args.insecure, - bootdir, - None, - entry_id.as_deref(), - &cmdline_refs, - )?; - - let state = args - .repo - .as_ref() - .map(|p: &PathBuf| p.parent().unwrap_or(p)) - .unwrap_or(Path::new("/sysroot")) - .join("state/deploy") - .join(id.to_hex()); - - create_dir_all(state.join("var"))?; - create_dir_all(state.join("etc/upper"))?; - create_dir_all(state.join("etc/work"))?; - } - }, - Command::ComputeId { - ref path, - write_dumpfile_to, - bootable, - stat_root, - } => { - let mut fs = composefs::fs::read_filesystem(CWD, path, Some(&repo), stat_root)?; - if bootable { - fs.transform_for_boot(&repo)?; - } - let id = fs.compute_image_id(); - println!("{}", id.to_hex()); - if let Some(path) = write_dumpfile_to.as_deref() { - let mut w = File::create(path) - .with_context(|| format!("Opening {path}")) - .map(BufWriter::new)?; - dumpfile::write_dumpfile(&mut w, &fs).context("Writing dumpfile")?; - } - } - Command::CreateImage { - ref path, - bootable, - stat_root, - ref image_name, - } => { - let mut fs = composefs::fs::read_filesystem(CWD, path, Some(&repo), stat_root)?; - if bootable { - fs.transform_for_boot(&repo)?; - } - let id = fs.commit_image(&repo, image_name.as_deref())?; - println!("{}", id.to_id()); - } - Command::CreateDumpfile { - ref path, - bootable, - stat_root, - } => { - let mut fs = composefs::fs::read_filesystem(CWD, path, Some(&repo), stat_root)?; - if bootable { - fs.transform_for_boot(&repo)?; - } - fs.print_dumpfile()?; - } - Command::Mount { name, mountpoint } => { - repo.mount_at(&name, &mountpoint)?; - } - Command::ImageObjects { name } => { - let objects = repo.objects_for_image(&name)?; - for object in objects { - println!("{}", object.to_id()); - } - } - Command::GC => { - repo.gc()?; - } - } - Ok(()) -} diff --git a/crates/lib/src/cli.rs b/crates/lib/src/cli.rs index ad284b940..6a70ecaf6 100644 --- a/crates/lib/src/cli.rs +++ b/crates/lib/src/cli.rs @@ -1710,13 +1710,15 @@ async fn run_from_opt(opt: Opt) -> Result<()> { let storage = get_storage().await?; let cfs = storage.get_ensure_composefs()?; let testdata = b"some test data"; - let testdata_digest = openssl::sha::sha256(testdata); - let mut w = SplitStreamWriter::new(&cfs, None, Some(testdata_digest)); + let testdata_digest = hex::encode(openssl::sha::sha256(testdata)); + let mut w = SplitStreamWriter::new(&cfs, 0); w.write_inline(testdata); - let object = cfs.write_stream(w, Some("testobject"))?.to_hex(); + let object = cfs + .write_stream(w, &testdata_digest, Some("testobject"))? + .to_hex(); assert_eq!( object, - "5d94ceb0b2bb3a78237e0a74bc030a262239ab5f47754a5eb2e42941056b64cb21035d64a8f7c2f156e34b820802fa51884de2b1f7dc3a41b9878fc543cd9b07" + "dc31ae5d2f637e98d2171821d60d2fcafb8084d6a4bb3bd9cdc7ad41decce6e48f85d5413d22371d36b223945042f53a2a6ab449b8e45d8896ba7d8694a16681" ); Ok(()) } @@ -1737,7 +1739,7 @@ async fn run_from_opt(opt: Opt) -> Result<()> { Ok(()) } }, - InternalsOpts::Cfs { args } => crate::cfsctl::run_from_iter(args.iter()).await, + InternalsOpts::Cfs { args } => Err(Command::new("cfsctl").args(args).exec().into()), InternalsOpts::Reboot => crate::reboot::reboot(), InternalsOpts::Fsck => { let storage = &get_storage().await?; diff --git a/crates/lib/src/install.rs b/crates/lib/src/install.rs index 993bea730..fa8ecd8a8 100644 --- a/crates/lib/src/install.rs +++ b/crates/lib/src/install.rs @@ -1729,9 +1729,9 @@ async fn install_to_filesystem_impl( // Load a fd for the mounted target physical root let (id, verity) = initialize_composefs_repository(state, rootfs).await?; - tracing::info!("id: {}, verity: {}", hex::encode(id), verity.to_hex()); + tracing::info!("id: {id}, verity: {}", verity.to_hex()); - setup_composefs_boot(rootfs, state, &hex::encode(id)).await?; + setup_composefs_boot(rootfs, state, &id).await?; } else { ostree_install(state, rootfs, cleanup).await?; } diff --git a/crates/lib/src/lib.rs b/crates/lib/src/lib.rs index 9f8a0d31f..f908acbcb 100644 --- a/crates/lib/src/lib.rs +++ b/crates/lib/src/lib.rs @@ -8,7 +8,6 @@ mod bootc_composefs; pub(crate) mod bootc_kargs; mod bootloader; mod boundimage; -mod cfsctl; pub mod cli; mod composefs_consts; mod containerenv; diff --git a/hack/lbi/usr/share/containers/systemd/curl-base.image b/hack/lbi/curl-base.image similarity index 100% rename from hack/lbi/usr/share/containers/systemd/curl-base.image rename to hack/lbi/curl-base.image diff --git a/hack/lbi/usr/share/containers/systemd/curl.container b/hack/lbi/curl.container similarity index 100% rename from hack/lbi/usr/share/containers/systemd/curl.container rename to hack/lbi/curl.container diff --git a/hack/lbi/usr/share/containers/systemd/jboss-webserver-5.image b/hack/lbi/jboss-webserver-5.image similarity index 100% rename from hack/lbi/usr/share/containers/systemd/jboss-webserver-5.image rename to hack/lbi/jboss-webserver-5.image diff --git a/hack/lbi/usr/share/containers/systemd/podman.image b/hack/lbi/podman.image similarity index 100% rename from hack/lbi/usr/share/containers/systemd/podman.image rename to hack/lbi/podman.image diff --git a/hack/provision-derived.sh b/hack/provision-derived.sh index 029f9fc4f..c7f165729 100755 --- a/hack/provision-derived.sh +++ b/hack/provision-derived.sh @@ -127,7 +127,7 @@ fi # for testing bootc install on Fedora CoreOS where these would conflict. if test -z "${SKIP_CONFIGS:-}"; then # For test-22-logically-bound-install - cp -a lbi/usr/. /usr + install -D -m 0644 -t /usr/share/containers/systemd/ lbi/* for x in curl.container curl-base.image podman.image; do ln -s /usr/share/containers/systemd/$x /usr/lib/bootc/bound-images.d/$x done