From 8b08e5f0686611b98157c85a5666125de066a148 Mon Sep 17 00:00:00 2001 From: Lionel Sambuc Date: Wed, 19 Nov 2014 10:54:14 +0100 Subject: [PATCH 1/4] Import a few manpages The following manpages where contributed by Jacob Adams : - atnormalize.8 - autopart.8 - decomp16.1 - devsize.8 - rawspeed.8 - rotate.8 - update_bootcfg.8 - updateboot.8 Change-Id: Ide3abf0962083b83e37426e2d47f3a9391d6315e --- distrib/sets/lists/minix/mi | 8 +++ minix/commands/atnormalize/Makefile | 2 +- minix/commands/atnormalize/atnormalize.8 | 20 +++++++ minix/commands/autopart/Makefile | 2 +- minix/commands/autopart/autopart.8 | 20 +++++++ minix/commands/decomp16/Makefile | 1 - minix/commands/decomp16/decomp16.1 | 55 +++++++++++++++++++ minix/commands/devsize/Makefile | 2 +- minix/commands/devsize/devsize.8 | 18 ++++++ minix/commands/rawspeed/Makefile | 2 +- minix/commands/rawspeed/rawspeed.8 | 30 ++++++++++ minix/commands/rotate/Makefile | 4 +- minix/commands/rotate/rotate.8 | 13 +++++ minix/commands/update_bootcfg/Makefile | 6 +- .../commands/update_bootcfg/update_bootcfg.8 | 18 ++++++ minix/commands/updateboot/Makefile | 6 +- minix/commands/updateboot/updateboot.8 | 19 +++++++ 17 files changed, 213 insertions(+), 13 deletions(-) create mode 100644 minix/commands/atnormalize/atnormalize.8 create mode 100644 minix/commands/autopart/autopart.8 create mode 100644 minix/commands/decomp16/decomp16.1 create mode 100644 minix/commands/devsize/devsize.8 create mode 100644 minix/commands/rawspeed/rawspeed.8 create mode 100644 minix/commands/rotate/rotate.8 create mode 100644 minix/commands/update_bootcfg/update_bootcfg.8 create mode 100644 minix/commands/updateboot/updateboot.8 diff --git a/distrib/sets/lists/minix/mi b/distrib/sets/lists/minix/mi index 98de10b36..51917725a 100644 --- a/distrib/sets/lists/minix/mi +++ b/distrib/sets/lists/minix/mi @@ -2384,6 +2384,7 @@ ./usr/man/man1/cut.1 minix-sys ./usr/man/man1/date.1 minix-sys ./usr/man/man1/dd.1 minix-sys +./usr/man/man1/decomp16.1 minix-sys ./usr/man/man1/deroff.1 minix-sys ./usr/man/man1/df.1 minix-sys ./usr/man/man1/dhrystone.1 minix-sys @@ -5193,6 +5194,8 @@ ./usr/man/man8 minix-sys ./usr/man/man8/add_route.8 minix-sys ./usr/man/man8/adduser.8 minix-sys +./usr/man/man8/atnormalize.8 minix-sys +./usr/man/man8/autopart.8 minix-sys ./usr/man/man8/backup.8 minix-sys ./usr/man/man8/boot.8 minix-sys ./usr/man/man8/btrace.8 minix-sys @@ -5202,6 +5205,7 @@ ./usr/man/man8/cleantmp.8 minix-sys ./usr/man/man8/config.8 minix-sys ./usr/man/man8/cron.8 minix-sys +./usr/man/man8/devsize.8 minix-sys ./usr/man/man8/dhcpd.8 minix-sys ./usr/man/man8/diskctl.8 minix-sys ./usr/man/man8/fbdctl.8 minix-sys @@ -5249,11 +5253,13 @@ ./usr/man/man8/pwdauth.8 minix-sys ./usr/man/man8/pwd_mkdb.8 minix-sys ./usr/man/man8/rarpd.8 minix-sys +./usr/man/man8/rawspeed.8 minix-sys ./usr/man/man8/rdate.8 minix-sys ./usr/man/man8/readclock.8 minix-sys ./usr/man/man8/reboot.8 minix-sys ./usr/man/man8/renice.8 minix-sys ./usr/man/man8/repartition.8 minix-sys +./usr/man/man8/rotate.8 minix-sys ./usr/man/man8/rshd.8 minix-sys ./usr/man/man8/screendump.8 minix-sys ./usr/man/man8/serial-ip.8 minix-sys @@ -5271,6 +5277,8 @@ ./usr/man/man8/unlink.8 minix-sys ./usr/man/man8/unstr.8 minix-sys ./usr/man/man8/update.8 minix-sys +./usr/man/man8/updateboot.8 minix-sys +./usr/man/man8/update_bootcfg.8 minix-sys ./usr/man/man8/usage.8 minix-sys ./usr/man/man8/user.8 minix-sys ./usr/man/man8/useradd.8 minix-sys diff --git a/minix/commands/atnormalize/Makefile b/minix/commands/atnormalize/Makefile index 4b4b9bba4..bb8d4f987 100644 --- a/minix/commands/atnormalize/Makefile +++ b/minix/commands/atnormalize/Makefile @@ -1,4 +1,4 @@ PROG= atnormalize -MAN= +MAN= atnormalize.8 .include diff --git a/minix/commands/atnormalize/atnormalize.8 b/minix/commands/atnormalize/atnormalize.8 new file mode 100644 index 000000000..5cd12b5a3 --- /dev/null +++ b/minix/commands/atnormalize/atnormalize.8 @@ -0,0 +1,20 @@ +.\" Based on http://osdir.com/ml/minix3/2010-01/msg00133.html +.TH man 8 "13 November 2014" "1.0" "atnormalize man page" +.SH NAME +atnormalize \- Reset disk drivers to normal settings + +.SH SYNOPSIS +atnormalize + +.SH DESCRIPTION +Resets the disk drivers to their normal settings in case a partitioning tool changes them. +Loops over all the disk devices and sends each a DIOCTIMEOUT with an argp of 0 + +.SH EXAMPLES +atnormalize + +.SH SEE ALSO +autopart(8),ioctl(2) + +.SH AUTHOR +Jacob Adams diff --git a/minix/commands/autopart/Makefile b/minix/commands/autopart/Makefile index 37ab9a324..e4fdd7a00 100644 --- a/minix/commands/autopart/Makefile +++ b/minix/commands/autopart/Makefile @@ -1,4 +1,4 @@ PROG= autopart -MAN= +MAN= autopart.8 .include diff --git a/minix/commands/autopart/autopart.8 b/minix/commands/autopart/autopart.8 new file mode 100644 index 000000000..68c1d7519 --- /dev/null +++ b/minix/commands/autopart/autopart.8 @@ -0,0 +1,20 @@ +.TH man 8 "13 November 2014" "1.0" "autopart man page" +.SH NAME +autopart \- Partition a hard disk for Minix installation + +.SH SYNOPSIS +autopart + +.SH DESCRIPTION +This tool is used as the third step in the install process. +It is not intended for use as a partitioning tool +Use part(8) instead. + +.SH EXAMPLES +autopart + +.SH SEE ALSO +part(8) + +.SH AUTHOR +Jacob Adams diff --git a/minix/commands/decomp16/Makefile b/minix/commands/decomp16/Makefile index 70f4d3cd9..de671e114 100644 --- a/minix/commands/decomp16/Makefile +++ b/minix/commands/decomp16/Makefile @@ -1,4 +1,3 @@ PROG= decomp16 -MAN= .include diff --git a/minix/commands/decomp16/decomp16.1 b/minix/commands/decomp16/decomp16.1 new file mode 100644 index 000000000..9d49aa9f7 --- /dev/null +++ b/minix/commands/decomp16/decomp16.1 @@ -0,0 +1,55 @@ +.TH man 1 "14 November 2014" "1.0" "decomp16 man page" +.PD 0 +.SH NAME +decomp16 \- decompress 16bit compressed files on a 16bit Intel processor + +.SH SYNOPSIS +decomp16 [-#] [in] [out] + +.SH OPTIONS +.IP -# +If given a switch -#, where # is a digit from 0 to 4 (example: -2), the +program will run as that copy, reading from stdin and writing to stdout. +This allows decompressing with very limited RAM because only one of the +five passes is in memory at a time. + +.IP in +File to decompress + +.IP out +File to output decompressed data to + +.SH DESCRIPTION +decompresses files compressed with compress(1) +This program works by forking four more copies of itself. The five +programs form a pipeline. Copy 0 writes to stdout, and forks copy 1 +to supply its input, which in turn forks and reads from copy 2, etc. +The arguments -0 to -4 run only the corresponding pass. +.P +Thus: +.P +decomp16 -4 < compressed_file > 3; +.P +decomp16 -3 < 3 > 2; +.P +decomp16 -2 < 2 > 1; +.P +decomp16 -1 < 1 > 0; +.P +decomp16 -0 < 0 > decompressed_file +.P +will also work, as will connecting the passes by explicit pipes if +there is enough memory to do so. + +.SH EXAMPLES +.P +decomp16 comp_file decomp_file # Decompresses comp_file to decomp_file. +.P +decomp16 < comp_file > decomp_file # Same as above but with output redirects. + + +.SH SEE ALSO +compress(1) + +.SH AUTHOR +Jacob Adams diff --git a/minix/commands/devsize/Makefile b/minix/commands/devsize/Makefile index e7f0eeefe..785d7b269 100644 --- a/minix/commands/devsize/Makefile +++ b/minix/commands/devsize/Makefile @@ -1,4 +1,4 @@ PROG= devsize -MAN= +MAN= devsize.8 .include diff --git a/minix/commands/devsize/devsize.8 b/minix/commands/devsize/devsize.8 new file mode 100644 index 000000000..33a4911ee --- /dev/null +++ b/minix/commands/devsize/devsize.8 @@ -0,0 +1,18 @@ +.TH man 8 "14 November 2014" "1.0" "devsize man page" +.SH NAME +devsize \- Prints size of device + +.SH SYNOPSIS +devsize + +.SH DESCRIPTION +Prints block size of device + +.SH EXAMPLES +devsize /dev/c0d1 + +.SH SEE ALSO +ioctl(2),part(8) + +.SH AUTHOR +Jacob Adams diff --git a/minix/commands/rawspeed/Makefile b/minix/commands/rawspeed/Makefile index 3d75a42df..a8fca19f9 100644 --- a/minix/commands/rawspeed/Makefile +++ b/minix/commands/rawspeed/Makefile @@ -1,4 +1,4 @@ PROG= rawspeed -MAN= +MAN= rawspeed.8 .include diff --git a/minix/commands/rawspeed/rawspeed.8 b/minix/commands/rawspeed/rawspeed.8 new file mode 100644 index 000000000..2cb61efe7 --- /dev/null +++ b/minix/commands/rawspeed/rawspeed.8 @@ -0,0 +1,30 @@ +.TH man 8 "14 November 2014" "1.0" "rawspeed man page" +.SH NAME +rawspeed \- Measure speed of a device + +.SH SYNOPSIS +rawspeed [-u unit] [-m max] [-t seconds] [-c] [-r limit] device +.SH OPTIONS +.IP -u +best sector multiple (default 2) + +.IP -m +read multiples of unit upto 'max' + +.IP -t +time to run test (default 10) + +.IP -c +cache test: rewind after each read or write of max size + +.IP -r +random seeks upto sector 'limit' before reading or writing + +.SH DESCRIPTION +Measures the speed of a given device. + +.SH EXAMPLES +rawspeed /dev/c0d1 + +.SH AUTHOR +Jacob Adams diff --git a/minix/commands/rotate/Makefile b/minix/commands/rotate/Makefile index b59ba3e5f..9660c4b53 100644 --- a/minix/commands/rotate/Makefile +++ b/minix/commands/rotate/Makefile @@ -1,4 +1,4 @@ -SCRIPTS= rotate.sh -MAN= +SCRIPTS= rotate.sh +MAN= rotate.8 .include diff --git a/minix/commands/rotate/rotate.8 b/minix/commands/rotate/rotate.8 new file mode 100644 index 000000000..1c99cab21 --- /dev/null +++ b/minix/commands/rotate/rotate.8 @@ -0,0 +1,13 @@ +.TH man 8 "14 November 2014" "1.0" "rotate man page" +.SH NAME +rotate \- rotate logs +.SH SYNOPSIS +rotate +.SH DESCRIPTION +Rotate logs +.SH EXAMPLES + +.SH SEE ALSO + +.SH AUTHOR +Jacob Adams diff --git a/minix/commands/update_bootcfg/Makefile b/minix/commands/update_bootcfg/Makefile index 1583e49ef..9c75de208 100644 --- a/minix/commands/update_bootcfg/Makefile +++ b/minix/commands/update_bootcfg/Makefile @@ -1,5 +1,5 @@ -SCRIPTS= update_bootcfg.sh -BINDIR= /bin -MAN= +SCRIPTS= update_bootcfg.sh +MAN= update_bootcfg.8 +BINDIR= /bin .include diff --git a/minix/commands/update_bootcfg/update_bootcfg.8 b/minix/commands/update_bootcfg/update_bootcfg.8 new file mode 100644 index 000000000..275fa95af --- /dev/null +++ b/minix/commands/update_bootcfg/update_bootcfg.8 @@ -0,0 +1,18 @@ +.TH man 8 "14 November 2014" "1.0" "update_bootcfg man page" +.SH NAME +update_bootcfg \- Update /boot.cfg + +.SH SYNOPSIS +update_bootcfg + +.SH DESCRIPTION +Updates /boot.cfg from /etc/boot.cfg.default and /etc/boot.cfg.local + +.SH EXAMPLES +update_bootcfg + +.SH SEE ALSO +boot.cfg(5) + +.SH AUTHOR +Jacob Adams diff --git a/minix/commands/updateboot/Makefile b/minix/commands/updateboot/Makefile index 81200bda1..e10395aba 100644 --- a/minix/commands/updateboot/Makefile +++ b/minix/commands/updateboot/Makefile @@ -1,5 +1,5 @@ -SCRIPTS= updateboot.sh -BINDIR= /bin -MAN= +SCRIPTS= updateboot.sh +MAN= updateboot.8 +BINDIR= /bin .include diff --git a/minix/commands/updateboot/updateboot.8 b/minix/commands/updateboot/updateboot.8 new file mode 100644 index 000000000..6283a3a75 --- /dev/null +++ b/minix/commands/updateboot/updateboot.8 @@ -0,0 +1,19 @@ +.TH man 8 "date" "1.0" "updateboot man page" +.SH NAME +updateboot \- Update boot monitor and bootstrap program + +.SH SYNOPSIS +updateboot + +.SH DESCRIPTION +Copies bootmonitor from /usr/mdec to /. +Installs bootstrap program bootxx_minixfs3 onto root device with installboot_nbsd + +.SH EXAMPLES +updateboot + +.SH SEE ALSO +updateboot_cfg(8) + +.SH AUTHOR +Jacob Adams From 637688ba55f9e6b6eeeb4b3bf67362423891af5b Mon Sep 17 00:00:00 2001 From: Jacob Adams Date: Wed, 19 Nov 2014 21:24:17 -0500 Subject: [PATCH 2/4] Changed manpages to reflect author's true status --- minix/commands/atnormalize/atnormalize.8 | 2 +- minix/commands/autopart/autopart.8 | 2 +- minix/commands/decomp16/decomp16.1 | 2 +- minix/commands/devsize/devsize.8 | 2 +- minix/commands/rawspeed/rawspeed.8 | 2 +- minix/commands/rotate/rotate.8 | 2 +- minix/commands/update_bootcfg/update_bootcfg.8 | 2 +- minix/commands/updateboot/updateboot.8 | 2 +- 8 files changed, 8 insertions(+), 8 deletions(-) diff --git a/minix/commands/atnormalize/atnormalize.8 b/minix/commands/atnormalize/atnormalize.8 index 5cd12b5a3..f397b59ac 100644 --- a/minix/commands/atnormalize/atnormalize.8 +++ b/minix/commands/atnormalize/atnormalize.8 @@ -17,4 +17,4 @@ atnormalize autopart(8),ioctl(2) .SH AUTHOR -Jacob Adams +Manpage written by Jacob Adams diff --git a/minix/commands/autopart/autopart.8 b/minix/commands/autopart/autopart.8 index 68c1d7519..106f360bb 100644 --- a/minix/commands/autopart/autopart.8 +++ b/minix/commands/autopart/autopart.8 @@ -17,4 +17,4 @@ autopart part(8) .SH AUTHOR -Jacob Adams +Manpage written by Jacob Adams diff --git a/minix/commands/decomp16/decomp16.1 b/minix/commands/decomp16/decomp16.1 index 9d49aa9f7..18dbee4e1 100644 --- a/minix/commands/decomp16/decomp16.1 +++ b/minix/commands/decomp16/decomp16.1 @@ -52,4 +52,4 @@ decomp16 < comp_file > decomp_file # Same as above but with output redirects. compress(1) .SH AUTHOR -Jacob Adams +Manpage written by Jacob Adams diff --git a/minix/commands/devsize/devsize.8 b/minix/commands/devsize/devsize.8 index 33a4911ee..56932234f 100644 --- a/minix/commands/devsize/devsize.8 +++ b/minix/commands/devsize/devsize.8 @@ -15,4 +15,4 @@ devsize /dev/c0d1 ioctl(2),part(8) .SH AUTHOR -Jacob Adams +Manpage written by Jacob Adams diff --git a/minix/commands/rawspeed/rawspeed.8 b/minix/commands/rawspeed/rawspeed.8 index 2cb61efe7..160d08ef2 100644 --- a/minix/commands/rawspeed/rawspeed.8 +++ b/minix/commands/rawspeed/rawspeed.8 @@ -27,4 +27,4 @@ Measures the speed of a given device. rawspeed /dev/c0d1 .SH AUTHOR -Jacob Adams +Manpage written by Jacob Adams diff --git a/minix/commands/rotate/rotate.8 b/minix/commands/rotate/rotate.8 index 1c99cab21..6fb18c170 100644 --- a/minix/commands/rotate/rotate.8 +++ b/minix/commands/rotate/rotate.8 @@ -10,4 +10,4 @@ Rotate logs .SH SEE ALSO .SH AUTHOR -Jacob Adams +Manpage written by Jacob Adams diff --git a/minix/commands/update_bootcfg/update_bootcfg.8 b/minix/commands/update_bootcfg/update_bootcfg.8 index 275fa95af..c9a32000f 100644 --- a/minix/commands/update_bootcfg/update_bootcfg.8 +++ b/minix/commands/update_bootcfg/update_bootcfg.8 @@ -15,4 +15,4 @@ update_bootcfg boot.cfg(5) .SH AUTHOR -Jacob Adams +Manpage written by Jacob Adams diff --git a/minix/commands/updateboot/updateboot.8 b/minix/commands/updateboot/updateboot.8 index 6283a3a75..94f4f2150 100644 --- a/minix/commands/updateboot/updateboot.8 +++ b/minix/commands/updateboot/updateboot.8 @@ -16,4 +16,4 @@ updateboot updateboot_cfg(8) .SH AUTHOR -Jacob Adams +Manpage written by Jacob Adams From 8a3135083fb2244379e9e86ef8f240a91a5a6c8c Mon Sep 17 00:00:00 2001 From: Jacob Adams Date: Sun, 1 Feb 2015 22:56:49 -0500 Subject: [PATCH 3/4] Use or instead of and to determine if urb is valid --- minix/lib/libddekit/src/usb_server.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/minix/lib/libddekit/src/usb_server.c b/minix/lib/libddekit/src/usb_server.c index df200435c..1ef3451b5 100644 --- a/minix/lib/libddekit/src/usb_server.c +++ b/minix/lib/libddekit/src/usb_server.c @@ -329,7 +329,7 @@ static void submit_urb(message *msg) DEBUG_MSG("URB type: %d", mx_urb->type); /* check if urb is valid */ - if (mx_urb->dev_id >= MAX_DEVS && mx_urb->dev_id < 0) { + if (mx_urb->dev_id >= MAX_DEVS || mx_urb->dev_id < 0) { DEBUG_MSG("Bogus device ID."); res = EINVAL; goto out; From a383f70f4682ca5fca3916076e7d85b8acec293f Mon Sep 17 00:00:00 2001 From: Jacob Adams Date: Sun, 1 Feb 2015 23:04:30 -0500 Subject: [PATCH 4/4] fix dead code block, make surrounding code more readable, and remove unused mode variable closes #20 --- minix/commands/autopart/autopart.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/minix/commands/autopart/autopart.c b/minix/commands/autopart/autopart.c index 4a47c3ad2..d94eab463 100644 --- a/minix/commands/autopart/autopart.c +++ b/minix/commands/autopart/autopart.c @@ -1521,7 +1521,7 @@ void regionize(void) void m_read(int ev, int *biosdrive) /* Read the partition table from the current device. */ { - int i, mode, n, v; + int i, n, v; struct part_entry *pe; u32_t system_hz; @@ -1531,8 +1531,8 @@ void m_read(int ev, int *biosdrive) stat_start(0); fflush(stdout); - if ((device= open(curdev->name, mode= O_RDWR, 0666)) < 0) { - if (device >= 0) { close(device); device= -1; } + device = open(curdev->name, O_RDWR, 0666); + if (device < 0) { return; }