Mailing List Archive

Building pre5 on a 2.2 kernel
(My apologies if this is a duplicate)




Has anyone had any luck building pre5 for a 2.2 kernel?

For pre3 I had to hack it a bit to get it to compile, but I'm not sure
I can for pre5.

Specifically: pre5 now uses wait_queue_t, that was not the case in
pre3. This makes drbd_double_sleep_on() impossible to compile. I
looked on a 2.4.2 (Red Hat 7.1) system and wait_queue_t is defined in
/usr/include/linux/wait.h, this is not the case in 2.2 (Red Hat 6.1).
Are there plans to support 2.2 with DRBD 1.6?

The other changes that I had to do included (the diff file is below):

drbd/Makefile.vars: My gcc didn't like
"-mpreferred-stack-boundary=2", I removed it from
KAF_i386.

drbd/Makefile: The definition of REQ_O wasn't working, I just hard
coded it to drbd_req-2.2.o.

drbd/drbd_int.h and drbd_main.c : Moved the definitions for
init_MUTEX_LOCKED, init_MUTEX,
init_waitqueue_head and
wait_queue_head_t from drbd_main.c
to drbd_int.h.

drbd/drbd_receiver.c: Compilation errors, substituted
unacked_cnt.counter for unacked_cnt.
if (drbd_conf[minor].unacked_cnt >= (NR_REQUEST / 4)) {
if (drbd_conf[minor].unacked_cnt.counter >= (NR_REQUEST / 4)) {


Thanks.


(diffs...)

diff -r drbd/Makefile.vars drbd.localchanges/Makefile.vars
40c40
< KAF_i386 := -fno-strict-aliasing -mpreferred-stack-boundary=2
---
> KAF_i386 := -fno-strict-aliasing # -mpreferred-stack-boundary=2
diff -r drbd/drbd/Makefile drbd.localchanges/drbd/Makefile
24c24,25
< REQ_O = $(shell if [ "$(KERNVER)" "<" "2.4.0" ]; then echo
"drbd_req-2.2.o"; else echo "drbd_req-2.4.o"; fi )
---
> #REQ_O = $(shell if [ "$(KERNVER)" "<" "2.4.0" ]; then echo
"drbd_req-2.2.o"; else echo "drbd_req-2.4.o"; fi )
> REQ_O = drbd_req-2.2.o
diff -r drbd/drbd/drbd_int.h drbd.localchanges/drbd/drbd_int.h
56a57,73
> #if 1
> #if LINUX_VERSION_CODE < KERNEL_VERSION(2,2,18)
> #define init_MUTEX_LOCKED( A ) (*(A)=MUTEX_LOCKED)
> #define init_MUTEX( A ) (*(A)=MUTEX)
> #define init_waitqueue_head( A ) (*(A)=0)
> typedef struct wait_queue* wait_queue_head_t;
>
> /* I am assuming that 2.2 kernel does not support SMP -tony */
> #define del_timer_sync(t) del_timer(t)
>
>
> #endif
> #endif /* 1 */
>
>
>
>
diff -r drbd/drbd/drbd_main.c drbd.localchanges/drbd/drbd_main.c
72a73
> #if 0
78a80
> #endif
diff -r drbd/drbd/drbd_receiver.c drbd.localchanges/drbd/drbd_receiver.c
638a639
> #if 0
639a641,643
> #else
> if (drbd_conf[minor].unacked_cnt.counter >= (NR_REQUEST / 4)) {
> #endif

--
Tony Willoughby tonyw@example.com

"The more it stays the same, the less it changes."
-Spinal Tap
Re: Building pre5 on a 2.2 kernel [ In reply to ]
On the weekend I did a "backport" to 2.2.x. It is already in CVS, but since
I am still hunting a rare semaphore deadlock, -pre6 is not yet released.

I compiled it with 2.2.19....

-Philipp

* Tony Willoughby <tonyw@example.com> [011023 00:08]:
>
> (My apologies if this is a duplicate)
>
>
>
>
> Has anyone had any luck building pre5 for a 2.2 kernel?
>
> For pre3 I had to hack it a bit to get it to compile, but I'm not sure
> I can for pre5.
>
> Specifically: pre5 now uses wait_queue_t, that was not the case in
> pre3. This makes drbd_double_sleep_on() impossible to compile. I
> looked on a 2.4.2 (Red Hat 7.1) system and wait_queue_t is defined in
> /usr/include/linux/wait.h, this is not the case in 2.2 (Red Hat 6.1).
> Are there plans to support 2.2 with DRBD 1.6?
>
> The other changes that I had to do included (the diff file is below):
>
> drbd/Makefile.vars: My gcc didn't like
> "-mpreferred-stack-boundary=2", I removed it from
> KAF_i386.
>
> drbd/Makefile: The definition of REQ_O wasn't working, I just hard
> coded it to drbd_req-2.2.o.
>
> drbd/drbd_int.h and drbd_main.c : Moved the definitions for
> init_MUTEX_LOCKED, init_MUTEX,
> init_waitqueue_head and
> wait_queue_head_t from drbd_main.c
> to drbd_int.h.
>
> drbd/drbd_receiver.c: Compilation errors, substituted
> unacked_cnt.counter for unacked_cnt.
> if (drbd_conf[minor].unacked_cnt >= (NR_REQUEST / 4)) {
> if (drbd_conf[minor].unacked_cnt.counter >= (NR_REQUEST / 4)) {
>
>
> Thanks.
>
>
> (diffs...)
>
> diff -r drbd/Makefile.vars drbd.localchanges/Makefile.vars
> 40c40
> < KAF_i386 := -fno-strict-aliasing -mpreferred-stack-boundary=2
> ---
> > KAF_i386 := -fno-strict-aliasing # -mpreferred-stack-boundary=2
> diff -r drbd/drbd/Makefile drbd.localchanges/drbd/Makefile
> 24c24,25
> < REQ_O = $(shell if [ "$(KERNVER)" "<" "2.4.0" ]; then echo
> "drbd_req-2.2.o"; else echo "drbd_req-2.4.o"; fi )
> ---
> > #REQ_O = $(shell if [ "$(KERNVER)" "<" "2.4.0" ]; then echo
> "drbd_req-2.2.o"; else echo "drbd_req-2.4.o"; fi )
> > REQ_O = drbd_req-2.2.o
> diff -r drbd/drbd/drbd_int.h drbd.localchanges/drbd/drbd_int.h
> 56a57,73
> > #if 1
> > #if LINUX_VERSION_CODE < KERNEL_VERSION(2,2,18)
> > #define init_MUTEX_LOCKED( A ) (*(A)=MUTEX_LOCKED)
> > #define init_MUTEX( A ) (*(A)=MUTEX)
> > #define init_waitqueue_head( A ) (*(A)=0)
> > typedef struct wait_queue* wait_queue_head_t;
> >
> > /* I am assuming that 2.2 kernel does not support SMP -tony */
> > #define del_timer_sync(t) del_timer(t)
> >
> >
> > #endif
> > #endif /* 1 */
> >
> >
> >
> >
> diff -r drbd/drbd/drbd_main.c drbd.localchanges/drbd/drbd_main.c
> 72a73
> > #if 0
> 78a80
> > #endif
> diff -r drbd/drbd/drbd_receiver.c drbd.localchanges/drbd/drbd_receiver.c
> 638a639
> > #if 0
> 639a641,643
> > #else
> > if (drbd_conf[minor].unacked_cnt.counter >= (NR_REQUEST / 4)) {
> > #endif
>
> --
> Tony Willoughby tonyw@example.com
>
> "The more it stays the same, the less it changes."
> -Spinal Tap
>
> _______________________________________________
> DRBD-devel mailing list
> DRBD-devel@example.com
> https://lists.sourceforge.net/lists/listinfo/drbd-devel
Re: Building pre5 on a 2.2 kernel [ In reply to ]
On Tuesday 23 October 2001 03:12 am, Philipp Reisner wrote:
> On the weekend I did a "backport" to 2.2.x. It is already in CVS, but
> since I am still hunting a rare semaphore deadlock, -pre6 is not yet
> released.
>
> I compiled it with 2.2.19....

Very cool, thank you Philipp.

I'll stick with pre3 until pre6 is ready.

Thanks again.


>
> -Philipp
>
> * Tony Willoughby <tonyw@example.com> [011023 00:08]:
> > (My apologies if this is a duplicate)
> >
> >
> >
> >
> > Has anyone had any luck building pre5 for a 2.2 kernel?
> >
> > For pre3 I had to hack it a bit to get it to compile, but I'm not
> > sure I can for pre5.
> >
> > Specifically: pre5 now uses wait_queue_t, that was not the case in
> > pre3. This makes drbd_double_sleep_on() impossible to compile. I
> > looked on a 2.4.2 (Red Hat 7.1) system and wait_queue_t is defined
> > in /usr/include/linux/wait.h, this is not the case in 2.2 (Red Hat
> > 6.1). Are there plans to support 2.2 with DRBD 1.6?
> >
> > The other changes that I had to do included (the diff file is
> > below):
> >
> > drbd/Makefile.vars: My gcc didn't like
> > "-mpreferred-stack-boundary=2", I removed it
> > from KAF_i386.
> >
> > drbd/Makefile: The definition of REQ_O wasn't working, I just hard
> > coded it to drbd_req-2.2.o.
> >
> > drbd/drbd_int.h and drbd_main.c : Moved the definitions for
> > init_MUTEX_LOCKED, init_MUTEX,
> > init_waitqueue_head and
> > wait_queue_head_t from
> > drbd_main.c to drbd_int.h.
> >
> > drbd/drbd_receiver.c: Compilation errors, substituted
> > unacked_cnt.counter for unacked_cnt.
> > if (drbd_conf[minor].unacked_cnt >= (NR_REQUEST / 4)) {
> > if (drbd_conf[minor].unacked_cnt.counter >= (NR_REQUEST /
> > 4)) {
> >
> >
> > Thanks.
> >
> >
> > (diffs...)
> >
> > diff -r drbd/Makefile.vars drbd.localchanges/Makefile.vars
> > 40c40
> > < KAF_i386 := -fno-strict-aliasing
> > -mpreferred-stack-boundary=2 ---
> >
> > > KAF_i386 := -fno-strict-aliasing #
> > > -mpreferred-stack-boundary=2
> >
> > diff -r drbd/drbd/Makefile drbd.localchanges/drbd/Makefile
> > 24c24,25
> > < REQ_O = $(shell if [ "$(KERNVER)" "<" "2.4.0" ]; then echo
> > "drbd_req-2.2.o"; else echo "drbd_req-2.4.o"; fi )
> > ---
> >
> > > #REQ_O = $(shell if [ "$(KERNVER)" "<" "2.4.0" ]; then echo
> >
> > "drbd_req-2.2.o"; else echo "drbd_req-2.4.o"; fi )
> >
> > > REQ_O = drbd_req-2.2.o
> >
> > diff -r drbd/drbd/drbd_int.h drbd.localchanges/drbd/drbd_int.h
> > 56a57,73
> >
> > > #if 1
> > > #if LINUX_VERSION_CODE < KERNEL_VERSION(2,2,18)
> > > #define init_MUTEX_LOCKED( A ) (*(A)=MUTEX_LOCKED)
> > > #define init_MUTEX( A ) (*(A)=MUTEX)
> > > #define init_waitqueue_head( A ) (*(A)=0)
> > > typedef struct wait_queue* wait_queue_head_t;
> > >
> > > /* I am assuming that 2.2 kernel does not support SMP -tony */
> > > #define del_timer_sync(t) del_timer(t)
> > >
> > >
> > > #endif
> > > #endif /* 1 */
> >
> > diff -r drbd/drbd/drbd_main.c drbd.localchanges/drbd/drbd_main.c
> > 72a73
> >
> > > #if 0
> >
> > 78a80
> >
> > > #endif
> >
> > diff -r drbd/drbd/drbd_receiver.c
> > drbd.localchanges/drbd/drbd_receiver.c 638a639
> >
> > > #if 0
> >
> > 639a641,643
> >
> > > #else
> > > if (drbd_conf[minor].unacked_cnt.counter >= (NR_REQUEST /
> > > 4)) { #endif
> >
> > --
> > Tony Willoughby tonyw@example.com
> >
> > "The more it stays the same, the less it changes."
> > -Spinal Tap
> >
> > _______________________________________________
> > DRBD-devel mailing list
> > DRBD-devel@example.com
> > https://lists.sourceforge.net/lists/listinfo/drbd-devel

--
Tony Willoughby tonyw@example.com


PCMCIA - People Can't Memorize Computer Industry Acronyms.