Skip to content

Instantly share code, notes, and snippets.

View minlexx's full-sized avatar
🐧
Working

Alexey Min minlexx

🐧
Working
View GitHub Profile
#!/usr/bin/python3
# SPDX-License-Identifier: GPL-3.0
# Author: Alexey Minnekhanov <alexeymin@postmarketos.org>
# Uncompressed aarch64 kernel image does not include file size
# anywhere inside the file itself; so we have to fake that.
# Append the size as a 32-bit little-endian number as gzip does.
# This works as follows:
/dts-v1/;
/ {
#address-cells = <0x1>;
#size-cells = <0x1>;
model = "SAMSUNG K PROJECT REV14";
compatible = "qcom,msm8974-mtp", "qcom,msm8974", "qcom,mtp";
interrupt-parent = <0x1>;
qcom,msm-id = <0xc208ff01 0xe 0x10000>;
@minlexx
minlexx / HOWTO-use.txt
Last active May 14, 2023 23:13
Linux build scripts for postmarketOS (read HOWTO-use.txt)
# First step, perform "pmbootstrap install" locally once for your device,
# to get the initramfs file generated by pmbootstrap.
# Then copy it into build dir (this is done only once!):
$ ./cp-initfs.sh
# Then regular build process:
$ ./menuconfig.sh or ./make.sh oldconfig
$ ./make.sh && ./modules-install.sh && ./create-bootimg.sh && ./upload-modules-root.sh
# If you need to update modules included in initramfs, run
#pragma once
#ifndef LINENOISE_CONVERT_INC
#define LINENOISE_CONVERT_INC
/*
Copyright 2020 dbj@dbj.org -- turned into single header C lib
inevitably some name clashes will
start becuase of this header.
Thus renaming is very likely not finished
Licence: CC BY SA 4.0
@minlexx
minlexx / example_output.txt
Last active February 14, 2020 16:11
test_threaded_socketnotifier
Thread: started!
Thread: writing: Write 0
ready to read!
read: Write 0
Thread: writing: Write 1
ready to read!
read: Write 1
Thread: writing: Write 2
ready to read!
read: Write 2
@minlexx
minlexx / create-bootimg.sh
Last active September 15, 2023 19:15
Script to create boot.img for xiaomi-lavender from inside kernel build tree, using initramfs file built by pmbootstrap
#!/bin/bash
set -x
KERNEL=./arch/arm64/boot/Image.gz
KERNEL_DTB=${KERNEL}-dtb
DTB=./arch/arm64/boot/dts/qcom/sdm660-xiaomi-lavender.dtb
INITRD=initramfs-postmarketos-qcom-sdm660
# Optional:
@minlexx
minlexx / sdm660-mtp_f7a.dts
Last active December 11, 2019 20:35
Xiaomi Redmi Note 7 (lavender) Device Tree Sources (preprocessed and included files list)
/dts-v1/;
/ {
#address-cells = <0x2>;
#size-cells = <0x2>;
model = "Qualcomm Technologies, Inc. SDM 660 PM660 + PM660L MTP F7A overlay";
compatible = "qcom,sdm660-mtp", "qcom,sdm660", "qcom,mtp";
qcom,msm-id = <0x13d 0x0>;
interrupt-parent = <0x1>;
qcom,board-id = <0x20008 0x0>;
@minlexx
minlexx / startplasmamobile snip
Last active July 15, 2019 13:20
modify /usr/bin/startplasmamobile like this
if [ -d "/dev/dri" ]; then
kwin_wayland --drm --xwayland plasma-phone 2>&1 | logger -t "$(whoami):plasma-mobile"
elif [ -d "/usr/lib/libhybris-egl" ]; then
# export EGL_PLATFORM=hwcomposer
# export QT_LOGGING_RULES="kwin*.debug=true;qt*.debug=true"
export QT_LOGGING_RULES="kwin*.debug=true"
export LD_PRELOAD=/usr/lib/libhybris-egl/libEGL.so.1
kwin_wayland --hwcomposer /usr/bin/plasma-phone 2>&1 | logger -t "$(whoami):plasma-mobile"
else
@minlexx
minlexx / RelinkQt.sh
Created January 25, 2019 11:47
Binary patcher for linux Qt builds to relocate hard-coded paths to library install location
#!/bin/sh
if [ x"$VERBOSE" = x"1" ]; then
set -x
fi
SCRIPT=$(readlink -f $0)
SCRIPTPATH=$(dirname $SCRIPT)
cd $SCRIPTPATH/..