From owner-freebsd-questions@freebsd.org Tue Oct 22 05:41:26 2019 Return-Path: Delivered-To: freebsd-questions@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C254D16FB8C for ; Tue, 22 Oct 2019 05:41:26 +0000 (UTC) (envelope-from freebsd@edvax.de) Received: from mout.kundenserver.de (mout.kundenserver.de [217.72.192.73]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "mout.kundenserver.de", Issuer "TeleSec ServerPass Class 2 CA" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46y2S45FPbz4LYP for ; Tue, 22 Oct 2019 05:41:24 +0000 (UTC) (envelope-from freebsd@edvax.de) Received: from r56.edvax.de ([178.12.116.99]) by mrelayeu.kundenserver.de (mreue107 [212.227.15.183]) with ESMTPA (Nemesis) id 1MTzOe-1iV8fi0kZm-00R52x; Tue, 22 Oct 2019 07:41:20 +0200 Date: Tue, 22 Oct 2019 07:41:18 +0200 From: Polytropon To: "Clay Daniels Jr." Cc: Yasuhiro KIMURA , "freebsd-questions@freebsd.org" Subject: Re: How to apply a patch to a port Message-Id: <20191022074118.0a08c0ad.freebsd@edvax.de> In-Reply-To: References: <20191022.053926.1076439053946694541.yasu@utahime.org> <9ac08912-0415-0830-9381-6df157fe6ab1@gmail.com> <20191022.090814.157299176887147047.yasu@utahime.org> Reply-To: Polytropon Organization: EDVAX X-Mailer: Sylpheed 3.1.1 (GTK+ 2.24.5; i386-portbld-freebsd8.2) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Provags-ID: V03:K1:4+AcyIRNTRtLGgNxeVytdypFzAcgbuoivu8a8xs+psaeuBsof/3 Fq09+HdRMKJ8zR6LU4UgXQ3ShSr3ol+mLTLO96l+ZvxrGxZXabowL8t9XYHAXYwKpOGryCf EOWpcJfqw+8Y/9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= X-Rspamd-Queue-Id: 46y2S45FPbz4LYP X-Spamd-Bar: ++++ Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=none (mx1.freebsd.org: domain of freebsd@edvax.de has no SPF policy when checking 217.72.192.73) smtp.mailfrom=freebsd@edvax.de X-Spamd-Result: default: False [4.64 / 15.00]; TO_DN_EQ_ADDR_SOME(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; HAS_REPLYTO(0.00)[freebsd@edvax.de]; TO_DN_SOME(0.00)[]; MV_CASE(0.50)[]; HAS_ORG_HEADER(0.00)[]; FREEMAIL_TO(0.00)[gmail.com]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:8560, ipnet:217.72.192.0/20, country:DE]; RCVD_TLS_LAST(0.00)[]; RECEIVED_SPAMHAUS_PBL(0.00)[99.116.12.178.khpj7ygk5idzvmvt5x4ziurxhy.zen.dq.spamhaus.net : 127.0.0.11]; ARC_NA(0.00)[]; REPLYTO_EQ_FROM(0.00)[]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[3]; TAGGED_RCPT(0.00)[]; MIME_GOOD(-0.10)[text/plain]; DMARC_NA(0.00)[edvax.de]; AUTH_NA(1.00)[]; NEURAL_SPAM_MEDIUM(0.76)[0.756,0]; TO_MATCH_ENVRCPT_SOME(0.00)[]; NEURAL_SPAM_LONG(0.99)[0.991,0]; MID_CONTAINS_FROM(1.00)[]; RCVD_IN_DNSWL_NONE(0.00)[73.192.72.217.list.dnswl.org : 127.0.5.0]; R_SPF_NA(0.00)[]; RCVD_COUNT_TWO(0.00)[2]; IP_SCORE(0.50)[ip: (0.27), ipnet: 217.72.192.0/20(0.24), asn: 8560(1.99), country: DE(-0.01)] X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Oct 2019 05:41:26 -0000 Following this thread, I think the file's content might be damaged? Or maybe it's just the MUA which mangled the lines... Allow me a few notes: On Mon, 21 Oct 2019 21:57:42 -0500, Clay Daniels Jr. wrote: > Thanks Yasuhiro. My patch file is a text file named > patch-linuxkpi_gplv2_src_linux__page.c with this content: > > diff --git a/linuxkpi/gplv2/src/linux_page.c > b/linuxkpi/gplv2/src/linux_page.c That should be _one_ line: diff --git a/linuxkpi/gplv2/src/linux_page.c b/linuxkpi/gplv2/src/linux_page.c The common notation is: diff --git > index e2b85c45c..060ae85ed 100644 That's, if I remember correctly, a git-specific line, but probably it won't do any harm. For testing, you could remove that line... > --- a/linuxkpi/gplv2/src/linux_page.c > +++ b/linuxkpi/gplv2/src/linux_page.c > @@ -239,7 +239,7 @@ retry: > page = vm_page_lookup(devobj, i); > if (page == NULL) > continue; > - if (vm_page_sleep_if_busy(page, "linuxkpi")) > + if (!vm_page_busy_acquire(page, VM_ALLOC_WAITFAIL)) > goto retry; > cdev_pager_free_page(devobj, page); > } This looks reasonable so far. :-) > I copied it, as root, from my thumbdrive to a /root/files directory I > created. Then i went to the main port directory for drm-current-kmod, ran > make patch, which did a lot of activity and created a /work/kms-drm-2d2852e > directory, where I tried to run: > patch -p 1 -s -i /root/files/patch-linuxkpi_gplv2_src_linux__page.c > It said 1 of 1 hunks failed - saving rejects... > Then I changed it to say -p 1, ran that and it asks: "File to patch:" > > I answered linux_page.c because I could not think of anything else, but the > file was not found. There are a lot of files created by the "make patch" > command and I'm looking through them now, though I'm not really sure what > I'm looking for. Then maybe I did guess right: the input patch file could be damaged. The procedure to apply external patches is correct. For reference purposes: https://www.freebsd.org/doc/en/books/porters-handbook/slow-patch.html Note that the file _name_ has to be in a specific format (see 4.4.2. example 2), but I think the file name you mentioned above conforms to that rule. Oh, and there's "man 7 ports" worth having a loot at: https://www.freebsd.org/cgi/man.cgi?ports(7) > Between our emails, I discovered the FreeBSD Porter's Handbook and it has a > lot of info I need to read. Of course I want to get this one patch > installed, but most importantly I want to know how to do it again, and > understand what I'm doing. For that _one_ line (!) change, you could manually edit the one file it corresponds to, as a temporary workaround, but of course that's not nearly what you want to achieve in the lon run. ;-) -- Polytropon Magdeburg, Germany Happy FreeBSD user since 4.0 Andra moi ennepe, Mousa, ...