]> git.plutz.net Git - bootimage/blobdiff - Makefile
include syslinux-common in base installaton
[bootimage] / Makefile
index 9b3579004d63ddc815a0325a3888ac0568a0a7b4..c4ccfc7089161f80fca3516159917172ad1fafa9 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -7,9 +7,9 @@ GROUPS := sudo
 ARCH := amd64
 CONFIG := config_base/
 
-PACKAGES := apt bilibop-lockfs btrfs-tools busybox-static bzip2 ca-certificates cron deborphan extlinux gzip htop ifupdown init iputils-ping irqbalance isc-dhcp-client less live-boot live-boot-initramfs-tools make man-db nbd-client net-tools nmap ntpdate openssh-client openssh-server p7zip-full pciutils rsync squashfs-tools sshfs sudo systemd unace unrar-free unzip vim wget wireless-tools wpasupplicant xz-utils zip
+PACKAGES := apt bilibop-lockfs btrfs-tools busybox-static bzip2 ca-certificates cron deborphan extlinux gzip htop ifupdown init iputils-ping irqbalance isc-dhcp-client less live-boot live-boot-initramfs-tools make man-db nbd-client net-tools nmap ntpdate openssh-client openssh-server p7zip-full pciutils rsync squashfs-tools sshfs sudo syslinux-common systemd unace unrar-free unzip vim wget wireless-tools wpasupplicant xz-utils zip
 
-Include *.mk
+include *.mk
 
 stretch_%_root/bin/sh:
        btrfs subvolume create "$(subst bin/sh,,$@)" || mkdir "$(subst bin/sh,,$@)"
@@ -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
+       mkswap -L SWAP ${@}
+       sync
+
+/dev/sd%3: /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