The mkuzip documentation says that you can just run the script at the start of an image it creates to mdconfig and mount the image. Those scripts don't work, for two reasons. First, the /dev/md0.<suffix> are created with a suffix of uzip, which is not what the scripts expect. Second, the .uzip images are ordinary read-only file systems, mounted with /sbin/mount; the script is trying to mount them using mount_cd9660, which isn't likely to work.
(In reply to Bill Blake from comment #0) Can you give the sequence of commands/configuration you're using? And demonstrate where it's going wrong and what you expect?
These are the commands and the resulting script that is put at the start of each out.img file: > mkuzip -A zstd -o out.img in.img #!/bin/sh #Z4.0 Format (kldstat -qm g_uzip||kldload geom_uzip)>&-&&mount_cd9660 /dev/`mdconfig -af $0`.uzip $1 exit $? > mkuzip -A lzma -o out.img in.img #!/bin/sh #L3.0 n=uncompress m=geom_$n (kldstat -m $m 2>&-||kldload $m)>&-&&mount_cd9660 /dev/`mdconfig -af $0`.$n $1 exit $? > mkuzip -A zlib -o out.img in.img #!/bin/sh #V2.0 Format (kldstat -qm g_uzip||kldload geom_uzip)>&-&&mount_cd9660 /dev/`mdconfig -af $0`.uzip $1 exit $? I can't speak to the kldstat/kldload stuff since I didn't actually run these scripts. However, look at the second example, which uses lzma. It tries to mount /dev/md*.uncompress. However, the mdconfig creates /dev/md*.uzip, so the mount fails. (I did the commands manually to confirm that this sequence doesn't work.) The other two correctly use the .uzip device. But in all three cases, the mount is mount_cd9660, which won't work since the file systems actually created are ufs file systems. They need "mount -o ro" instead. (Again, manually confirmed.) Also, a nitpick: The mdconfig calls should have an option "-o ro". Where it matters is when the config'd image is on a read-only file system; mdconfig will generate an error message without the read-only option, though it still configs the file.
(In reply to Bill Blake from comment #2) Alright, I see what you mean - thanks for the info. There seems to be a few issues here, I'll check it out. also, note that mdconfig has a "-o readonly" option
proposed fix https://reviews.freebsd.org/D43425