[NEWS] Linux 4.19 to natively support Samsung Galaxy S

Search This thread

devloz

Senior Member
May 3, 2013
585
465
OnePlus 8T
Those who read Phoronix might already know, but Olof Johansson from kernel.org is working on official support for Samsung Galaxy S smartphone.
Most probably, for XDA, they are a bit late to the party, but it still might be fun for tinkerers who'd want to run a Linux distro (any dev still here?).

Now, I'm not an owner/user of I9000 anymore (it was broken by a child I borrowed it to, just for 24h [driven over by bike - WTF], and lies in the closet, due to the sentiment - I've learned a lot of Linux stuff with this phone and I can't part with it), but I'm moved by the fact that there will be official support. This feels so awesome that I'm sad my old brick isn't working anymore ?

I can see the place isn't as lively as I remember, but if there any of you left, then best of luck playing with it ?

Source:
https://www.phoronix.com/scan.php?page=news_item&px=Samsung-Galaxy-S-DT-Linux-4.19
https://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc.git/commit/?h=for-next&id=85b40cf3a868361fed3122a503469f3be7a38b97

PS. Graphics device would still be a problem (SGX540, if I remember?). It's blobbed, so it sucks.
 
  • Like
Reactions: xc-racer99

MYEUHD

Member
Feb 28, 2017
41
27
Those who read Phoronix might already know, but Olof Johansson from kernel.org is working on official support for Samsung Galaxy S smartphone.
Most probably, for XDA, they are a bit late to the party, but it still might be fun for tinkerers who'd want to run a Linux distro (any dev still here?).

Now, I'm not an owner/user of I9000 anymore (it was broken by a child I borrowed it to, just for 24h [driven over by bike - WTF], and lies in the closet, due to the sentiment - I've learned a lot of Linux stuff with this phone and I can't part with it), but I'm moved by the fact that there will be official support. This feels so awesome that I'm sad my old brick isn't working anymore

I can see the place isn't as lively as I remember, but if there any of you left, then best of luck playing with it

Source:
https://www.phoronix.com/scan.php?page=news_item&px=Samsung-Galaxy-S-DT-Linux-4.19
https://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc.git/commit/?h=for-next&id=85b40cf3a868361fed3122a503469f3be7a38b97

PS. Graphics device would still be a problem (SGX540, if I remember?). It's blobbed, so it sucks.

Giving proper credits is very important.
Obviously, when you submit patches to the linux kernel, somebody (from the kernel's team) has to review them, and merge them if they look good.
That 'somebody' in this case is Olof Johansson. The process is called code-review.
The actual developers are PabloPL and @xc-racer99
source code: https://github.com/PabloPL/linux
further proof: https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/log/?qt=grep&q=paweł+chmiel
status: https://github.com/PabloPL/linux/wiki (this is slightly outdated, you can follow the github issues for current status)

P.S: Graphics won't be a problem as desktop environments like MATE and xfce work well even with software rendering.
 
Last edited:
  • Like
Reactions: xc-racer99

xc-racer99

Senior Member
Aug 28, 2013
667
1,063
Thanks for putting this up here, it's possible someone else might notice and help out :) There's also an associated u-boot port at https://github.com/xc-racer99/u-boot-galaxys4g/wiki

If anyone is interested, I can give instructions on how to boot a basic Debian or Arch Linux installation.

Yep, that's correct that the SGX 540 is blobbed. There's an in-kernel driver, but it's mostly a shim for the proprietary blob which implements the windowing system (surfaceflinger for Android, X for Linux). It would probably be possible to re-used the Pandaboard X window system blobs, but 3D acceleration is a ways off.
 
  • Like
Reactions: 0aa and MYEUHD

xc-racer99

Senior Member
Aug 28, 2013
667
1,063
Yes, please. That would be very useful!

Alright, here goes. This is assuming you have all data backed up to somewhere safe.

1) Clone the u-boot port from https://github.com/xc-racer99/u-boot-galaxys4g/ - the v2018.05-aries branch is probably best
Code:
git clone https://github.com/xc-racer99/u-boot-galaxys4g -b v2018.05-aries
cd u-boot-galaxys4g
2) Build u-boot:
Code:
export ARCH=arm CROSS_COMPILE=/path/to/arm/cc
make s5p_aries_defconfig
make -j6
3) The resulting u-boot.bin is the u-boot file to flash:
Code:
heimdall flash --KERNEL u-boot.bin
4) Clone the linux kernel. You can use a variety of branches - linus' branch (aka v4.19 stable), any of the ones from https://github.com/PabloPL/linux/branches - note that I recommend the for-upstream/aries-patches-v2 branch as a base and cherry-pick the commits from the other branches for peripherals you want to use
Code:
git clone https://github.com/PabloPL/linux -b for-upstream/aries-patches-v2
cd linux
5) Build linux. First, make sure that the correct debug uart is defined in the defconfig
Code:
sed -i -- 's/CONFIG_DEBUG_S3C_UART1/CONFIG_DEBUG_S3C_UART2/g' arch/arm/configs/s5pv210_defconfig
export ARCH=arm CROSS_COMPILE=/path/to/arm/cc
make s5pv210_defconfig
make
6) Create the u-boot uImage. Replace fascinate4g.dtb with galaxys.dtb if not using an SGH-T959V/SGH-T959W/SGH-T959P. Note that if not using the i9000 or one of the above models, there could be some minor incompatabilities.
Code:
cat arch/arm/boot/zImage arch/arm/boot/dts/s5pv210-fascinate4g.dtb > zImage-dtb
mkimage -A arm -T kernel -a 30008000 -e 30008000 -O linux -d zImage-dtb -C none uImage
7) Flash the u-boot boot image. This could also be placed in a different place that u-boot knows how to boot from (mmc partition 1/2, sd card partition 1/2)
Code:
heimdall flash --RECOVERY uImage


---------- Post added at 09:45 AM ---------- Previous post was at 09:26 AM ----------

Installing a Linux distro
1) Format the first partition on your SD card as a Linux-compatible filesystem (eg ext4)
2) Arch Linux
a) Download the ARMv7 multi-platform zip from https://archlinuxarm.org/about/downloads
b) Extract the ArchLinuxARM-armv7-latest.tar.gz to the first partition on your SD card
3) Debian
a) From a Debian host, install debootstrap and qemu-arm-static
Code:
# apt install qemu-arm-static debootstrap
b) Bootstrap the system
Code:
# mkdir debian_armhf_stretch
# qemu-debootstrap --arch armhf stretch debian_armhf_stretch http://deb.debian.org/debian/
c) Enter the chroot and configure it
Code:
# chroot debian_armhf_stretch
i) Set password
Code:
passwd <your new password for user root here>
ii) Install any desired packages, eg xfce4
Code:
apt install xfce4
d) Exit the chroot
Code:
exit
e) Copy the contents of debian_armhf_stretch to your SD card. Alternatively, you could have run qemu-debootstrap to setup directly on the SD card
4) Stick your SD card into your phone and boot!

Arch Linux is a minimal, non-GUI install while Debian can be customized as desired. I personally use Debian. Note that if using some things such as wifi or bluetooth, you may need some firmware and/or some of the kernel modules to be copied to their required places.

Update
The aries-patches-v2 branch doesn't have the touchscreen enabled. You'll need to merge the commits from https://github.com/PabloPL/linux/commits/for-upstream/atmel-mxt-fixes
You'll also probably want to follow the instructions in the answers in https://askubuntu.com/questions/369621/how-to-get-the-onscreen-keybord-appear-on-login to install an on-screen keyboard. Make sure when you're running the commands that you're in the debian chroot.
 
Last edited:
  • Like
Reactions: MYEUHD

laharl_22

Senior Member
Jan 23, 2011
247
19
Wich dependancies is required for building with ubuntu? The command make -j6 give me 2 errors
 

xc-racer99

Senior Member
Aug 28, 2013
667
1,063
Do I need a serial console to enter the password and login?
Edit: I disabled the password login by following https://superuser.com/questions/969923/automatic-root-login-in-debian-8-0-console-only#970013
But still, debian doesn't boot to xfce4.
Shouldn't need a serial console to login, although that's how I've been doing it lately. What's the last screen you see? Is it flashing a few different ones (I think this was just when DMA was enabled, I need to check when I get the chance though) or just stuck at the lightdm screen? Come to think of it, the aries-patches-v2 branch doesn't have the touchscreen enabled, so you'll need to manually merge the patches from the branch https://github.com/PabloPL/linux/commits/for-upstream/atmel-mxt-fixes and then you'll need to enable the on-screen keyboard based on the answers in https://askubuntu.com/questions/369621/how-to-get-the-onscreen-keybord-appear-on-login

Wich dependancies is required for building with ubuntu? The command make -j6 give me 2 errors
You should just need an ARM cross compiler (eg gcc-6-arm-linux-gnueabihf-base) and possibly build-essential. U-Boot does need a relatively new cross compiler IIRC so the Android GCC 4.8/4.9 based ones probably don't work.
 
  • Like
Reactions: MYEUHD

laharl_22

Senior Member
Jan 23, 2011
247
19
Exactly the sames errors after installing the libs im on ubuntu 18.04 lts amd64 the error text
scripts/kconfig/conf --silentoldconfig Kconfig
CHK include/config.h
CFG u-boot.cfg
GEN include/autoconf.mk.dep
GEN include/autoconf.mk
CHK include/config/uboot.release
CHK include/generated/timestamp_autogenerated.h
UPD include/generated/timestamp_autogenerated.h
CHK include/config.h
CFG u-boot.cfg
CHK include/generated/version_autogenerated.h
CC lib/asm-offsets.s
CC arch/arm/lib/asm-offsets.s
cc1: error: bad value (‘armv5’) for ‘-march=’ switch
cc1: note: valid arguments to ‘-march=’ switch are: nocona core2 nehalem corei7 westmere sandybridge corei7-avx ivybridge core-avx-i haswell core-avx2 broadwell skylake skylake-avx512 bonnell atom silvermont slm knl x86-64 eden-x2 nano nano-1000 nano-2000 nano-3000 nano-x2 eden-x4 nano-x4 k8 k8-sse3 opteron opteron-sse

---------- Post added at 07:37 PM ---------- Previous post was at 06:44 PM ----------

how to fix the bad value please ?

---------- Post added at 08:18 PM ---------- Previous post was at 07:37 PM ----------

anyone can compile tested with 3 version of cross compiler always the sames error
 
Last edited:

xc-racer99

Senior Member
Aug 28, 2013
667
1,063
Exactly the sames errors after installing the libs im on ubuntu 18.04 lts amd64 the error text
scripts/kconfig/conf --silentoldconfig Kconfig
CHK include/config.h
CFG u-boot.cfg
GEN include/autoconf.mk.dep
GEN include/autoconf.mk
CHK include/config/uboot.release
CHK include/generated/timestamp_autogenerated.h
UPD include/generated/timestamp_autogenerated.h
CHK include/config.h
CFG u-boot.cfg
CHK include/generated/version_autogenerated.h
CC lib/asm-offsets.s
CC arch/arm/lib/asm-offsets.s
cc1: error: bad value (‘armv5’) for ‘-march=’ switch
cc1: note: valid arguments to ‘-march=’ switch are: nocona core2 nehalem corei7 westmere sandybridge corei7-avx ivybridge core-avx-i haswell core-avx2 broadwell skylake skylake-avx512 bonnell atom silvermont slm knl x86-64 eden-x2 nano nano-1000 nano-2000 nano-3000 nano-x2 eden-x4 nano-x4 k8 k8-sse3 opteron opteron-sse

---------- Post added at 07:37 PM ---------- Previous post was at 06:44 PM ----------

how to fix the bad value please ?

---------- Post added at 08:18 PM ---------- Previous post was at 07:37 PM ----------

anyone can compile tested with 3 version of cross compiler always the sames error

Doesn't look like you've properly setup the cross compiler. Have you run
Code:
export ARCH=arm CROSS_COMPILE=</path/to/cc>
where </path/to/cc> is the arm cross compiler toolchain? Note that in my case (Debian Stretch) that is /usr/bin/arm-linux-gnueabi- note that arm-linux-gnueabi- part (including the dash) are required, so the actual gcc path would be /usr/bin/arm-linux-gnueabi-gcc
The error you're getting shows you're trying to use a x86 toolchain to build for an ARM machine.
 
  • Like
Reactions: laharl_22

MYEUHD

Member
Feb 28, 2017
41
27
Shouldn't need a serial console to login, although that's how I've been doing it lately. What's the last screen you see? Is it flashing a few different ones (I think this was just when DMA was enabled, I need to check when I get the chance though) or just stuck at the lightdm screen? Come to think of it, the aries-patches-v2 branch doesn't have the touchscreen enabled, so you'll need to manually merge the patches from the branch https://github.com/PabloPL/linux/commits/for-upstream/atmel-mxt-fixes and then you'll need to enable the on-screen keyboard based on the answers in https://askubuntu.com/questions/369621/how-to-get-the-onscreen-keybord-appear-on-login.

Lightdm wasn't even showing up, all I got was the same non-GUI login that you'd find in Arch.
Surprisingly, when I set autologin-guest to true in lightdm's configuration, it shows up and I can type my username and password to enter xfce4 (using on-screen keyboard).
Thank you for the instructions!
Edit: I just disabled autologin-guest to confirm the issue. Yet, lightdm showed up.
Very wierd...

Edit2: Check the following post for the solution.
 
Last edited:

MYEUHD

Member
Feb 28, 2017
41
27
If someone is having issues with Lightdm e.g getting a non-GUI login screen, or the phone looping between a black screen (~3s) and u-boot's graphical menu(~0.5s) instead of showing Lightdm,
type the following in the Debian chroot:
Code:
dpkg-reconfigure lightdm
 
  • Like
Reactions: xc-racer99

PabloPL

Senior Member
May 27, 2008
103
69
About touchscreen patches
It turns out that those patches (from for-upstream/atmel-mxt-fixes) are not needed to enable touchscreen on Aries phones.
Just look here https://github.com/PabloPL/linux/co...7ff#diff-a55548a61205e9ebe52d79c1251eb46cR361

So like @xc-racer99 said, the best will be to use for-upstream/aries-patches-v2 branch

About compilation problems:
You can try to take toolchain from https://releases.linaro.org/components/toolchain/binaries/latest/arm-linux-gnueabihf/ (i'm using it during development on my ubuntu 16.04).
 
Last edited:

laharl_22

Senior Member
Jan 23, 2011
247
19
anyone have the compiled files please?i have tested all i have command not found on cross compiler
 

xc-racer99

Senior Member
Aug 28, 2013
667
1,063
anyone have the compiled files please?i have tested all i have command not found on cross compiler
Frankly, and with no offense meant, the state of the project is such that if you are unable to compile it on your own, then you probably shouldn't be running it as the potential for messing up your device and hard-bricking it is relatively high (ie I screwed up once and had to apply the unbrickable mod on my device to save it). As well, it's only really useful right now as a development project for someone with time on their hands :)

If it ever gets to point where it becomes usable, precompiled binaries with instructions on how to flash them will be provided. Don't hold your breath on getting to this point soon (or maybe even ever...)
 
  • Like
Reactions: laharl_22

Top Liked Posts