]> git.plutz.net Git - blast/blobdiff - Makefile
makefile indentation for readability, working shutdown in xfce, hostname setting
[blast] / Makefile
index 8caf61890cdf54ef119be15c5c92acc3196a9556..41a99930c9c58529cf6c3b4c1cff9c41db77a55c 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -1,8 +1,8 @@
 DEFAULT: _target
 
 nul_:=
-comma_:=,
-space_:=${nul_} ${nul_}
+comma_:= ,
+space_:= ${nul_} ${nul_}
 
 .PHONY: clean .FORCE
 .PHONY: _config_raspi _partition_raspi
@@ -21,114 +21,114 @@ define SOURCES =
 deb    http://cdn.debian.net/debian stretch main
 endef
 
-PACKAGES := ${PACKAGES} apt btrfs-tools busybox-static bzip2 ca-certificates cron debian-archive-keyring deborphan firmware-linux-free gzip htop ifupdown init iputils-ping irqbalance isc-dhcp-client less make net-tools nmap ntpdate openssh-client psmisc rsync sshfs sudo systemd traceroute unzip vim wget wireless-tools wpasupplicant xz-utils zip
+PACKAGES := ${PACKAGES} apt busybox-static debian-archive-keyring init systemd
 
+include config.mk
 config.mk:
        cp "config.example" "$@"
 
-include config.mk
-
 ifdef disk
-VOLUME := ${disk}
-PBOOT := ${disk}1
-PROOT := ${disk}2
-SYSROOT := hdd_mount/
-CFGROOT := hdd_mount/
-
-_target: _mbr _umount _config _install _partition
-
-_partition:
-_format: _partition
-_mount: _format
-_bootstrap: _mount
-_install: _bootstrap _mount
-_config: _install _mount
-_bootloader: _mount
-_umount: _mount _config _bootloader
-_mbr: _umount _bootloader
+  VOLUME := ${disk}
+  PBOOT := ${disk}1
+  PROOT := ${disk}2
+  SYSROOT := hdd_mount/
+  CFGROOT := hdd_mount/
+  
+  _target: _mbr _umount _config _install _partition
+  
+  _partition:
+  _format: _partition
+  _mount: _format
+  _bootstrap: _mount
+  _install: _bootstrap _mount
+  _config: _install _mount
+  _bootloader: _mount
+  _umount: _mount _config _bootloader
+  _mbr: _umount _bootloader
 
 else ifdef image
-VOLUME := ${image}
-PBOOT := part_boot.img
-PROOT := part_root.img
-SYSROOT := sys_root/
-CFGROOT := img_mount/
-
-_target: _mbr _umount _partcopy _config _install
-
-_bootstrap:
-_install: _bootstrap
-_sparse:
-_format: _sparse
-_mount: _format
-_copy: _install _mount
-_config: _copy _mount
-_bootloader: _mount
-_umount: _mount _config _bootloader
-_partition:
-_partcopy: _partition _umount
-_mbr: _partcopy _bootloader
+  VOLUME := ${image}
+  PBOOT := part_boot.img
+  PROOT := part_root.img
+  SYSROOT := sys_root/
+  CFGROOT := img_mount/
+  
+  _target: _mbr _umount _partcopy _config _install
+  
+  _bootstrap:
+  _install: _bootstrap
+  _sparse:
+  _format: _sparse
+  _mount: _format
+  _copy: _install _mount
+  _config: _copy _mount
+  _bootloader: _mount
+  _umount: _mount _config _bootloader
+  _partition:
+  _partcopy: _partition _umount
+  _mbr: _partcopy _bootloader
 
 else ifdef squash
-SQUASH := ${squash}
-SYSROOT := sys_root/
-CFGROOT := cfg_root/
-
-_target: _squash _install _config
-
-_bootstrap:
-_install: _bootstrap
-_copy: _install
-_config: _copy
-_squash: _config
+  SQUASH := ${squash}
+  SYSROOT := sys_root/
+  CFGROOT := cfg_root/
+  
+  _target: _squash _install _config
+  
+  _bootstrap:
+  _install: _bootstrap
+  _copy: _install
+  _config: _copy
+  _squash: _config
 
 else ifdef raspi
-VOLUME := ${raspi}
-PBOOT := rpi_boot.img
-PROOT := rpi_root.img
-SYSROOT := rpi_root/
-CFGROOT := img_mount/
-
-ARCH := armhf
-KEYRING := keys/raspbian-archive-keyring.gpg
-BOOTSTRAP := http://raspbian.raspberrypi.org/raspbian
-
-define SOURCES =
-deb    http://raspbian.raspberrypi.org/raspbian stretch main non-free firmware rpi
-deb    http://archive.raspberrypi.org/debian stretch main
-endef
+  VOLUME := ${raspi}
+  PBOOT := rpi_boot.img
+  PROOT := rpi_root.img
+  SYSROOT := rpi_root/
+  CFGROOT := img_mount/
+  
+  ARCH := armhf
+  KEYRING := keys/raspbian-archive-keyring.gpg
+  BOOTSTRAP := http://raspbian.raspberrypi.org/raspbian
+
+  define SOURCES =
+  deb  http://raspbian.raspberrypi.org/raspbian stretch main non-free firmware rpi
+  deb  http://archive.raspberrypi.org/debian stretch main
+  endef
+
 PACKAGES := ${PACKAGES} firmware-brcm80211 libraspberrypi-bin libraspberrypi0 pi-bluetooth raspberrypi-bootloader raspberrypi-kernel
 
-_target: _umount _partcopy _config _install
-
-_qemu:
-_bootstrap: _qemu
-_install: _bootstrap
-_sparse:
-_format: _sparse
-_mount: _format
-_copy: _install _mount
-_config_raspi: _copy _mount
-_config: _copy _mount _config_raspi
-_umount: _mount _config
-_partition_raspi:
-_partcopy: _partition_raspi _umount
+  _target: _umount _partcopy _config _install
+  
+  _qemu:
+  _bootstrap: _qemu
+  _install: _bootstrap
+  _sparse:
+  _format: _sparse
+  _mount: _format
+  _copy: _install _mount
+  _config_raspi: _copy _mount
+  _config: _copy _mount _config_raspi
+  _umount: _mount _config
+  _partition_raspi:
+  _partcopy: _partition_raspi _umount
 
 else
-_target:
+  _target:
        false
 
 endif
 
 include modules/default.mk
 ifdef modules
-include $(addsuffix .mk, $(addprefix modules/, $(subst ${comma_},${space},${modules})))
+  include $(addsuffix .mk, $(addprefix modules/, $(subst ${comma_},${space_},${modules})))
 endif
 
 ifeq "${ARCH}" "amd64"
-PACKAGES := ${PACKAGES} linux-image-amd64
+  PACKAGES += linux-image-amd64
 else ifeq "${ARCH}" "i386"
-PACKAGES := ${PACKAGES} linux-image-686
+  PACKAGES += linux-image-686
 endif
 
 export SOURCES SYSROOT CFGROOT VOLUME PBOOT PROOT SQUASH ARCH KEYRING BOOTSTRAP
@@ -178,7 +178,7 @@ ${SYSROOT}/etc/apt/trusted.gpg.d/: ${SYSROOT}
        cp keys/*.gpg "$@"
 
 _install: ${SYSROOT} _aptkeys _norecommends
-       printf %s "$${SOURCES}" >"$${SYSROOT}/etc/apt/sources.list"
+       printf '%s\n' "$${SOURCES}" >"$${SYSROOT}/etc/apt/sources.list"
        -cp /etc/resolv.conf "$${SYSROOT}/etc/"
        -chroot "$${SYSROOT}" sh -c 'apt-mark showmanual |xargs apt-mark auto'
        -chroot "$${SYSROOT}" apt-get update
@@ -198,7 +198,7 @@ ${CFGROOT}/boot/cmdline.txt: ${CFGROOT}
 
 .PHONY: _common_config
 _config: _common_config
-_common_config: ${CFGROOT} cfg_seed/
+_common_config: ${CFGROOT}
        ln -sf /dev/null "$${CFGROOT}/etc/systemd/network/99-default.link"
        printf 'LABEL=FSROOT / ext4 auto,nofail,rw 0 0\nLABEL=BOOT /boot vfat auto,nofail,ro 0 0\n' \
                >"$${CFGROOT}/etc/fstab"
@@ -213,6 +213,7 @@ ${VOLUME}: .FORCE
        ! printf '%s\n' "$${VOLUME}" |grep -q '^/dev/'  # abort if volume should be real device
        dd count=0 of="$${VOLUME}"  # truncate
        dd bs=1M count=0 seek=$$((3 + ${BOOT_MB} + ${ROOT_MB})) of="$${VOLUME}"
+       chmod g+w "$${VOLUME}"
 
 ${PBOOT}: .FORCE
        ! printf '%s\n' "$${PBOOT}" |grep -q '^/dev/'  # abort if volume should be real device