diff options
author | Mike Frysinger <vapier@gentoo.org> | 2008-02-22 03:38:51 +0000 |
---|---|---|
committer | Mike Frysinger <vapier@gentoo.org> | 2008-02-22 03:38:51 +0000 |
commit | 883ce06773ce9b57878b083836a42d135df5acb1 (patch) | |
tree | cdb4eaa401ed5d49ba03bac10cc41b7a6e5319ba | |
parent | Fix broken Manifest. (diff) | |
download | gentoo-2-883ce06773ce9b57878b083836a42d135df5acb1.tar.gz gentoo-2-883ce06773ce9b57878b083836a42d135df5acb1.tar.bz2 gentoo-2-883ce06773ce9b57878b083836a42d135df5acb1.zip |
Respect user LDFLAGS. Fix building with gcc-3.4/-O0 #180619 by Natanael Copa. Add some kernel updates from upstream #191313.
(Portage version: 2.2_pre2)
7 files changed, 270 insertions, 13 deletions
diff --git a/sys-block/iscsitarget/ChangeLog b/sys-block/iscsitarget/ChangeLog index 40597dcb8cc9..23c64300fc62 100644 --- a/sys-block/iscsitarget/ChangeLog +++ b/sys-block/iscsitarget/ChangeLog @@ -1,6 +1,15 @@ # ChangeLog for sys-block/iscsitarget # Copyright 1999-2008 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/sys-block/iscsitarget/ChangeLog,v 1.8 2008/01/14 01:58:58 robbat2 Exp $ +# $Header: /var/cvsroot/gentoo-x86/sys-block/iscsitarget/ChangeLog,v 1.9 2008/02/22 03:38:50 vapier Exp $ + + 22 Feb 2008; Mike Frysinger <vapier@gentoo.org> + +files/iscsitarget-0.4.15-build.patch, + +files/iscsitarget-0.4.15-isns-set-scn-flag.patch, + +files/iscsitarget-0.4.15-kmem.patch, + +files/iscsitarget-0.4.15-scatter.patch, files/ietd-init.d, + iscsitarget-0.4.15-r1.ebuild: + Respect user LDFLAGS. Fix building with gcc-3.4/-O0 #180619 by Natanael + Copa. Add some kernel updates from upstream #191313. 14 Jan 2008; Robin H. Johnson <robbat2@gentoo.org> metadata.xml: Change herd. diff --git a/sys-block/iscsitarget/files/ietd-init.d b/sys-block/iscsitarget/files/ietd-init.d index 33d65f4baea1..27d67bf92485 100644 --- a/sys-block/iscsitarget/files/ietd-init.d +++ b/sys-block/iscsitarget/files/ietd-init.d @@ -1,7 +1,7 @@ #!/sbin/runscript -# Copyright 1999-2005 Gentoo Technologies, Inc. +# Copyright 1999-2008 Gentoo Technologies, Inc. # Distributed under the terms of the GNU General Public License, v2 or later -# $Header: /var/cvsroot/gentoo-x86/sys-block/iscsitarget/files/ietd-init.d,v 1.1 2006/02/20 08:33:40 robbat2 Exp $ +# $Header: /var/cvsroot/gentoo-x86/sys-block/iscsitarget/files/ietd-init.d,v 1.2 2008/02/22 03:38:51 vapier Exp $ MEM_SIZE=1048576 DAEMON=/usr/sbin/ietd @@ -79,7 +79,7 @@ stop() { # ugly, but ietadm does not allways provides correct exit values RETURN="$(ietadm --op delete 2>&1)" RETVAL=$? - if [ $RETVAL == "0" ] && [[ $RETURN != "something wrong" ]]; then + if [ $RETVAL -eq 0 ] && [ "$RETURN" != "something wrong" ] ; then eend 0 else eend 1 diff --git a/sys-block/iscsitarget/files/iscsitarget-0.4.15-build.patch b/sys-block/iscsitarget/files/iscsitarget-0.4.15-build.patch new file mode 100644 index 000000000000..44f830d18e88 --- /dev/null +++ b/sys-block/iscsitarget/files/iscsitarget-0.4.15-build.patch @@ -0,0 +1,22 @@ +--- usr/Makefile ++++ usr/Makefile +@@ -1,15 +1,14 @@ +-CFLAGS += -O2 -fno-inline -Wall -Wstrict-prototypes -g -I../include ++CFLAGS ?= -O2 -fno-inline -g ++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-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.15-kmem.patch b/sys-block/iscsitarget/files/iscsitarget-0.4.15-kmem.patch new file mode 100644 index 000000000000..55e96f3f72a2 --- /dev/null +++ b/sys-block/iscsitarget/files/iscsitarget-0.4.15-kmem.patch @@ -0,0 +1,44 @@ +------------------------------------------------------------------------ +r138 | tomo | 2007-09-20 19:26:20 -0400 (Thu, 20 Sep 2007) | 12 lines + +From: Arne Redlich <agr@powerkom-dd.de> +Subject: 2.6.23 compile fix +Date: Thu, 20 Sep 2007 23:30:19 +0200 + +kmem_cache_create()'s arguments will change with 2.6.23. + +Note that instead of simply modifying the kmem_cache_create() calls to +match the new interface, they're replaced with KMEM_CACHE(), which was +introduced with 2.6.22 to simplify slab cache creation. + +Merely compile tested. + +------------------------------------------------------------------------ +Index: kernel/iscsi.c +=================================================================== +--- kernel/iscsi.c (revision 137) ++++ kernel/iscsi.c (revision 138) +@@ -1757,8 +1757,7 @@ static int iscsi_init(void) + if ((err = event_init()) < 0) + goto err; + +- iscsi_cmnd_cache = kmem_cache_create("iscsi_cmnd", sizeof(struct iscsi_cmnd), +- 0, 0, NULL, NULL); ++ iscsi_cmnd_cache = KMEM_CACHE(iscsi_cmnd, 0); + if (!iscsi_cmnd_cache) + goto err; + +Index: kernel/tio.c +=================================================================== +--- kernel/tio.c (revision 137) ++++ kernel/tio.c (revision 138) +@@ -110,8 +110,7 @@ int tio_sync(struct iet_volume *lu, stru + + int tio_init(void) + { +- tio_cache = kmem_cache_create("tio", sizeof(struct tio), +- 0, 0, NULL, NULL); ++ tio_cache = KMEM_CACHE(tio, 0); + return tio_cache ? 0 : -ENOMEM; + } + diff --git a/sys-block/iscsitarget/files/iscsitarget-0.4.15-scatter.patch b/sys-block/iscsitarget/files/iscsitarget-0.4.15-scatter.patch new file mode 100644 index 000000000000..0d41d1538097 --- /dev/null +++ b/sys-block/iscsitarget/files/iscsitarget-0.4.15-scatter.patch @@ -0,0 +1,160 @@ +------------------------------------------------------------------------ +r146 | tomo | 2008-02-11 07:26:38 -0500 (Mon, 11 Feb 2008) | 5 lines + +From: Arne Redlich <agr@powerkom-dd.de> +Subject: fix compilation on 2.6.24 +Date: Sun, 10 Feb 2008 22:26:28 +0100 + + +------------------------------------------------------------------------ +Index: kernel/block-io.c +=================================================================== +--- kernel/block-io.c (revision 145) ++++ kernel/block-io.c (revision 146) +@@ -28,15 +28,10 @@ struct tio_work { + struct completion tio_complete; + }; + +-static int +-blockio_bio_endio(struct bio *bio, unsigned int bytes_done, int error) ++static void blockio_bio_endio(struct bio *bio, int error) + { + struct tio_work *tio_work = bio->bi_private; + +- /* Ignore partials */ +- if (bio->bi_size) +- return 1; +- + error = test_bit(BIO_UPTODATE, &bio->bi_flags) ? error : -EIO; + + if (error) +@@ -47,8 +42,6 @@ blockio_bio_endio(struct bio *bio, unsig + complete(&tio_work->tio_complete); + + bio_put(bio); +- +- return 0; + } + + /* +Index: kernel/config.c +=================================================================== +--- kernel/config.c (revision 145) ++++ kernel/config.c (revision 146) +@@ -40,7 +40,7 @@ int iet_procfs_init(void) + int i; + struct proc_dir_entry *ent; + +- if (!(proc_iet_dir = proc_mkdir("net/iet", 0))) ++ if (!(proc_iet_dir = proc_mkdir("iet", init_net.proc_net))) + goto err; + + proc_iet_dir->owner = THIS_MODULE; +Index: kernel/digest.c +=================================================================== +--- kernel/digest.c (revision 145) ++++ kernel/digest.c (revision 146) +@@ -161,22 +161,17 @@ static inline void __dbg_simulate_data_d + } + } + +-/* Copied from linux-iscsi initiator and slightly adjusted */ +-#define SETSG(sg, p, l) do { \ +- (sg).page = virt_to_page((p)); \ +- (sg).offset = ((unsigned long)(p) & ~PAGE_CACHE_MASK); \ +- (sg).length = (l); \ +-} while (0) +- + static void digest_header(struct hash_desc *hash, struct iscsi_pdu *pdu, + u8 *crc) + { + struct scatterlist sg[2]; + unsigned int nbytes = sizeof(struct iscsi_hdr); + +- SETSG(sg[0], &pdu->bhs, nbytes); ++ sg_init_table(sg, pdu->ahssize ? 2 : 1); ++ ++ sg_set_buf(&sg[0], &pdu->bhs, nbytes); + if (pdu->ahssize) { +- SETSG(sg[1], pdu->ahs, pdu->ahssize); ++ sg_set_buf(&sg[1], pdu->ahs, pdu->ahssize); + nbytes += pdu->ahssize; + } + +@@ -220,6 +215,7 @@ static void digest_data(struct hash_desc + + assert(count <= ISCSI_CONN_IOV_MAX); + ++ sg_init_table(sg, ARRAY_SIZE(cmnd->conn->hash_sg)); + crypto_hash_init(hash); + + for (i = 0; size; i++) { +@@ -228,13 +224,13 @@ static void digest_data(struct hash_desc + else + length = size; + +- sg[i].page = tio->pvec[idx + i]; +- sg[i].offset = offset; +- sg[i].length = length; ++ sg_set_page(&sg[i], tio->pvec[idx + i], length, offset); + size -= length; + offset = 0; + } + ++ sg_mark_end(&sg[i - 1]); ++ + crypto_hash_update(hash, sg, nbytes); + crypto_hash_final(hash, crc); + } +Index: kernel/event.c +=================================================================== +--- kernel/event.c (revision 145) ++++ kernel/event.c (revision 146) +@@ -28,7 +28,7 @@ static int event_recv_msg(struct sk_buff + return 0; + } + +-static int event_recv_skb(struct sk_buff *skb) ++static void event_recv_skb(struct sk_buff *skb) + { + int err; + struct nlmsghdr *nlh; +@@ -37,7 +37,7 @@ static int event_recv_skb(struct sk_buff + while (skb->len >= NLMSG_SPACE(0)) { + nlh = (struct nlmsghdr *)skb->data; + if (nlh->nlmsg_len < sizeof(*nlh) || skb->len < nlh->nlmsg_len) +- return 0; ++ break; + rlen = NLMSG_ALIGN(nlh->nlmsg_len); + if (rlen > skb->len) + rlen = skb->len; +@@ -47,19 +47,6 @@ static int event_recv_skb(struct sk_buff + netlink_ack(skb, nlh, 0); + skb_pull(skb, rlen); + } +- return 0; +-} +- +-static void event_recv(struct sock *sk, int length) +-{ +- struct sk_buff *skb; +- +- while ((skb = skb_dequeue(&sk->sk_receive_queue))) { +- if (event_recv_skb(skb) && skb->len) +- skb_queue_head(&sk->sk_receive_queue, skb); +- else +- kfree_skb(skb); +- } + } + + static int notify(void *data, int len, int gfp_mask) +@@ -95,7 +82,8 @@ int event_send(u32 tid, u64 sid, u32 cid + + int event_init(void) + { +- nl = netlink_kernel_create(NETLINK_IET, 1, event_recv, THIS_MODULE); ++ nl = netlink_kernel_create(&init_net, NETLINK_IET, 1, event_recv_skb, ++ NULL, THIS_MODULE); + if (!nl) + return -ENOMEM; + else diff --git a/sys-block/iscsitarget/iscsitarget-0.4.15-r1.ebuild b/sys-block/iscsitarget/iscsitarget-0.4.15-r1.ebuild index 71479868d90e..92a8b8267dfb 100644 --- a/sys-block/iscsitarget/iscsitarget-0.4.15-r1.ebuild +++ b/sys-block/iscsitarget/iscsitarget-0.4.15-r1.ebuild @@ -1,6 +1,6 @@ -# Copyright 1999-2007 Gentoo Foundation +# Copyright 1999-2008 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/sys-block/iscsitarget/iscsitarget-0.4.15-r1.ebuild,v 1.2 2007/11/06 07:07:22 mr_bones_ Exp $ +# $Header: /var/cvsroot/gentoo-x86/sys-block/iscsitarget/iscsitarget-0.4.15-r1.ebuild,v 1.3 2008/02/22 03:38:50 vapier Exp $ inherit linux-mod eutils @@ -15,23 +15,25 @@ IUSE="" RDEPEND="dev-libs/openssl" DEPEND="${RDEPEND} - virtual/linux-sources" + virtual/linux-sources" + MODULE_NAMES="iscsi_trgt(kernel/iscsi:${S}/kernel)" CONFIG_CHECK="CRYPTO_CRC32C" ERROR_CFG="iscsitarget needs support for CRC32C in your kernel." src_unpack() { unpack ${A} - EPATCH_OPTS="-d ${S} -p0" \ - epatch ${FILESDIR}/${PN}-0.4.13-usrbuildfix.patch - convert_to_m ${S}/Makefile + cd "${S}" + epatch "${FILESDIR}"/${PN}-0.4.15-isns-set-scn-flag.patch #180619 + epatch "${FILESDIR}"/${PN}-0.4.15-build.patch + epatch "${FILESDIR}"/${PN}-0.4.15-kmem.patch + epatch "${FILESDIR}"/${PN}-0.4.15-scatter.patch + convert_to_m "${S}"/Makefile } src_compile() { - einfo "Building userspace" - CFLAGS="" emake usr OPTFLAGS="${CFLAGS}" || die "failed to build userspace" + emake usr || die "failed to build userspace" - einfo "Building kernel modules" unset ARCH emake KSRC="${KERNEL_DIR}" kernel || die "failed to build module" } |