]> git.plutz.net Git - bootimage/blobdiff - Makefile
Copy Makefile so it can be used for HDD installation
[bootimage] / Makefile
index 5ea6b7c89d90bd0d1daa07a965be32c22b423613..b4d9440b7dc0c180d8ef86e6c2b511286d95fcc8 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -46,18 +46,29 @@ stretch_%.squashfs: stretch_%_config/
        rm "$@" || true
        mksquashfs "$<" "$@" -comp xz
 
-/dev/sd%: partitions vmlinuz initrd.img syslinux.cfg .FORCE
-       mkdir mount
+/dev/sd%: partitions .FORCE
        sfdisk ${@} <partitions
-       mkfs.ext3 -L SQUASHBOOT ${@}1
-       mkfs.btrfs -L SQUASHCLIENT ${@}2
        dd of=${@} if=/usr/lib/syslinux/mbr/mbr.bin
-       mount -t ext3 ${@}1 mount
-       cp -L vmlinuz initrd.img *.squashfs syslinux.cfg mount/
+
+/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/
-       mount -t btrfs ${@}2 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