• Introducing XDA Computing: Discussion zones for Hardware, Software, and more!    Check it out!
  • Fill out your device list and let everyone know which phones you have!    Edit Your Device Inventory

[Linux] Porting native Linux to Galaxy Note9

Search This thread

stdog21

Member
Jun 1, 2010
26
2
Hello.Is there is any project like this one for S9 Exynos version? And if not, can u tell me how to compile linux kernel or atleast short guide with info how to bypass typical bugs, troubles maybe to make it easier and faster for me to get it work.Thanks
 

-W_O_L_F-

Senior Member
Jul 10, 2010
1,029
936
Moscow
Hello.Is there is any project like this one for S9 Exynos version? And if not, can u tell me how to compile linux kernel or atleast short guide with info how to bypass typical bugs, troubles maybe to make it easier and faster for me to get it work.Thanks

My work is based on Exynos Linux Stable kernel which is also available for S9. You can easily take look at my changes with this link: https://github.com/LONELY-WOLF/crownlte-linux-os/commits?author=LONELY-WOLF
S9 kernel should be similar to Note9. IMHO it's not a big deal to port my work to S9 :)
 

Rukarn

New member
Aug 23, 2015
4
0
I am also getting bootloop. I flashed the kernel as recovery and have formatted the parititions as described. I have redone the ext2 partition multiple times. I have about a 40GB fat32 partition, then a 1 MB raw, then about a 200 GB ext2 partition.
 

SirSoviet

Senior Member
Sep 1, 2015
573
286
Toronto
Wow, this is absolutely amazing! I'll try applying your changes to exynos-linux-stable/dreamlte, and see if I can bring this to the Galaxy S8. From what I've seen so far, all of your changes can be applied to the S8 kernel, but whether it'll work is a different story.
 

lucahack

Senior Member
Oct 26, 2015
50
18
This thread is about starting native Linux on Samsung Galaxy Note9. This isn't my first attempt to do such thing. The history looks like Galaxy Spica -> Galaxy J1 (2016) -> Galaxy Note9. So I know what I'm doing :D

Later I'll post instructions how to install and run it.
Note9 isn't my main device, so I won't work on dualboot. If some wants to make it, feel free to build dualboot (kexec) recovery and post it here.

Source code.
Kernel: https://github.com/LONELY-WOLF/crownlte-linux-os
Hey!
Could I insert a 1To class 10 micro-sdcard and install android on it? That'd be a pretty cool project!
 

sulimanp

Member
Apr 8, 2020
5
0
i got bootloop …………
this is my SD card partitions
m
 

Drupall

New member
Jun 24, 2020
2
0
For WIFI i just disabled CONFIG_ANDROID_PARANOID_NETWORK in .config and copy /vendor folder to / of linux.
And to make OTG work i must disable "disable U1/U2 state"
Last thing i need is how to enable HDMI port on DEX pad and enable sound, loading sound firmware make system very unstable.

This is not enough. May be linuxdeploy does something.



Take a look at this project: https://forum.xda-developers.com/showthread.php?t=2070139

I think this is DisplayPort Alt Mode :D : https://en.everybodywiki.com/List_of_devices_with_video_output_over_USB-C (https://cateee.net/lkddb/web-lkddb/TYPEC_DP_ALTMODE.html)
It support in kernel 4.19.x :laugh: : https://www.phoronix.com/scan.php?page=news_item&px=Type-C-DP-Alt-Mode-Linux-4.19
So, you can get Farovitus's commit :silly: : https://github.com/exynos-linux-stable/starlte/commits?author=farovitus (https://stackoverflow.com/questions...h-upstream-and-re-applying-downstream-changes)
Then apply to kernel 4.19.x :p : https://android.googlesource.com/kernel/common/+/refs/tags/ASB-2020-06-05_4.19-stable (https://android.googlesource.com/kernel/common/)
And update with your patch :fingers-crossed: : https://github.com/LONELY-WOLF/crownlte-linux-os
Goodluck! Likes this :highfive: : https://www.youtube.com/watch?v=yBeza4UNOm8
 
Last edited:

Top Liked Posts

  • There are no posts matching your filters.
  • 12
    This thread is about starting native Linux on Samsung Galaxy Note9. This isn't my first attempt to do such thing. The history looks like Galaxy Spica -> Galaxy J1 (2016) -> Galaxy Note9. So I know what I'm doing :D

    Later I'll post instructions how to install and run it.
    Note9 isn't my main device, so I won't work on dualboot. If some wants to make it, feel free to build dualboot (kexec) recovery and post it here.

    Source code.
    Kernel: https://github.com/LONELY-WOLF/crownlte-linux-os
    9
    First success

    So, here is a first result.

    With minor modifications to DECON (framebuffer) my Note9 is able to run Arch Linux form SD card.
    So far it has no serial or USB console. I can't find a way to make UART JIG for Type-C Samsungs. USB gadgets are hardcoded and can't be easy changed to CDC ACM. This is not good and makes development harder.
    Arch Linux says it started GUI but I don't know what happened to Xorg. It can be on back buffer or on another display (since Note9 has it via Type-C).
    8
    Work report:
    • FS on SD got corrupted and I replaced Arch Linux with openSUSE.
    • Started GNOME Shell on Note9.
    • Added firmware. Some drivers find their firmware files, others don't.
    • Can't see any signs of Wi-Fi driver. Looks like it silently fails to start.

    Problems:
    • 3K display is too big even for a such fast CPU as Exynos 9810. Interface isn't smooth.
    • Some drivers can't find their firmware even if it's present.
    • Wacom driver needs to be adopted for Xorg.
    • Xorg colors look swapped. But fbcon is ok.

    Further tasks:
    • Start Wi-Fi.
    • Get on-screen keyboard. There IS on-screen keyboard on login screen but not in GNOME.
    • Fix Xorg colors.
    • Find a way to get HW graphics acceleration. It can be done by G2D or Mali (3D). G2D is available for Exynos 5422. I think it needs modifications to work on another SoC. I also used Mali (OpenCL) on 5422, but I don't know if Xorg can use OpenGL ES or OpenCL for acceleration.

    Finally I have a screenshot for you, guys!
    7
    Wifi is working! Wonder how @Sisah managed to get it to work. I've disabled deferred initcalls but his config has this option enabled. Looks like this feature was ported from older kernels by Samsung. But they didn't ported flag inside /proc. Don't know how Android makes those initcalls :eek:

    Now it's time for keyboard
    4
    Release

    Ok, it's time to release something to public.

    What do I get after installation?
    You will get OpenSUSE linux running on your Note9. Any software from repo will be available.

    What hardware works?
    Minimal set of devices work. Display, touch, SD, Wi-Fi and S-Pen (as mouse). Plus, you have virtual COM (with console) on USB. RNDIS on USB can be enabled.

    What do I lose?
    Either kernel or recovery. Everything else remains untouched.

    How to install?
    1. First of all you need to repartition your SD card. THIS CAN DESTROY ALL YOUR DATA ON SD! DO BACKUP! You need 3 partitions. First is your SD for Android in FAT32 or exFAT format. Second one can be 1MB and RAW. It was made for Apps2SD, but I have no idea if anyone still needs it. And third partition is for linux. It's ext2 and at least 5GB in size. Don't make it too small or you risk to do everything once more.
    2. Download rootfs. I use openSUSE-Tumbleweed-ARM-GNOME.aarch64-rootfs.aarch64-2019.09.04-Snapshot20190907.tar.xz from here: http://download.opensuse.org/ports/aarch64/tumbleweed/images/ . You can choose another DE but remember to download image in tar.xz format!
    3. Download attachment to this post. It contains rootfs diff and kernel.
    4. Extract rootfs and diff to third partition of SD card. ROOT privileges needed!
    5. Now you need to copy /vendor directory from your phone to 3rd SD partition. Can be done from Android if you have root. Can be done inside TWRP (don't forget to manually mount SD in terminal). I think you can even extract vendor contents from official ROM.
    6. Flash kernel as kernel or recovery. It should work in both cases. I flash it with Heimdall tool. Like this:
      Code:
      heimdall flash --BOOT image-new.img
    7. That's all! You have linux installed now. Enjoy :)

    Cheats:
    If you flash Linux kernel as kernel do backup of your Android kernel first. In this case you can easily return to Android. If you flash kernel as recovery you get dualboot but lose TWRP.
    I've added 2 additional scripts to root's home dir. One for fixing Wi-Fi and another to configure USB network settings. USB network is disabled by default.
    Uncomment those lines
    Code:
    #mkdir functions/rndis.usb0 # use default parameters
    #ln -s functions/rndis.usb0 configs/c.1
    in /etc/rc.local script and reboot to activate it.
    S-Pen button does right click :)
    You can connect via USB console with minicom:
    Code:
    minicom -o -D /dev/ttyACM0 -b 115200 -c on -a on -t linux
    Default login for OpenSUSE is root with password linux.
    In case you have network connection but no internet add DNS:
    Code:
    echo nameserver 8.8.8.8 >> /etc/resolv.conf