##// END OF EJS Templates
set kernel default governor
set kernel default governor

Fichier de la dernière révision:

r430:6b801569adf2
r455:7f84c1cfdbfd
Show More
functions.sh
96 lines | 2.6 KiB | application/x-sh | BashLexer
Unknown
a
r411 #!/bin/sh
drtyhlpr
Added Raspberry Pi 3 model support
r94 # This file contains utility functions used by rpi23-gen-image.sh
Jan Wagner
spliting more files, fix-uboot, fix-fbturbo, fix-locale
r67
Filip Pytloun
Refactor: split bootstrap actions and allow custom
r56 cleanup (){
set +x
set +e
Jan Wagner
spliting more files, fix-uboot, fix-fbturbo, fix-locale
r67
# Identify and kill all processes still using files
Filip Pytloun
Enhance cleanup by killing processes running in endpoint
r59 echo "killing processes using mount point ..."
Jan Wagner
fix: ENABLE_CRYPTFS -> UBOOT, SPLITFS, EXPANDROOT - cleanup
r82 fuser -k "${R}"
Filip Pytloun
Enhance cleanup by killing processes running in endpoint
r59 sleep 3
Jan Wagner
fix: ENABLE_CRYPTFS -> UBOOT, SPLITFS, EXPANDROOT - cleanup
r82 fuser -9 -k -v "${R}"
Jan Wagner
spliting more files, fix-uboot, fix-fbturbo, fix-locale
r67
Jan Wagner
shred-fix
r78 # Clean up temporary .password file
if [ -r ".password" ] ; then
shred -zu .password
fi
Jan Wagner
spliting more files, fix-uboot, fix-fbturbo, fix-locale
r67 # Clean up all temporary mount points
Filip Pytloun
Refactor: split bootstrap actions and allow custom
r56 echo "removing temporary mount points ..."
Jan Wagner
fix: ENABLE_CRYPTFS -> UBOOT, SPLITFS, EXPANDROOT - cleanup
r82 umount -l "${R}/proc" 2> /dev/null
umount -l "${R}/sys" 2> /dev/null
umount -l "${R}/dev/pts" 2> /dev/null
Filip Pytloun
Refactor: split bootstrap actions and allow custom
r56 umount "$BUILDDIR/mount/boot/firmware" 2> /dev/null
umount "$BUILDDIR/mount" 2> /dev/null
Jan Wagner
Added: ENABLE_CRYPTFS - encrypted rootfs, use-latest-bootloader, cp-cleanup
r77 cryptsetup close "${CRYPTFS_MAPPING}" 2> /dev/null
Vincent Knecht
Added ENABLE_SPLITFS option to produce distinct /boot/firmware and root images
r66 losetup -d "$ROOT_LOOP" 2> /dev/null
losetup -d "$FRMW_LOOP" 2> /dev/null
Filip Pytloun
Refactor: split bootstrap actions and allow custom
r56 trap - 0 1 2 3 6
}
chroot_exec() {
# Exec command in chroot
Unknown
a
r413 LANG=C LC_ALL=C DEBIAN_FRONTEND=noninteractive chroot "${R}" "$@"
Filip Pytloun
Refactor: split bootstrap actions and allow custom
r56 }
Jan Wagner
spliting more files, fix-uboot, fix-fbturbo, fix-locale
r67
Petter Reinholdtsen
Introduce as_nobody() function to make it easier to control how it is done....
r174 as_nobody() {
# Exec command as user nobody
Unknown
a
r413 sudo -E -u nobody LANG=C LC_ALL=C "$@"
Petter Reinholdtsen
Introduce as_nobody() function to make it easier to control how it is done....
r174 }
Jan Wagner
spliting more files, fix-uboot, fix-fbturbo, fix-locale
r67 install_readonly() {
# Install file with user read-only permissions
Unknown
a
r413 install -o root -g root -m 644 "$@"
Jan Wagner
spliting more files, fix-uboot, fix-fbturbo, fix-locale
r67 }
install_exec() {
# Install file with root exec permissions
Unknown
a
r413 install -o root -g root -m 744 "$@"
Jan Wagner
spliting more files, fix-uboot, fix-fbturbo, fix-locale
r67 }
drtyhlpr
Added: Configuration template file support (testing)
r117
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}"
}
drtyhlpr
Updated: Dropping privileges, chroot compiler install, dropbear sshd config
r142
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 }')
Unknown
remerge
r385 # Install COMPILER_PACKAGES in chroot
Unknown
a
r412 chroot_exec apt-get -q -y --allow-unauthenticated --no-install-recommends install "${COMPILER_PACKAGES}"
drtyhlpr
Updated: Dropping privileges, chroot compiler install, dropbear sshd config
r142 fi
}
chroot_remove_cc() {
# Remove c/c++ build environment from the chroot
Unknown
a
r412 if [ -n "${COMPILER_PACKAGES}" ] ; then
chroot_exec apt-get -qq -y --auto-remove purge "${COMPILER_PACKAGES}"
drtyhlpr
Updated: Dropping privileges, chroot compiler install, dropbear sshd config
r142 COMPILER_PACKAGES=""
fi
}
Unknown
added testing support for zswap and kvm support
r346 #GPL v2.0
#https://github.com/sakaki-/bcmrpi3-kernel-bis/blob/master/conform_config.sh
set_kernel_config() {
Unknown
a
r400 # flag as $1, value to set as $2, config must exist at "./.config"
Unknown
a
r411 TGT="CONFIG_${1#CONFIG_}"
REP="${2}"
Unknown
a
r400 if grep -q "^${TGT}[^_]" .config; then
sed -i "s/^\(${TGT}=.*\|# ${TGT} is not set\)/${TGT}=${REP}/" .config
else
Unknown
0
r430 echo "${TGT}"="${2}" >> .config
Unknown
a
r400 fi
Unknown
added testing support for zswap and kvm support
r346 }
unset_kernel_config() {
Unknown
a
r400 # unsets flag with the value of $1, config must exist at "./.config"
Unknown
a
r412 TGT="CONFIG_${1#CONFIG_}"
Unknown
a
r400 sed -i "s/^${TGT}=.*/# ${TGT} is not set/" .config
Unknown
added testing support for zswap and kvm support
r346 }
Unknown
a
r412 #