Public
Snippet $25705 authored by Simon Josefsson

replicant-6-firmware

Edited
replicant-6-non-free-firmware.md

Replicant 6 non-free firmware


wget http://download.cyanogenmod.org/get/jenkins/42508/cm-10.1.3-i9300.zip
echo '073a464a9f5129c490502c77374495c38a25ba790c10e27f51b43845baeba6bf  cm-10.1.3-i9300.zip' | sha256sum -c
mkdir cm-10.1.3-i9300
cd cm-10.1.3-i9300
unzip ../cm-10.1.3-i9300.zip
cd ..

adb root
adb wait-for-device 
adb remount
adb shell mkdir /system/vendor/firmware
adb shell chmod 755 /system/vendor/firmware

# nfc works out of the box!

# front-camera
adb push cm-10.1.3-i9300/system/vendor/firmware/setfile.bin /system/vendor/firmware/setfile.bin
adb push cm-10.1.3-i9300/system/vendor/firmware/fimc_is_fw.bin /system/vendor/firmware/fimc_is_fw.bin

# bluetooth
adb push cm-10.1.3-i9300/system/bin/bcm4334.hcd /system/vendor/firmware/
adb push cm-10.1.3-i9300/system/bin/bcm4334_murata.hcd /system/vendor/firmware/
adb push cm-10.1.3-i9300/system/bin/bcm4334_semco.hcd /system/vendor/firmware/
adb push cm-10.1.3-i9300/system/bin/bcm4334_semcosh.hcd /system/vendor/firmware/

# wifi
adb push cm-10.1.3-i9300/system/etc/wifi/bcmdhd_apsta.bin_b2 /system/vendor/firmware
adb push cm-10.1.3-i9300/system/etc/wifi/bcmdhd_mfg.bin_b2 /system/vendor/firmware
adb push cm-10.1.3-i9300/system/etc/wifi/bcmdhd_p2p.bin_b2 /system/vendor/firmware
adb push cm-10.1.3-i9300/system/etc/wifi/bcmdhd_sta.bin_b2 /system/vendor/firmware
adb push cm-10.1.3-i9300/system/etc/wifi/nvram_mfg.txt /system/vendor/firmware
adb push cm-10.1.3-i9300/system/etc/wifi/nvram_mfg.txt_murata /system/vendor/firmware
adb push cm-10.1.3-i9300/system/etc/wifi/nvram_mfg.txt_semcosh /system/vendor/firmware
adb push cm-10.1.3-i9300/system/etc/wifi/nvram_net.txt /system/vendor/firmware
adb push cm-10.1.3-i9300/system/etc/wifi/nvram_net.txt_murata /system/vendor/firmware
adb push cm-10.1.3-i9300/system/etc/wifi/nvram_net.txt_semcosh /system/vendor/firmware

# GPS - requires ROM with fixed /init.target.rc to launch gpsd properly.
# see patch below, against devices/samsung/i9300/
# inspired by https://code.fossencdi.org/device_samsung_i9300.git/commit/?h=replicant-6.0&id=eb564f1803a0145eef68b59cdbb75362175d05a7
# use ROM from https://josefsson.org/replicant6 if unsure
# if you have problems, try 'chown -R gps.system /data/gps' too
wget https://download.cyanogenmod.org/get/jenkins/175164/cm-13.0-20160820-SNAPSHOT-ZNH5YAO0J2-i9300.zip
mkdir cm-13.0-20160820-SNAPSHOT-ZNH5YAO0J2-i9300
cd cm-13.0-20160820-SNAPSHOT-ZNH5YAO0J2-i9300
unzip ../cm-13.0-20160820-SNAPSHOT-ZNH5YAO0J2-i9300
sdat2img.py system.transfer.list system.new.dat system.img
mkdir image
sudo mount system.img image/
adb push cm-13.0-20160820-SNAPSHOT-ZNH5YAO0J2-i9300/image/bin/glgps /system/bin
adb push cm-13.0-20160820-SNAPSHOT-ZNH5YAO0J2-i9300/image/lib/hw/gps.exynos4.so /system/lib/hw/
adb push cm-13.0-20160820-SNAPSHOT-ZNH5YAO0J2-i9300/image/bin/gps.cer /system/bin

From b6cac1a04b9738d614bacbfb8335dedd55c85afe Mon Sep 17 00:00:00 2001
From: Simon Josefsson <simon@josefsson.org>
Date: Fri, 9 Sep 2016 18:31:43 +0000
Subject: [PATCH] Launch gpsd.

---
 rootdir/init.target.rc | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/rootdir/init.target.rc b/rootdir/init.target.rc
index 45b4501..050c459 100644
--- a/rootdir/init.target.rc
+++ b/rootdir/init.target.rc
@@ -42,14 +42,14 @@ on fs
     # zram
     swapon_all /fstab.smdk4x12

-#on boot
+on boot
 # Start GPS daemon
-#service gps-daemon /system/bin/sh /system/bin/gps_daemon.sh
-#    class main
-#    socket gps seqpacket 0660 gps system
-#    user gps
-#    group system inet sdcard_rw gps
-#    seclabel u:r:glgps:s0
+service gps-daemon /system/bin/sh /system/bin/gps_daemon.sh
+    class main
+    socket gps seqpacket 0660 gps system
+    user gps
+    group system inet sdcard_rw gps
+    seclabel u:r:glgps:s0

 on property:dev.bootcomplete=1
 # boot on default pegasusq settings (for better performance)
-- 
2.1.4