Skip to content

Commit 1712851

Browse files
committed
Fix kexec-tools build and optimize for size where possible
Signed-off-by: Andrea Barberio <[email protected]>
1 parent c781761 commit 1712851

File tree

2 files changed

+11
-5
lines changed

2 files changed

+11
-5
lines changed

.travis.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,16 @@
1-
sudo: false
1+
dist: xenial
22
matrix:
33
include:
44
- os: linux
5-
env: TARGET=x86_64-unknown-linux-musl
65
addons:
76
apt:
87
packages:
8+
- musl-dev
99
- libpci-dev
1010
- libusb-dev
1111
- libusb-1.0-0-dev
12+
- uuid-dev
13+
- linux-libc-dev
1214
script:
1315
- "./build.sh"
1416
deploy:

build.sh

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#!/usr/bin/env bash
2-
set -ex
2+
set -exu
33

44
BASEDIR="${PWD}"
55
OUTDIR="${BASEDIR}/build"
@@ -16,6 +16,8 @@ git clone git://git.kernel.org/pub/scm/utils/kernel/kexec/kexec-tools.git
1616
cd kexec-tools
1717
git checkout -b "${KEXEC_TOOLS_VERSION}"
1818
./bootstrap
19+
# just optimize for space. Kexec uses kernel headers so we cannot use musl-gcc
20+
# here. See https://wiki.musl-libc.org/faq.html#Q:-Why-am-I-getting-
1921
CFLAGS=-Os ./configure
2022
make
2123
strip build/sbin/kexec
@@ -27,7 +29,9 @@ cd "${OUTDIR}"
2729
git clone https://review.coreboot.org/cgit/flashrom.git
2830
cd flashrom
2931
git checkout -b "${FLASHROM_VERSION}"
30-
make
32+
# no musl-gcc here either, as flashrom needs libpci-dev (we may remove PCI
33+
# programmers from the build at a later stage though)
34+
CFLAGS=-Os make
3135
strip flashrom
3236
du -hs flashrom
3337
ldd flashrom
@@ -38,6 +42,6 @@ wget "http://pyropus.ca/software/memtester/old-versions/memtester-${MEMTESTER_VE
3842
tar xvzf "memtester-${MEMTESTER_VERSION}".tar.gz
3943
ln -s "memtester-${MEMTESTER_VERSION}" memtester
4044
cd "memtester-${MEMTESTER_VERSION}"
41-
make # build statically
45+
CFLAGS=-Os CC=musl-gcc make # build statically
4246
du -hs memtester
4347
ldd memtester

0 commit comments

Comments
 (0)