diff --git a/sys/compat/linux/linux_ioctl.c b/sys/compat/linux/linux_ioctl.c index aa2c9ce7f273..ceb17bd040b5 100644 --- a/sys/compat/linux/linux_ioctl.c +++ b/sys/compat/linux/linux_ioctl.c @@ -421,6 +421,8 @@ bsd_to_linux_termios(struct termios *bios, struct linux_termios *lios) lios->c_iflag |= LINUX_IXOFF; if (bios->c_iflag & IMAXBEL) lios->c_iflag |= LINUX_IMAXBEL; + if (bios->c_iflag & IUTF8) + lios->c_iflag |= LINUX_IUTF8; lios->c_oflag = 0; if (bios->c_oflag & OPOST) @@ -538,6 +540,8 @@ linux_to_bsd_termios(struct linux_termios *lios, struct termios *bios) bios->c_iflag |= IXOFF; if (lios->c_iflag & LINUX_IMAXBEL) bios->c_iflag |= IMAXBEL; + if (lios->c_iflag & LINUX_IUTF8) + bios->c_iflag |= IUTF8; bios->c_oflag = 0; if (lios->c_oflag & LINUX_OPOST) diff --git a/sys/compat/linux/linux_ioctl.h b/sys/compat/linux/linux_ioctl.h index 4ef6d4f40830..ccc25bc919ab 100644 --- a/sys/compat/linux/linux_ioctl.h +++ b/sys/compat/linux/linux_ioctl.h @@ -462,6 +462,7 @@ #define LINUX_IXOFF 0x0001000 #define LINUX_IMAXBEL 0x0002000 +#define LINUX_IUTF8 0x0004000 /* Linux c_oflag masks */ #define LINUX_OPOST 0x0000001 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 */ diff --git a/usr.sbin/usbdump/usbdump.8 b/usr.sbin/usbdump/usbdump.8 index 33b759e3406d..96be9f738e2d 100644 --- a/usr.sbin/usbdump/usbdump.8 +++ b/usr.sbin/usbdump/usbdump.8 @@ -37,6 +37,7 @@ .Op Fl i Ar ifname .Op Fl r Ar file .Op Fl s Ar snaplen +.Op Fl u .Op Fl v .Op Fl w Ar file .Op Fl f Ar filter @@ -89,6 +90,8 @@ This option also works with the -f option. Snapshot .Ar snaplen bytes from each packet. +.It Fl u +Unbuffered output. .It Fl v Enable debugging messages. When defined multiple times the verbosity level increases. diff --git a/usr.sbin/usbdump/usbdump.c b/usr.sbin/usbdump/usbdump.c index 9c4b6c67c07d..887e2baeed26 100644 --- a/usr.sbin/usbdump/usbdump.c +++ b/usr.sbin/usbdump/usbdump.c @@ -829,7 +829,7 @@ main(int argc, char *argv[]) const char *optstring; char *pp; - optstring = "b:d:hi:r:s:vw:f:"; + optstring = "b:d:hi:r:s:uvw:f:"; while ((o = getopt(argc, argv, optstring)) != -1) { switch (o) { case 'b': @@ -899,6 +899,10 @@ main(int argc, char *argv[]) if (snapshot == 0) snapshot = -1; break; + case 'u': + setbuf(stdout, NULL); + setbuf(stderr, NULL); + break; case 'v': verbose++; break;