X-Git-Url: https://git.plutz.net/?a=blobdiff_plain;f=Makefile;h=cd430aad1648283c4c31e8d2ceb5d3370bef7443;hb=885091ac4326fa344c3831532daf01a0c6a4eeb8;hp=31f844eef8ada7307a9c9b3c1d38ede53efd3fe5;hpb=3365b381c0c1a811ac00a4337f063dbb65134fb0;p=blast diff --git a/Makefile b/Makefile index 31f844e..cd430aa 100644 --- a/Makefile +++ b/Makefile @@ -21,6 +21,8 @@ PACKAGES := ${PACKAGES} apt busybox-static debian-archive-keyring init systemd BOOT_MB := 62 ROOT_MB := 959 +fstype := ext4 + config.mk: cp "config.example" "$@" @@ -43,8 +45,6 @@ deb http://cdn.debian.net/debian ${release} main endef endif -fstype := ext4 - ifdef disk VOLUME := ${disk} PBOOT := ${disk}1 @@ -98,7 +98,7 @@ else ifdef subvol _config: _copy ${subvol}: _config - btrfs sub snap "${CFG_ROOT}" "$@" + btrfs sub snap "${CFGROOT}" "$@" else ifdef squash SQUASH := ${squash} @@ -152,8 +152,7 @@ else ifdef raspi deb http://archive.raspberrypi.org/debian ${release} main endef - PACKAGES += firmware-brcm80211 libraspberrypi-bin libraspberrypi0 pi-bluetooth raspberrypi-bootloader raspberrypi-kernel initramfs-tools nilfs-tools - fstype := nilfs2 + PACKAGES += firmware-brcm80211 libraspberrypi-bin libraspberrypi0 pi-bluetooth raspberrypi-bootloader raspberrypi-kernel initramfs-tools _target: _umount _config @@ -168,7 +167,7 @@ else ifdef raspi _copy: _install _img_mount _config: _copy _img_mount _bootloader_raspi: _img_mount - _umount: _img_mount _config _bootloader_raspi + _umount: _copy _config _bootloader_raspi else _target: @@ -237,6 +236,7 @@ ${SYSROOT}/etc/apt/apt.conf.d/10norecommends: ${SYSROOT} ${SYSROOT}/etc/apt/trusted.gpg.d/: ${SYSROOT} _bootstrap mkdir -p -m 755 "$@" cp keys/*.gpg "$@" + chmod 644 "$@"/*.gpg _install: ${SYSROOT} _aptkeys _norecommends printf '%s\n' "$${SOURCES}" |sort -u >"$${SYSROOT}/etc/apt/sources.list" @@ -256,6 +256,7 @@ _install: ${SYSROOT} _aptkeys _norecommends chroot "$${SYSROOT}" rm /usr/sbin/udevadm _copy: ${SYSROOT} ${CFGROOT} + sync cp -au "$${SYSROOT}/." "$${CFGROOT}/" _config: ${CFGROOT} @@ -306,15 +307,15 @@ _partition_gpt: ${VOLUME} _sparse: ${PBOOT} ${PROOT} -ifdef raspi -_format_root: ${PROOT} - -umount "$${CFGROOT}/boot" "$${CFGROOT}" "${PROOT}" - mkfs.nilfs2 -f -L FSROOT "$${PROOT}" +ifeq "${fstype}" "ext4" + fsflag:=-F else + fsflag:=-f +endif + _format_root: ${PROOT} -umount "$${CFGROOT}/boot" "$${CFGROOT}" "${PROOT}" - mkfs.ext4 -F -L FSROOT "$${PROOT}" -endif + mkfs.${fstype} ${fsflag} -L FSROOT "$${PROOT}" _format_boot: ${PBOOT} -umount "$${CFGROOT}/boot" "${PBOOT}" @@ -379,10 +380,12 @@ _bootloader_pc: ${CFGROOT} _grub_efi32 _grub_efi64 _syslinux_bios #_syslinux_efi _bootloader_iso: ${CFGROOT} ${ISOROOT} mkdir -p "$${ISOROOT}/boot/grub/" cp -L "$${CFGROOT}/vmlinuz" "$${CFGROOT}/initrd.img" "$${ISOROOT}" + printf '%s\n' "insmod all_video" "set gfxmode=auto" "load_video" "insmod gfxterm" \ + >"$${ISOROOT}/boot/grub/grub.cfg" printf '%s\n' "set timeout=10" "default=buster" \ "menuentry 'Debian Buster' --id 'buster' {" \ "linux '/vmlinuz' boot=live" "initrd '/initrd.img'" "}" \ - >"$${ISOROOT}/boot/grub/grub.cfg" + >>"$${ISOROOT}/boot/grub/grub.cfg" -[ -f "$${ISOROOT}/install/initrd.gz" -a -f "$${ISOROOT}/install/linux" ] && \ printf '%s\n' "menuentry 'Install Debian' --id 'install' {" \ "linux '/install/linux'" "initrd '/install/initrd.gz'" "}" \ @@ -394,6 +397,7 @@ _efi_mount: ${PBOOT} mount -t vfat -o loop "$${PBOOT}" "efi/" _efi_umount: _efi_mount + sync umount efi/ && rmdir efi/ .PHONY: _syslinux_mbr _grub_mbr @@ -437,10 +441,12 @@ _img_mount: ${CFGROOT} || mount -o loop,offset=2M,sizelimit=${BOOT_MB}M \ -t vfat "$${VOLUME}" "$${CFGROOT}/boot" -_umount_boot: ${CFGROOT} +_umount_boot: ${CFGROOT} _config + sync -umount "$${CFGROOT}/boot" -_umount_root: _umount_boot +_umount_root: _umount_boot _config + sync umount "$${CFGROOT}" && rmdir "$${CFGROOT}" _umount: _umount_boot _umount_root