Bug 202367

Summary: sysutils/byobu relies on linprocfs at /proc
Product: Ports & Packages Reporter: Justin Coffman <jcoffm>
Component: Individual Port(s)Assignee: Steve Wills <swills>
Status: Closed FIXED    
Severity: Affects Many People CC: justin, robak, ultima
Priority: --- Keywords: needs-patch, needs-qa
Version: Latest   
Hardware: Any   
OS: Any   
Attachments:
Description Flags
Patches for includes to redirect to /compat/linux/proc
none
linprocfs and df compatibility fixes
none
Patched byobu port dir for linprocfs and others
none
svn diff - linprocfs, df patches none

Description Justin Coffman 2015-08-16 17:39:39 UTC
Created attachment 159928 [details]
Patches for includes to redirect to /compat/linux/proc

sysutils/byobu has widgets in /usr/local/lib/byobu/include that rely on having a linprocfs mounted on /proc. Attached patch redirects these to /compat/linux/proc - still requires linprocfs, but in the correct place per hier(7).

Also add to pkg-message:

======================================================================

byobu requires linprocfs(5) mounted on /compat/linux/proc

If you have not done it yet, please do the following:

        mkdir -p /compat/linux/proc
        chown -w /compat/linux/proc
        mount -t linprocfs linproc /compat/linux/proc

To make it permanent, you need the following lines in /etc/fstab:

        linproc  /compat/linux/proc  linprocfs  rw  0  0

======================================================================
Comment 1 Bartek Rutkowski freebsd_committer freebsd_triage 2017-02-25 17:04:27 UTC
Hi, your patch fails to apply as there's no such thing in the port as 'usr/lib/byobu'. It seems like you're trying to patch things that only exist in the OS after the port is being installed, which is incorrect. Please, check the FreeBSD Porters Handbook on how to prepare a proper patch and reopen the PR once you have it working properly and tested. Thanks!
Comment 2 Justin Coffman 2017-08-05 22:39:31 UTC
*** Bug 221259 has been marked as a duplicate of this bug. ***
Comment 3 Justin Coffman 2017-08-05 22:42:19 UTC
Created attachment 185064 [details]
linprocfs and df compatibility fixes

shar file format patch for sysutils/byobu

* Directs /proc requests to /compat/linux/proc
* Removes -P flag from 'df' calls (this is a Linux-ism, -P functions differently here)
* Adds pkg-message indicating that linprocfs(5) is necessary
Comment 4 Justin Coffman 2017-08-05 22:45:54 UTC
Created attachment 185066 [details]
Patched byobu port dir for linprocfs and others

Update to previous. Forgot to mention that /compat/linux/proc needs to be created before mounting linprocfs there. Might help.
Comment 5 Kubilay Kocak freebsd_committer freebsd_triage 2017-08-06 06:27:28 UTC
Thank you for the update Justin.

If you could provide a single unified diff (ideally using svn diff) against the port directory that will help this issue progress.

Before doing that, for any patches that need to be made against upstream sources, please use the `make makesum` method outlined in the Porters Handbook [1], which will automatically produce the correct files/patch-* files needed for the port.

[1] https://www.freebsd.org/doc/en_US.ISO8859-1/books/porters-handbook/book.html#slow-patch
Comment 6 Justin Coffman 2017-08-06 12:21:08 UTC
Created attachment 185089 [details]
svn diff - linprocfs, df patches

I'm going to get this right eventually.
Comment 7 Richard Gallamore freebsd_committer freebsd_triage 2017-08-12 08:45:33 UTC
There are a lot of patches here doing the same thing. Would it not be better to simply add a REINPLACE_CMD to the makefile with 's|/proc/|/compat/linux/proc/|g'? It would look dirty but at present adding 36 patchfiles is simply insane.

Also I'm a bit puzzled at the first file. Does this also belong to the port or is this for base?
Comment 8 Justin Coffman 2017-10-22 18:09:42 UTC
Comment on attachment 159928 [details]
Patches for includes to redirect to /compat/linux/proc

Ignore this file. I didn't have a good grasp on how to submit patches when this was created.
Comment 9 Justin Coffman 2017-10-22 18:10:53 UTC
(In reply to Richard Gallamore from comment #7)

That could conceivably work, and it would also handle future cases of /proc reliance should new widgets be added upstream. I assumed that such a solution was to be avoided due to "dirtiness," but if that's preferable in this case...
Comment 10 Richard Gallamore freebsd_committer freebsd_triage 2017-10-22 18:51:40 UTC
(In reply to Justin Coffman from comment #9)
This looks much better. A the PORTREVISION will need to be bumped though. Can you also provide some comments about QA?

It is really up to the maintainers judgement. If adding it to Makefile will likely cause foreseeable future issues, then patchfile will probably be the best route. Otherwise the former.
Comment 11 Justin Coffman 2017-10-22 18:54:43 UTC
(In reply to Richard Gallamore from comment #10)

Thinking about it in forward terms, byobu's widgets make so many assumptions regarding the presence of a Linux procfs on /proc that NOT adding it to the Makefile will probably necessitate future patches of exactly the same variety as I've submitted.
Comment 12 commit-hook freebsd_committer freebsd_triage 2018-06-16 22:51:49 UTC
A commit references this bug:

Author: swills
Date: Sat Jun 16 22:51:26 UTC 2018
New revision: 472574
URL: https://svnweb.freebsd.org/changeset/ports/472574

Log:
  sysutils/byobu: add patches to use linprocfs

  PR:		202367
  Submitted by:	Justin Coffman <coffmanjk@gmail.com>
  Approved by:	maintainer timeout (amutu@amutu.com, >10 months)

Changes:
  head/sysutils/byobu/Makefile
  head/sysutils/byobu/files/
  head/sysutils/byobu/files/patch-usr_lib_byobu_battery
  head/sysutils/byobu/files/patch-usr_lib_byobu_cpu__count
  head/sysutils/byobu/files/patch-usr_lib_byobu_cpu__freq
  head/sysutils/byobu/files/patch-usr_lib_byobu_cpu__temp
  head/sysutils/byobu/files/patch-usr_lib_byobu_disk
  head/sysutils/byobu/files/patch-usr_lib_byobu_ec2__cost
  head/sysutils/byobu/files/patch-usr_lib_byobu_entropy
  head/sysutils/byobu/files/patch-usr_lib_byobu_fan__speed
  head/sysutils/byobu/files/patch-usr_lib_byobu_ip__address
  head/sysutils/byobu/files/patch-usr_lib_byobu_load__average
  head/sysutils/byobu/files/patch-usr_lib_byobu_memory
  head/sysutils/byobu/files/patch-usr_lib_byobu_network
  head/sysutils/byobu/files/patch-usr_lib_byobu_processes
  head/sysutils/byobu/files/patch-usr_lib_byobu_raid
  head/sysutils/byobu/files/patch-usr_lib_byobu_rcs__cost
  head/sysutils/byobu/files/patch-usr_lib_byobu_reboot__required
  head/sysutils/byobu/files/patch-usr_lib_byobu_swap
  head/sysutils/byobu/files/patch-usr_lib_byobu_uptime
  head/sysutils/byobu/pkg-message
Comment 13 Steve Wills freebsd_committer freebsd_triage 2018-06-16 22:52:32 UTC
Committed, thanks!