-
Notifications
You must be signed in to change notification settings - Fork 24
/
Copy path.travis.yml
66 lines (61 loc) · 3.27 KB
/
.travis.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
language: cpp
compiler: gcc
sudo: require
dist: trusty
env:
- ISO="http://us.cdimage.ubuntu.com/xubuntu/releases/19.04/release/xubuntu-19.04-desktop-amd64.iso"
- ISO=""
install:
- sudo apt-get -y install util-linux dosfstools mtools kpartx grub-pc-bin grub-common grub-efi-amd64-bin parted util-linux # grub-efi-amd64 conflicts grub-pc
script:
- set -e # Stop on errors, https://github.com/travis-ci/travis-ci/issues/1066
- cd ..
- if [ -z "$ISO" ] ; then dd if=/dev/zero of=boot.img count=64 bs=1M ; fi #### 64
- if [ ! -z "$ISO" ] ; then wget -c -nv "$ISO" ; fi
- if [ ! -z "$ISO" ] ; then SIZE=$(($(ls -lh --block-size=M *.iso | cut -d " " -f 5 | cut -d M -f 1) + 100)) ; fi # 100 MB larger than ISO
- if [ ! -z "$ISO" ] ; then dd if=/dev/zero of=boot.img count=$SIZE bs=1M ; fi
- parted --script boot.img mklabel msdos mkpart p fat32 1 100% set 1 boot on # # Make the partition table, partition and set it bootable
- # http://nairobi-embedded.org/making_a_qemu_disk_image_bootable_with_grub.html#installing-grub-in-the-disk-image
- sudo kpartx -av boot.img
- sudo mkdir mnt
- sudo losetup /dev/loop1 /dev/mapper/loop0p1
- sleep 1
# If you get the message WARNING: Not enough clusters for a 32 bit FAT!, reduce cluster size with mkfs.fat -s2 -F32 ... or -s1;
# otherwise the partition may be unreadable by UEFI. See mkfs.fat(8) for supported cluster sizes.
# https://wiki.archlinux.org/index.php/EFI_system_partition#MBR_partitioned_disks
- sudo mkfs.vfat -s1 -F32 /dev/mapper/loop0p1
- sudo mount /dev/loop1 mnt
- sudo df -h
- sudo cp -r SystemImageKit/* ./mnt/
- if [ ! -z "$ISO" ] ; then sudo mv *.iso ./mnt/boot/iso/ ; fi
- sudo parted /dev/loop0 set 1 boot on # Set boot flag
- # https://superuser.com/a/200442
- sudo rm -rf ./mnt/boot/grub/device.map # grub-install: warning: the device.map entry `hd0,1' is invalid. Ignoring it. Please correct or delete your device.map.
- sudo grub-install --modules="biosdisk part_msdos configfile normal multiboot" --no-floppy --boot-directory=./mnt/boot /dev/loop0
- sudo mkdir -p ./mnt/boot/efi ./mnt/EFI/
- sudo grub-install --target=x86_64-efi --boot-directory=./mnt/boot --efi-directory=./mnt/boot/efi /dev/mapper/loop0p1
- sudo mv ./mnt/boot/EFI/BOOT ./mnt/EFI/BOOT
- sudo bash -e ./mnt/boot/iso/additional-initramfs/generate # Generate additional initrd (gets loaded in addition to the one on the ISO)
- sudo find ./mnt/
- sudo ./mnt/boot/bin/detect # Configure bootloader
- sudo cat ./mnt/boot/grub/grub.cfg
- sudo find ./mnt/boot/bin/generate-appimaged* -exec bash {} \; # Create and install ExtensionImage
- sudo umount ./mnt
- sudo fdisk -l /dev/loop0
- sudo losetup -d /dev/loop1
- sudo kpartx -v -d /dev/loop0
- ls -lh .
- VERSION=$(cd SystemImageKit ; git rev-parse --short HEAD)
# travis_wait 30 xz -0 boot.img
- if [ ! -z "$ISO" ] ; then SUFFIX=$(basename $ISO | cut -d "-" -f 1-2) ; fi
# mv boot.img.xz BootImage-$SUFFIX-$VERSION-x86_64.img.xz # takes time
- mv boot.img BootImage-$SUFFIX-$VERSION-x86_64.img
- ls -lh
after_success:
- wget -c https://github.com/probonopd/uploadtool/raw/master/upload.sh
# bash upload.sh ./*.xz
- bash upload.sh ./*.img
branches:
except:
- # Do not build tags that we create when we upload to GitHub Releases
- /^(?i:continuous)/