about summary refs log tree commit diff stats
path: root/.travis.yml
Commit message (Expand)AuthorAgeFilesLines
* 5914Kartik Agaram2020-01-211-3/+1
* 5485 - promote SubX to top-levelKartik Agaram2019-07-271-24/+2
* 4991Kartik Agaram2019-02-251-3/+4
* 4647 - support 64-bit Linux in CIKartik Agaram2018-10-011-0/+1
* 4248 -- simplify CIKartik Agaram2018-05-251-1/+3
* 4219 - add an even simpler build scriptKartik K. Agaram2018-03-131-0/+1
* 4218 - test build alternatives in CIKartik K. Agaram2018-03-131-1/+3
* 4016 - include subx/ tests in CIKartik K. Agaram2017-10-111-17/+18
* 3128Kartik K. Agaram2016-07-221-1/+2
* 3029Kartik K. Agaram2016-06-021-0/+1
* 3028Kartik K. Agaram2016-06-021-1/+2
* 2951Kartik K. Agaram2016-05-091-3/+0
* 2950 - more Travis load-balancingKartik K. Agaram2016-05-091-4/+3
* 2947Kartik K. Agaram2016-05-081-2/+3
* 2945Kartik K. Agaram2016-05-081-5/+10
* 2944Kartik K. Agaram2016-05-081-2/+9
* 2943Kartik K. Agaram2016-05-081-4/+8
* 2941 - split Travis CI into multiple jobsKartik K. Agaram2016-05-081-1/+4
* 2938 - ok, let's try CIKartik K. Agaram2016-05-081-0/+21
6699 } /* Name.Variable.Class */ .highlight .vg { color: #dd7700 } /* Name.Variable.Global */ .highlight .vi { color: #3333bb } /* Name.Variable.Instance */ .highlight .vm { color: #336699 } /* Name.Variable.Magic */ .highlight .il { color: #0000DD; font-weight: bold } /* Literal.Number.Integer.Long */
#!/bin/sh
# Build one or more .subx files into an ELF binary, and package it up into a
# bootable ISO image.
#
# Must be run on Linux.
#
# Dependencies:
#   apt install build-essential flex bison wget libelf-dev libssl-dev xorriso
#
# Based on http://minimal.linux-bg.org (GPLv3)

set -e

if [ $# -eq 0 ]
then
  echo "Usage: `basename $0` file.subx ..."
  exit 1
fi

echo "=== constructing initramfs out of SubX binary"
./ntranslate $*
mv a.elf init
chmod +x init
rm -rf tmp/isoimage
mkdir -p tmp/isoimage/boot
echo init | cpio -R root:root -H newc -o | xz -9 --check=none > tmp/isoimage/boot/rootfs.xz

if [ ! -d kernel ]
then
  echo "=== cloning kernel"
  git clone https://github.com/akkartik/kernel
fi

echo "=== building kernel"
( cd kernel
  make bzImage -j $(grep ^processor /proc/cpuinfo | wc -l)
)
cp kernel/arch/x86/boot/bzImage tmp/isoimage/boot/kernel.xz

echo "=== downloading syslinux"
test -f tmp/syslinux-6.03.tar.xz  ||  wget https://kernel.org/pub/linux/utils/boot/syslinux/syslinux-6.03.tar.xz -P tmp
echo "=== unpacking syslinux"
tar xf tmp/syslinux-*.tar.xz -C tmp

mkdir -p tmp/isoimage/boot/syslinux
cp syslinux.cfg \
   tmp/syslinux-*/bios/core/isolinux.bin \
   tmp/syslinux-*/bios/com32/elflink/ldlinux/ldlinux.c32 \
   tmp/isoimage/boot/syslinux

echo "=== generating ISO"
# 'hybrid' ISO can also be used on non-optical media such as a disk or USB stick
xorriso -as mkisofs \
  -isohybrid-mbr tmp/syslinux-*/bios/mbr/isohdpfx.bin \
  -c boot/syslinux/boot.cat \
  -b boot/syslinux/isolinux.bin \
    -no-emul-boot \
    -boot-load-size 4 \
    -boot-info-table \
  tmp/isoimage -o mu.iso