X-Git-Url: http://gitweb/?a=blobdiff_plain;f=Makefile;h=cc433854cd95d72cb8d14d109d3e3dea0fade231;hb=3e88256fee44ecb48cecd8c2cb78cc53f71205fb;hp=cd3df6dee479ee35279eeb4ee53f76a2566391f3;hpb=557be67fe72dc8b70d81817a22effd074c665c52;p=initramfs.git diff --git a/Makefile b/Makefile index cd3df6d..cc43385 100644 --- a/Makefile +++ b/Makefile @@ -6,32 +6,27 @@ TOPDIR = $(shell pwd) include $(TOPDIR)/../toolchain/vars.mk -TARGET = arm-crux-linux-gnueabi -DEVICE = versatile +TARGET = arm-crux-linux-gnueabihf WORK = $(TOPDIR)/work CLFS = $(TOPDIR)/../toolchain/clfs CROSSTOOLS = $(TOPDIR)/../toolchain/crosstools - -KERNEL_PATH = $(PWD)/../kernel/$(DEVICE) -KERNEL_VERSION = $(shell grep '^KERNEL_VERSION = ' $(KERNEL_PATH)/Makefile | sed 's|KERNEL_VERSION = ||') - -BUSYBOX_VERSION = 1.20.2 +BUSYBOX_VERSION = 1.21.1 BUSYBOX_SOURCE = http://busybox.net/downloads/busybox-$(BUSYBOX_VERSION).tar.bz2 -DIALOG_VERSION = 1.1-20120215 -DIALOG_SOURCE = ftp://dickey.his.com/dialog/dialog-$(DIALOG_VERSION).tgz +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 initramfs clean distclean +.PHONY: all check-root busybox dialog gen_init_cpio initramfs clean distclean -all: busybox dialog initramfs +all: initramfs -clean: busybox-clean dialog-clean initramfs-clean +clean: busybox-clean dialog-clean gen_init_cpio-clean initramfs-clean -dist-clean: busybox-distclean dialog-distclean gen_init_cpio-distclean initramfs-distclean +distclean: busybox-distclean dialog-distclean gen_init_cpio-distclean initramfs-distclean check-root: @if [ "$$UID" != "0" ]; then \ @@ -41,17 +36,19 @@ check-root: fi $(WORK)/busybox-$(BUSYBOX_VERSION).tar.bz2: - wget -P $(WORK) -c http://busybox.net/downloads/busybox-$(BUSYBOX_VERSION).tar.bz2 + wget -P $(WORK) -c $(BUSYBOX_SOURCE) -$(WORK)/busybox-$(BUSYBOX_VERSION): $(WORK)/busybox-$(BUSYBOX_VERSION).tar.bz2 $(PWD)/busybox-$(BUSYBOX_VERSION).config +$(WORK)/busybox-$(BUSYBOX_VERSION): $(WORK)/busybox-$(BUSYBOX_VERSION).tar.bz2 $(TOPDIR)/busybox-$(BUSYBOX_VERSION).config $(WORK)/fix-resource_header.patch tar -C $(WORK) -xvjf $(WORK)/busybox-$(BUSYBOX_VERSION).tar.bz2 - cp -v $(PWD)/busybox-$(BUSYBOX_VERSION).config $(WORK)/busybox-$(BUSYBOX_VERSION)/.config - touch $(WORK)/busybox-$(BUSYBOX_VERSION).tar.bz2 + cd $(WORK)/busybox-$(BUSYBOX_VERSION) && \ + patch -p1 -i $(WORK)/fix-resource_header.patch + cp -v $(TOPDIR)/busybox-$(BUSYBOX_VERSION).config $(WORK)/busybox-$(BUSYBOX_VERSION)/.config + touch $(WORK)/busybox-$(BUSYBOX_VERSION) $(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 @@ -74,14 +71,14 @@ $(WORK)/dialog-$(DIALOG_VERSION): $(WORK)/dialog-$(DIALOG_VERSION).tgz $(WORK)/dialog-$(DIALOG_VERSION)/_install/usr/bin/dialog: $(WORK)/dialog-$(DIALOG_VERSION) export PATH=$(CROSSTOOLS)/bin:$$PATH && \ export LD_LIBRARY_PATH=$(CROSSTOOLS)/lib:$$LD_LIBRARY_PATH && \ - cd $(WORK)/dialog-$(DIALOG_VERSION) && \ - ./configure --build=$(BUILD) --host=$(TARGET) --prefix=/usr --with-ncursesw && \ - find -type f -name 'makefile' \ - -exec sed -e "s|-I/usr|-I$(CLFS)/usr|g" -e "s|-L/usr|-L$(CLFS)/usr|g" -i {} \; && \ - make CC="$(TARGET)-gcc -static" && \ - make DESTDIR=$(WORK)/dialog-$(DIALOG_VERSION)/_install install && \ - $(TARGET)-strip $(WORK)/dialog-$(DIALOG_VERSION)/_install/usr/bin/dialog && \ - touch $(WORK)/dialog-$(DIALOG_VERSION)/_install/usr/bin/dialog + cd $(WORK)/dialog-$(DIALOG_VERSION) && \ + ./configure --build=$(BUILD) --host=$(TARGET) --prefix=/usr --with-ncursesw && \ + find -type f -name 'makefile' \ + -exec sed -e "s|-I/usr|-I$(CLFS)/usr|g" -e "s|-L/usr|-L$(CLFS)/usr|g" -i {} \; && \ + make CC="$(TARGET)-gcc -static" && \ + make DESTDIR=$(WORK)/dialog-$(DIALOG_VERSION)/_install install && \ + $(TARGET)-strip $(WORK)/dialog-$(DIALOG_VERSION)/_install/usr/bin/dialog && \ + touch $(WORK)/dialog-$(DIALOG_VERSION)/_install/usr/bin/dialog dialog: $(NCURSES_HEADER) $(WORK)/dialog-$(DIALOG_VERSION)/_install/usr/bin/dialog @@ -102,29 +99,39 @@ gen_init_cpio-clean: gen_init_cpio-distclean: gen_init_cpio-clean -$(WORK)/initramfs.cpio.gz-$(KERNEL_VERSION): check-root busybox dialog $(TOPDIR)/filesystem $(WORK)/gen_init_cpio $(WORK)/initramfs.lst - mkdir -p $(WORK)/mnt/{etc,lib,usr/share/terminfo} +$(WORK)/mnt: + mkdir -p $(WORK)/mnt + +$(WORK)/initramfs.cpio: check-root busybox 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 + mknod $(WORK)/mnt/dev/tty c 5 0 && chmod 666 $(WORK)/mnt/dev/tty + mkdir $(WORK)/mnt/dev/rd && mknod $(WORK)/mnt/dev/rd/0 b 1 0 + mknod $(WORK)/mnt/dev/ram0 b 1 0 && chmod 600 $(WORK)/mnt/dev/ram0 + for i in 0 1 2 3 4 5 6 7; do \ + 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)/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 cp -dRv $(CLFS)/usr/share/terminfo/v $(WORK)/mnt/usr/share/terminfo install -v -m 0644 $(TOPDIR)/filesystem/{fstab,inittab,profile,protocols,*.conf} $(WORK)/mnt/etc - install -v -m 0755 $(TOPDIR)/filesystem/rc $(WORK)/mnt/etc - install -v -m 0755 $(TOPDIR)/filesystem/{setup*,crux} $(WORK)/mnt/usr/bin + install -v -m 0664 $(TOPDIR)/filesystem/group $(WORK)/mnt/etc + install -v -m 0600 $(TOPDIR)/filesystem/passwd $(WORK)/mnt/etc + install -v -m 0400 $(TOPDIR)/filesystem/shadow $(WORK)/mnt/etc + install -v -m 0755 $(TOPDIR)/filesystem/rc $(WORK)/mnt/etc && \ + install -v -m 0755 $(TOPDIR)/filesystem/{setup,setup-chroot,crux} $(WORK)/mnt/usr/bin && \ + ln -s bin/busybox $(WORK)/mnt/init /sbin/ldconfig -r $(WORK)/mnt - cd $(WORK)/mnt && \ - sed -e "s/#KERNEL_VERSION#/$(KERNEL_VERSION)/g; s/#BUSYBOX_VERSION#/$(BUSYBOX_VERSION)/g" \ - $(WORK)/initramfs.lst > $(WORK)/initramfs.lst-sed && \ - $(WORK)/gen_init_cpio $(WORK)/initramfs.lst-sed | cpio -id && \ - find * | cpio -H newc -o > $(WORK)/initramfs.cpio && \ - gzip -v9 $(WORK)/initramfs.cpio - mv $(WORK)/initramfs.cpio.gz{,-$(KERNEL_VERSION)} - rm -rf $(WORK)/mnt + cd $(WORK)/mnt && find . | cpio -o -H newc > $(WORK)/initramfs.cpio + touch $(WORK)/initramfs.cpio -initramfs: $(WORK)/initramfs.cpio.gz-$(KERNEL_VERSION) +initramfs: $(WORK)/initramfs.cpio initramfs-clean: - rm -rf $(WORK)/initramfs-$(KERNEL_VERSION) $(WORK)/mnt $(WORK)/initramfs.cpio.gz-$(KERNEL_VERSION) + rm -rf $(WORK)/initramfs* $(WORK)/mnt initramfs-distclean: initramfs-clean