diff --git a/xorriso-dd-target/xorriso-dd-target b/xorriso-dd-target/xorriso-dd-target index a6a37dfc..f3a881fd 100755 --- a/xorriso-dd-target/xorriso-dd-target +++ b/xorriso-dd-target/xorriso-dd-target @@ -252,13 +252,15 @@ plug_in_watcher() { echo >&2 echo "Step 1:" >&2 echo "Please make sure that the desired target device is plugged _out_ now." >&2 + echo "If it is currently plugged in, make sure to unmount all its fileystems" >&2 + echo "and then unplug it." >&2 echo "Press the Enter key when ready." >&2 read dummy old_device_list=' '$($lsblk_cmd -d -n -o NAME | grep -v '^sr[0-9]' | grep -v '^fd[0-9]' | tr '\n\r' ' ')' ' # <<< Mock-up to save USB socket wear-off by erasing items from old_device_list # <<< Their presence in new_device_list will let them appear as fresh plugs -# old_device_list=' '$(echo -n $old_device_list | sed -e 's/sd[e-f]//')' ' +# old_device_list=' '$(echo -n $old_device_list | sed -e 's/sde//')' ' echo "Found and noted as _not_ desired: $old_device_list" >&2 echo >&2 @@ -653,11 +655,18 @@ then echo "Step 3:" >&2 if test -n "$dummy_run" then - echo "This would be the last chance to abort. Press Enter to see -dummy report." >&2 + echo "This would be the last chance to abort. Enter the word 'yes' to see -dummy report." >&2 else - echo "Last chance to abort. Press Enter to start REAL WRITING." >&2 + echo "Last chance to abort. Enter the word 'yes' to start REAL WRITING." >&2 fi read dummy + if test "$dummy" = "yes" -o "$dummy" = "'yes'" -o "$dummy" = '"yes"' + then + dummy=dummy + else + echo "WRITE RUN PREVENTED by user input '$dummy'." >&2 + exit 12 + fi fi write_image "$image_file" $candidates exit $? diff --git a/xorriso-dd-target/xorriso-dd-target.1 b/xorriso-dd-target/xorriso-dd-target.1 index 40932850..727fc8ad 100644 --- a/xorriso-dd-target/xorriso-dd-target.1 +++ b/xorriso-dd-target/xorriso-dd-target.1 @@ -48,10 +48,10 @@ If a single plausible candidate is detected, then the program is willing to copy a disk image file onto it. This will overwrite or make inaccessible the previous partition table and all previous data content of the target device. .br -\fBSuperuser power\fR is needed for filesystem type identification, for -possible unmounting, and for possible image writing. Option \fB\-with_sudo\fR -offers a way to gain this power only for those tasks and to run the program -elsewise with a normal user's power. +\fBSuperuser power\fR is normally needed for filesystem type identification, +for possible unmounting, and for possible image writing. +Option \fB\-with_sudo\fR offers a way to gain this power only for those +tasks and to run the program elsewise with a normal user's power. .br If a particular disk image file is intended as copy source, then its path should be given by option \-image_file, so that its size can be used @@ -110,7 +110,7 @@ storage, and \- if tested \- of sufficient or plausible size. \fBreasoning\fR is a blank separated list of words with either suffix '+' for an inviting device property or '\-' for a prohibitive property. Normally a single '\-' reason disqualifies the device from being advisable. Only if -option \-look_for_iso is given, a reason "has_...\-" can be overridden by +option \-look_for_iso is given, a reason "has_XYZ\-" can be overridden by the presence of an ISO 9660 filesystem on the device. .br \fBinfo\fR is composed from VENDOR and MODEL as told by lsblk. @@ -174,7 +174,7 @@ device name was given. Option \-list_all and any device names given as arguments will be ignored. .br \fBStep 3\fR happens only if options \-DO_WRITE or \-dummy_force are given. -The program asks for a final press of the Enter key before real or simulated +The program asks for a final input of the word 'yes' before real or simulated writing begins. .br Example: @@ -189,6 +189,11 @@ by watching it appear after being plugged in. Step 1: .br Please make sure that the desired target device is plugged _out_ now. +.br +If it is currently plugged in, make sure to unmount all its fileystems +.br +and then unplug it. +.br Press the Enter key when ready. .br @@ -233,9 +238,9 @@ sde : YES : usb+ has_iso9660+ has_vfat+ .br Step 3: .br -Last chance to abort. Press Enter to start REAL WRITING. +Last chance to abort. Enter the word 'yes' to start REAL WRITING. .br - +yes .br Looking for mount points of sde: .br @@ -398,7 +403,8 @@ This overrides device names and option \-list_all. The found device is then shown with advice, vendor, and model. .br Option \-DO_WRITE is obeyed if given. -In this case a final Enter key is demanded before writing begins. +In this case, the word 'yes' has to be entered to let unmounting and writing +begin. .TP \fB\-list_all\fR Print list of all found devices with advice, vendor and model. One per line. diff --git a/xorriso-dd-target/xorriso-dd-target.info b/xorriso-dd-target/xorriso-dd-target.info index 67035c58..e33518dc 100644 --- a/xorriso-dd-target/xorriso-dd-target.info +++ b/xorriso-dd-target/xorriso-dd-target.info @@ -50,8 +50,8 @@ If a single plausible candidate is detected, then the program is willing to copy a disk image file onto it. This will overwrite or make inaccessible the previous partition table and all previous data content of the target device. -*Superuser power* is needed for filesystem type identification, for -possible unmounting, and for possible image writing. Option +*Superuser power* is normally needed for filesystem type identification, +for possible unmounting, and for possible image writing. Option *-with_sudo* offers a way to gain this power only for those tasks and to run the program elsewise with a normal user's power. If a particular disk image file is intended as copy source, then its @@ -106,7 +106,7 @@ data storage, and - if tested - of sufficient or plausible size. *reasoning* is a blank separated list of words with either suffix '+' for an inviting device property or '-' for a prohibitive property. Normally a single '-' reason disqualifies the device from being -advisable. Only if option -look_for_iso is given, a reason "has_...-" +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. @@ -160,7 +160,7 @@ Only if a single new device is found, the program will go on as if a single device name was given. Option -list_all and any device names given as arguments will be ignored. *Step 3* happens only if options -DO_WRITE or -dummy_force are given. -The program asks for a final press of the Enter key before real or +The program asks for a final input of the word 'yes' before real or simulated writing begins. Example: $ xorriso-dd-target -with_sudo -plug_test @@ -169,6 +169,8 @@ Caused by option -plug_test: Attempt to find the desired device by watching it appear after being plugged in. Step 1: Please make sure that the desired target device is plugged _out_ now. +If it is currently plugged in, make sure to unmount all its fileystems +and then unplug it. Press the Enter key when ready. @@ -203,10 +205,9 @@ $ xorriso-dd-target -with_sudo -plug_test -DO_WRITE \ sde : YES : usb+ has_iso9660+ has_vfat+ Step 3: -Last chance to abort. Press Enter to start REAL WRITING. - - - Looking for mount points of sde: +Last chance to abort. Enter the word 'yes' to start REAL WRITING. +yes +Looking for mount points of sde: /dev/sde1 on /mnt/iso type iso9660 (ro,relatime) /dev/sde2 on /mnt/fat type vfat (rw,...,errors=remount-ro) Unmounted: /dev/sde1 @@ -323,8 +324,8 @@ File: xorriso-dd-target.info, Node: Options, Next: Examples, Prev: Overview, and to press Enter again. This overrides device names and option -list_all. The found device is then shown with advice, vendor, and model. - Option -DO_WRITE is obeyed if given. In this case a final Enter - key is demanded before writing begins. + Option -DO_WRITE is obeyed if given. In this case, the word 'yes' + has to be entered to let unmounting and writing begin. -list_all Print list of all found devices with advice, vendor and model. One per line. Ignore any device names. Ignore -DO_WRITE. @@ -499,20 +500,20 @@ File: xorriso-dd-target.info, Node: ConceptIdx, Next: Top, Prev: CommandIdx, Tag Table: Node: Top429 Node: Overview996 -Node: Simplenames2779 -Node: Listall3390 -Node: Givendevices4800 -Node: Plugtest5602 -Node: Dowrite7350 -Node: Unwise8457 -Node: Reasons9813 -Node: Options12111 -Node: Examples14713 -Node: Files14886 -Node: Seealso15044 -Node: Bugreport15210 -Node: Legal15796 -Node: CommandIdx16500 -Node: ConceptIdx17547 +Node: Simplenames2788 +Node: Listall3399 +Node: Givendevices4809 +Node: Plugtest5611 +Node: Dowrite7451 +Node: Unwise8566 +Node: Reasons9922 +Node: Options12220 +Node: Examples14840 +Node: Files15013 +Node: Seealso15171 +Node: Bugreport15337 +Node: Legal15923 +Node: CommandIdx16627 +Node: ConceptIdx17674  End Tag Table diff --git a/xorriso-dd-target/xorriso-dd-target.texi b/xorriso-dd-target/xorriso-dd-target.texi index c2f30585..459ee2d8 100644 --- a/xorriso-dd-target/xorriso-dd-target.texi +++ b/xorriso-dd-target/xorriso-dd-target.texi @@ -128,10 +128,10 @@ If a single plausible candidate is detected, then the program is willing to copy a disk image file onto it. This will overwrite or make inaccessible the previous partition table and all previous data content of the target device. @* -@strong{Superuser power} is needed for filesystem type identification, for -possible unmounting, and for possible image writing. Option @strong{-with_sudo} -offers a way to gain this power only for those tasks and to run the program -elsewise with a normal user's power. +@strong{Superuser power} is normally needed for filesystem type identification, +for possible unmounting, and for possible image writing. +Option @strong{-with_sudo} offers a way to gain this power only for those +tasks and to run the program elsewise with a normal user's power. @* If a particular disk image file is intended as copy source, then its path should be given by option -image_file, so that its size can be used @@ -206,7 +206,7 @@ storage, and - if tested - of sufficient or plausible size. @strong{reasoning} is a blank separated list of words with either suffix '+' for an inviting device property or '-' for a prohibitive property. Normally a single '-' reason disqualifies the device from being advisable. Only if -option -look_for_iso is given, a reason "has_...-" can be overridden by +option -look_for_iso is given, a reason "has_XYZ-" can be overridden by the presence of an ISO 9660 filesystem on the device. @* @strong{info} is composed from VENDOR and MODEL as told by lsblk. @@ -276,7 +276,7 @@ device name was given. Option -list_all and any device names given as arguments will be ignored. @* @strong{Step 3} happens only if options -DO_WRITE or -dummy_force are given. -The program asks for a final press of the Enter key before real or simulated +The program asks for a final input of the word 'yes' before real or simulated writing begins. @* Example: @@ -291,6 +291,11 @@ by watching it appear after being plugged in. Step 1: @* Please make sure that the desired target device is plugged _out_ now. +@* +If it is currently plugged in, make sure to unmount all its fileystems +@* +and then unplug it. +@* Press the Enter key when ready. @* @@ -338,9 +343,9 @@ sde : YES : usb+ has_iso9660+ has_vfat+ @* Step 3: @* -Last chance to abort. Press Enter to start REAL WRITING. +Last chance to abort. Enter the word 'yes' to start REAL WRITING. @* - +yes @* Looking for mount points of sde: @* @@ -516,7 +521,8 @@ This overrides device names and option -list_all. The found device is then shown with advice, vendor, and model. @* Option -DO_WRITE is obeyed if given. -In this case a final Enter key is demanded before writing begins. +In this case, the word 'yes' has to be entered to let unmounting and writing +begin. @c man .TP @item -list_all @kindex -list_all print list of disk devices