Add command to flash custom lineage kernel

This commit is contained in:
Waldemar Tomme 2025-01-10 09:53:05 +01:00
parent 05c43567d7
commit b2794eb97c
2 changed files with 29 additions and 12 deletions

1
.gitignore vendored
View File

@ -5,3 +5,4 @@
/tools/
/.cache/
/.repos/
/.tmp/

View File

@ -35,7 +35,6 @@
(python3.withPackages (pypi: with pypi; [
libfdt
]))
android-fhs
(writeShellScriptBin "flash-lineage-magisk" ''
rootDir="${rootDir}"
@ -73,6 +72,16 @@
flash-lineage-magisk
'')
(writeShellScriptBin "flash-custom-lineage-kernel" ''
echo "Installing custom LineageOS..."
heimdall flash --BOOT ".repos/lineageos/out/target/product/a71/boot.img"
'')
(writeShellScriptBin "flash-stock" ''
echo "Installing stock..."
# does not work for some reason
# pmbootstrap flasher --method heimdall-bootimg --resume flash_kernel
'')
(writeShellScriptBin "flash-postmarketos" ''
echo "Installing postmarketOS..."
heimdall flash \
@ -269,6 +278,19 @@
# only necessary if you wanna use `runScript = "zsh";` below
zsh
brotli
sdat2img
(writeShellScriptBin "init-repositories" ''
if [[ ! -d ".repos/lineageos" ]]; then
mkdir -p ".repos/lineageos"
pushd .repos/lineageos
repo init -u https://github.com/LineageOS/android.git -b lineage-22.1 --git-lfs --no-clone-bundle
repo sync
popd
fi
'')
];
multiPkgs = pkgs:
with pkgs; [
@ -280,16 +302,6 @@
libgcc # crtbeginS.o
iconv # ??? - i put this here and by the time i went back to remove unecessary packages i forgot why
iconv.dev # sys/types.h
(writeShellScriptBin "init-repositories" ''
if [[ ! -d ".repos/lineageos" ]]; then
mkdir -p ".repos/lineageos"
pushd .repos/lineageos
repo init -u https://github.com/LineageOS/android.git -b lineage-22.1 --git-lfs --no-clone-bundle
repo sync
popd
fi
'')
];
runScript = "zsh"; # personal preference, you could set this to bash instead if you want
profile = ''
@ -303,7 +315,11 @@
'';
};
in
fhs.env;
pkgs.stdenv.mkDerivation {
name = "lineageos-env-shell";
nativeBuildInputs = [fhs];
shellHook = "exec lineageos-env";
};
};
};
}