diff --git a/xorriso-dd-target/xorriso-dd-target b/xorriso-dd-target/xorriso-dd-target index 0410baad..6275dcf7 100755 --- a/xorriso-dd-target/xorriso-dd-target +++ b/xorriso-dd-target/xorriso-dd-target @@ -76,8 +76,11 @@ print_usage() { echo " -list_all Print list of all found devices with advice, vendor" echo " and model. One per line. Ignore any device names." echo " Ignore -DO_WRITE." - echo " -with_vendor_model Print vendor and model with each submitted device." - echo + echo " -list_long With each line printed by -list_all or a submitted" + echo " device name, let lsblk print info which led to the" + echo " shown reasons." + echo " -with_vendor_model Print vendor and model with each submitted device" + echo " name." echo " -max_size n[M|G|T] Set upper byte size limit for advisable devices." echo " Plain numbers get rounded down to full millions." echo " Suffix: M = million, G = billion, T = trillion." @@ -162,7 +165,6 @@ check_parameter() { reset_job() { list_all= do_list_long= - do_list_long_after= show_reasons= look_for_iso= devs= @@ -215,12 +217,9 @@ arg_interpreter() { list_all=y with_vendor_model=y show_reasons=y - elif test "$i" = "-list_long_inline" + elif test "$i" = "-list_long" then do_list_long=y - elif test "$i" = "-list_long_after" - then - do_list_long_after=y elif test "$i" = "-plug_test" then do_plug_test=y @@ -308,12 +307,7 @@ list_long() { then return 0 fi - local_list_devs= - for i in "$@" - do - local_list_devs="${local_list_devs}/dev/$i " - done - $sudo_cmd "$lsblk_cmd" -o NAME,SIZE,FSTYPE,TRAN,LABEL $local_list_devs + $sudo_cmd "$lsblk_cmd" -o NAME,SIZE,FSTYPE,TRAN,LABEL /dev/"$1" echo } @@ -588,12 +582,6 @@ list_devices() { fi fi done - if test -n "$show_reasons" -a -n "$do_list_long_after" - then - echo - do_list_long=y - list_long $devs - fi return 0; } diff --git a/xorriso-dd-target/xorriso-dd-target.1 b/xorriso-dd-target/xorriso-dd-target.1 index 3a8108d8..e5809f52 100644 --- a/xorriso-dd-target/xorriso-dd-target.1 +++ b/xorriso-dd-target/xorriso-dd-target.1 @@ -9,7 +9,7 @@ .\" First parameter, NAME, should be all caps .\" Second parameter, SECTION, should be 1-8, maybe w/ subsection .\" other parameters are allowed: see man(7), man(1) -.TH XORRISO-DD-TARGET 1 "Version 1.5.3, Dec 6, 2019" +.TH XORRISO-DD-TARGET 1 "Version 1.5.3, Dec 7, 2019" .\" Please adjust this date whenever revising the manpage. .\" .\" Some roff macros, for reference: @@ -35,9 +35,9 @@ xorriso\-dd\-target \- Device evaluator and disk image copier for GNU/Linux evaluates block devices of the Linux kernel whether they are suitable targets for a disk image file and optionally copies the image file to one of them. .br -It is specialized on the device names of the Linux kernel and uses the -capabilities of util\-linux program lsblk. Therefore it refuses to run on -non\-Linux kernels. +It is specialized on the device names of the \fBLinux kernel\fR and uses the +capabilities of util\-linux program \fBlsblk\fR. +Therefore it refuses to run on non\-Linux kernels. .br .PP The main purpose of xorriso\-dd\-target is to inspect the device files @@ -79,6 +79,9 @@ and without options \-list_all, \-plug_test, \-DO_WRITE, \-dummy_force. It prints on standard output (stdout) only the names of advisable devices without "/dev/" prefix. One name per line and without any reasoning text. .br +The possible sudo password prompt, the message line about sudo, and the +empty line after it do not go to stdout. +.br Example: .br $ xorriso\-dd\-target \-with_sudo @@ -95,7 +98,8 @@ sde .br For the more curious user, there is option \fB\-list_all\fR which prints the evaluation of each disk\-like device that is listed by program lsblk. -Optical drives, floppy disks, RAM block devices are excluded, though. +Optical drives, floppy disks, RAM block devices, loop devices are excluded, +though. .br Each device is shown by one line of the form .br @@ -115,6 +119,9 @@ the presence of an ISO 9660 filesystem on the device. .br \fBinfo\fR is composed from VENDOR and MODEL as told by lsblk. .br +Option \fB\-list_long\fR causes with each line an additional listing of +the information provided by lsblk which led to the shown reasons. +.br Example: .br $ xorriso\-dd\-target \-with_sudo \-list_all @@ -135,8 +142,9 @@ If \fBdevice names\fR are given instead of option \-list_all, then only these devices are inspected. Their result gets listed without the ": info" part, unless option \fB\-with_vendor_model\fR is given. .br -Device names must not begin by '\-' and must be single words. They must -not contain '/'. E.g. 'sdc' is valid, '/dev/sdc' is not valid. +Device names must not begin by '\-' and must be single words composed of +the characters [A\-za\-z0\-9_/\-]. They should not contain '/'. E.g. 'sdc' is +valid, '/dev/sdc' is not valid. .br If one of the given device names gets not advised, the exit value is 1. .br @@ -357,7 +365,7 @@ A given device name looks like the name of a loop device: loop[0\-9]*. .br \fBlooks_like_ramdev\-\fR .br -A given device name looks like the name of a ram block device: zram[0\-9]*. +A given device name looks like the name of a RAM block device: zram[0\-9]*. .br \fBlsblk_no_size\-\fR .br @@ -428,6 +436,11 @@ begin. Print list of all found devices with advice, vendor and model. One per line. Ignore any device names. Ignore \-DO_WRITE. .TP +\fB\-list_long\fR +After each result line, which shows reasons, add an additional listing of +the information provided by lsblk which led to the reasons and add an empty +line. +.TP \fB\-with_vendor_model\fR Print vendor and model with each submitted device name. .TP @@ -495,7 +508,7 @@ please send electronic mail to the public list . If more privacy is desired, mail to . .br Please describe what you expect the program to do, the program arguments -which you used, the messages of \fBxorrisodd\-target\fR, and the +which you used, the messages of \fBxorriso\-dd\-target\fR, and the undesirable outcome of your program run. .br Expect to get asked more questions before solutions can be proposed. diff --git a/xorriso-dd-target/xorriso-dd-target.info b/xorriso-dd-target/xorriso-dd-target.info index bb91cbee..55a92f81 100644 --- a/xorriso-dd-target/xorriso-dd-target.info +++ b/xorriso-dd-target/xorriso-dd-target.info @@ -39,8 +39,8 @@ File: xorriso-dd-target.info, Node: Overview, Next: Options, Prev: Top, Up: 'xorriso-dd-target' evaluates block devices of the Linux kernel whether they are suitable targets for a disk image file and optionally copies the image file to one of them. -It is specialized on the device names of the Linux kernel and uses the -capabilities of util-linux program lsblk. Therefore it refuses to run +It is specialized on the device names of the *Linux kernel* and uses the +capabilities of util-linux program *lsblk*. Therefore it refuses to run on non-Linux kernels. The main purpose of xorriso-dd-target is to inspect the device files @@ -80,6 +80,8 @@ names and without options -list_all, -plug_test, -DO_WRITE, -dummy_force. It prints on standard output (stdout) only the names of advisable devices without "/dev/" prefix. One name per line and without any reasoning text. +The possible sudo password prompt, the message line about sudo, and the +empty line after it do not go to stdout. Example: $ xorriso-dd-target -with_sudo Testing sudo to possibly get password prompting done now: @@ -96,7 +98,8 @@ File: xorriso-dd-target.info, Node: Listall, Next: Givendevices, Prev: Simple For the more curious user, there is option *-list_all* which prints the evaluation of each disk-like device that is listed by program lsblk. -Optical drives, floppy disks, RAM block devices are excluded, though. +Optical drives, floppy disks, RAM block devices, loop devices are +excluded, though. Each device is shown by one line of the form name : advice : reasoning : info *name* is the device name without "/dev/" prefix. @@ -110,6 +113,8 @@ advisable. Only if option -look_for_iso is given, a reason "has_XYZ-" can be overridden by the presence of an ISO 9660 filesystem on the device. *info* is composed from VENDOR and MODEL as told by lsblk. +Option *-list_long* causes with each line an additional listing of the +information provided by lsblk which led to the shown reasons. Example: $ xorriso-dd-target -with_sudo -list_all ... @@ -127,8 +132,9 @@ File: xorriso-dd-target.info, Node: Givendevices, Next: Plugtest, Prev: Lista If *device names* are given instead of option -list_all, then only these devices are inspected. Their result gets listed without the ": info" part, unless option *-with_vendor_model* is given. -Device names must not begin by '-' and must be single words. They must -not contain '/'. E.g. 'sdc' is valid, '/dev/sdc' is not valid. +Device names must not begin by '-' and must be single words composed of +the characters [A-za-z0-9_/-]. They should not contain '/'. E.g. +'sdc' is valid, '/dev/sdc' is not valid. If one of the given device names gets not advised, the exit value is 1. It makes few sense to give device names which are not listed by -list_all. @@ -292,7 +298,7 @@ fd[0-9]*. *looks_like_loopdev-* A given device name looks like the name of a loop device: loop[0-9]*. *looks_like_ramdev-* -A given device name looks like the name of a ram block device: +A given device name looks like the name of a RAM block device: zram[0-9]*. *lsblk_no_size-* A size test is given by -max_size, -min_size, or -image_file but the @@ -340,6 +346,10 @@ File: xorriso-dd-target.info, Node: Options, Next: Examples, Prev: Overview, -list_all Print list of all found devices with advice, vendor and model. One per line. Ignore any device names. Ignore -DO_WRITE. +-list_long + After each result line, which shows reasons, add an additional + listing of the information provided by lsblk which led to the + reasons and add an empty line. -with_vendor_model Print vendor and model with each submitted device name. -max_size n[M|G|T] @@ -418,7 +428,7 @@ To report bugs, request help, or suggest enhancements for . Please describe what you expect the program to do, the program -arguments which you used, the messages of 'xorrisodd-target', and the +arguments which you used, the messages of 'xorriso-dd-target', and the undesirable outcome of your program run. Expect to get asked more questions before solutions can be proposed. @@ -460,18 +470,19 @@ File: xorriso-dd-target.info, Node: CommandIdx, Next: ConceptIdx, Prev: Legal [index] * Menu: -* -DO_WRITE write image file to device: Options. (line 44) -* -dummy report but do not perform: Options. (line 51) -* -dummy_force show raw copy commands: Options. (line 53) -* -help print help text to stdout: Options. (line 57) -* -image_file set path of disk image file: Options. (line 41) +* -DO_WRITE write image file to device: Options. (line 48) +* -dummy report but do not perform: Options. (line 55) +* -dummy_force show raw copy commands: Options. (line 57) +* -help print help text to stdout: Options. (line 61) +* -image_file set path of disk image file: Options. (line 45) * -list_all print list of disk devices: Options. (line 15) -* -look_for_iso demand presence of ISO 9660: Options. (line 29) -* -max_size set size limit for device: Options. (line 20) -* -min_size set size limit for device: Options. (line 25) +* -list_long print extra device info: Options. (line 18) +* -look_for_iso demand presence of ISO 9660: Options. (line 33) +* -max_size set size limit for device: Options. (line 24) +* -min_size set size limit for device: Options. (line 29) * -plug_test detect target device plugging: Options. (line 7) -* -with_sudo run lsblk, umount, dd by sudo: Options. (line 34) -* -with_vendor_model add drive info to advice: Options. (line 18) +* -with_sudo run lsblk, umount, dd by sudo: Options. (line 38) +* -with_vendor_model add drive info to advice: Options. (line 22)  File: xorriso-dd-target.info, Node: ConceptIdx, Next: Top, Prev: CommandIdx, Up: Top @@ -483,18 +494,19 @@ File: xorriso-dd-target.info, Node: ConceptIdx, Next: Top, Prev: CommandIdx, * Menu: * Bugs, reporting: Bugreport. (line 6) -* Device size, set limit, -max_size: Options. (line 20) -* Device size, set limit, -min_size: Options. (line 25) +* Device info, print extra, -list_long: Options. (line 18) +* Device size, set limit, -max_size: Options. (line 24) +* Device size, set limit, -min_size: Options. (line 29) * Disk devices, print list, -list_all: Options. (line 15) -* disk image file, set path, -image_file: Options. (line 41) -* disk image file, write to device, -DO_WRITE: Options. (line 44) -* Drive info, add to advice, -with_vendor_model: Options. (line 18) -* help text, print to stdout, -help: Options. (line 57) -* ISO 9660, demand presence on target, -look_for_iso: Options. (line 29) -* lsblk, umount, dd, run by sudo, -with_sudo: Options. (line 34) -* only report, do not perform, -dummy: Options. (line 51) +* disk image file, set path, -image_file: Options. (line 45) +* disk image file, write to device, -DO_WRITE: Options. (line 48) +* Drive info, add to advice, -with_vendor_model: Options. (line 22) +* help text, print to stdout, -help: Options. (line 61) +* ISO 9660, demand presence on target, -look_for_iso: Options. (line 33) +* lsblk, umount, dd, run by sudo, -with_sudo: Options. (line 38) +* only report, do not perform, -dummy: Options. (line 55) * Problems, reporting: Bugreport. (line 6) -* raw copy commands, show, -dummy_force: Options. (line 53) +* raw copy commands, show, -dummy_force: Options. (line 57) * Reasons, list of: Reasons. (line 6) * Target device, detect by plugging, -plug_test: Options. (line 7) * Use case, detect intended device by plugging: Plugtest. (line 6) @@ -511,20 +523,20 @@ File: xorriso-dd-target.info, Node: ConceptIdx, Next: Top, Prev: CommandIdx, Tag Table: Node: Top429 Node: Overview996 -Node: Simplenames2788 -Node: Listall3399 -Node: Givendevices4825 -Node: Plugtest5746 -Node: Dowrite7586 -Node: Unwise8701 -Node: Reasons10057 -Node: Options12638 -Node: Examples15258 -Node: Files15431 -Node: Seealso15589 -Node: Bugreport15755 -Node: Legal16341 -Node: CommandIdx17045 -Node: ConceptIdx18092 +Node: Simplenames2792 +Node: Listall3516 +Node: Givendevices5089 +Node: Plugtest6053 +Node: Dowrite7893 +Node: Unwise9008 +Node: Reasons10364 +Node: Options12945 +Node: Examples15747 +Node: Files15920 +Node: Seealso16078 +Node: Bugreport16244 +Node: Legal16831 +Node: CommandIdx17535 +Node: ConceptIdx18655  End Tag Table diff --git a/xorriso-dd-target/xorriso-dd-target.texi b/xorriso-dd-target/xorriso-dd-target.texi index 949b80f1..525a25f4 100644 --- a/xorriso-dd-target/xorriso-dd-target.texi +++ b/xorriso-dd-target/xorriso-dd-target.texi @@ -50,7 +50,7 @@ @c man .\" First parameter, NAME, should be all caps @c man .\" Second parameter, SECTION, should be 1-8, maybe w/ subsection @c man .\" other parameters are allowed: see man(7), man(1) -@c man .TH XORRISO-DD-TARGET 1 "Version 1.5.3, Dec 6, 2019" +@c man .TH XORRISO-DD-TARGET 1 "Version 1.5.3, Dec 7, 2019" @c man .\" Please adjust this date whenever revising the manpage. @c man .\" @c man .\" Some roff macros, for reference: @@ -114,9 +114,9 @@ xorriso-dd-target - Device evaluator and disk image copier for GNU/Linux evaluates block devices of the Linux kernel whether they are suitable targets for a disk image file and optionally copies the image file to one of them. @* -It is specialized on the device names of the Linux kernel and uses the -capabilities of util-linux program lsblk. Therefore it refuses to run on -non-Linux kernels. +It is specialized on the device names of the @strong{Linux kernel} and uses the +capabilities of util-linux program @strong{lsblk}. +Therefore it refuses to run on non-Linux kernels. @* @sp 1 @c man .PP @@ -172,6 +172,9 @@ and without options -list_all, -plug_test, -DO_WRITE, -dummy_force. It prints on standard output (stdout) only the names of advisable devices without "/dev/" prefix. One name per line and without any reasoning text. @* +The possible sudo password prompt, the message line about sudo, and the +empty line after it do not go to stdout. +@* Example: @* $ xorriso-dd-target -with_sudo @@ -191,7 +194,8 @@ sde @cindex Use case, list all devices with reasoning For the more curious user, there is option @strong{-list_all} which prints the evaluation of each disk-like device that is listed by program lsblk. -Optical drives, floppy disks, RAM block devices are excluded, though. +Optical drives, floppy disks, RAM block devices, loop devices are excluded, +though. @* Each device is shown by one line of the form @* @@ -211,6 +215,9 @@ the presence of an ISO 9660 filesystem on the device. @* @strong{info} is composed from VENDOR and MODEL as told by lsblk. @* +Option @strong{-list_long} causes with each line an additional listing of +the information provided by lsblk which led to the shown reasons. +@* Example: @* $ xorriso-dd-target -with_sudo -list_all @@ -234,8 +241,9 @@ If @strong{device names} are given instead of option -list_all, then only these devices are inspected. Their result gets listed without the ": info" part, unless option @strong{-with_vendor_model} is given. @* -Device names must not begin by '-' and must be single words. They must -not contain '/'. E.g. 'sdc' is valid, '/dev/sdc' is not valid. +Device names must not begin by '-' and must be single words composed of +the characters [A-za-z0-9_/-]. They should not contain '/'. E.g. 'sdc' is +valid, '/dev/sdc' is not valid. @* If one of the given device names gets not advised, the exit value is 1. @* @@ -469,7 +477,7 @@ A given device name looks like the name of a loop device: loop[0-9]*. @* @strong{looks_like_ramdev-} @* -A given device name looks like the name of a ram block device: zram[0-9]*. +A given device name looks like the name of a RAM block device: zram[0-9]*. @* @strong{lsblk_no_size-} @* @@ -548,6 +556,13 @@ begin. Print list of all found devices with advice, vendor and model. One per line. Ignore any device names. Ignore -DO_WRITE. @c man .TP +@item -list_long +@kindex -list_long print extra device info +@cindex Device info, print extra, -list_long +After each result line, which shows reasons, add an additional listing of +the information provided by lsblk which led to the reasons and add an empty +line. +@c man .TP @item -with_vendor_model @kindex -with_vendor_model add drive info to advice @cindex Drive info, add to advice, -with_vendor_model @@ -650,7 +665,7 @@ If more privacy is desired, mail to @email{scdbackup@@gmx.net}. @* @sp 1 Please describe what you expect the program to do, the program arguments -which you used, the messages of @command{xorrisodd-target}, and the +which you used, the messages of @command{xorriso-dd-target}, and the undesirable outcome of your program run. @* @sp 1