When you try a new patch for sys-freebsd packages, need to change the ebuild. Call epatch_user in freebsd.eclass, we will be able to easily try new patch without changing ebuild. Please add epatch_user to freebsd.eclass for ease the development and use. FYI, Function epatch_user is included in eutils.eclass. http://devmanual.gentoo.org/eclass-reference/eutils.eclass/index.html
Created attachment 330358 [details, diff] patch for eclass/freebsd.eclass
Created attachment 330362 [details, diff] patch for freebsd-sources-9.1_rc3.ebuild Must be bump to EAPI=2 for freebsd.eclass work properly.
Created attachment 330364 [details, diff] patch for freebsd-sources/files/freebsd-sources-9.1-gentoo.patch The change from LDADD=-ll to LDADD=-lfl by freebsd_rename_libraries of freebsd.eclass automatically.
Created attachment 330366 [details, diff] patch for freebsd-pam-modules-9.1_rc3.ebuild bump to EAPI=2
Steps to Reproduce: 1. Apply patches all of attachments. 2. mkdir -p /etc/portage/patches/sys-freebsd/freebsd-sources 3. wget -O /etc/portage/patches/sys-freebsd/freebsd-sources/100_CVE-2012-4576.patch http://security.FreeBSD.org/patches/SA-12:08/linux.patch 4. cd /usr/portage/sys-freebsd/freebsd-sources 5. ebuild freebsd-sources-9.1_rc3.ebuild prepare * freebsd-sys-9.1_rc3.tar.bz2 SHA256 SHA512 WHIRLPOOL size ;-) ... [ ok ] * checking ebuild checksums ;-) ... [ ok ] * checking auxfile checksums ;-) ... [ ok ] * checking miscfile checksums ;-) ... [ ok ] >>> Unpacking source... >>> Unpacking freebsd-sys-9.1_rc3.tar.bz2 to /var/tmp/portage/sys-freebsd/freebsd-sources-9.1_rc3/work * Applying user patches from /etc/portage/patches//sys-freebsd/freebsd-sources ... * 100_CVE-2012-4576.patch ... [ ok ] * Done with patching * Renaming libraries ... [ ok ] >>> Source unpacked in /var/tmp/portage/sys-freebsd/freebsd-sources-9.1_rc3/work >>> Preparing source in /var/tmp/portage/sys-freebsd/freebsd-sources-9.1_rc3/work/sys ... * Applying freebsd-sources-9.0-disable-optimization.patch ... [ ok ] * Applying freebsd-sources-9.1-gentoo.patch ... [ ok ] <snip>
ok let me see if i get it correctly: adding epatch_user to freebsd_src_unpack is trivial; but then some ebuilds do not call it properly so you need to change them right ? and one of freebsd-sources patches isnt needed anymore ?
(In reply to comment #6) > ok let me see if i get it correctly: adding epatch_user to > freebsd_src_unpack is trivial; but then some ebuilds do not call it properly > so you need to change them right ? sorry, patches that I attached to the first was wrong. ebuild that is defined src_unpack don't call freebsd_src_unpack always. (regardless of definition of EAPI) freebsd_do_patches not called only 2 packages that I attach patches. Otherwise, freebsd_src_unpack or freebsd_do_patches are included in src_unpack or not is defined src_unpack. I'll attach patches to make minimal changes. > and one of freebsd-sources patches isnt needed anymore ? Are you about 330364 attachment ? freebsd-sources-9.1-gentoo.patch is patch for two files. Requires part of sys/conf/kern.mk. please don't remove it. The only changes to -lfl from -ll in sys/dev/aic7xxx/aicasm/Makefile. freebsd_src_unpack or freebsd_rename_libraries if called in ebuild, this part is not required. I think better to call freebsd_rename_libraries instead of patch. details, please see freebsd_rename_libraries function in freebsd.eclass. FYI, http://sources.gentoo.org/cgi-bin/viewvc.cgi/gentoo-x86/eclass/freebsd.eclass freebsd_rename_libraries() { <snip> # flex provides libfl, not libl find "${S}" -name Makefile -print0 | xargs -0 \ sed -i -e 's:-ll$:-lfl:g; s:-ll :-lfl :g; s:{LIBL}:{LIBFL}:g' <snip> }
Created attachment 330396 [details, diff] minimal patch for freebsd-sources-9.1_rc3.ebuild add freebsd_do_patches and freebsd_rename_libraries to src_unpack.
Created attachment 330400 [details, diff] minimal patch for freebsd-pam-modules-9.1_rc3.ebuild
Created attachment 330404 [details, diff] sample patch for freebsd-sources-9.1_rc3.ebuild (clean up) freebsd-sources have a lot of patches. and call many times epatch. This patch clean up ebuild to use the functionality of freebsd.eclass. In addition remove sed -e 's/elf64-sparc/elf64-sparc-freebsd/g' -i "${S}/conf/ldscript.sparc64" || die Currently, fixed in upstream. http://svnweb.freebsd.org/base/releng/9.1/sys/conf/ldscript.sparc64?revision=239080&view=markup
Created attachment 330408 [details, diff] sample patch for freebsd-pam-modules-9.1_rc3.ebuild (clean up) changed to use the functionality of freebsd.eclass
@aballier I confirm success of emerge freebsd-pam-modules freebsd-sources. I have confirmed to kernel build also. Of course, both clean up patch and minimal patch. Please apply patches that you want.
(In reply to comment #6) > ok let me see if i get it correctly: adding epatch_user to > freebsd_src_unpack is trivial; I had overlooked. Please add epatch_user to freebsd_do_patches. freebsd-contrib don't call freebsd_src_unpack. Includes only freebsd_do_patches and freebsd_rename_libraries in src_unpack.
(In reply to comment #13) > (In reply to comment #6) > > ok let me see if i get it correctly: adding epatch_user to > > freebsd_src_unpack is trivial; > > I had overlooked. > Please add epatch_user to freebsd_do_patches. done this, lemme check the other patches
Comment on attachment 330358 [details, diff] patch for eclass/freebsd.eclass applid
Comment on attachment 330408 [details, diff] sample patch for freebsd-pam-modules-9.1_rc3.ebuild (clean up) applied
Comment on attachment 330400 [details, diff] minimal patch for freebsd-pam-modules-9.1_rc3.ebuild shouldnt be needed anymore
all done, thanks a lot!