This commit is contained in:
Jeremy Soller
2019-09-13 20:10:47 -06:00
69 changed files with 4703 additions and 1917 deletions

View File

@ -39,6 +39,8 @@ FIRMWARE_OPEN_VBT="${MODEL_DIR}/vbt.rom" \
PACKAGES_PATH="${MODEL_DIR}:$(realpath edk2-platforms):$(realpath apps)" \
./scripts/_build/edk2.sh \
"${UEFIPAYLOAD}" \
-D USE_HPET_TIMER=TRUE \
-D SOURCE_DEBUG_ENABLE=FALSE \
-D FIRMWARE_OPEN_FIRMWARE_SETUP="firmware-setup/firmware-setup.inf" \
-D FIRMWARE_OPEN_GOP_POLICY="gop-policy/gop-policy.inf" \
-D FIRMWARE_OPEN_GOP="IntelGopDriver.inf"
@ -60,4 +62,6 @@ pushd apps/firmware-update >/dev/null
popd >/dev/null
mmd -i "${USB}.partial@@1M" "::${BASEDIR}/firmware"
mcopy -i "${USB}.partial@@1M" "${COREBOOT}" "::${BASEDIR}/firmware/firmware.rom"
mcopy -i "${USB}.partial@@1M" "${MODEL_DIR}/ec.rom" "::${BASEDIR}/firmware/ec.rom"
mcopy -i "${USB}.partial@@1M" "${MODEL_DIR}/uecflash.efi" "::${BASEDIR}/firmware/uecflash.efi"
mv -v "${USB}.partial" "${USB}"

57
scripts/deps.sh Executable file
View File

@ -0,0 +1,57 @@
#!/usr/bin/env bash
set -eE
function msg {
echo -e "\x1B[1m$*\x1B[0m" >&2
}
trap 'msg "\x1B[31mFailed to install dependencies!"' ERR
if which apt-get > /dev/null
then
msg "Installing system build dependencies"
sudo apt-get install \
build-essential \
bison \
ccache \
flex \
git-lfs \
gnat \
mtools \
nasm \
uuid-dev \
zlib1g-dev
else
msg "Please add support for your distribution to:"
msg "scripts/deps.sh"
exit 1
fi
msg "Installing GIT LFS hooks"
git lfs install
msg "Downloading GIT LFS artifacts"
git lfs pull
msg "Installing Rust"
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs \
| sh -s -- -y --default-toolchain nightly
msg "Loading Rust environment"
source ~/.cargo/env
msg "Installing pinned Rust toolchain"
rustup toolchain install "$(cat rust-toolchain)"
msg "Installing source for pinned Rust toolchain"
rustup component add --toolchain "$(cat rust-toolchain)" rust-src
if ! which cargo-xbuild > /dev/null
then
msg "Installing cargo-xbuild"
cargo +nightly install cargo-xbuild
fi
msg "\x1B[32mSuccessfully installed dependencies"
echo "Ready to run ./scripts/build.sh [model]" >&2

20
scripts/flash.sh Executable file
View File

@ -0,0 +1,20 @@
#!/usr/bin/env bash
set -e
if [ -z "$1" ]
then
echo "$0 [model]" >&2
exit 1
fi
MODEL="$1"
if [ ! -d "models/$1" ]
then
echo "model '$1' not found" >&2
exit 1
fi
MODEL_DIR="$(realpath "models/${MODEL}")"
cargo build --release --manifest-path libs/intel-spi/Cargo.toml
sudo libs/intel-spi/target/release/intel-spi "build/${MODEL}/coreboot.rom"

4
scripts/udk-debug.gdb Executable file
View File

@ -0,0 +1,4 @@
#!/usr/bin/gdb -x
target remote :1234
source /opt/intel/udkdebugger/script/udk_gdb_script
iowatch/b 0x80

5
scripts/udk-output.sh Executable file
View File

@ -0,0 +1,5 @@
#!/usr/bin/env bash
set -e
nc localhost 20715

9
scripts/udk-server.sh Executable file
View File

@ -0,0 +1,9 @@
#!/usr/bin/env bash
set -e
while true
do
/opt/intel/udkdebugger/bin/udk-gdb-server
sleep 10
done

32
scripts/udk.sh Executable file
View File

@ -0,0 +1,32 @@
#!/usr/bin/env bash
set -e
trap "trap - SIGTERM && kill -- -$$" SIGINT SIGTERM EXIT
echo "## Launching UDK ##"
./scripts/udk-server.sh &
while true
do
if lsof -Pi :20715 -sTCP:LISTEN -t >/dev/null
then
break
fi
sleep 1
done
echo "## Launching NC ##"
./scripts/udk-output.sh &
while true
do
if lsof -Pi :1234 -sTCP:LISTEN -t >/dev/null
then
break
fi
sleep 1
done
echo "## Launching GDB ##"
./scripts/udk-debug.gdb