1 Index: os-prober/common.sh
2 ===================================================================
3 --- os-prober.orig/common.sh
4 +++ os-prober/common.sh
5 @@ -62,10 +62,14 @@ cache_progname() {
11 - logger -t "$progname" "$@"
13 +# fd_logger: bind value now, possibly after assigning default.
17 + echo "$progname: $@" 1>&'${fd_logger:=9}'
20 +export fd_logger # so subshells inherit current value by default
24 @@ -81,10 +85,14 @@ debug() {
32 +# fd_result: bind value now, possibly after assigning default.
36 + echo "$@" 1>&'${fd_result:=1}'
39 +export fd_result # so subshells inherit current value by default
41 # shim to make it easier to use os-prober outside d-i
42 if ! type mapdevfs >/dev/null 2>&1; then
43 Index: os-prober/linux-boot-prober
44 ===================================================================
45 --- os-prober.orig/linux-boot-prober
46 +++ os-prober/linux-boot-prober
50 +# dash shell does not have "{varname}>&1" feature that bash shell has
51 +# for auto-assignment of new filedescriptors.
52 +# It is cumbersome to write the 'eval' to use our own variables in redirections.
53 +# Therefore use fixed numbers.
54 +export fd_result=3 # file descriptor for external results
55 +export fd_logger=9 # file descriptor for input to logger
57 . /usr/share/os-prober/common.sh
60 @@ -19,6 +27,7 @@ bootuuid=
62 grep "^/dev/" /proc/mounts | parse_proc_mounts >"$OS_PROBER_TMP/mounted-map" || true
67 elif [ "$1" = btrfs -a -z "$2" ]; then
68 @@ -186,3 +195,5 @@ else
72 +) 9>&1 | logger 1>&- # fd_logger
74 Index: os-prober/os-prober
75 ===================================================================
76 --- os-prober.orig/os-prober
77 +++ os-prober/os-prober
82 -. /usr/share/os-prober/common.sh
83 +# dash shell does not have "{varname}>&1" feature that bash shell has
84 +# for auto-assignment of new filedescriptors.
85 +# It is cumbersome to write the 'eval' to use our own variables in redirections.
86 +# Therefore use fixed numbers.
87 +export fd_result=3 # file descriptor for external results
88 +export fd_logger=9 # file descriptor for input to logger
90 + . /usr/share/os-prober/common.sh
94 @@ -136,6 +143,7 @@ fi
96 : >"$OS_PROBER_TMP/btrfs-vols"
99 for partition in $(partitions); do
100 if ! mapped="$(mapdevfs "$partition")"; then
101 log "Device '$partition' does not exist; skipping"
102 @@ -200,3 +208,5 @@ for partition in $(partitions); do
106 +) 9>&1 | logger 1>&- # fd_logger