Skip to content

Instantly share code, notes, and snippets.

View zultron's full-sized avatar

John Morris zultron

View GitHub Profile
@zultron
zultron / entrypoint.sh
Created February 4, 2019 02:25
Docker entrypoint script to edit `/etc/hosts` and `/etc/passwd` at container init time
#!/bin/bash -e
# add hostname to hosts
sh -c 'echo "127.0.2.1 `hostname`" >> /etc/hosts'
# Start rsyslog for MK logging
service rsyslog start
# Add user and group to system
echo "${USER}:x:${UID}:${GID}::${HOME}:/bin/bash" >>/etc/passwd
@zultron
zultron / low_latency.c
Created July 3, 2019 18:20
Disable CPU idle states using PM QoS framework
// Disable CPU idle states using PM QoS framework
//
// Directly related:
// https://github.com/torvalds/linux/blob/master/Documentation/power/pm_qos_interface.txt
// https://lwn.net/Articles/465195/
// https://access.redhat.com/articles/65410
//
// Network:
// https://elinux.org/images/f/f9/Elc2008_pm_qos_slides.pdf
//
@zultron
zultron / bootlog.txt
Last active July 30, 2020 11:50
BPi-R2 boot log and dmesg
[ 0.000000] Booting Linux on physical CPU 0x0
[ 0.000000] Linux version 4.14.189-bpi-r2-main (jman@bpi-r2) (gcc version 6.3.0 20170516 (Debian 6.3.0-18+deb9u1)) #1 SMP Wed Jul 29 18:50:53 UTC 2020
[ 0.000000] CPU: ARMv7 Processor [410fc073] revision 3 (ARMv7), cr=10c5387d
[ 0.000000] CPU: div instructions available: patching division code
[ 0.000000] CPU: PIPT / VIPT nonaliasing data cache, VIPT aliasing instruction cache
[ 0.000000] OF: fdt: Machine model: Bananapi BPI-R2
[ 0.000000] Memory policy: Data cache writealloc
[ 0.000000] [WMT-CONSYS-HW][W]reserve_memory_consys_fn: name: consys-reserve-memory, base: 0xffe00000, size: 0x100000
[ 0.000000] OF: reserved mem: initialized node consys-reserve-memory, compatible id mediatek,consys-reserve-memory
[ 0.000000] cma: Reserved 64 MiB at 0xfb800000
modified build.sh
@@ -110,10 +110,10 @@ case $1 in
"install")
echo "install"
fname=/media/$USER/BPI-BOOT/bananapi/bpi-r2/linux/uImage_${kernver}-main
- if [ -e $fname ];then
- cp $fname $fname.bak
- fi
- cp uImage $fname
+ # if [ -e $fname ];then