mirror of
https://github.com/cirosantilli/linux-kernel-module-cheat.git
synced 2026-01-23 10:15:57 +01:00
split networking and filesystem toplevel secions create closest overlayfs attempt so far and document it
112 lines
2.2 KiB
Bash
Executable File
112 lines
2.2 KiB
Bash
Executable File
#!/usr/bin/env bash
|
|
|
|
# Shallow helper to build everything, or a subset of everything conveniently.
|
|
#
|
|
# While developing something however, you will likely want to just run the
|
|
# required sub-build commands manually to speed things up and understand what
|
|
# is going on.
|
|
#
|
|
# Without any args, build everything for all archs:
|
|
#
|
|
# ./build-all
|
|
#
|
|
# This will build QEMU, gem5, Buildroot, Linux, etc.
|
|
# for x86_64, arm and aarch64.
|
|
#
|
|
# With --archs, build everything for just the given archs:
|
|
#
|
|
# ./build-all --archs 'arm aarch64'
|
|
#
|
|
# Other options make this script build only the given components. E.g., to build
|
|
# just Linux and QEMU for all archs, but not gem5, Buildroot, etc.:
|
|
#
|
|
# ./build-all --linux --qemu
|
|
#
|
|
# this is useful to while developing those components to prepare to quickly
|
|
|
|
set -eu
|
|
archs='x86_64 arm aarch64'
|
|
baremetal=false
|
|
buildroot=false
|
|
gem5=false
|
|
linux=false
|
|
modules=false
|
|
qemu=false
|
|
userland=false
|
|
while [ $# -gt 0 ]; do
|
|
case "$1" in
|
|
--archs)
|
|
archs="$2"
|
|
shift 2
|
|
;;
|
|
--baremetal)
|
|
baremetal=true
|
|
shift
|
|
;;
|
|
--buildroot)
|
|
buildroot=true
|
|
shift
|
|
;;
|
|
--gem5)
|
|
gem5=true
|
|
shift
|
|
;;
|
|
--linux)
|
|
linux=true
|
|
shift
|
|
;;
|
|
--modules)
|
|
modules=true
|
|
shift
|
|
;;
|
|
--qemu)
|
|
qemu=true
|
|
shift
|
|
;;
|
|
--userland)
|
|
userland=true
|
|
shift
|
|
;;
|
|
esac
|
|
done
|
|
if ! (
|
|
"$baremetal" || \
|
|
"$buildroot" || \
|
|
"$gem5" || \
|
|
"$linux" || \
|
|
"$qemu"
|
|
)
|
|
then
|
|
baremetal=true
|
|
buildroot=true
|
|
gem5=true
|
|
linux=true
|
|
qemu=true
|
|
fi
|
|
for arch in $archs; do
|
|
if "$qemu"; then
|
|
./build-qemu --arch "$arch"
|
|
fi
|
|
if "$linux"; then
|
|
./build-linux --arch "$arch"
|
|
fi
|
|
if "$modules"; then
|
|
./build-modules
|
|
fi
|
|
if "$userland"; then
|
|
./build-userland
|
|
fi
|
|
if "$baremetal" && [ ! "$arch" = x86_64 ]; then
|
|
./build-crosstool-ng --arch "$arch"
|
|
./build-baremetal --arch "$arch"
|
|
./build-baremetal --arch "$arch" --gem5
|
|
./build-baremetal --arch "$arch" --gem5 --machine RealViewPBX
|
|
fi
|
|
if "$buildroot"; then
|
|
./build-buildroot --arch "$arch" --gem5 --kernel-modules "$@"
|
|
fi
|
|
if "$gem5"; then
|
|
./build-gem5 --arch "$arch"
|
|
fi
|
|
done
|