diff options
author | Matt Housh <jaeger@crux.nu> | 2015-06-15 18:30:31 -0500 |
---|---|---|
committer | Matt Housh <jaeger@crux.nu> | 2015-06-15 18:30:31 -0500 |
commit | b791a786c091cdb7c59f977bcb288cdf62947e8f (patch) | |
tree | b541f81b636612c8e70907a7d35516dc51a79a30 | |
parent | 05c7d7f56b0f10f81e643c855f875df0b3a6bc6f (diff) | |
download | iso-b791a786c091cdb7c59f977bcb288cdf62947e8f.tar.gz iso-b791a786c091cdb7c59f977bcb288cdf62947e8f.tar.xz |
Makefile updates for dash as /bin/sh
-rw-r--r-- | Makefile | 41 |
1 files changed, 23 insertions, 18 deletions
@@ -65,7 +65,7 @@ help: @echo " $(COLLECTIONS)" check-root: - @if [ "$$UID" != "0" ]; then \ + @if [ "$(shell id -u)" != "0" ]; then \ echo "You need to be root to do this."; \ exit 1; \ fi @@ -256,13 +256,13 @@ all-chroot: check-root bootstrap: check-root kernel @echo "Bootstrap started (`date +'%F %T'`)" @echo "- Stage 0 (`date +'%F %T'`)" - @$(MAKE) all &> log.stage0 + @$(MAKE) all > log.stage0 2>&1 @$(MAKE) check-log < log.stage0 @echo "- Stage 1 (`date +'%F %T'`)" - @$(MAKE) all-chroot &> log.stage1 + @$(MAKE) all-chroot > log.stage1 2>&1 @$(MAKE) check-log < log.stage1 @echo "- Stage 2 (`date +'%F %T'`)" - @$(MAKE) all-chroot &> log.stage2 + @$(MAKE) all-chroot > log.stage2 2>&1 @$(MAKE) check-log < log.stage2 @echo "Bootstrap completed (`date +'%F %T'`)" @@ -296,7 +296,7 @@ rootfs: kernel busybox @echo "- Installing kernel and modules..." @cp kernel/linux-$(KERNEL_VERSION)/System.map $(ROOTFS_DIR)/boot/System.map @cp kernel/linux-$(KERNEL_VERSION)/arch/x86/boot/bzImage $(ROOTFS_DIR)/boot/vmlinuz - @make -C kernel/linux-$(KERNEL_VERSION) INSTALL_MOD_PATH=$(ROOTFS_DIR) modules_install &> modules_install.log + @make -C kernel/linux-$(KERNEL_VERSION) INSTALL_MOD_PATH=$(ROOTFS_DIR) modules_install > modules_install.log 2>&1 @echo "- Deleting superfluous files..." @cd $(ROOTFS_DIR) && rm -rf var opt home @mkdir -p $(ROOTFS_DIR)/var/empty $(ROOTFS_DIR)/var/lib @@ -304,19 +304,22 @@ rootfs: kernel busybox @cd $(ROOTFS_DIR)/usr/share && mkdir l v x; cp terminfo/l/linux l; cp terminfo/v/vt100 v; cp terminfo/x/xterm x; rm -rf terminfo/*; mv l v x terminfo @cd $(ROOTFS_DIR)/usr/share && rm -rf et ss vim i18n zoneinfo @cd $(ROOTFS_DIR)/usr/bin && rm cal locale localedef rpcgen compile_et mk_cmds - @cd $(ROOTFS_DIR)/usr/sbin && rm group{add,del,mod} user{add,del,mod} grpck pwck iconvconfig - @cd $(ROOTFS_DIR)/etc && rm -rf cron {resolv,lilo,sysctl,pkgadd,pkgmk}.conf securetty + @cd $(ROOTFS_DIR)/usr/sbin && rm groupadd groupdel groupmod useradd userdel usermod grpck pwck iconvconfig + @cd $(ROOTFS_DIR)/etc && rm -rf cron resolv.conf lilo.conf sysctl.conf pkgadd.conf pkgmk.conf securetty @cd $(ROOTFS_DIR)/etc/rc.d && find . -type f ! -name "sshd" -exec rm -f '{}' \; - @cd $(ROOTFS_DIR)/lib/modules/$(KERNEL_VERSION) && rm -f build + @rm $(ROOTFS_DIR)/lib/modules/$(KERNEL_VERSION)/build @echo "- Creating symlinks" @ln -sf /tmp/var $(ROOTFS_DIR)/var @ln -sf /proc/mounts $(ROOTFS_DIR)/etc/mtab @echo "- Updating library links and cache" @ldconfig -r $(ROOTFS_DIR) @echo "- Copying iso/ files..." - @cp iso/etc/{motd,fstab,hosts,inittab,issue,ld.so.conf,protocols,rc,rc.shutdown,rc.single,services,shadow} \ - $(ROOTFS_DIR)/etc - @cp iso/bin/{setup,setup-helper,setup-chroot,serial_console} $(ROOTFS_DIR)/usr/bin + @for F in motd fstab hosts inittab issue ld.so.conf protocols rc rc.shutdown rc.single services shadow; do \ + cp iso/etc/$$F $(ROOTFS_DIR)/etc; \ + done + @for F in setup setup-helper setup-chroot serial_console; do \ + cp iso/bin/$$F $(ROOTFS_DIR)/usr/bin; \ + done @echo "- Compressing (rootfs.tar.xz)..." @mkdir -p rootfs @(cd $(ROOTFS_DIR) && tar -Jcf ../../rootfs/rootfs.tar.xz . 2>/dev/null) @@ -374,7 +377,7 @@ image-base: check-root kernel syslinux initramfs rootfs setup.dependencies iso/e @cp initramfs/initramfs $(IMG_ROOT_DIR)/boot/initramfs @echo "- Copying CRUX packages" @mkdir -p $(IMG_ROOT_DIR)/crux - @cp doc/handbook/{handbook,releasenotes}.txt $(IMG_ROOT_DIR)/crux + @cp doc/handbook/handbook.txt doc/handbook/releasenotes.txt $(IMG_ROOT_DIR)/crux @cp iso/setup.dependencies $(IMG_ROOT_DIR)/crux @mkdir -p $(IMG_ROOT_DIR)/crux/kernel @cp kernel/linux-$(KERNEL_VERSION).tar.xz $(IMG_ROOT_DIR)/crux/kernel @@ -402,13 +405,13 @@ iso: image-base memtest @echo "Copying ISO specific files" @mkdir -p $(IMG_ROOT_DIR)/boot/isolinux @cp iso/syslinux-$(SYSLINUX_VERSION)/core/isolinux.bin $(IMG_ROOT_DIR)/boot/isolinux - @cp iso/isolinux/{isolinux.cfg,*.msg} \ + @cp iso/isolinux/isolinux.cfg iso/isolinux/*.msg \ $(IMG_ROOT_DIR)/boot/isolinux @cp iso/isolinux/memtest86+-$(MEMTEST_VERSION).bin $(IMG_ROOT_DIR)/boot/isolinux/memtest86plus @cp iso/efiboot.img $(IMG_ROOT_DIR)/boot/ - @mkdir -p $(IMG_ROOT_DIR)/boot/grub/{x86_64,i386}-efi - @cp -a /usr/lib/grub/x86_64-efi/*.{mod,lst} $(IMG_ROOT_DIR)/boot/grub/x86_64-efi/ - @cp -a /usr/lib/grub/i386-efi/*.{mod,lst} $(IMG_ROOT_DIR)/boot/grub/i386-efi/ + @mkdir -p $(IMG_ROOT_DIR)/boot/grub/x86_64-efi $(IMG_ROOT_DIR)/boot/grub/i386-efi + @cp -a /usr/lib/grub/x86_64-efi/*.mod /usr/lib/grub/x86_64-efi/*.lst $(IMG_ROOT_DIR)/boot/grub/x86_64-efi/ + @cp -a /usr/lib/grub/i386-efi/*.mod /usr/lib/grub/i386-efi/*.lst $(IMG_ROOT_DIR)/boot/grub/i386-efi/ @cp iso/grub.cfg $(IMG_ROOT_DIR)/boot/grub/ @echo "- Creating ISO sort table" @echo "$(IMG_ROOT_DIR)/boot 100" > /tmp/iso.sort @@ -430,11 +433,13 @@ iso: image-base memtest source-iso: busybox-source packages.all iso/syslinux-$(SYSLINUX_VERSION).tar.gz kernel/linux-$(KERNEL_VERSION).tar.xz @echo "Creating ISO image with sources ($(SRCISO_FILENAME))" @rm -rf $(SRCISO_ROOT_DIR) - @mkdir -p $(SRCISO_ROOT_DIR)/{ports,kernel,misc} + @mkdir -p $(SRCISO_ROOT_DIR)/ports $(SRCISO_ROOT_DIR)/kernel $(SRCISO_ROOT_DIR)/misc @echo "- Copying ports" @for PORT in $(shell /bin/cat packages.all); do \ find $(PORTS_DIR) -mindepth 2 -maxdepth 2 -name $$PORT -type d -exec cp -r {} $(SRCISO_ROOT_DIR)/ports \; ; \ - rm -f $(SRCISO_ROOT_DIR)/ports/$$PORT/{.footprint,.md5sum,*.$(PKG_EXT)}; \ + rm -f $(SRCISO_ROOT_DIR)/ports/$$PORT/.footprint \ + $(SRCISO_ROOT_DIR)/ports/$$PORT/.md5sum \ + $(SRCISO_ROOT_DIR)/ports/$$PORT/*.$(PKG_EXT); \ done @echo "- Copying misc sources" @cp busybox/busybox-$(BB_VERSION).tar.bz2 $(SRCISO_ROOT_DIR)/misc |