diff --git a/usr.bin/mkuzip/mkuz_lzma.h b/usr.bin/mkuzip/mkuz_lzma.h index abdcc996e4c3..de7633c395ca 100644 --- a/usr.bin/mkuzip/mkuz_lzma.h +++ b/usr.bin/mkuzip/mkuz_lzma.h @@ -25,17 +25,11 @@ * SUCH DAMAGE. */ -/* Format L3.0, since we move to XZ API */ -#define CLOOP_MAGIC_LZMA \ - "#!/bin/sh\n" \ - "#L3.0\n" \ - "n=uncompress\n" \ - "m=geom_$n\n" \ - "(kldstat -m $m 2>&-||kldload $m)>&-&&" \ - "mount_cd9660 /dev/`mdconfig -af $0`.$n $1\n" \ - "exit $?\n" #define DEFAULT_SUFX_LZMA ".ulzma" +/* Format L3.0, since we move to XZ API */ +#define CLOOP_MAGIC_LZMA "#!/bin/sh\n#L3.0\n" + size_t mkuz_lzma_cbound(size_t); void *mkuz_lzma_init(int *); void mkuz_lzma_compress(void *, const struct mkuz_blk *, struct mkuz_blk *); diff --git a/usr.bin/mkuzip/mkuz_zlib.h b/usr.bin/mkuzip/mkuz_zlib.h index 88e68343a27d..5ecf77bb7284 100644 --- a/usr.bin/mkuzip/mkuz_zlib.h +++ b/usr.bin/mkuzip/mkuz_zlib.h @@ -26,9 +26,7 @@ #define DEFAULT_SUFX_ZLIB ".uzip" -#define CLOOP_MAGIC_ZLIB "#!/bin/sh\n#V2.0 Format\n" \ - "(kldstat -qm g_uzip||kldload geom_uzip)>&-&&" \ - "mount_cd9660 /dev/`mdconfig -af $0`.uzip $1\nexit $?\n" +#define CLOOP_MAGIC_ZLIB "#!/bin/sh\n#V2.0 Format\n" size_t mkuz_zlib_cbound(size_t); void *mkuz_zlib_init(int *); diff --git a/usr.bin/mkuzip/mkuz_zstd.h b/usr.bin/mkuzip/mkuz_zstd.h index b434afe61eee..ca62d3afd417 100644 --- a/usr.bin/mkuzip/mkuz_zstd.h +++ b/usr.bin/mkuzip/mkuz_zstd.h @@ -27,9 +27,7 @@ #define DEFAULT_SUFX_ZSTD ".uzst" -#define CLOOP_MAGIC_ZSTD "#!/bin/sh\n#Z4.0 Format\n" \ - "(kldstat -qm g_uzip||kldload geom_uzip)>&-&&" \ - "mount_cd9660 /dev/`mdconfig -af $0`.uzip $1\nexit $?\n" +#define CLOOP_MAGIC_ZSTD "#!/bin/sh\n#Z4.0 Format\n" size_t mkuz_zstd_cbound(size_t); void *mkuz_zstd_init(int *); diff --git a/usr.bin/mkuzip/mkuzip.8 b/usr.bin/mkuzip/mkuzip.8 index 6f7495ce5418..3b3afc626633 100644 --- a/usr.bin/mkuzip/mkuzip.8 +++ b/usr.bin/mkuzip/mkuzip.8 @@ -207,23 +207,6 @@ The same tradeoff continues to apply: reads in .Xr geom_uzip 4 become more expensive the greater the cluster size. .Pp -The -.Nm -utility -inserts a short shell script at the beginning of the generated image, -which makes it possible to -.Dq run -the image just like any other shell script. -The script tries to load the -.Xr geom_uzip 4 -class if it is not loaded, configure the image as an -.Xr md 4 -disk device using -.Xr mdconfig 8 , -and automatically mount it using -.Xr mount_cd9660 8 -on the mount point provided as the first argument to the script. -.Pp The de-duplication is a .Fx specific feature and while it does not require any changes to on-disk @@ -247,6 +230,34 @@ for .Dq 1 . .Sh EXIT STATUS .Ex -std +.Sh EXAMPLES +.Pp +The following describes how to create and mount a uzip image. +.Pp +Create a file system image: +.Bd -literal -offset indent +makefs /src.img /usr/src +.Ed +.Pp +Create the uzip image, the output file will be named src.img.uzip: +.Bd -literal -offset indent +mkuzip /src.img +.Ed +.Pp +Ensure geom_uzip is loaded: +.Bd -literal -offset indent +kldload geom_uzip +.Ed +.Pp +Create an MD device backed by the uzip image: +.Bd -literal -offset indent +mdconfig -f /src.img.uzip +.Ed +.Pp +Mount the uzip image: +.Bd -literal -offset indent +mount -o ro /dev/md0.uzip /mnt +.Ed .Sh SEE ALSO .Xr gzip 1 , .Xr xz 1 , diff --git a/usr.bin/mkuzip/mkuzip.c b/usr.bin/mkuzip/mkuzip.c index f627562af7df..5d2aa9a48a98 100644 --- a/usr.bin/mkuzip/mkuzip.c +++ b/usr.bin/mkuzip/mkuzip.c @@ -298,7 +298,7 @@ int main(int argc, char **argv) toc[hdr.nblocks] = 0; cfs.fdw = open(oname, (cfs.en_dedup ? O_RDWR : O_WRONLY) | O_TRUNC | O_CREAT, - S_IRWXU | S_IRGRP | S_IXGRP | S_IROTH | S_IXOTH); + S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH); if (cfs.fdw < 0) { err(1, "open(%s)", oname); /* Not reached */