Skip to content

Instantly share code, notes, and snippets.

View minlexx's full-sized avatar
🐧
Working

Alexey Min minlexx

🐧
Working
View GitHub Profile
#!/bin/bash
MIRROR_PMOS=http://mirror.postmarketos.org/postmarketos/
MIRROR_ALPINE=http://mirror.yandex.ru/mirrors/alpine/
#MIRROR_ALPINE=http://dl-cdn.alpinelinux.org/alpine/
python3 ~/projects/pmbootstrap/pmbootstrap.py \
--mirror-pmOS=${MIRROR_PMOS} \
--mirror-alpine=${MIRROR_ALPINE} \
@minlexx
minlexx / setup-diag.sh
Created May 24, 2024 12:51
Setup diag-router FunctionFS gadget on pmOS phone with already configured USB gadget
#!/bin/sh
set -x
G1="/sys/kernel/config/usb_gadget/g1"
# turn off the gadget
UDC_NAME=$( cat $G1/UDC )
echo "" > $G1/UDC
sleep 1
#!/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>;