##// END OF EJS Templates
kernel features + nexmon monitor mode wlan patch(kali-kernel) with RPI3,RPI3B+ firmware patch...
kernel features + nexmon monitor mode wlan patch(kali-kernel) with RPI3,RPI3B+ firmware patch - ENABLE_NEXMON to use raspberry pi kali kernel sources which include patched nl80211 driver. Needed to crosscompile nexmon. Firmware for RPI3 and RPI3B+ is patched in the process to enable moniotor mode and injection. - Support for precompiled kernel. RPI3 64bit kernel from sakaki and a multi kernel (supporting all RPI models) from hyperiotOS. Needs further testing! - start.elf isn't supplied from precompiled kernel so always install them - ENABLE_SYSTEMDSWAP enables swapping service supporting new KERNEL_ZSWAP feature and also manages swap files - KERNEL_SECURITY activates apparmor, keyring,str/mem cpy protection, audit funcionality, integrity checks - KERNEL_ZSWAP enables compressed swap kernel feature. -KERNEL_VIRT enables virtualisation on RPI2,3,3P -KERNEL_BPF enables bpf syscall (supress journald warning message) - KERNEL_NF enable netfilter firewall (iptables-legacy is not default anymore) - KERNEL_DEFAULT_GOV set default cpu governor

Fichier de la dernière révision:

r420:0a810af45a73
r502:3d4e292749a1
Show More
functions.sh
77 lines | 2.1 KiB | application/x-sh | BashLexer
# This file contains utility functions used by rpi23-gen-image.sh
cleanup (){
set +x
set +e
# Identify and kill all processes still using files
echo "killing processes using mount point ..."
fuser -k "${R}"
sleep 3
fuser -9 -k -v "${R}"
# Clean up temporary .password file
if [ -r ".password" ] ; then
shred -zu .password
fi
# Clean up all temporary mount points
echo "removing temporary mount points ..."
umount -l "${R}/proc" 2> /dev/null
umount -l "${R}/sys" 2> /dev/null
umount -l "${R}/dev/pts" 2> /dev/null
umount "$BUILDDIR/mount/boot/firmware" 2> /dev/null
umount "$BUILDDIR/mount" 2> /dev/null
cryptsetup close "${CRYPTFS_MAPPING}" 2> /dev/null
losetup -d "$ROOT_LOOP" 2> /dev/null
losetup -d "$FRMW_LOOP" 2> /dev/null
trap - 0 1 2 3 6
}
chroot_exec() {
# Exec command in chroot
LANG=C LC_ALL=C DEBIAN_FRONTEND=noninteractive chroot "${R}" "$@"
}
as_nobody() {
# Exec command as user nobody
sudo -E -u nobody LANG=C LC_ALL=C "$@"
}
install_readonly() {
# Install file with user read-only permissions
install -o root -g root -m 644 "$@"
}
install_exec() {
# Install file with root exec permissions
install -o root -g root -m 744 "$@"
}
use_template () {
# Test if configuration template file exists
if [ ! -r "./templates/${CONFIG_TEMPLATE}" ] ; then
echo "error: configuration template ${CONFIG_TEMPLATE} not found"
exit 1
fi
# Load template configuration parameters
. "./templates/${CONFIG_TEMPLATE}"
}
chroot_install_cc() {
# Install c/c++ build environment inside the chroot
if [ -z "${COMPILER_PACKAGES}" ] ; then
COMPILER_PACKAGES=$(chroot_exec apt-get -s install g++ make bc | grep "^Inst " | awk -v ORS=" " '{ print $2 }')
# Install COMPILER_PACKAGES in chroot
chroot_exec apt-get -q -y --allow-unauthenticated --no-install-recommends install "${COMPILER_PACKAGES}"
fi
}
chroot_remove_cc() {
# Remove c/c++ build environment from the chroot
if [ -n "${COMPILER_PACKAGES}" ] ; then
chroot_exec apt-get -qq -y --auto-remove purge "${COMPILER_PACKAGES}"
COMPILER_PACKAGES=""
fi
}