diff options
-rw-r--r-- | content/debian-stretch-debootstrap-replicant.rst | 2 | ||||
-rw-r--r-- | content/newer-kernel-galaxyS3.rst | 8 | ||||
-rw-r--r-- | content/u-boot-galaxyS3.rst | 12 |
3 files changed, 11 insertions, 11 deletions
diff --git a/content/debian-stretch-debootstrap-replicant.rst b/content/debian-stretch-debootstrap-replicant.rst index 3f07afc..d61b73d 100644 --- a/content/debian-stretch-debootstrap-replicant.rst +++ b/content/debian-stretch-debootstrap-replicant.rst @@ -57,7 +57,7 @@ Tell apt where it should get the source packages from: # echo "deb-src http://deb.debian.org/debian stretch main" >> /etc/apt/sources.list -Replacing ``deb.debian.org`` in your ``sources.list`` with a local mirror leads likely to a lot faster downloads and puts less load on the Debian servers. I'm in Germany so I have ``ftp.de.debian.org`` in my ``sources.list``. +Replacing ``deb.debian.org`` in your ``sources.list`` with a local mirror likely leads to a lot faster downloads and puts less load on the Debian servers. I'm in Germany so I have ``ftp.de.debian.org`` in my ``sources.list``. Then add the i386 architecture and update: diff --git a/content/newer-kernel-galaxyS3.rst b/content/newer-kernel-galaxyS3.rst index 435b998..a89ea03 100644 --- a/content/newer-kernel-galaxyS3.rst +++ b/content/newer-kernel-galaxyS3.rst @@ -1,14 +1,14 @@ :title: Problems getting a current kernel working on the Galaxy S3 and why merging is bad -:date: 2016-11-27 19:54 +:date: 2017-02-02 17:32 :tags: kernel, free software, sustainability, phone :category: General :author: Wolfgang Wiedmeyer -:status: draft +:status: published :summary: Some time ago, I started to wonder if it would be possible to update the old Linux kernel for the GT-I9300 variant (international version) of the Galaxy S3 to a more recent version. Some time ago, I started to wonder wheter it would be possible to update the old Linux kernel for the GT-I9300 variant (international version) of the Galaxy S3 to a more recent version. A newer kernel could not only bring new features and speed improvements, but also lots of security fixes that are not yet patched. Furthermore, porting a more recent Android version to the device would be much more easier. Making a newer kernel work with an older user space is much easier than making an old kernel work with a new user space. And isn't it the spirit of free software to be able to use the newest and shiny software on arbitrary hardware, regardless of its age? -But why Galaxy S3? Wouldn't it be better to take a more recent device that was already released with a newer kernel? I work on the Galaxy S3 because I use it as my daily driver and I have a spare device that I can use for development. Besides the Galaxy S2, it is still the best supported device by `Replicant <http://www.replicant.us/>`_ which was my original reason to start working with this phone. And especially in regards to the mainline kernel, it actually turns out to be a really good choice, but more about that in a `second post <{filename}/mainline-kernel-galaxyS3.rst>`_. +But why Galaxy S3? Wouldn't it be better to take a more recent device that was already released with a newer kernel? I work on the Galaxy S3 because I use it as my daily driver and I have a spare device that I can use for development. Besides the Galaxy S2, it is still the best supported device by `Replicant <http://www.replicant.us/>`_ which was my original reason to start working with this phone. And especially in regards to the mainline kernel, it actually turns out to be a really good choice, but more about that in another post. It's pretty easy, isn't it? ########################### @@ -33,4 +33,4 @@ There is another reason that makes merging with newer kernel releases very diffi Without the Git history, Git has a very hard time to resolve conflicts when merging and you end up with a huge amount of conflicts so that it's just too much work to go through all of them. This happened when I merged with the 3.2.x mainline kernel tree. `I was able to get a partial merge working <https://code.fossencdi.org/kernel_samsung_smdk4412.git/log/?h=migrate_3.2>`_. The end result is not maintainable because there is too much unmerged code and you end up in the middle between two kernel versions. Merging more recent kernel versions becomes even more harder and you will end up with numerous bugs that no one else has. `Dorimanx targeted the Galaxy S2 and he did partial merges up to Linux 3.14 <https://github.com/dorimanx/Dorimanx-SG2-I9100-Kernel>`_, but he stopped working on it in 2014. The Galaxy S2 (GT-I9100) uses the same kernel sources. -In the end, all of these efforts don't really bring a newer kernel to the device and we end up with an unmaintainable mess. The goal should be to have an easily maintainable kernel that makes future kernel updates possible. `In the second part <{filename}/mainline-kernel-galaxyS3.rst>`_, I will explain why going mainline is the only solution and how far I've got with getting the mainline kernel working. +In the end, all of these efforts don't really bring a newer kernel to the device and we end up with an unmaintainable mess. The goal should be to have an easily maintainable kernel that makes future kernel updates possible. In the next post, I will explain why going mainline is the only solution and how far I've got with getting the mainline kernel working. diff --git a/content/u-boot-galaxyS3.rst b/content/u-boot-galaxyS3.rst index 073ee38..16d45c4 100644 --- a/content/u-boot-galaxyS3.rst +++ b/content/u-boot-galaxyS3.rst @@ -1,12 +1,12 @@ :title: U-Boot for the Galaxy S3: an investigation -:date: 2016-11-26 21:19 +:date: 2017-02-02 17:31 :tags: bootloader, kernel, free software, phone :category: General :author: Wolfgang Wiedmeyer -:status: draft -:summary: The Galaxy S3 comes with a bootloader named S-Boot which is a proprietary bootloader from Samsung. In this post, I want to collect information about the possibilty to run the bootloader U-Boot on the phone. +:status: published +:summary: The Galaxy S3 comes with a bootloader named S-Boot which is a proprietary bootloader from Samsung. In this post, I want to collect information about the possibilty to run the free bootloader U-Boot on the phone. -The Galaxy S3 (GT-I9300) comes with a bootloader named S-Boot which is a proprietary bootloader from Samsung. In this post, I want to collect information about the possibilty to run the bootloader U-Boot on the phone. I personally didn't work on the bootloader part, but I became interested in it when `I tried to get the mainline kernel working and S-Boot prevented the mainline kernel from booting due to a bug <{filename}/mainline-kernel-galaxyS3.rst>`_. +The Galaxy S3 (GT-I9300) comes with a bootloader named S-Boot which is a proprietary bootloader from Samsung. In this post, I want to collect information about the possibilty to run the free bootloader U-Boot on the phone. I personally didn't work on the bootloader part, but I became interested in it when I tried to get the mainline kernel working and S-Boot prevented the mainline kernel from booting due to a bug. Benefits ######## @@ -18,7 +18,7 @@ A free bootloader would also make new security features like verified boot possi Is it possible? ############### -In 2013, Dominik Marszk and Adam Outler managed to boot U-Boot from the SD card. Their U-Boot source can be found `here <https://github.com/Rebell/exynos4_uboot>`_. The Galaxy S3 tries to boot from eMMC (internal memory) first and if that fails, it attempts to boot from other possible boot devices like the SD card. In order to force booting from SD card, Adam corrupted the data transfer between CPU and eMMC by attaching a thin wire to one of the data lines that shortens the data line. After U-Boot has booted, it enters a 10 second delay to allow to release the line shortening. At this point, it's possible to talk to the U-Boot command line via `UART <{filename}/mainline-kernel-galaxyS3.rst#uart>`_. +In 2013, Dominik Marszk and Adam Outler managed to boot U-Boot from the SD card. Their U-Boot source can be found `here <https://github.com/Rebell/exynos4_uboot>`_. The Galaxy S3 tries to boot from eMMC (internal memory) first and if that fails, it attempts to boot from other possible boot devices like the SD card. In order to force booting from SD card, Adam corrupted the data transfer between CPU and eMMC by attaching a thin wire to one of the data lines that shortens the data line. After U-Boot has booted, it enters a 10 second delay to allow to release the line shortening. At this point, it's possible to talk to the U-Boot command line via UART. `These <https://github.com/Rebell/exynos4_uboot/tree/master/sd_fuse>`_ are the files they used to create the SD card. They come from `ODROID-X <http://www.hardkernel.com/main/products/prdt_info.php?g_code=G133999328931>`_ bootloader sources which are based on Exynos4412, just like the Galaxy S3. The binary p4412_s_fwbl1.bin is especially interesting because it is a first stage bootloader that drops the secure boot process and jumps to an unsigned payload. This signed first stage bootloader also works on the Galaxy S3 because the same signing key is fused into all Exynos4412-based development boards and handhelds. @@ -28,7 +28,7 @@ The advantage of Dominik's and Adam's approach is the possibility to replace the There is some info floating around about a recovery procedure that boots from the SD card, but replaces the existing bootloader which resides in the bootloader partition on eMMC. `There are claims <http://forum.xda-developers.com/showpost.php?p=47234165&postcount=220>`_ that it's possible to trigger this process with more recent Galaxy S3 devices by pressing the menu key, both volume keys and the power key. Otherwise, it seems to be necessary to disassemble the device and shorten a very small resistor with a pair of tweezers, according to `leaked Samsung documents <https://smyl.es/samsung-galaxy-iii-s3-gt-i9300-jtag-leaked-document-how-to-repair-soft-bricked-galaxy-s3/>`_. This procedure could be an alternative to corrupting the data transfer between CPU and eMMC. -As part of `my work with the mainline kernel on the Galaxy S3 <{filename}/mainline-kernel-galaxyS3.rst>`_, I submitted a `bootloader-related patch that allows to reboot the device in the recovery and download mode <https://patchwork.kernel.org/patch/9345815/>`_. In the discussion about the patch with the kernel maintainer Krzysztof Kozlowski, it turned out that Trats2, which is the Galaxy S3 released for Tizen, is supported by U-Boot. However, S-Boot was not replaced. Instead, U-Boot gets chainloaded after booting a (probably) adapted S-Boot image. `Krzysztof's mail <http://www.spinics.net/lists/arm-kernel/msg534042.html>`_ provides more info how the Trats2 image could be installed. +As part of my work with the mainline kernel on the Galaxy S3, I submitted a `bootloader-related patch that allows to reboot the device in the recovery and download mode <https://patchwork.kernel.org/patch/9345815/>`_. In the discussion about the patch with the kernel maintainer Krzysztof Kozlowski, it turned out that Trats2, which is the Galaxy S3 released for Tizen, is supported by U-Boot. However, S-Boot was not replaced. Instead, U-Boot gets chainloaded after booting a (probably) adapted S-Boot image. `Krzysztof's mail <http://www.spinics.net/lists/arm-kernel/msg534042.html>`_ provides more info how the Trats2 image could be installed. Freedom-wise, chainloading U-Boot after S-Boot is not attractive as no non-free software is replaced. But having the Linux kernel loaded by U-Boot would make working on the mainline kernel easier because I don't have to figure out all the differences between U-Boot and S-Boot and patch the kernel. The only question in this regard is whether it's less work to stick with S-Boot and work around the differences or to get U-Boot for Trats2 working with a Galaxy S3 targeting Android and avoid having to patch the kernel. |