FreeBSD Bugzilla – Attachment 159928 Details for
Bug 202367
sysutils/byobu relies on linprocfs at /proc
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patches for includes to redirect to /compat/linux/proc
byobu.patch (text/plain), 12.18 KB, created by
Justin Coffman
on 2015-08-16 17:39:39 UTC
(
hide
)
Description:
Patches for includes to redirect to /compat/linux/proc
Filename:
MIME Type:
Creator:
Justin Coffman
Created:
2015-08-16 17:39:39 UTC
Size:
12.18 KB
patch
obsolete
>--- ./usr/lib/byobu/uptime.orig 2014-03-16 19:32:17.000000000 -0500 >+++ ./usr/lib/byobu/uptime 2015-08-16 12:31:20.643220798 -0500 >@@ -27,8 +27,8 @@ > > __uptime() { > local u= idle= str= >- if [ -r /proc/uptime ]; then >- read u idle < /proc/uptime >+ if [ -r /compat/linux/proc/uptime ]; then >+ read u idle < /compat/linux/proc/uptime > u=${u%.*} > if [ "$u" -gt 86400 ]; then > str="$(($u / 86400))d$((($u % 86400) / 3600))h" >--- ./usr/lib/byobu/load_average.orig 2014-03-16 19:31:33.000000000 -0500 >+++ ./usr/lib/byobu/load_average 2015-08-16 12:31:20.669220588 -0500 >@@ -20,12 +20,12 @@ > # along with this program. If not, see <http://www.gnu.org/licenses/>. > > __load_average_detail() { >- cat /proc/loadavg >+ cat /compat/linux/proc/loadavg > } > > __load_average() { >- if [ -r "/proc/loadavg" ]; then >- read one five fifteen other < /proc/loadavg >+ if [ -r "/compat/linux/proc/loadavg" ]; then >+ read one five fifteen other < /compat/linux/proc/loadavg > else > one=$(uptime | sed -e "s/.*://" | awk '{print $1}') > fi >--- ./usr/lib/byobu/swap.orig 2014-03-16 19:32:33.000000000 -0500 >+++ ./usr/lib/byobu/swap 2015-08-16 12:31:20.679220461 -0500 >@@ -20,7 +20,7 @@ > # along with this program. If not, see <http://www.gnu.org/licenses/>. > > __swap_detail() { >- cat /proc/meminfo >+ cat /compat/linux/proc/meminfo > } > > __swap() { >@@ -34,7 +34,7 @@ > continue > fi > [ -n "$stotal" -a -n "$sfree" ] && break; >- done < /proc/meminfo >+ done < /compat/linux/proc/meminfo > [ "${stotal:-0}" = "0" ] && return 0 > mem=${stotal} > f=$(((100*($stotal-$sfree))/$stotal)) >--- ./usr/lib/byobu/cpu_freq.orig 2014-03-16 19:31:49.000000000 -0500 >+++ ./usr/lib/byobu/cpu_freq 2015-08-16 12:31:20.676220625 -0500 >@@ -20,7 +20,7 @@ > # along with this program. If not, see <http://www.gnu.org/licenses/>. > > __cpu_freq_detail() { >- cat /proc/cpuinfo >+ cat /compat/linux/proc/cpuinfo > } > > __cpu_freq() { >@@ -29,13 +29,13 @@ > read hz < /sys/devices/system/cpu/cpu0/cpufreq/scaling_cur_freq > fpdiv $hz "1000000" 1 # 1Ghz > freq="$_RET" >- elif [ -r "/proc/cpuinfo" ]; then >- if egrep -q -s -i -m 1 "^cpu MHz|^clock" /proc/cpuinfo; then >- freq=$(egrep -i -m 1 "^cpu MHz|^clock" /proc/cpuinfo | awk -F"[:.]" '{ printf "%01.1f", $2 / 1000 }') >+ elif [ -r "/compat/linux/proc/cpuinfo" ]; then >+ if egrep -q -s -i -m 1 "^cpu MHz|^clock" /compat/linux/proc/cpuinfo; then >+ freq=$(egrep -i -m 1 "^cpu MHz|^clock" /compat/linux/proc/cpuinfo | awk -F"[:.]" '{ printf "%01.1f", $2 / 1000 }') > else > # Must scale frequency by number of processors, if counting bogomips >- count=$(getconf _NPROCESSORS_ONLN 2>/dev/null || grep -ci "^processor" /proc/cpuinfo) >- freq=$(egrep -i -m 1 "^bogomips" /proc/cpuinfo | awk -F"[:.]" '{ print $2 }') >+ count=$(getconf _NPROCESSORS_ONLN 2>/dev/null || grep -ci "^processor" /compat/linux/proc/cpuinfo) >+ freq=$(egrep -i -m 1 "^bogomips" /compat/linux/proc/cpuinfo | awk -F"[:.]" '{ print $2 }') > freq=$(printf "%s %s" "$freq" "$count" | awk '{printf "%01.1f\n", $1/$2/1000}') > fi > elif hz=$(sysctl -n hw.cpufrequency 2>/dev/null); then >--- ./usr/lib/byobu/cpu_temp.orig 2014-03-16 19:31:51.000000000 -0500 >+++ ./usr/lib/byobu/cpu_temp 2015-08-16 12:31:20.656220650 -0500 >@@ -21,7 +21,7 @@ > > __cpu_temp_detail() { > local i >- for i in $MONITORED_TEMP /sys/class/hwmon/hwmon*/device/temp*_input /sys/class/hwmon/hwmon*/temp*_input /proc/acpi/ibm/thermal /proc/acpi/thermal_zone/*/temperature; do >+ for i in $MONITORED_TEMP /sys/class/hwmon/hwmon*/device/temp*_input /sys/class/hwmon/hwmon*/temp*_input /compat/linux/proc/acpi/ibm/thermal /compat/linux/proc/acpi/thermal_zone/*/temperature; do > [ -r "$i" ] || continue > printf "%s\n" "$i:" > cat "$i"/* >@@ -30,7 +30,7 @@ > > __cpu_temp() { > local i t unit >- for i in $MONITORED_TEMP /sys/class/hwmon/hwmon*/device/temp*_input /sys/class/hwmon/hwmon*/temp*_input /proc/acpi/ibm/thermal /proc/acpi/thermal_zone/*/temperature; do >+ for i in $MONITORED_TEMP /sys/class/hwmon/hwmon*/device/temp*_input /sys/class/hwmon/hwmon*/temp*_input /compat/linux/proc/acpi/ibm/thermal /compat/linux/proc/acpi/thermal_zone/*/temperature; do > case "$i" in > *temp*_input) > [ -s "$i" ] && read t < "$i" && t=$(($t/1000)) >--- ./usr/lib/byobu/ec2_cost.orig 2014-03-16 19:32:22.000000000 -0500 >+++ ./usr/lib/byobu/ec2_cost 2015-08-16 12:31:20.666220556 -0500 >@@ -56,8 +56,8 @@ > file_to_stat="/etc/hostname" > hours=$(((`date +%s` - `stat --printf %Y $file_to_stat`) / 60 / 60 + 1)) > # Auto detect network interface >- [ -r "/proc/net/route" ] || return >- interface=$(tail -n1 /proc/net/route | awk '{print $1}') >+ [ -r "/compat/linux/proc/net/route" ] || return >+ interface=$(tail -n1 /compat/linux/proc/net/route | awk '{print $1}') > local iface rbytes rpackets rerrs rdrop rfifo rframe rcompressed rmulticast tbytes tpackets terrs tdrop tfifo tcolls tcarrier tcompressed > while read iface rbytes rpackets rerrs rdrop rfifo rframe rcompressed rmulticast tbytes tpackets terrs tdrop tfifo tcolls tcarrier tcompressed; do > case "$iface" in >@@ -78,7 +78,7 @@ > rx_gb=${rbytes} > break > fi >- done < /proc/net/dev >+ done < /compat/linux/proc/net/dev > tx_gb=$(printf "%s" ${tx_gb} | awk '{ printf "%f", $1 / 1024 / 1024 / 1024 }') > rx_gb=$(printf "%s" ${rx_gb} | awk '{ printf "%f", $1 / 1024 / 1024 / 1024 }') > network_cost=`printf "%s %s %s %s" "$tx_gb" "$TX_RATE" "$rx_gb" "$RX_RATE" | awk '{printf "%f %f", $1*$2, $3*$4}' | awk '{printf "%f", $1 + $2}'` >--- ./usr/lib/byobu/processes.orig 2014-03-16 19:31:08.000000000 -0500 >+++ ./usr/lib/byobu/processes 2015-08-16 12:31:20.646220484 -0500 >@@ -26,7 +26,7 @@ > __processes() { > local count= > if [ -r /proc ]; then >- count=$(ls -d /proc/[0-9]* 2>/dev/null| wc -l) >+ count=$(ls -d /compat/linux/proc/[0-9]* 2>/dev/null| wc -l) > else > count=$(ps -ef | wc -l | awk '{print $1}') > fi >--- ./usr/lib/byobu/network.orig 2014-03-16 19:31:24.000000000 -0500 >+++ ./usr/lib/byobu/network 2015-08-16 12:31:20.678220492 -0500 >@@ -41,7 +41,7 @@ > cache="$BYOBU_RUN_DIR/cache.$BYOBU_BACKEND/network.$i" > [ -r "$cache" ] && read x1 < "$cache" || tx1=0 > local iface rbytes rpackets rerrs rdrop rfifo rframe rcompressed rmulticast tbytes tpackets terrs tdrop tfifo tcolls tcarrier tcompressed >- cat /proc/net/dev > "$cache".dev >+ cat /compat/linux/proc/net/dev > "$cache".dev > while read iface rbytes rpackets rerrs rdrop rfifo rframe rcompressed rmulticast tbytes tpackets terrs tdrop tfifo tcolls tcarrier tcompressed; do > case "$iface" in > ${interface}:) >--- ./usr/lib/byobu/ip_address.orig 2014-03-16 19:31:27.000000000 -0500 >+++ ./usr/lib/byobu/ip_address 2015-08-16 12:31:20.658220468 -0500 >@@ -34,7 +34,7 @@ > interface="$MONITORED_NETWORK" > else > case "$IPV6" in >- 1|true|yes) interface=$(awk '$10 != "lo" { iface=$10 ; }; END { print iface; }' /proc/net/ipv6_route);; >+ 1|true|yes) interface=$(awk '$10 != "lo" { iface=$10 ; }; END { print iface; }' /compat/linux/proc/net/ipv6_route);; > *) get_network_interface; interface="$_RET";; > esac > fi >--- ./usr/lib/byobu/raid.orig 2014-03-16 19:32:36.000000000 -0500 >+++ ./usr/lib/byobu/raid 2015-08-16 12:31:20.668220892 -0500 >@@ -20,7 +20,7 @@ > # along with this program. If not, see <http://www.gnu.org/licenses/>. > > __raid_detail() { >- [ -r /proc/mdstat ] && cat /proc/mdstat || true >+ [ -r /compat/linux/proc/mdstat ] && cat /compat/linux/proc/mdstat || true > } > > __raid() { >@@ -37,7 +37,7 @@ > msg="$msg,$p" > ;; > esac >- done < /proc/mdstat >+ done < /compat/linux/proc/mdstat > if [ -n "$msg" ]; then > color B w r; printf "%s" "$msg"; color -- > elif [ -e "$BYOBU_RUN_DIR/status.$BYOBU_BACKEND/raid" ]; then >--- ./usr/lib/byobu/rcs_cost.orig 2014-03-16 19:31:46.000000000 -0500 >+++ ./usr/lib/byobu/rcs_cost 2015-08-16 12:31:20.642220547 -0500 >@@ -40,7 +40,7 @@ > # 15872MB $0.960/h > > # Instance memory >- memory=`grep "^MemTotal:" /proc/meminfo | awk '{print $2}'` >+ memory=`grep "^MemTotal:" /compat/linux/proc/meminfo | awk '{print $2}'` > > # Round memory down to the nearest multiple of 64MB > memory=$((${memory} - (${memory} % (64 * 1024)))) >@@ -59,8 +59,8 @@ > TX_RATE="0.22" > > # Auto detect network interface >- [ -r "/proc/net/route" ] || return >- IF=$(tail -n1 /proc/net/route | awk '{print $1}') >+ [ -r "/compat/linux/proc/net/route" ] || return >+ IF=$(tail -n1 /compat/linux/proc/net/route | awk '{print $1}') > > ifconfig_out=`LC_ALL=C /sbin/ifconfig "$IF"` > >--- ./usr/lib/byobu/memory.orig 2014-03-16 19:31:31.000000000 -0500 >+++ ./usr/lib/byobu/memory 2015-08-16 12:31:20.665220449 -0500 >@@ -26,7 +26,7 @@ > __memory() { > local free="" total="" buffers="" cached="" > local kb_main_used=0 buffers_plus_cached=0 fo_buffers=0 fo_cached=0 >- if [ -r /proc/meminfo ]; then >+ if [ -r /compat/linux/proc/meminfo ]; then > while read tok val unit; do > case "$tok" in > MemTotal:) total=${val};; >@@ -35,7 +35,7 @@ > Cached:) cached=${val};; > esac > [ -n "${free}" -a -n "${total}" -a -n "${buffers}" -a -n "${cached}" ] && break; >- done < /proc/meminfo >+ done < /compat/linux/proc/meminfo > elif $BYOBU_TEST vm_stat >/dev/null 2>&1; then > # MacOS support > # calculation borrowed from http://apple.stackexchange.com/a/48195/18857 >--- ./usr/lib/byobu/battery.orig 2014-03-16 19:53:02.000000000 -0500 >+++ ./usr/lib/byobu/battery 2015-08-16 12:31:20.651220903 -0500 >@@ -22,7 +22,7 @@ > > __battery_detail() { > local bat >- for bat in /proc/acpi/battery/*; do >+ for bat in /compat/linux/proc/acpi/battery/*; do > cat "$bat/info" > cat "$bat/state" > done >@@ -32,7 +32,7 @@ > __battery() { > local bat line present sign state percent full rem color bcolor > # Linux support >- for bat in $BATTERY /sys/class/power_supply/* /proc/acpi/battery/*; do >+ for bat in $BATTERY /sys/class/power_supply/* /compat/linux/proc/acpi/battery/*; do > present=""; full=""; rem=""; state="" > case "$bat" in > /sys/*) >@@ -50,7 +50,7 @@ > [ "$present" = "1" ] && [ -n "$full" ] && [ -n "$rem" ] && [ -n "$state" ] && break > fi > ;; >- /proc/*) >+ /compat/linux/proc/*) > [ -f "$bat/info" ] || continue > while read line; do > set -- ${line} >--- ./usr/lib/byobu/cpu_count.orig 2014-03-16 19:32:19.000000000 -0500 >+++ ./usr/lib/byobu/cpu_count 2015-08-16 12:31:20.677220480 -0500 >@@ -20,12 +20,12 @@ > # along with this program. If not, see <http://www.gnu.org/licenses/>. > > __cpu_count_detail() { >- grep -i "^model name" /proc/cpuinfo >+ grep -i "^model name" /compat/linux/proc/cpuinfo > } > > __cpu_count() { > local c >- c=$(getconf _NPROCESSORS_ONLN 2>/dev/null || grep -ci "^processor" /proc/cpuinfo) >+ c=$(getconf _NPROCESSORS_ONLN 2>/dev/null || grep -ci "^processor" /compat/linux/proc/cpuinfo) > [ "$c" = "1" ] || printf "%sx" "$c" > } > >--- ./usr/lib/byobu/entropy.orig 2014-03-16 19:31:22.000000000 -0500 >+++ ./usr/lib/byobu/entropy 2015-08-16 12:31:20.675220854 -0500 >@@ -19,12 +19,12 @@ > # along with this program. If not, see <http://www.gnu.org/licenses/>. > > __entropy_detail() { >- cat /proc/sys/kernel/random/entropy_avail 2>/dev/null >+ cat /compat/linux/proc/sys/kernel/random/entropy_avail 2>/dev/null > } > > __entropy() { >- if [ -r /proc/sys/kernel/random/entropy_avail ]; then >- local e=$(cat /proc/sys/kernel/random/entropy_avail) >+ if [ -r /compat/linux/proc/sys/kernel/random/entropy_avail ]; then >+ local e=$(cat /compat/linux/proc/sys/kernel/random/entropy_avail) > [ -n "$e" ] || return > color K Y; printf "e%s" "$e"; color -- > fi >--- ./usr/lib/byobu/disk.orig 2014-03-16 19:32:01.000000000 -0500 >+++ ./usr/lib/byobu/disk 2015-08-16 12:31:20.661220465 -0500 >@@ -28,7 +28,7 @@ > # Default to /, but let users override > [ -z "$MONITORED_DISK" ] && MP="/" || MP="$MONITORED_DISK" > case $MP in >- /dev/*) MP=$(awk '$1 == m { print $2; exit(0); }' "m=$MP" /proc/mounts);; >+ /dev/*) MP=$(awk '$1 == m { print $2; exit(0); }' "m=$MP" /compat/linux/proc/mounts);; > esac > # this could be done faster with 'stat --file-system --format' > # but then we'd have to do blocks -> human units ourselves >--- ./usr/lib/byobu/fan_speed.orig 2014-03-16 19:31:20.000000000 -0500 >+++ ./usr/lib/byobu/fan_speed 2015-08-16 12:31:20.668220892 -0500 >@@ -38,9 +38,9 @@ > done > > # But others (e.g. Dell Inspirons) seem to be here: >- if [ -r /proc/i8k ]; then >+ if [ -r /compat/linux/proc/i8k ]; then > local line="" >- read line < /proc/i8k >+ read line < /compat/linux/proc/i8k > set -- $line > for speed in $7 $8; do > if [ -n "$speed" ] && [ "$speed" -gt 0 ]; then
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 202367
:
159928
|
185064
|
185066
|
185089