diff options
author | Natanael Copa <ncopa@alpinelinux.org> | 2009-05-25 14:33:49 +0000 |
---|---|---|
committer | Natanael Copa <ncopa@alpinelinux.org> | 2009-05-25 14:33:49 +0000 |
commit | 989003baa23fd8921d77112562237301355641b7 (patch) | |
tree | aa770d908c8bb354850296e569546c407419019a /alpine.mk | |
parent | 2219b258cfe9e0ff7165dccfa98c697ab9cb628b (diff) | |
download | abuild-989003baa23fd8921d77112562237301355641b7.tar.gz abuild-989003baa23fd8921d77112562237301355641b7.tar.bz2 abuild-989003baa23fd8921d77112562237301355641b7.tar.xz abuild-989003baa23fd8921d77112562237301355641b7.zip |
alpine.mk: maketarget for usb images
Diffstat (limited to 'alpine.mk')
-rwxr-xr-x | alpine.mk | 30 |
1 files changed, 27 insertions, 3 deletions
@@ -235,10 +235,34 @@ iso: $(ISO) # # SHA1 sum of ISO # -SHA1 := $(ISO).sha1 +ISO_SHA1 := $(ISO).sha1 -$(SHA1): $(ISO) +$(ISO_SHA1): $(ISO) @echo "==> Generating sha1 sum" @sha1sum $(ISO) > $@ || rm -f $@ -sha1: $(SHA1) +# +# USB image +# +USBIMG := $(ALPINE_NAME)-$(ALPINE_RELEASE)-$(ALPINE_ARCH).img +USBIMG_SIZE := 510 +MBRPATH := /usr/share/syslinux/mbr.bin +# the offset where the frist partition is found +USBIMG_OFFSET := 16384 + +$(USBIMG): $(ISOFS_DIRSTAMP) + #Creating imagefile + dd if=/dev/zero of=$(USBIMG) bs=1000000 count=$(USBIMG_SIZE) + parted -s $(USBIMG) mklabel msdos + parted -s $(USBIMG) mkpartfs primary fat32 0 $(USBIMG_SIZE) + parted -s $(USBIMG) set 1 boot on + dd if=$(MBRPATH) of=$(USBIMG) oflags=notrunc + syslinux -o $(USBIMG_OFFSET) $(USBIMG) + mcopy -i $(USBIMG)@@$(USBIMG_OFFSET) $(ISO_DIR)/* $(ISO_DIR)/.[a-z]* :: + +USBIMG_SHA1 := $(USBIMG).sha1 +$(USBIMG_SHA1): $(USBIMG) + @echo "==> Generating sha1 sum" + @sha1sum $(USBIMG) > $@ || rm -f $@ + +sha1 release: $(ISO_SHA1) $(USBIMG_SHA1) |