X-Git-Url: http://git.plutz.net/?a=blobdiff_plain;f=Makefile;h=dc7dd52806e1aeccf2fbaef3484fd6e6d6591691;hb=218e2ce73d4d5a9a0b9ef554be77c93a3b66895d;hp=c3309a2912ebc71823a073a498b1a8ba26d78c7d;hpb=23d0b46966959d04e3d99010b22a24e36b73d6a7;p=blast diff --git a/Makefile b/Makefile index c3309a2..dc7dd52 100644 --- a/Makefile +++ b/Makefile @@ -7,8 +7,8 @@ space_:= ${nul_} ${nul_} .PHONY: clean .FORCE _target .PHONY: _bootloader_raspi _bootloader_pc _partition_gpt _partition_raspi .PHONY: _squash_modules -.PHONY: _qemu _bootstrap _install _copy _config _bootloader _squash -.PHONY: _partition _format _mount _sparse _umount _partcopy _mbr +.PHONY: _qemu _bootstrap _install _copy _config _squash +.PHONY: _format _mount _sparse _umount _partcopy _mbr ARCH := amd64 KEYRING := keys/debian-archive-stretch-stable.gpg @@ -33,6 +33,8 @@ ifndef release endif define SOURCES := +deb http://cdn.debian.net/debian stretch main +deb http://cdn.debian.net/debian buster main deb http://cdn.debian.net/debian ${release} main endef @@ -43,17 +45,17 @@ ifdef disk SYSROOT := hdd_mount/ CFGROOT := hdd_mount/ - _target: _mbr _umount _config _install _partition + _target: _mbr _umount _config _install _partition_gpt - _partition: _partition_gpt - _format: _partition + _partition_gpt: + _format: _partition_gpt _mount: _format _bootstrap: _mount _install: _bootstrap _mount _config: _install _mount - _bootloader: _mount _bootloader_pc - _umount: _mount _config _bootloader - _mbr: _umount _bootloader + _bootloader_pc: _mount + _umount: _mount _config _bootloader_pc + _mbr: _umount _bootloader_pc else ifdef image VOLUME := ${image} @@ -62,20 +64,20 @@ else ifdef image SYSROOT := sys_root_${release}/ CFGROOT := img_mount/ - _target: _mbr _umount _partcopy _config _install + _target: _mbr _umount _config _install _bootstrap: _install: _bootstrap _sparse: _format: _sparse - _mount: _format - _copy: _install _mount - _config: _copy _mount - _bootloader: _mount _bootloader_pc - _umount: _mount _config _bootloader - _partition: _partition_gpt - _partcopy: _partition _umount - _mbr: _partcopy _bootloader + _partition_gpt: _sparse + _partcopy: _partition_gpt _format + _img_mount: _partcopy + _copy: _install _img_mount + _config: _copy _img_mount + _bootloader_pc: _img_mount + _umount: _img_mount _config _bootloader_pc + _mbr: _partcopy _bootloader_pc else ifdef squash SQUASH := ${squash} @@ -110,20 +112,20 @@ else ifdef raspi PACKAGES += firmware-brcm80211 libraspberrypi-bin libraspberrypi0 pi-bluetooth raspberrypi-bootloader raspberrypi-kernel - _target: _umount _partcopy _config _install + _target: _umount _config _qemu: _bootstrap: _qemu _install: _bootstrap _sparse: _format: _sparse - _mount: _format - _copy: _install _mount - _config: _copy _mount - _bootloader: _mount _bootloader_raspi - _umount: _mount _config _bootloader - _partition: _partition_raspi - _partcopy: _partition _umount + _partition_raspi: _sparse + _partcopy: _partition_raspi _format + _img_mount: _partcopy + _copy: _install _img_mount + _config: _copy _img_mount + _bootloader_raspi: _img_mount + _umount: _img_mount _config _bootloader_raspi else _target: @@ -192,7 +194,7 @@ ${SYSROOT}/etc/apt/trusted.gpg.d/: ${SYSROOT} cp keys/*.gpg "$@" _install: ${SYSROOT} _aptkeys _norecommends - printf '%s\n' "$${SOURCES}" >"$${SYSROOT}/etc/apt/sources.list" + printf '%s\n' "$${SOURCES}" |sort -u >"$${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 @@ -325,6 +327,14 @@ _mount: ${PBOOT} ${PROOT} ${CFG_ROOT} mkdir -p -m 755 "$${CFGROOT}/boot" mount -t vfat "$${PBOOT}" "$${CFGROOT}/boot" +_img_mount: + mount -o loop,offset="$$((${BOOT_MB} + 2))"M,sizelimit=${ROOT_MB}M \ + -t ext4 "$${VOLUME}" "$${CFGROOT}" + chmod 755 "$${CFGROOT}" + mkdir -p -m 755 "$${CFGROOT}/boot" + mount -o loop,offset=2M,sizelimit=${BOOT_MB}M \ + -t vfat "$${VOLUME}" "$${CFGROOT}/boot" + _umount: ${CFGROOT} -umount "$${CFGROOT}/boot" umount "$${CFGROOT}" && rmdir "$${CFGROOT}"