forked from wilkie/buildtools
-
Notifications
You must be signed in to change notification settings - Fork 14
/
pciutils.sh
executable file
·48 lines (32 loc) · 1.15 KB
/
pciutils.sh
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
source scripts/functions.sh
# --- Variables ---
source scripts/nativevars.sh
# --- idk why newlib doesn't install header files that live in sub-directories ---
cp -r newlib-files/asm local/x86_64-pc-xomb/include/
# --- Directory creation ---
mkdir -p build
mkdir -p $PREFIX
cd build
setphase "MAKE OBJECT DIRECTORIES"
mkdir -p pciutils-obj
PCIUTILS_VER=3.1.9
# --- Fetch and extract each package ---
wget $WFLAGS ftp://atrey.karlin.mff.cuni.cz/pub/linux/pci/pciutils-${PCIUTILS_VER}.tar.gz
tar -xf pciutils-${PCIUTILS_VER}.tar.gz
doPatch pciutils
# --- Compile all packages ---
setphase "COMPILE PCIUTILS"
cd pciutils-obj
cp -R ../pciutils-${PCIUTILS_VER}/* . || exit
FLAGS="ZLIB=no DNS=no SHARED=no PREFIX=$PREFIX HOST=$TARGET CROSS_COMPILE=${TARGET}-"
CMD="make -j$NCPU $FLAGS"
echo ${CMD}
${CMD} LDFLAGS="-g -T../../../xomb/app/build/elf.ld" || exit
setphase "INSTALL PCIUTILS"
make install $FLAGS LDFLAGS="${LDFLAGS}" || exit
make install-lib $FLAGS LDFLAGS="${LDFLAGS}" || exit
cd ..
XOMB_PREFIX=../../xomb
cp $PREFIX/sbin/lspci $XOMB_PREFIX/build/root/binaries
mkdir -p $XOMB_PREFIX/build/root/data
cp $PREFIX/share/pci.ids $XOMB_PREFIX/build/root/data/