Giter Club home page Giter Club logo

edk2-msm8x26-lumia's Introduction

Lumia830Pkg

All this assumes you already have unlocked your bootloader and know how to switch between different modes as well as have some sort of un-bricking method if things go wrong. For RM-1073, check my GitHub Lumia640 Unbrick repo: https://github.com/WolfLink115/Lumia-640-RM-1073_Unbrick

Not Working

  • At the moment this is unknown

Working

  • Boots to EDK2 shell
  • Linux boots if you use the linux port by Dominduchami

How to Compile

Download EDK2:

git clone https://github.com/tianocore/edk2 --recursive
git clone https://github.com/tianocore/edk2-platforms
git clone https://github.com/WolfLink115/edk2-msm8x26-lumia

Install dependencies:

For Ubuntu/Debian-based systems

sudo apt install build-essential uuid-dev iasl git gcc-5 nasm python3-distutils

To Build EDK2 just run this in the Linux terminal:

mkdir workspace
./build.sh

How to Install (Windows Needed)

  1. Compile Lumia830Pkg & Copy emmc_appsboot.mbn to EFIESP partition
  2. Download compiled BootShim and BootShim Patcher from releases page:
  3. Copy Stage2.efi to EFIESP partition
  4. Rename resetphone.efi to resetphone.efi.bak and move it somewhere to your computer
  5. Copy resetphone.efi to MainOS:\EFIESP\Windows\System32\Boot
  6. Add "NoIntegrityChecks" to "Reset Phone Application" entry in BCD of your phone:
    • Open Command Prompt as admin, enter the letter for MainOS partition followed by a colon (ex. E:) and run:
    cd EFIESP\efi\Microsoft\boot
    bcdedit /store .\BCD /enum ALL
    • Look for the Reset Phone Application section and copy the UUID for it (UUID ex. {xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx}). Then run:
    bcdedit /store .\BCD /set <"{UUID-for-ResetPhoneApplication}"> "nointegritychecks" yes
  7. Enable DisplayBootMenu in BCD
    bcdedit /store .\BCD /set "{bootmgr}" "nointegritychecks" yes
    bcdedit /store .\BCD /set "{bootmgr}" "testsigning" Yes
    bcdedit /store .\BCD /set "{bootmgr}" "timeout" 5
    bcdedit /store .\BCD /set "{bootmgr}" "displaybootmenu" Yes
    
  8. Reboot Phone
  9. At the BootMenu press vol down to boot EDK2

How to boot Linux from eMMC on Lumia 640

Linux only (WSL untested):

  1. Open Terminal and install GParted.

    sudo apt install gparted
    
  2. Plug your Lumia in Mass Storage Mode into your computer and open GParted.

    Switch to your Lumia's eMMC in gparted and delete the MainOS and DATA partitions (Partition number varies between devices).

    Create a new ext4 partition from the remaining space, name label it MainOS.

  3. Run these in terminal, being sure to replace with your preferred username:

    sudo mkdir /mnt/root
    sudo mount </path/to/MainOS> /mnt/root
    sudo debootstrap --arch=armhf <distro> /mnt/root
    
    - To install desktop environment:
    sudo chroot /mnt/root
    apt update
    apt install xfce4 -y
    
    - To setup user profile
    adduser <username>
    usermod -aG sudo <username>
    
    - To setup autologin
    nano /etc/lightdm/lightdm.conf
    
    - Add in "[Seat:*]" section:
    pam-service=lightdm
    pam-autologin-service=lightdm-autologin
    autologin-user=<username>
    autologin-user-timeout=0
    session-wrapper=/etc/X11/Xsession
    Greeter-session=lightdm-greeter
    
    - Press CTRL + X then Y and Enter
    
    - Finishing up, type:
    exit
    umount /mnt/root
    exit
    
  4. To set up Linux kernel Copy the zImage, lumia.dtb, and initramfs-linux.img from https://github.com/WolfLink115/linux/releases/tag/v1-alpha to the root of the EFIESP partition.

  5. To set up startup.nsh, being sure to replace <mmcblk0p*> with your MainOS partition:

    cat <<EOF > startup.nsh
    zImage dtb=lumia.dtb video=efifb earlycon=efifb root=/dev/<mmcblk0p*> PMOS_NO_OUTPUT_REDIRECT
    EOF
    
  6. Reboot and hold volume down to boot Linux

Credits!

  1. Imbushuo for BootShim (https://github.com/imbushuo/boot-shim)
  2. Linus Torvalds for Linux kernel (https://github.com/torvalds/linux)
  3. Tianocore for EDK2 sources (https://github.com/tianocore/edk2)
  4. Konrad Dybcio for writing a porting guide (https://github.com/konradybcio/Lumia-EDK2-Guide)
  5. Dominduchami for modified Lumia 830 EDK2 (https://github.com/Dominduchami/Lumia830Pkg)
  6. Ivaylo Ivanov for his initramfs-linux.img (https://github.com/ivoszbg)
  7. Empyreal96 for Lumia 950XL debootstrap install guide (https://github.com/empyreal96)
  8. Aljoshua Hell for introducing me to debootstrap (https://github.com/J0SH1X)
  9. postmarketOS team for envkernel.sh script (https://gitlab.com/postmarketOS/pmbootstrap/-/blob/master/helpers/envkernel.sh)
  10. Anyone else I may be missing.

edk2-msm8x26-lumia's People

Contributors

wolflink115 avatar 1maxnet1 avatar exkc avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.