]> git.plutz.net Git - bootimage/blobdiff - Makefile
scripts for volume setup
[bootimage] / Makefile
index 2c6c749ee6459a7ddaaff3ee891bb8cbf0f607d2..5ea6b7c89d90bd0d1daa07a965be32c22b423613 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -45,3 +45,19 @@ stretch_%_config/: stretch_%_root/ ${CONFIG} permissions .FORCE
 stretch_%.squashfs: stretch_%_config/
        rm "$@" || true
        mksquashfs "$<" "$@" -comp xz
+
+/dev/sd%: partitions vmlinuz initrd.img syslinux.cfg .FORCE
+       mkdir mount
+       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/
+       cp $(addprefix /usr/lib/syslinux/modules/bios/, menu.c32 libutil.c32) mount/
+       extlinux -i mount/
+       umount mount/
+       mount -t btrfs ${@}2 mount
+       btrfs subvolume create mount/home
+       chmod 0755 mount/home
+       umount mount/