Skip to content

Instantly share code, notes, and snippets.

@justfortherec
justfortherec / 0001-Fix-reboot-on-shutdown-issue-with-the-new-camera-mod.patch
Created February 18, 2019 09:17
Linux kernel patch in Fairphone 19.02.1 to fix shutdown issue
From eb244d10da4f96f8147cc0bcadf2e043106745a4 Mon Sep 17 00:00:00 2001
From: Francesco Salvatore <francesco@fairphone.com>
Date: Fri, 14 Dec 2018 16:15:44 +0100
Subject: [PATCH] Fix reboot-on-shutdown issue with the new camera module
Since the introduction of Android N on FP2 devices equipped
with the new camera module, when an user tries to shutdown the device
it starts the power-off procedure but reboots before finishing.
This makes it impossible to turn off the phone and,
as a side effect, even to encrypt the device.
@justfortherec
justfortherec / dmesg.log
Created June 20, 2018 11:24
Kernel log of failed incremental update of FP2 with TWRP
<6>[ 0.000000] Booting Linux on physical CPU 0
<6>[ 0.000000] Initializing cgroup subsys cpu
<5>[ 0.000000] Linux version 3.4.113-lineageos-gc81a9c2 (jenkins@0fd045ccc84f) (gcc version 4.9.x-google 20140827 (prerelease) (GCC) ) #1 SMP PREEMPT Sat Dec 9 11:27:24 UTC 2017
<4>[ 0.000000] CPU: ARMv7 Processor [512f06f1] revision 1 (ARMv7), cr=10c5387d
<4>[ 0.000000] CPU: PIPT / VIPT nonaliasing data cache, PIPT instruction cache
<6>[ 0.000000] Machine: Qualcomm MSM 8974 (Flattened Device Tree), model: Qualcomm MSM 8974Pro-AA/AB MTP
<6>[ 0.000000] qcom,ion-heap@28 reserved EBI1 size 614000
<6>[ 0.000000] Node qcom,mdss_fb_primary memblock_reserve memory 3200000-5000000
<6>[ 0.000000] qcom,msm-contig-mem reserved EBI1 size 280000
<6>[ 0.000000] Node qcom,msm-mem-hole removed memory 5a00000-d200000
@justfortherec
justfortherec / recovery.log
Created June 20, 2018 11:21
Log of failed incremental update of FP2 with TWRP
__bionic_open_tzdata: couldn't find any tzdata when looking for localtime!
__bionic_open_tzdata: couldn't find any tzdata when looking for GMT!
__bionic_open_tzdata: couldn't find any tzdata when looking for posixrules!
Starting TWRP 3.2.1-0-2af13795 on Fri Jan 2 03:31:28 1970
(pid 206)
I:Lun file '/sys/class/android_usb/android0/f_mass_storage/lun0/file' does not exist, USB storage mode disabled
TW_INCLUDE_CRYPTO := true
I:Found brightness file at '/sys/class/leds/lcd-backlight/brightness'
I:Got max brightness 255 from '/sys/class/leds/lcd-backlight/max_brightness'
I:TWFunc::Set_Brightness: Setting brightness control to 255
@justfortherec
justfortherec / ratelimit_explained.py
Created January 27, 2018 17:03
GitHub API Rate Limit Explained
from datetime import datetime
from github3 import GitHub
def search_ratelimit(github):
"""Return information about search rate limit."""
ratelimit = github.rate_limit()
# `ratelimit` holds the JSON as described here:
# https://developer.github.com/v3/rate_limit/#get-your-current-rate-limit-status
@justfortherec
justfortherec / fp2-device-tree.md
Last active October 25, 2017 15:53
Device tree definition for Fairphone 2 linux kernel

The following files are included from the root description kernel/arch/arm/boot/dts/msm8974pro-ab-pm8941-mtp.dts:

  • msm8974pro-ab-pm8941.dtsi
    • msm8974pro-pm8941.dtsi
      • msm8974pro.dtsi
        • msm8974.dtsi
          • skeleton.dtsi
          • msm8974-camera.dtsi
          • msm8974-coresight.dtsi
          • msm-gdsc.dtsi
  • msm8974-ion.dtsi
@justfortherec
justfortherec / create_fp2_build_env_docker_image.sh
Last active January 9, 2016 22:06
Setup script for Fairphone 2 build environment Docker image (https://hub.docker.com/r/jftr/fairphone2-build-env)
#!/bin/bash
# Configure path to Dockerfile and shared directory
FAIRPHONE_OS_PATH=`readlink -f "~/fairphone_os"`
# Download Docker image
sudo docker pull jftr/fairphone2-build-env
# Now your docker image is available.
@justfortherec
justfortherec / Dockerfile
Last active January 9, 2016 21:36
Dockerfile for Fairphone 2 build environment as detailed at http://code.fairphone.com/projects/fp-osos/dev/fairphone-os-build-instructions.html
# This example is obsolete
# You can use a pre-built docker image from Docker Hub:
# https://hub.docker.com/r/jftr/fairphone2-build-env
# $ docker pull jftr/fairphone2-build-env