X-Git-Url: http://git.plutz.net/?a=blobdiff_plain;f=Makefile;h=03fd52b38bfc8c23846ed89a43f94464b3c92667;hb=4a83f36e36d09bfca93a9f3b2cb55e08d5d13169;hp=da5d3e44ef0330c777212c3641f3ca6a1f590180;hpb=d32c1d496394986056e98c0786828a0307626964;p=blast diff --git a/Makefile b/Makefile index da5d3e4..03fd52b 100644 --- a/Makefile +++ b/Makefile @@ -1,10 +1,11 @@ DEFAULT: _target nul_:= -comma_:=, -space_:=${nul_} ${nul_} +comma_:= , +space_:= ${nul_} ${nul_} .PHONY: clean .FORCE +.PHONY: _config_raspi _partition_raspi .PHONY: _qemu _bootstrap _install _copy _config_raspi _config _bootloader _squash .PHONY: _target _partition _format _mount _sparse _umount _partcopy _mbr @@ -20,7 +21,7 @@ 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 config.mk: cp "config.example" "$@" @@ -96,6 +97,7 @@ 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 @@ -110,8 +112,8 @@ _copy: _install _mount _config_raspi: _copy _mount _config: _copy _mount _config_raspi _umount: _mount _config -_partition: -_partcopy: _partition _umount +_partition_raspi: +_partcopy: _partition_raspi _umount else _target: @@ -121,7 +123,7 @@ 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" @@ -177,7 +179,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 @@ -197,7 +199,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" @@ -212,6 +214,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 @@ -223,6 +226,10 @@ ${PROOT}: .FORCE dd count=0 of="$${PROOT}" # truncate dd bs=1M count=0 seek=${ROOT_MB} of="$${PROOT}" +_partition_raspi: ${VOLUME} + printf 'label: dos\n\n: start=2MiB, size=%iMiB, type=c\n: start=%iMiB, size=%iMiB, type=83\n' \ + ${BOOT_MB} "$$((${BOOT_MB} + 2))" ${ROOT_MB} | sfdisk "$${VOLUME}" + _partition: ${VOLUME} printf 'label: gpt\n\n: start=2MiB, size=%iMiB, type=1, attrs="LegacyBIOSBootable"\n: size=%iMiB, type=20\n' \ ${BOOT_MB} ${ROOT_MB} | sfdisk "$${VOLUME}"