Credits to @TheOnlyAnil-@Firelord[^stackoverflow]
-
Requirements: a) stock recovery + rooted phone b) custom recovery
-
Files changed:
# I used this shell.nix to build LineageOS 21.0 for redfin (Google Pixel 5) | |
# | |
# IMPORANT NOTE: I had to use a pure shell for my builds to work, i.e: `nix-shell --pure` rather than `nix-shell` | |
# | |
# The build instructions are here: https://wiki.lineageos.org/devices/redfin/build | |
# | |
# Warning (from forked gist, was added August 1st 2018): | |
# The hardened NixOS kernel disables 32 bit emulation, which made me run into multiple "Exec format error" errors. | |
# To fix, use the default kernel, or enable "IA32_EMULATION y" in the kernel config. | |
# |
#!/bin/bash | |
# Version 0.2 by Sebastiaan Franken | |
# This is meant and tested on Fedora and Fedora only, with systemd-boot (bootctl) | |
# Place this file in /etc/kernel/postinst.d/ and don't forget to make it executable | |
# with chmod +x /etc/kernel/postinst.d/bootctl-postinst.sh | |
# | |
# Also, don't forget to modify the rootpath variable to reflect your situation | |
[ -f /etc/sysconfig/kernel ] && . /etc/sysconfig/kernel |
{ config, pkgs, ... }: | |
let | |
# Import unstable channel. | |
# sudo nix-channel --add http://nixos.org/channels/nixpkgs-unstable nixpkgs-unstable | |
# sudo nix-channel --update nixpkgs-unstable | |
unstable = import <nixpkgs-unstable> {}; | |
in | |
{ |
#!/bin/bash | |
# | |
# /etc/kernel/postinst.d script to sign akmods kmods after kernel upgrade | |
# | |
# Author: Michael Goodwin Date: 2016-09-21 | |
# 1. Copy this script to /etc/kernel/postinst.d/ and `chmod +x` it | |
# | |
# 2. Create signing keys (store these somewhere useful and safe): | |
# $ mkdir -p /etc/pki/tls/private/mok |