Changes

Jump to navigation Jump to search
no edit summary
{{Infobox device
| manufacturer = Sony
| name = Xperia L
| codename = sony-taoshan
| image = File:Sony-Taoshan.jpg
| imagecaption = CHANGE_MEReplacement image
| releaseyear = 2013
| originalsoftware = 4.1.2/4.2.2
| chipset = Qualcomm MSM8230 Snapdragon S4 Plus MSM823
| cpu = 1 GHz Dual-Core Krait
| gpu = Adreno 305
| memory = 1 GiB
| architecture = armhf
| status_usbnet = PY
| status_flashing = Y
| status_touch = P| status_screen = P
| status_wifi =
| status_xwayland =
| status_sms =
| status_calls =
| status = Screen stays blackKernel builds, but telnet connections are possible (with after flashing it doesn't boot, doesn'debug-shell'' activated).t vibrate/blink with maximum_attention hook
| booting = yes
}}
== Maintainer(s) ==
<!-- Only if this device doesn't run on linux-postmarketos yet! -->
<!-- This person needs to be willing to answer questions from users of this device -->
* [[User:Halamix2|Halamix2]]
* [[User:Powimod|Powimod]]
 
== Users owning this device ==
{{Device owners}}
== What works ==
* After pressing the power on button, nothing seems to happen (black screen, led off, no vibrations), but it's possible to do a telnet connection (with the debug-shell hook activated). Device boots == What does not work ==* Weston works* EverythingSSH connections are possible.
== How to enter flash mode ==
== Current work ==
=== Kernel compilation === The kernel used comes from Lineage OS. The kernel version is '''3.4.0'''. The ''android_device_sony_taoshan'' github repository contains a file named ''lineage.dependencies'' witch indicates the name of the kernel used : ''android_kernel_sony_msm8930''. * [https://github.com/LineageOS/android_device_sony_taoshan XPeria L Github repository]* [https://github.com/LineageOS/android_kernel_sony_msm8930 kernel Github repository]* [Sony_Xperia_L_https://raw.githubusercontent.com/LineageOS/android_kernel_sony_msm8930/cm-14.1/arch/arm/configs/taoshan_defconfig Taoshan kernel configuration file on msm8930 Github repository] To satisfy pmbootstrap kernel config checking : * disable ''CONFIG_ANDROID_PARANOID_NETWORK'' option* enable ''CONFIG_DEVTMPFS'' option* enable ''CONFIG_SYSVIPC'' option The patch [[https://github.com/postmarketOS/pmbootstrap/blob/master/aports/device/linux-lg-mako/02_gpu-msm-fix-gcc5-compile.patch gpu-msm-fix-gcc5-compile.patch]] is necessary to fix the following error : ''undefined reference to kgsl_iommu_sync_lock''. The screen resolution must be updated in the <code>device-sony-taoshan/deviceinfo</code> file : <pre>deviceinfo_screen_width="854"deviceinfo_screen_height="480"</pre> ==== XZ compression error ==== By default, the kernel compilation (<code>pmbootstrap build linux-sony-taoshan</code>) fails with the following error in the log : <pre> AS arch/arm/boot/compressed/ashldi3.o/home/pmos/build/src/android_kernel_sony_msm8930-df6292bc628cece5925d0f67fbc8c8a2cab2d524/scripts/xz_wrap.sh: exec: line 23: xz: not foundmake[2]: *** [/home/pmos/build/src/android_kernel_sony_msm8930-df6292bc628cece5925d0f67fbc8c8a2cab2d524/arch/arm/boot/compressed/Makefile:190: arch/arm/boot/compressed/piggy.xzkern] Error 1make[2]: *** Waiting for unfinished jobs....make[1]: *** [/home/pmos/build/src/android_kernel_sony_msm8930-df6292bc628cece5925d0f67fbc8c8a2cab2d524/arch/arm/boot/Makefile:52: arch/arm/boot/compressed/vmlinux] Error 2make: *** [/home/pmos/build/src/android_kernel_sony_msm8930-df6292bc628cece5925d0f67fbc8c8a2cab2d524/arch/arm/Makefile:292: zImage] Error 2>>> ERROR: linux-sony-taoshan: build failed</pre> '''Explanation :''' The kernel compilation needs the '''xz''' utility to build the kernel because the original taoshan kernel configuration file (from Lineage OS)has the <code>CONFIG_KERNEL_XZ</code> option enabled and ''pmbootstrap'' did not install this utility when installing the Alpine OS base. The first solution is to add ''xz'' in the <code>makedepends</code> directive of the <code>linux-sony-taoshan/APKBUILD</code> file : <pre> makedepends="perl sed installkernel bash gmp-dev bc linux-headers elfutils-dev devicepkg-dev xz" </pre>Then you must clear all caches with <code>pmboostrap zap</code> and restart a new compilation. The second solution is to choose another compression mode. To do that, run <code>pmbootstrap kconfig edit sony-taoshan</code>, go in the menu "'''General setup'''" and select ''GZIP'' for the "'''Kernel compression mode'''" option. With this two methods, the kernel compilation is successfull, but the phone does not boot... ==== ARM_UNWIND support ==== To avoid "'''ftrace.h:51: multiple definition of `return_address''''" errors, it's necessary to disable the stack unwinding support : To do that, run <code>pmbootstrap kconfig edit sony-taoshan</code>, go in the menu "'''Kernel hacking'''" and uncheck the "'''Enable stack unwinding support '''" option. === Unpacking boot.img and non-standard warning === The Juisma's unmkbootimg utility prints a warning message indicating that the '''OFF_RAMDISK_ADDR''' is non-standard : <pre>Boot = boot.imgunmkbootimg version 1.2 - Mikael Q Kuisma <kuisma@ping.se>Kernel size 5847800Kernel address 0x80208000Ramdisk size 7421021Ramdisk address 0x82200000Secondary size 0Secondary address 0x81100000Kernel tags address 0x80200100Flash page size 2048Board name is ""Command line "console=ttyHSL0,115200,n8 androidboot.hardware=qcom androidboot.bootdevice=msm_sdcc.1 user_debug=31 msm_rtb.filter=0x3F ehci-hcd.park=3 maxcpus=2 buildvariant=userdebug" *** WARNING ****This image is built using NON-standard mkbootimg!OFF_RAMDISK_ADDR is 0x02000000Please modify mkbootimg.c using the above values to build your image.**************** Extracting kernel to file zImage ...Extracting root filesystem to file initramfs.cpio.gz ...All done.---------------sourceTo recompile this image, use: mkbootimg --kernel zImage --ramdisk initramfs.cpio.gz --base 0x80200000 --cmdline 'console=ttyHSL0,115200,n8 androidboot.hardware=qcom androidboot.bootdevice=msm_sdcc.1 user_debug=31 msm_rtb.filter=0x3F ehci-hcd.park=3 maxcpus=2 buildvariant=userdebug' -o new_boot.img---------------24525 blocks</pre> The [http://whiteboard.ping.se/Android/Unmkbootimg Kuisma's unmkbootimg utility home page] was not modified since 2015-12-07 : it seems to be out of date... And there is no way to download the source code to investigate...  As this warning is shown for both files (pmboostrap and Lineage), I think it can be ignored safely :  Lineage :<pre>$ unzip ~/postmarket/taoshan/lineage-14.1-20180909-nightly-taoshan-signed.zip boot.img$ mv boot.img boot.img.lineage$ ./unmkbootimg boot.img.pmbootstrap | grep NONThis image is built using NON-standard mkbootimg!</pre> PmBootStrap :<pre>$ cp /home/dom/.local/var/pmbootstrap/chroot_rootfs_sony-taoshan/boot/boot.img-sony-taoshan boot.img.pmbootstrap$ ./unmkbootimg boot.img.lineage | grep NONThis image is built using NON-standard mkbootimg!</pre> == Motherboard == [[File:Taoshan_motherboard_sa77GA341.JPG|thumb|left|SA77_GA-341 motherboard]] The reference of the motherboard is ''''sa77_GA-341'''' ==== Serial connector ====[[File:Taoshan_motherboard_pinout.png|thumb|SA77_GA-341 pinout]]Presently, we have no idea where the UART pins (TX, RX and ground) are located. Maybe at the top left, under the 'D' letter... Light blue is voltage when the phone is powered on. Measured voltage on pin marked "strange" is weird:* when voltmeter test leads touch this pad and ground (shield in my case) it shows varying 1.6V - 1.7V* when measuring after boot OR taking voltmeter leads from the pad and touching it again it shows 0.0V Small pad on bottom between ground and BATT_MID is 1.8V: after connecting it to TX and right after inserting the battery it sends similar string:{{note| Occasional 9 may be caused by transmission error, I was holding wires in hand}}<pre>(8888888988998898888888888888888888888988898898888898888888888898888888889888889888988888888888888988988889888888888888988988888889888888988888988888989888888898888888989888988888988898888888888888888B (8888888888988889888888898988888988888888888898888888889888888888898899888888889888888888888888988888888889898889888889888888988889988889889888888888898898988888888888888889889888988888888988888888988B(8988989888988888888888888898888898888888889988888988898888888888888889989888888988888998888898889889898988988888888898888888889888898888888888888988888888888888888888888888888888988888888888888889888B</pre>   === Trying to use the Lineage OS prebuilt kernel === Reference : [[Using_prebuilt_kernels|Using prebuilt kernels]] Download the '''unpackbootimg''' utility :<pre>$ wget https://storage.googleapis.com/google-code-archive-downloads/v2/code.google.com/android-serialport-api/android_bootimg_tools.tar.gz$ tar xf android_bootimg_tools.tar.gz </pre> Xperia L is running Lineage OS and is connected to the computer with an USB cable. Use '''adb''' to connect as root :<pre>$ sudo adb root* daemon not running. starting it now on port 5037 ** daemon started successfully *restarting adbd as root $ adb shelltaoshan:/ # whoamiroot</pre> Find the boot partition (/dev/block/mmcblk0p24) :<pre>taoshan:/ # ls -l /dev/block/platform/*/by-name/* | grep -i "\/boot" lrwxrwxrwx 1 root root 21 2018-10-26 16:56 /dev/block/platform/msm_sdcc.1/by-name/boot -> /dev/block/mmcblk0p24</pre> Get the boot partition content : <pre>taoshan:/ # cat /dev/block/mmcblk0p24 > /sdcard/boot_img_lineage_os.imgtaoshan:/ # chmod 666 /sdcard/boot_img_lineage_os.imgtaoshan:/ # exit</pre> Download and extract to LineageOS boot partition :<pre>$ adb pull /sdcard/boot_img_lineage_os.img .[100%] /sdcard/boot_img_lineage_os.img $ mkdir boot_img_lineage_os$ ./unpackbootimg -i boot_img_lineage_os.img -o boot_img_lineage_os dom@shangrao:investigations~/postmarket/taoshan/temp$ ls boot_img_lineage_os |Investigationscatboot_img_lineage_os.img-baseboot_img_lineage_os.img-cmdlineboot_img_lineage_os.img-pagesizeboot_img_lineage_os.img-ramdisk.gzboot_img_lineage_os.img-zImage</pre> Build LineageOS : <pre>$ pmbootstrap install</pre> Restart smartphone in fastboot mode : * turn the device off* unplug the USB cable* while pressing the volume up button, plug the USB cable* check the led is blue With the '''fastboott boot''' command, load LineageOS kernel and Postmarket ramdisk in the device memory : <pre>$ sudo fastboot boot ./boot_img_lineage_os/boot_img_lineage_os.img-zImage ~/.local/var/pmbootstrap/chroot_rootfs_sony-taoshan/boot/initramfs-sony-taoshancreating boot image...creating boot image - 7084032 bytesdownloading 'boot.img'...OKAY [ 0.220s]booting...OKAY [ 0.032s]finished. total time: 0.253s</pre> After writing, the device tries to boot (message ''booting...''), but nothing happens : the screen remains black and the led remains blue. A '''fastboot devices''' command shows no device connected : the device is frozzen.  After removing and replacing the battery, you can boot normally.  === boot addresses === The official chipset of Xperia L is MSM8230 Snapdragon 400. In the Lineage Github repository of the taoshan device, the [https://github.com/LineageOS/android_device_sony_taoshan/blob/cm-14.1/PlatformConfig.mk PlatformConfig.mk] indicates that the platform is '''msm8960''' : <pre>TARGET_BOARD_PLATFORM := msm8960</pre> and the [https://github.com/LineageOS/android_device_sony_taoshan/blob/cm-14.1/lineage.dependencies lineage.dependencies] file indicates that the kernel github repository is '''android_kernel_sony_msm8930''' :<pre> "repository": "android_kernel_sony_msm8930", "target_path": "kernel/sony/msm8930</pre> In the [https://github.com/LineageOS/android_kernel_sony_msm8930 LineageOS msm8930 repository], the [https://github.com/LineageOS/android_kernel_sony_msm8930/blob/cm-14.1/arch/arm/mach-msm/Makefile.boot Makefile.boot] file of the '''msm''' architecture indicates the same value (''0x80208000'') for the ''MSM8960'' and the ''MSM8930'' architectures : <pre>zreladdr-$(CONFIG_ARCH_MSM8960) := 0x80208000zreladdr-$(CONFIG_ARCH_MSM8930) := 0x80208000</pre> Using the '''abootimg''' utility with the original Lineage OS boot.img file confirms this value :<pre>$ abootimg -i ~/postmarket/taoshan/boot_img_lineage_os.img Android Boot Image Info:* file name = /home/dom/postmarket/taoshan/boot_img_lineage_os.img * image size = 19922944 bytes (19.00 MB) page size = 2048 bytes* Boot Name = ""* kernel size = 5847840 bytes (5.58 MB) ramdisk size = 7420948 bytes (7.08 MB)* load addresses: kernel: 0x80208000 ramdisk: 0x82200000 tags: 0x80200100* cmdline = console=ttyHSL0,115200,n8 androidboot.hardware=qcom androidboot.bootdevice=msm_sdcc.1 user_debug=31 msm_rtb.filter=0x3F ehci-hcd.park=3 maxcpus=2 buildvariant=userdebug* id = 0x38f1134f 0xc038d148 0xe9283af8 0x00e68f16 0x910e8cf0 0x00000000 0x00000000 0x00000000 </pre> === fastboot boot issue === After serveral tests with the '''fastboot boot''' command and different kernels, I was surprised to see the Samsung logo even with a Postmarket kernel. So I suspected the device to always reboots with the LineageOS kernel written on disk and not with the kernel I loaded in memory... To check this, I erased the /boot partition (with '''fastboot erase boot''') and I checked that the device could not start : effectively, screen stayed black and the red led was blinking every 5 seconds. My next step was to use '''fastboot boot''' command to boot with original Lineage kernel and ramdisk. My best result was to send :* --base 0x80200000 * --kernel-offset 0x00008000 * --ramdisk-offset 0x02000000 <pre>$ sudo fastboot boot --base 0x80200000 --kernel-offset 0x00008000 --ramdisk-offset 0x02000000 -c "console=ttyHSL0,115200,n8 androidboot.hardware=qcom androidboot.bootdevice=msm_sdcc.1 user_debug=31 msm_rtb.filter=0x3F ehci-hcd.park=3 maxcpus=2 buildvariant=userdebug" boot_img_lineage_os.img-zImage boot_img_lineage_os.img-ramdisk.gzcreating boot image...creating boot image - 13273088 bytesdownloading 'boot.img'...OKAY [ 0.411s]booting...OKAY [ 0.032s]finished. total time: 0.443s</pre> Device restarted, but screen remained black and the red led was blinking every 5 seconds...*  === Lineage OS boot.img recompression === Unpackaging and repackaging the LineageOS boot.img file creates a new file which is smaller (6Mo). This image can be booted normally. LineageOS's boot.img extraction :<pre>$ unpackbootimg -i boot_img_lineage_os.img -o boot_img_lineage_osBOARD_KERNEL_CMDLINE console=ttyHSL0,115200,n8 androidboot.hardware=qcom androidboot.bootdevice=msm_sdcc.1 user_debug=31 msm_rtb.filter=0x3F ehci-hcd.park=3 maxcpus=2 buildvariant=userdebugBOARD_KERNEL_BASE 80200000BOARD_PAGE_SIZE 2048</pre> New boot.img repackaging : <pre>$ mkbootimg --base 0x80200000 --kernel_offset 0x00008000 --ramdisk_offset 0x02000000 --tags_offset 0x00000100 --pagesize 2048 --cmdline 'console=ttyHSL0,115200,n8 androidboot.hardware=qcom androidboot.bootdevice=msm_sdcc.1 user_debug=31 msm_rtb.filter=0x3F ehci-hcd.park=3 maxcpus=2 buildvariant=userdebug' --kernel boot_img_lineage_os/boot_img_lineage_os.img-zImage --ramdisk boot_img_lineage_os/boot_img_lineage_os.img-ramdisk.gz -o boot_img_lineage_os_recompress.img</pre> Original and new boot.img files don't have the same size (6Mo) : <pre>$ ls -lh boot_img_lineage_os_recompress.img boot_img_lineage_os.img-r--r--r-- 1 dom dom 19M oct. 26 16:13 boot_img_lineage_os.img-rw-r--r-- 1 dom dom 13M nov. 7 19:02 boot_img_lineage_os_recompress.img</pre> New boot.img file flashing : <pre>$ sudo fastboot flash boot ./boot_img_lineage_os_recompress.imgtarget didn't report max-download-sizesending 'boot' (12962 KB)...OKAY [ 0.411s]writing 'boot'...OKAY [ 0.899s]finished. total time: 1.309s</pre> Device boots normally with this new image even if it's 6Mo smaller. A binary comparison of the two files shows that a chunck of 6 Mo of null bytes was added at the end of the LineageOS boot.img file. === Starting LineageOS with PostMarket kernel === Booting LineageOS with a ''boot.img'' including a Postmarket's kernel works ! Create a ''boot.img'' including LineageOS ramdisk and the PostMarket kernel :<pre>$ mkbootimg --base 0x80200000 --kernel_offset 0x00008000 --ramdisk_offset 0x02000000 --tags_offset 0x00000100 --pagesize 2048 --cmdline 'console=ttyHSL0,115200,n8 androidboot.hardware=qcom androidboot.bootdevice=msm_sdcc.1 user_debug=31 msm_rtb.filter=0x3F ehci-hcd.park=3 maxcpus=2 buildvariant=userdebug' --kernel ~/.local/var/pmbootstrap/chroot_rootfs_sony-taoshan/boot/vmlinuz-sony-taoshan --ramdisk boot_img_lineage_os/boot_img_lineage_os.img-ramdisk.gz -o boot_img_lineage_os_kernel_postmarket.img</pre> Flash ''boot.img'' : <pre>$ sudo fastboot flash boot boot_img_lineage_os_kernel_postmarket.imgtarget didn't report max-download-sizesending 'boot' (15430 KB)...OKAY [ 0.488s]writing 'boot'...OKAY [ 1.062s]finished. total time: 1.551s</pre> Restart device and check with ''uname'' that the kernel is PostMarket kernel : <pre>taoshan:/ $ uname -v#1-postmarketOS SMP PREEMPT Fri Nov 9 20:16:31 UTC 2018</pre>  === Booting with Postmarket kernel and ramdisk === Booting device with Postmarket kernel and ramdisk seems not to work : device does not react at all when pressing power on button (screen stays black, led is off, no vibration). But we will see later that it's possible to do a telnet connection. Create a boot.img file with Postmarket's Ramdisk and Kernel : <pre>$ mkbootimg -base 0x80200000 --kernel_offset 0x00008000 --ramdisk_offset 0x02000000 --tags_offset 0x00000100 --pagesize 2048 --cmdline 'console=ttyHSL0,115200,n8 androidboot.hardware=qcom androidboot.bootdevice=msm_sdcc.1 user_debug=31 msm_rtb.filter=0x3F ehci-hcd.park=3 maxcpus=2 buildvariant=userdebug' --kernel ~/.local/var/pmbootstrap/chroot_rootfs_sony-taoshan/boot/vmlinuz-sony-taoshan --ramdisk ~/.local/var/pmbootstrap/chroot_rootfs_sony-taoshan/boot/initramfs-sony-taoshan -o boot_img_kernel_ramdisk_postmarket.img</pre> Flash this file :<pre>$ sudo fastboot flash boot boot_img_kernel_ramdisk_postmarket.img target didn't report max-download-sizesending 'boot' (9422 KB)...OKAY [ 0.299s]writing 'boot'...OKAY [ 0.652s]finished. total time: 0.951s</pre> Restart device :<pre>dom@shangrao:~/postmarket/taoshan/temp$ sudo fastboot rebootrebooting...finished. total time: 0.051s</pre> Nothing seems to happen when pressing the power on button (black screen, no vibration, led off).  === Establishing a telnet connection with the debug-shell hook === With the ''debug-shell'' extension activated, it will be possible to do a telnet connection to the device from the computer. Enable the ''debug-shell'' hook : <pre>$ pmbootstrap initfs hook_add debug-shell[15:28:19] (rootfs_sony-taoshan) install postmarketos-mkinitfs-hook-debug-shell[15:28:27] (rootfs_sony-taoshan) mkinitfs sony-taoshan[15:28:32] NOTE: chroot is still active (use 'pmbootstrap shutdown' as necessary)[15:28:32] Done</pre> Create a ''boot.img'' file with Postmarket's kernel and ramdisk :<pre>$ mkbootimg --base 0x80200000 --kernel_offset 0x00008000 --ramdisk_offset 0x02000000 --tags_offset 0x00000100 --pagesize 2048 --cmdline 'console=ttyHSL0,115200,n8 androidboot.hardware=qcom androidboot.bootdevice=msm_sdcc.1 user_debug=31 msm_rtb.filter=0x3F ehci-hcd.park=3 maxcpus=2 buildvariant=userdebug' --kernel ~/.local/var/pmbootstrap/chroot_rootfs_sony-taoshan/boot/vmlinuz-sony-taoshan --ramdisk ~/.local/var/pmbootstrap/chroot_rootfs_sony-taoshan/boot/initramfs-sony-taoshan -o boot_img_kernel_ramdisk_postmarket.img</pre> And flash it : <pre>$ sudo fastboot flash boot boot_img_kernel_ramdisk_postmarket.img target didn't report max-download-sizesending 'boot' (9422 KB)...OKAY [ 0.299s]writing 'boot'...OKAY [ 0.652s]finished. total time: 0.951s</pre> Reboot device : <pre>$ sudo fastboot rebootrebooting...finished. total time: 0.051s</pre> Nothing happens : screen is black, led is off, no vibrations... Check if a net device appears :* disconnect USB cable* display net device list :<pre>$ ip link1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN mode DEFAULT group default qlen 1000 link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:002: enp2s0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc pfifo_fast state DOWN mode DEFAULT group default qlen 1000 link/ether fc:aa:14:7d:67:0f brd ff:ff:ff:ff:ff:ff3: wlp3s0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP mode DORMANT group default qlen 1000 link/ether d8:fc:93:41:b9:41 brd ff:ff:ff:ff:ff:ff</pre>* reconnect USB cable* redisplay net device list :<pre>1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN mode DEFAULT group default qlen 1000 link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:002: enp2s0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc pfifo_fast state DOWN mode DEFAULT group default qlen 1000 link/ether fc:aa:14:7d:67:0f brd ff:ff:ff:ff:ff:ff3: wlp3s0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP mode DORMANT group default qlen 1000 link/ether d8:fc:93:41:b9:41 brd ff:ff:ff:ff:ff:ff7: enp0s20u4: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UNKNOWN mode DEFAULT group default qlen 1000 link/ether c2:c1:d3:ef:a3:25 brd ff:ff:ff:ff:ff:ff</pre> A new device ''enp0s20u4'' appeared with the mac address ''c2:c1:d3:ef:a3:25''. Give it the IP address ''172.16.42.2'' :<pre>$ sudo ip address add dev enp0s20u4 172.16.42.2/24RTNETLINK answers: File exists</pre> And activate it :<pre>$ sudo ip link set enp0s20u4 up</pre> Check the local IP can be pinged :<pre>$ ping -c1 172.16.42.2PING 172.16.42.2 (172.16.42.2) 56(84) bytes of data.64 bytes from 172.16.42.2: icmp_seq=1 ttl=64 time=0.021 ms--- 172.16.42.2 ping statistics ---1 packets transmitted, 1 received, 0% packet loss, time 0msrtt min/avg/max/mdev = 0.021/0.021/0.021/0.000 ms</pre> Check that the phone responds at the address ''172.16.42.1'' : <pre>$ ping -c1 172.16.42.1PING 172.16.42.1 (172.16.42.1) 56(84) bytes of data.64 bytes from 172.16.42.1: icmp_seq=1 ttl=64 time=0.286 ms--- 172.16.42.1 ping statistics ---1 packets transmitted, 1 received, 0% packet loss, time 0msrtt min/avg/max/mdev = 0.286/0.286/0.286/0.000 ms</pre> Launch a telnet connection :<pre>dom@shangrao:~/postmarket/taoshan/temp$ telnet 172.16.42.1Trying 172.16.42.1...Connected to 172.16.42.1.Escape character is '^]'.Type 'pmos_continue_boot' to continue booting:/ # </pre> Device is up and running :-) === Screen remains black with LineageOS kernel and Postmarket ramdisk === Create a ''boot.img'' file with LineageOS kernel and Postmarket ramdisk :<pre>$ mkbootimg --base 0x80200000 --kernel_offset 0x00008000 --ramdisk_offset 0x02000000 --tags_offset 0x00000100 --pagesize 2048 --cmdline 'console=ttyHSL0,115200,n8 androidboot.hardware=qcom androidboot.bootdevice=msm_sdcc.1 user_debug=31 msm_rtb.filter=0x3F ehci-hcd.park=3 maxcpus=2 buildvariant=userdebug' --kernel ./boot_img_lineage_os/boot_img_lineage_os.img-zImage --ramdisk ~/.local/var/pmbootstrap/chroot_rootfs_sony-taoshan/boot/initramfs-sony-taoshan -o boot_img_kernel_taoshan_ramdisk_postmarket.img</pre> Flash this file and reboot :<pre>$ sudo fastboot flash boot boot_img_kernel_taoshan_ramdisk_postmarket.img$ sudo fastboot reboot</pre> Initialize USB net :<pre>$ sudo ip address add dev enp0s20u4 172.16.42.2/24$ sudo ip link set enp0s20u4 up</pre> Start a telnet connection :<pre>$ telnet 172.16.42.1Trying 172.16.42.1...Connected to 172.16.42.1.Escape character is '^]'.Type 'pmos_continue_boot' to continue booting:/ #</pre> Check kernel is not Postmarket's kernel :<pre>/ # uname -aLinux (none) 3.4.0-gdf6292b #1 SMP PREEMPT Sun Sep 9 08:11:30 UTC 2018 armv7l Linux</pre> Try do display an image :<pre>/ # . init_functions.sh / # show_splash /splash-loading.ppm.gz/ # </pre> Screen stays black / off... With Postmarket ramdisk, device screen remains black (or off) (with Postmarket kernel or with LineageOS kernel).But with LineageOS ramdisk, kernel displays Samsung logo. Is there something special in LineageOS ramdisk to initialize screen ?  == Changing screen brightness == Sending this command changes the screen brightness (even if it remains black) :<pre># echo 255 > /sys/devices/platform/msm_ssbi.0/pm8038-core/pm8xxx-led/leds/wled/brightness</pre>  After sending the ''show_splash'' function, screen seems to display something white very briefly and then turns off with no luminosity : <pre>/ # . init_functions.sh / # show_splash /splash-loading.ppm.gz</pre>  Brightness falls back to zero : <pre># cat /sys/devices/platform/msm_ssbi.0/pm8038-core/pm8xxx-led/leds/wled/brightness0</pre> Following lines appears at the end of ''dmesg'' :<pre>[ 3628.406286] MIPI::mipi_dsi_panel_power: [ 3628.406347] mipi_dsi_samsung_panel_power: MIPI : 1[ 3628.406439] mipi_dsi_samsung_panel_power(1): init=1[ 3628.482343] mipi_samsung_lcd_on: MIPI init cmd start[ 3628.704623] mipi_samsung_lcd_on: MIPI init cmd end[ 3628.719944] mdp4_calc_req_mdp_clk: src_h is zero![ 3628.749885]MIPI::mipi_dsi_panel_power: [ 3628.749946] mipi_dsi_samsung_panel_power: MIPI : 0[ 3628.750068] mipi_dsi_samsung_panel_power(0): init=1</pre> === Adding logo.rle in ramdisk === With Postmarket ramdisk, dmesg complains about no finding ''logo.rle'' file :<pre>[ 0.744208] load_565rle_image: Can not open /logo.rle</pre> Copy the original LineageOS ''logo.rle'' file in taoshan's chroot FS : <pre>$ sudo cp postmarket/taoshan/temp/boot_img_lineage_os/ramdisk/logo.rle /home/dom/.local/var/pmbootstrap/chroot_rootfs_sony-taoshan/logo.rle</pre> Configure ''mkinitfs'' to add this file in ramdisk :<pre>$ pmbootstrap chroot -r# cat /etc/postmarketos-mkinitfs/files/30-dOm-logo.files << EOF/logo.rleEOF# exit</pre> Rebuild initfs :<pre>$ pmbootstrap initfs build[19:15:22] (rootfs_sony-taoshan) mkinitfs sony-taoshan[19:15:26] NOTE: chroot is still active (use 'pmbootstrap shutdown' as necessary)[19:15:26] Done</pre> Create a ''boot.img'' file with Postmarket kernel and ramdisk (including logo) :<pre>$ mkbootimg --base 0x80200000 --kernel_offset 0x00008000 --ramdisk_offset 0x02000000 --tags_offset 0x00000100 --pagesize 2048 --cmdline 'console=ttyHSL0,115200,n8 androidboot.hardware=qcom androidboot.bootdevice=msm_sdcc.1 user_debug=31 msm_rtb.filter=0x3F ehci-hcd.park=3 maxcpus=2 buildvariant=userdebug' --kernel ~/.local/var/pmbootstrap/chroot_rootfs_sony-taoshan/boot/vmlinuz-sony-taoshan --ramdisk ~/.local/var/pmbootstrap/chroot_rootfs_sony-taoshan/boot/initramfs-sony-taoshan -o boot_img_kernel_ramdisk_postmarket_with_logo.img</pre> Flash this file and reboot :<pre>$ sudo fastboot flash boot boot_img_kernel_ramdisk_postmarket_with_logo.img$ sudo fastboot reboot</pre> Sony logo (content of ''logo.rle'') appears on screen ! Initialize USB net and check ''logo.rle'' file :<pre>$ telnet 172.16.42.1Trying 172.16.42.1...Connected to 172.16.42.1.Escape character is '^]'.Type 'pmos_continue_boot' to continue booting:/ # ls -l /logo.rle -rw-r--r-- 1 0 0 7660 Nov 11 2018 /logo.rle</pre> Try to display a splash screen :<pre>/ # . init_functions.sh / # show_splash /splash-loading.ppm.gz/ #</pre> Nothing happens and screen continues to display Sony logo.  === Manually updating fb mode updates screen === Reference : * https://wiki.postmarketos.org/wiki/Troubleshooting#Newer_version_in_binary_package_repositories_than_in_aports_folder* https://github.com/postmarketOS/pmbootstrap/pull/66 The following command updates screen :<pre>/ # cat /sys/class/graphics/fb0/modes > /sys/class/graphics/fb0/mode</pre> The content of '''modes''' file is :<pre>/ # cat /sys/class/graphics/fb0/modesU:480x854p-0</pre> So writing the string '''U:480x854p-0''' in the '''mode''' file works too :<pre>/ # echo "U:480x854p-0" > /sys/class/graphics/fb0/mode</pre> By example, to display the loading splash :<pre>/ # . init_functions.sh / # show_splash splash-loading.ppm.gz/ # echo "U:480x854p-0" > /sys/class/graphics/fb0/mode/ # </pre> Calling only the ''show_splash'' function to display another splash screen does not work :<pre>/ # show_splash splash-mounterror.ppm.gz</pre> But, once you send the ''echo'' command, splash screen appears :<pre>/ # echo "U:480x854p-0" > /sys/class/graphics/fb0/mode</pre>  === Enabling msm-fb-refresher === As explained in [https://wiki.postmarketos.org/wiki/Troubleshooting:display Troubleshooting], ''msm-fb-refresher'' may help. Add ''msm-fb-refresher'' in ''~/.local/var/pmbootstrap/cache_git/pmaports/device/device-sony-taoshan/APKBUILD'' :<pre>depends="postmarketos-base linux-sony-taoshan mkbootimg msm-fb-refresher mesa-dri-swrast"</pre> Rebuild all :<pre>$ pmbootstrap zap$ pmbootstrap checksum device-sony-taoshan$ pmbootstrap build device-sony-taoshan --force$ pmbootstrap install</pre> Check ''msm-fb-refresher'' presence in ramdisk :<pre>$ pmbootstrap initfs ls | grep refresher[17:44:36] *** initramfs ***-rwxr-xr-x 1 root root 5.2K Nov 12 17:44 msm-fb-refresher[17:44:36] *** initramfs-extra ***[17:44:37] See also: <https://wiki.postmarketos.org/wiki/Initramfs_development>[17:44:37] NOTE: chroot is still active (use 'pmbootstrap shutdown' as necessary)[17:44:37] Done</pre> Flash and reboot :<pre>$ pmbootstrap flasher flash_rootfs$ pmbootstrap flasher flash_kernel$ sudo fastboot reboot</pre> Screen remains black but ping responds :<pre>$ sudo ip address add dev enp0s20u4 172.16.42.2/24$ sudo ip link set enp0s20u4 up$ ping 172.16.42.1PING 172.16.42.1 (172.16.42.1) 56(84) bytes of data.64 bytes from 172.16.42.1: icmp_seq=2 ttl=64 time=0.314 ms^C</pre> Telnet connection is not possible :<pre>$ telnet 172.16.42.1Trying 172.16.42.1...telnet: Unable to connect to remote host: Connection refused</pre> But ssh connection is possible :<pre>$ ssh 172.16.42.1The authenticity of host '172.16.42.1 (172.16.42.1)' can't be established.ECDSA key fingerprint is SHA256:BlhEQYA2LoQZR8/zWztgoVdQYmTUtHB7JHU5w+sH+eY.Are you sure you want to continue connecting (yes/no)? yesWarning: Permanently added '172.16.42.1' (ECDSA) to the list of known hosts.dom@172.16.42.1's password: Welcome to postmarketOS!</pre> Due to the zap command, debug-shell hook has been lost. Reenabled it, flash and reboot :<pre>$ pmbootstrap initfs hook_add debug-shell$ pmbootstrap flasher flash_kernel$ sudo fastboot reboot</pre> Screen remains black while booting. Telnet connection is possible :<pre>$ telnet 172.16.42.1Trying 172.16.42.1...Connected to 172.16.42.1.Escape character is '^]'. Type 'pmos_continue_boot' to continue booting:</pre> msm-fb-refresher is running :<pre>/ # ps -ef | grep msm-fb-refreshe[r] 275 0 0:00 /usr/sbin/msm-fb-refresher --loop</pre> After increasing screen luminosity, a splash screen appears :<pre>/ # echo 255 > /sys/devices/platform/msm_ssbi.0/pm8038-core/pm8xxx-led/leds/wled/brightness</pre> Loading another splash screen is immediately displayed :<pre>/ # . init_functions.sh / # show_splash /splash-loading.ppm.gz</pre> Conclusion : ''msm-fb-refresher'' does it's job, but manually setting screen brightness in startup screen seems to be necessary. === Boot process hangs when exiting telnet debug-shell === When exiting the debug-shell with '''pmos_continue_boot''', the boot process hangs and sshd daemon never starts. To follow the boot process after launching the ''pmos_continue_boot'' command, I will launch a second telnetd daemon listening on another port and connect to it to follow the content of ''pmOS_init.log''. To start a daemon in background, we need to add ''nohup'' in the initramfs :<pre>$ pmbootstrap chroot --rootfs/ # cat /etc/postmarketos-mkinitfs/files/10-nohup.files/usr/bin/nohupEOF/ # exit$ pmbootstrap initfs build $ pmbootstrap flasher flash_kernel$ sudo fastboot reboot</pre> Start a second daemon :<pre>$ telnet 172.16.42.1/ # nohup telnetd -b 172.16.42.1:2323 -l /bin/sh</pre> With a second terminal window, connect to it and prints log :<pre>$ telnet 172.16.42.1 2323 Trying 172.16.42.1... Connected to 172.16.42.1. Escape character is '^]'. / # tail -f pmOS_init.log</pre> After exiting from the first telnet connection with ''pmos_continue_boot'', the log prints :<pre>TerminatedMount boot partition (/dev/dm-0)Extract /boot/initramfs-sony-taoshan-extra25124 blocks[INFO] charging-sdl version 0.1.0Device /dev/input/event1 not suitable.commandline read: charging-sdlcommandline read: -pcfcommandline read: /usr/share/fonts/ttf-dejavu/DejaVuSans.ttf(*) Direct/Thread: Started 'SigHandler' (768) [CRITICAL - OTHER/0] <85340>...~~~~~~~~~~~~~~~~~~~~~~~~~| DirectFB 1.7.7 |~~~~~~~~~~~~~~~~~~~~~~~~~~(c) 2012-2015 DirectFB integrated media GmbH(c) 2001-2015 The world wide DirectFB Open Source Community(c) 2000-2004 Convergence (integrated media) GmbH----------------------------------------------------------------(*) DirectFB/Core: Single Application Core. (2017-10-03 12:19) Device /dev/input/event5 not suitable.(*) Direct/Memcpy: Using libc memcpy()(*) Direct/Thread: Started 'Fusion Dispatch' (769) [MESSAGING - OTHER/0] <85340>...Device /dev/input/event6 not suitable.(*) Direct/Thread: Started 'VT Switcher' (772) [CRITICAL - OTHER/0] <85340>...(*) Direct/Thread: Started 'VT Flusher' (773) [DEFAULT - OTHER/0] <85340>...(*) DirectFB/FBDev: Found 'msmfb43_90501' (ID 0) with frame buffer at 0x82334000, 4812k (MMIO 0x00000000, 0k)(*) Direct/Modules: suppress module 'linux_input'Device /dev/input/event0 not suitable.(*) Direct/Thread: Started 'Keyboard Input' (774) [INPUT - OTHER/0] <85340>...(*) DirectFB/Input: Keyboard 0.9 (directfb.org)(*) DirectFB/Input: Hot-plug detection enabled with Input Hub Driver (*) Direct/Thread: Started 'PS/2 Input' (775) [INPUT - OTHER/0] <85340>...(*) DirectFB/Input: IMPS/2 Mouse (1) 1.0 (directfb.org)(*) Direct/Thread: Started 'PS/2 Input' (776) [INPUT - OTHER/0] <85340>...(*) DirectFB/Input: IMPS/2 Mouse (2) 1.0 (directfb.org)(*) DirectFB/Graphics: Generic Software Rasterizer 0.7 (directfb.org)(!) DirectFB/FBDev: No supported modes found in /etc/fb.modes and current mode not supported!(!) DirectFB/FBDev: Current mode's pixelformat: rgba 8/24, 8/16, 8/8, 8/0 (32bit)(!) DirectFB/Core/layers: Failed to initialize layer 0! --> A general initialization error occured(!) DirectFB/Core: Could not initialize 'layer_core' core! --> A general initialization error occuredSegmentation fault</pre> Executing the '''start_charging_mode''' from debug-shell prints the same error :<pre>/# . init_functions.sh/ # start_charging_mode[...](*) DirectFB/Graphics: Generic Software Rasterizer 0.7 (directfb.org)(!) DirectFB/FBDev: No supported modes found in /etc/fb.modes and current mode not supported!(!) DirectFB/FBDev: Current mode's pixelformat: rgba 8/24, 8/16, 8/8, 8/0 (32bit)(!) DirectFB/Core/layers: Failed to initialize layer 0!(!) DirectFB/Core: Could not initialize 'layer_core' core! --> A general initialization error occuredSegmentation fault</pre> After disabling this function, the boot process terminates, and sshd daemon is started. Source of the ''start_charging_mode'' function :<pre>start_charging_mode(){ # Check cmdline for charging mode chargingmodes=" androidboot.mode=charger lpm_boot=1 androidboot.huawei_type=oem_rtc startup=0x00010004 lpcharge=1 androidboot.bootchg=true " # shellcheck disable=SC2086 grep -Eq "$(echo $chargingmodes | tr ' ' '|')" /proc/cmdline || return setup_directfb_tslib # Get the font from osk-sdl config fontpath=$(awk '/^keyboard-font/{print $3}' /etc/osk.conf) # Set up triggerhappy config { echo "KEY_POWER 1 pgrep -x charging-sdl || charging-sdl -pcf $fontpath" } >/etc/triggerhappy.conf # Start it once and then start triggerhappy ( charging-sdl -pcf "$fontpath" \ || show_splash /splash-charging-error.ppm.gz ) & thd --deviceglob /dev/input/event* --triggers /etc/triggerhappy.conf}</pre>  There are two issues with DirectFB :* The ''No supported modes found in /etc/fb.modes'' error : generate this file with the appropriate mode.* The final segmentation fault : try to generate a core dump and anlayze it. === charging-sdl segmentation fault analyzing === The idea is to generate the segmentation fault from ''gdb'' to examine backtrace. To include ''gdb'', add it in the ''depends'' directive of ''~/.local/var/pmbootstrap/cache_git/pmaports/device/device-sony-taoshan/APKBUILD'' :<pre>depends="postmarketos-base linux-sony-taoshan mkbootimg msm-fb-refresher mesa-dri-swrast gdb"</pre> Remove debug-shell :<pre>$ pmbootstrap initfs hook_del debug-shell</pre> Rebuild rootfs and flash it :<pre>$ pmbootstrap build --force device-sony-taoshan$ pmbootstrap install$ pmbootstrap flasher flash_rootfs$ pmbootstrap flasher flash_kernel</pre> After rebooting phone, enable USB networking and connect with ssh.<pre>$ sudo ip address add dev enp0s20u4 172.16.42.2/24$ sudo ip link set enp0s20u4 up$ ssh 172.16.42.1 </pre> Once connected, change root :<pre>$ sudo su -[sudo] password for dom: </pre> To generate the segmentation fault :<pre>sony-taoshan:~# export DFBARGS="system=fbdev,no-cursor,disable-module=linux_input"sony-taoshan:~# echo "KEY_POWER 1 pgrep -x charging-sdl || charging-sdl -pcf $fontpath" > /etc/triggerhappy.confsony-taoshan:~# charging-sdl -pcf /usr/share/fonts/ttf-dejavu/DejaVuSans.ttf[INFO] charging-sdl version 0.1.0[...] --> A general initialization error occuredSegmentation faultsony-taoshan:~# </pre> To generate this seg fault from gdb, launch it like this :<pre>sony-taoshan:~# gdb --args /usr/bin/charging-sdl -pcf /usr/share/fonts/ttf-dejavu/DejaVuSans.ttfGNU gdb (GDB) 8.0.1[...]Reading symbols from /usr/bin/charging-sdl...done.(gdb)</pre> Start ''charging-sdl'' execution : <pre>(gdb) runStarting program: /usr/bin/charging-sdl -pcf /usr/share/fonts/ttf-dejavu/DejaVuSans.ttf[INFO] charging-sdl version 0.1.0No protocol specifiedcommandline read: charging-sdlcommandline read: -pcfcommandline read: /usr/share/fonts/ttf-dejavu/DejaVuSans.ttf[New LWP 1539](*) Direct/Thread: Started 'SigHandler' (1539) [CRITICAL - OTHER/0] <85340>... ~~~~~~~~~~~~~~~~~~~~~~~~~| DirectFB 1.7.7 |~~~~~~~~~~~~~~~~~~~~~~~~~~ (c) 2012-2015 DirectFB integrated media GmbH (c) 2001-2015 The world wide DirectFB Open Source Community (c) 2000-2004 Convergence (integrated media) GmbH ----------------------------------------------------------------(*) DirectFB/Core: Single Application Core. (2017-10-03 12:19) (*) Direct/Memcpy: Using libc memcpy()[New LWP 1540](*) Direct/Thread: Started 'Fusion Dispatch' (1540) [MESSAGING - OTHER/0] <85340>...[New LWP 1543](*) Direct/Thread: Started 'VT Switcher' (1543) [CRITICAL - OTHER/0] <85340>...[New LWP 1544](*) Direct/Thread: Started 'VT Flusher' (1544) [DEFAULT - OTHER/0] <85340>...(*) DirectFB/FBDev: Found 'msmfb43_90501' (ID 0) with frame buffer at 0x82334000, 4812k (MMIO 0x00000000, 0k)(*) Direct/Modules: suppress module 'linux_input'(*) DirectFB/Input: Hot-plug detection enabled with Input Hub Driver [New LWP 1545](*) Direct/Thread: Started 'Keyboard Input' (1545) [INPUT - OTHER/0] <85340>...(*) DirectFB/Input: Keyboard 0.9 (directfb.org)[New LWP 1546](*) Direct/Thread: Started 'PS/2 Input' (1546) [INPUT - OTHER/0] <85340>...(*) DirectFB/Input: IMPS/2 Mouse (1) 1.0 (directfb.org)[New LWP 1547](*) Direct/Thread: Started 'PS/2 Input' (1547) [INPUT - OTHER/0] <85340>...(*) DirectFB/Input: IMPS/2 Mouse (2) 1.0 (directfb.org)(*) DirectFB/Graphics: Generic Software Rasterizer 0.7 (directfb.org)(!) DirectFB/FBDev: No supported modes found in /etc/fb.modes and current mode not supported!(!) DirectFB/FBDev: Current mode's pixelformat: rgba 8/24, 8/16, 8/8, 8/0 (32bit)(!) DirectFB/Core/layers: Failed to initialize layer 0! --> A general initialization error occured(!) DirectFB/Core: Could not initialize 'layer_core' core! --> A general initialization error occuredThread 6 "Keyboard Input" received signal ?, Unknown signal.[Switching to LWP 1545]0xb6fb29a8 in __clone () from /lib/ld-musl-armhf.so.1</pre> Seg fault comes from the thread ''Keyboard Input'' (LWP 1545) which receives a unknown signal. Print backtrace complains about a corrupt stack :<pre>(gdb) backtrace#0 0xb6fb29a8 in __clone () from /lib/ld-musl-armhf.so.1#1 0xb6fb3668 in ?? () from /lib/ld-musl-armhf.so.1Backtrace stopped: previous frame identical to this frame (corrupt stack?)</pre> ==== Error DirectFB/FBDev: No supported modes found ==== The error ''DirectFB/FBDev: No supported modes found in /etc/fb.modes and current mode not supported!'' is a known problem. See the ''Osk-sdl'' page:* [https://wiki.postmarketos.org/wiki/Osk-sdl#DirectFB.2FFBDev:_No_supported_modes_found_in_.2Fetc.2Ffb.modes_and_current_mode_not_supported.21 DirectFB/FBDev: No supported modes found in /etc/fb.modes and current mode not supported]* [https://wiki.postmarketos.org/wiki/Osk-sdl#Create_fb.modes Create fb.modes] After creating the appropriate FB Mode in ''/etc/fb.modes'', it should be possible to reactivate the ''start_charging_mode'' in ''init_functions.sh''. With ''debug-shell'' enabled, connect via telnet, and enlight screen by writing in the ''brightness'' file :<pre>echo 255 > /sys/devices/platform/msm_ssbi.0/pm8038-core/pm8xxx-led/leds/wled/brightness</pre> Create the ''/etc/fb.modes'' file :<pre>cat > /etc/fb.modes << EOFmode "480x854-0" # D: 0.003 MHz, H: 0.004 kHz, V: 0.005 Hz geometry 854 1708 854 1708 16 timings 400000000 50 50 9 9 20 4 accel false rgba 8/24,8/16,8/8,8/0endmodeEOF</pre> Exit telnet :<pre>/ # pmos_continue_boot</pre> Screen becomes black. After few seconds, connect with ssh and enlight screen again :<pre>sony-taoshan:~$ sudo su -[sudo] password for dom: sony-taoshan:~# echo 255 > /sys/devices/platform/msm_ssbi.0/pm8038-core/pm8xxx-led/leds/wled/brightness</pre> The Wayland screen should appears. === Adding FB workarounds in APKBUILD === Go in the taoshan's device directory : ''~/.local/var/pmbootstrap/cache_git/pmaports/device/device-sony-taoshan''. Create the '''fb.modes''' file :<pre> mode "480x854-0" # D: 0.003 MHz, H: 0.004 kHz, V: 0.005 Hz geometry 854 1708 854 1708 16 timings 400000000 50 50 9 9 20 4 accel false rgba 8/24,8/16,8/8,8/0endmode</pre> Create the '''screen_enlightener''' script :<pre>#!/bin/shbrightness_file=$(find /sys/devices/platform/msm_ssbi.0/ -name brightness | grep -v rgb | head -n1)test -z "$brightness_file" && { echo "Can't find screen brightness file !" exit 1}echo "Screen brightness : $brightness_file"test -w "$brightness_file" || { echo "Can't find write screen brightness file !" exit 1}while true ; do test $(cat $brightness_file) -ne 255 && \ echo 255 > $brightness_file sleep 1done </pre>  Create a hook script named '''initfs-hook.sh''' which will be called during boot process to start the ''screen_enlightener'' script in background :<pre> #!/bin/shecho "Start the screen enlightener script"/bin/sh /usr/sbin/screen_enlightener >/tmp/screen_enlightener.log 2>&1 </dev/null &</pre> Create a ''50-screen-enlightener.files'' file which will include the ''screen_enlightener'' script in ''initramfs'' :<pre>/usr/sbin/screen_enlightener</pre> Update the ''APKBUILD'' :* declare these files in the '''source''' variable* add an ''install'' directive in the ''package'' function : <pre>source=" deviceinfo screen_enlightener fb.modes 50-screen-enlightener.files initfs-hook.sh"[...]package() { devicepkg_package $startdir $pkgname install -Dm544 "$srcdir"/fb.modes "$pkgdir"/etc/fb.modes install -Dm444 "$srcdir"/screen_enlightener "$pkgdir"/usr/sbin/screen_enlightener install -Dm444 "$srcdir"/50-screen-enlightener.files "$pkgdir"/etc/postmarketos-mkinitfs/files/50-screen-enlightener.files install -Dm644 "$srcdir"/initfs-hook.sh "$pkgdir"/etc/postmarketos-mkinitfs/hooks/00-${pkgname}.sh}</pre> It's not necessary to add an install directive for the ''fb.modes'' file : it's automatically in ''initramfs-extra''. Checksums (at the end of ''APKBUILD'') need to be updated after adding new files :<pre>$ pmbootstrap checksum device-sony-taoshan[13:02:46] (native) generate checksums for device-sony-taoshan[13:02:46] NOTE: chroot is still active (use 'pmbootstrap shutdown' as necessary)[13:02:46] Done</pre> Rebuild all :<pre>$ pmbootstrap build device-sony-taoshan --force$ pmbootstrap install</pre> Check files presence in chroot :<pre>$ pmbootstrap chroot -r[13:10:16] (rootfs_sony-taoshan) % sh -i / # ls -l /etc/fb.modes /usr/sbin/screen_enlightener /etc/postmarketos-mkinitfs/hooks/00-device-sony-taoshan.sh -r-xr--r-- 1 root root 185 Nov 17 17:44 /etc/fb.modes-rw-r--r-- 1 root root 137 Nov 17 17:44 /etc/postmarketos-mkinitfs/hooks/00-device-sony-taoshan.sh-r--r--r-- 1 root root 492 Nov 17 17:44 /usr/sbin/screen_enlightener / # cat /etc/postmarketos-mkinitfs/hooks/00-device-sony-taoshan.sh#!/bin/shecho "Start the screen enlightener script"/bin/sh /usr/sbin/screen_enlightener >/tmp/screen_enlightener.log 2>&1 </dev/null & / # exit[13:10:28] NOTE: chroot is still active (use 'pmbootstrap shutdown' as necessary)[13:10:28]Done</pre> ==Touch screen ==Touch screen is /dev/input/event2
== Installation ==
[[Installation guide]]
 <!--== See also ==Link to related gitlab issues or merge requests like the following (replace CHANGEME with the ID, e.g. 1234):* {{MR|CHANGEME71|pmaports}} Initial merge request* {{issueDevice package|CHANGEMEsony-taoshan}} Some related issueYou can also add normal web links:* [https://redmine.replicant.us/projects/replicant/wiki/GalaxyS2I9100 Replicant wiki page]{{Kernel package|sony-->taoshan}}
489

edits

Navigation menu