New xorriso-dd-target option -trust_lsblk_udev
This commit is contained in:
parent
49690fcac7
commit
1170a9b883
@ -15,7 +15,7 @@
|
|||||||
# announces.
|
# announces.
|
||||||
|
|
||||||
xdt_print_version() {
|
xdt_print_version() {
|
||||||
echo "xorriso-dd-target , version 1.5.3 , 2020.01.08.204757"
|
echo "xorriso-dd-target , version 1.5.3 , 2020.02.12.145929"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -123,6 +123,10 @@ xdt_print_usage() {
|
|||||||
echo " If no filesystems are detected and the program"
|
echo " If no filesystems are detected and the program"
|
||||||
echo " has no superuser power, the device is not advised."
|
echo " has no superuser power, the device is not advised."
|
||||||
echo " If -DO_WRITE is given, run umount and dd by sudo."
|
echo " If -DO_WRITE is given, run umount and dd by sudo."
|
||||||
|
echo " -trust_lsblk_udev Suppress the reason no_fs_while_not_su- if lsblk"
|
||||||
|
echo " is linked with libudev.so. In this case it is very"
|
||||||
|
echo " likely that lsblk can retrieve FSTYPE even if"
|
||||||
|
echo " run by a non-priviledged user."
|
||||||
echo " -image_file PATH Set the path of the image file which shall be"
|
echo " -image_file PATH Set the path of the image file which shall be"
|
||||||
echo " written to a device. Its size will be set as"
|
echo " written to a device. Its size will be set as"
|
||||||
echo " -min_size."
|
echo " -min_size."
|
||||||
@ -220,6 +224,7 @@ xdt_reset_job() {
|
|||||||
xdt_dummy_force=
|
xdt_dummy_force=
|
||||||
xdt_no_pacifier=
|
xdt_no_pacifier=
|
||||||
xdt_do_plug_test=
|
xdt_do_plug_test=
|
||||||
|
xdt_trust_lsblk_udev=
|
||||||
|
|
||||||
# Status
|
# Status
|
||||||
xdt_sudo_cmd=
|
xdt_sudo_cmd=
|
||||||
@ -233,6 +238,7 @@ xdt_reset_job() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
## Predict superuser power. Possibly enable sudo with lsblk -o FSTYPE and dd.
|
## Predict superuser power. Possibly enable sudo with lsblk -o FSTYPE and dd.
|
||||||
|
## Also predict whether lsblk -o FSTYPE will bring results as non-root.
|
||||||
xdt_predict_su_power() {
|
xdt_predict_su_power() {
|
||||||
if test "$(whoami)" = "root"
|
if test "$(whoami)" = "root"
|
||||||
then
|
then
|
||||||
@ -251,6 +257,16 @@ xdt_predict_su_power() {
|
|||||||
return 11
|
return 11
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# lsblk linked with libudev.so usually can obtain filesystem info
|
||||||
|
# without superuser powers.
|
||||||
|
if test -n "$xdt_trust_lsblk_udev"
|
||||||
|
then
|
||||||
|
if ldd "$xdt_lsblk_cmd" | grep '\tlibudev\.so' >/dev/null
|
||||||
|
then
|
||||||
|
xdt_lsblk_fs_wo_su=y
|
||||||
|
fi
|
||||||
|
fi
|
||||||
return 0
|
return 0
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -308,6 +324,9 @@ xdt_arg_interpreter() {
|
|||||||
elif test "X$xdt_i" = "X-look_for_iso"
|
elif test "X$xdt_i" = "X-look_for_iso"
|
||||||
then
|
then
|
||||||
xdt_look_for_iso=y
|
xdt_look_for_iso=y
|
||||||
|
elif test "X$xdt_i" = "X-trust_lsblk_udev"
|
||||||
|
then
|
||||||
|
xdt_trust_lsblk_udev=y
|
||||||
elif test "X$xdt_i" = "X-with_sudo"
|
elif test "X$xdt_i" = "X-with_sudo"
|
||||||
then
|
then
|
||||||
xdt_with_sudo=y
|
xdt_with_sudo=y
|
||||||
@ -604,7 +623,7 @@ xdt_list_devices() {
|
|||||||
# Decide whether the found filesystems look dispensible enough
|
# Decide whether the found filesystems look dispensible enough
|
||||||
xdt_reasons="${xdt_reasons}${xdt_good_fs}${xdt_bad_fs}"
|
xdt_reasons="${xdt_reasons}${xdt_good_fs}${xdt_bad_fs}"
|
||||||
if test "${xdt_bad_fs}${xdt_good_fs}" = "" \
|
if test "${xdt_bad_fs}${xdt_good_fs}" = "" \
|
||||||
&& test -z "$xdt_have_su_power"
|
&& test -z "$xdt_have_su_power" && test -z "$xdt_lsblk_fs_wo_su"
|
||||||
then
|
then
|
||||||
xdt_yucky=y
|
xdt_yucky=y
|
||||||
xdt_reasons="${xdt_reasons}no_fs_while_not_su- "
|
xdt_reasons="${xdt_reasons}no_fs_while_not_su- "
|
||||||
|
@ -9,7 +9,7 @@
|
|||||||
.\" First parameter, NAME, should be all caps
|
.\" First parameter, NAME, should be all caps
|
||||||
.\" Second parameter, SECTION, should be 1-8, maybe w/ subsection
|
.\" Second parameter, SECTION, should be 1-8, maybe w/ subsection
|
||||||
.\" other parameters are allowed: see man(7), man(1)
|
.\" other parameters are allowed: see man(7), man(1)
|
||||||
.TH XORRISO-DD-TARGET 1 "Version 1.5.3, Jan 7, 2020"
|
.TH XORRISO-DD-TARGET 1 "Version 1.5.3, Fep 12, 2020"
|
||||||
.\" Please adjust this date whenever revising the manpage.
|
.\" Please adjust this date whenever revising the manpage.
|
||||||
.\"
|
.\"
|
||||||
.\" Some roff macros, for reference:
|
.\" Some roff macros, for reference:
|
||||||
@ -498,6 +498,16 @@ program as superuser.
|
|||||||
If \-DO_WRITE \-with_sudo is given, then the programs umount and dd will be run
|
If \-DO_WRITE \-with_sudo is given, then the programs umount and dd will be run
|
||||||
by sudo, too.
|
by sudo, too.
|
||||||
.TP
|
.TP
|
||||||
|
\fB\-trust_lsblk_udev\fR
|
||||||
|
Suppress the reason no_fs_while_not_su\- if lsblk is linked with libudev.so.
|
||||||
|
In this case it is likely that lsblk can retrieve FSTYPE even if run
|
||||||
|
by a non\-priviledged user.
|
||||||
|
.br
|
||||||
|
This option is intended for use by frontend programs which are certain
|
||||||
|
that they do not encounter a udev\-using version of lsblk which nevertheless
|
||||||
|
fails to detect existing filesystems. Human users should better acquire
|
||||||
|
superuser powers if reason no_fs_while_not_su\- is reported.
|
||||||
|
.TP
|
||||||
\fB\-image_file\fR PATH
|
\fB\-image_file\fR PATH
|
||||||
Set the path of the image file which shall be written to a device. Its size
|
Set the path of the image file which shall be written to a device. Its size
|
||||||
will be set as \-min_size.
|
will be set as \-min_size.
|
||||||
|
@ -387,6 +387,15 @@ File: xorriso-dd-target.info, Node: Options, Next: Examples, Prev: Overview,
|
|||||||
need to run the whole program as superuser.
|
need to run the whole program as superuser.
|
||||||
If -DO_WRITE -with_sudo is given, then the programs umount and dd
|
If -DO_WRITE -with_sudo is given, then the programs umount and dd
|
||||||
will be run by sudo, too.
|
will be run by sudo, too.
|
||||||
|
-trust_lsblk_udev
|
||||||
|
Suppress the reason no_fs_while_not_su- if lsblk is linked with
|
||||||
|
libudev.so. In this case it is likely that lsblk can retrieve
|
||||||
|
FSTYPE even if run by a non-priviledged user.
|
||||||
|
This option is intended for use by frontend programs which are
|
||||||
|
certain that they do not encounter a udev-using version of lsblk
|
||||||
|
which nevertheless fails to detect existing filesystems. Human
|
||||||
|
users should better acquire superuser powers if reason
|
||||||
|
no_fs_while_not_su- is reported.
|
||||||
-image_file PATH
|
-image_file PATH
|
||||||
Set the path of the image file which shall be written to a device.
|
Set the path of the image file which shall be written to a device.
|
||||||
Its size will be set as -min_size.
|
Its size will be set as -min_size.
|
||||||
@ -491,19 +500,20 @@ File: xorriso-dd-target.info, Node: CommandIdx, Next: ConceptIdx, Prev: Legal
|
|||||||
|