CRUX-ARM : Home

Home :: Documentation :: Download :: Development :: Community :: Ports :: Packages :: Bugs :: Links :: About :: Donors
Added mke2fs from e2fsprogs and removed it from busybox's config. Also cleaned up...
[initramfs.git] / Makefile
index 82462b8a6bc22014488514a95bfa9c998749a3f1..53384411e7475d1342e420582223abac88083ef4 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -15,18 +15,21 @@ CROSSTOOLS = $(TOPDIR)/../toolchain/crosstools
 BUSYBOX_VERSION  = 1.21.1
 BUSYBOX_SOURCE   = http://busybox.net/downloads/busybox-$(BUSYBOX_VERSION).tar.bz2
 
+E2FSPROGS_VERSION = 1.42.5
+E2FSPROGS_SOURCE = http://downloads.sourceforge.net/project/e2fsprogs/e2fsprogs/v$(E2FSPROGS_VERSION)/e2fsprogs-$(E2FSPROGS_VERSION).tar.gz
+
 DIALOG_VERSION = 1.2-20130523
 DIALOG_SOURCE = ftp://invisible-island.net/dialog/dialog-$(DIALOG_VERSION).tgz
 
 NCURSES_HEADER = $(CLFS)/usr/include/ncurses.h
 
-.PHONY: all check-root busybox dialog gen_init_cpio initramfs clean distclean
+.PHONY: all check-root busybox e2fsprogs dialog gen_init_cpio initramfs clean distclean
 
 all: initramfs
 
-clean: busybox-clean dialog-clean gen_init_cpio-clean initramfs-clean
+clean: busybox-clean e2fsprogs-clean dialog-clean gen_init_cpio-clean initramfs-clean
 
-distclean: busybox-distclean dialog-distclean gen_init_cpio-distclean initramfs-distclean
+distclean: busybox-distclean e2fsprogs-distclean dialog-distclean gen_init_cpio-distclean initramfs-distclean
 
 check-root:
        @if [ "$$UID" != "0" ]; then \
@@ -48,7 +51,7 @@ $(WORK)/busybox-$(BUSYBOX_VERSION): $(WORK)/busybox-$(BUSYBOX_VERSION).tar.bz2 $
 $(WORK)/busybox-$(BUSYBOX_VERSION)/_install/bin/busybox: $(WORK)/busybox-$(BUSYBOX_VERSION)
        export PATH=$(CROSSTOOLS)/bin:$$PATH &&  \
        export LD_LIBRARY_PATH=$(CROSSTOOLS)/lib:$$LD_LIBRARY_PATH && \
-       make -C $(WORK)/busybox-$(BUSYBOX_VERSION) ARCH=arm CROSS_COMPILE=$(TARGET)- install && \
+       make -j1 -C $(WORK)/busybox-$(BUSYBOX_VERSION) ARCH=arm CROSS_COMPILE=$(TARGET)- install && \
        install -D -m 0755 $(WORK)/busybox-$(BUSYBOX_VERSION)/examples/udhcp/simple.script $(WORK)/busybox-$(BUSYBOX_VERSION)/_install/usr/share/udhcpc/default.script && \
        $(TARGET)-strip $(WORK)/busybox-$(BUSYBOX_VERSION)/_install/bin/busybox && \
        touch $(WORK)/busybox-$(BUSYBOX_VERSION)/_install/bin/busybox
@@ -61,6 +64,36 @@ busybox-clean:
 busybox-distclean: busybox-clean
        rm -vf $(WORK)/busybox-$(BUSYBOX_VERSION).tar.bz2
 
+$(WORK)/e2fsprogs-$(E2FSPROGS_VERSION).tar.gz:
+       wget -P $(WORK) -c $(E2FSPROGS_SOURCE)
+
+$(WORK)/e2fsprogs-$(E2FSPROGS_VERSION): $(WORK)/e2fsprogs-$(E2FSPROGS_VERSION).tar.gz
+       tar -C $(WORK) -xvzf $(WORK)/e2fsprogs-$(E2FSPROGS_VERSION).tar.gz
+       touch $(WORK)/e2fsprogs-$(E2FSPROGS_VERSION)
+
+$(WORK)/e2fsprogs-$(E2FSPROGS_VERSION)/misc/mke2fs: $(WORK)/e2fsprogs-$(E2FSPROGS_VERSION)
+       export PATH=$(CROSSTOOLS)/bin:$$PATH &&  \
+       export LD_LIBRARY_PATH=$(CROSSTOOLS)/lib:$$LD_LIBRARY_PATH && \
+       cd $(WORK)/e2fsprogs-$(E2FSPROGS_VERSION) && \
+               ./configure --build=$(BUILD) --host=$(TARGET) --prefix=/usr --with-root-prefix= \
+               --mandir=/usr/man --disable-symlink-install --disable-nls --disable-compression \
+               --disable-htree --disable-elf-shlibs --disable-bsd-shlibs --disable-profile \
+               --disable-checker --disable-jbd-debug --disable-blkid-debug --disable-testio-debug \
+               --enable-libuuid --enable-libblkid --disable-libquota --disable-debugfs --disable-imager \
+               --disable-resizer --disable-defrag --disable-fsck --disable-e2initrd-helper \
+               --disable-tls --disable-rpath && \
+               make V=1 CFLAGS="$(CFLAGS) -static" LDFLAGS="$(LDFLAGS) -static" && \
+               $(TARGET)-strip $(WORK)/e2fsprogs-$(E2FSPROGS_VERSION)/misc/mke2fs && \
+               touch $(WORK)/e2fsprogs-$(E2FSPROGS_VERSION)/misc/mke2fs
+
+e2fsprogs: $(WORK)/e2fsprogs-$(E2FSPROGS_VERSION)/misc/mke2fs
+
+e2fsprogs-clean:
+       rm -vrf $(WORK)/e2fsprogs-$(E2FSPROGS_VERSION)
+
+e2fsprogs-distclean:
+       rm -vf $(WORK)/e2fsprogs-$(E2FSPROGS_VERSION).tar.bz2
+
 $(WORK)/dialog-$(DIALOG_VERSION).tgz:
        wget -P $(WORK) -c $(DIALOG_SOURCE)
 
@@ -102,7 +135,7 @@ gen_init_cpio-distclean: gen_init_cpio-clean
 $(WORK)/mnt:
        mkdir -p $(WORK)/mnt
 
-$(WORK)/initramfs.cpio: check-root busybox dialog $(WORK)/mnt gen_init_cpio $(TOPDIR)/filesystem
+$(WORK)/initramfs.cpio: check-root busybox e2fsprogs dialog $(WORK)/mnt gen_init_cpio $(TOPDIR)/filesystem
        install -d -m 0755 $(WORK)/mnt/{mnt,media,etc,dev,sys,proc,lib,usr,var/{log,lock,run},tmp}
        mknod $(WORK)/mnt/dev/console c 5 1 && chmod 666 $(WORK)/mnt/dev/console
        mknod $(WORK)/mnt/dev/null c 1 3 && chmod 666 $(WORK)/mnt/dev/null
@@ -113,6 +146,10 @@ $(WORK)/initramfs.cpio: check-root busybox dialog $(WORK)/mnt gen_init_cpio $(TO
                mknod $(WORK)/mnt/dev/tty$$i c 4 $$i && chmod 666 $(WORK)/mnt/dev/tty$$i; \
        done
        cp -dRv $(WORK)/busybox-$(BUSYBOX_VERSION)/_install/* $(WORK)/mnt
+       install -v -m 0755 $(WORK)/e2fsprogs-$(E2FSPROGS_VERSION)/misc/mke2fs $(WORK)/mnt/sbin
+       for i in 2 3 4 4dev; do \
+               ln -s mke2fs $(WORK)/mnt/sbin/mkfs.ext$$i; \
+       done
        install -v -m 0755 $(WORK)/dialog-$(DIALOG_VERSION)/_install/usr/bin/dialog $(WORK)/mnt/usr/bin
        cp -dRv $(CLFS)/lib/libnss_{files*,dns*} $(CLFS)/lib/libresolv* $(WORK)/mnt/lib
        install -d  $(WORK)/mnt/usr/share/terminfo