summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDiego Elio Pettenò <flameeyes@gentoo.org>2006-09-04 18:49:15 +0000
committerDiego Elio Pettenò <flameeyes@gentoo.org>2006-09-04 18:49:15 +0000
commit387b496eeac6aed1c5edd3357ece67597bb76226 (patch)
treeb61cbe7705cf0f5d7ff8a28680b04ab9186e27fc /sys-freebsd/freebsd-sources
parentAdd ~x86-fbsd keyword. (diff)
downloadhistorical-387b496eeac6aed1c5edd3357ece67597bb76226.tar.gz
historical-387b496eeac6aed1c5edd3357ece67597bb76226.tar.bz2
historical-387b496eeac6aed1c5edd3357ece67597bb76226.zip
Add patch from Alex for sandbox not to deadlock devfs, see bug #146284.
Package-Manager: portage-2.1.1_rc1-r3
Diffstat (limited to 'sys-freebsd/freebsd-sources')
-rw-r--r--sys-freebsd/freebsd-sources/ChangeLog9
-rw-r--r--sys-freebsd/freebsd-sources/Manifest27
-rw-r--r--sys-freebsd/freebsd-sources/files/digest-freebsd-sources-6.1-r43
-rw-r--r--sys-freebsd/freebsd-sources/files/freebsd-sources-6.1-devfs-deadlock.patch165
-rw-r--r--sys-freebsd/freebsd-sources/freebsd-sources-6.1-r4.ebuild80
5 files changed, 275 insertions, 9 deletions
diff --git a/sys-freebsd/freebsd-sources/ChangeLog b/sys-freebsd/freebsd-sources/ChangeLog
index 1cc40ebf4718..988ce1c181b9 100644
--- a/sys-freebsd/freebsd-sources/ChangeLog
+++ b/sys-freebsd/freebsd-sources/ChangeLog
@@ -1,6 +1,13 @@
# ChangeLog for sys-freebsd/freebsd-sources
# Copyright 1999-2006 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/sys-freebsd/freebsd-sources/ChangeLog,v 1.18 2006/07/27 01:43:51 flameeyes Exp $
+# $Header: /var/cvsroot/gentoo-x86/sys-freebsd/freebsd-sources/ChangeLog,v 1.19 2006/09/04 18:49:15 flameeyes Exp $
+
+*freebsd-sources-6.1-r4 (04 Sep 2006)
+
+ 04 Sep 2006; Diego Pettenò <flameeyes@gentoo.org>
+ +files/freebsd-sources-6.1-devfs-deadlock.patch,
+ +freebsd-sources-6.1-r4.ebuild:
+ Add patch from Alex for sandbox not to deadlock devfs, see bug #146284.
27 Jul 2006; Diego Pettenò <flameeyes@gentoo.org>
-files/SA-06-04-ipfw.patch, -files/SA-06-06-kmem60.patch,
diff --git a/sys-freebsd/freebsd-sources/Manifest b/sys-freebsd/freebsd-sources/Manifest
index 1bac453ffb08..9acdbd693420 100644
--- a/sys-freebsd/freebsd-sources/Manifest
+++ b/sys-freebsd/freebsd-sources/Manifest
@@ -17,6 +17,10 @@ AUX freebsd-sources-6.0-werror.patch 898 RMD160 41a6f582a70018f29c96c08a5853bcbf
MD5 1c230261604f76eb3766df9769864942 files/freebsd-sources-6.0-werror.patch 898
RMD160 41a6f582a70018f29c96c08a5853bcbf167157d0 files/freebsd-sources-6.0-werror.patch 898
SHA256 7fbd139296e98697c94dcc6a4cd4d926b057779cb2415cb62bbb881b8acf26e5 files/freebsd-sources-6.0-werror.patch 898
+AUX freebsd-sources-6.1-devfs-deadlock.patch 4616 RMD160 85ce3ae845c435d5b50a4e820a9e3f9f364f7dde SHA1 99c7a0c61f9dbd31890865b6e86e01a71de67462 SHA256 196652d16339a1fe6c934c889c40eec78ed668c0fc2f253fed819587a7755825
+MD5 0e514494ce056f722aca5e98ff951916 files/freebsd-sources-6.1-devfs-deadlock.patch 4616
+RMD160 85ce3ae845c435d5b50a4e820a9e3f9f364f7dde files/freebsd-sources-6.1-devfs-deadlock.patch 4616
+SHA256 196652d16339a1fe6c934c889c40eec78ed668c0fc2f253fed819587a7755825 files/freebsd-sources-6.1-devfs-deadlock.patch 4616
AUX freebsd-sources-6.1-gcc41.patch 16013 RMD160 c259aec856d5d4b68682138c7b1112e60b6814fa SHA1 5a0e61de9dde00279d36425cc451a2e0af1b38ae SHA256 d5b702657dae7e30774c4222094166334e5e466ccc5307a92992ed8df29e6b05
MD5 8effd8101607ae4f84a9621e57f1ae2f files/freebsd-sources-6.1-gcc41.patch 16013
RMD160 c259aec856d5d4b68682138c7b1112e60b6814fa files/freebsd-sources-6.1-gcc41.patch 16013
@@ -34,10 +38,14 @@ EBUILD freebsd-sources-6.1-r3.ebuild 2419 RMD160 0b883b91a5c9e6c4cd5139fb16982e4
MD5 242afb82662fb880568a677072a59eb9 freebsd-sources-6.1-r3.ebuild 2419
RMD160 0b883b91a5c9e6c4cd5139fb16982e4b00696a5b freebsd-sources-6.1-r3.ebuild 2419
SHA256 bb0fa9e58602f70288ceb22f27f603bfb997686f48ddbc03e821abfa07f36e57 freebsd-sources-6.1-r3.ebuild 2419
-MISC ChangeLog 7274 RMD160 7e353bf7419ceddd77d71d2da166afdcfabf7b90 SHA1 5469a2b19c82e6ba338a2343e1568215e507fc77 SHA256 5379b5c327dc9bd2779d5faaf2883876f964cb11b1ac179c2d7eb22103369cc9
-MD5 c1d694bb2fb436449d8a36a062221524 ChangeLog 7274
-RMD160 7e353bf7419ceddd77d71d2da166afdcfabf7b90 ChangeLog 7274
-SHA256 5379b5c327dc9bd2779d5faaf2883876f964cb11b1ac179c2d7eb22103369cc9 ChangeLog 7274
+EBUILD freebsd-sources-6.1-r4.ebuild 2530 RMD160 bd3ba4af2cef79d5cd089bc0b0b7035267af81e2 SHA1 802dc37b0c3e2d43186702ab90466f1259d11c62 SHA256 de4c5bce9f0ca5fbb6b97b28fae0aa67e440ff03d4c3355ef9976325540c0766
+MD5 6a03faf7ce60f4ad00e01e3372ba65f9 freebsd-sources-6.1-r4.ebuild 2530
+RMD160 bd3ba4af2cef79d5cd089bc0b0b7035267af81e2 freebsd-sources-6.1-r4.ebuild 2530
+SHA256 de4c5bce9f0ca5fbb6b97b28fae0aa67e440ff03d4c3355ef9976325540c0766 freebsd-sources-6.1-r4.ebuild 2530
+MISC ChangeLog 7526 RMD160 9adad6bfa23833b844f1289ad0a4ec717293e51e SHA1 b15c9d73eb04951daea015c9f5519f928ac58252 SHA256 fffd649bcefc4880ce878d54c83204692e64dfd51de78ccb2e4bc63c1dfa3156
+MD5 c6397f64f1cbcbdc615d5ded30495b66 ChangeLog 7526
+RMD160 9adad6bfa23833b844f1289ad0a4ec717293e51e ChangeLog 7526
+SHA256 fffd649bcefc4880ce878d54c83204692e64dfd51de78ccb2e4bc63c1dfa3156 ChangeLog 7526
MISC metadata.xml 156 RMD160 60b5820a08275f307e5bd936d78f5afd1f141086 SHA1 d9d9d4f2b5afc58339ea3e562fca490156935f1f SHA256 30ab515d6ac492d3d6c36ac3c675511742c2149e56a6b3228c8d22ab8edb3ff7
MD5 2bd48a5ae413433cbb36110b219ce97c metadata.xml 156
RMD160 60b5820a08275f307e5bd936d78f5afd1f141086 metadata.xml 156
@@ -45,10 +53,13 @@ SHA256 30ab515d6ac492d3d6c36ac3c675511742c2149e56a6b3228c8d22ab8edb3ff7 metadata
MD5 bfcb2966c1ec6e468c2575c36179479c files/digest-freebsd-sources-6.1-r3 256
RMD160 e3e91956a4a0e172a5a548c6b069c24f9864b6d9 files/digest-freebsd-sources-6.1-r3 256
SHA256 a390411c7d0ce30970aac523a261176bf7fcb5235d6f782156ec5d52ddc382a1 files/digest-freebsd-sources-6.1-r3 256
+MD5 bfcb2966c1ec6e468c2575c36179479c files/digest-freebsd-sources-6.1-r4 256
+RMD160 e3e91956a4a0e172a5a548c6b069c24f9864b6d9 files/digest-freebsd-sources-6.1-r4 256
+SHA256 a390411c7d0ce30970aac523a261176bf7fcb5235d6f782156ec5d52ddc382a1 files/digest-freebsd-sources-6.1-r4 256
-----BEGIN PGP SIGNATURE-----
-Version: GnuPG v1.4.4 (GNU/Linux)
+Version: GnuPG v1.4.5 (GNU/Linux)
-iD8DBQFEyBpeAiZjviIA2XgRAj0DAKChJ/PHDQKHTOW05jtQi4Dt2rd5WACggkoJ
-+TvANn3pPEaHDOURLnNFXJM=
-=0H9O
+iD8DBQFE/HUzAiZjviIA2XgRAt7ZAKCU588ES4HwRfrY6jPNGPAZCF+CHQCbB4UB
+WCAO5l5Yccz/QaxREZpc8F8=
+=BFdo
-----END PGP SIGNATURE-----
diff --git a/sys-freebsd/freebsd-sources/files/digest-freebsd-sources-6.1-r4 b/sys-freebsd/freebsd-sources/files/digest-freebsd-sources-6.1-r4
new file mode 100644
index 000000000000..ed81a3f45c74
--- /dev/null
+++ b/sys-freebsd/freebsd-sources/files/digest-freebsd-sources-6.1-r4
@@ -0,0 +1,3 @@
+MD5 8893a0a0ddfa8959f71e8ee561a11333 freebsd-sys-6.1.tar.bz2 17361671
+RMD160 eb19f6a345c665542df694a4f9170d227beaf3b6 freebsd-sys-6.1.tar.bz2 17361671
+SHA256 d2ecd79b83ba06c12e358adfccc7e057e15fb7c5be76d92c537b99cbe1d84f0f freebsd-sys-6.1.tar.bz2 17361671
diff --git a/sys-freebsd/freebsd-sources/files/freebsd-sources-6.1-devfs-deadlock.patch b/sys-freebsd/freebsd-sources/files/freebsd-sources-6.1-devfs-deadlock.patch
new file mode 100644
index 000000000000..016bdb9d1f19
--- /dev/null
+++ b/sys-freebsd/freebsd-sources/files/freebsd-sources-6.1-devfs-deadlock.patch
@@ -0,0 +1,165 @@
+diff -Naur devfs/devfs.h devfsb/devfs.h
+--- fs/devfs/devfs.h 2006-08-18 17:23:00 +0000
++++ fs/devfsb/devfs.h 2006-09-03 19:34:57 +0000
+@@ -163,7 +163,7 @@
+ void devfs_rules_apply(struct devfs_mount *dm, struct devfs_dirent *de);
+ void devfs_rules_cleanup (struct devfs_mount *dm);
+ int devfs_rules_ioctl(struct devfs_mount *dm, u_long cmd, caddr_t data, struct thread *td);
+-int devfs_allocv (struct devfs_dirent *de, struct mount *mp, struct vnode **vpp, struct thread *td);
++int devfs_allocv (struct devfs_dirent *de, struct mount *mp, struct vnode **vpp, int *dm_unlock, struct thread *td);
+ struct cdev **devfs_itod (int inode);
+ struct devfs_dirent **devfs_itode (struct devfs_mount *dm, int inode);
+ void devfs_delete(struct devfs_mount *dm, struct devfs_dirent *de);
+diff -Naur devfs/devfs_vfsops.c devfsb/devfs_vfsops.c
+--- fs/devfs/devfs_vfsops.c 2006-08-18 17:23:00 +0000
++++ fs/devfsb/devfs_vfsops.c 2006-09-03 19:34:57 +0000
+@@ -139,9 +139,11 @@
+ int error;
+ struct vnode *vp;
+ struct devfs_mount *dmp;
++ int dm_unlock;
+
+ dmp = VFSTODEVFS(mp);
+- error = devfs_allocv(dmp->dm_rootdir, mp, &vp, td);
++ dm_unlock = 0;
++ error = devfs_allocv(dmp->dm_rootdir, mp, &vp, &dm_unlock, td);
+ if (error)
+ return (error);
+ vp->v_vflag |= VV_ROOT;
+diff -Naur devfs/devfs_vnops.c devfsb/devfs_vnops.c
+--- fs/devfs/devfs_vnops.c 2006-08-18 17:23:00 +0000
++++ fs/devfsb/devfs_vnops.c 2006-09-03 19:34:57 +0000
+@@ -124,16 +124,23 @@
+ }
+
+ int
+-devfs_allocv(struct devfs_dirent *de, struct mount *mp, struct vnode **vpp, struct thread *td)
++devfs_allocv(struct devfs_dirent *de, struct mount *mp, struct vnode **vpp,
++ int *dm_unlock, struct thread *td)
+ {
+ int error;
+ struct vnode *vp;
+ struct cdev *dev;
++ struct devfs_mount *dmp;
+
+ KASSERT(td == curthread, ("devfs_allocv: td != curthread"));
++ dmp = VFSTODEVFS(mp);
+ loop:
+ vp = de->de_vnode;
+ if (vp != NULL) {
++ if (*dm_unlock) {
++ sx_xunlock(&dmp->dm_lock);
++ *dm_unlock = 0;
++ }
+ if (vget(vp, LK_EXCLUSIVE, td))
+ goto loop;
+ *vpp = vp;
+@@ -173,6 +180,10 @@
+ }
+ vp->v_data = de;
+ de->de_vnode = vp;
++ if (*dm_unlock) {
++ sx_xunlock(&dmp->dm_lock);
++ *dm_unlock = 0;
++ }
+ vn_lock(vp, LK_EXCLUSIVE | LK_RETRY, td);
+ #ifdef MAC
+ mac_associate_vnode_devfs(mp, de, vp);
+@@ -453,7 +464,7 @@
+ }
+
+ static int
+-devfs_lookupx(struct vop_lookup_args *ap)
++devfs_lookupx(struct vop_lookup_args *ap, int *dm_unlock)
+ {
+ struct componentname *cnp;
+ struct vnode *dvp, **vpp;
+@@ -504,7 +515,7 @@
+ de = TAILQ_FIRST(&dd->de_dlist); /* "." */
+ de = TAILQ_NEXT(de, de_list); /* ".." */
+ de = de->de_dir;
+- error = devfs_allocv(de, dvp->v_mount, vpp, td);
++ error = devfs_allocv(de, dvp->v_mount, vpp, dm_unlock, td);
+ vn_lock(dvp, LK_EXCLUSIVE | LK_RETRY, td);
+ return (error);
+ }
+@@ -561,7 +572,7 @@
+ return (0);
+ }
+ }
+- error = devfs_allocv(de, dvp->v_mount, vpp, td);
++ error = devfs_allocv(de, dvp->v_mount, vpp, dm_unlock, td);
+ return (error);
+ }
+
+@@ -570,11 +581,14 @@
+ {
+ int j;
+ struct devfs_mount *dmp;
++ int dm_unlock;
+
+ dmp = VFSTODEVFS(ap->a_dvp->v_mount);
++ dm_unlock = 1;
+ sx_xlock(&dmp->dm_lock);
+- j = devfs_lookupx(ap);
+- sx_xunlock(&dmp->dm_lock);
++ j = devfs_lookupx(ap, &dm_unlock);
++ if (dm_unlock == 1)
++ sx_xunlock(&dmp->dm_lock);
+ return (j);
+ }
+
+@@ -586,6 +600,7 @@
+ struct thread *td;
+ struct devfs_dirent *dd, *de;
+ struct devfs_mount *dmp;
++ int dm_unlock;
+ int error;
+
+ /*
+@@ -597,6 +612,7 @@
+ dvp = ap->a_dvp;
+ dmp = VFSTODEVFS(dvp->v_mount);
+ sx_xlock(&dmp->dm_lock);
++ dm_unlock = 1;
+
+ cnp = ap->a_cnp;
+ vpp = ap->a_vpp;
+@@ -617,9 +633,10 @@
+ if (de == NULL)
+ goto notfound;
+ de->de_flags &= ~DE_WHITEOUT;
+- error = devfs_allocv(de, dvp->v_mount, vpp, td);
++ error = devfs_allocv(de, dvp->v_mount, vpp, &dm_unlock, td);
+ notfound:
+- sx_xunlock(&dmp->dm_lock);
++ if (dm_unlock == 1)
++ sx_xunlock(&dmp->dm_lock);
+ return (error);
+ }
+
+@@ -1101,6 +1118,7 @@
+ struct devfs_dirent *de;
+ struct devfs_mount *dmp;
+ struct thread *td;
++ int dm_unlock;
+
+ td = ap->a_cnp->cn_thread;
+ KASSERT(td == curthread, ("devfs_symlink: td != curthread"));
+@@ -1119,12 +1137,14 @@
+ de->de_symlink = malloc(i, M_DEVFS, M_WAITOK);
+ bcopy(ap->a_target, de->de_symlink, i);
+ sx_xlock(&dmp->dm_lock);
++ dm_unlock = 1;
+ #ifdef MAC
+ mac_create_devfs_symlink(ap->a_cnp->cn_cred, dmp->dm_mount, dd, de);
+ #endif
+ TAILQ_INSERT_TAIL(&dd->de_dlist, de, de_list);
+- devfs_allocv(de, ap->a_dvp->v_mount, ap->a_vpp, td);
+- sx_xunlock(&dmp->dm_lock);
++ devfs_allocv(de, ap->a_dvp->v_mount, ap->a_vpp, &dm_unlock, td);
++ if (dm_unlock == 1)
++ sx_xunlock(&dmp->dm_lock);
+ return (0);
+ }
+
diff --git a/sys-freebsd/freebsd-sources/freebsd-sources-6.1-r4.ebuild b/sys-freebsd/freebsd-sources/freebsd-sources-6.1-r4.ebuild
new file mode 100644
index 000000000000..541822fca1be
--- /dev/null
+++ b/sys-freebsd/freebsd-sources/freebsd-sources-6.1-r4.ebuild
@@ -0,0 +1,80 @@
+# Copyright 1999-2006 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/sys-freebsd/freebsd-sources/freebsd-sources-6.1-r4.ebuild,v 1.1 2006/09/04 18:49:15 flameeyes Exp $
+
+inherit bsdmk freebsd flag-o-matic
+
+DESCRIPTION="FreeBSD kernel sources"
+SLOT="${PVR}"
+KEYWORDS="~x86-fbsd"
+
+IUSE="symlink"
+
+SRC_URI="mirror://gentoo/${SYS}.tar.bz2"
+
+RDEPEND=">=sys-freebsd/freebsd-mk-defs-6.0-r1"
+DEPEND=""
+
+RESTRICT="strip binchecks"
+
+S="${WORKDIR}/sys"
+
+MY_PVR="${PVR}"
+
+[[ ${MY_PVR} == "${RV}" ]] && MY_PVR="${MY_PVR}-r0"
+
+src_unpack() {
+ unpack ${A}
+ cd "${S}"
+
+ # This replaces the gentoover patch, it doesn't need reapply every time.
+ sed -i -e 's:^REVISION=.*:REVISION="'${PVR}'":' \
+ -e 's:^BRANCH=.*:BRANCH="Gentoo":' \
+ -e 's:^VERSION=.*:VERSION="${TYPE} ${BRANCH} ${REVISION}":' \
+ "${S}/conf/newvers.sh"
+
+ epatch "${FILESDIR}/${PN}-gentoo.patch"
+ epatch "${FILESDIR}/${PN}-6.0-flex-2.5.31.patch"
+ epatch "${FILESDIR}/${PN}-6.0-asm.patch"
+ epatch "${FILESDIR}/${PN}-6.0-werror.patch"
+ epatch "${FILESDIR}/${PN}-6.1-gcc41.patch"
+ epatch "${FILESDIR}/${PN}-6.1-intrcnt.patch"
+
+ # This is to be able to use sandbox safely, see bug #146284
+ epatch "${FILESDIR}/${P}-devfs-deadlock.patch"
+
+ epatch "${FILESDIR}/SA-06-16-smbfs.patch"
+
+ # Disable SSP for the kernel
+ grep -Zlr -- -ffreestanding "${S}" | xargs -0 sed -i -e \
+ "s:-ffreestanding:-ffreestanding $(test-flags -fno-stack-protector -fno-stack-protector-all):g"
+}
+
+src_compile() {
+ einfo "Nothing to compile.."
+}
+
+src_install() {
+ insinto "/usr/src/sys-${MY_PVR}"
+ doins -r "${S}/"*
+}
+
+pkg_postinst() {
+ if [[ ! -L "${ROOT}/usr/src/sys" ]]; then
+ einfo "/usr/src/sys symlink doesn't exist; creating symlink to sys-${MY_PVR}..."
+ ln -sf "sys-${MY_PVR}" "${ROOT}/usr/src/sys" || \
+ eerror "Couldn't create ${ROOT}/usr/src/sys symlink."
+ # just in case...
+ [[ -L ""${ROOT}/usr/src/sys-${RV}"" ]] && rm "${ROOT}/usr/src/sys-${RV}"
+ ln -sf "sys-${MY_PVR}" "${ROOT}/usr/src/sys-${RV}" || \
+ eerror "Couldn't create ${ROOT}/usr/src/sys-${RV} symlink."
+ elif use symlink; then
+ einfo "Updating /usr/src/sys symlink to sys-${MY_PVR}..."
+ rm "${ROOT}/usr/src/sys" "${ROOT}/usr/src/sys-${RV}" || \
+ eerror "Couldn't remove previous symlinks, please fix manually."
+ ln -sf "sys-${MY_PVR}" "${ROOT}/usr/src/sys" || \
+ eerror "Couldn't create ${ROOT}/usr/src/sys symlink."
+ ln -sf "sys-${MY_PVR}" "${ROOT}/usr/src/sys-${RV}" || \
+ eerror "Couldn't create ${ROOT}/usr/src/sys-${RV} symlink."
+ fi
+}