Skip to content

Instantly share code, notes, and snippets.

Avatar

Satadru Pramanik satmandu

View GitHub Profile
@satmandu
satmandu / make_current_arm64_rpi_kernel_debs.sh
Last active Aug 27, 2021
Make arm64 deb packages for the offical Raspberry Pi Foundation arm64 kernels + NOW INSTALLS headers package too.
View make_current_arm64_rpi_kernel_debs.sh
#!/bin/bash -x
# make_arm64_rpi_kernel_debs.sh
# Builds arm64 debian packages from the CURRENT rpi firmware repository kernel which is installed by:
# sudo rpi-update
# This runs on an arm64 host with arm64 compilation tools...
# or with some sort of cross-compilation setup.
# Debs are put in $workdir/build
#
# This will NOT work in Raspbian unless you have an arm64 compilation
# environment setup. Appears to work on
@satmandu
satmandu / chromeos_docker.sh
Last active Aug 5, 2021
Updated ChromeOS docker container script
View chromeos_docker.sh
#!/bin/bash
# chromeos_docker.sh
# Usage:
# chromeos_docker.sh recoveryfileurl name milestone arch
# or if image.bin already exists this works too:
# chromeos_docker.sh dummy name milestone arch
# (Default is not to delete the image after download.)
# e.g.
# Example for x86_64:
# chromeos_docker.sh https://dl.google.com/dl/edgedl/chromeos/recovery/chromeos_13816.82.0_nocturne_recovery_stable-channel_mp.bin.zip nocturne 90 x86_64
@satmandu
satmandu / gist:3fd42c5a538bc34a1636950740838d3e
Created Apr 12, 2019
Waveshare35a config info for raspberry pi
View gist:3fd42c5a538bc34a1636950740838d3e
From https://www.spotpear.com/learn/EN/raspberry-pi/Raspberry-Pi-LCD/Raspberry-Pi-_Rotate-the-screen-display.html
Raspberry Pi - Rotate the screen display
Raspberry Pi 2.4/3.2 inch LCD
Rotate display
sudo nano /boot/config.txt
@satmandu
satmandu / dpcd_pixel_slate.patch
Last active May 29, 2021
Patch to make backlight work for nocturne/Pixel Slate (and maybe also eve) with linux kernel 5.12
View dpcd_pixel_slate.patch
diff -Npaur a/drivers/gpu/drm/i915/display/intel_dp_aux_backlight.c b/drivers/gpu/drm/i915/display/intel_dp_aux_backlight.c
--- a/drivers/gpu/drm/i915/display/intel_dp_aux_backlight.c 2021-05-07 18:57:14.612178675 -0400
+++ b/drivers/gpu/drm/i915/display/intel_dp_aux_backlight.c 2021-05-07 18:58:15.107279925 -0400
@@ -593,7 +593,6 @@ intel_dp_aux_supports_vesa_backlight(str
* work just fine using normal PWM controls anyway.
*/
if (intel_dp->edp_dpcd[1] & DP_EDP_TCON_BACKLIGHT_ADJUSTMENT_CAP &&
- (intel_dp->edp_dpcd[1] & DP_EDP_BACKLIGHT_AUX_ENABLE_CAP) &&
(intel_dp->edp_dpcd[2] & DP_EDP_BACKLIGHT_BRIGHTNESS_AUX_SET_CAP)) {
drm_dbg_kms(&i915->drm, "AUX Backlight Control Supported!\n");
@satmandu
satmandu / gcc10.rb
Created Apr 14, 2021
gcc 10.3.0 chromebrew package WIP
View gcc10.rb
require 'package'
class Gcc10 < Package
description 'The GNU Compiler Collection includes front ends for C, C++, Objective-C, Fortran, Ada, and Go.'
homepage 'https://www.gnu.org/software/gcc/'
version '10.3.0'
@isl_ver = '0.23'
compatibility 'all'
license 'GPL-3'
source_url 'https://gcc.gnu.org/pub/gcc/releases/gcc-10.3.0/gcc-10.3.0.tar.xz'
@satmandu
satmandu / getdeps
Last active Mar 25, 2021
Chromebrew get actual runtime dependencies for a package
View getdeps
#!/bin/env bash
# set -x
pkg="${1}"
CREW_LIB_PREFIX=$(crew const | grep CREW_LIB_PREFIX | awk -F = '{print $2}')
# Which packages have a needed library in CREW_LIB_PREFIX
# This is a subset of what crew whatprovides gives
whatprovidesfxn() {
pkgdepslcl="${1}"
filelcl=$(grep "$pkgdepslcl" /usr/local/etc/crew/meta/*.filelist | grep $CREW_LIB_PREFIX)
@satmandu
satmandu / build_arm64_rpi_userland.sh
Last active Mar 21, 2021
Generate an arm64 rpi userland for use on ubuntu/arm64.
View build_arm64_rpi_userland.sh
#!/bin/bash -x
workdir="${HOME}/workdir"
[[ ! -d "$workdir" ]] && ( mkdir -p "$workdir" || exit 1)
[[ ! -d "$workdir"/tmp ]] && ( mkdir -p "$workdir"/tmp || exit 1)
[[ ! -d "$workdir"/output ]] && ( mkdir -p "$workdir"/output || exit 1)
echo "workdir is ${workdir}"
tmpdir=$(mktemp -d deb_XXXX -p "$workdir"/tmp)
deb_temp=${tmpdir}/deb
extract_tmp=${tmpdir}/extract
@satmandu
satmandu / chromeos_docker.sh
Last active Mar 16, 2021
Docker buildx based package builder for Chromebrew on x86_64, i686, & armv7l. (armv7l only tested on Raspberry PI) Put both files in the same folder.
View chromeos_docker.sh
#!/bin/bash
# chromeos_docker.sh
# Usage:
# chromeos_docker.sh recoveryfileurl name milestone arch
# or if image.bin already exists this works too:
# chromeos_docker.sh dummy name milestone arch
# (Default is not to delete the image after download.)
# e.g.
# Example for x86_64:
# chromeos_docker.sh https://dl.google.com/dl/edgedl/chromeos/recovery/chromeos_13505.73.0_nocturne_recovery_stable-channel_mp.bin.zip nocturne 87 x86_64
@satmandu
satmandu / arch2crew
Last active Mar 9, 2021
Script to help with creating Chromebrew package files from Arch Linux PKGBUILD files
View arch2crew
#!/bin/bash -x
# arch2crew
# Script to help with creating Chromebrew package files from Arch Linux PKGBUILD files
# Assumes rubocop is installed via "gem install rubocop"
# Usage: arch2crew <Arch Linux package name>
# Satadru Pramanik <satadru@gmail.com>
#
archpkgname="${1}"
# Initial setup
@satmandu
satmandu / netflix-dns.sh
Last active Jan 10, 2021
PfSense script to keep HE tunnels from confusing netflix by blocking netflix IPV6 resolution.
View netflix-dns.sh
#!/bin/sh
#make sure the directory for the python libraries is in the chroot
mkdir -p /var/unbound/usr/local/lib/python2.7
#link the actual python library directory to the chroot's directory
mount -t nullfs /usr/local/lib/python2.7 /var/unbound/usr/local/lib/python2.7
#copy the python script to the /var/unbound directory so
#unbound-checkconf can find it