I have no idea how to implement this patch or how to even go about it.
Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I have no idea how to implement this patch or how to even go about it.
I am hoping someone can point me in the right direction.
The story so far…
I have a Raspberry Pi 3 running Raspbian Stretch Lite and Avhai.
I followed this guide to get Avhai successfully up and running and reflecting mDNS across my Vlans. https://chrisreinking.com/need-bonjo...avahi-gateway/
However I need to restrict Avhai to only reflect traffic for Airplay. I have a handful of Apple Tvs that are sitting on Vlan 1 that need to be accessible via AirPlay on Vlan 2.
Thank you for pointing me in the right direction.
I was able to copy the patch files to the pi via ssh, by following this tutorial. https://www.youtube.com/watch?v=fmMg6cyww14
Then I ran the following command per your suggestion.
Code:
patch -p1 < airplay.service.patch
This resulted in the following
Code:
patch -p1 < airplay-service.patch
can't find file to patch at input line 5
Perhaps you used the wrong -p or --strip option?
The text leading up to this was:
--------------------------
|diff --git a/service-type-database/service-types b/service-type-database/service-types
|index 6e7e2cd..54719af 100644
|--- a/service-type-database/service-types
|+++ b/service-type-database/service-types
--------------------------
File to patch:
No knowing what to do next I exited the ssh session and ran the other patch thinking maybe I need to run that one first.
Here is the result.
Code:
patch -p1 < 0001-Filtering-Reflector-Advertisements.patch
can't find file to patch at input line 30
Perhaps you used the wrong -p or --strip option?
The text leading up to this was:
--------------------------
|From 0e9f40ff16f2d1582b3e1200a7a35f83f216f4f2 Mon Sep 17 00:00:00 2001
|From: James Rudd <James.Rudd@sbhs.nsw.edu.au>
|Date: Mon, 25 Aug 2014 16:23:33 +1000
|Subject: [[PATCH] Filtering Reflector Advertisements] Filtering Reflector
| Advertisements
|
|Allows Avahi-Daemon to filter which advertisements are added to the cache to be reflected to different networks.
|It checks incoming service names against a list defined in avahi-daemon.conf [reflector] reflect-filters.
|The list can be types of services or can contain hostnames to match.
|For example we only allow AirPlay and AirTunes to be reflected between VLANs, so have "_airplay._tcp.local,_raop._tcp.local" set.
|
|The patch will block the PTR and SRV advertisements but will still allow A records for machine name lookup.
|All locally published services are still published even if they do not match the filter.
|
|The filter also blocks local programs from seeing advertised programs so it is recommend to only enable it on a dedicated bonjour reflector server.
|
|Signed-off-by: James Rudd <James.Rudd@sbhs.nsw.edu.au>
|---
| avahi-core/core.h | 1 +
| avahi-core/server.c | 42 +++++++++++++++++++++++++++++++++++++++++-
| avahi-daemon/avahi-daemon.conf | 1 +
| avahi-daemon/main.c | 12 ++++++++++++
| man/avahi-daemon.conf.5.xml.in | 10 ++++++++++
| 5 files changed, 65 insertions(+), 1 deletion(-)
|
|diff --git a/avahi-core/core.h b/avahi-core/core.h
|index f50c612..1ebd27a 100644
|--- a/avahi-core/core.h
|+++ b/avahi-core/core.h
--------------------------
File to patch:
Distribution: Debian testing/sid; OpenSuSE; Fedora; Mint
Posts: 5,524
Rep:
In the beginning of the patch file there is a path to a file. Depending on how you store the files to be patched, you may need to trim the path using the -p option. See the man page for patch.
Distribution: Debian testing/sid; OpenSuSE; Fedora; Mint
Posts: 5,524
Rep:
The patch itself lists which files to patch. That is all automated. You just have to get the -p value correct. Did you open one of the patch files and look at it? That might help you understand. And read the man page for patch.
Here are the contents of the airplay-service.patch file.
Code:
diff --git a/service-type-database/service-types b/service-type-database/service-types
index 6e7e2cd..54719af 100644
--- a/service-type-database/service-types
+++ b/service-type-database/service-types
@@ -139,6 +139,7 @@ _realplayfavs._tcp:RealPlayer Shared Favorites
_realplayfavs._tcp[it]:RealPlayer - Preferiti Condivisi
_raop._tcp:AirTunes Remote Audio
+_airplay._tcp:AirPlay Remote Video
_rtsp._tcp:RTSP Realtime Streaming Server
_rtp._udp:RTP Realtime Streaming Server
I am not sure what p switch I should use I have tried -p1, -n, etc but they all return the same error.
Code:
sudo patch -p1 < airplay-service.patch
can't find file to patch at input line 5
Perhaps you used the wrong -p or --strip option?
The text leading up to this was:
--------------------------
|diff --git a/service-type-database/service-types b/service-type-database/service-types
|index 6e7e2cd..54719af 100644
|--- a/service-type-database/service-types
|+++ b/service-type-database/service-types
--------------------------
File to patch:
Also on the main page for the patch I see where James talks about compiling and modifying a makefile. Is this something I need to do?
Distribution: Debian testing/sid; OpenSuSE; Fedora; Mint
Posts: 5,524
Rep:
The following is a path to a file the patch will patch.
Quote:
a/service-type-database/service-types
'a' is the top directory. So, the patch will be looking in 'service-type-database' directory for the file 'service-types' in order to patch it. '-p1' will strip off the first '/', leaving 'service-type-database/service-types'. So, if your directly above the service-type-database directory, you would use '-p1'. If you're in service-type-database directory, you would use '-p2'.
If you store the files in a different directory structure, you would go to the directory with the file to be patched and use '-p2'.
So I wasn't able to find the "a" directory.
But I did find the service-types directory in the usr folder and was able to patch it.
Code:
pi@Avahi:~ $ sudo patch -p1 < airplay-service.patch
can't find file to patch at input line 5
Perhaps you used the wrong -p or --strip option?
The text leading up to this was:
--------------------------
|diff --git a/service-type-database/service-types b/service-type-database/service-types
|index 6e7e2cd..54719af 100644
|--- a/service-type-database/service-types
|+++ b/service-type-database/service-types
--------------------------
File to patch: /usr/share/avahi/service-types
patching file /usr/share/avahi/service-types
pi@Avahi:~ $
My next challenge is finding a file called core.h so I can run the second patch
To patch means usually update / change source code with a file that contains updated code, the patch file
So first you have to download the source code directory tree in a working directory.
Then you use the patch program with the patch file in the working directory.
After patch succeeds, the source code is changed. Now you have to compile the code (and optionnally make a package) using appropriate scripts, like configure, make etc
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.