CRUX-ARM : Home

Home :: Documentation :: Download :: Development :: Community :: Ports :: Packages :: Bugs :: Links :: About :: Donors
Use extension .cpio.gz for initramfs file and cleanup
authorJose V Beneyto <sepen@crux.nu>
Fri, 18 Oct 2013 10:43:11 +0000 (10:43 +0000)
committerJose V Beneyto <sepen@crux.nu>
Fri, 18 Oct 2013 10:43:11 +0000 (10:43 +0000)
Makefile

index bc9d2aedb4bbc0d485a59f452f92279fc2034f3b..2cbc2bfa0d5ebf87a92d150e4524edad947ae813 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -102,7 +102,7 @@ gen_init_cpio-distclean: gen_init_cpio-clean
 $(WORK)/mnt:
        mkdir -p $(WORK)/mnt
 
-$(WORK)/initramfs: check-root busybox dialog $(WORK)/mnt gen_init_cpio $(TOPDIR)/filesystem
+$(WORK)/initramfs.cpio.gz: 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
@@ -123,18 +123,15 @@ $(WORK)/initramfs: check-root busybox dialog $(WORK)/mnt gen_init_cpio $(TOPDIR)
        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 && \
-       /sbin/ldconfig -r $(WORK)/mnt && \
-        cd $(WORK)/mnt && \
-       find . | cpio -o -H newc > $(WORK)/initramfs.cpio && \
-       cd $(WORK) && \
-       gzip -v initramfs.cpio && \
-       cp $(WORK)/initramfs{.cpio.gz,} && \
-       touch $(WORK)/initramfs
+       /sbin/ldconfig -r $(WORK)/mnt
+       cd $(WORK)/mnt && find . | cpio -o -H newc > $(WORK)/initramfs.cpio && \
+               cd $(WORK) && gzip -v initramfs.cpio
+       touch $(WORK)/initramfs.cpio.gz
 
-initramfs: $(WORK)/initramfs
+initramfs: $(WORK)/initramfs.cpio.gz
 
 initramfs-clean:
-       rm -f $(WORK)/initramfs
+       rm -rf $(WORK)/initramfs* $(WORK)/mnt
 
 initramfs-distclean: initramfs-clean