summaryrefslogtreecommitdiff
path: root/sys-block/iscsitarget
diff options
context:
space:
mode:
authorV3n3RiX <venerix@redcorelinux.org>2017-10-09 18:53:29 +0100
committerV3n3RiX <venerix@redcorelinux.org>2017-10-09 18:53:29 +0100
commit4f2d7949f03e1c198bc888f2d05f421d35c57e21 (patch)
treeba5f07bf3f9d22d82e54a462313f5d244036c768 /sys-block/iscsitarget
reinit the tree, so we can have metadata
Diffstat (limited to 'sys-block/iscsitarget')
-rw-r--r--sys-block/iscsitarget/Manifest28
-rw-r--r--sys-block/iscsitarget/files/ietd-conf.d29
-rw-r--r--sys-block/iscsitarget/files/ietd-init.d-2105
-rw-r--r--sys-block/iscsitarget/files/iscsitarget-0.4.15-isns-set-scn-flag.patch20
-rw-r--r--sys-block/iscsitarget/files/iscsitarget-0.4.17+linux-2.6.28.patch82
-rw-r--r--sys-block/iscsitarget/files/iscsitarget-0.4.17+linux-2.6.29.patch40
-rw-r--r--sys-block/iscsitarget/files/iscsitarget-0.4.17+linux-2.6.30.patch37
-rw-r--r--sys-block/iscsitarget/files/iscsitarget-0.4.17-build.patch23
-rw-r--r--sys-block/iscsitarget/files/iscsitarget-1.4.18+linux-2.6.32.patch42
-rw-r--r--sys-block/iscsitarget/files/iscsitarget-1.4.19+linux-2.6.33.patch12
-rw-r--r--sys-block/iscsitarget/files/iscsitarget-1.4.20.2-respect-flags-v2.patch10
-rw-r--r--sys-block/iscsitarget/files/iscsitarget-1.4.20.2-respect-flags.patch32
-rw-r--r--sys-block/iscsitarget/files/iscsitarget-1.4.20.2_kernel-2.6.36.patch12
-rw-r--r--sys-block/iscsitarget/files/iscsitarget-1.4.20.2_p20130103-fix-3.2-support.patch135
-rw-r--r--sys-block/iscsitarget/files/iscsitarget-1.4.20.2_p20130103-restore-linux-2.6.32-support.patch96
-rw-r--r--sys-block/iscsitarget/iscsitarget-0.4.17.ebuild61
-rw-r--r--sys-block/iscsitarget/iscsitarget-1.4.19.ebuild69
-rw-r--r--sys-block/iscsitarget/iscsitarget-1.4.20.2.ebuild70
-rw-r--r--sys-block/iscsitarget/iscsitarget-1.4.20.2_p20130103.ebuild93
-rw-r--r--sys-block/iscsitarget/iscsitarget-1.4.20.2_p20130821.ebuild93
-rw-r--r--sys-block/iscsitarget/iscsitarget-9999.ebuild93
-rw-r--r--sys-block/iscsitarget/metadata.xml15
22 files changed, 1197 insertions, 0 deletions
diff --git a/sys-block/iscsitarget/Manifest b/sys-block/iscsitarget/Manifest
new file mode 100644
index 000000000000..2772d899a8f4
--- /dev/null
+++ b/sys-block/iscsitarget/Manifest
@@ -0,0 +1,28 @@
+AUX ietd-conf.d 950 SHA256 9b805a976493eae255a768e0d85c3a9477290c651732986c07f87fe477012e7c SHA512 779e3243f58ed8e728be36d18b040e6804e6d8e1a5f697d579327b52c184a30f6f17094de4cbee38da2f790f065445cb2571e5c4e0eda789b347f472474da578 WHIRLPOOL a475589e3527c4cf1a5bccb1271c4902f648cbe54f52920747e2a444524a7cb912e3ad4839f2d6ff48d147ce5bc253a0258edb73b6fbfa517b56eb86685860b8
+AUX ietd-init.d-2 2360 SHA256 1d4eff9f0b40713335b38df8e656515f416fbe3c84ca6963e88920bc23e0fefa SHA512 7fb14140d1a8a1502ab93f97b089b267c3b1e028fce212fdb0b856fffa1b00a94e4516a9c61cafedefc88406f3f0f5d86e85b673687ee418a965b138f440e651 WHIRLPOOL 19c5199902974e18dd246eba21a1a687b3202160bc7e65751196d06d744c49f09d296909dbd60ad72880b32f36a5dc38e8659b5946c1631ffe3cf5357740caa9
+AUX iscsitarget-0.4.15-isns-set-scn-flag.patch 507 SHA256 dc99ad8fa1cc10f6c6af4c99374dd0da14d3a56aebee2c48dd02cd8e156f9996 SHA512 7da5ef15d52121fd81f3f9a6afe97d4c8259f3b255a97d5e1329720c263970fe6a6764fdaf6be4caeeec76d9e87d9be19084504de4a146d5972961e72ecd84fa WHIRLPOOL d6229e41bd09a2ef1b6fec3fcd48304758cec5b7e539749f3b49bee3fed21d1f82f1811ce06980a839dcfe8194eda0b2d002b5079f53b03ab7bf5f71e342e34d
+AUX iscsitarget-0.4.17+linux-2.6.28.patch 2427 SHA256 277bab00bd30b40ccdc5375bf5c3f0ed949fa756b6300828b052ec269c90ca8e SHA512 21c57a040f272115c7934ce576c167c29ad822e50a9d6e88146240f8d9704220ae519e7259df1bc1ae26387865e7b23af0f578c23c03d6c320cbbd151c7be909 WHIRLPOOL b8c49a32c5973ec8d0580b7ab3f7566ebf1c4d56ea280212337a3713e13ba2bf6059037b07cd428ac9e130c075cc92dc73704e17e7dda6ab015a529eaac6d162
+AUX iscsitarget-0.4.17+linux-2.6.29.patch 1123 SHA256 aa8d8c39d6375b5f5a05e4b5f98c839a2b841fa43d79447055edd57d05f53b37 SHA512 850d56c3cdac287078f8a06600d426352104ce69d051bb54c1ad4958514ae110557286068bcbb9be19b74ac864479ac8195e05e4ddf0da76a571a6d9f6f8b3a8 WHIRLPOOL c17d83833123bae14ce6c1776c0d6d7486ba002815f4e30eb8caa19e331b0da16d9534e52eeb4c7ca45b9fd1819662fe8e316f477714e924a988c2c1db55277b
+AUX iscsitarget-0.4.17+linux-2.6.30.patch 1145 SHA256 86699f7bcf7bb6f9bf903f255724d08e1f3020b7854477b46329a3d202f15855 SHA512 0643c1037fe7aba21f6d6d9b82db19a5a20d57121c51a7b7ee6635a3768f494c3da508cb63e6e519a89d643df40f4342f6e423ee67296b6039d3c7f3b48324c9 WHIRLPOOL 4c8e969b6c3d467aaa86429d7e93d2deaf6f1c4ce5fe3df8fa59f7ea19db049a99195c307748a1850c6da66502ce4210ff630611c9aadeaf43f5c1c8d77cb046
+AUX iscsitarget-0.4.17-build.patch 580 SHA256 f1a29431674e4e185d3565df045ad575800c48f49de3a2a53d5723c7b2b7383d SHA512 1ab4bf0f3cedf3b05178e73d53dcd9738f3a3bdbd3f26b4989ddee8540c418d02d1ca1cedd122475f140004bcb0beba411f0530f7cbf2c2fc46b5640b036bafb WHIRLPOOL 3f8ca7db86a6dadfe712a7ef1be61d97a4a45261f7acd45943b2c502e87b58dc4775bd4e3050f79d510009067cb12d2020f8a9052e035548e2dd756049dd7983
+AUX iscsitarget-1.4.18+linux-2.6.32.patch 1342 SHA256 7ad2db023826e4861d644646d855406c0bbffe007b7a81d1f209948d0d58d336 SHA512 87886af4f2c78918c51fb07537e5098223d579a38cc81254a8d110ca8cfad822a46107179615b43183ef1f86f485051b0596be4e38ad150e718302bfad7dcffc WHIRLPOOL 99f716db1c961d0c90f1fa1475ae5d9c505662c5662d3c7b2dc8605db364d3100acaedc772e5f4c11b296ee7362d57c9c0de2b555bd33460c933c6f4b8f07e78
+AUX iscsitarget-1.4.19+linux-2.6.33.patch 594 SHA256 2e50daac88dff35a268a56950491fc9b7b9533eebd2a690f3c4eb448990f8352 SHA512 8e9193b34ccfff7f187f24312ada685cb75b581ad591d7193276bfce85605eed1639ca797caa23638d7991acab312a404147a5f1a3ada1020ef7350ddf507bff WHIRLPOOL e0d5011f341c61cd1cad3b678d045434f6aa4823a8f64b356f86666ef36e3ec0f5a77a8a0ca5e35e92eb00f3383e43d3da71a3767508bab78f52ecebce6b4337
+AUX iscsitarget-1.4.20.2-respect-flags-v2.patch 381 SHA256 d0884cffaeaf3fec4d9da2d4b357ccad368b2643f693aa5a5e663c1c46fa92bc SHA512 21bd981aa071b4a51619615e0a78e1babb208a7cb45d89135069272c0c1fb38b5dd62dd78632c2db07c1953ba2f95a29cc318c41b7348d319a879f8446efd5f8 WHIRLPOOL 87dd865851c5eeebab98504e8a4c2037e2ca287471c2af65314f04abcd4add80c328a089b2336c57161a6177283eaa88c083f1972ede5e8d46e8d1747df33254
+AUX iscsitarget-1.4.20.2-respect-flags.patch 878 SHA256 4657f3a7739ed5d2a75f8a8a4ca715f3a3098edd717c4acd1070638fcda2d80a SHA512 132e27f9385b423c0918806cccebd2c5a9072d72348a9bad0886d5c39e6f100db24ae807ba3d04e32c5f9831a79dafcc472c33ebec3a29c830f40b07ddf93807 WHIRLPOOL 048560e0455dff246c30be4db6d9c94e0c91f53d60b13d2afa487f98e9b6d174b0a506893893e96d265caf629cdcf9f1b8fb674bcf17b2201c1ecc288809510c
+AUX iscsitarget-1.4.20.2_kernel-2.6.36.patch 339 SHA256 1a2b44da24a89fd2ba204600668351c0130c28eacace1ff0d362ef370cb3aaec SHA512 f83667b85d5a997335775e1c64cb61af6c57262dcffdd8e6c38ced30c3695ed0ab31fcd81c222c89b8200f8c4e9935f4bfeb859748fdf097e4d3f26d0c9c0488 WHIRLPOOL 64ef2b713ed6d5067c70feb36cb02f7d87b5b5f5783d45f19a4192e4d773353d71e4fae66d3a268a6d1808de77bc82ea9e121e21480a9a982f4797cab52ceb40
+AUX iscsitarget-1.4.20.2_p20130103-fix-3.2-support.patch 4047 SHA256 d6252cd4ec62d2a398e26a7bd12f793175c892f025be862c2861ebf8a4815816 SHA512 52229dd30ab5c9b8f0f700315560d4d67a7a55641a4612c04728b69ca789b6d7e50e1cd21dd7deaa35edb9f28c83f69b0182414cd96ee0a121c3e58fa7cfcc57 WHIRLPOOL f8b77081360ce1edc6c8d1a97e1c90cf68a6e21b7afd4bd8e2a908255dd105fdc64d8712c77ddb334509ddefe2a9b36ace581c52dc3b3a3e5fa109acb0e3d155
+AUX iscsitarget-1.4.20.2_p20130103-restore-linux-2.6.32-support.patch 2806 SHA256 c16163e852dfd8c56869121ab6def96efaf84812a3140eb569b8fd11a4c14a9c SHA512 d529496bc7dea558856cb5ba6c58695d83001f1ff91a5d9fdb7d23d042512d4ed550f1d78dfaa0bb9c3807532b0802b55e59517c9e028e4066d97aa5ba9f82f8 WHIRLPOOL 22c08af05fa2ec8bf8d623da28e745c623dc6eb2b6ecfd9d3b776510286ff201ccff880e17d283286d1dcf8b2961bbe5d178ee11052492fc37f87cbc3cae010e
+DIST iscsitarget-0.4.17.tar.gz 107884 SHA256 bc554508174f2657c93ddb0501adad0256d1c6801a3c1ee54ff721bc92ff8778 SHA512 12e11cb4dcf98952bd655f1ecbc0a1b881a3195d36a4ae25af81059ace93997c6247403da4a5531008d88c49a831b5d160f7837e598652e99e6aca44b2a2c4a2 WHIRLPOOL 8ce11bcd3aed4577c925dc2fe4fda27b3f2589c9cdef6b5d06271046ba39113dcbde2e3a206b5a98ede3a4088aab2706a58d6b6c63a44826ad184074617351ad
+DIST iscsitarget-1.4.19.tar.gz 124288 SHA256 a9fc5e43a2806b8aa95513b2af06d97bb9181ef5fedc906d69144d93a86e664a SHA512 f653e114e13946ca947a6d481d94f92da4a75f0678d9413a82e6ffcc8fb621e48ea111a3d979b2a0818bd9f1eb4be4d0b20d250484c7fc6a0cdb93d977cc2e5c WHIRLPOOL 86639d3b2f422ca2a4471ce1d8c075e3a928dd5e77d1cc3bdb5167c213cc61a763ea1dbe33ea2c2c3adfc54cf15e29e9f7f54e17eea7fe6db1561765ba1487c0
+DIST iscsitarget-1.4.20.2.tar.gz 138464 SHA256 0f3c8e2c2038fbbd7059d1efdd428260013212daca75c1d56abbeec33cb8d388 SHA512 e9853eb5b954f5cbb43f4ed568ac896616a845f3f9ae57841045f4ef6f6487704d94364cdf48da2c0171aef27aeffa7ca8a4653bfe956486d63578a0d4c32dc6 WHIRLPOOL a24148101fc0abbd19e762ae46b84838027180559e96168efeca2e6fbf355e43cf57219701c58dcab0cdc9b3423601bd066f2a91dae477ab7ff67110c6a63a41
+DIST iscsitarget-1.4.20.2_p20130103.tar.gz 147073 SHA256 ff86e0fc18e8a33b299c8438729613345a50b91f988383fc9cad240cd3f7c1c1 SHA512 7ed706c38a63b696ff344725308a5d476f8fc4ebee71456615274470afed4d9cb2985d0960a9e77d185e267771e6c7ece8707232d42affd11f7de76e0eaf7371 WHIRLPOOL d13a869e14d716558bf15b7291b0987c5561067faafc3af5e0fd0db0126add7fbc0621e53394ca912c55fb6a3aa9ff6d402aca52d18d7087b5c3d594e15021f4
+DIST iscsitarget-1.4.20.2_p20130821.tar.xz 115664 SHA256 e1f5ce48b9c51da98564addc76cd5ae512744d5899991892b7578325ec3f149c SHA512 7dcc0b0f670954f06a0018f4969122b4b264523c82dea25145fdbe25054b18909c5a4cd8b6945cc29dfd7ce8704f3d9df3f4ae23ec334e79da065158ae291fd1 WHIRLPOOL 897f181f9f18dec5ef85c644516200426b09ee5c4c45d0822e831ad7835d294b1af3e7da17544200b56a68c4e800cca6c803a60b4f422a4a61791a6a4cdfe4d5
+EBUILD iscsitarget-0.4.17.ebuild 1847 SHA256 e571dbeb082a76e4f35074924cf6608f24cc7f9bcde6a37c3c3c8f02cfdff1cc SHA512 dd015d84cfb786b85f17e41bf164407b42433d1c4fd96726bab8903c5e1f7e8f3a6dccf6fa73212377164475d3a487946cc1c51070bd5b0abcd8375c592c3c7a WHIRLPOOL 73f2ca34c43130b2461964cfcb2c2c9e290a9c17fbffc5b2f3d907ada5b1838da381952e6997f35e9f4e60e0ea053db334f45494ea5b985686293c4d86642cce
+EBUILD iscsitarget-1.4.19.ebuild 2041 SHA256 fc008df5d69bd55807faf9381d3f34e7b61ed57bd472c73d5f532b563eeeaa63 SHA512 341e5acd4404ac51ffe252d186ffe8d6f7aa4b236e8254626fa1ab52fa1076a247d0e12c65e84206112d4ce736c495f11efe2e2b35149c2a1ab4f08ffa63df12 WHIRLPOOL e4b44dcdb679b6ab04772f5951b48113a883c41c5f48a9f218cd7e5efda4e6a5a77cd0188d50082649e2984b26d9c83c35b974d6545a45019cdd21b2fa862899
+EBUILD iscsitarget-1.4.20.2.ebuild 1871 SHA256 9fcee2223065e5184f1ce5866d97e8f2a8dfea15cf1680e78ebbc92de166144a SHA512 a17d70cf299428f752d148ed297c1634b5ec001862037a6eb5351e65463a52e5566a87a0b16fe064901f579ac8160a0370534ab630acfcc4572eed2f52fe78a5 WHIRLPOOL 3d7006bbda4ebdf4916031625d12308c1b6b65704d0f1127ce2de0433b37111586ff045932b74c910b5b500c446ae6c5b3d35ed04af5738c9526533b24975bf7
+EBUILD iscsitarget-1.4.20.2_p20130103.ebuild 2372 SHA256 b180095d48b2c38dbc72609fa3c9bda0c435461c787e31e4e7f7a8251bbac5e7 SHA512 79905f7f6185d2cad0ea8908923636650aa8acc325b3d7ad58643d9116f58e685e03cf7577cef3b5d2d2c8df071d82b09724bc6912e17942159f8909a60d9358 WHIRLPOOL 426fb5271cef6bf48b0e3514358528554d6bcd68c989b9a72908541b557f27e783a6ce61c6307040233aafb0c9f69bd17d1a8ff21937442babb50c7ade7118b4
+EBUILD iscsitarget-1.4.20.2_p20130821.ebuild 2374 SHA256 520aefcc7429f83d751b260c325fa73a14d834e254cafa636fffb5dd8566f638 SHA512 c2cc9c5d7ee47133cc259fd5fd858935a1718e521c25144416179814474dbea9e575f53e30778d2caa0bda9fad36b98b778ae2244e89cae592e4d85a8c3f930f WHIRLPOOL dbc7a39cb3408942eb7170f08cc8bc305fe3f194203d72f15e165a7102f95c02d51e9f353112cc11af8519ff1dcaac8e2422570a1619dcd967cded2bdf5ee46f
+EBUILD iscsitarget-9999.ebuild 2376 SHA256 3d2f4d157bf1ef9115c01d95c11a34d551505d10881f25409766c2a698eeed3f SHA512 7de6c486ff3e89c0b88cac8b85cc084f57d600a52961277e6435f7675b54b60591d9bfa882bf46188d775c6e3bb8db6512b33da39e71178f7fca5888a6c2bb17 WHIRLPOOL adc67690fa29ca9eabdadcca30aef8a817fe103e26b84c72a57d692962acafbcf6cdf66077d0b773bbcfbd8699a70998ea3ea8a9ebc098fddcc772de1f7e7170
+MISC ChangeLog 4591 SHA256 6d521653310bcf0522daf8ac0c75eb030be0c1ca6d8b4bdf250f51307877d6b4 SHA512 b2ad3bddd43319d35707fb16aa81978d22b8e94b8d5b9999efa24b36a6f2475606ef0521972f5e22cc001d66894221332cdd826d28c27c0b7baf969bc3eea7e8 WHIRLPOOL 9f9b9ff8febb4f668b25d3653ada0baa789fea752732133531247ec63d82ea676944dea96a385594110789cc20349710a9ee463cafbdcb38cb3226147c9241df
+MISC ChangeLog-2015 9623 SHA256 2f97fbfa610cc4855cc004ad4fdef5fe63ba0f0555580bbb1a8817006012f984 SHA512 49c1886882d440abf5bcd81e6d82c0760b137df365c475b9656db8e08d11f21b6bde2de5d88a96e31e963e6dc56abdff9acd7c366ecfadbc6deda86f094c144d WHIRLPOOL 426b9a004112515f8ba29ec567c0b179de281280c6beb41b6b37b9bdc9129202604fd93e66ebb4b8c7fd49f6fbfcfdc409c9aa522613edea653057b237be0080
+MISC metadata.xml 451 SHA256 0c9b5d75080a1da22dcd66edc3996fdc2cb05546c078b7fe1d4bad169b71e680 SHA512 ab6ad34e8beca347d1744f6bf35b1dc56900d6b392d60545def93cde4fd876fee090f8fd18063a7278980109f5a8b3644ce83f2eeabaa584768a4e7a8b8f8b85 WHIRLPOOL 79f7a30fa2347e82b5fb81271b2696e4a56cc3796e41c4b5321af8809a295d00983783591f7aa6c49d99fa18000a09ef9fbbb8098493c2ef933207f30a0b4250
diff --git a/sys-block/iscsitarget/files/ietd-conf.d b/sys-block/iscsitarget/files/ietd-conf.d
new file mode 100644
index 000000000000..1cac14ae9bb5
--- /dev/null
+++ b/sys-block/iscsitarget/files/ietd-conf.d
@@ -0,0 +1,29 @@
+# Copyright 1999-2006 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License, v2 or later
+
+# Address and port to listen on for connections.
+#ADDRESS="" # set this to non-empty to listen somewhere specific
+PORT=3260
+
+# Address of your SNS server
+# if available
+#ISNS=""
+
+# User and group to run as
+# You must ensure that the UID/GID have access to the files/devices you
+# have provided in your configuration.
+USER="root"
+GROUP="root"
+
+# Debug level - see ietd(8) for the levels
+#DEBUGLEVEL=
+
+# This setting disables the memory configuration warnings.
+# Upstream takes the general policy of forcing all of the memory settings that
+# they want, but that doesn't mesh with users that have it set higher.
+# Gentoo by default ignores the settings that are higher, but issues warnings
+# on those that are lower.
+# Uncomment the next line to disable those warnings.
+#DISABLE_MEMORY_WARNINGS=1
+
+# vim: filetype=gentoo-conf-d tw=72:
diff --git a/sys-block/iscsitarget/files/ietd-init.d-2 b/sys-block/iscsitarget/files/ietd-init.d-2
new file mode 100644
index 000000000000..2f4f7cef8698
--- /dev/null
+++ b/sys-block/iscsitarget/files/ietd-init.d-2
@@ -0,0 +1,105 @@
+#!/sbin/openrc-run
+# Copyright 1999-2010 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License, v2 or later
+
+MEM_SIZE=1048576
+DAEMON=/usr/sbin/ietd
+CONFIG_FILE=/etc/ietd.conf
+PID_FILE=/var/run/ietd.pid
+NAME="iSCSI Enterprise Target"
+
+ARGS=""
+[ -n "$USER" ] && ARGS="${ARGS} --uid=${USER}"
+[ -n "$GROUP" ] && ARGS="${ARGS} --gid=${GROUP}"
+[ -n "$ISNS" ] && ARGS="${ARGS} --isns=${ISNS}"
+[ -n "$PORT" ] && ARGS="${ARGS} --port=${PORT}"
+[ -n "$ADDRESS" ] && ARGS="${ARGS} --address=${ADDRESS}"
+[ -n "$DEBUGLEVEL" ] && ARGS="${ARGS} --debug=${DEBUGLEVEL}"
+
+depend() {
+ use net
+ after modules
+}
+checkconfig() {
+ if [ ! -f $CONFIG_FILE ]; then
+ eerror "Config file $CONFIG_FILE does not exist!"
+ return 1
+ fi
+ if [ -z "$DISABLE_MEMORY_WARNINGS" ]; then
+ check_memsize
+ fi
+}
+
+check_memsize() {
+ local wr md sysctl_key v k
+ for wr in r w; do
+ for md in max default; do
+ sysctl_key="net.core.${wr}mem_${md}"
+ v="$(sysctl -n ${sysctl_key})"
+ if [ "${v}" -lt "${MEM_SIZE}" ]; then
+ ewarn "$sysctl_key ($v) is lower than recommended ${MEM_SIZE}"
+ fi
+ done
+ done
+ for wr in "" r w; do
+ sysctl_key="net.ipv4.tcp_${wr}mem"
+ set -- $(sysctl -n ${sysctl_key})
+ for k in min default max ; do
+ if [ "${1}" -lt "${MEM_SIZE}" ]; then
+ ewarn "$sysctl_key:$k (${1}) is lower than recommended ${MEM_SIZE}"
+ fi
+ shift
+ done
+ done
+}
+
+do_modules() {
+ msg="$1"
+ shift
+ modules="$1"
+ shift
+ opts="$@"
+ for m in ${modules}; do
+ ebegin "${msg} - ${m}"
+ modprobe ${opts} $m
+ ret=$?
+ eend $ret
+ [ $ret -ne 0 ] && return $ret
+ done
+ return 0
+}
+
+start() {
+ checkconfig || return 1
+ do_modules 'Loading iSCSI-Target modules' 'iscsi_trgt'
+ ebegin "Starting ${NAME}"
+ start-stop-daemon --start --exec $DAEMON --quiet -- ${ARGS}
+ eend $?
+}
+
+stop() {
+ ebegin "Removing ${NAME} devices"
+ # ugly, but ietadm does not allways provides correct exit values
+ RETURN="$(ietadm --op delete 2>&1)"
+ RETVAL=$?
+ if [ $RETVAL -eq 0 ] && [ "$RETURN" != "something wrong" ] ; then
+ eend 0
+ else
+ eend 1
+ eerror "ietadm failed - $RETURN"
+ return 1
+ fi
+
+ ebegin "Stopping ${NAME}"
+ start-stop-daemon --stop --quiet --exec $DAEMON --pidfile $PID_FILE
+ ret=$?
+ eend $ret
+ [ $ret -ne 0 ] && return 1
+
+ # ugly, but pid file is not removed by ietd
+ rm -f $PID_FILE
+ do_modules 'Removing iSCSI-Target modules' 'iscsi_trgt' '-r'
+ return $?
+}
+
+# vim: tw=72:
diff --git a/sys-block/iscsitarget/files/iscsitarget-0.4.15-isns-set-scn-flag.patch b/sys-block/iscsitarget/files/iscsitarget-0.4.15-isns-set-scn-flag.patch
new file mode 100644
index 000000000000..47ca031a7469
--- /dev/null
+++ b/sys-block/iscsitarget/files/iscsitarget-0.4.15-isns-set-scn-flag.patch
@@ -0,0 +1,20 @@
+http://bugs.gentoo.org/180619
+
+--- usr/isns.c
++++ usr/isns.c
+@@ -215,13 +215,13 @@
+
+ #if __BYTE_ORDER == __LITTLE_ENDIAN
+ #define set_scn_flag(x) \
+-{ \
++({ \
+ x = (x & 0x55555555) << 1 | (x & 0xaaaaaaaa) >> 1; \
+ x = (x & 0x33333333) << 2 | (x & 0xcccccccc) >> 2; \
+ x = (x & 0x0f0f0f0f) << 4 | (x & 0xf0f0f0f0) >> 4; \
+ x = (x & 0x00ff00ff) << 8 | (x & 0xff00ff00) >> 8; \
+ x = (x & 0x0000ffff) << 16 | (x & 0xffff0000) >> 16; \
+-}
++})
+ #else
+ #define set_scn_flag(x) (x)
+ #endif
diff --git a/sys-block/iscsitarget/files/iscsitarget-0.4.17+linux-2.6.28.patch b/sys-block/iscsitarget/files/iscsitarget-0.4.17+linux-2.6.28.patch
new file mode 100644
index 000000000000..1f57afdba42c
--- /dev/null
+++ b/sys-block/iscsitarget/files/iscsitarget-0.4.17+linux-2.6.28.patch
@@ -0,0 +1,82 @@
+From 57551cb0529b48411f8f63a002882b7e1cf792f8 Mon Sep 17 00:00:00 2001
+From: =?utf-8?q?Diego=20E.=20'Flameeyes'=20Petten=C3=B2?= <flameeyes@gmail.com>
+Date: Wed, 25 Mar 2009 16:14:26 +0100
+Subject: [PATCH 1/2] Fix building with Linux kernel 2.6.28 and later.
+
+With changeset 30c40d2c01f68c7eb1a41ab3552bdaf5dbf300d4 of the Linux
+kernel, the functions open_bdev_excl and close_bdev_excl were replaced with
+functionally-equivalent open_bdev_exclusive and close_bdev_exclusive.
+
+The new interface uses fmode_t instead of integer flags to carry on the
+opening mode for a block device, thus require some minor changes in the
+calls.
+---
+ kernel/block-io.c | 22 ++++++++++++++++++++++
+ 1 files changed, 22 insertions(+), 0 deletions(-)
+
+diff --git a/kernel/block-io.c b/kernel/block-io.c
+index e4a25f7..af10c7e 100644
+--- a/kernel/block-io.c
++++ b/kernel/block-io.c
+@@ -13,11 +13,18 @@
+ #include <linux/blkdev.h>
+ #include <linux/parser.h>
+ #include <linux/buffer_head.h>
++#include <linux/version.h>
+
+ #include "iscsi.h"
+ #include "iscsi_dbg.h"
+ #include "iotype.h"
+
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 28)
++# define HAVE_OPEN_BDEV_EXCLUSIVE 1
++#else
++# define HAVE_OPEN_BDEV_EXCLUSIVE 0
++#endif
++
+ struct blockio_data {
+ char *path;
+ struct block_device *bdev;
+@@ -154,14 +161,22 @@ blockio_open_path(struct iet_volume *volume, const char *path)
+ {
+ struct blockio_data *bio_data = volume->private;
+ struct block_device *bdev;
++#if HAVE_OPEN_BDEV_EXCLUSIVE
++ fmode_t mode = FMODE_READ | ( LUReadonly(volume) ? 0 : FMODE_WRITE );
++#else
+ int flags = LUReadonly(volume) ? MS_RDONLY : 0;
++#endif
+ int err = 0;
+
+ bio_data->path = kstrdup(path, GFP_KERNEL);
+ if (!bio_data->path)
+ return -ENOMEM;
+
++#if HAVE_OPEN_BDEV_EXCLUSIVE
++ bdev = open_bdev_exclusive(path, mode, THIS_MODULE);
++#else
+ bdev = open_bdev_excl(path, flags, THIS_MODULE);
++#endif
+ if (IS_ERR(bdev)) {
+ err = PTR_ERR(bdev);
+ eprintk("Can't open device %s, error %d\n", path, err);
+@@ -323,9 +338,16 @@ static void
+ blockio_detach(struct iet_volume *volume)
+ {
+ struct blockio_data *bio_data = volume->private;
++#if HAVE_OPEN_BDEV_EXCLUSIVE
++ fmode_t mode = FMODE_READ | ( LUReadonly(volume) ? 0 : FMODE_WRITE );
++#endif
+
+ if (bio_data->bdev)
++#if HAVE_OPEN_BDEV_EXCLUSIVE
++ close_bdev_exclusive(bio_data->bdev, mode);
++#else
+ close_bdev_excl(bio_data->bdev);
++#endif
+ kfree(bio_data->path);
+
+ kfree(volume->private);
+--
+1.6.2
+
diff --git a/sys-block/iscsitarget/files/iscsitarget-0.4.17+linux-2.6.29.patch b/sys-block/iscsitarget/files/iscsitarget-0.4.17+linux-2.6.29.patch
new file mode 100644
index 000000000000..092fdc3fd9c4
--- /dev/null
+++ b/sys-block/iscsitarget/files/iscsitarget-0.4.17+linux-2.6.29.patch
@@ -0,0 +1,40 @@
+From 81373580a641732a7e4610c3d39af0c68007b892 Mon Sep 17 00:00:00 2001
+From: =?utf-8?q?Diego=20Elio=20'Flameeyes'=20Petten=C3=B2?= <flameeyes@gmail.com>
+Date: Wed, 25 Mar 2009 16:14:46 +0100
+Subject: [PATCH 2/2] Fix building with Linux kernel 2.6.29 and later.
+
+When building for Linux 2.6.29 or later, instead of using the NIP6
+macro (that has been removed) use the new %p6 format specifier.
+---
+ kernel/conn.c | 6 ++++++
+ 1 files changed, 6 insertions(+), 0 deletions(-)
+
+diff --git a/kernel/conn.c b/kernel/conn.c
+index f96e2b6..ab561f9 100644
+--- a/kernel/conn.c
++++ b/kernel/conn.c
+@@ -6,6 +6,7 @@
+
+ #include <linux/file.h>
+ #include <linux/ip.h>
++#include <linux/version.h>
+ #include <net/tcp.h>
+
+ #include "iscsi.h"
+@@ -47,8 +48,13 @@ void conn_info_show(struct seq_file *seq, struct iscsi_session *session)
+ break;
+ case AF_INET6:
+ snprintf(buf, sizeof(buf),
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 29)
++ "[%p6]",
++ &(inet6_sk(sk)->daddr));
++#else
+ "[%04x:%04x:%04x:%04x:%04x:%04x:%04x:%04x]",
+ NIP6(inet6_sk(sk)->daddr));
++#endif
+ break;
+ default:
+ break;
+--
+1.6.2
+
diff --git a/sys-block/iscsitarget/files/iscsitarget-0.4.17+linux-2.6.30.patch b/sys-block/iscsitarget/files/iscsitarget-0.4.17+linux-2.6.30.patch
new file mode 100644
index 000000000000..fa420e97b375
--- /dev/null
+++ b/sys-block/iscsitarget/files/iscsitarget-0.4.17+linux-2.6.30.patch
@@ -0,0 +1,37 @@
+From cb1b94ffa91d71aba8e07ed018e9f43064e05a49 Mon Sep 17 00:00:00 2001
+From: =?utf-8?q?Diego=20Elio=20'Flameeyes'=20Petten=C3=B2?= <flameeyes@gmail.com>
+Date: Wed, 10 Jun 2009 17:24:02 +0200
+Subject: [PATCH 3/3] Fix building with Linux kernel 2.6.30 and later.
+
+With commit 99b76233803beab302123d243eea9e41149804f3 the proc_dir_entry
+structure does not have an owner any longer, this just removes the
+assignment to make the code build with the newer kernel.
+---
+ kernel/config.c | 3 +++
+ 1 files changed, 3 insertions(+), 0 deletions(-)
+
+diff --git a/kernel/config.c b/kernel/config.c
+index d6c4b5e..34681f5 100644
+--- a/kernel/config.c
++++ b/kernel/config.c
+@@ -5,6 +5,7 @@
+ */
+
+ #include <linux/proc_fs.h>
++#include <linux/version.h>
+
+ #include "iscsi.h"
+ #include "iscsi_dbg.h"
+@@ -43,7 +44,9 @@ int iet_procfs_init(void)
+ if (!(proc_iet_dir = proc_mkdir("iet", init_net.proc_net)))
+ goto err;
+
++#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 30)
+ proc_iet_dir->owner = THIS_MODULE;
++#endif
+
+ for (i = 0; i < ARRAY_SIZE(iet_proc_entries); i++) {
+ ent = create_proc_entry(iet_proc_entries[i].name, 0, proc_iet_dir);
+--
+1.6.3.1
+
diff --git a/sys-block/iscsitarget/files/iscsitarget-0.4.17-build.patch b/sys-block/iscsitarget/files/iscsitarget-0.4.17-build.patch
new file mode 100644
index 000000000000..e984bd3ec374
--- /dev/null
+++ b/sys-block/iscsitarget/files/iscsitarget-0.4.17-build.patch
@@ -0,0 +1,23 @@
+--- usr/Makefile
++++ usr/Makefile
+@@ -1,16 +1,15 @@
+-CFLAGS += -O2 -fno-inline -Wall -Wstrict-prototypes -g -I../include
++CFLAGS ?= -O2 -fno-inline -g
+ CFLAGS += -D_GNU_SOURCE # required for glibc >= 2.8
++WARNFLAGS = -Wall -Wstrict-prototypes
++CFLAGS += $(WARNFLAGS) -I../include
+ PROGRAMS = ietd ietadm
+-LIBS = -lcrypto
++LDLIBS = -lcrypto
+
+ all: $(PROGRAMS)
+
+ ietd: ietd.o iscsid.o conn.o session.o target.o message.o ctldev.o log.o chap.o event.o param.o plain.o isns.o
+
+- $(CC) $^ -o $@ $(LIBS)
+-
+ ietadm: ietadm.o param.o
+- $(CC) $^ -o $@
+
+ clean:
+ rm -f *.o $(PROGRAMS)
diff --git a/sys-block/iscsitarget/files/iscsitarget-1.4.18+linux-2.6.32.patch b/sys-block/iscsitarget/files/iscsitarget-1.4.18+linux-2.6.32.patch
new file mode 100644
index 000000000000..f139e732e7de
--- /dev/null
+++ b/sys-block/iscsitarget/files/iscsitarget-1.4.18+linux-2.6.32.patch
@@ -0,0 +1,42 @@
+From 43227c1624e919efcd0cd035516c1776be55ac08 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Diego=20Elio=20'Flameeyes'=20Petten=C3=B2?= <flameeyes@gmail.com>
+Date: Sun, 18 Oct 2009 12:41:28 +0200
+Subject: [PATCH] Fix building with Linux kernel 2.6.32 and later.
+
+With commit 18f2ee705d98034b0f229a3202d827468d4bffd9 of the Linux kernel,
+the sync_page_range() function has been removed.
+
+This patch changes it to filemap_write_and_wait_range() as done for the XFS
+driver in the kernel (commit af0f4414f343429971d33b0dd8dccc85c1f3dcd2).
+---
+ kernel/file-io.c | 6 ++++++
+ 1 files changed, 6 insertions(+), 0 deletions(-)
+
+diff --git a/kernel/file-io.c b/kernel/file-io.c
+index dbf7b1c..e4c3fea 100644
+--- a/kernel/file-io.c
++++ b/kernel/file-io.c
+@@ -8,6 +8,7 @@
+ #include <linux/blkdev.h>
+ #include <linux/parser.h>
+ #include <linux/writeback.h>
++#include <linux/version.h>
+
+ #include "iscsi.h"
+ #include "iscsi_dbg.h"
+@@ -88,7 +89,12 @@ static int fileio_sync(struct iet_volume *lu, struct tio *tio)
+ count = lu->blk_cnt << lu->blk_shift;
+ }
+
++#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 32)
+ res = sync_page_range(inode, mapping, ppos, count);
++#else
++ res = filemap_write_and_wait_range(mapping, ppos,
++ ppos + count -1);
++#endif
+ if (res) {
+ eprintk("I/O error: syncing pages failed: %d\n", res);
+ return -EIO;
+--
+1.6.5
+
diff --git a/sys-block/iscsitarget/files/iscsitarget-1.4.19+linux-2.6.33.patch b/sys-block/iscsitarget/files/iscsitarget-1.4.19+linux-2.6.33.patch
new file mode 100644
index 000000000000..3c2e4e426282
--- /dev/null
+++ b/sys-block/iscsitarget/files/iscsitarget-1.4.19+linux-2.6.33.patch
@@ -0,0 +1,12 @@
+diff -p -up iscsitarget-1.4.19-1mdv2010.1/kernel/conn.c.2.6.33 iscsitarget-1.4.19-1mdv2010.1/kernel/conn.c
+--- iscsitarget-1.4.19-1mdv2010.1/kernel/conn.c.2.6.33 2010-02-21 13:07:29.000000000 +0100
++++ iscsitarget-1.4.19-1mdv2010.1/kernel/conn.c 2010-02-21 13:41:38.641365087 +0100
+@@ -43,7 +43,7 @@ void conn_info_show(struct seq_file *seq
+ switch (sk->sk_family) {
+ case AF_INET:
+ snprintf(buf, sizeof(buf),
+- "%u.%u.%u.%u", NIPQUAD(inet_sk(sk)->daddr));
++ "%u.%u.%u.%u", NIPQUAD(inet_sk(sk)->inet_daddr));
+ break;
+ case AF_INET6:
+ snprintf(buf, sizeof(buf), "[%pI6]",
diff --git a/sys-block/iscsitarget/files/iscsitarget-1.4.20.2-respect-flags-v2.patch b/sys-block/iscsitarget/files/iscsitarget-1.4.20.2-respect-flags-v2.patch
new file mode 100644
index 000000000000..b675afff08ae
--- /dev/null
+++ b/sys-block/iscsitarget/files/iscsitarget-1.4.20.2-respect-flags-v2.patch
@@ -0,0 +1,10 @@
+Index: usr/Makefile
+===================================================================
+--- usr/Makefile (revision 446)
++++ usr/Makefile (working copy)
+@@ -1,4 +1,4 @@
+-CFLAGS += -O2 -fno-inline -Wall -Wstrict-prototypes -I../include
++CFLAGS += -fno-inline -Wall -Wstrict-prototypes -I../include
+ CFLAGS += -D_GNU_SOURCE # required for glibc >= 2.8
+ PROGRAMS = ietd ietadm
+ LIBS =
diff --git a/sys-block/iscsitarget/files/iscsitarget-1.4.20.2-respect-flags.patch b/sys-block/iscsitarget/files/iscsitarget-1.4.20.2-respect-flags.patch
new file mode 100644
index 000000000000..347650ab9407
--- /dev/null
+++ b/sys-block/iscsitarget/files/iscsitarget-1.4.20.2-respect-flags.patch
@@ -0,0 +1,32 @@
+--- a/Makefile
++++ b/Makefile
+@@ -26,7 +26,7 @@
+ endif
+ endif
+
+-KVER := $(shell $(CC) $(CFLAGS) -E -dM $(VERSION_FILE) | \
++KVER := $(shell $(CC) $(CFLAGS) $(LDFLAGS) -E -dM $(VERSION_FILE) | \
+ grep UTS_RELEASE | awk '{ print $$3 }' | sed 's/\"//g')
+
+ KMOD := /lib/modules/$(KVER)/extra
+--- a/usr/Makefile
++++ b/usr/Makefile
+@@ -1,4 +1,4 @@
+-CFLAGS += -O2 -fno-inline -Wall -Wstrict-prototypes -g -I../include
++CFLAGS += -fno-inline -Wall -Wstrict-prototypes -I../include
+ CFLAGS += -D_GNU_SOURCE # required for glibc >= 2.8
+ PROGRAMS = ietd ietadm
+ LIBS =
+@@ -7,10 +7,10 @@
+
+ ietd: ietd.o iscsid.o conn.o session.o target.o message.o ctldev.o log.o chap.o event.o param.o plain.o isns.o md5.o sha1.o
+
+- $(CC) $^ -o $@ $(LIBS)
++ $(CC) $(LDFLAGS) $^ -o $@ $(LIBS)
+
+ ietadm: ietadm.o param.o
+- $(CC) $^ -o $@
++ $(CC) $(LDFLAGS) $^ -o $@
+
+ clean:
+ rm -f *.o $(PROGRAMS)
diff --git a/sys-block/iscsitarget/files/iscsitarget-1.4.20.2_kernel-2.6.36.patch b/sys-block/iscsitarget/files/iscsitarget-1.4.20.2_kernel-2.6.36.patch
new file mode 100644
index 000000000000..63c50b093368
--- /dev/null
+++ b/sys-block/iscsitarget/files/iscsitarget-1.4.20.2_kernel-2.6.36.patch
@@ -0,0 +1,12 @@
+--- trunk/kernel/conn.c (revision 372)
++++ trunk/kernel/conn.c (working copy)
+@@ -44,7 +44,7 @@
+ switch (sk->sk_family) {
+ case AF_INET:
+ snprintf(buf, sizeof(buf),
+- "%u.%u.%u.%u", NIPQUAD(inet_sk(sk)->inet_daddr));
++ "%pI4", inet_sk(sk)->inet_daddr);
+ break;
+ case AF_INET6:
+ snprintf(buf, sizeof(buf), "[%pI6]",
+
diff --git a/sys-block/iscsitarget/files/iscsitarget-1.4.20.2_p20130103-fix-3.2-support.patch b/sys-block/iscsitarget/files/iscsitarget-1.4.20.2_p20130103-fix-3.2-support.patch
new file mode 100644
index 000000000000..d41751535d31
--- /dev/null
+++ b/sys-block/iscsitarget/files/iscsitarget-1.4.20.2_p20130103-fix-3.2-support.patch
@@ -0,0 +1,135 @@
+diff --git a/Makefile b/Makefile
+index df41642..f2f17c8 100644
+--- a/Makefile
++++ b/Makefile
+@@ -46,18 +46,10 @@ kver_lt = $(shell [ $(KMAJ) -lt $(1) -o \
+ $(KMAJ) -eq $(1) -a $(KMIN) -lt $(2) -o \
+ $(KMAJ) -eq $(1) -a $(KMIN) -eq $(2) -a $(KREV) -lt $(3) ] && \
+ echo 1 || echo 0)
+-kver_le = $(shell [ $(KMAJ) -lt $(1) -o \
+- $(KMAJ) -eq $(1) -a $(KMIN) -lt $(2) -o \
+- $(KMAJ) -eq $(1) -a $(KMIN) -eq $(2) -a $(KREV) -le $(3) ] && \
+- echo 1 || echo 0)
+-kver_gt = $(shell [ ( $(KMAJ) -gt $(1) ) -o \
++kver_gt = $(shell [ $(KMAJ) -gt $(1) -o \
+ $(KMAJ) -eq $(1) -a $(KMIN) -gt $(2) -o \
+ $(KMAJ) -eq $(1) -a $(KMIN) -eq $(2) -a $(KREV) -gt $(3) ] && \
+ echo 1 || echo 0)
+-kver_ge = $(shell [ ( $(KMAJ) -gt $(1) ) -o \
+- $(KMAJ) -eq $(1) -a $(KMIN) -gt $(2) -o \
+- $(KMAJ) -eq $(1) -a $(KMIN) -eq $(2) -a $(KREV) -ge $(3) ] && \
+- echo 1 || echo 0)
+ kver_lk = $(shell [ `echo $(KVER) | egrep $(1)` ] && echo 1 || echo 0)
+
+ #
+@@ -66,85 +58,93 @@ kver_lk = $(shell [ `echo $(KVER) | egrep $(1)` ] && echo 1 || echo 0)
+ # base first the earlier patch sets will not need to be modified.
+ #
+
+-ifeq ($(call kver_le,3,5,0),1)
++ifeq ($(call kver_lt,3,6,0),1)
+ PATCHES := $(PATCHES) compat-3.5.patch
+ endif
+
+-ifeq ($(call kver_le,3,4,0),1)
++ifeq ($(call kver_lt,3,5,0),1)
+ PATCHES := $(PATCHES) compat-3.2-3.4.patch
+ endif
+
+-ifeq ($(call kver_le,3,2,0),1)
++ifeq ($(call kver_lt,3,3,0),1)
+ PATCHES := $(PATCHES) compat-2.6.39-3.2.patch
+ endif
+
+-ifeq ($(call kver_le,2,6,38),1)
++ifeq ($(call kver_lt,2,6,39),1)
+ PATCHES := $(PATCHES) compat-2.6.38.patch
+ endif
+
+-ifeq ($(call kver_le,2,6,37),1)
++ifeq ($(call kver_lt,2,6,38),1)
+ PATCHES := $(PATCHES) compat-2.6.36-2.6.37.patch
+ endif
+
+ # Compatibility patch for kernels > 2.6.32 <= 2.6.35
+-ifeq ($(call kver_le,2,6,35),1)
++ifeq ($(call kver_lt,2,6,36),1)
++ifeq ($(call kver_gt,2,6,32),1)
+ PATCHES := $(PATCHES) compat-2.6.33-2.6.35.patch
+ endif
++endif
+
+ # Compatibility patch for kernels <= 2.6.32
+-ifeq ($(call kver_le,2,6,32),1)
++ifeq ($(call kver_lt,2,6,33),1)
+ PATCHES := $(PATCHES) compat-2.6.32.patch
+ endif
+
+ # Compatibility patch for kernels <= 2.6.31
+-ifeq ($(call kver_le,2,6,31),1)
++ifeq ($(call kver_lt,2,6,32),1)
+ PATCHES := $(PATCHES) compat-2.6.31.patch
+ endif
+
+ # Compatibility patch for kernels <= 2.6.30
+-ifeq ($(call kver_le,2,6,30),1)
++ifeq ($(call kver_lt,2,6,31),1)
+ PATCHES := $(PATCHES) compat-2.6.30.patch
+ endif
+
+ # Compatibility patch for kernels <= 2.6.29
+-ifeq ($(call kver_le,2,6,29),1)
++ifeq ($(call kver_lt,2,6,30),1)
+ PATCHES := $(PATCHES) compat-2.6.29.patch
+ endif
+
+ # Compatibility patch for kernels <= 2.6.28
+-ifeq ($(call kver_le,2,6,28),1)
++ifeq ($(call kver_lt,2,6,29),1)
+ PATCHES := $(PATCHES) compat-2.6.28.patch
+ endif
+
+ # Compatibility patch for kernels >= 2.6.25 and <= 2.6.27
+-ifeq ($(call kver_le,2,6,27),1)
++ifeq ($(call kver_lt,2,6,28),1)
++ifeq ($(call kver_gt,2,6,24),1)
+ PATCHES := $(PATCHES) compat-2.6.25-2.6.27.patch
+ endif
++endif
+
+ # Compatibility patch for kernels <= 2.6.24
+-ifeq ($(call kver_le,2,6,24),1)
++ifeq ($(call kver_lt,2,6,25),1)
+ PATCHES := $(PATCHES) compat-2.6.24.patch
+ endif
+
+ # Compatibility patch for kernels <= 2.6.23
+-ifeq ($(call kver_le,2,6,23),1)
++ifeq ($(call kver_lt,2,6,24),1)
+ PATCHES := $(PATCHES) compat-2.6.23.patch
+ endif
+
+ # Compatibility patch for kernels <= 2.6.22
+-ifeq ($(call kver_le,2,6,22),1)
++ifeq ($(call kver_lt,2,6,23),1)
+ PATCHES := $(PATCHES) compat-2.6.22.patch
+ endif
+
+ # Compatibility patch for kernels >= 2.6.19 and <= 2.6.21
+-ifeq ($(call kver_le,2,6,21),1)
++ifeq ($(call kver_lt,2,6,22),1)
++ifeq ($(call kver_gt,2,6,18),1)
+ PATCHES := $(PATCHES) compat-2.6.19-2.6.21.patch
+ endif
++endif
+
+ # Compatibility patch for kernels >= 2.6.14 and <= 2.6.18
+-ifeq ($(call kver_le,2,6,18),1)
++ifeq ($(call kver_lt,2,6,19),1)
++ifeq ($(call kver_gt,2,6,13),1)
+ PATCHES := $(PATCHES) compat-2.6.14-2.6.18.patch
+ endif
++endif
+
+ # We don't support kernels < 2.6.14 except for explicit distros
+ ifeq ($(call kver_lt,2,6,14),1)
diff --git a/sys-block/iscsitarget/files/iscsitarget-1.4.20.2_p20130103-restore-linux-2.6.32-support.patch b/sys-block/iscsitarget/files/iscsitarget-1.4.20.2_p20130103-restore-linux-2.6.32-support.patch
new file mode 100644
index 000000000000..cc6a0b8c7e3c
--- /dev/null
+++ b/sys-block/iscsitarget/files/iscsitarget-1.4.20.2_p20130103-restore-linux-2.6.32-support.patch
@@ -0,0 +1,96 @@
+diff --git a/kernel/iscsi.c b/kernel/iscsi.c
+index 9ad3047..37d7753 100644
+--- a/kernel/iscsi.c
++++ b/kernel/iscsi.c
+@@ -773,6 +773,7 @@ static void set_offset_and_length(const struct iet_volume *lu,
+ break;
+ case READ_16:
+ case WRITE_16:
++#ifdef WRITE_SAME_16
+ case WRITE_SAME_16:
+ *off = (u64)cmd[2] << 56 | (u64)cmd[3] << 48 |
+ (u64)cmd[4] << 40 | (u64)cmd[5] << 32 |
+@@ -781,6 +782,7 @@ static void set_offset_and_length(const struct iet_volume *lu,
+ *len = (u32)cmd[10] << 24 | (u32)cmd[11] << 16 |
+ (u32)cmd[12] << 8 | (u32)cmd[13];
+ break;
++#endif
+ case PERSISTENT_RESERVE_OUT:
+ {
+ const struct persistent_reserve_out *pr_out =
+@@ -1036,6 +1038,7 @@ static void scsi_cmnd_start(struct iscsi_conn *conn, struct iscsi_cmnd *req)
+ case WRITE_10:
+ case WRITE_16:
+ case WRITE_VERIFY:
++#ifdef WRITE_SAME_16
+ case WRITE_SAME_16:
+ {
+ struct iscsi_sess_param *param = &conn->session->param;
+@@ -1104,6 +1107,7 @@ static void scsi_cmnd_start(struct iscsi_conn *conn, struct iscsi_cmnd *req)
+ }
+ break;
+ }
++#endif
+ error:
+ default:
+ eprintk("Unsupported %x\n", req_hdr->scb[0]);
+diff --git a/kernel/iscsi_dbg.h b/kernel/iscsi_dbg.h
+index 8c9b928..ad5c6d4 100644
+--- a/kernel/iscsi_dbg.h
++++ b/kernel/iscsi_dbg.h
+@@ -12,7 +12,9 @@
+ #define D_IOMODE (1UL << 8)
+ #define D_UAC (1UL << 9)
+ #define D_PR (1UL << 10)
++#ifdef WRITE_SAME_16
+ #define D_VAAI (1UL << 11)
++#endif
+
+ #define D_DATA (D_READ | D_WRITE)
+
+diff --git a/kernel/target_disk.c b/kernel/target_disk.c
+index 6b1de2c..ca28e4e 100644
+--- a/kernel/target_disk.c
++++ b/kernel/target_disk.c
+@@ -408,6 +408,7 @@ static void build_write_response(struct iscsi_cmnd *cmnd)
+ iscsi_cmnd_set_sense(cmnd, MEDIUM_ERROR, 0x03, 0x0);
+ }
+
++#ifdef WRITE_SAME_16
+ static void build_write_same_response(struct iscsi_cmnd *cmnd) {
+ int err;
+ struct tio *target_tio;
+@@ -475,6 +476,7 @@ static void build_write_same_response(struct iscsi_cmnd *cmnd) {
+
+ tio_put(target_tio);
+ }
++#endif
+
+ static void build_sync_cache_response(struct iscsi_cmnd *cmnd)
+ {
+@@ -618,9 +620,11 @@ static int disk_execute_cmnd(struct iscsi_cmnd *cmnd)
+ case WRITE_VERIFY:
+ send_scsi_rsp(cmnd, build_write_response);
+ break;
++#ifdef WRITE_SAME_16
+ case WRITE_SAME_16:
+ send_scsi_rsp(cmnd, build_write_same_response);
+ break;
++#endif
+ case SYNCHRONIZE_CACHE:
+ send_scsi_rsp(cmnd, build_sync_cache_response);
+ break;
+diff --git a/kernel/volume.c b/kernel/volume.c
+index 8beeb1e..6ad2a3d 100644
+--- a/kernel/volume.c
++++ b/kernel/volume.c
+@@ -446,7 +446,9 @@ int is_volume_reserved(struct iet_volume *volume, u64 sid, u8 *scb)
+ case WRITE_10:
+ case WRITE_12:
+ case WRITE_16:
++#ifdef WRITE_SAME_16
+ case WRITE_SAME_16:
++#endif
+ case WRITE_VERIFY:
+ case SYNCHRONIZE_CACHE:
+ if (write_excl || excl_access)
diff --git a/sys-block/iscsitarget/iscsitarget-0.4.17.ebuild b/sys-block/iscsitarget/iscsitarget-0.4.17.ebuild
new file mode 100644
index 000000000000..42d30526b103
--- /dev/null
+++ b/sys-block/iscsitarget/iscsitarget-0.4.17.ebuild
@@ -0,0 +1,61 @@
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+inherit linux-mod eutils flag-o-matic
+
+DESCRIPTION="Open Source iSCSI target with professional features"
+HOMEPAGE="http://iscsitarget.sourceforge.net/"
+SRC_URI="mirror://sourceforge/${PN}/${P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="amd64 ppc x86"
+IUSE=""
+
+DEPEND="dev-libs/openssl"
+RDEPEND="${DEPEND}"
+
+MODULE_NAMES="iscsi_trgt(misc:${S}/kernel)"
+CONFIG_CHECK="CRYPTO_CRC32C"
+ERROR_CFG="iscsitarget needs support for CRC32C in your kernel."
+
+src_unpack() {
+ unpack ${A}
+ cd "${S}"
+ epatch "${FILESDIR}"/${PN}-0.4.15-isns-set-scn-flag.patch #180619
+ epatch "${FILESDIR}"/${PN}-0.4.17-build.patch
+ epatch "${FILESDIR}"/${PN}-0.4.17+linux-2.6.28.patch #252608
+ epatch "${FILESDIR}"/${PN}-0.4.17+linux-2.6.29.patch
+ epatch "${FILESDIR}"/${PN}-0.4.17+linux-2.6.30.patch
+ convert_to_m "${S}"/Makefile
+}
+
+src_compile() {
+ emake usr || die "failed to build userspace"
+
+ unset ARCH
+ filter-ldflags -Wl,*
+ emake KSRC="${KERNEL_DIR}" kernel || die "failed to build module"
+}
+
+src_install() {
+ einfo "Installing userspace"
+ dosbin usr/ietd usr/ietadm || die "dosbin failed"
+ insinto /etc
+ doins etc/ietd.conf etc/initiators.{allow,deny} || die "doins failed"
+ # Upstream's provided Gentoo init script is out of date compared to
+ # their Debian init script. And isn't that nice.
+ #newinitd etc/initd/initd.gentoo ietd || die
+ newinitd "${FILESDIR}"/ietd-init.d-2 ietd || die "newinitd failed"
+ newconfd "${FILESDIR}"/ietd-conf.d ietd || die "newconfd failed"
+
+ # Lock down perms, per bug 198209
+ fperms 0640 /etc/ietd.conf /etc/initiators.{allow,deny}
+
+ doman doc/manpages/*.[1-9] || die "manpages failed"
+ dodoc ChangeLog README || die "docs failed"
+
+ einfo "Installing kernel module"
+ unset ARCH
+ linux-mod_src_install || die "modules failed"
+}
diff --git a/sys-block/iscsitarget/iscsitarget-1.4.19.ebuild b/sys-block/iscsitarget/iscsitarget-1.4.19.ebuild
new file mode 100644
index 000000000000..9d6b99f143ad
--- /dev/null
+++ b/sys-block/iscsitarget/iscsitarget-1.4.19.ebuild
@@ -0,0 +1,69 @@
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+inherit linux-mod eutils flag-o-matic
+
+DESCRIPTION="Open Source iSCSI target with professional features"
+HOMEPAGE="http://iscsitarget.sourceforge.net/"
+SRC_URI="mirror://sourceforge/${PN}/${P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="amd64 ppc x86"
+IUSE=""
+
+DEPEND="dev-libs/openssl"
+RDEPEND="${DEPEND}"
+
+MODULE_NAMES="iscsi_trgt(misc:${S}/kernel)"
+CONFIG_CHECK="CRYPTO_CRC32C"
+ERROR_CFG="iscsitarget needs support for CRC32C in your kernel."
+
+src_unpack() {
+ unpack ${A}
+ cd "${S}"
+ epatch "${FILESDIR}"/${PN}-0.4.15-isns-set-scn-flag.patch #180619
+ epatch "${FILESDIR}"/${PN}-0.4.17-build.patch
+ epatch "${FILESDIR}"/${PN}-1.4.18+linux-2.6.32.patch
+ if kernel_is ge 2 6 33; then
+ epatch "${FILESDIR}"/${PN}-1.4.19+linux-2.6.33.patch
+ fi
+ convert_to_m "${S}"/Makefile
+}
+
+src_compile() {
+ emake KSRC="${KERNEL_DIR}" usr || die "failed to build userspace"
+
+ unset ARCH
+ filter-ldflags -Wl,*
+ emake KSRC="${KERNEL_DIR}" kernel || die "failed to build module"
+}
+
+src_install() {
+ einfo "Installing userspace"
+
+ # Install ietd into libexec; we don't need ietd to be in the path
+ # for ROOT, since it's just a service.
+ exeinto /usr/libexec
+ doexe usr/ietd || die "doexe ietd failed"
+
+ dosbin usr/ietadm || die "dosbin failed"
+
+ insinto /etc
+ doins etc/ietd.conf etc/initiators.allow || die "doins failed"
+
+ # We moved ietd in /usr/libexec, so update the init script accordingly.
+ sed -e 's:/usr/sbin/ietd:/usr/libexec/ietd:' "${FILESDIR}"/ietd-init.d-2 > "${T}"/ietd-init.d
+ newinitd "${T}"/ietd-init.d ietd || die "newinitd failed"
+ newconfd "${FILESDIR}"/ietd-conf.d ietd || die "newconfd failed"
+
+ # Lock down perms, per bug 198209
+ fperms 0640 /etc/ietd.conf /etc/initiators.{allow,deny}
+
+ doman doc/manpages/*.[1-9] || die "manpages failed"
+ dodoc ChangeLog README RELEASE_NOTES README.initiators README.vmware || die "docs failed"
+
+ einfo "Installing kernel module"
+ unset ARCH
+ linux-mod_src_install || die "modules failed"
+}
diff --git a/sys-block/iscsitarget/iscsitarget-1.4.20.2.ebuild b/sys-block/iscsitarget/iscsitarget-1.4.20.2.ebuild
new file mode 100644
index 000000000000..00a02594d5ed
--- /dev/null
+++ b/sys-block/iscsitarget/iscsitarget-1.4.20.2.ebuild
@@ -0,0 +1,70 @@
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+inherit linux-mod eutils flag-o-matic
+
+DESCRIPTION="Open Source iSCSI target with professional features"
+HOMEPAGE="http://iscsitarget.sourceforge.net/"
+SRC_URI="mirror://sourceforge/${PN}/${P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="amd64 ~ppc x86"
+IUSE=""
+
+DEPEND="dev-libs/openssl"
+RDEPEND="${DEPEND}"
+
+MODULE_NAMES="iscsi_trgt(misc:${S}/kernel)"
+CONFIG_CHECK="CRYPTO_CRC32C"
+ERROR_CFG="iscsitarget needs support for CRC32C in your kernel."
+
+src_unpack() {
+ unpack ${A}
+ cd "${S}"
+ epatch "${FILESDIR}"/${PN}-0.4.15-isns-set-scn-flag.patch #180619
+ # Respect LDFLAGS. Bug #350742
+ epatch "${FILESDIR}"/${P}-respect-flags.patch
+ # NIPQUAD removed in 2.6.36, #340449
+ if kernel_is ge 2 6 36; then
+ epatch "${FILESDIR}"/iscsitarget-1.4.20.2_kernel-2.6.36.patch
+ fi
+ convert_to_m "${S}"/Makefile
+}
+
+src_compile() {
+ emake KSRC="${KERNEL_DIR}" usr || die
+
+ unset ARCH
+ filter-ldflags -Wl,*
+ emake KSRC="${KERNEL_DIR}" kernel || die
+}
+
+src_install() {
+ einfo "Installing userspace"
+
+ # Install ietd into libexec; we don't need ietd to be in the path
+ # for ROOT, since it's just a service.
+ exeinto /usr/libexec
+ doexe usr/ietd || die
+
+ dosbin usr/ietadm || die
+
+ insinto /etc
+ doins etc/ietd.conf etc/initiators.allow || die
+
+ # We moved ietd in /usr/libexec, so update the init script accordingly.
+ sed -e 's:/usr/sbin/ietd:/usr/libexec/ietd:' "${FILESDIR}"/ietd-init.d-2 > "${T}"/ietd-init.d
+ newinitd "${T}"/ietd-init.d ietd || die
+ newconfd "${FILESDIR}"/ietd-conf.d ietd || die
+
+ # Lock down perms, per bug 198209
+ fperms 0640 /etc/ietd.conf /etc/initiators.allow
+
+ doman doc/manpages/*.[1-9] || die
+ dodoc ChangeLog README RELEASE_NOTES README.initiators README.vmware || die
+
+ einfo "Installing kernel module"
+ unset ARCH
+ linux-mod_src_install || die
+}
diff --git a/sys-block/iscsitarget/iscsitarget-1.4.20.2_p20130103.ebuild b/sys-block/iscsitarget/iscsitarget-1.4.20.2_p20130103.ebuild
new file mode 100644
index 000000000000..d0cdfe59c384
--- /dev/null
+++ b/sys-block/iscsitarget/iscsitarget-1.4.20.2_p20130103.ebuild
@@ -0,0 +1,93 @@
+# Copyright 1999-2016 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="4"
+
+inherit linux-mod eutils flag-o-matic
+
+if [ ${PV} == "9999" ] ; then
+ inherit subversion
+ ESVN_REPO_URI="https://svn.code.sf.net/p/iscsitarget/code/trunk"
+else
+ SRC_URI="https://dev.gentoo.org/~ryao/dist/${P}.tar.gz"
+ KEYWORDS="amd64 ~ppc x86"
+fi
+
+DESCRIPTION="Open Source iSCSI target with professional features"
+HOMEPAGE="http://iscsitarget.sourceforge.net/"
+
+LICENSE="GPL-2"
+SLOT="0"
+IUSE=""
+
+DEPEND="dev-libs/openssl"
+RDEPEND="${DEPEND}"
+
+MODULE_NAMES="iscsi_trgt(misc:${S}/kernel)"
+
+pkg_setup() {
+ CONFIG_CHECK="CRYPTO_CRC32C"
+ ERROR_CFG="iscsitarget needs support for CRC32C in your kernel."
+
+ kernel_is ge 2 6 14 || die "Linux 2.6.14 or newer required"
+
+ [ ${PV} != "9999" ] && \
+ { kernel_is le 3 6 || die "Linux 3.6 is the latest supported version."; }
+
+ linux-mod_pkg_setup
+}
+src_prepare() {
+ if [ ${PV} != "9999" ]
+ then
+ # Fix build system to apply proper patches
+ epatch "${FILESDIR}/${PN}-1.4.20.2_p20130103-fix-3.2-support.patch"
+
+ # Respect LDFLAGS. Bug #365735
+ epatch "${FILESDIR}/${PN}-1.4.20.2-respect-flags-v2.patch"
+
+ # Avoid use of WRITE_SAME_16 in Linux 2.6.32 and earlier
+ epatch "${FILESDIR}/${PN}-1.4.20.2_p20130103-restore-linux-2.6.32-support.patch"
+ fi
+
+ # Apply kernel-specific patches
+ emake KSRC="${KERNEL_DIR}" patch || die
+
+ epatch_user
+}
+
+src_compile() {
+ emake KSRC="${KERNEL_DIR}" usr || die
+
+ unset ARCH
+ filter-ldflags -Wl,*
+ emake KSRC="${KERNEL_DIR}" kernel || die
+}
+
+src_install() {
+ einfo "Installing userspace"
+
+ # Install ietd into libexec; we don't need ietd to be in the path
+ # for ROOT, since it's just a service.
+ exeinto /usr/libexec
+ doexe usr/ietd || die
+
+ dosbin usr/ietadm || die
+
+ insinto /etc
+ doins etc/ietd.conf etc/initiators.allow || die
+
+ # We moved ietd in /usr/libexec, so update the init script accordingly.
+ sed -e 's:/usr/sbin/ietd:/usr/libexec/ietd:' "${FILESDIR}"/ietd-init.d-2 > "${T}"/ietd-init.d
+ newinitd "${T}"/ietd-init.d ietd || die
+ newconfd "${FILESDIR}"/ietd-conf.d ietd || die
+
+ # Lock down perms, per bug 198209
+ fperms 0640 /etc/ietd.conf /etc/initiators.allow
+
+ doman doc/manpages/*.[1-9] || die
+ dodoc ChangeLog README RELEASE_NOTES README.initiators README.mcs README.vmware || die
+
+ einfo "Installing kernel module"
+ unset ARCH
+ linux-mod_src_install || die
+}
diff --git a/sys-block/iscsitarget/iscsitarget-1.4.20.2_p20130821.ebuild b/sys-block/iscsitarget/iscsitarget-1.4.20.2_p20130821.ebuild
new file mode 100644
index 000000000000..ed6015f7a7ee
--- /dev/null
+++ b/sys-block/iscsitarget/iscsitarget-1.4.20.2_p20130821.ebuild
@@ -0,0 +1,93 @@
+# Copyright 1999-2016 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="4"
+
+inherit linux-mod eutils flag-o-matic
+
+if [ ${PV} == "9999" ] ; then
+ inherit subversion
+ ESVN_REPO_URI="https://svn.code.sf.net/p/iscsitarget/code/trunk"
+else
+ SRC_URI="https://dev.gentoo.org/~ryao/dist/${P}.tar.xz"
+ KEYWORDS="amd64 ~ppc x86"
+fi
+
+DESCRIPTION="Open Source iSCSI target with professional features"
+HOMEPAGE="http://iscsitarget.sourceforge.net/"
+
+LICENSE="GPL-2"
+SLOT="0"
+IUSE=""
+
+DEPEND="dev-libs/openssl"
+RDEPEND="${DEPEND}"
+
+MODULE_NAMES="iscsi_trgt(misc:${S}/kernel)"
+
+pkg_setup() {
+ CONFIG_CHECK="CRYPTO_CRC32C"
+ ERROR_CFG="iscsitarget needs support for CRC32C in your kernel."
+
+ kernel_is ge 2 6 14 || die "Linux 2.6.14 or newer required"
+
+ [ ${PV} != "9999" ] && \
+ { kernel_is le 3 11 || die "Linux 3.11 is the latest supported version."; }
+
+ linux-mod_pkg_setup
+}
+src_prepare() {
+ if [ ${PV} != "9999" ]
+ then
+ # Fix build system to apply proper patches
+ epatch "${FILESDIR}/${PN}-1.4.20.2_p20130103-fix-3.2-support.patch"
+
+ # Respect LDFLAGS. Bug #365735
+ epatch "${FILESDIR}/${PN}-1.4.20.2-respect-flags-v2.patch"
+
+ # Avoid use of WRITE_SAME_16 in Linux 2.6.32 and earlier
+ epatch "${FILESDIR}/${PN}-1.4.20.2_p20130103-restore-linux-2.6.32-support.patch"
+ fi
+
+ # Apply kernel-specific patches
+ emake KSRC="${KERNEL_DIR}" patch || die
+
+ epatch_user
+}
+
+src_compile() {
+ emake KSRC="${KERNEL_DIR}" usr || die
+
+ unset ARCH
+ filter-ldflags -Wl,*
+ emake KSRC="${KERNEL_DIR}" kernel || die
+}
+
+src_install() {
+ einfo "Installing userspace"
+
+ # Install ietd into libexec; we don't need ietd to be in the path
+ # for ROOT, since it's just a service.
+ exeinto /usr/libexec
+ doexe usr/ietd || die
+
+ dosbin usr/ietadm || die
+
+ insinto /etc
+ doins etc/ietd.conf etc/initiators.allow || die
+
+ # We moved ietd in /usr/libexec, so update the init script accordingly.
+ sed -e 's:/usr/sbin/ietd:/usr/libexec/ietd:' "${FILESDIR}"/ietd-init.d-2 > "${T}"/ietd-init.d
+ newinitd "${T}"/ietd-init.d ietd || die
+ newconfd "${FILESDIR}"/ietd-conf.d ietd || die
+
+ # Lock down perms, per bug 198209
+ fperms 0640 /etc/ietd.conf /etc/initiators.allow
+
+ doman doc/manpages/*.[1-9] || die
+ dodoc ChangeLog README RELEASE_NOTES README.initiators README.mcs README.vmware || die
+
+ einfo "Installing kernel module"
+ unset ARCH
+ linux-mod_src_install || die
+}
diff --git a/sys-block/iscsitarget/iscsitarget-9999.ebuild b/sys-block/iscsitarget/iscsitarget-9999.ebuild
new file mode 100644
index 000000000000..8b95d3ba166a
--- /dev/null
+++ b/sys-block/iscsitarget/iscsitarget-9999.ebuild
@@ -0,0 +1,93 @@
+# Copyright 1999-2016 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="4"
+
+inherit linux-mod eutils flag-o-matic
+
+if [ ${PV} == "9999" ] ; then
+ inherit subversion
+ ESVN_REPO_URI="https://svn.code.sf.net/p/iscsitarget/code/trunk"
+else
+ SRC_URI="https://dev.gentoo.org/~ryao/dist/${P}.tar.xz"
+ KEYWORDS="~amd64 ~ppc ~x86"
+fi
+
+DESCRIPTION="Open Source iSCSI target with professional features"
+HOMEPAGE="http://iscsitarget.sourceforge.net/"
+
+LICENSE="GPL-2"
+SLOT="0"
+IUSE=""
+
+DEPEND="dev-libs/openssl"
+RDEPEND="${DEPEND}"
+
+MODULE_NAMES="iscsi_trgt(misc:${S}/kernel)"
+
+pkg_setup() {
+ CONFIG_CHECK="CRYPTO_CRC32C"
+ ERROR_CFG="iscsitarget needs support for CRC32C in your kernel."
+
+ kernel_is ge 2 6 14 || die "Linux 2.6.14 or newer required"
+
+ [ ${PV} != "9999" ] && \
+ { kernel_is le 3 11 || die "Linux 3.11 is the latest supported version."; }
+
+ linux-mod_pkg_setup
+}
+src_prepare() {
+ if [ ${PV} != "9999" ]
+ then
+ # Fix build system to apply proper patches
+ epatch "${FILESDIR}/${PN}-1.4.20.2_p20130103-fix-3.2-support.patch"
+
+ # Respect LDFLAGS. Bug #365735
+ epatch "${FILESDIR}/${PN}-1.4.20.2-respect-flags-v2.patch"
+
+ # Avoid use of WRITE_SAME_16 in Linux 2.6.32 and earlier
+ epatch "${FILESDIR}/${PN}-1.4.20.2_p20130103-restore-linux-2.6.32-support.patch"
+ fi
+
+ # Apply kernel-specific patches
+ emake KSRC="${KERNEL_DIR}" patch || die
+
+ epatch_user
+}
+
+src_compile() {
+ emake KSRC="${KERNEL_DIR}" usr || die
+
+ unset ARCH
+ filter-ldflags -Wl,*
+ emake KSRC="${KERNEL_DIR}" kernel || die
+}
+
+src_install() {
+ einfo "Installing userspace"
+
+ # Install ietd into libexec; we don't need ietd to be in the path
+ # for ROOT, since it's just a service.
+ exeinto /usr/libexec
+ doexe usr/ietd || die
+
+ dosbin usr/ietadm || die
+
+ insinto /etc
+ doins etc/ietd.conf etc/initiators.allow || die
+
+ # We moved ietd in /usr/libexec, so update the init script accordingly.
+ sed -e 's:/usr/sbin/ietd:/usr/libexec/ietd:' "${FILESDIR}"/ietd-init.d-2 > "${T}"/ietd-init.d
+ newinitd "${T}"/ietd-init.d ietd || die
+ newconfd "${FILESDIR}"/ietd-conf.d ietd || die
+
+ # Lock down perms, per bug 198209
+ fperms 0640 /etc/ietd.conf /etc/initiators.allow
+
+ doman doc/manpages/*.[1-9] || die
+ dodoc ChangeLog README RELEASE_NOTES README.initiators README.mcs README.vmware || die
+
+ einfo "Installing kernel module"
+ unset ARCH
+ linux-mod_src_install || die
+}
diff --git a/sys-block/iscsitarget/metadata.xml b/sys-block/iscsitarget/metadata.xml
new file mode 100644
index 000000000000..22355ab8069f
--- /dev/null
+++ b/sys-block/iscsitarget/metadata.xml
@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+<maintainer type="person">
+ <email>ryao@gentoo.org</email>
+ <description>Primary maintainer</description>
+</maintainer>
+<maintainer type="project">
+ <email>base-system@gentoo.org</email>
+ <name>Gentoo Base System</name>
+</maintainer>
+<upstream>
+ <remote-id type="sourceforge">iscsitarget</remote-id>
+</upstream>
+</pkgmetadata>