]> git.plutz.net Git - bootimage/blobdiff - Makefile
Copy Makefile so it can be used for HDD installation
[bootimage] / Makefile
index 2c6c749ee6459a7ddaaff3ee891bb8cbf0f607d2..b4d9440b7dc0c180d8ef86e6c2b511286d95fcc8 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -45,3 +45,30 @@ stretch_%_config/: stretch_%_root/ ${CONFIG} permissions .FORCE
 stretch_%.squashfs: stretch_%_config/
        rm "$@" || true
        mksquashfs "$<" "$@" -comp xz
+
+/dev/sd%: partitions .FORCE
+       sfdisk ${@} <partitions
+       dd of=${@} if=/usr/lib/syslinux/mbr/mbr.bin
+
+/dev/sd%1: /dev/sd% vmlinuz initrd.img syslinux.cfg .FORCE
+       mkdir -p mount
+       mkfs.ext3 -FL SQUASHBOOT ${@}
+       mount -t ext3 ${@} mount
+       cp -L vmlinuz initrd.img *.squashfs syslinux.cfg Makefile partitions mount/
+       cp $(addprefix /usr/lib/syslinux/modules/bios/, menu.c32 libutil.c32) mount/
+       extlinux -i mount/
+       umount mount/
+       sync
+
+/dev/sd%2: /dev/sd% .FORCE
+       mkdir -p mount
+       mkfs.btrfs -fL SQUASHCLIENT ${@}
+       mount -t btrfs ${@} mount
+       btrfs subvolume create mount/home
+       chmod 0755 mount/home
+       umount mount/
+       sync
+
+/dev/sd%3: /dev/sd% .FORCE
+       mkswap -L SWAP ${@}
+       sync