[5745] | 1 | # $Id: Makefile 6048 2018-07-08 22:34:18Z skylar $ |
---|
| 2 | |
---|
[5894] | 3 | SHELL = /bin/bash |
---|
[5830] | 4 | export MKDIR_P := mkdir -p |
---|
| 5 | export SVNROOT := https://cluster.earlham.edu/svn/bccd-ng/branches/skylar/bccd-3.4.0-build_ng |
---|
| 6 | export SVN_REV = $(shell svn info $(SVNROOT)|awk '$$1 ~ /^Revision:/ {print $$2}') |
---|
| 7 | export SVN_CO := svn cat -r |
---|
| 8 | export VERSION := 3.4.0 |
---|
[6028] | 9 | # KERN_REV needs to be set to a version supported by aufs (see /usr/src/aufs-xxx/dkms.conf) |
---|
[6040] | 10 | export KERN_REV := 4.16.0-2-amd64 |
---|
[5745] | 11 | |
---|
[5898] | 12 | .PHONY: install-iso |
---|
[5888] | 13 | |
---|
[5900] | 14 | # Archive this in Jenkins so that downstream projects have the correct ordering b/w target/bccd.noarch.deb and build/etc/bccd-revision |
---|
[5901] | 15 | build/etc/bccd-revision: |
---|
[5881] | 16 | /bin/mkdir -p "$(WORKSPACE)"/build/etc |
---|
| 17 | @echo "$(VERSION).$(SVN_REVISION)" > "$(WORKSPACE)"/build/etc/bccd-revision |
---|
[6001] | 18 | # Set modification time of bccd-revision to bccd.noarch.deb if it is available, to avoid |
---|
| 19 | # unnecessary rebuild of bccd.noarch.deb if it is copied in from another build |
---|
[6044] | 20 | find "$(WORKSPACE)"/target -type f -name bccd.noarch.deb -exec touch -r "{}" "$@" \; |
---|
[5881] | 21 | |
---|
[5900] | 22 | target/bccd.noarch.deb: build/etc/bccd-revision |
---|
[5922] | 23 | cp $< "$(WORKSPACE)/src/etc" |
---|
[5990] | 24 | # Dependency on gnupg2 is required by apt-key |
---|
[5757] | 25 | fpm \ |
---|
[5756] | 26 | -n bccd \ |
---|
| 27 | -C "$(WORKSPACE)"/src \ |
---|
| 28 | -s dir \ |
---|
| 29 | -t deb \ |
---|
[5990] | 30 | -d gnupg2 \ |
---|
[5756] | 31 | -p "$(WORKSPACE)"/target/bccd.noarch.deb \ |
---|
| 32 | -v "$(VERSION)" \ |
---|
| 33 | --iteration "$(SVN_REVISION)" \ |
---|
[5764] | 34 | -x '*/.svn*' \ |
---|
[5782] | 35 | --before-install "$(WORKSPACE)/bin/deb/bccd_deb_before_install" \ |
---|
| 36 | --after-remove "$(WORKSPACE)/bin/deb/bccd_deb_after_remove" \ |
---|
| 37 | --after-install "$(WORKSPACE)/bin/deb/bccd_deb_after_install" |
---|
[5803] | 38 | |
---|
[5888] | 39 | debootstrap: |
---|
[5896] | 40 | # Script will either create a new debootstrap (if executing a debootstrap project) or extract the imported |
---|
[5904] | 41 | # debootstrap.tar.bz2 artifact |
---|
[5896] | 42 | "$(WORKSPACE)"/bin/prepare_debootstrap |
---|
[5888] | 43 | |
---|
[5904] | 44 | target/debootstrap-bccd.tar.bz2: target/bccd.noarch.deb debootstrap |
---|
[5888] | 45 | /bin/cp -v "$<" "$(WORKSPACE)/debootstrap/tmp" |
---|
[5835] | 46 | "$(WORKSPACE)/bin/bccd_install_pkgs" |
---|
[5904] | 47 | # Using pbzip2 takes a couple minutes but saves 50% / 2+GB of space |
---|
[6022] | 48 | /bin/tar -C "$(WORKSPACE)" --exclude='debootstrap/proc/*' -cf - debootstrap | nice /usr/bin/pbzip2 -c > "$(@)" |
---|
[5803] | 49 | |
---|
[5904] | 50 | target/debootstrap.tar.bz2: debootstrap |
---|
[6022] | 51 | /bin/tar -C "$(WORKSPACE)" --exclude='debootstrap/proc/*' -cf - "$<" | nice /usr/bin/pbzip2 -c > "$(@)" |
---|
[5887] | 52 | |
---|
[5817] | 53 | iso/live/initrd.img: debootstrap |
---|
| 54 | /usr/bin/sudo /usr/sbin/chroot "$(WORKSPACE)/debootstrap" mkinitramfs \ |
---|
[5898] | 55 | -o "/boot/initrd-$(KERN_REV).diskless" "$(KERN_REV)" |
---|
[5817] | 56 | /bin/cp "$(WORKSPACE)/debootstrap/boot/initrd-$(KERN_REV).diskless" "$(WORKSPACE)/$@" |
---|
| 57 | |
---|
| 58 | iso/live/vmlinuz: debootstrap |
---|
| 59 | /bin/cp "$(WORKSPACE)/debootstrap/boot/vmlinuz-$(KERN_REV)" "$(WORKSPACE)/$@" |
---|
| 60 | |
---|
[5904] | 61 | iso/live/filesystem.squashfs: target/debootstrap-bccd.tar.bz2 |
---|
[6025] | 62 | nice "$(WORKSPACE)"/bin/make_filesystem_squashfs -o "$@" < "$<" |
---|
[5805] | 63 | |
---|
[6048] | 64 | # Added to test ISO w/o bccd deb #1008 |
---|
| 65 | nobccd-filesystem.squashfs: target/debootstrap.tar.bz2 |
---|
| 66 | nice "$(WORKSPACE)"/bin/make_filesystem_squashfs -o iso/live/filesystem.squashfs < "$<" |
---|
| 67 | |
---|
[6006] | 68 | iso/boot/isolinux/isolinux.bin: |
---|
[6005] | 69 | cp /usr/lib/ISOLINUX/isolinux.bin $@ |
---|
| 70 | |
---|
[6007] | 71 | iso/boot/isolinux/ldlinux.c32: |
---|
| 72 | cp /usr/lib/syslinux/modules/bios/ldlinux.c32 $@ |
---|
| 73 | |
---|
| 74 | target/bccd.amd64.iso: iso/boot/isolinux/isolinux.bin iso/boot/isolinux/ldlinux.c32 iso/live/filesystem.squashfs iso/live/initrd.img iso/live/vmlinuz |
---|
[5916] | 75 | nice /usr/bin/genisoimage \ |
---|
[5803] | 76 | -pad \ |
---|
| 77 | -l \ |
---|
| 78 | -r \ |
---|
| 79 | -J \ |
---|
| 80 | -v \ |
---|
[5808] | 81 | -V "BCCDv3-$(SVN_REV)" \ |
---|
[5803] | 82 | -no-emul-boot \ |
---|
| 83 | -boot-load-size 4 \ |
---|
| 84 | -boot-info-table \ |
---|
[5809] | 85 | -b boot/isolinux/isolinux.bin \ |
---|
| 86 | -c boot/isolinux/boot.cat \ |
---|
[5803] | 87 | -hide-rr-moved \ |
---|
[5804] | 88 | -o $@ \ |
---|
[5808] | 89 | iso |
---|
[5882] | 90 | |
---|
[6048] | 91 | target/nobccd.amd64.iso: iso/boot/isolinux/isolinux.bin iso/boot/isolinux/ldlinux.c32 nobccd-filesystem.squashfs iso/live/initrd.img iso/live/vmlinuz |
---|
| 92 | nice /usr/bin/genisoimage \ |
---|
| 93 | -pad \ |
---|
| 94 | -l \ |
---|
| 95 | -r \ |
---|
| 96 | -J \ |
---|
| 97 | -v \ |
---|
| 98 | -V "BCCDv3-$(SVN_REV)" \ |
---|
| 99 | -no-emul-boot \ |
---|
| 100 | -boot-load-size 4 \ |
---|
| 101 | -boot-info-table \ |
---|
| 102 | -b boot/isolinux/isolinux.bin \ |
---|
| 103 | -c boot/isolinux/boot.cat \ |
---|
| 104 | -hide-rr-moved \ |
---|
| 105 | -o $@ \ |
---|
| 106 | iso |
---|
| 107 | |
---|
| 108 | # Added to test ISO w/o bccd deb #1008 |
---|
| 109 | target/nobccd.amd64.iso.md5: target/nobccd.amd64.iso |
---|
[5915] | 110 | # Change directory to make md5sum print just the filename |
---|
| 111 | cd $(dir $<) && md5sum $(notdir $<) > $(notdir $@) |
---|
[5883] | 112 | |
---|
| 113 | install-iso: target/bccd.amd64.iso.md5 |
---|
[5887] | 114 | # Copy the MD5 file target, and the associaetd ISO file, to ISO_INSTALL_DIR |
---|
[5884] | 115 | ifdef ISO_INSTALL_DIR |
---|
[5907] | 116 | /bin/cp -v "$<" $(<:.md5=) "$(ISO_INSTALL_DIR)" |
---|
[5884] | 117 | endif |
---|
[6048] | 118 | |
---|
| 119 | # Added to test ISO w/o bccd deb #1008 |
---|
| 120 | nobccd-install-iso: target/nobccd.amd64.iso.md5 |
---|
| 121 | # Copy the MD5 file target, and the associaetd ISO file, to ISO_INSTALL_DIR |
---|
| 122 | ifdef ISO_INSTALL_DIR |
---|
| 123 | /bin/cp -v "$<" $(<:.md5=) "$(ISO_INSTALL_DIR)" |
---|
| 124 | endif |
---|