Bug List: (This bug is not in your last search results)   Show last search results      Search page      Enter new bug
Bug#: 211426
Alias:
Product:
Component:
Status: RESOLVED
Resolution: FIXED
Assigned To: Gentoo's Team for Core System packages <base-system@gentoo.org>
Hardware:
OS:
Version:
Priority:
Severity:
Reporter: Jimmy.Jazz@gmx.net
Add CC:
CC:
URL:
Summary:
Status Whiteboard:
Keywords:

Filename Description Type Creator Created Size Actions
mdadm-ebuild.diff mdadm with mdassemble and static flag patch Jimmy.Jazz@gmx.net 2008-02-25 19:28 0000 2.29 KB Details | Diff
mdadm-add-mdassemble.patch add mdassemble and mdadm.static in Makefile patch Jimmy.Jazz@gmx.net 2008-02-25 19:29 0000 284 bytes Details | Diff
mdadm-Makefile.patch Makefile patch Jimmy.Jazz@gmx.net 2008-03-17 22:40 0000 820 bytes Details | Diff
mdadm-2.6.4-r1.ebuild ebuild with mdassemble text/plain Jimmy.Jazz@gmx.net 2008-03-22 12:56 0000 3.33 KB Details
mdadm-Makefile.diff Mafile patch patch Jimmy.Jazz@gmx.net 2008-03-22 12:57 0000 2.46 KB Details | Diff
mdadm-2.6.4-r2.ebuild ebuild with mdassemble text/plain Jimmy.Jazz@gmx.net 2008-03-22 13:29 0000 3.35 KB Details
ebuild-corrective correct the directory name where mdadm will look for mdadm.conf patch Jimmy.Jazz@gmx.net 2008-03-22 13:47 0000 1012 bytes Details | Diff
mdadm-2.6.4-r2.ebuild ebuild with mdassemble text/plain Jimmy.Jazz@gmx.net 2008-03-22 23:33 0000 3.33 KB Details
Makefile Makefile more generic text/plain Jimmy.Jazz@gmx.net 2008-03-24 18:38 0000 3.28 KB Details
Create a New Attachment (proposed patch, testcase, etc.) View All

Bug 211426 depends on: Show dependency tree
Bug 211426 blocks:
Votes: 0    Show votes for this bug    Vote for this bug

Additional Comments: (this is where you put emerge --info)


Not eligible to see or edit group visibility for this bug.






View Bug Activity   |   Format For Printing   |   XML   |   Clone This Bug


Description:   Opened: 2008-02-25 19:22 0000
mdassemble is a lightweight program to assemble raid devices  that can be
called directly for an initramfs filesystem. It weights 88ko compiled
statically with dietlibc. Also, it would be great to see it in a mdadm ebuild
with mdadm.static.


Reproducible: Always

------- Comment #1 From Jimmy.Jazz@gmx.net 2008-02-25 19:28:53 0000 -------
Created an attachment (id=144625) [details]
mdadm with mdassemble and static flag

It is not quite a good example but that was the only one that has survived. It
works well with crossdev.

------- Comment #2 From Jimmy.Jazz@gmx.net 2008-02-25 19:29:58 0000 -------
Created an attachment (id=144627) [details]
add mdassemble and mdadm.static in Makefile

------- Comment #3 From SpanKY 2008-03-16 08:05:53 0000 -------
(From update of attachment 144625 [details])
selection of a compiler is up to the user, not the ebuild.  same goes for
static linking.

there's also a lot of extraneous noise/wrong lines in the ebuild diff.

post a patch against the Makefile to generate mdassemble using the normal
compiler and i'll look at it.

------- Comment #4 From Jimmy.Jazz@gmx.net 2008-03-17 22:37:20 0000 -------
(In reply to comment #3)
> (From update of attachment 144625 [details] [edit])
> selection of a compiler is up to the user, not the ebuild.  same goes for
> static linking.
> 
> there's also a lot of extraneous noise/wrong lines in the ebuild diff.

I agree with you. Sorry for that. It is sometimes a pain in the neck to get a
nice ebuild especially if everything goes wrong.

> 
> post a patch against the Makefile to generate mdassemble using the normal
> compiler and i'll look at it.
> 

I just patched the makefile to handle mdassemble as well as mdadm.uclibc (the
initial makefile ignores mdadm.uclibc whereas mdadm binary works like expected
even from an initramfs file. I'm not always so lucky with busybox ;))

The makefile works with the following flags,

LDFLAGS="-static" CHOST="x86_64-pc-linux-uclibc" make mdadm.uclibc
LDFLAGS="-static" CHOST="x86_64-pc-linux-uclibc" make mdassemble.uclibc
CFLAGS="-static" MDASSEMBLE_AUTO="dummy" make mdassemble
or to build a smaller program (~88k) CFLAGS="-static" make mdassemble

FYI, I was not able to play with uclibc successfully with neither device-mapper
nor lvm ebuild configure file. The configure file always use gnu gcc even if
CHOST, CBUILD or CTARGET is/are specified :( but that's an other story.

I hope I could help.

------- Comment #5 From Jimmy.Jazz@gmx.net 2008-03-17 22:40:24 0000 -------
Created an attachment (id=146418) [details]
Makefile

------- Comment #6 From SpanKY 2008-03-18 11:32:02 0000 -------
i dont see how that patch helps us ... for the ebuild, we dont care about the
random extraneous targets that mdadm's Makefile provides.

what exactly are you after ?  mdassemble ?  so fix the default "mdassemble"
target so that it:
 - does not delete all random objects
 - does not hardcode static flags
 - uses the normal toolchain / flags

then when people do `emerge mdadm`, they get a normal dynamic "mdassemble"
binary.  if they want a static one, they can build up with USE=static and copy
mdassemble out of the tree.  or if they want to build with some random
toolchain (like uclibc/dietlibc/whatever), they set their build environment
accordingly.

------- Comment #7 From Jimmy.Jazz@gmx.net 2008-03-22 12:54:48 0000 -------
(In reply to comment #6)
> i dont see how that patch helps us ... for the ebuild, we dont care about the
> random extraneous targets that mdadm's Makefile provides.

You asked me for a Makefile not an ebuild.

> what exactly are you after ?  

That's what i'm asking myself sometimes. Seriously, the idea was to get
mdassemble and mdadm binaries as small as possible.

> then when people do `emerge mdadm`, they get a normal dynamic "mdassemble"
> binary.  if they want a static one, they can build up with USE=static and copy
> mdassemble out of the tree.  or if they want to build with some random
> toolchain (like uclibc/dietlibc/whatever), they set their build environment
> accordingly.
> 

I didn't test all the possibilities, but I hope it will now fit their needs.

I don't have tcc, klibc and dietlibc cross-compiler installed, I cannot test
them.
It is still possible to use diet directly with the diet flag.

mdassemble works when compiled statically. Otherwise use mdadm instead.

For example,
USE="diet" ebuild mdadm-2.6.4-r1.ebuild install
USE=static CHOST=x86_64-pc-linux-uclibc ebuild mdadm-2.6.4-r1.ebuild install

I hope that will satisfy your requirements :)

------- Comment #8 From Jimmy.Jazz@gmx.net 2008-03-22 12:56:20 0000 -------
Created an attachment (id=146878) [details]
ebuild with mdassemble

------- Comment #9 From Jimmy.Jazz@gmx.net 2008-03-22 12:57:27 0000 -------
Created an attachment (id=146879) [details]
Mafile patch

------- Comment #10 From Jimmy.Jazz@gmx.net 2008-03-22 13:29:02 0000 -------
Created an attachment (id=146886) [details]
ebuild with mdassemble

------- Comment #11 From Jimmy.Jazz@gmx.net 2008-03-22 13:33:52 0000 -------
(From update of attachment 146878 [details])
Wrong file + errors when using mailer and mdauto flags

------- Comment #12 From Jimmy.Jazz@gmx.net 2008-03-22 13:47:32 0000 -------
Created an attachment (id=146889) [details]
correct the directory name where mdadm will look for mdadm.conf

Gentoo mdadm uses /etc/mdadm.conf instead

------- Comment #13 From Jimmy.Jazz@gmx.net 2008-03-22 23:33:47 0000 -------
Created an attachment (id=146958) [details]
ebuild with mdassemble

I'm not used to play with gentoo eclasses. mdadm and mdassemble need of course
to have the executable flag set otherwise raidstart.sh will not be able to run
mdadm and you will certainly end up with an unbootable system. So be careful.

To avoid any confusions I uploaded a full ebuild, hoping it won't be any errors
this time.

Sorry for the inconvenience.

------- Comment #14 From SpanKY 2008-03-23 17:55:03 0000 -------
we dont control klibc/dietlibc/uclibc at all in ebuilds.  just fix the
mdassemble target and that's it.

------- Comment #15 From Jimmy.Jazz@gmx.net 2008-03-24 18:38:25 0000 -------
Created an attachment (id=147155) [details]
Makefile more generic

(In reply to comment #14)
> we dont control klibc/dietlibc/uclibc at all in ebuilds.  just fix the
> mdassemble target and that's it.
> 

All right then. If I understand well you would prefer that the Makefile handles
all the xxlibc stuff and nothing shall be add in the ebuild. Actually, I didn't
look into a makefile for years and I'm a bit rusted. I will really appreciate
if someone could look after it in detail.

For instance, the makefile is able to understand CFLAGS, LDFLAGS, CPPFLAGS, CC
and for cross compiling CHOST and if CC is not set it will take the value make
will attribute to it by default (cc I guess).

CFLAGS="-ggdb" LDFLAGS=-static CPPFLAGS=" -USendmail" CC="diet gcc"
CHOST=x86_64-pc-linux-gnu make -f Makefile clean
CFLAGS="-ggdb" LDFLAGS=-static CPPFLAGS=" -USendmail" CC="gcc"
CHOST=x86_64-pc-linux-gnu make -f Makefile clean
CFLAGS="-ggdb" LDFLAGS=-static CPPFLAGS=" -USendmail" CC="gcc"
CHOST=x86_64-pc-linux-gnu make -f Makefile
CFLAGS="-ggdb" LDFLAGS=-static CPPFLAGS=" -USendmail" CC="gcc"
CHOST=x86_64-pc-linux-gnu make -f Makefile clean
CFLAGS="-ggdb" LDFLAGS=-static CPPFLAGS=" -USendmail" CC="gcc"
CHOST=x86_64-pc-linux-uclibc make -f Makefile clean
CFLAGS="-ggdb" LDFLAGS=-static CPPFLAGS=" -USendmail" CC="gcc"
CHOST=x86_64-pc-linux-uclibc make -f Makefile 
CFLAGS="-ggdb" CPPFLAGS=" -USendmail" CC="gcc" CHOST=x86_64-pc-linux-uclibc
make -f Makefile clean
CFLAGS="-ggdb" CPPFLAGS=" -USendmail" CC="gcc" CHOST=x86_64-pc-linux-uclibc
make -f Makefile 
CFLAGS="-ggdb" CPPFLAGS=" -USendmail" CC="gcc" CHOST=x86_64-pc-linux-uclibc
make -f Makefile clean
CFLAGS="-ggdb" CPPFLAGS=" -USendmail" CC="diet gcc"
CHOST=x86_64-pc-linux-uclibc make -f Makefile 

------- Comment #16 From Jimmy.Jazz@gmx.net 2008-03-24 18:52:19 0000 -------
Oops, as usual when you are in a hurry you make mistakes :(
Just delete $(DIET) before $(CC) in the following rules. If set, diet is call
from CC .

--- Makefile    2008-03-24 19:09:40.000000000 +0100
+++ /var/tmp/portage/sys-fs/mdadm-2.6.4-r1/work/mdadm-2.6.4/Makefile   
2008-03-24 19:34:31.000000000 +0100

@@ -97,11 +96,11 @@
 all : mdadm mdassemble

 mdadm : $(OBJS) $(STATICOBJS)
-       $(DIET) $(CC) ${CFLAGS} $(LDFLAGS) -o mdadm $(OBJS) $(LDLIBS)
$(STATICOBJS)
+       $(CC) ${CFLAGS} $(LDFLAGS) -o mdadm $(OBJS) $(LDLIBS) $(STATICOBJS)

 mdassemble : $(ASSEMBLE_SRCS) mdadm.h
        rm -f $(OBJS)
-       $(DIET) $(CC) $(LDFLAGS) $(ASSEMBLE_FLAGS) -DHAVE_STDINT_H -o
mdassemble $(ASSEMBLE_SRCS) $(STATICSRC)
+       $(CC) $(LDFLAGS) $(ASSEMBLE_FLAGS) -DHAVE_STDINT_H -o mdassemble
$(ASSEMBLE_SRCS) $(STATICSRC)

 mdadm.man : mdadm.8
        nroff -man mdadm.8 > mdadm.man

------- Comment #17 From SpanKY 2008-03-29 19:21:22 0000 -------
fixed with 2.6.4-r2

------- Comment #18 From Jimmy.Jazz@gmx.net 2008-04-16 19:41:14 0000 -------
(In reply to comment #17)
> fixed with 2.6.4-r2
> 

Thanks,

Just to let you know in case you missed it, I rewrite a new Makefile that
handled "standard" flags better, anyway if you want to cross compile. See last
attachment.
The commented lines at the beginning of the file show some examples. 
I use it to generate uclibc binary for my own initramfs.

Bug List: (This bug is not in your last search results)   Show last search results      Search page      Enter new bug