Skip to content

Commit

Permalink
disable kexec by default on poco f1 and oneplus6
Browse files Browse the repository at this point in the history
  • Loading branch information
Seshpenguin committed Nov 16, 2023
1 parent 06ae078 commit 175457d
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
9 changes: 8 additions & 1 deletion src-extra/image-gen/image-gen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ const mountPMOSImage = (targetDevice: string) => {

const buildTargetStandardPMOSDeviceImage = (targetDevice: string) => {
console.log(`Building ${targetDevice} image`);
let adevice = ACCEPTABLE_ANDROID_DEVICES.find((d) => d.name === targetDevice)

// Format and place files into rootfs
exec(`
sudo mkfs.ext4 /dev/disk/by-label/pmOS_root -F -L pmOS_root
Expand All @@ -49,6 +51,11 @@ const buildTargetStandardPMOSDeviceImage = (targetDevice: string) => {
sudo chown -R 1000:1000 ${BUILD_DIR}/pmos_root_mnt/data/home/user
sudo cp -v ${FILES_DIR}/prolinux.toml ${BUILD_DIR}/pmos_root_mnt/data/prolinux.toml
# TODO: the current situation on android is that kexec is broken
if [ "${adevice?.should_disable_kexec}" = true ]; then
echo "pl2.disable_kexec = true" >> ${BUILD_DIR}/pmos_root_mnt/data/prolinux.toml
fi
# pmos init checks this to see if root was mounted
sudo mkdir -pv ${BUILD_DIR}/pmos_root_mnt/usr
sudo umount /dev/disk/by-label/pmOS_root
Expand All @@ -61,7 +68,7 @@ const buildTargetStandardPMOSDeviceImage = (targetDevice: string) => {
sudo cp -v ${BUILD_DIR}/img-staging/${targetDevice}.img ${OUTPUT_DIR}
`);

let adevice = ACCEPTABLE_ANDROID_DEVICES.find((d) => d.name === targetDevice)

if(adevice) {
// Convert to Android sparse image
exec(`
Expand Down
6 changes: 4 additions & 2 deletions src/helpers/consts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,14 +30,16 @@ export const ACCEPTABLE_ANDROID_DEVICES = [
"rootfs_image_sector_size": 4096,
"squash_builtin": true,
"should_gunzip_vmlinuz": true,
"uses_zstd_initramfs": true
"uses_zstd_initramfs": true,
"should_disable_kexec": true
},
{
name: "oneplus-enchilada",
"rootfs_image_sector_size": 4096,
"squash_builtin": true,
"should_gunzip_vmlinuz": true,
"uses_zstd_initramfs": true
"uses_zstd_initramfs": true,
"should_disable_kexec": true
},
];

Expand Down

0 comments on commit 175457d

Please sign in to comment.