https://wiki.merproject.org/w/api.php?action=feedcontributions&user=Dylanvanassc&feedformat=atomMer Wiki - User contributions [en]2024-03-29T13:08:15ZUser contributionsMediaWiki 1.19.20+dfsg-2.3https://wiki.merproject.org/wiki/Adaptations/PinePhone64Adaptations/PinePhone642020-05-06T18:26:58Z<p>Dylanvanassc: /* Video */</p>
<hr />
<div>=Hardware Support=<br />
<br />
Full information of hardware spec [https://wiki.pine64.org/index.php/Project_Don't_be_evil Here]<br />
<br />
PostMarket OS hardware information [https://wiki.postmarketos.org/wiki/Pine_Don%27t_be_evil_devkit_(pine-dontbeevil) PostMarketOS Wiki]<br />
<br />
==WiFi/BT RTL8723CS==<br />
<br />
=== WiFi ===<br />
The WiFi driver isn't available in the Linux kernel yet. However, we can compile it as an out-of-tree driver for now.<br />
See kernel building for more instruction<br />
<br />
=== Bluetooth ===<br />
The production version of the PineTab and PinePhone are both using the Realtek 8723CS WiFi/BT module.<br />
BT is natively supported after adding the necessary firmware from [https://github.com/anarsoul/rtl8723bt-firmware/tree/master/rtl_bt https://github.com/anarsoul/rtl8723bt-firmware/tree/master/rtl_bt]<br />
Download all the <code>*.bin</code> files and copy them to the <code>/lib/firmware/rtl_bt</code> directory in the rootFS.<br />
<br />
==Modem EC25==<br />
<br />
===Setup===<br />
<br />
1. Make sure that the <code>qmimodem</code> plugin is enabled in the <code>.spec</code> of <code>ofono</code>.<br />
<br />
2. Remove the <code>noplugin.conf</code> file under <code>/lib/environment/ofono/noplugin.conf</code>.<br />
<br />
3. Restart <code>ofono</code><br />
systemctl restart ofono<br />
<br />
4. Check if the QMI modem is properly detected:<br />
/usr/lib/ofono/test/list-modems<br />
<br />
5. Unlock you SIM card (if needed):<br />
/usr/lib/ofono/test/enter-pin /quectelqmi_0 pin <PIN CODE><br />
<br />
The EC25 Quectel modem is now ready :)<br />
Thanks to SuperPrower for the hard work!<br />
<br />
===Sending SMS===<br />
<br />
/usr/lib/ofono/test/send-sms <PHONE NUMBER RECEIVER> <MESSAGE> <DELIVERY REPORT><br />
<br />
To skip the delivery report, use <code>0</code> as argument.<br />
<br />
==Cameras==<br />
<br />
Thanks to: https://wiki.postmarketos.org/wiki/Pine_Don't_be_evil_devkit_(pine-dontbeevil)#Cameras<br />
Only the back camera is supported by the mainline kernel.<br />
To use it, you need to configure it first:<br />
<br />
media-ctl --set-v4l2 '"ov5640 2-003c":0[fmt:UYVY8_2X8/1280x7200]' -d /dev/media1<br />
<br />
Afterwards, you can take a picture with:<br />
<br />
ffmpeg -s 1280x720 -f video4linux2 -i /dev/video1 -vframes 1 selfie.jpg<br />
<br />
- <code>/dev/media1</code> is the controller interface of the back camera<br />
<br />
- <code>/dev/video1</code> is the back camera stream interface<br />
<br />
If that works, you can try <code>gstreamer</code> to make the camera available for system wide usage:]<br />
<br />
gst-launch-1.0 v4l2src device=/dev/video1 num-buffers=1 ! 'video/x-raw,format=UYVY,width=1280,height=720' ! jpegenc ! filesink location=selfie.jpg<br />
cp selfie.jpg /home/nemo/Pictures<br />
<br />
This command generates a <code>selfie.jpg</code> file and by copying it to <code>/home/nemo/Pictures</code> you can view it with the Gallery app.<br />
<br />
== Audio ==<br />
<br />
1. Unmute the <code>AIF1 Slot 0 Digital DAC</code> channel using <code>alsamixer</code>. Use <code>m</code> to unmute.<br />
<br />
2. Same for <code>Line Out</code> and increase the volume to 100 (default is 0).<br />
<br />
2. Copy the default PulseAudio config: <br />
cp /etc/pulse/default.pa /etc/pulse/arm_native_config.pa<br />
<br />
3. Enable ALSA modules in the new config:<br />
load-module module-alsa-sink<br />
load-module module-alsa-source device=hw:1,0<br />
They are commented out by default.<br />
<br />
4. Configure PulseAudio by changing <code>arm_droid_config.pa</code> to <code>/arm_native_config.pa</code> in <code>/etc/sysconfig/pulseaudio</code>.<br />
<br />
5. Restart PulseAudio or reboot.<br />
<br />
6. Go to the Settings app and test the sound output by playing a ringtone under Sounds and Feedback.<br />
<br />
== Video ==<br />
WIP GStreamer support. Doesn't start the sink properly yet.<br />
<br />
GST_DEBUG=4 gst-launch-1.0 filesrc location=~!lion-sample.mov ! qtdemux ! h264parse ! vaapidecodebin ! vaapisink<br />
<br />
You need to export some env variables:<br />
<br />
LIBVA_V4L2_REQUEST_VIDEO_PATH=/dev/videoX<br />
LIBVA_DRIVER_NAME=v4l2_request<br />
GST_VAAPI_ALL_DRIVERS=1<br />
<br />
==PineTab==<br />
<br />
In pinetab we have jack to uart port cable. For enable UART console move selector nearby sd-card slot away from sd-card slot.<br />
<br />
==Testing the vibrator motor==<br />
<br />
You need to have the <code>CONFIG_GPIO_SYSFS</code> enabled in your kernel config for this!<br />
<br />
Vibrator motor is on pin <code>PD2</code>.<br />
You can calculate the PIN number for PD2 as followed ([https://linux-sunxi.org/GPIO more information]):<br />
<code>(4-1) * 32 + 2 = 98</code><br />
<br />
echo "98" > /sys/class/gpio/export # Make pin available<br />
echo "out" > /sys/class/gpio/gpio98/direction # Set as output<br />
echo "1" > /sys/class/gpio/gpio98/value # On<br />
echo "1" > /sys/class/gpio/gpio98/value # Off<br />
echo "98" > /sys/class/gpio/unexport # When you're done<br />
<br />
==Notification LED==<br />
<br />
export COLOR=red # or green, blue is broken due to a hardware fault<br />
# Activate LED<br />
echo 1 > /sys/class/leds/$COLOR/brightness<br />
# Deactivate LED<br />
echo 0 > /sys/class/leds/$COLOR/brightness<br />
<br />
The LED can be controlled in Mer by MCE. You need the <code>mce-plugin-libhybris-nondroid</code> for this.<br />
<br />
In the latest kernel, the control paths of the LED aren't the default ones that the MCE is expecting.<br />
This requires a config file to enable MCE to control the LED on the PinePhone devphone:<br />
<br />
[LEDConfigHybris]<br />
<br />
# Choose Vanilla backend<br />
BackEnd=vanilla<br />
<br />
# Configure base directories for red/green/blue channels<br />
RedDirectory=/sys/class/leds/pinephone:red:user<br />
GreenDirectory=/sys/class/leds/pinephone:green:user<br />
BlueDirectory=/sys/class/leds/pinephone:blue:user<br />
<br />
This config file must be saved in the following file: <code>/etc/mce/99-pinephone.ini</code><br />
<br />
=Installation=<br />
==Prepare SD card==<br />
<br />
Use GParted or any other tool to create the following <code>EXT4</code> partitions:<br />
<br />
# <b>boot</b>: Holds the mainline kernel Image and Device Tree files<br />
# <b>data</b>: Holds the Sailfish OS rootFS<br />
<br />
GParted will ask you to leave the first MB free of the SD card when creating the first partition, this is correct.<br />
This 1 MB will be used to store the U-boot boot loader.<br />
<br />
<b>Note</b>: Make sure you have a <code>msdos</code> partition table! If not, the U-boot flashing will make partition table unusable (in case of GPT for example)!<br />
<br />
==U-Boot==<br />
<br />
We will now build the mainline U-boot boot loader from Git.<br />
<br />
=== Clone ARM Trusted Firmware (master branch) ===<br />
<br />
git clone https://github.com/ARM-software/arm-trusted-firmware.git<br />
<br />
=== Build the BL31.bin ===<br />
<br />
Follow the instructions here: https://github.com/u-boot/u-boot/blob/master/board/sunxi/README.sunxi64<br />
<br />
Quick start:<br />
<br />
export CROSS_COMPILE=aarch64-linux-gnu-<br />
ARCH=arm64 make PLAT=sun50i_a64 DEBUG=1 bl31<br />
export BL31=/path/to/bl31.bin # Probably: ~/arm-trusted-firmware/build/sun50i_a64/debug/bl31.bin<br />
<br />
=== Clone U-boot (master branch): ===<br />
<br />
You can find the U-boot mirror repository on Github:<br />
<br />
git clone https://github.com/u-boot/u-boot.git<br />
<br />
=== Compile U-boot ===<br />
<br />
You have to cross compile U-boot with the <code>arm64</code> arch:<br />
<br />
export CROSS_COMPILE=aarch64-linux-gnu-<br />
ARCH=arm64 make clean<br />
ARCH=arm64 make sopine_baseboard_defconfig # U-boot upstream, use pinephone_defconfig when using pine64-org's U-boot with enhanced PinePhone support<br />
ARCH=arm64 make<br />
<br />
The <code>sopine_baseboard_defconfig</code> is the same for the Don't Be Evil devkit.<br />
<br />
=== Burn U-boot to your SD card ===<br />
<br />
Copy the compiled U-boot bootloader to the first sector on your SD card:<br />
<br />
sudo dd if=u-boot-sunxi-with-spl.bin of=/dev/sdX bs=8k seek=1<br />
<br />
<br />
=== Manually loading the kernel ===<br />
<br />
Serial TTY Baudrate over UART = 115200 for screen, example: <code>screen /dev/ttyUSB0 115200</code><br />
You have to start screen first, before turning on the devkit.<br />
<br />
Interrupt the U-boot autoboot process when you see a message in the U-boot prompt. <br />
We need to access the U-boot prompt to load the Kernel image and boot it manually!<br />
<br />
Set bootargs:<br />
<br />
setenv bootargs root=/dev/mmcblk0p2 rootwait panic=10<br />
<br />
Kernel Image loading and Device Tree files:<br />
<br />
ext4load mmc 0:1 ${kernel_addr_r} /Image <br />
ext4load mmc 0:1 ${fdt_addr_r} /sun50i-a64-pinephone.dtb <br />
<br />
Boot the kernel:<br />
<br />
booti ${kernel_addr_r} - ${fdt_addr_r}<br />
<br />
=== Automatic boot ===<br />
<br />
Create a <code>boot.cmd</code> file for the '''PinePhone''':<br />
<br />
echo Setting bootargs<br />
setenv bootargs console=tty0 console=ttyS0,115200 root=/dev/mmcblk0p2 no_console_suspend rootwait quiet<br />
earlycon=uart,mmio32,0x01c28000 panic=10 consoleblank=0 loglevel=0<br />
printenv<br />
echo Loading DTB<br />
load mmc 0:1 ${fdt_addr_r} /sun50i-a64-pinephone.dtb<br />
echo Loading kernel Image<br />
load mmc 0:1 ${kernel_addr_r} /Image<br />
echo Booting kernel NOW<br />
booti ${kernel_addr_r} - ${fdt_addr_r}<br />
<br />
Create a <code>boot.cmd</code> file for the '''PineTab''':<br />
<br />
echo Setting bootargs<br />
setenv bootargs console=tty0 console=ttyS0,115200 root=/dev/mmcblk0p2 no_console_suspend rootwait quiet<br />
earlycon=uart,mmio32,0x01c28000 panic=10 consoleblank=0 loglevel=0<br />
printenv<br />
echo Loading DTB<br />
load mmc 0:1 ${fdt_addr_r} /sun50i-a64-pinetab.dtb<br />
echo Loading kernel Image<br />
load mmc 0:1 ${kernel_addr_r} /Image<br />
echo Booting kernel NOW<br />
booti ${kernel_addr_r} - ${fdt_addr_r}<br />
<br />
Mount your <code>boot</code> partition and run the following command:<br />
sudo mkimage -C none -A arm -T script -d /mnt/boot.cmd /mnt/boot.scr<br />
<br />
This will translate the <code>boot.cmd</code> file into a U-boot script.<br />
<br />
If you don't have the <code>mkimage</code> command available, you can install it from the <code>uboot-tools</code> package.<br />
<br />
==Kernel==<br />
<br />
The PinePhone runs a mainline kernel, device tree modifications are done by all the PinePhone OS developers on Gitlab (https://gitlab.com/pine64-org/linux).<br />
<br />
=== Clone the kernel ===<br />
<br />
git clone https://gitlab.com/pine64-org/linux<br />
cd linux<br />
git checkout pine64-kernel<br />
<br />
=== Configure the kernel ===<br />
<br />
# <b>Copy our kernel config</b>: https://gitlab.com/pinephone-sailfish-os/linux-kernel/raw/master/pinephone-config<br />
# <b>Enter the <code>linux</code> project</b>: <code>cd linux</code><br />
# <b>Copy the config file</b> to <code>.config</code> in the main directory<br />
<br />
=== Enable WiFi out-of-tree driver ===<br />
<br />
Add the driver to the kernel:<br />
cd drivers/staging<br />
git clone https://github.com/Icenowy/rtl8723cs.git<br />
<br />
Configure the kernel build system now:<br />
<br />
# <b>Add this line to <code>drivers/staging/Kconfig</code></b>: <code>source "drivers/staging/rtl8723cs/Kconfig"</code><br />
# <b>Add this line to <code>drivers/staging/Makefile</code></b>: <code>obj-$(CONFIG_RTL8723CS) += rtl8723cs/</code><br />
# <b>Enable the driver in the kernel config:</b> <code>CONFIG_RTL8723CS=m</code><br />
<br />
See: [https://gitlab.com/postmarketOS/pmaports/blob/master/main/linux-postmarketos-allwinner/rtl8723cs.patch https://gitlab.com/postmarketOS/pmaports/blob/master/main/linux-postmarketos-allwinner/rtl8723cs.patch]<br />
<br />
=== Build the kernel ===<br />
<br />
We cross compile the kernel for ARM64.<br />
The <code>LOCALVERSION</code> variable can be used to add a version to the build.<br />
<br />
Cross compile the kernel:<br />
export ARCH=arm64<br />
export CROSS_COMPILE=aarch64-linux-gnu-<br />
export LOCALVERSION=-nemo<br />
make clean<br />
make defconfig KBUILD_DEFCONFIG=config-sailfishos-allwinner.aarch64<br />
make -j4 Image modules dtbs<br />
<br />
Install the kernel modules in a different path: <br />
make modules_install INSTALL_MOD_PATH=../linux_modules/<br />
<br />
=== Install kernel ===<br />
<br />
Copy the following things:<br />
<br />
# <b>Image</b> from <code>arch/arm64/boot/Image</code> to the root of the <code>boot</code> partition.<br />
# <b>Device tree files</b> <br />
For pinethone <code>arch/arm64/boot/dts/allwinner/sun50i-a64-pinephone.dtb</code> and <code>arch/arm64/boot/dts/allwinner/sun50i-a64-pinephone.dts</code> to the root of the <code>boot</code> partition.<br />
<br />
For pinetab <code>arch/arm64/boot/dts/allwinner/sun50i-a64-pinetab.dtb</code> and <code>arch/arm64/boot/dts/allwinner/sun50i-a64-pinetab.dts</code> to the root of the <code>boot</code> partition.<br />
# <b>Modules</b> from <code>../linux_modules</code> to <code>/lib/modules</code> on the <code>data</code> partition.<br />
<br />
==Nemo Mobile==<br />
<br />
Nemo Mobile have same MW with SFOS but use gcc8 have aarch64 support and use newset version of packages.<br />
<br />
git of device config: https://github.com/neochapay/nemo-device-dont_be_evil<br />
<br />
For build last release of nemo use this ks file https://gist.github.com/neochapay/8d40f9ee1e5fd621e0053aa126d39e81<br />
<br />
==Sailfish OS==<br />
<br />
===Github & OBS project===<br />
<br />
- https://github.com/sailfish-on-dontbeevil<br />
<br />
- https://build.merproject.org/project/show/nemo:devel:hw:pine:dontbeevil<br />
<br />
===Flash rootFS===<br />
You can download the latest rootFS from the Gitlab SailfishOS Porters CI: https://gitlab.com/sailfishos-porters-ci/dont_be_evil-ci (see the artifacts of the latest CI job).<br />
<br />
This <code>tar.gz</code> archive should be burned to the <code>data</code> partition of the SD card.<br />
It's important to burn it as the root user (not with sudo) to preserve extended attributes and ACLs: <br />
<br />
sudo su<br />
bsdtar -xpf <SAILFISH OS ROOTFS>.tar.bz2 -C <MOUNTPOINT OF /DATA><br />
<br />
===Device repos===<br />
To boot Lipstick, you need to add the device specific repos to the devkit.<br />
All the following commands are executed in a shell on the devkit.<br />
<br />
''Make sure you configure the ethernet interface first before you continue!''<br />
''You need to have access to the WWW to fetch the necessary repository data and packages.''<br />
<br />
Install zypper manually:<br />
curl -o augeas-lib.rpm http://repo.merproject.org/obs/mer:/core/latest_armv7hl/armv7hl/augeas-libs-1.6.0+git1-1.10.6.armv7hl.rpm<br />
curl -o zypper.rpm http://repo.merproject.org/obs/mer:/core/latest_armv7hl/armv7hl/zypper-1.14.6+git3-1.24.5.armv7hl.rpm<br />
rpm -Uvh *rpm<br />
<br />
Use <code>ssu</code> to add the repo<br />
ssu ar common http://repo.merproject.org/obs/nemo:/devel:/hw:/common/sailfish_latest_armv7hl/<br />
ssu ar dontbeevil http://repo.merproject.org/obs/home:/piggz:/dontbeevil/sailfishos_3.0.3.9_latest_armv7hl/<br />
ssu ar jolla https://releases.jolla.com/releases/3.0.3.9/jolla/armv7hl/<br />
<br />
Refresh the repo:<br />
zypper refresh<br />
<br />
Install the device packages:<br />
zypper install dontbeevil:qt5-qtcore dontbeevil:qt5-qttest dontbeevil:lipstick-qt5<br />
zypper install droid-config-dontbeevil # Select 1 for vendor change<br />
zypper install droid-config-dontbeevil-sailfish<br />
zypper install qt5-plugin-platform-eglfs # EGLFS LIMA plugin<br />
zypper install qt5-plugin-generic-evdev # evdev input plugins<br />
<br />
Other useful packages<br />
zypper install mce-tools #useful for mcetool (mcetool -U activates the screen)<br />
<br />
===Unknown password===<br />
The Sailfish OS rootFS sets a random password when booting for the first time.<br />
You can only log in through the <code>telnet</code> debug interface.<br />
Since the <code>eth0</code> interface still requires manually setup, you can't access <code>telnet</code>.<br />
<br />
To circumvent this issue, you can login through the UART TTY interface. <br />
However you don't know the password of the <code>root</code> nor <code>nemo</code> users!<br />
To disable the <code>root</code> and <code>nemo</code> passwords, we can modify the <code>/etc/shadow</code> file:<br />
<br />
sudo chmod +w <SD card data partition>/etc/shadow<br />
sudo vim <SD card data partition>/etc/shadow # Remove any characters where <HASHED PASSWORD> is written: user1:<HASHED PASSWORD>:16092:0:99999:7:::.<br />
sudo chmod -w <SD card data partition>/etc/shadow<br />
<br />
By removing the hashed password, we can login with the user without entering a password.<br />
You can set a new password afterwards by running as a logged in user:<br />
<br />
passwd<br />
<br />
===Init eth0===<br />
Enabling the <code>eth0</code> interface has to be done manually for now:<br />
<br />
ifconfig eth0 <YOUR_IP><br />
route add default gw <DEFAULT_GATEWAY_IP><br />
echo "nameserver <DNS_SERVER_IP>" > /etc/resolv.conf<br />
<br />
Test your configuration with <code>ping</code>:<br />
<br />
ping jolla.com<br />
<br />
<br />
===Lipstick crashing===<br />
<br />
Install Lipstick from the <code>dontbeevil</code> repository:<br />
<br />
zypper install dontbeevil:lipstick-qt5<br />
<br />
As from 3.1.0.12, this fix is obsolete.<br />
<br />
===No setup wizard===<br />
<br />
Make sure the configuration package is installed:<br />
<br />
zypper install droid-config-dontbeevil-sailfish<br />
<br />
===Missing regulatory.db for RT8723BS WiFi/BT module===<br />
<br />
git clone git://git.kernel.org/pub/scm/linux/kernel/git/sforshee/wireless-regdb.git<br />
cd wireless-regdb<br />
cp regulatory* /lib/firmware</div>Dylanvanasschttps://wiki.merproject.org/wiki/Adaptations/PinePhone64Adaptations/PinePhone642020-05-06T18:22:35Z<p>Dylanvanassc: /* Hardware Support */</p>
<hr />
<div>=Hardware Support=<br />
<br />
Full information of hardware spec [https://wiki.pine64.org/index.php/Project_Don't_be_evil Here]<br />
<br />
PostMarket OS hardware information [https://wiki.postmarketos.org/wiki/Pine_Don%27t_be_evil_devkit_(pine-dontbeevil) PostMarketOS Wiki]<br />
<br />
==WiFi/BT RTL8723CS==<br />
<br />
=== WiFi ===<br />
The WiFi driver isn't available in the Linux kernel yet. However, we can compile it as an out-of-tree driver for now.<br />
See kernel building for more instruction<br />
<br />
=== Bluetooth ===<br />
The production version of the PineTab and PinePhone are both using the Realtek 8723CS WiFi/BT module.<br />
BT is natively supported after adding the necessary firmware from [https://github.com/anarsoul/rtl8723bt-firmware/tree/master/rtl_bt https://github.com/anarsoul/rtl8723bt-firmware/tree/master/rtl_bt]<br />
Download all the <code>*.bin</code> files and copy them to the <code>/lib/firmware/rtl_bt</code> directory in the rootFS.<br />
<br />
==Modem EC25==<br />
<br />
===Setup===<br />
<br />
1. Make sure that the <code>qmimodem</code> plugin is enabled in the <code>.spec</code> of <code>ofono</code>.<br />
<br />
2. Remove the <code>noplugin.conf</code> file under <code>/lib/environment/ofono/noplugin.conf</code>.<br />
<br />
3. Restart <code>ofono</code><br />
systemctl restart ofono<br />
<br />
4. Check if the QMI modem is properly detected:<br />
/usr/lib/ofono/test/list-modems<br />
<br />
5. Unlock you SIM card (if needed):<br />
/usr/lib/ofono/test/enter-pin /quectelqmi_0 pin <PIN CODE><br />
<br />
The EC25 Quectel modem is now ready :)<br />
Thanks to SuperPrower for the hard work!<br />
<br />
===Sending SMS===<br />
<br />
/usr/lib/ofono/test/send-sms <PHONE NUMBER RECEIVER> <MESSAGE> <DELIVERY REPORT><br />
<br />
To skip the delivery report, use <code>0</code> as argument.<br />
<br />
==Cameras==<br />
<br />
Thanks to: https://wiki.postmarketos.org/wiki/Pine_Don't_be_evil_devkit_(pine-dontbeevil)#Cameras<br />
Only the back camera is supported by the mainline kernel.<br />
To use it, you need to configure it first:<br />
<br />
media-ctl --set-v4l2 '"ov5640 2-003c":0[fmt:UYVY8_2X8/1280x7200]' -d /dev/media1<br />
<br />
Afterwards, you can take a picture with:<br />
<br />
ffmpeg -s 1280x720 -f video4linux2 -i /dev/video1 -vframes 1 selfie.jpg<br />
<br />
- <code>/dev/media1</code> is the controller interface of the back camera<br />
<br />
- <code>/dev/video1</code> is the back camera stream interface<br />
<br />
If that works, you can try <code>gstreamer</code> to make the camera available for system wide usage:]<br />
<br />
gst-launch-1.0 v4l2src device=/dev/video1 num-buffers=1 ! 'video/x-raw,format=UYVY,width=1280,height=720' ! jpegenc ! filesink location=selfie.jpg<br />
cp selfie.jpg /home/nemo/Pictures<br />
<br />
This command generates a <code>selfie.jpg</code> file and by copying it to <code>/home/nemo/Pictures</code> you can view it with the Gallery app.<br />
<br />
== Audio ==<br />
<br />
1. Unmute the <code>AIF1 Slot 0 Digital DAC</code> channel using <code>alsamixer</code>. Use <code>m</code> to unmute.<br />
<br />
2. Same for <code>Line Out</code> and increase the volume to 100 (default is 0).<br />
<br />
2. Copy the default PulseAudio config: <br />
cp /etc/pulse/default.pa /etc/pulse/arm_native_config.pa<br />
<br />
3. Enable ALSA modules in the new config:<br />
load-module module-alsa-sink<br />
load-module module-alsa-source device=hw:1,0<br />
They are commented out by default.<br />
<br />
4. Configure PulseAudio by changing <code>arm_droid_config.pa</code> to <code>/arm_native_config.pa</code> in <code>/etc/sysconfig/pulseaudio</code>.<br />
<br />
5. Restart PulseAudio or reboot.<br />
<br />
6. Go to the Settings app and test the sound output by playing a ringtone under Sounds and Feedback.<br />
<br />
== Video ==<br />
GStreamer support<br />
<br />
GST_DEBUG=4 gst-launch-1.0 filesrc location=~!lion-sample.mov ! qtdemux ! h264parse ! vaapidecodebin ! vaapisink<br />
<br />
You need to export some env variables:<br />
<br />
LIBVA_V4L2_REQUEST_VIDEO_PATH=/dev/videoX<br />
LIBVA_DRIVER_NAME=v4l2_request<br />
GST_VAAPI_ALL_DRIVERS=1<br />
<br />
==PineTab==<br />
<br />
In pinetab we have jack to uart port cable. For enable UART console move selector nearby sd-card slot away from sd-card slot.<br />
<br />
==Testing the vibrator motor==<br />
<br />
You need to have the <code>CONFIG_GPIO_SYSFS</code> enabled in your kernel config for this!<br />
<br />
Vibrator motor is on pin <code>PD2</code>.<br />
You can calculate the PIN number for PD2 as followed ([https://linux-sunxi.org/GPIO more information]):<br />
<code>(4-1) * 32 + 2 = 98</code><br />
<br />
echo "98" > /sys/class/gpio/export # Make pin available<br />
echo "out" > /sys/class/gpio/gpio98/direction # Set as output<br />
echo "1" > /sys/class/gpio/gpio98/value # On<br />
echo "1" > /sys/class/gpio/gpio98/value # Off<br />
echo "98" > /sys/class/gpio/unexport # When you're done<br />
<br />
==Notification LED==<br />
<br />
export COLOR=red # or green, blue is broken due to a hardware fault<br />
# Activate LED<br />
echo 1 > /sys/class/leds/$COLOR/brightness<br />
# Deactivate LED<br />
echo 0 > /sys/class/leds/$COLOR/brightness<br />
<br />
The LED can be controlled in Mer by MCE. You need the <code>mce-plugin-libhybris-nondroid</code> for this.<br />
<br />
In the latest kernel, the control paths of the LED aren't the default ones that the MCE is expecting.<br />
This requires a config file to enable MCE to control the LED on the PinePhone devphone:<br />
<br />
[LEDConfigHybris]<br />
<br />
# Choose Vanilla backend<br />
BackEnd=vanilla<br />
<br />
# Configure base directories for red/green/blue channels<br />
RedDirectory=/sys/class/leds/pinephone:red:user<br />
GreenDirectory=/sys/class/leds/pinephone:green:user<br />
BlueDirectory=/sys/class/leds/pinephone:blue:user<br />
<br />
This config file must be saved in the following file: <code>/etc/mce/99-pinephone.ini</code><br />
<br />
=Installation=<br />
==Prepare SD card==<br />
<br />
Use GParted or any other tool to create the following <code>EXT4</code> partitions:<br />
<br />
# <b>boot</b>: Holds the mainline kernel Image and Device Tree files<br />
# <b>data</b>: Holds the Sailfish OS rootFS<br />
<br />
GParted will ask you to leave the first MB free of the SD card when creating the first partition, this is correct.<br />
This 1 MB will be used to store the U-boot boot loader.<br />
<br />
<b>Note</b>: Make sure you have a <code>msdos</code> partition table! If not, the U-boot flashing will make partition table unusable (in case of GPT for example)!<br />
<br />
==U-Boot==<br />
<br />
We will now build the mainline U-boot boot loader from Git.<br />
<br />
=== Clone ARM Trusted Firmware (master branch) ===<br />
<br />
git clone https://github.com/ARM-software/arm-trusted-firmware.git<br />
<br />
=== Build the BL31.bin ===<br />
<br />
Follow the instructions here: https://github.com/u-boot/u-boot/blob/master/board/sunxi/README.sunxi64<br />
<br />
Quick start:<br />
<br />
export CROSS_COMPILE=aarch64-linux-gnu-<br />
ARCH=arm64 make PLAT=sun50i_a64 DEBUG=1 bl31<br />
export BL31=/path/to/bl31.bin # Probably: ~/arm-trusted-firmware/build/sun50i_a64/debug/bl31.bin<br />
<br />
=== Clone U-boot (master branch): ===<br />
<br />
You can find the U-boot mirror repository on Github:<br />
<br />
git clone https://github.com/u-boot/u-boot.git<br />
<br />
=== Compile U-boot ===<br />
<br />
You have to cross compile U-boot with the <code>arm64</code> arch:<br />
<br />
export CROSS_COMPILE=aarch64-linux-gnu-<br />
ARCH=arm64 make clean<br />
ARCH=arm64 make sopine_baseboard_defconfig # U-boot upstream, use pinephone_defconfig when using pine64-org's U-boot with enhanced PinePhone support<br />
ARCH=arm64 make<br />
<br />
The <code>sopine_baseboard_defconfig</code> is the same for the Don't Be Evil devkit.<br />
<br />
=== Burn U-boot to your SD card ===<br />
<br />
Copy the compiled U-boot bootloader to the first sector on your SD card:<br />
<br />
sudo dd if=u-boot-sunxi-with-spl.bin of=/dev/sdX bs=8k seek=1<br />
<br />
<br />
=== Manually loading the kernel ===<br />
<br />
Serial TTY Baudrate over UART = 115200 for screen, example: <code>screen /dev/ttyUSB0 115200</code><br />
You have to start screen first, before turning on the devkit.<br />
<br />
Interrupt the U-boot autoboot process when you see a message in the U-boot prompt. <br />
We need to access the U-boot prompt to load the Kernel image and boot it manually!<br />
<br />
Set bootargs:<br />
<br />
setenv bootargs root=/dev/mmcblk0p2 rootwait panic=10<br />
<br />
Kernel Image loading and Device Tree files:<br />
<br />
ext4load mmc 0:1 ${kernel_addr_r} /Image <br />
ext4load mmc 0:1 ${fdt_addr_r} /sun50i-a64-pinephone.dtb <br />
<br />
Boot the kernel:<br />
<br />
booti ${kernel_addr_r} - ${fdt_addr_r}<br />
<br />
=== Automatic boot ===<br />
<br />
Create a <code>boot.cmd</code> file for the '''PinePhone''':<br />
<br />
echo Setting bootargs<br />
setenv bootargs console=tty0 console=ttyS0,115200 root=/dev/mmcblk0p2 no_console_suspend rootwait quiet<br />
earlycon=uart,mmio32,0x01c28000 panic=10 consoleblank=0 loglevel=0<br />
printenv<br />
echo Loading DTB<br />
load mmc 0:1 ${fdt_addr_r} /sun50i-a64-pinephone.dtb<br />
echo Loading kernel Image<br />
load mmc 0:1 ${kernel_addr_r} /Image<br />
echo Booting kernel NOW<br />
booti ${kernel_addr_r} - ${fdt_addr_r}<br />
<br />
Create a <code>boot.cmd</code> file for the '''PineTab''':<br />
<br />
echo Setting bootargs<br />
setenv bootargs console=tty0 console=ttyS0,115200 root=/dev/mmcblk0p2 no_console_suspend rootwait quiet<br />
earlycon=uart,mmio32,0x01c28000 panic=10 consoleblank=0 loglevel=0<br />
printenv<br />
echo Loading DTB<br />
load mmc 0:1 ${fdt_addr_r} /sun50i-a64-pinetab.dtb<br />
echo Loading kernel Image<br />
load mmc 0:1 ${kernel_addr_r} /Image<br />
echo Booting kernel NOW<br />
booti ${kernel_addr_r} - ${fdt_addr_r}<br />
<br />
Mount your <code>boot</code> partition and run the following command:<br />
sudo mkimage -C none -A arm -T script -d /mnt/boot.cmd /mnt/boot.scr<br />
<br />
This will translate the <code>boot.cmd</code> file into a U-boot script.<br />
<br />
If you don't have the <code>mkimage</code> command available, you can install it from the <code>uboot-tools</code> package.<br />
<br />
==Kernel==<br />
<br />
The PinePhone runs a mainline kernel, device tree modifications are done by all the PinePhone OS developers on Gitlab (https://gitlab.com/pine64-org/linux).<br />
<br />
=== Clone the kernel ===<br />
<br />
git clone https://gitlab.com/pine64-org/linux<br />
cd linux<br />
git checkout pine64-kernel<br />
<br />
=== Configure the kernel ===<br />
<br />
# <b>Copy our kernel config</b>: https://gitlab.com/pinephone-sailfish-os/linux-kernel/raw/master/pinephone-config<br />
# <b>Enter the <code>linux</code> project</b>: <code>cd linux</code><br />
# <b>Copy the config file</b> to <code>.config</code> in the main directory<br />
<br />
=== Enable WiFi out-of-tree driver ===<br />
<br />
Add the driver to the kernel:<br />
cd drivers/staging<br />
git clone https://github.com/Icenowy/rtl8723cs.git<br />
<br />
Configure the kernel build system now:<br />
<br />
# <b>Add this line to <code>drivers/staging/Kconfig</code></b>: <code>source "drivers/staging/rtl8723cs/Kconfig"</code><br />
# <b>Add this line to <code>drivers/staging/Makefile</code></b>: <code>obj-$(CONFIG_RTL8723CS) += rtl8723cs/</code><br />
# <b>Enable the driver in the kernel config:</b> <code>CONFIG_RTL8723CS=m</code><br />
<br />
See: [https://gitlab.com/postmarketOS/pmaports/blob/master/main/linux-postmarketos-allwinner/rtl8723cs.patch https://gitlab.com/postmarketOS/pmaports/blob/master/main/linux-postmarketos-allwinner/rtl8723cs.patch]<br />
<br />
=== Build the kernel ===<br />
<br />
We cross compile the kernel for ARM64.<br />
The <code>LOCALVERSION</code> variable can be used to add a version to the build.<br />
<br />
Cross compile the kernel:<br />
export ARCH=arm64<br />
export CROSS_COMPILE=aarch64-linux-gnu-<br />
export LOCALVERSION=-nemo<br />
make clean<br />
make defconfig KBUILD_DEFCONFIG=config-sailfishos-allwinner.aarch64<br />
make -j4 Image modules dtbs<br />
<br />
Install the kernel modules in a different path: <br />
make modules_install INSTALL_MOD_PATH=../linux_modules/<br />
<br />
=== Install kernel ===<br />
<br />
Copy the following things:<br />
<br />
# <b>Image</b> from <code>arch/arm64/boot/Image</code> to the root of the <code>boot</code> partition.<br />
# <b>Device tree files</b> <br />
For pinethone <code>arch/arm64/boot/dts/allwinner/sun50i-a64-pinephone.dtb</code> and <code>arch/arm64/boot/dts/allwinner/sun50i-a64-pinephone.dts</code> to the root of the <code>boot</code> partition.<br />
<br />
For pinetab <code>arch/arm64/boot/dts/allwinner/sun50i-a64-pinetab.dtb</code> and <code>arch/arm64/boot/dts/allwinner/sun50i-a64-pinetab.dts</code> to the root of the <code>boot</code> partition.<br />
# <b>Modules</b> from <code>../linux_modules</code> to <code>/lib/modules</code> on the <code>data</code> partition.<br />
<br />
==Nemo Mobile==<br />
<br />
Nemo Mobile have same MW with SFOS but use gcc8 have aarch64 support and use newset version of packages.<br />
<br />
git of device config: https://github.com/neochapay/nemo-device-dont_be_evil<br />
<br />
For build last release of nemo use this ks file https://gist.github.com/neochapay/8d40f9ee1e5fd621e0053aa126d39e81<br />
<br />
==Sailfish OS==<br />
<br />
===Github & OBS project===<br />
<br />
- https://github.com/sailfish-on-dontbeevil<br />
<br />
- https://build.merproject.org/project/show/nemo:devel:hw:pine:dontbeevil<br />
<br />
===Flash rootFS===<br />
You can download the latest rootFS from the Gitlab SailfishOS Porters CI: https://gitlab.com/sailfishos-porters-ci/dont_be_evil-ci (see the artifacts of the latest CI job).<br />
<br />
This <code>tar.gz</code> archive should be burned to the <code>data</code> partition of the SD card.<br />
It's important to burn it as the root user (not with sudo) to preserve extended attributes and ACLs: <br />
<br />
sudo su<br />
bsdtar -xpf <SAILFISH OS ROOTFS>.tar.bz2 -C <MOUNTPOINT OF /DATA><br />
<br />
===Device repos===<br />
To boot Lipstick, you need to add the device specific repos to the devkit.<br />
All the following commands are executed in a shell on the devkit.<br />
<br />
''Make sure you configure the ethernet interface first before you continue!''<br />
''You need to have access to the WWW to fetch the necessary repository data and packages.''<br />
<br />
Install zypper manually:<br />
curl -o augeas-lib.rpm http://repo.merproject.org/obs/mer:/core/latest_armv7hl/armv7hl/augeas-libs-1.6.0+git1-1.10.6.armv7hl.rpm<br />
curl -o zypper.rpm http://repo.merproject.org/obs/mer:/core/latest_armv7hl/armv7hl/zypper-1.14.6+git3-1.24.5.armv7hl.rpm<br />
rpm -Uvh *rpm<br />
<br />
Use <code>ssu</code> to add the repo<br />
ssu ar common http://repo.merproject.org/obs/nemo:/devel:/hw:/common/sailfish_latest_armv7hl/<br />
ssu ar dontbeevil http://repo.merproject.org/obs/home:/piggz:/dontbeevil/sailfishos_3.0.3.9_latest_armv7hl/<br />
ssu ar jolla https://releases.jolla.com/releases/3.0.3.9/jolla/armv7hl/<br />
<br />
Refresh the repo:<br />
zypper refresh<br />
<br />
Install the device packages:<br />
zypper install dontbeevil:qt5-qtcore dontbeevil:qt5-qttest dontbeevil:lipstick-qt5<br />
zypper install droid-config-dontbeevil # Select 1 for vendor change<br />
zypper install droid-config-dontbeevil-sailfish<br />
zypper install qt5-plugin-platform-eglfs # EGLFS LIMA plugin<br />
zypper install qt5-plugin-generic-evdev # evdev input plugins<br />
<br />
Other useful packages<br />
zypper install mce-tools #useful for mcetool (mcetool -U activates the screen)<br />
<br />
===Unknown password===<br />
The Sailfish OS rootFS sets a random password when booting for the first time.<br />
You can only log in through the <code>telnet</code> debug interface.<br />
Since the <code>eth0</code> interface still requires manually setup, you can't access <code>telnet</code>.<br />
<br />
To circumvent this issue, you can login through the UART TTY interface. <br />
However you don't know the password of the <code>root</code> nor <code>nemo</code> users!<br />
To disable the <code>root</code> and <code>nemo</code> passwords, we can modify the <code>/etc/shadow</code> file:<br />
<br />
sudo chmod +w <SD card data partition>/etc/shadow<br />
sudo vim <SD card data partition>/etc/shadow # Remove any characters where <HASHED PASSWORD> is written: user1:<HASHED PASSWORD>:16092:0:99999:7:::.<br />
sudo chmod -w <SD card data partition>/etc/shadow<br />
<br />
By removing the hashed password, we can login with the user without entering a password.<br />
You can set a new password afterwards by running as a logged in user:<br />
<br />
passwd<br />
<br />
===Init eth0===<br />
Enabling the <code>eth0</code> interface has to be done manually for now:<br />
<br />
ifconfig eth0 <YOUR_IP><br />
route add default gw <DEFAULT_GATEWAY_IP><br />
echo "nameserver <DNS_SERVER_IP>" > /etc/resolv.conf<br />
<br />
Test your configuration with <code>ping</code>:<br />
<br />
ping jolla.com<br />
<br />
<br />
===Lipstick crashing===<br />
<br />
Install Lipstick from the <code>dontbeevil</code> repository:<br />
<br />
zypper install dontbeevil:lipstick-qt5<br />
<br />
As from 3.1.0.12, this fix is obsolete.<br />
<br />
===No setup wizard===<br />
<br />
Make sure the configuration package is installed:<br />
<br />
zypper install droid-config-dontbeevil-sailfish<br />
<br />
===Missing regulatory.db for RT8723BS WiFi/BT module===<br />
<br />
git clone git://git.kernel.org/pub/scm/linux/kernel/git/sforshee/wireless-regdb.git<br />
cd wireless-regdb<br />
cp regulatory* /lib/firmware</div>Dylanvanasschttps://wiki.merproject.org/wiki/Adaptations/PinePhone64Adaptations/PinePhone642020-03-24T18:09:38Z<p>Dylanvanassc: /* Build the BL31.bin */</p>
<hr />
<div>=Hardware Support=<br />
<br />
Full information of hardware spec [https://wiki.pine64.org/index.php/Project_Don't_be_evil Here]<br />
<br />
PostMarket OS hardware information [https://wiki.postmarketos.org/wiki/Pine_Don%27t_be_evil_devkit_(pine-dontbeevil) PostMarketOS Wiki]<br />
<br />
==WiFi/BT RTL8723CS==<br />
<br />
=== WiFi ===<br />
The WiFi driver isn't available in the Linux kernel yet. However, we can compile it as an out-of-tree driver for now.<br />
See kernel building for more instruction<br />
<br />
=== Bluetooth ===<br />
The production version of the PineTab and PinePhone are both using the Realtek 8723CS WiFi/BT module.<br />
BT is natively supported after adding the necessary firmware from [https://github.com/anarsoul/rtl8723bt-firmware/tree/master/rtl_bt https://github.com/anarsoul/rtl8723bt-firmware/tree/master/rtl_bt]<br />
Download all the <code>*.bin</code> files and copy them to the <code>/lib/firmware/rtl_bt</code> directory in the rootFS.<br />
<br />
==Modem EC25==<br />
<br />
===Setup===<br />
<br />
1. Make sure that the <code>qmimodem</code> plugin is enabled in the <code>.spec</code> of <code>ofono</code>.<br />
<br />
2. Remove the <code>noplugin.conf</code> file under <code>/lib/environment/ofono/noplugin.conf</code>.<br />
<br />
3. Restart <code>ofono</code><br />
systemctl restart ofono<br />
<br />
4. Check if the QMI modem is properly detected:<br />
/usr/lib/ofono/test/list-modems<br />
<br />
5. Unlock you SIM card (if needed):<br />
/usr/lib/ofono/test/enter-pin /quectelqmi_0 pin <PIN CODE><br />
<br />
The EC25 Quectel modem is now ready :)<br />
Thanks to SuperPrower for the hard work!<br />
<br />
===Sending SMS===<br />
<br />
/usr/lib/ofono/test/send-sms <PHONE NUMBER RECEIVER> <MESSAGE> <DELIVERY REPORT><br />
<br />
To skip the delivery report, use <code>0</code> as argument.<br />
<br />
==Cameras==<br />
<br />
Thanks to: https://wiki.postmarketos.org/wiki/Pine_Don't_be_evil_devkit_(pine-dontbeevil)#Cameras<br />
Only the back camera is supported by the mainline kernel.<br />
To use it, you need to configure it first:<br />
<br />
media-ctl --set-v4l2 '"ov5640 2-003c":0[fmt:UYVY8_2X8/1280x7200]' -d /dev/media1<br />
<br />
Afterwards, you can take a picture with:<br />
<br />
ffmpeg -s 1280x720 -f video4linux2 -i /dev/video1 -vframes 1 selfie.jpg<br />
<br />
- <code>/dev/media1</code> is the controller interface of the back camera<br />
<br />
- <code>/dev/video1</code> is the back camera stream interface<br />
<br />
If that works, you can try <code>gstreamer</code> to make the camera available for system wide usage:]<br />
<br />
gst-launch-1.0 v4l2src device=/dev/video1 num-buffers=1 ! 'video/x-raw,format=UYVY,width=1280,height=720' ! jpegenc ! filesink location=selfie.jpg<br />
cp selfie.jpg /home/nemo/Pictures<br />
<br />
This command generates a <code>selfie.jpg</code> file and by copying it to <code>/home/nemo/Pictures</code> you can view it with the Gallery app.<br />
<br />
== Audio ==<br />
<br />
1. Unmute the <code>AIF1 Slot 0 Digital DAC</code> channel using <code>alsamixer</code>. Use <code>m</code> to unmute.<br />
<br />
2. Same for <code>Line Out</code> and increase the volume to 100 (default is 0).<br />
<br />
2. Copy the default PulseAudio config: <br />
cp /etc/pulse/default.pa /etc/pulse/arm_native_config.pa<br />
<br />
3. Enable ALSA modules in the new config:<br />
load-module module-alsa-sink<br />
load-module module-alsa-source device=hw:1,0<br />
They are commented out by default.<br />
<br />
4. Configure PulseAudio by changing <code>arm_droid_config.pa</code> to <code>/arm_native_config.pa</code> in <code>/etc/sysconfig/pulseaudio</code>.<br />
<br />
5. Restart PulseAudio or reboot.<br />
<br />
6. Go to the Settings app and test the sound output by playing a ringtone under Sounds and Feedback.<br />
<br />
==PineTab==<br />
<br />
In pinetab we have jack to uart port cable. For enable UART console move selector nearby sd-card slot away from sd-card slot.<br />
<br />
==Testing the vibrator motor==<br />
<br />
You need to have the <code>CONFIG_GPIO_SYSFS</code> enabled in your kernel config for this!<br />
<br />
Vibrator motor is on pin <code>PD2</code>.<br />
You can calculate the PIN number for PD2 as followed ([https://linux-sunxi.org/GPIO more information]):<br />
<code>(4-1) * 32 + 2 = 98</code><br />
<br />
echo "98" > /sys/class/gpio/export # Make pin available<br />
echo "out" > /sys/class/gpio/gpio98/direction # Set as output<br />
echo "1" > /sys/class/gpio/gpio98/value # On<br />
echo "1" > /sys/class/gpio/gpio98/value # Off<br />
echo "98" > /sys/class/gpio/unexport # When you're done<br />
<br />
==Notification LED==<br />
<br />
export COLOR=red # or green, blue is broken due to a hardware fault<br />
# Activate LED<br />
echo 1 > /sys/class/leds/$COLOR/brightness<br />
# Deactivate LED<br />
echo 0 > /sys/class/leds/$COLOR/brightness<br />
<br />
The LED can be controlled in Mer by MCE. You need the <code>mce-plugin-libhybris-nondroid</code> for this.<br />
<br />
In the latest kernel, the control paths of the LED aren't the default ones that the MCE is expecting.<br />
This requires a config file to enable MCE to control the LED on the PinePhone devphone:<br />
<br />
[LEDConfigHybris]<br />
<br />
# Choose Vanilla backend<br />
BackEnd=vanilla<br />
<br />
# Configure base directories for red/green/blue channels<br />
RedDirectory=/sys/class/leds/pinephone:red:user<br />
GreenDirectory=/sys/class/leds/pinephone:green:user<br />
BlueDirectory=/sys/class/leds/pinephone:blue:user<br />
<br />
This config file must be saved in the following file: <code>/etc/mce/99-pinephone.ini</code><br />
<br />
=Installation=<br />
==Prepare SD card==<br />
<br />
Use GParted or any other tool to create the following <code>EXT4</code> partitions:<br />
<br />
# <b>boot</b>: Holds the mainline kernel Image and Device Tree files<br />
# <b>data</b>: Holds the Sailfish OS rootFS<br />
<br />
GParted will ask you to leave the first MB free of the SD card when creating the first partition, this is correct.<br />
This 1 MB will be used to store the U-boot boot loader.<br />
<br />
<b>Note</b>: Make sure you have a <code>msdos</code> partition table! If not, the U-boot flashing will make partition table unusable (in case of GPT for example)!<br />
<br />
==U-Boot==<br />
<br />
We will now build the mainline U-boot boot loader from Git.<br />
<br />
=== Clone ARM Trusted Firmware (master branch) ===<br />
<br />
git clone https://github.com/ARM-software/arm-trusted-firmware.git<br />
<br />
=== Build the BL31.bin ===<br />
<br />
Follow the instructions here: https://github.com/u-boot/u-boot/blob/master/board/sunxi/README.sunxi64<br />
<br />
Quick start:<br />
<br />
export CROSS_COMPILE=aarch64-linux-gnu-<br />
ARCH=arm64 make PLAT=sun50i_a64 DEBUG=1 bl31<br />
export BL31=/path/to/bl31.bin # Probably: ~/arm-trusted-firmware/build/sun50i_a64/debug/bl31.bin<br />
<br />
=== Clone U-boot (master branch): ===<br />
<br />
You can find the U-boot mirror repository on Github:<br />
<br />
git clone https://github.com/u-boot/u-boot.git<br />
<br />
=== Compile U-boot ===<br />
<br />
You have to cross compile U-boot with the <code>arm64</code> arch:<br />
<br />
export CROSS_COMPILE=aarch64-linux-gnu-<br />
ARCH=arm64 make clean<br />
ARCH=arm64 make sopine_baseboard_defconfig # U-boot upstream, use pinephone_defconfig when using pine64-org's U-boot with enhanced PinePhone support<br />
ARCH=arm64 make<br />
<br />
The <code>sopine_baseboard_defconfig</code> is the same for the Don't Be Evil devkit.<br />
<br />
=== Burn U-boot to your SD card ===<br />
<br />
Copy the compiled U-boot bootloader to the first sector on your SD card:<br />
<br />
sudo dd if=u-boot-sunxi-with-spl.bin of=/dev/sdX bs=8k seek=1<br />
<br />
<br />
=== Manually loading the kernel ===<br />
<br />
Serial TTY Baudrate over UART = 115200 for screen, example: <code>screen /dev/ttyUSB0 115200</code><br />
You have to start screen first, before turning on the devkit.<br />
<br />
Interrupt the U-boot autoboot process when you see a message in the U-boot prompt. <br />
We need to access the U-boot prompt to load the Kernel image and boot it manually!<br />
<br />
Set bootargs:<br />
<br />
setenv bootargs root=/dev/mmcblk0p2 rootwait panic=10<br />
<br />
Kernel Image loading and Device Tree files:<br />
<br />
ext4load mmc 0:1 ${kernel_addr_r} /Image <br />
ext4load mmc 0:1 ${fdt_addr_r} /sun50i-a64-pinephone.dtb <br />
<br />
Boot the kernel:<br />
<br />
booti ${kernel_addr_r} - ${fdt_addr_r}<br />
<br />
=== Automatic boot ===<br />
<br />
Create a <code>boot.cmd</code> file for the '''PinePhone''':<br />
<br />
echo Setting bootargs<br />
setenv bootargs console=tty0 console=ttyS0,115200 root=/dev/mmcblk0p2 no_console_suspend rootwait quiet<br />
earlycon=uart,mmio32,0x01c28000 panic=10 consoleblank=0 loglevel=0<br />
printenv<br />
echo Loading DTB<br />
load mmc 0:1 ${fdt_addr_r} /sun50i-a64-pinephone.dtb<br />
echo Loading kernel Image<br />
load mmc 0:1 ${kernel_addr_r} /Image<br />
echo Booting kernel NOW<br />
booti ${kernel_addr_r} - ${fdt_addr_r}<br />
<br />
Create a <code>boot.cmd</code> file for the '''PineTab''':<br />
<br />
echo Setting bootargs<br />
setenv bootargs console=tty0 console=ttyS0,115200 root=/dev/mmcblk0p2 no_console_suspend rootwait quiet<br />
earlycon=uart,mmio32,0x01c28000 panic=10 consoleblank=0 loglevel=0<br />
printenv<br />
echo Loading DTB<br />
load mmc 0:1 ${fdt_addr_r} /sun50i-a64-pinetab.dtb<br />
echo Loading kernel Image<br />
load mmc 0:1 ${kernel_addr_r} /Image<br />
echo Booting kernel NOW<br />
booti ${kernel_addr_r} - ${fdt_addr_r}<br />
<br />
Mount your <code>boot</code> partition and run the following command:<br />
sudo mkimage -C none -A arm -T script -d /mnt/boot.cmd /mnt/boot.scr<br />
<br />
This will translate the <code>boot.cmd</code> file into a U-boot script.<br />
<br />
If you don't have the <code>mkimage</code> command available, you can install it from the <code>uboot-tools</code> package.<br />
<br />
==Kernel==<br />
<br />
The PinePhone runs a mainline kernel, device tree modifications are done by all the PinePhone OS developers on Gitlab (https://gitlab.com/pine64-org/linux).<br />
<br />
=== Clone the kernel ===<br />
<br />
git clone https://gitlab.com/pine64-org/linux<br />
cd linux<br />
git checkout pine64-kernel<br />
<br />
=== Configure the kernel ===<br />
<br />
# <b>Copy our kernel config</b>: https://gitlab.com/pinephone-sailfish-os/linux-kernel/raw/master/pinephone-config<br />
# <b>Enter the <code>linux</code> project</b>: <code>cd linux</code><br />
# <b>Copy the config file</b> to <code>.config</code> in the main directory<br />
<br />
=== Enable WiFi out-of-tree driver ===<br />
<br />
Add the driver to the kernel:<br />
cd drivers/staging<br />
git clone https://github.com/Icenowy/rtl8723cs.git<br />
<br />
Configure the kernel build system now:<br />
<br />
# <b>Add this line to <code>drivers/staging/Kconfig</code></b>: <code>source "drivers/staging/rtl8723cs/Kconfig"</code><br />
# <b>Add this line to <code>drivers/staging/Makefile</code></b>: <code>obj-$(CONFIG_RTL8723CS) += rtl8723cs/</code><br />
# <b>Enable the driver in the kernel config:</b> <code>CONFIG_RTL8723CS=m</code><br />
<br />
See: [https://gitlab.com/postmarketOS/pmaports/blob/master/main/linux-postmarketos-allwinner/rtl8723cs.patch https://gitlab.com/postmarketOS/pmaports/blob/master/main/linux-postmarketos-allwinner/rtl8723cs.patch]<br />
<br />
=== Build the kernel ===<br />
<br />
We cross compile the kernel for ARM64.<br />
The <code>LOCALVERSION</code> variable can be used to add a version to the build.<br />
<br />
Cross compile the kernel:<br />
export ARCH=arm64<br />
export CROSS_COMPILE=aarch64-linux-gnu-<br />
export LOCALVERSION=-nemo<br />
make clean<br />
make defconfig KBUILD_DEFCONFIG=config-sailfishos-allwinner.aarch64<br />
make -j4 Image modules dtbs<br />
<br />
Install the kernel modules in a different path: <br />
make modules_install INSTALL_MOD_PATH=../linux_modules/<br />
<br />
=== Install kernel ===<br />
<br />
Copy the following things:<br />
<br />
# <b>Image</b> from <code>arch/arm64/boot/Image</code> to the root of the <code>boot</code> partition.<br />
# <b>Device tree files</b> <br />
For pinethone <code>arch/arm64/boot/dts/allwinner/sun50i-a64-pinephone.dtb</code> and <code>arch/arm64/boot/dts/allwinner/sun50i-a64-pinephone.dts</code> to the root of the <code>boot</code> partition.<br />
<br />
For pinetab <code>arch/arm64/boot/dts/allwinner/sun50i-a64-pinetab.dtb</code> and <code>arch/arm64/boot/dts/allwinner/sun50i-a64-pinetab.dts</code> to the root of the <code>boot</code> partition.<br />
# <b>Modules</b> from <code>../linux_modules</code> to <code>/lib/modules</code> on the <code>data</code> partition.<br />
<br />
==Nemo Mobile==<br />
<br />
Nemo Mobile have same MW with SFOS but use gcc8 have aarch64 support and use newset version of packages.<br />
<br />
git of device config: https://github.com/neochapay/nemo-device-dont_be_evil<br />
<br />
For build last release of nemo use this ks file https://gist.github.com/neochapay/8d40f9ee1e5fd621e0053aa126d39e81<br />
<br />
==Sailfish OS==<br />
<br />
===Github & OBS project===<br />
<br />
- https://github.com/sailfish-on-dontbeevil<br />
<br />
- https://build.merproject.org/project/show/nemo:devel:hw:pine:dontbeevil<br />
<br />
===Flash rootFS===<br />
You can download the latest rootFS from the Gitlab SailfishOS Porters CI: https://gitlab.com/sailfishos-porters-ci/dont_be_evil-ci (see the artifacts of the latest CI job).<br />
<br />
This <code>tar.gz</code> archive should be burned to the <code>data</code> partition of the SD card.<br />
It's important to burn it as the root user (not with sudo) to preserve extended attributes and ACLs: <br />
<br />
sudo su<br />
bsdtar -xpf <SAILFISH OS ROOTFS>.tar.bz2 -C <MOUNTPOINT OF /DATA><br />
<br />
===Device repos===<br />
To boot Lipstick, you need to add the device specific repos to the devkit.<br />
All the following commands are executed in a shell on the devkit.<br />
<br />
''Make sure you configure the ethernet interface first before you continue!''<br />
''You need to have access to the WWW to fetch the necessary repository data and packages.''<br />
<br />
Install zypper manually:<br />
curl -o augeas-lib.rpm http://repo.merproject.org/obs/mer:/core/latest_armv7hl/armv7hl/augeas-libs-1.6.0+git1-1.10.6.armv7hl.rpm<br />
curl -o zypper.rpm http://repo.merproject.org/obs/mer:/core/latest_armv7hl/armv7hl/zypper-1.14.6+git3-1.24.5.armv7hl.rpm<br />
rpm -Uvh *rpm<br />
<br />
Use <code>ssu</code> to add the repo<br />
ssu ar common http://repo.merproject.org/obs/nemo:/devel:/hw:/common/sailfish_latest_armv7hl/<br />
ssu ar dontbeevil http://repo.merproject.org/obs/home:/piggz:/dontbeevil/sailfishos_3.0.3.9_latest_armv7hl/<br />
ssu ar jolla https://releases.jolla.com/releases/3.0.3.9/jolla/armv7hl/<br />
<br />
Refresh the repo:<br />
zypper refresh<br />
<br />
Install the device packages:<br />
zypper install dontbeevil:qt5-qtcore dontbeevil:qt5-qttest dontbeevil:lipstick-qt5<br />
zypper install droid-config-dontbeevil # Select 1 for vendor change<br />
zypper install droid-config-dontbeevil-sailfish<br />
zypper install qt5-plugin-platform-eglfs # EGLFS LIMA plugin<br />
zypper install qt5-plugin-generic-evdev # evdev input plugins<br />
<br />
Other useful packages<br />
zypper install mce-tools #useful for mcetool (mcetool -U activates the screen)<br />
<br />
===Unknown password===<br />
The Sailfish OS rootFS sets a random password when booting for the first time.<br />
You can only log in through the <code>telnet</code> debug interface.<br />
Since the <code>eth0</code> interface still requires manually setup, you can't access <code>telnet</code>.<br />
<br />
To circumvent this issue, you can login through the UART TTY interface. <br />
However you don't know the password of the <code>root</code> nor <code>nemo</code> users!<br />
To disable the <code>root</code> and <code>nemo</code> passwords, we can modify the <code>/etc/shadow</code> file:<br />
<br />
sudo chmod +w <SD card data partition>/etc/shadow<br />
sudo vim <SD card data partition>/etc/shadow # Remove any characters where <HASHED PASSWORD> is written: user1:<HASHED PASSWORD>:16092:0:99999:7:::.<br />
sudo chmod -w <SD card data partition>/etc/shadow<br />
<br />
By removing the hashed password, we can login with the user without entering a password.<br />
You can set a new password afterwards by running as a logged in user:<br />
<br />
passwd<br />
<br />
===Init eth0===<br />
Enabling the <code>eth0</code> interface has to be done manually for now:<br />
<br />
ifconfig eth0 <YOUR_IP><br />
route add default gw <DEFAULT_GATEWAY_IP><br />
echo "nameserver <DNS_SERVER_IP>" > /etc/resolv.conf<br />
<br />
Test your configuration with <code>ping</code>:<br />
<br />
ping jolla.com<br />
<br />
<br />
===Lipstick crashing===<br />
<br />
Install Lipstick from the <code>dontbeevil</code> repository:<br />
<br />
zypper install dontbeevil:lipstick-qt5<br />
<br />
As from 3.1.0.12, this fix is obsolete.<br />
<br />
===No setup wizard===<br />
<br />
Make sure the configuration package is installed:<br />
<br />
zypper install droid-config-dontbeevil-sailfish<br />
<br />
===Missing regulatory.db for RT8723BS WiFi/BT module===<br />
<br />
git clone git://git.kernel.org/pub/scm/linux/kernel/git/sforshee/wireless-regdb.git<br />
cd wireless-regdb<br />
cp regulatory* /lib/firmware</div>Dylanvanasschttps://wiki.merproject.org/wiki/Adaptations/PinePhone64Adaptations/PinePhone642020-03-24T18:01:41Z<p>Dylanvanassc: /* Build the BL31.bin */</p>
<hr />
<div>=Hardware Support=<br />
<br />
Full information of hardware spec [https://wiki.pine64.org/index.php/Project_Don't_be_evil Here]<br />
<br />
PostMarket OS hardware information [https://wiki.postmarketos.org/wiki/Pine_Don%27t_be_evil_devkit_(pine-dontbeevil) PostMarketOS Wiki]<br />
<br />
==WiFi/BT RTL8723CS==<br />
<br />
=== WiFi ===<br />
The WiFi driver isn't available in the Linux kernel yet. However, we can compile it as an out-of-tree driver for now.<br />
See kernel building for more instruction<br />
<br />
=== Bluetooth ===<br />
The production version of the PineTab and PinePhone are both using the Realtek 8723CS WiFi/BT module.<br />
BT is natively supported after adding the necessary firmware from [https://github.com/anarsoul/rtl8723bt-firmware/tree/master/rtl_bt https://github.com/anarsoul/rtl8723bt-firmware/tree/master/rtl_bt]<br />
Download all the <code>*.bin</code> files and copy them to the <code>/lib/firmware/rtl_bt</code> directory in the rootFS.<br />
<br />
==Modem EC25==<br />
<br />
===Setup===<br />
<br />
1. Make sure that the <code>qmimodem</code> plugin is enabled in the <code>.spec</code> of <code>ofono</code>.<br />
<br />
2. Remove the <code>noplugin.conf</code> file under <code>/lib/environment/ofono/noplugin.conf</code>.<br />
<br />
3. Restart <code>ofono</code><br />
systemctl restart ofono<br />
<br />
4. Check if the QMI modem is properly detected:<br />
/usr/lib/ofono/test/list-modems<br />
<br />
5. Unlock you SIM card (if needed):<br />
/usr/lib/ofono/test/enter-pin /quectelqmi_0 pin <PIN CODE><br />
<br />
The EC25 Quectel modem is now ready :)<br />
Thanks to SuperPrower for the hard work!<br />
<br />
===Sending SMS===<br />
<br />
/usr/lib/ofono/test/send-sms <PHONE NUMBER RECEIVER> <MESSAGE> <DELIVERY REPORT><br />
<br />
To skip the delivery report, use <code>0</code> as argument.<br />
<br />
==Cameras==<br />
<br />
Thanks to: https://wiki.postmarketos.org/wiki/Pine_Don't_be_evil_devkit_(pine-dontbeevil)#Cameras<br />
Only the back camera is supported by the mainline kernel.<br />
To use it, you need to configure it first:<br />
<br />
media-ctl --set-v4l2 '"ov5640 2-003c":0[fmt:UYVY8_2X8/1280x7200]' -d /dev/media1<br />
<br />
Afterwards, you can take a picture with:<br />
<br />
ffmpeg -s 1280x720 -f video4linux2 -i /dev/video1 -vframes 1 selfie.jpg<br />
<br />
- <code>/dev/media1</code> is the controller interface of the back camera<br />
<br />
- <code>/dev/video1</code> is the back camera stream interface<br />
<br />
If that works, you can try <code>gstreamer</code> to make the camera available for system wide usage:]<br />
<br />
gst-launch-1.0 v4l2src device=/dev/video1 num-buffers=1 ! 'video/x-raw,format=UYVY,width=1280,height=720' ! jpegenc ! filesink location=selfie.jpg<br />
cp selfie.jpg /home/nemo/Pictures<br />
<br />
This command generates a <code>selfie.jpg</code> file and by copying it to <code>/home/nemo/Pictures</code> you can view it with the Gallery app.<br />
<br />
== Audio ==<br />
<br />
1. Unmute the <code>AIF1 Slot 0 Digital DAC</code> channel using <code>alsamixer</code>. Use <code>m</code> to unmute.<br />
<br />
2. Same for <code>Line Out</code> and increase the volume to 100 (default is 0).<br />
<br />
2. Copy the default PulseAudio config: <br />
cp /etc/pulse/default.pa /etc/pulse/arm_native_config.pa<br />
<br />
3. Enable ALSA modules in the new config:<br />
load-module module-alsa-sink<br />
load-module module-alsa-source device=hw:1,0<br />
They are commented out by default.<br />
<br />
4. Configure PulseAudio by changing <code>arm_droid_config.pa</code> to <code>/arm_native_config.pa</code> in <code>/etc/sysconfig/pulseaudio</code>.<br />
<br />
5. Restart PulseAudio or reboot.<br />
<br />
6. Go to the Settings app and test the sound output by playing a ringtone under Sounds and Feedback.<br />
<br />
==PineTab==<br />
<br />
In pinetab we have jack to uart port cable. For enable UART console move selector nearby sd-card slot away from sd-card slot.<br />
<br />
==Testing the vibrator motor==<br />
<br />
You need to have the <code>CONFIG_GPIO_SYSFS</code> enabled in your kernel config for this!<br />
<br />
Vibrator motor is on pin <code>PD2</code>.<br />
You can calculate the PIN number for PD2 as followed ([https://linux-sunxi.org/GPIO more information]):<br />
<code>(4-1) * 32 + 2 = 98</code><br />
<br />
echo "98" > /sys/class/gpio/export # Make pin available<br />
echo "out" > /sys/class/gpio/gpio98/direction # Set as output<br />
echo "1" > /sys/class/gpio/gpio98/value # On<br />
echo "1" > /sys/class/gpio/gpio98/value # Off<br />
echo "98" > /sys/class/gpio/unexport # When you're done<br />
<br />
==Notification LED==<br />
<br />
export COLOR=red # or green, blue is broken due to a hardware fault<br />
# Activate LED<br />
echo 1 > /sys/class/leds/$COLOR/brightness<br />
# Deactivate LED<br />
echo 0 > /sys/class/leds/$COLOR/brightness<br />
<br />
The LED can be controlled in Mer by MCE. You need the <code>mce-plugin-libhybris-nondroid</code> for this.<br />
<br />
In the latest kernel, the control paths of the LED aren't the default ones that the MCE is expecting.<br />
This requires a config file to enable MCE to control the LED on the PinePhone devphone:<br />
<br />
[LEDConfigHybris]<br />
<br />
# Choose Vanilla backend<br />
BackEnd=vanilla<br />
<br />
# Configure base directories for red/green/blue channels<br />
RedDirectory=/sys/class/leds/pinephone:red:user<br />
GreenDirectory=/sys/class/leds/pinephone:green:user<br />
BlueDirectory=/sys/class/leds/pinephone:blue:user<br />
<br />
This config file must be saved in the following file: <code>/etc/mce/99-pinephone.ini</code><br />
<br />
=Installation=<br />
==Prepare SD card==<br />
<br />
Use GParted or any other tool to create the following <code>EXT4</code> partitions:<br />
<br />
# <b>boot</b>: Holds the mainline kernel Image and Device Tree files<br />
# <b>data</b>: Holds the Sailfish OS rootFS<br />
<br />
GParted will ask you to leave the first MB free of the SD card when creating the first partition, this is correct.<br />
This 1 MB will be used to store the U-boot boot loader.<br />
<br />
<b>Note</b>: Make sure you have a <code>msdos</code> partition table! If not, the U-boot flashing will make partition table unusable (in case of GPT for example)!<br />
<br />
==U-Boot==<br />
<br />
We will now build the mainline U-boot boot loader from Git.<br />
<br />
=== Clone ARM Trusted Firmware (master branch) ===<br />
<br />
git clone https://github.com/ARM-software/arm-trusted-firmware.git<br />
<br />
=== Build the BL31.bin ===<br />
<br />
Follow the instructions here: https://github.com/u-boot/u-boot/blob/master/board/sunxi/README.sunxi64<br />
<br />
Quick start:<br />
<br />
export CROSS_COMPILE=aarch64-linux-gnu-<br />
ARCH=arm64 make PLAT=sun50i_a64 DEBUG=1 bl31<br />
export BL31=/path/to/bl31.bin # Probably: ../build/sun50i_a64/debug/bl31.bin<br />
<br />
=== Clone U-boot (master branch): ===<br />
<br />
You can find the U-boot mirror repository on Github:<br />
<br />
git clone https://github.com/u-boot/u-boot.git<br />
<br />
=== Compile U-boot ===<br />
<br />
You have to cross compile U-boot with the <code>arm64</code> arch:<br />
<br />
export CROSS_COMPILE=aarch64-linux-gnu-<br />
ARCH=arm64 make clean<br />
ARCH=arm64 make sopine_baseboard_defconfig # U-boot upstream, use pinephone_defconfig when using pine64-org's U-boot with enhanced PinePhone support<br />
ARCH=arm64 make<br />
<br />
The <code>sopine_baseboard_defconfig</code> is the same for the Don't Be Evil devkit.<br />
<br />
=== Burn U-boot to your SD card ===<br />
<br />
Copy the compiled U-boot bootloader to the first sector on your SD card:<br />
<br />
sudo dd if=u-boot-sunxi-with-spl.bin of=/dev/sdX bs=8k seek=1<br />
<br />
<br />
=== Manually loading the kernel ===<br />
<br />
Serial TTY Baudrate over UART = 115200 for screen, example: <code>screen /dev/ttyUSB0 115200</code><br />
You have to start screen first, before turning on the devkit.<br />
<br />
Interrupt the U-boot autoboot process when you see a message in the U-boot prompt. <br />
We need to access the U-boot prompt to load the Kernel image and boot it manually!<br />
<br />
Set bootargs:<br />
<br />
setenv bootargs root=/dev/mmcblk0p2 rootwait panic=10<br />
<br />
Kernel Image loading and Device Tree files:<br />
<br />
ext4load mmc 0:1 ${kernel_addr_r} /Image <br />
ext4load mmc 0:1 ${fdt_addr_r} /sun50i-a64-pinephone.dtb <br />
<br />
Boot the kernel:<br />
<br />
booti ${kernel_addr_r} - ${fdt_addr_r}<br />
<br />
=== Automatic boot ===<br />
<br />
Create a <code>boot.cmd</code> file for the '''PinePhone''':<br />
<br />
echo Setting bootargs<br />
setenv bootargs console=tty0 console=ttyS0,115200 root=/dev/mmcblk0p2 no_console_suspend rootwait quiet<br />
earlycon=uart,mmio32,0x01c28000 panic=10 consoleblank=0 loglevel=0<br />
printenv<br />
echo Loading DTB<br />
load mmc 0:1 ${fdt_addr_r} /sun50i-a64-pinephone.dtb<br />
echo Loading kernel Image<br />
load mmc 0:1 ${kernel_addr_r} /Image<br />
echo Booting kernel NOW<br />
booti ${kernel_addr_r} - ${fdt_addr_r}<br />
<br />
Create a <code>boot.cmd</code> file for the '''PineTab''':<br />
<br />
echo Setting bootargs<br />
setenv bootargs console=tty0 console=ttyS0,115200 root=/dev/mmcblk0p2 no_console_suspend rootwait quiet<br />
earlycon=uart,mmio32,0x01c28000 panic=10 consoleblank=0 loglevel=0<br />
printenv<br />
echo Loading DTB<br />
load mmc 0:1 ${fdt_addr_r} /sun50i-a64-pinetab.dtb<br />
echo Loading kernel Image<br />
load mmc 0:1 ${kernel_addr_r} /Image<br />
echo Booting kernel NOW<br />
booti ${kernel_addr_r} - ${fdt_addr_r}<br />
<br />
Mount your <code>boot</code> partition and run the following command:<br />
sudo mkimage -C none -A arm -T script -d /mnt/boot.cmd /mnt/boot.scr<br />
<br />
This will translate the <code>boot.cmd</code> file into a U-boot script.<br />
<br />
If you don't have the <code>mkimage</code> command available, you can install it from the <code>uboot-tools</code> package.<br />
<br />
==Kernel==<br />
<br />
The PinePhone runs a mainline kernel, device tree modifications are done by all the PinePhone OS developers on Gitlab (https://gitlab.com/pine64-org/linux).<br />
<br />
=== Clone the kernel ===<br />
<br />
git clone https://gitlab.com/pine64-org/linux<br />
cd linux<br />
git checkout pine64-kernel<br />
<br />
=== Configure the kernel ===<br />
<br />
# <b>Copy our kernel config</b>: https://gitlab.com/pinephone-sailfish-os/linux-kernel/raw/master/pinephone-config<br />
# <b>Enter the <code>linux</code> project</b>: <code>cd linux</code><br />
# <b>Copy the config file</b> to <code>.config</code> in the main directory<br />
<br />
=== Enable WiFi out-of-tree driver ===<br />
<br />
Add the driver to the kernel:<br />
cd drivers/staging<br />
git clone https://github.com/Icenowy/rtl8723cs.git<br />
<br />
Configure the kernel build system now:<br />
<br />
# <b>Add this line to <code>drivers/staging/Kconfig</code></b>: <code>source "drivers/staging/rtl8723cs/Kconfig"</code><br />
# <b>Add this line to <code>drivers/staging/Makefile</code></b>: <code>obj-$(CONFIG_RTL8723CS) += rtl8723cs/</code><br />
# <b>Enable the driver in the kernel config:</b> <code>CONFIG_RTL8723CS=m</code><br />
<br />
See: [https://gitlab.com/postmarketOS/pmaports/blob/master/main/linux-postmarketos-allwinner/rtl8723cs.patch https://gitlab.com/postmarketOS/pmaports/blob/master/main/linux-postmarketos-allwinner/rtl8723cs.patch]<br />
<br />
=== Build the kernel ===<br />
<br />
We cross compile the kernel for ARM64.<br />
The <code>LOCALVERSION</code> variable can be used to add a version to the build.<br />
<br />
Cross compile the kernel:<br />
export ARCH=arm64<br />
export CROSS_COMPILE=aarch64-linux-gnu-<br />
export LOCALVERSION=-nemo<br />
make clean<br />
make defconfig KBUILD_DEFCONFIG=config-sailfishos-allwinner.aarch64<br />
make -j4 Image modules dtbs<br />
<br />
Install the kernel modules in a different path: <br />
make modules_install INSTALL_MOD_PATH=../linux_modules/<br />
<br />
=== Install kernel ===<br />
<br />
Copy the following things:<br />
<br />
# <b>Image</b> from <code>arch/arm64/boot/Image</code> to the root of the <code>boot</code> partition.<br />
# <b>Device tree files</b> <br />
For pinethone <code>arch/arm64/boot/dts/allwinner/sun50i-a64-pinephone.dtb</code> and <code>arch/arm64/boot/dts/allwinner/sun50i-a64-pinephone.dts</code> to the root of the <code>boot</code> partition.<br />
<br />
For pinetab <code>arch/arm64/boot/dts/allwinner/sun50i-a64-pinetab.dtb</code> and <code>arch/arm64/boot/dts/allwinner/sun50i-a64-pinetab.dts</code> to the root of the <code>boot</code> partition.<br />
# <b>Modules</b> from <code>../linux_modules</code> to <code>/lib/modules</code> on the <code>data</code> partition.<br />
<br />
==Nemo Mobile==<br />
<br />
Nemo Mobile have same MW with SFOS but use gcc8 have aarch64 support and use newset version of packages.<br />
<br />
git of device config: https://github.com/neochapay/nemo-device-dont_be_evil<br />
<br />
For build last release of nemo use this ks file https://gist.github.com/neochapay/8d40f9ee1e5fd621e0053aa126d39e81<br />
<br />
==Sailfish OS==<br />
<br />
===Github & OBS project===<br />
<br />
- https://github.com/sailfish-on-dontbeevil<br />
<br />
- https://build.merproject.org/project/show/nemo:devel:hw:pine:dontbeevil<br />
<br />
===Flash rootFS===<br />
You can download the latest rootFS from the Gitlab SailfishOS Porters CI: https://gitlab.com/sailfishos-porters-ci/dont_be_evil-ci (see the artifacts of the latest CI job).<br />
<br />
This <code>tar.gz</code> archive should be burned to the <code>data</code> partition of the SD card.<br />
It's important to burn it as the root user (not with sudo) to preserve extended attributes and ACLs: <br />
<br />
sudo su<br />
bsdtar -xpf <SAILFISH OS ROOTFS>.tar.bz2 -C <MOUNTPOINT OF /DATA><br />
<br />
===Device repos===<br />
To boot Lipstick, you need to add the device specific repos to the devkit.<br />
All the following commands are executed in a shell on the devkit.<br />
<br />
''Make sure you configure the ethernet interface first before you continue!''<br />
''You need to have access to the WWW to fetch the necessary repository data and packages.''<br />
<br />
Install zypper manually:<br />
curl -o augeas-lib.rpm http://repo.merproject.org/obs/mer:/core/latest_armv7hl/armv7hl/augeas-libs-1.6.0+git1-1.10.6.armv7hl.rpm<br />
curl -o zypper.rpm http://repo.merproject.org/obs/mer:/core/latest_armv7hl/armv7hl/zypper-1.14.6+git3-1.24.5.armv7hl.rpm<br />
rpm -Uvh *rpm<br />
<br />
Use <code>ssu</code> to add the repo<br />
ssu ar common http://repo.merproject.org/obs/nemo:/devel:/hw:/common/sailfish_latest_armv7hl/<br />
ssu ar dontbeevil http://repo.merproject.org/obs/home:/piggz:/dontbeevil/sailfishos_3.0.3.9_latest_armv7hl/<br />
ssu ar jolla https://releases.jolla.com/releases/3.0.3.9/jolla/armv7hl/<br />
<br />
Refresh the repo:<br />
zypper refresh<br />
<br />
Install the device packages:<br />
zypper install dontbeevil:qt5-qtcore dontbeevil:qt5-qttest dontbeevil:lipstick-qt5<br />
zypper install droid-config-dontbeevil # Select 1 for vendor change<br />
zypper install droid-config-dontbeevil-sailfish<br />
zypper install qt5-plugin-platform-eglfs # EGLFS LIMA plugin<br />
zypper install qt5-plugin-generic-evdev # evdev input plugins<br />
<br />
Other useful packages<br />
zypper install mce-tools #useful for mcetool (mcetool -U activates the screen)<br />
<br />
===Unknown password===<br />
The Sailfish OS rootFS sets a random password when booting for the first time.<br />
You can only log in through the <code>telnet</code> debug interface.<br />
Since the <code>eth0</code> interface still requires manually setup, you can't access <code>telnet</code>.<br />
<br />
To circumvent this issue, you can login through the UART TTY interface. <br />
However you don't know the password of the <code>root</code> nor <code>nemo</code> users!<br />
To disable the <code>root</code> and <code>nemo</code> passwords, we can modify the <code>/etc/shadow</code> file:<br />
<br />
sudo chmod +w <SD card data partition>/etc/shadow<br />
sudo vim <SD card data partition>/etc/shadow # Remove any characters where <HASHED PASSWORD> is written: user1:<HASHED PASSWORD>:16092:0:99999:7:::.<br />
sudo chmod -w <SD card data partition>/etc/shadow<br />
<br />
By removing the hashed password, we can login with the user without entering a password.<br />
You can set a new password afterwards by running as a logged in user:<br />
<br />
passwd<br />
<br />
===Init eth0===<br />
Enabling the <code>eth0</code> interface has to be done manually for now:<br />
<br />
ifconfig eth0 <YOUR_IP><br />
route add default gw <DEFAULT_GATEWAY_IP><br />
echo "nameserver <DNS_SERVER_IP>" > /etc/resolv.conf<br />
<br />
Test your configuration with <code>ping</code>:<br />
<br />
ping jolla.com<br />
<br />
<br />
===Lipstick crashing===<br />
<br />
Install Lipstick from the <code>dontbeevil</code> repository:<br />
<br />
zypper install dontbeevil:lipstick-qt5<br />
<br />
As from 3.1.0.12, this fix is obsolete.<br />
<br />
===No setup wizard===<br />
<br />
Make sure the configuration package is installed:<br />
<br />
zypper install droid-config-dontbeevil-sailfish<br />
<br />
===Missing regulatory.db for RT8723BS WiFi/BT module===<br />
<br />
git clone git://git.kernel.org/pub/scm/linux/kernel/git/sforshee/wireless-regdb.git<br />
cd wireless-regdb<br />
cp regulatory* /lib/firmware</div>Dylanvanasschttps://wiki.merproject.org/wiki/Adaptations/PinePhone64Adaptations/PinePhone642020-03-24T18:00:27Z<p>Dylanvanassc: /* Compile U-boot */</p>
<hr />
<div>=Hardware Support=<br />
<br />
Full information of hardware spec [https://wiki.pine64.org/index.php/Project_Don't_be_evil Here]<br />
<br />
PostMarket OS hardware information [https://wiki.postmarketos.org/wiki/Pine_Don%27t_be_evil_devkit_(pine-dontbeevil) PostMarketOS Wiki]<br />
<br />
==WiFi/BT RTL8723CS==<br />
<br />
=== WiFi ===<br />
The WiFi driver isn't available in the Linux kernel yet. However, we can compile it as an out-of-tree driver for now.<br />
See kernel building for more instruction<br />
<br />
=== Bluetooth ===<br />
The production version of the PineTab and PinePhone are both using the Realtek 8723CS WiFi/BT module.<br />
BT is natively supported after adding the necessary firmware from [https://github.com/anarsoul/rtl8723bt-firmware/tree/master/rtl_bt https://github.com/anarsoul/rtl8723bt-firmware/tree/master/rtl_bt]<br />
Download all the <code>*.bin</code> files and copy them to the <code>/lib/firmware/rtl_bt</code> directory in the rootFS.<br />
<br />
==Modem EC25==<br />
<br />
===Setup===<br />
<br />
1. Make sure that the <code>qmimodem</code> plugin is enabled in the <code>.spec</code> of <code>ofono</code>.<br />
<br />
2. Remove the <code>noplugin.conf</code> file under <code>/lib/environment/ofono/noplugin.conf</code>.<br />
<br />
3. Restart <code>ofono</code><br />
systemctl restart ofono<br />
<br />
4. Check if the QMI modem is properly detected:<br />
/usr/lib/ofono/test/list-modems<br />
<br />
5. Unlock you SIM card (if needed):<br />
/usr/lib/ofono/test/enter-pin /quectelqmi_0 pin <PIN CODE><br />
<br />
The EC25 Quectel modem is now ready :)<br />
Thanks to SuperPrower for the hard work!<br />
<br />
===Sending SMS===<br />
<br />
/usr/lib/ofono/test/send-sms <PHONE NUMBER RECEIVER> <MESSAGE> <DELIVERY REPORT><br />
<br />
To skip the delivery report, use <code>0</code> as argument.<br />
<br />
==Cameras==<br />
<br />
Thanks to: https://wiki.postmarketos.org/wiki/Pine_Don't_be_evil_devkit_(pine-dontbeevil)#Cameras<br />
Only the back camera is supported by the mainline kernel.<br />
To use it, you need to configure it first:<br />
<br />
media-ctl --set-v4l2 '"ov5640 2-003c":0[fmt:UYVY8_2X8/1280x7200]' -d /dev/media1<br />
<br />
Afterwards, you can take a picture with:<br />
<br />
ffmpeg -s 1280x720 -f video4linux2 -i /dev/video1 -vframes 1 selfie.jpg<br />
<br />
- <code>/dev/media1</code> is the controller interface of the back camera<br />
<br />
- <code>/dev/video1</code> is the back camera stream interface<br />
<br />
If that works, you can try <code>gstreamer</code> to make the camera available for system wide usage:]<br />
<br />
gst-launch-1.0 v4l2src device=/dev/video1 num-buffers=1 ! 'video/x-raw,format=UYVY,width=1280,height=720' ! jpegenc ! filesink location=selfie.jpg<br />
cp selfie.jpg /home/nemo/Pictures<br />
<br />
This command generates a <code>selfie.jpg</code> file and by copying it to <code>/home/nemo/Pictures</code> you can view it with the Gallery app.<br />
<br />
== Audio ==<br />
<br />
1. Unmute the <code>AIF1 Slot 0 Digital DAC</code> channel using <code>alsamixer</code>. Use <code>m</code> to unmute.<br />
<br />
2. Same for <code>Line Out</code> and increase the volume to 100 (default is 0).<br />
<br />
2. Copy the default PulseAudio config: <br />
cp /etc/pulse/default.pa /etc/pulse/arm_native_config.pa<br />
<br />
3. Enable ALSA modules in the new config:<br />
load-module module-alsa-sink<br />
load-module module-alsa-source device=hw:1,0<br />
They are commented out by default.<br />
<br />
4. Configure PulseAudio by changing <code>arm_droid_config.pa</code> to <code>/arm_native_config.pa</code> in <code>/etc/sysconfig/pulseaudio</code>.<br />
<br />
5. Restart PulseAudio or reboot.<br />
<br />
6. Go to the Settings app and test the sound output by playing a ringtone under Sounds and Feedback.<br />
<br />
==PineTab==<br />
<br />
In pinetab we have jack to uart port cable. For enable UART console move selector nearby sd-card slot away from sd-card slot.<br />
<br />
==Testing the vibrator motor==<br />
<br />
You need to have the <code>CONFIG_GPIO_SYSFS</code> enabled in your kernel config for this!<br />
<br />
Vibrator motor is on pin <code>PD2</code>.<br />
You can calculate the PIN number for PD2 as followed ([https://linux-sunxi.org/GPIO more information]):<br />
<code>(4-1) * 32 + 2 = 98</code><br />
<br />
echo "98" > /sys/class/gpio/export # Make pin available<br />
echo "out" > /sys/class/gpio/gpio98/direction # Set as output<br />
echo "1" > /sys/class/gpio/gpio98/value # On<br />
echo "1" > /sys/class/gpio/gpio98/value # Off<br />
echo "98" > /sys/class/gpio/unexport # When you're done<br />
<br />
==Notification LED==<br />
<br />
export COLOR=red # or green, blue is broken due to a hardware fault<br />
# Activate LED<br />
echo 1 > /sys/class/leds/$COLOR/brightness<br />
# Deactivate LED<br />
echo 0 > /sys/class/leds/$COLOR/brightness<br />
<br />
The LED can be controlled in Mer by MCE. You need the <code>mce-plugin-libhybris-nondroid</code> for this.<br />
<br />
In the latest kernel, the control paths of the LED aren't the default ones that the MCE is expecting.<br />
This requires a config file to enable MCE to control the LED on the PinePhone devphone:<br />
<br />
[LEDConfigHybris]<br />
<br />
# Choose Vanilla backend<br />
BackEnd=vanilla<br />
<br />
# Configure base directories for red/green/blue channels<br />
RedDirectory=/sys/class/leds/pinephone:red:user<br />
GreenDirectory=/sys/class/leds/pinephone:green:user<br />
BlueDirectory=/sys/class/leds/pinephone:blue:user<br />
<br />
This config file must be saved in the following file: <code>/etc/mce/99-pinephone.ini</code><br />
<br />
=Installation=<br />
==Prepare SD card==<br />
<br />
Use GParted or any other tool to create the following <code>EXT4</code> partitions:<br />
<br />
# <b>boot</b>: Holds the mainline kernel Image and Device Tree files<br />
# <b>data</b>: Holds the Sailfish OS rootFS<br />
<br />
GParted will ask you to leave the first MB free of the SD card when creating the first partition, this is correct.<br />
This 1 MB will be used to store the U-boot boot loader.<br />
<br />
<b>Note</b>: Make sure you have a <code>msdos</code> partition table! If not, the U-boot flashing will make partition table unusable (in case of GPT for example)!<br />
<br />
==U-Boot==<br />
<br />
We will now build the mainline U-boot boot loader from Git.<br />
<br />
=== Clone ARM Trusted Firmware (master branch) ===<br />
<br />
git clone https://github.com/ARM-software/arm-trusted-firmware.git<br />
<br />
=== Build the BL31.bin ===<br />
<br />
Follow the instructions here: https://github.com/u-boot/u-boot/blob/master/board/sunxi/README.sunxi64<br />
<br />
Quick start:<br />
<br />
export CROSS_COMPILE=aarch64-linux-gnu-<br />
ARCH=arm64 make PLAT=sun50i_a64 DEBUG=1 bl31<br />
export BL31=/path/to/bl31.bin<br />
<br />
=== Clone U-boot (master branch): ===<br />
<br />
You can find the U-boot mirror repository on Github:<br />
<br />
git clone https://github.com/u-boot/u-boot.git<br />
<br />
=== Compile U-boot ===<br />
<br />
You have to cross compile U-boot with the <code>arm64</code> arch:<br />
<br />
export CROSS_COMPILE=aarch64-linux-gnu-<br />
ARCH=arm64 make clean<br />
ARCH=arm64 make sopine_baseboard_defconfig # U-boot upstream, use pinephone_defconfig when using pine64-org's U-boot with enhanced PinePhone support<br />
ARCH=arm64 make<br />
<br />
The <code>sopine_baseboard_defconfig</code> is the same for the Don't Be Evil devkit.<br />
<br />
=== Burn U-boot to your SD card ===<br />
<br />
Copy the compiled U-boot bootloader to the first sector on your SD card:<br />
<br />
sudo dd if=u-boot-sunxi-with-spl.bin of=/dev/sdX bs=8k seek=1<br />
<br />
<br />
=== Manually loading the kernel ===<br />
<br />
Serial TTY Baudrate over UART = 115200 for screen, example: <code>screen /dev/ttyUSB0 115200</code><br />
You have to start screen first, before turning on the devkit.<br />
<br />
Interrupt the U-boot autoboot process when you see a message in the U-boot prompt. <br />
We need to access the U-boot prompt to load the Kernel image and boot it manually!<br />
<br />
Set bootargs:<br />
<br />
setenv bootargs root=/dev/mmcblk0p2 rootwait panic=10<br />
<br />
Kernel Image loading and Device Tree files:<br />
<br />
ext4load mmc 0:1 ${kernel_addr_r} /Image <br />
ext4load mmc 0:1 ${fdt_addr_r} /sun50i-a64-pinephone.dtb <br />
<br />
Boot the kernel:<br />
<br />
booti ${kernel_addr_r} - ${fdt_addr_r}<br />
<br />
=== Automatic boot ===<br />
<br />
Create a <code>boot.cmd</code> file for the '''PinePhone''':<br />
<br />
echo Setting bootargs<br />
setenv bootargs console=tty0 console=ttyS0,115200 root=/dev/mmcblk0p2 no_console_suspend rootwait quiet<br />
earlycon=uart,mmio32,0x01c28000 panic=10 consoleblank=0 loglevel=0<br />
printenv<br />
echo Loading DTB<br />
load mmc 0:1 ${fdt_addr_r} /sun50i-a64-pinephone.dtb<br />
echo Loading kernel Image<br />
load mmc 0:1 ${kernel_addr_r} /Image<br />
echo Booting kernel NOW<br />
booti ${kernel_addr_r} - ${fdt_addr_r}<br />
<br />
Create a <code>boot.cmd</code> file for the '''PineTab''':<br />
<br />
echo Setting bootargs<br />
setenv bootargs console=tty0 console=ttyS0,115200 root=/dev/mmcblk0p2 no_console_suspend rootwait quiet<br />
earlycon=uart,mmio32,0x01c28000 panic=10 consoleblank=0 loglevel=0<br />
printenv<br />
echo Loading DTB<br />
load mmc 0:1 ${fdt_addr_r} /sun50i-a64-pinetab.dtb<br />
echo Loading kernel Image<br />
load mmc 0:1 ${kernel_addr_r} /Image<br />
echo Booting kernel NOW<br />
booti ${kernel_addr_r} - ${fdt_addr_r}<br />
<br />
Mount your <code>boot</code> partition and run the following command:<br />
sudo mkimage -C none -A arm -T script -d /mnt/boot.cmd /mnt/boot.scr<br />
<br />
This will translate the <code>boot.cmd</code> file into a U-boot script.<br />
<br />
If you don't have the <code>mkimage</code> command available, you can install it from the <code>uboot-tools</code> package.<br />
<br />
==Kernel==<br />
<br />
The PinePhone runs a mainline kernel, device tree modifications are done by all the PinePhone OS developers on Gitlab (https://gitlab.com/pine64-org/linux).<br />
<br />
=== Clone the kernel ===<br />
<br />
git clone https://gitlab.com/pine64-org/linux<br />
cd linux<br />
git checkout pine64-kernel<br />
<br />
=== Configure the kernel ===<br />
<br />
# <b>Copy our kernel config</b>: https://gitlab.com/pinephone-sailfish-os/linux-kernel/raw/master/pinephone-config<br />
# <b>Enter the <code>linux</code> project</b>: <code>cd linux</code><br />
# <b>Copy the config file</b> to <code>.config</code> in the main directory<br />
<br />
=== Enable WiFi out-of-tree driver ===<br />
<br />
Add the driver to the kernel:<br />
cd drivers/staging<br />
git clone https://github.com/Icenowy/rtl8723cs.git<br />
<br />
Configure the kernel build system now:<br />
<br />
# <b>Add this line to <code>drivers/staging/Kconfig</code></b>: <code>source "drivers/staging/rtl8723cs/Kconfig"</code><br />
# <b>Add this line to <code>drivers/staging/Makefile</code></b>: <code>obj-$(CONFIG_RTL8723CS) += rtl8723cs/</code><br />
# <b>Enable the driver in the kernel config:</b> <code>CONFIG_RTL8723CS=m</code><br />
<br />
See: [https://gitlab.com/postmarketOS/pmaports/blob/master/main/linux-postmarketos-allwinner/rtl8723cs.patch https://gitlab.com/postmarketOS/pmaports/blob/master/main/linux-postmarketos-allwinner/rtl8723cs.patch]<br />
<br />
=== Build the kernel ===<br />
<br />
We cross compile the kernel for ARM64.<br />
The <code>LOCALVERSION</code> variable can be used to add a version to the build.<br />
<br />
Cross compile the kernel:<br />
export ARCH=arm64<br />
export CROSS_COMPILE=aarch64-linux-gnu-<br />
export LOCALVERSION=-nemo<br />
make clean<br />
make defconfig KBUILD_DEFCONFIG=config-sailfishos-allwinner.aarch64<br />
make -j4 Image modules dtbs<br />
<br />
Install the kernel modules in a different path: <br />
make modules_install INSTALL_MOD_PATH=../linux_modules/<br />
<br />
=== Install kernel ===<br />
<br />
Copy the following things:<br />
<br />
# <b>Image</b> from <code>arch/arm64/boot/Image</code> to the root of the <code>boot</code> partition.<br />
# <b>Device tree files</b> <br />
For pinethone <code>arch/arm64/boot/dts/allwinner/sun50i-a64-pinephone.dtb</code> and <code>arch/arm64/boot/dts/allwinner/sun50i-a64-pinephone.dts</code> to the root of the <code>boot</code> partition.<br />
<br />
For pinetab <code>arch/arm64/boot/dts/allwinner/sun50i-a64-pinetab.dtb</code> and <code>arch/arm64/boot/dts/allwinner/sun50i-a64-pinetab.dts</code> to the root of the <code>boot</code> partition.<br />
# <b>Modules</b> from <code>../linux_modules</code> to <code>/lib/modules</code> on the <code>data</code> partition.<br />
<br />
==Nemo Mobile==<br />
<br />
Nemo Mobile have same MW with SFOS but use gcc8 have aarch64 support and use newset version of packages.<br />
<br />
git of device config: https://github.com/neochapay/nemo-device-dont_be_evil<br />
<br />
For build last release of nemo use this ks file https://gist.github.com/neochapay/8d40f9ee1e5fd621e0053aa126d39e81<br />
<br />
==Sailfish OS==<br />
<br />
===Github & OBS project===<br />
<br />
- https://github.com/sailfish-on-dontbeevil<br />
<br />
- https://build.merproject.org/project/show/nemo:devel:hw:pine:dontbeevil<br />
<br />
===Flash rootFS===<br />
You can download the latest rootFS from the Gitlab SailfishOS Porters CI: https://gitlab.com/sailfishos-porters-ci/dont_be_evil-ci (see the artifacts of the latest CI job).<br />
<br />
This <code>tar.gz</code> archive should be burned to the <code>data</code> partition of the SD card.<br />
It's important to burn it as the root user (not with sudo) to preserve extended attributes and ACLs: <br />
<br />
sudo su<br />
bsdtar -xpf <SAILFISH OS ROOTFS>.tar.bz2 -C <MOUNTPOINT OF /DATA><br />
<br />
===Device repos===<br />
To boot Lipstick, you need to add the device specific repos to the devkit.<br />
All the following commands are executed in a shell on the devkit.<br />
<br />
''Make sure you configure the ethernet interface first before you continue!''<br />
''You need to have access to the WWW to fetch the necessary repository data and packages.''<br />
<br />
Install zypper manually:<br />
curl -o augeas-lib.rpm http://repo.merproject.org/obs/mer:/core/latest_armv7hl/armv7hl/augeas-libs-1.6.0+git1-1.10.6.armv7hl.rpm<br />
curl -o zypper.rpm http://repo.merproject.org/obs/mer:/core/latest_armv7hl/armv7hl/zypper-1.14.6+git3-1.24.5.armv7hl.rpm<br />
rpm -Uvh *rpm<br />
<br />
Use <code>ssu</code> to add the repo<br />
ssu ar common http://repo.merproject.org/obs/nemo:/devel:/hw:/common/sailfish_latest_armv7hl/<br />
ssu ar dontbeevil http://repo.merproject.org/obs/home:/piggz:/dontbeevil/sailfishos_3.0.3.9_latest_armv7hl/<br />
ssu ar jolla https://releases.jolla.com/releases/3.0.3.9/jolla/armv7hl/<br />
<br />
Refresh the repo:<br />
zypper refresh<br />
<br />
Install the device packages:<br />
zypper install dontbeevil:qt5-qtcore dontbeevil:qt5-qttest dontbeevil:lipstick-qt5<br />
zypper install droid-config-dontbeevil # Select 1 for vendor change<br />
zypper install droid-config-dontbeevil-sailfish<br />
zypper install qt5-plugin-platform-eglfs # EGLFS LIMA plugin<br />
zypper install qt5-plugin-generic-evdev # evdev input plugins<br />
<br />
Other useful packages<br />
zypper install mce-tools #useful for mcetool (mcetool -U activates the screen)<br />
<br />
===Unknown password===<br />
The Sailfish OS rootFS sets a random password when booting for the first time.<br />
You can only log in through the <code>telnet</code> debug interface.<br />
Since the <code>eth0</code> interface still requires manually setup, you can't access <code>telnet</code>.<br />
<br />
To circumvent this issue, you can login through the UART TTY interface. <br />
However you don't know the password of the <code>root</code> nor <code>nemo</code> users!<br />
To disable the <code>root</code> and <code>nemo</code> passwords, we can modify the <code>/etc/shadow</code> file:<br />
<br />
sudo chmod +w <SD card data partition>/etc/shadow<br />
sudo vim <SD card data partition>/etc/shadow # Remove any characters where <HASHED PASSWORD> is written: user1:<HASHED PASSWORD>:16092:0:99999:7:::.<br />
sudo chmod -w <SD card data partition>/etc/shadow<br />
<br />
By removing the hashed password, we can login with the user without entering a password.<br />
You can set a new password afterwards by running as a logged in user:<br />
<br />
passwd<br />
<br />
===Init eth0===<br />
Enabling the <code>eth0</code> interface has to be done manually for now:<br />
<br />
ifconfig eth0 <YOUR_IP><br />
route add default gw <DEFAULT_GATEWAY_IP><br />
echo "nameserver <DNS_SERVER_IP>" > /etc/resolv.conf<br />
<br />
Test your configuration with <code>ping</code>:<br />
<br />
ping jolla.com<br />
<br />
<br />
===Lipstick crashing===<br />
<br />
Install Lipstick from the <code>dontbeevil</code> repository:<br />
<br />
zypper install dontbeevil:lipstick-qt5<br />
<br />
As from 3.1.0.12, this fix is obsolete.<br />
<br />
===No setup wizard===<br />
<br />
Make sure the configuration package is installed:<br />
<br />
zypper install droid-config-dontbeevil-sailfish<br />
<br />
===Missing regulatory.db for RT8723BS WiFi/BT module===<br />
<br />
git clone git://git.kernel.org/pub/scm/linux/kernel/git/sforshee/wireless-regdb.git<br />
cd wireless-regdb<br />
cp regulatory* /lib/firmware</div>Dylanvanasschttps://wiki.merproject.org/wiki/Adaptations/PinePhone64Adaptations/PinePhone642020-03-21T19:04:37Z<p>Dylanvanassc: /* Build the kernel */</p>
<hr />
<div>=Hardware Support=<br />
<br />
Full information of hardware spec [https://wiki.pine64.org/index.php/Project_Don't_be_evil Here]<br />
<br />
PostMarket OS hardware information [https://wiki.postmarketos.org/wiki/Pine_Don%27t_be_evil_devkit_(pine-dontbeevil) PostMarketOS Wiki]<br />
<br />
==WiFi/BT RTL8723CS==<br />
<br />
=== WiFi ===<br />
The WiFi driver isn't available in the Linux kernel yet. However, we can compile it as an out-of-tree driver for now.<br />
See kernel building for more instruction<br />
<br />
=== Bluetooth ===<br />
The production version of the PineTab and PinePhone are both using the Realtek 8723CS WiFi/BT module.<br />
BT is natively supported after adding the necessary firmware from [https://github.com/anarsoul/rtl8723bt-firmware/tree/master/rtl_bt https://github.com/anarsoul/rtl8723bt-firmware/tree/master/rtl_bt]<br />
Download all the <code>*.bin</code> files and copy them to the <code>/lib/firmware/rtl_bt</code> directory in the rootFS.<br />
<br />
==Modem EC25==<br />
<br />
===Setup===<br />
<br />
1. Make sure that the <code>qmimodem</code> plugin is enabled in the <code>.spec</code> of <code>ofono</code>.<br />
<br />
2. Remove the <code>noplugin.conf</code> file under <code>/lib/environment/ofono/noplugin.conf</code>.<br />
<br />
3. Restart <code>ofono</code><br />
systemctl restart ofono<br />
<br />
4. Check if the QMI modem is properly detected:<br />
/usr/lib/ofono/test/list-modems<br />
<br />
5. Unlock you SIM card (if needed):<br />
/usr/lib/ofono/test/enter-pin /quectelqmi_0 pin <PIN CODE><br />
<br />
The EC25 Quectel modem is now ready :)<br />
Thanks to SuperPrower for the hard work!<br />
<br />
===Sending SMS===<br />
<br />
/usr/lib/ofono/test/send-sms <PHONE NUMBER RECEIVER> <MESSAGE> <DELIVERY REPORT><br />
<br />
To skip the delivery report, use <code>0</code> as argument.<br />
<br />
==Cameras==<br />
<br />
Thanks to: https://wiki.postmarketos.org/wiki/Pine_Don't_be_evil_devkit_(pine-dontbeevil)#Cameras<br />
Only the back camera is supported by the mainline kernel.<br />
To use it, you need to configure it first:<br />
<br />
media-ctl --set-v4l2 '"ov5640 2-003c":0[fmt:UYVY8_2X8/1280x7200]' -d /dev/media1<br />
<br />
Afterwards, you can take a picture with:<br />
<br />
ffmpeg -s 1280x720 -f video4linux2 -i /dev/video1 -vframes 1 selfie.jpg<br />
<br />
- <code>/dev/media1</code> is the controller interface of the back camera<br />
<br />
- <code>/dev/video1</code> is the back camera stream interface<br />
<br />
If that works, you can try <code>gstreamer</code> to make the camera available for system wide usage:]<br />
<br />
gst-launch-1.0 v4l2src device=/dev/video1 num-buffers=1 ! 'video/x-raw,format=UYVY,width=1280,height=720' ! jpegenc ! filesink location=selfie.jpg<br />
cp selfie.jpg /home/nemo/Pictures<br />
<br />
This command generates a <code>selfie.jpg</code> file and by copying it to <code>/home/nemo/Pictures</code> you can view it with the Gallery app.<br />
<br />
== Audio ==<br />
<br />
1. Unmute the <code>AIF1 Slot 0 Digital DAC</code> channel using <code>alsamixer</code>. Use <code>m</code> to unmute.<br />
<br />
2. Same for <code>Line Out</code> and increase the volume to 100 (default is 0).<br />
<br />
2. Copy the default PulseAudio config: <br />
cp /etc/pulse/default.pa /etc/pulse/arm_native_config.pa<br />
<br />
3. Enable ALSA modules in the new config:<br />
load-module module-alsa-sink<br />
load-module module-alsa-source device=hw:1,0<br />
They are commented out by default.<br />
<br />
4. Configure PulseAudio by changing <code>arm_droid_config.pa</code> to <code>/arm_native_config.pa</code> in <code>/etc/sysconfig/pulseaudio</code>.<br />
<br />
5. Restart PulseAudio or reboot.<br />
<br />
6. Go to the Settings app and test the sound output by playing a ringtone under Sounds and Feedback.<br />
<br />
==PineTab==<br />
<br />
In pinetab we have jack to uart port cable. For enable UART console move selector nearby sd-card slot away from sd-card slot.<br />
<br />
==Testing the vibrator motor==<br />
<br />
You need to have the <code>CONFIG_GPIO_SYSFS</code> enabled in your kernel config for this!<br />
<br />
Vibrator motor is on pin <code>PD2</code>.<br />
You can calculate the PIN number for PD2 as followed ([https://linux-sunxi.org/GPIO more information]):<br />
<code>(4-1) * 32 + 2 = 98</code><br />
<br />
echo "98" > /sys/class/gpio/export # Make pin available<br />
echo "out" > /sys/class/gpio/gpio98/direction # Set as output<br />
echo "1" > /sys/class/gpio/gpio98/value # On<br />
echo "1" > /sys/class/gpio/gpio98/value # Off<br />
echo "98" > /sys/class/gpio/unexport # When you're done<br />
<br />
==Notification LED==<br />
<br />
export COLOR=red # or green, blue is broken due to a hardware fault<br />
# Activate LED<br />
echo 1 > /sys/class/leds/$COLOR/brightness<br />
# Deactivate LED<br />
echo 0 > /sys/class/leds/$COLOR/brightness<br />
<br />
The LED can be controlled in Mer by MCE. You need the <code>mce-plugin-libhybris-nondroid</code> for this.<br />
<br />
In the latest kernel, the control paths of the LED aren't the default ones that the MCE is expecting.<br />
This requires a config file to enable MCE to control the LED on the PinePhone devphone:<br />
<br />
[LEDConfigHybris]<br />
<br />
# Choose Vanilla backend<br />
BackEnd=vanilla<br />
<br />
# Configure base directories for red/green/blue channels<br />
RedDirectory=/sys/class/leds/pinephone:red:user<br />
GreenDirectory=/sys/class/leds/pinephone:green:user<br />
BlueDirectory=/sys/class/leds/pinephone:blue:user<br />
<br />
This config file must be saved in the following file: <code>/etc/mce/99-pinephone.ini</code><br />
<br />
=Installation=<br />
==Prepare SD card==<br />
<br />
Use GParted or any other tool to create the following <code>EXT4</code> partitions:<br />
<br />
# <b>boot</b>: Holds the mainline kernel Image and Device Tree files<br />
# <b>data</b>: Holds the Sailfish OS rootFS<br />
<br />
GParted will ask you to leave the first MB free of the SD card when creating the first partition, this is correct.<br />
This 1 MB will be used to store the U-boot boot loader.<br />
<br />
<b>Note</b>: Make sure you have a <code>msdos</code> partition table! If not, the U-boot flashing will make partition table unusable (in case of GPT for example)!<br />
<br />
==U-Boot==<br />
<br />
We will now build the mainline U-boot boot loader from Git.<br />
<br />
=== Clone ARM Trusted Firmware (master branch) ===<br />
<br />
git clone https://github.com/ARM-software/arm-trusted-firmware.git<br />
<br />
=== Build the BL31.bin ===<br />
<br />
Follow the instructions here: https://github.com/u-boot/u-boot/blob/master/board/sunxi/README.sunxi64<br />
<br />
Quick start:<br />
<br />
export CROSS_COMPILE=aarch64-linux-gnu-<br />
ARCH=arm64 make PLAT=sun50i_a64 DEBUG=1 bl31<br />
export BL31=/path/to/bl31.bin<br />
<br />
=== Clone U-boot (master branch): ===<br />
<br />
You can find the U-boot mirror repository on Github:<br />
<br />
git clone https://github.com/u-boot/u-boot.git<br />
<br />
=== Compile U-boot ===<br />
<br />
You have to cross compile U-boot with the <code>arm64</code> arch:<br />
<br />
export CROSS_COMPILE=aarch64-linux-gnu-<br />
ARCH=arm64 make clean<br />
ARCH=arm64 make sopine_baseboard_defconfig<br />
ARCH=arm64 make<br />
<br />
The <code>sopine_baseboard_defconfig</code> is the same for the Don't Be Evil devkit.<br />
<br />
=== Burn U-boot to your SD card ===<br />
<br />
Copy the compiled U-boot bootloader to the first sector on your SD card:<br />
<br />
sudo dd if=u-boot-sunxi-with-spl.bin of=/dev/sdX bs=8k seek=1<br />
<br />
<br />
=== Manually loading the kernel ===<br />
<br />
Serial TTY Baudrate over UART = 115200 for screen, example: <code>screen /dev/ttyUSB0 115200</code><br />
You have to start screen first, before turning on the devkit.<br />
<br />
Interrupt the U-boot autoboot process when you see a message in the U-boot prompt. <br />
We need to access the U-boot prompt to load the Kernel image and boot it manually!<br />
<br />
Set bootargs:<br />
<br />
setenv bootargs root=/dev/mmcblk0p2 rootwait panic=10<br />
<br />
Kernel Image loading and Device Tree files:<br />
<br />
ext4load mmc 0:1 ${kernel_addr_r} /Image <br />
ext4load mmc 0:1 ${fdt_addr_r} /sun50i-a64-pinephone.dtb <br />
<br />
Boot the kernel:<br />
<br />
booti ${kernel_addr_r} - ${fdt_addr_r}<br />
<br />
=== Automatic boot ===<br />
<br />
Create a <code>boot.cmd</code> file for the '''PinePhone''':<br />
<br />
echo Setting bootargs<br />
setenv bootargs console=tty0 console=ttyS0,115200 root=/dev/mmcblk0p2 no_console_suspend rootwait quiet<br />
earlycon=uart,mmio32,0x01c28000 panic=10 consoleblank=0 loglevel=0<br />
printenv<br />
echo Loading DTB<br />
load mmc 0:1 ${fdt_addr_r} /sun50i-a64-pinephone.dtb<br />
echo Loading kernel Image<br />
load mmc 0:1 ${kernel_addr_r} /Image<br />
echo Booting kernel NOW<br />
booti ${kernel_addr_r} - ${fdt_addr_r}<br />
<br />
Create a <code>boot.cmd</code> file for the '''PineTab''':<br />
<br />
echo Setting bootargs<br />
setenv bootargs console=tty0 console=ttyS0,115200 root=/dev/mmcblk0p2 no_console_suspend rootwait quiet<br />
earlycon=uart,mmio32,0x01c28000 panic=10 consoleblank=0 loglevel=0<br />
printenv<br />
echo Loading DTB<br />
load mmc 0:1 ${fdt_addr_r} /sun50i-a64-pinetab.dtb<br />
echo Loading kernel Image<br />
load mmc 0:1 ${kernel_addr_r} /Image<br />
echo Booting kernel NOW<br />
booti ${kernel_addr_r} - ${fdt_addr_r}<br />
<br />
Mount your <code>boot</code> partition and run the following command:<br />
sudo mkimage -C none -A arm -T script -d /mnt/boot.cmd /mnt/boot.scr<br />
<br />
This will translate the <code>boot.cmd</code> file into a U-boot script.<br />
<br />
If you don't have the <code>mkimage</code> command available, you can install it from the <code>uboot-tools</code> package.<br />
<br />
==Kernel==<br />
<br />
The PinePhone runs a mainline kernel, device tree modifications are done by all the PinePhone OS developers on Gitlab (https://gitlab.com/pine64-org/linux).<br />
<br />
=== Clone the kernel ===<br />
<br />
git clone https://gitlab.com/pine64-org/linux<br />
cd linux<br />
git checkout pine64-kernel<br />
<br />
=== Configure the kernel ===<br />
<br />
# <b>Copy our kernel config</b>: https://gitlab.com/pinephone-sailfish-os/linux-kernel/raw/master/pinephone-config<br />
# <b>Enter the <code>linux</code> project</b>: <code>cd linux</code><br />
# <b>Copy the config file</b> to <code>.config</code> in the main directory<br />
<br />
=== Enable WiFi out-of-tree driver ===<br />
<br />
Add the driver to the kernel:<br />
cd drivers/staging<br />
git clone https://github.com/Icenowy/rtl8723cs.git<br />
<br />
Configure the kernel build system now:<br />
<br />
# <b>Add this line to <code>drivers/staging/Kconfig</code></b>: <code>source "drivers/staging/rtl8723cs/Kconfig"</code><br />
# <b>Add this line to <code>drivers/staging/Makefile</code></b>: <code>obj-$(CONFIG_RTL8723CS) += rtl8723cs/</code><br />
# <b>Enable the driver in the kernel config:</b> <code>CONFIG_RTL8723CS=m</code><br />
<br />
See: [https://gitlab.com/postmarketOS/pmaports/blob/master/main/linux-postmarketos-allwinner/rtl8723cs.patch https://gitlab.com/postmarketOS/pmaports/blob/master/main/linux-postmarketos-allwinner/rtl8723cs.patch]<br />
<br />
=== Build the kernel ===<br />
<br />
We cross compile the kernel for ARM64.<br />
The <code>LOCALVERSION</code> variable can be used to add a version to the build.<br />
<br />
Cross compile the kernel:<br />
export ARCH=arm64<br />
export CROSS_COMPILE=aarch64-linux-gnu-<br />
export LOCALVERSION=-nemo<br />
make clean<br />
make defconfig KBUILD_DEFCONFIG=config-sailfishos-allwinner.aarch64<br />
make -j4 Image modules dtbs<br />
<br />
Install the kernel modules in a different path: <br />
make modules_install INSTALL_MOD_PATH=../linux_modules/<br />
<br />
=== Install kernel ===<br />
<br />
Copy the following things:<br />
<br />
# <b>Image</b> from <code>arch/arm64/boot/Image</code> to the root of the <code>boot</code> partition.<br />
# <b>Device tree files</b> <br />
For pinethone <code>arch/arm64/boot/dts/allwinner/sun50i-a64-pinephone.dtb</code> and <code>arch/arm64/boot/dts/allwinner/sun50i-a64-pinephone.dts</code> to the root of the <code>boot</code> partition.<br />
<br />
For pinetab <code>arch/arm64/boot/dts/allwinner/sun50i-a64-pinetab.dtb</code> and <code>arch/arm64/boot/dts/allwinner/sun50i-a64-pinetab.dts</code> to the root of the <code>boot</code> partition.<br />
# <b>Modules</b> from <code>../linux_modules</code> to <code>/lib/modules</code> on the <code>data</code> partition.<br />
<br />
==Nemo Mobile==<br />
<br />
Nemo Mobile have same MW with SFOS but use gcc8 have aarch64 support and use newset version of packages.<br />
<br />
git of device config: https://github.com/neochapay/nemo-device-dont_be_evil<br />
<br />
For build last release of nemo use this ks file https://gist.github.com/neochapay/8d40f9ee1e5fd621e0053aa126d39e81<br />
<br />
==Sailfish OS==<br />
<br />
===Github & OBS project===<br />
<br />
- https://github.com/sailfish-on-dontbeevil<br />
<br />
- https://build.merproject.org/project/show/nemo:devel:hw:pine:dontbeevil<br />
<br />
===Flash rootFS===<br />
You can download the latest rootFS from the Gitlab SailfishOS Porters CI: https://gitlab.com/sailfishos-porters-ci/dont_be_evil-ci (see the artifacts of the latest CI job).<br />
<br />
This <code>tar.gz</code> archive should be burned to the <code>data</code> partition of the SD card.<br />
It's important to burn it as the root user (not with sudo) to preserve extended attributes and ACLs: <br />
<br />
sudo su<br />
bsdtar -xpf <SAILFISH OS ROOTFS>.tar.bz2 -C <MOUNTPOINT OF /DATA><br />
<br />
===Device repos===<br />
To boot Lipstick, you need to add the device specific repos to the devkit.<br />
All the following commands are executed in a shell on the devkit.<br />
<br />
''Make sure you configure the ethernet interface first before you continue!''<br />
''You need to have access to the WWW to fetch the necessary repository data and packages.''<br />
<br />
Install zypper manually:<br />
curl -o augeas-lib.rpm http://repo.merproject.org/obs/mer:/core/latest_armv7hl/armv7hl/augeas-libs-1.6.0+git1-1.10.6.armv7hl.rpm<br />
curl -o zypper.rpm http://repo.merproject.org/obs/mer:/core/latest_armv7hl/armv7hl/zypper-1.14.6+git3-1.24.5.armv7hl.rpm<br />
rpm -Uvh *rpm<br />
<br />
Use <code>ssu</code> to add the repo<br />
ssu ar common http://repo.merproject.org/obs/nemo:/devel:/hw:/common/sailfish_latest_armv7hl/<br />
ssu ar dontbeevil http://repo.merproject.org/obs/home:/piggz:/dontbeevil/sailfishos_3.0.3.9_latest_armv7hl/<br />
ssu ar jolla https://releases.jolla.com/releases/3.0.3.9/jolla/armv7hl/<br />
<br />
Refresh the repo:<br />
zypper refresh<br />
<br />
Install the device packages:<br />
zypper install dontbeevil:qt5-qtcore dontbeevil:qt5-qttest dontbeevil:lipstick-qt5<br />
zypper install droid-config-dontbeevil # Select 1 for vendor change<br />
zypper install droid-config-dontbeevil-sailfish<br />
zypper install qt5-plugin-platform-eglfs # EGLFS LIMA plugin<br />
zypper install qt5-plugin-generic-evdev # evdev input plugins<br />
<br />
Other useful packages<br />
zypper install mce-tools #useful for mcetool (mcetool -U activates the screen)<br />
<br />
===Unknown password===<br />
The Sailfish OS rootFS sets a random password when booting for the first time.<br />
You can only log in through the <code>telnet</code> debug interface.<br />
Since the <code>eth0</code> interface still requires manually setup, you can't access <code>telnet</code>.<br />
<br />
To circumvent this issue, you can login through the UART TTY interface. <br />
However you don't know the password of the <code>root</code> nor <code>nemo</code> users!<br />
To disable the <code>root</code> and <code>nemo</code> passwords, we can modify the <code>/etc/shadow</code> file:<br />
<br />
sudo chmod +w <SD card data partition>/etc/shadow<br />
sudo vim <SD card data partition>/etc/shadow # Remove any characters where <HASHED PASSWORD> is written: user1:<HASHED PASSWORD>:16092:0:99999:7:::.<br />
sudo chmod -w <SD card data partition>/etc/shadow<br />
<br />
By removing the hashed password, we can login with the user without entering a password.<br />
You can set a new password afterwards by running as a logged in user:<br />
<br />
passwd<br />
<br />
===Init eth0===<br />
Enabling the <code>eth0</code> interface has to be done manually for now:<br />
<br />
ifconfig eth0 <YOUR_IP><br />
route add default gw <DEFAULT_GATEWAY_IP><br />
echo "nameserver <DNS_SERVER_IP>" > /etc/resolv.conf<br />
<br />
Test your configuration with <code>ping</code>:<br />
<br />
ping jolla.com<br />
<br />
<br />
===Lipstick crashing===<br />
<br />
Install Lipstick from the <code>dontbeevil</code> repository:<br />
<br />
zypper install dontbeevil:lipstick-qt5<br />
<br />
As from 3.1.0.12, this fix is obsolete.<br />
<br />
===No setup wizard===<br />
<br />
Make sure the configuration package is installed:<br />
<br />
zypper install droid-config-dontbeevil-sailfish<br />
<br />
===Missing regulatory.db for RT8723BS WiFi/BT module===<br />
<br />
git clone git://git.kernel.org/pub/scm/linux/kernel/git/sforshee/wireless-regdb.git<br />
cd wireless-regdb<br />
cp regulatory* /lib/firmware</div>Dylanvanasschttps://wiki.merproject.org/wiki/Adaptations/PinePhone64Adaptations/PinePhone642020-01-18T20:28:21Z<p>Dylanvanassc: /* Notification LED */</p>
<hr />
<div>=Hardware Support=<br />
<br />
Full information of hardware spec [https://wiki.pine64.org/index.php/Project_Don't_be_evil Here]<br />
<br />
PostMarket OS hardware information [https://wiki.postmarketos.org/wiki/Pine_Don%27t_be_evil_devkit_(pine-dontbeevil) PostMarketOS Wiki]<br />
<br />
==WiFi/BT RTL8723CS==<br />
<br />
=== WiFi ===<br />
The WiFi driver isn't available in the Linux kernel yet. However, we can compile it as an out-of-tree driver for now.<br />
See kernel building for more instruction<br />
<br />
=== Bluetooth ===<br />
The production version of the PineTab and PinePhone are both using the Realtek 8723CS WiFi/BT module.<br />
BT is natively supported after adding the necessary firmware from [https://github.com/anarsoul/rtl8723bt-firmware/tree/master/rtl_bt https://github.com/anarsoul/rtl8723bt-firmware/tree/master/rtl_bt]<br />
Download all the <code>*.bin</code> files and copy them to the <code>/lib/firmware/rtl_bt</code> directory in the rootFS.<br />
<br />
==Modem EC25==<br />
<br />
===Setup===<br />
<br />
1. Make sure that the <code>qmimodem</code> plugin is enabled in the <code>.spec</code> of <code>ofono</code>.<br />
<br />
2. Remove the <code>noplugin.conf</code> file under <code>/lib/environment/ofono/noplugin.conf</code>.<br />
<br />
3. Restart <code>ofono</code><br />
systemctl restart ofono<br />
<br />
4. Check if the QMI modem is properly detected:<br />
/usr/lib/ofono/test/list-modems<br />
<br />
5. Unlock you SIM card (if needed):<br />
/usr/lib/ofono/test/enter-pin /quectelqmi_0 pin <PIN CODE><br />
<br />
The EC25 Quectel modem is now ready :)<br />
Thanks to SuperPrower for the hard work!<br />
<br />
===Sending SMS===<br />
<br />
/usr/lib/ofono/test/send-sms <PHONE NUMBER RECEIVER> <MESSAGE> <DELIVERY REPORT><br />
<br />
To skip the delivery report, use <code>0</code> as argument.<br />
<br />
==Cameras==<br />
<br />
Thanks to: https://wiki.postmarketos.org/wiki/Pine_Don't_be_evil_devkit_(pine-dontbeevil)#Cameras<br />
Only the back camera is supported by the mainline kernel.<br />
To use it, you need to configure it first:<br />
<br />
media-ctl --set-v4l2 '"ov5640 2-003c":0[fmt:UYVY8_2X8/1280x7200]' -d /dev/media1<br />
<br />
Afterwards, you can take a picture with:<br />
<br />
ffmpeg -s 1280x720 -f video4linux2 -i /dev/video1 -vframes 1 selfie.jpg<br />
<br />
- <code>/dev/media1</code> is the controller interface of the back camera<br />
<br />
- <code>/dev/video1</code> is the back camera stream interface<br />
<br />
If that works, you can try <code>gstreamer</code> to make the camera available for system wide usage:]<br />
<br />
gst-launch-1.0 v4l2src device=/dev/video1 num-buffers=1 ! 'video/x-raw,format=UYVY,width=1280,height=720' ! jpegenc ! filesink location=selfie.jpg<br />
cp selfie.jpg /home/nemo/Pictures<br />
<br />
This command generates a <code>selfie.jpg</code> file and by copying it to <code>/home/nemo/Pictures</code> you can view it with the Gallery app.<br />
<br />
== Audio ==<br />
<br />
1. Unmute the <code>AIF1 Slot 0 Digital DAC</code> channel using <code>alsamixer</code>. Use <code>m</code> to unmute.<br />
<br />
2. Same for <code>Line Out</code> and increase the volume to 100 (default is 0).<br />
<br />
2. Copy the default PulseAudio config: <br />
cp /etc/pulse/default.pa /etc/pulse/arm_native_config.pa<br />
<br />
3. Enable ALSA modules in the new config:<br />
load-module module-alsa-sink<br />
load-module module-alsa-source device=hw:1,0<br />
They are commented out by default.<br />
<br />
4. Configure PulseAudio by changing <code>arm_droid_config.pa</code> to <code>/arm_native_config.pa</code> in <code>/etc/sysconfig/pulseaudio</code>.<br />
<br />
5. Restart PulseAudio or reboot.<br />
<br />
6. Go to the Settings app and test the sound output by playing a ringtone under Sounds and Feedback.<br />
<br />
==PineTab==<br />
<br />
In pinetab we have jack to uart port cable. For enable UART console move selector nearby sd-card slot away from sd-card slot.<br />
<br />
==Testing the vibrator motor==<br />
<br />
You need to have the <code>CONFIG_GPIO_SYSFS</code> enabled in your kernel config for this!<br />
<br />
Vibrator motor is on pin <code>PD2</code>.<br />
You can calculate the PIN number for PD2 as followed ([https://linux-sunxi.org/GPIO more information]):<br />
<code>(4-1) * 32 + 2 = 98</code><br />
<br />
echo "98" > /sys/class/gpio/export # Make pin available<br />
echo "out" > /sys/class/gpio/gpio98/direction # Set as output<br />
echo "1" > /sys/class/gpio/gpio98/value # On<br />
echo "1" > /sys/class/gpio/gpio98/value # Off<br />
echo "98" > /sys/class/gpio/unexport # When you're done<br />
<br />
==Notification LED==<br />
<br />
export COLOR=red # or green, blue is broken due to a hardware fault<br />
# Activate LED<br />
echo 1 > /sys/class/leds/$COLOR/brightness<br />
# Deactivate LED<br />
echo 0 > /sys/class/leds/$COLOR/brightness<br />
<br />
The LED can be controlled in Mer by MCE. You need the <code>mce-plugin-libhybris-nondroid</code> for this.<br />
<br />
In the latest kernel, the control paths of the LED aren't the default ones that the MCE is expecting.<br />
This requires a config file to enable MCE to control the LED on the PinePhone devphone:<br />
<br />
[LEDConfigHybris]<br />
<br />
# Choose Vanilla backend<br />
BackEnd=vanilla<br />
<br />
# Configure base directories for red/green/blue channels<br />
RedDirectory=/sys/class/leds/pinephone:red:user<br />
GreenDirectory=/sys/class/leds/pinephone:green:user<br />
BlueDirectory=/sys/class/leds/pinephone:blue:user<br />
<br />
This config file must be saved in the following file: <code>/etc/mce/99-pinephone.ini</code><br />
<br />
=Installation=<br />
==Prepare SD card==<br />
<br />
Use GParted or any other tool to create the following <code>EXT4</code> partitions:<br />
<br />
# <b>boot</b>: Holds the mainline kernel Image and Device Tree files<br />
# <b>data</b>: Holds the Sailfish OS rootFS<br />
<br />
GParted will ask you to leave the first MB free of the SD card when creating the first partition, this is correct.<br />
This 1 MB will be used to store the U-boot boot loader.<br />
<br />
<b>Note</b>: Make sure you have a <code>msdos</code> partition table! If not, the U-boot flashing will make partition table unusable (in case of GPT for example)!<br />
<br />
==U-Boot==<br />
<br />
We will now build the mainline U-boot boot loader from Git.<br />
<br />
=== Clone ARM Trusted Firmware (master branch) ===<br />
<br />
git clone https://github.com/ARM-software/arm-trusted-firmware.git<br />
<br />
=== Build the BL31.bin ===<br />
<br />
Follow the instructions here: https://github.com/u-boot/u-boot/blob/master/board/sunxi/README.sunxi64<br />
<br />
Quick start:<br />
<br />
export CROSS_COMPILE=aarch64-linux-gnu-<br />
ARCH=arm64 make PLAT=sun50i_a64 DEBUG=1 bl31<br />
export BL31=/path/to/bl31.bin<br />
<br />
=== Clone U-boot (master branch): ===<br />
<br />
You can find the U-boot mirror repository on Github:<br />
<br />
git clone https://github.com/u-boot/u-boot.git<br />
<br />
=== Compile U-boot ===<br />
<br />
You have to cross compile U-boot with the <code>arm64</code> arch:<br />
<br />
export CROSS_COMPILE=aarch64-linux-gnu-<br />
ARCH=arm64 make clean<br />
ARCH=arm64 make sopine_baseboard_defconfig<br />
ARCH=arm64 make<br />
<br />
The <code>sopine_baseboard_defconfig</code> is the same for the Don't Be Evil devkit.<br />
<br />
=== Burn U-boot to your SD card ===<br />
<br />
Copy the compiled U-boot bootloader to the first sector on your SD card:<br />
<br />
sudo dd if=u-boot-sunxi-with-spl.bin of=/dev/sdX bs=8k seek=1<br />
<br />
<br />
=== Manually loading the kernel ===<br />
<br />
Serial TTY Baudrate over UART = 115200 for screen, example: <code>screen /dev/ttyUSB0 115200</code><br />
You have to start screen first, before turning on the devkit.<br />
<br />
Interrupt the U-boot autoboot process when you see a message in the U-boot prompt. <br />
We need to access the U-boot prompt to load the Kernel image and boot it manually!<br />
<br />
Set bootargs:<br />
<br />
setenv bootargs root=/dev/mmcblk0p2 rootwait panic=10<br />
<br />
Kernel Image loading and Device Tree files:<br />
<br />
ext4load mmc 0:1 ${kernel_addr_r} /Image <br />
ext4load mmc 0:1 ${fdt_addr_r} /sun50i-a64-pinephone.dtb <br />
<br />
Boot the kernel:<br />
<br />
booti ${kernel_addr_r} - ${fdt_addr_r}<br />
<br />
=== Automatic boot ===<br />
<br />
Create a <code>boot.cmd</code> file for the '''PinePhone''':<br />
<br />
echo Setting bootargs<br />
setenv bootargs console=tty0 console=ttyS0,115200 root=/dev/mmcblk0p2 no_console_suspend rootwait quiet<br />
earlycon=uart,mmio32,0x01c28000 panic=10 consoleblank=0 loglevel=0<br />
printenv<br />
echo Loading DTB<br />
load mmc 0:1 ${fdt_addr_r} /sun50i-a64-pinephone.dtb<br />
echo Loading kernel Image<br />
load mmc 0:1 ${kernel_addr_r} /Image<br />
echo Booting kernel NOW<br />
booti ${kernel_addr_r} - ${fdt_addr_r}<br />
<br />
Create a <code>boot.cmd</code> file for the '''PineTab''':<br />
<br />
echo Setting bootargs<br />
setenv bootargs console=tty0 console=ttyS0,115200 root=/dev/mmcblk0p2 no_console_suspend rootwait quiet<br />
earlycon=uart,mmio32,0x01c28000 panic=10 consoleblank=0 loglevel=0<br />
printenv<br />
echo Loading DTB<br />
load mmc 0:1 ${fdt_addr_r} /sun50i-a64-pinetab.dtb<br />
echo Loading kernel Image<br />
load mmc 0:1 ${kernel_addr_r} /Image<br />
echo Booting kernel NOW<br />
booti ${kernel_addr_r} - ${fdt_addr_r}<br />
<br />
Mount your <code>boot</code> partition and run the following command:<br />
sudo mkimage -C none -A arm -T script -d /mnt/boot.cmd /mnt/boot.scr<br />
<br />
This will translate the <code>boot.cmd</code> file into a U-boot script.<br />
<br />
If you don't have the <code>mkimage</code> command available, you can install it from the <code>uboot-tools</code> package.<br />
<br />
==Kernel==<br />
<br />
The PinePhone runs a mainline kernel, device tree modifications are done by all the PinePhone OS developers on Gitlab (https://gitlab.com/pine64-org/linux).<br />
<br />
=== Clone the kernel ===<br />
<br />
git clone https://gitlab.com/pine64-org/linux<br />
cd linux<br />
git checkout pine64-kernel<br />
<br />
=== Configure the kernel ===<br />
<br />
# <b>Copy our kernel config</b>: https://gitlab.com/pinephone-sailfish-os/linux-kernel/raw/master/pinephone-config<br />
# <b>Enter the <code>linux</code> project</b>: <code>cd linux</code><br />
# <b>Copy the config file</b> to <code>.config</code> in the main directory<br />
<br />
=== Enable WiFi out-of-tree driver ===<br />
<br />
Add the driver to the kernel:<br />
cd drivers/staging<br />
git clone https://github.com/Icenowy/rtl8723cs.git<br />
<br />
Configure the kernel build system now:<br />
<br />
# <b>Add this line to <code>drivers/staging/Kconfig</code></b>: <code>source "drivers/staging/rtl8723cs/Kconfig"</code><br />
# <b>Add this line to <code>drivers/staging/Makefile</code></b>: <code>obj-$(CONFIG_RTL8723CS) += rtl8723cs/</code><br />
# <b>Enable the driver in the kernel config:</b> <code>CONFIG_RTL8723CS=m</code><br />
<br />
See: [https://gitlab.com/postmarketOS/pmaports/blob/master/main/linux-postmarketos-allwinner/rtl8723cs.patch https://gitlab.com/postmarketOS/pmaports/blob/master/main/linux-postmarketos-allwinner/rtl8723cs.patch]<br />
<br />
=== Build the kernel ===<br />
<br />
We cross compile the kernel for ARM64.<br />
The <code>LOCALVERSION</code> variable can be used to add a version to the build.<br />
<br />
Cross compile the kernel:<br />
export ARCH=arm64<br />
export CROSS_COMPILE=aarch64-linux-gnu-<br />
export LOCALVERSION=-nemo<br />
make clean<br />
make oldconfig<br />
make -j4 Image modules dtbs<br />
<br />
Install the kernel modules in a different path: <br />
make modules_install INSTALL_MOD_PATH=../linux_modules/<br />
<br />
=== Install kernel ===<br />
<br />
Copy the following things:<br />
<br />
# <b>Image</b> from <code>arch/arm64/boot/Image</code> to the root of the <code>boot</code> partition.<br />
# <b>Device tree files</b> <br />
For pinethone <code>arch/arm64/boot/dts/allwinner/sun50i-a64-pinephone.dtb</code> and <code>arch/arm64/boot/dts/allwinner/sun50i-a64-pinephone.dts</code> to the root of the <code>boot</code> partition.<br />
<br />
For pinetab <code>arch/arm64/boot/dts/allwinner/sun50i-a64-pinetab.dtb</code> and <code>arch/arm64/boot/dts/allwinner/sun50i-a64-pinetab.dts</code> to the root of the <code>boot</code> partition.<br />
# <b>Modules</b> from <code>../linux_modules</code> to <code>/lib/modules</code> on the <code>data</code> partition.<br />
<br />
==Nemo Mobile==<br />
<br />
Nemo Mobile have same MW with SFOS but use gcc8 have aarch64 support and use newset version of packages.<br />
<br />
git of device config: https://github.com/neochapay/nemo-device-dont_be_evil<br />
<br />
For build last release of nemo use this ks file https://gist.github.com/neochapay/8d40f9ee1e5fd621e0053aa126d39e81<br />
<br />
==Sailfish OS==<br />
<br />
===Github & OBS project===<br />
<br />
- https://github.com/sailfish-on-dontbeevil<br />
<br />
- https://build.merproject.org/project/show/nemo:devel:hw:pine:dontbeevil<br />
<br />
===Flash rootFS===<br />
You can download the latest rootFS from the Gitlab SailfishOS Porters CI: https://gitlab.com/sailfishos-porters-ci/dont_be_evil-ci (see the artifacts of the latest CI job).<br />
<br />
This <code>tar.gz</code> archive should be burned to the <code>data</code> partition of the SD card.<br />
It's important to burn it as the root user (not with sudo) to preserve extended attributes and ACLs: <br />
<br />
sudo su<br />
bsdtar -xpf <SAILFISH OS ROOTFS>.tar.bz2 -C <MOUNTPOINT OF /DATA><br />
<br />
===Device repos===<br />
To boot Lipstick, you need to add the device specific repos to the devkit.<br />
All the following commands are executed in a shell on the devkit.<br />
<br />
''Make sure you configure the ethernet interface first before you continue!''<br />
''You need to have access to the WWW to fetch the necessary repository data and packages.''<br />
<br />
Install zypper manually:<br />
curl -o augeas-lib.rpm http://repo.merproject.org/obs/mer:/core/latest_armv7hl/armv7hl/augeas-libs-1.6.0+git1-1.10.6.armv7hl.rpm<br />
curl -o zypper.rpm http://repo.merproject.org/obs/mer:/core/latest_armv7hl/armv7hl/zypper-1.14.6+git3-1.24.5.armv7hl.rpm<br />
rpm -Uvh *rpm<br />
<br />
Use <code>ssu</code> to add the repo<br />
ssu ar common http://repo.merproject.org/obs/nemo:/devel:/hw:/common/sailfish_latest_armv7hl/<br />
ssu ar dontbeevil http://repo.merproject.org/obs/home:/piggz:/dontbeevil/sailfishos_3.0.3.9_latest_armv7hl/<br />
ssu ar jolla https://releases.jolla.com/releases/3.0.3.9/jolla/armv7hl/<br />
<br />
Refresh the repo:<br />
zypper refresh<br />
<br />
Install the device packages:<br />
zypper install dontbeevil:qt5-qtcore dontbeevil:qt5-qttest dontbeevil:lipstick-qt5<br />
zypper install droid-config-dontbeevil # Select 1 for vendor change<br />
zypper install droid-config-dontbeevil-sailfish<br />
zypper install qt5-plugin-platform-eglfs # EGLFS LIMA plugin<br />
zypper install qt5-plugin-generic-evdev # evdev input plugins<br />
<br />
Other useful packages<br />
zypper install mce-tools #useful for mcetool (mcetool -U activates the screen)<br />
<br />
===Unknown password===<br />
The Sailfish OS rootFS sets a random password when booting for the first time.<br />
You can only log in through the <code>telnet</code> debug interface.<br />
Since the <code>eth0</code> interface still requires manually setup, you can't access <code>telnet</code>.<br />
<br />
To circumvent this issue, you can login through the UART TTY interface. <br />
However you don't know the password of the <code>root</code> nor <code>nemo</code> users!<br />
To disable the <code>root</code> and <code>nemo</code> passwords, we can modify the <code>/etc/shadow</code> file:<br />
<br />
sudo chmod +w <SD card data partition>/etc/shadow<br />
sudo vim <SD card data partition>/etc/shadow # Remove any characters where <HASHED PASSWORD> is written: user1:<HASHED PASSWORD>:16092:0:99999:7:::.<br />
sudo chmod -w <SD card data partition>/etc/shadow<br />
<br />
By removing the hashed password, we can login with the user without entering a password.<br />
You can set a new password afterwards by running as a logged in user:<br />
<br />
passwd<br />
<br />
===Init eth0===<br />
Enabling the <code>eth0</code> interface has to be done manually for now:<br />
<br />
ifconfig eth0 <YOUR_IP><br />
route add default gw <DEFAULT_GATEWAY_IP><br />
echo "nameserver <DNS_SERVER_IP>" > /etc/resolv.conf<br />
<br />
Test your configuration with <code>ping</code>:<br />
<br />
ping jolla.com<br />
<br />
<br />
===Lipstick crashing===<br />
<br />
Install Lipstick from the <code>dontbeevil</code> repository:<br />
<br />
zypper install dontbeevil:lipstick-qt5<br />
<br />
As from 3.1.0.12, this fix is obsolete.<br />
<br />
===No setup wizard===<br />
<br />
Make sure the configuration package is installed:<br />
<br />
zypper install droid-config-dontbeevil-sailfish<br />
<br />
===Missing regulatory.db for RT8723BS WiFi/BT module===<br />
<br />
git clone git://git.kernel.org/pub/scm/linux/kernel/git/sforshee/wireless-regdb.git<br />
cd wireless-regdb<br />
cp regulatory* /lib/firmware</div>Dylanvanasschttps://wiki.merproject.org/wiki/Adaptations/PinePhone64Adaptations/PinePhone642020-01-18T20:25:39Z<p>Dylanvanassc: /* Audio */</p>
<hr />
<div>=Hardware Support=<br />
<br />
Full information of hardware spec [https://wiki.pine64.org/index.php/Project_Don't_be_evil Here]<br />
<br />
PostMarket OS hardware information [https://wiki.postmarketos.org/wiki/Pine_Don%27t_be_evil_devkit_(pine-dontbeevil) PostMarketOS Wiki]<br />
<br />
==WiFi/BT RTL8723CS==<br />
<br />
=== WiFi ===<br />
The WiFi driver isn't available in the Linux kernel yet. However, we can compile it as an out-of-tree driver for now.<br />
See kernel building for more instruction<br />
<br />
=== Bluetooth ===<br />
The production version of the PineTab and PinePhone are both using the Realtek 8723CS WiFi/BT module.<br />
BT is natively supported after adding the necessary firmware from [https://github.com/anarsoul/rtl8723bt-firmware/tree/master/rtl_bt https://github.com/anarsoul/rtl8723bt-firmware/tree/master/rtl_bt]<br />
Download all the <code>*.bin</code> files and copy them to the <code>/lib/firmware/rtl_bt</code> directory in the rootFS.<br />
<br />
==Modem EC25==<br />
<br />
===Setup===<br />
<br />
1. Make sure that the <code>qmimodem</code> plugin is enabled in the <code>.spec</code> of <code>ofono</code>.<br />
<br />
2. Remove the <code>noplugin.conf</code> file under <code>/lib/environment/ofono/noplugin.conf</code>.<br />
<br />
3. Restart <code>ofono</code><br />
systemctl restart ofono<br />
<br />
4. Check if the QMI modem is properly detected:<br />
/usr/lib/ofono/test/list-modems<br />
<br />
5. Unlock you SIM card (if needed):<br />
/usr/lib/ofono/test/enter-pin /quectelqmi_0 pin <PIN CODE><br />
<br />
The EC25 Quectel modem is now ready :)<br />
Thanks to SuperPrower for the hard work!<br />
<br />
===Sending SMS===<br />
<br />
/usr/lib/ofono/test/send-sms <PHONE NUMBER RECEIVER> <MESSAGE> <DELIVERY REPORT><br />
<br />
To skip the delivery report, use <code>0</code> as argument.<br />
<br />
==Cameras==<br />
<br />
Thanks to: https://wiki.postmarketos.org/wiki/Pine_Don't_be_evil_devkit_(pine-dontbeevil)#Cameras<br />
Only the back camera is supported by the mainline kernel.<br />
To use it, you need to configure it first:<br />
<br />
media-ctl --set-v4l2 '"ov5640 2-003c":0[fmt:UYVY8_2X8/1280x7200]' -d /dev/media1<br />
<br />
Afterwards, you can take a picture with:<br />
<br />
ffmpeg -s 1280x720 -f video4linux2 -i /dev/video1 -vframes 1 selfie.jpg<br />
<br />
- <code>/dev/media1</code> is the controller interface of the back camera<br />
<br />
- <code>/dev/video1</code> is the back camera stream interface<br />
<br />
If that works, you can try <code>gstreamer</code> to make the camera available for system wide usage:]<br />
<br />
gst-launch-1.0 v4l2src device=/dev/video1 num-buffers=1 ! 'video/x-raw,format=UYVY,width=1280,height=720' ! jpegenc ! filesink location=selfie.jpg<br />
cp selfie.jpg /home/nemo/Pictures<br />
<br />
This command generates a <code>selfie.jpg</code> file and by copying it to <code>/home/nemo/Pictures</code> you can view it with the Gallery app.<br />
<br />
== Audio ==<br />
<br />
1. Unmute the <code>AIF1 Slot 0 Digital DAC</code> channel using <code>alsamixer</code>. Use <code>m</code> to unmute.<br />
<br />
2. Same for <code>Line Out</code> and increase the volume to 100 (default is 0).<br />
<br />
2. Copy the default PulseAudio config: <br />
cp /etc/pulse/default.pa /etc/pulse/arm_native_config.pa<br />
<br />
3. Enable ALSA modules in the new config:<br />
load-module module-alsa-sink<br />
load-module module-alsa-source device=hw:1,0<br />
They are commented out by default.<br />
<br />
4. Configure PulseAudio by changing <code>arm_droid_config.pa</code> to <code>/arm_native_config.pa</code> in <code>/etc/sysconfig/pulseaudio</code>.<br />
<br />
5. Restart PulseAudio or reboot.<br />
<br />
6. Go to the Settings app and test the sound output by playing a ringtone under Sounds and Feedback.<br />
<br />
==PineTab==<br />
<br />
In pinetab we have jack to uart port cable. For enable UART console move selector nearby sd-card slot away from sd-card slot.<br />
<br />
==Testing the vibrator motor==<br />
<br />
You need to have the <code>CONFIG_GPIO_SYSFS</code> enabled in your kernel config for this!<br />
<br />
Vibrator motor is on pin <code>PD2</code>.<br />
You can calculate the PIN number for PD2 as followed ([https://linux-sunxi.org/GPIO more information]):<br />
<code>(4-1) * 32 + 2 = 98</code><br />
<br />
echo "98" > /sys/class/gpio/export # Make pin available<br />
echo "out" > /sys/class/gpio/gpio98/direction # Set as output<br />
echo "1" > /sys/class/gpio/gpio98/value # On<br />
echo "1" > /sys/class/gpio/gpio98/value # Off<br />
echo "98" > /sys/class/gpio/unexport # When you're done<br />
<br />
==Notification LED==<br />
<br />
export COLOR=red # or green, blue is broken due to a hardware fault<br />
# Activate LED<br />
echo 1 > /sys/class/leds/$COLOR/brightness<br />
# Deactivate LED<br />
echo 0 > /sys/class/leds/$COLOR/brightness<br />
<br />
The LED can be controlled in Mer by MCE. You need the <code>mce-plugin-libhybris-nondroid</code> for this.<br />
<br />
=Installation=<br />
==Prepare SD card==<br />
<br />
Use GParted or any other tool to create the following <code>EXT4</code> partitions:<br />
<br />
# <b>boot</b>: Holds the mainline kernel Image and Device Tree files<br />
# <b>data</b>: Holds the Sailfish OS rootFS<br />
<br />
GParted will ask you to leave the first MB free of the SD card when creating the first partition, this is correct.<br />
This 1 MB will be used to store the U-boot boot loader.<br />
<br />
<b>Note</b>: Make sure you have a <code>msdos</code> partition table! If not, the U-boot flashing will make partition table unusable (in case of GPT for example)!<br />
<br />
==U-Boot==<br />
<br />
We will now build the mainline U-boot boot loader from Git.<br />
<br />
=== Clone ARM Trusted Firmware (master branch) ===<br />
<br />
git clone https://github.com/ARM-software/arm-trusted-firmware.git<br />
<br />
=== Build the BL31.bin ===<br />
<br />
Follow the instructions here: https://github.com/u-boot/u-boot/blob/master/board/sunxi/README.sunxi64<br />
<br />
Quick start:<br />
<br />
export CROSS_COMPILE=aarch64-linux-gnu-<br />
ARCH=arm64 make PLAT=sun50i_a64 DEBUG=1 bl31<br />
export BL31=/path/to/bl31.bin<br />
<br />
=== Clone U-boot (master branch): ===<br />
<br />
You can find the U-boot mirror repository on Github:<br />
<br />
git clone https://github.com/u-boot/u-boot.git<br />
<br />
=== Compile U-boot ===<br />
<br />
You have to cross compile U-boot with the <code>arm64</code> arch:<br />
<br />
export CROSS_COMPILE=aarch64-linux-gnu-<br />
ARCH=arm64 make clean<br />
ARCH=arm64 make sopine_baseboard_defconfig<br />
ARCH=arm64 make<br />
<br />
The <code>sopine_baseboard_defconfig</code> is the same for the Don't Be Evil devkit.<br />
<br />
=== Burn U-boot to your SD card ===<br />
<br />
Copy the compiled U-boot bootloader to the first sector on your SD card:<br />
<br />
sudo dd if=u-boot-sunxi-with-spl.bin of=/dev/sdX bs=8k seek=1<br />
<br />
<br />
=== Manually loading the kernel ===<br />
<br />
Serial TTY Baudrate over UART = 115200 for screen, example: <code>screen /dev/ttyUSB0 115200</code><br />
You have to start screen first, before turning on the devkit.<br />
<br />
Interrupt the U-boot autoboot process when you see a message in the U-boot prompt. <br />
We need to access the U-boot prompt to load the Kernel image and boot it manually!<br />
<br />
Set bootargs:<br />
<br />
setenv bootargs root=/dev/mmcblk0p2 rootwait panic=10<br />
<br />
Kernel Image loading and Device Tree files:<br />
<br />
ext4load mmc 0:1 ${kernel_addr_r} /Image <br />
ext4load mmc 0:1 ${fdt_addr_r} /sun50i-a64-pinephone.dtb <br />
<br />
Boot the kernel:<br />
<br />
booti ${kernel_addr_r} - ${fdt_addr_r}<br />
<br />
=== Automatic boot ===<br />
<br />
Create a <code>boot.cmd</code> file for the '''PinePhone''':<br />
<br />
echo Setting bootargs<br />
setenv bootargs console=tty0 console=ttyS0,115200 root=/dev/mmcblk0p2 no_console_suspend rootwait quiet<br />
earlycon=uart,mmio32,0x01c28000 panic=10 consoleblank=0 loglevel=0<br />
printenv<br />
echo Loading DTB<br />
load mmc 0:1 ${fdt_addr_r} /sun50i-a64-pinephone.dtb<br />
echo Loading kernel Image<br />
load mmc 0:1 ${kernel_addr_r} /Image<br />
echo Booting kernel NOW<br />
booti ${kernel_addr_r} - ${fdt_addr_r}<br />
<br />
Create a <code>boot.cmd</code> file for the '''PineTab''':<br />
<br />
echo Setting bootargs<br />
setenv bootargs console=tty0 console=ttyS0,115200 root=/dev/mmcblk0p2 no_console_suspend rootwait quiet<br />
earlycon=uart,mmio32,0x01c28000 panic=10 consoleblank=0 loglevel=0<br />
printenv<br />
echo Loading DTB<br />
load mmc 0:1 ${fdt_addr_r} /sun50i-a64-pinetab.dtb<br />
echo Loading kernel Image<br />
load mmc 0:1 ${kernel_addr_r} /Image<br />
echo Booting kernel NOW<br />
booti ${kernel_addr_r} - ${fdt_addr_r}<br />
<br />
Mount your <code>boot</code> partition and run the following command:<br />
sudo mkimage -C none -A arm -T script -d /mnt/boot.cmd /mnt/boot.scr<br />
<br />
This will translate the <code>boot.cmd</code> file into a U-boot script.<br />
<br />
If you don't have the <code>mkimage</code> command available, you can install it from the <code>uboot-tools</code> package.<br />
<br />
==Kernel==<br />
<br />
The PinePhone runs a mainline kernel, device tree modifications are done by all the PinePhone OS developers on Gitlab (https://gitlab.com/pine64-org/linux).<br />
<br />
=== Clone the kernel ===<br />
<br />
git clone https://gitlab.com/pine64-org/linux<br />
cd linux<br />
git checkout pine64-kernel<br />
<br />
=== Configure the kernel ===<br />
<br />
# <b>Copy our kernel config</b>: https://gitlab.com/pinephone-sailfish-os/linux-kernel/raw/master/pinephone-config<br />
# <b>Enter the <code>linux</code> project</b>: <code>cd linux</code><br />
# <b>Copy the config file</b> to <code>.config</code> in the main directory<br />
<br />
=== Enable WiFi out-of-tree driver ===<br />
<br />
Add the driver to the kernel:<br />
cd drivers/staging<br />
git clone https://github.com/Icenowy/rtl8723cs.git<br />
<br />
Configure the kernel build system now:<br />
<br />
# <b>Add this line to <code>drivers/staging/Kconfig</code></b>: <code>source "drivers/staging/rtl8723cs/Kconfig"</code><br />
# <b>Add this line to <code>drivers/staging/Makefile</code></b>: <code>obj-$(CONFIG_RTL8723CS) += rtl8723cs/</code><br />
# <b>Enable the driver in the kernel config:</b> <code>CONFIG_RTL8723CS=m</code><br />
<br />
See: [https://gitlab.com/postmarketOS/pmaports/blob/master/main/linux-postmarketos-allwinner/rtl8723cs.patch https://gitlab.com/postmarketOS/pmaports/blob/master/main/linux-postmarketos-allwinner/rtl8723cs.patch]<br />
<br />
=== Build the kernel ===<br />
<br />
We cross compile the kernel for ARM64.<br />
The <code>LOCALVERSION</code> variable can be used to add a version to the build.<br />
<br />
Cross compile the kernel:<br />
export ARCH=arm64<br />
export CROSS_COMPILE=aarch64-linux-gnu-<br />
export LOCALVERSION=-nemo<br />
make clean<br />
make oldconfig<br />
make -j4 Image modules dtbs<br />
<br />
Install the kernel modules in a different path: <br />
make modules_install INSTALL_MOD_PATH=../linux_modules/<br />
<br />
=== Install kernel ===<br />
<br />
Copy the following things:<br />
<br />
# <b>Image</b> from <code>arch/arm64/boot/Image</code> to the root of the <code>boot</code> partition.<br />
# <b>Device tree files</b> <br />
For pinethone <code>arch/arm64/boot/dts/allwinner/sun50i-a64-pinephone.dtb</code> and <code>arch/arm64/boot/dts/allwinner/sun50i-a64-pinephone.dts</code> to the root of the <code>boot</code> partition.<br />
<br />
For pinetab <code>arch/arm64/boot/dts/allwinner/sun50i-a64-pinetab.dtb</code> and <code>arch/arm64/boot/dts/allwinner/sun50i-a64-pinetab.dts</code> to the root of the <code>boot</code> partition.<br />
# <b>Modules</b> from <code>../linux_modules</code> to <code>/lib/modules</code> on the <code>data</code> partition.<br />
<br />
==Nemo Mobile==<br />
<br />
Nemo Mobile have same MW with SFOS but use gcc8 have aarch64 support and use newset version of packages.<br />
<br />
git of device config: https://github.com/neochapay/nemo-device-dont_be_evil<br />
<br />
For build last release of nemo use this ks file https://gist.github.com/neochapay/8d40f9ee1e5fd621e0053aa126d39e81<br />
<br />
==Sailfish OS==<br />
<br />
===Github & OBS project===<br />
<br />
- https://github.com/sailfish-on-dontbeevil<br />
<br />
- https://build.merproject.org/project/show/nemo:devel:hw:pine:dontbeevil<br />
<br />
===Flash rootFS===<br />
You can download the latest rootFS from the Gitlab SailfishOS Porters CI: https://gitlab.com/sailfishos-porters-ci/dont_be_evil-ci (see the artifacts of the latest CI job).<br />
<br />
This <code>tar.gz</code> archive should be burned to the <code>data</code> partition of the SD card.<br />
It's important to burn it as the root user (not with sudo) to preserve extended attributes and ACLs: <br />
<br />
sudo su<br />
bsdtar -xpf <SAILFISH OS ROOTFS>.tar.bz2 -C <MOUNTPOINT OF /DATA><br />
<br />
===Device repos===<br />
To boot Lipstick, you need to add the device specific repos to the devkit.<br />
All the following commands are executed in a shell on the devkit.<br />
<br />
''Make sure you configure the ethernet interface first before you continue!''<br />
''You need to have access to the WWW to fetch the necessary repository data and packages.''<br />
<br />
Install zypper manually:<br />
curl -o augeas-lib.rpm http://repo.merproject.org/obs/mer:/core/latest_armv7hl/armv7hl/augeas-libs-1.6.0+git1-1.10.6.armv7hl.rpm<br />
curl -o zypper.rpm http://repo.merproject.org/obs/mer:/core/latest_armv7hl/armv7hl/zypper-1.14.6+git3-1.24.5.armv7hl.rpm<br />
rpm -Uvh *rpm<br />
<br />
Use <code>ssu</code> to add the repo<br />
ssu ar common http://repo.merproject.org/obs/nemo:/devel:/hw:/common/sailfish_latest_armv7hl/<br />
ssu ar dontbeevil http://repo.merproject.org/obs/home:/piggz:/dontbeevil/sailfishos_3.0.3.9_latest_armv7hl/<br />
ssu ar jolla https://releases.jolla.com/releases/3.0.3.9/jolla/armv7hl/<br />
<br />
Refresh the repo:<br />
zypper refresh<br />
<br />
Install the device packages:<br />
zypper install dontbeevil:qt5-qtcore dontbeevil:qt5-qttest dontbeevil:lipstick-qt5<br />
zypper install droid-config-dontbeevil # Select 1 for vendor change<br />
zypper install droid-config-dontbeevil-sailfish<br />
zypper install qt5-plugin-platform-eglfs # EGLFS LIMA plugin<br />
zypper install qt5-plugin-generic-evdev # evdev input plugins<br />
<br />
Other useful packages<br />
zypper install mce-tools #useful for mcetool (mcetool -U activates the screen)<br />
<br />
===Unknown password===<br />
The Sailfish OS rootFS sets a random password when booting for the first time.<br />
You can only log in through the <code>telnet</code> debug interface.<br />
Since the <code>eth0</code> interface still requires manually setup, you can't access <code>telnet</code>.<br />
<br />
To circumvent this issue, you can login through the UART TTY interface. <br />
However you don't know the password of the <code>root</code> nor <code>nemo</code> users!<br />
To disable the <code>root</code> and <code>nemo</code> passwords, we can modify the <code>/etc/shadow</code> file:<br />
<br />
sudo chmod +w <SD card data partition>/etc/shadow<br />
sudo vim <SD card data partition>/etc/shadow # Remove any characters where <HASHED PASSWORD> is written: user1:<HASHED PASSWORD>:16092:0:99999:7:::.<br />
sudo chmod -w <SD card data partition>/etc/shadow<br />
<br />
By removing the hashed password, we can login with the user without entering a password.<br />
You can set a new password afterwards by running as a logged in user:<br />
<br />
passwd<br />
<br />
===Init eth0===<br />
Enabling the <code>eth0</code> interface has to be done manually for now:<br />
<br />
ifconfig eth0 <YOUR_IP><br />
route add default gw <DEFAULT_GATEWAY_IP><br />
echo "nameserver <DNS_SERVER_IP>" > /etc/resolv.conf<br />
<br />
Test your configuration with <code>ping</code>:<br />
<br />
ping jolla.com<br />
<br />
<br />
===Lipstick crashing===<br />
<br />
Install Lipstick from the <code>dontbeevil</code> repository:<br />
<br />
zypper install dontbeevil:lipstick-qt5<br />
<br />
As from 3.1.0.12, this fix is obsolete.<br />
<br />
===No setup wizard===<br />
<br />
Make sure the configuration package is installed:<br />
<br />
zypper install droid-config-dontbeevil-sailfish<br />
<br />
===Missing regulatory.db for RT8723BS WiFi/BT module===<br />
<br />
git clone git://git.kernel.org/pub/scm/linux/kernel/git/sforshee/wireless-regdb.git<br />
cd wireless-regdb<br />
cp regulatory* /lib/firmware</div>Dylanvanasschttps://wiki.merproject.org/wiki/Adaptations/PinePhone64Adaptations/PinePhone642020-01-12T09:00:30Z<p>Dylanvanassc: /* Automatic boot */</p>
<hr />
<div>=Hardware Support=<br />
<br />
Full information of hardware spec [https://wiki.pine64.org/index.php/Project_Don't_be_evil Here]<br />
<br />
PostMarket OS hardware information [https://wiki.postmarketos.org/wiki/Pine_Don%27t_be_evil_devkit_(pine-dontbeevil) PostMarketOS Wiki]<br />
<br />
==WiFi/BT RTL8723CS==<br />
<br />
=== WiFi ===<br />
The WiFi driver isn't available in the Linux kernel yet. However, we can compile it as an out-of-tree driver for now.<br />
See kernel building for more instruction<br />
<br />
=== Bluetooth ===<br />
The production version of the PineTab and PinePhone are both using the Realtek 8723CS WiFi/BT module.<br />
BT is natively supported after adding the necessary firmware from [https://github.com/anarsoul/rtl8723bt-firmware/tree/master/rtl_bt https://github.com/anarsoul/rtl8723bt-firmware/tree/master/rtl_bt]<br />
Download all the <code>*.bin</code> files and copy them to the <code>/lib/firmware/rtl_bt</code> directory in the rootFS.<br />
<br />
==Modem EC25==<br />
<br />
===Setup===<br />
<br />
1. Make sure that the <code>qmimodem</code> plugin is enabled in the <code>.spec</code> of <code>ofono</code>.<br />
<br />
2. Remove the <code>noplugin.conf</code> file under <code>/lib/environment/ofono/noplugin.conf</code>.<br />
<br />
3. Restart <code>ofono</code><br />
systemctl restart ofono<br />
<br />
4. Check if the QMI modem is properly detected:<br />
/usr/lib/ofono/test/list-modems<br />
<br />
5. Unlock you SIM card (if needed):<br />
/usr/lib/ofono/test/enter-pin /quectelqmi_0 pin <PIN CODE><br />
<br />
The EC25 Quectel modem is now ready :)<br />
Thanks to SuperPrower for the hard work!<br />
<br />
===Sending SMS===<br />
<br />
/usr/lib/ofono/test/send-sms <PHONE NUMBER RECEIVER> <MESSAGE> <DELIVERY REPORT><br />
<br />
To skip the delivery report, use <code>0</code> as argument.<br />
<br />
==Cameras==<br />
<br />
Thanks to: https://wiki.postmarketos.org/wiki/Pine_Don't_be_evil_devkit_(pine-dontbeevil)#Cameras<br />
Only the back camera is supported by the mainline kernel.<br />
To use it, you need to configure it first:<br />
<br />
media-ctl --set-v4l2 '"ov5640 2-003c":0[fmt:UYVY8_2X8/1280x7200]' -d /dev/media1<br />
<br />
Afterwards, you can take a picture with:<br />
<br />
ffmpeg -s 1280x720 -f video4linux2 -i /dev/video1 -vframes 1 selfie.jpg<br />
<br />
- <code>/dev/media1</code> is the controller interface of the back camera<br />
<br />
- <code>/dev/video1</code> is the back camera stream interface<br />
<br />
If that works, you can try <code>gstreamer</code> to make the camera available for system wide usage:]<br />
<br />
gst-launch-1.0 v4l2src device=/dev/video1 num-buffers=1 ! 'video/x-raw,format=UYVY,width=1280,height=720' ! jpegenc ! filesink location=selfie.jpg<br />
cp selfie.jpg /home/nemo/Pictures<br />
<br />
This command generates a <code>selfie.jpg</code> file and by copying it to <code>/home/nemo/Pictures</code> you can view it with the Gallery app.<br />
<br />
== Audio ==<br />
<br />
1. Unmuting the <code>AIF1 Slot 0 Digital DAC</code> channel using <code>alsamixer</code>. Use <code>m</code> to unmute.<br />
<br />
2. Copy the default PulseAudio config: <br />
cp /etc/pulse/default.pa /etc/pulse/arm_native_config.pa<br />
<br />
3. Enable ALSA modules in the new config:<br />
load-module module-alsa-sink<br />
load-module module-alsa-source device=hw:1,0<br />
They are commented out by default.<br />
<br />
4. Configure PulseAudio by changing <code>arm_droid_config.pa</code> to <code>/arm_native_config.pa</code> in <code>/etc/sysconfig/pulseaudio</code>.<br />
<br />
5. Restart PulseAudio or reboot.<br />
<br />
6. Go to the Settings app and test the sound output by playing a ringtone under Sounds and Feedback.<br />
<br />
==PineTab==<br />
<br />
In pinetab we have jack to uart port cable. For enable UART console move selector nearby sd-card slot away from sd-card slot.<br />
<br />
==Testing the vibrator motor==<br />
<br />
You need to have the <code>CONFIG_GPIO_SYSFS</code> enabled in your kernel config for this!<br />
<br />
Vibrator motor is on pin <code>PD2</code>.<br />
You can calculate the PIN number for PD2 as followed ([https://linux-sunxi.org/GPIO more information]):<br />
<code>(4-1) * 32 + 2 = 98</code><br />
<br />
echo "98" > /sys/class/gpio/export # Make pin available<br />
echo "out" > /sys/class/gpio/gpio98/direction # Set as output<br />
echo "1" > /sys/class/gpio/gpio98/value # On<br />
echo "1" > /sys/class/gpio/gpio98/value # Off<br />
echo "98" > /sys/class/gpio/unexport # When you're done<br />
<br />
==Notification LED==<br />
<br />
export COLOR=red # or green, blue is broken due to a hardware fault<br />
# Activate LED<br />
echo 1 > /sys/class/leds/$COLOR/brightness<br />
# Deactivate LED<br />
echo 0 > /sys/class/leds/$COLOR/brightness<br />
<br />
The LED can be controlled in Mer by MCE. You need the <code>mce-plugin-libhybris-nondroid</code> for this.<br />
<br />
=Installation=<br />
==Prepare SD card==<br />
<br />
Use GParted or any other tool to create the following <code>EXT4</code> partitions:<br />
<br />
# <b>boot</b>: Holds the mainline kernel Image and Device Tree files<br />
# <b>data</b>: Holds the Sailfish OS rootFS<br />
<br />
GParted will ask you to leave the first MB free of the SD card when creating the first partition, this is correct.<br />
This 1 MB will be used to store the U-boot boot loader.<br />
<br />
<b>Note</b>: Make sure you have a <code>msdos</code> partition table! If not, the U-boot flashing will make partition table unusable (in case of GPT for example)!<br />
<br />
==U-Boot==<br />
<br />
We will now build the mainline U-boot boot loader from Git.<br />
<br />
=== Clone ARM Trusted Firmware (master branch) ===<br />
<br />
git clone https://github.com/ARM-software/arm-trusted-firmware.git<br />
<br />
=== Build the BL31.bin ===<br />
<br />
Follow the instructions here: https://github.com/u-boot/u-boot/blob/master/board/sunxi/README.sunxi64<br />
<br />
Quick start:<br />
<br />
export CROSS_COMPILE=aarch64-linux-gnu-<br />
ARCH=arm64 make PLAT=sun50i_a64 DEBUG=1 bl31<br />
export BL31=/path/to/bl31.bin<br />
<br />
=== Clone U-boot (master branch): ===<br />
<br />
You can find the U-boot mirror repository on Github:<br />
<br />
git clone https://github.com/u-boot/u-boot.git<br />
<br />
=== Compile U-boot ===<br />
<br />
You have to cross compile U-boot with the <code>arm64</code> arch:<br />
<br />
export CROSS_COMPILE=aarch64-linux-gnu-<br />
ARCH=arm64 make clean<br />
ARCH=arm64 make sopine_baseboard_defconfig<br />
ARCH=arm64 make<br />
<br />
The <code>sopine_baseboard_defconfig</code> is the same for the Don't Be Evil devkit.<br />
<br />
=== Burn U-boot to your SD card ===<br />
<br />
Copy the compiled U-boot bootloader to the first sector on your SD card:<br />
<br />
sudo dd if=u-boot-sunxi-with-spl.bin of=/dev/sdX bs=8k seek=1<br />
<br />
<br />
=== Manually loading the kernel ===<br />
<br />
Serial TTY Baudrate over UART = 115200 for screen, example: <code>screen /dev/ttyUSB0 115200</code><br />
You have to start screen first, before turning on the devkit.<br />
<br />
Interrupt the U-boot autoboot process when you see a message in the U-boot prompt. <br />
We need to access the U-boot prompt to load the Kernel image and boot it manually!<br />
<br />
Set bootargs:<br />
<br />
setenv bootargs root=/dev/mmcblk0p2 rootwait panic=10<br />
<br />
Kernel Image loading and Device Tree files:<br />
<br />
ext4load mmc 0:1 ${kernel_addr_r} /Image <br />
ext4load mmc 0:1 ${fdt_addr_r} /sun50i-a64-pinephone.dtb <br />
<br />
Boot the kernel:<br />
<br />
booti ${kernel_addr_r} - ${fdt_addr_r}<br />
<br />
=== Automatic boot ===<br />
<br />
Create a <code>boot.cmd</code> file for the '''PinePhone''':<br />
<br />
echo Setting bootargs<br />
setenv bootargs console=tty0 console=ttyS0,115200 root=/dev/mmcblk0p2 no_console_suspend rootwait quiet<br />
earlycon=uart,mmio32,0x01c28000 panic=10 consoleblank=0 loglevel=0<br />
printenv<br />
echo Loading DTB<br />
load mmc 0:1 ${fdt_addr_r} /sun50i-a64-pinephone.dtb<br />
echo Loading kernel Image<br />
load mmc 0:1 ${kernel_addr_r} /Image<br />
echo Booting kernel NOW<br />
booti ${kernel_addr_r} - ${fdt_addr_r}<br />
<br />
Create a <code>boot.cmd</code> file for the '''PineTab''':<br />
<br />
echo Setting bootargs<br />
setenv bootargs console=tty0 console=ttyS0,115200 root=/dev/mmcblk0p2 no_console_suspend rootwait quiet<br />
earlycon=uart,mmio32,0x01c28000 panic=10 consoleblank=0 loglevel=0<br />
printenv<br />
echo Loading DTB<br />
load mmc 0:1 ${fdt_addr_r} /sun50i-a64-pinetab.dtb<br />
echo Loading kernel Image<br />
load mmc 0:1 ${kernel_addr_r} /Image<br />
echo Booting kernel NOW<br />
booti ${kernel_addr_r} - ${fdt_addr_r}<br />
<br />
Mount your <code>boot</code> partition and run the following command:<br />
sudo mkimage -C none -A arm -T script -d /mnt/boot.cmd /mnt/boot.scr<br />
<br />
This will translate the <code>boot.cmd</code> file into a U-boot script.<br />
<br />
If you don't have the <code>mkimage</code> command available, you can install it from the <code>uboot-tools</code> package.<br />
<br />
==Kernel==<br />
<br />
The PinePhone runs a mainline kernel, device tree modifications are done by all the PinePhone OS developers on Gitlab (https://gitlab.com/pine64-org/linux).<br />
<br />
=== Clone the kernel ===<br />
<br />
git clone https://gitlab.com/pine64-org/linux<br />
cd linux<br />
git checkout pine64-kernel<br />
<br />
=== Configure the kernel ===<br />
<br />
# <b>Copy our kernel config</b>: https://gitlab.com/pinephone-sailfish-os/linux-kernel/raw/master/pinephone-config<br />
# <b>Enter the <code>linux</code> project</b>: <code>cd linux</code><br />
# <b>Copy the config file</b> to <code>.config</code> in the main directory<br />
<br />
=== Enable WiFi out-of-tree driver ===<br />
<br />
Add the driver to the kernel:<br />
cd drivers/staging<br />
git clone https://github.com/Icenowy/rtl8723cs.git<br />
<br />
Configure the kernel build system now:<br />
<br />
# <b>Add this line to <code>drivers/staging/Kconfig</code></b>: <code>source "drivers/staging/rtl8723cs/Kconfig"</code><br />
# <b>Add this line to <code>drivers/staging/Makefile</code></b>: <code>obj-$(CONFIG_RTL8723CS) += rtl8723cs/</code><br />
# <b>Enable the driver in the kernel config:</b> <code>CONFIG_RTL8723CS=m</code><br />
<br />
See: [https://gitlab.com/postmarketOS/pmaports/blob/master/main/linux-postmarketos-allwinner/rtl8723cs.patch https://gitlab.com/postmarketOS/pmaports/blob/master/main/linux-postmarketos-allwinner/rtl8723cs.patch]<br />
<br />
=== Build the kernel ===<br />
<br />
We cross compile the kernel for ARM64.<br />
The <code>LOCALVERSION</code> variable can be used to add a version to the build.<br />
<br />
Cross compile the kernel:<br />
export ARCH=arm64<br />
export CROSS_COMPILE=aarch64-linux-gnu-<br />
export LOCALVERSION=-nemo<br />
make clean<br />
make oldconfig<br />
make -j4 Image modules dtbs<br />
<br />
Install the kernel modules in a different path: <br />
make modules_install INSTALL_MOD_PATH=../linux_modules/<br />
<br />
=== Install kernel ===<br />
<br />
Copy the following things:<br />
<br />
# <b>Image</b> from <code>arch/arm64/boot/Image</code> to the root of the <code>boot</code> partition.<br />
# <b>Device tree files</b> <br />
For pinethone <code>arch/arm64/boot/dts/allwinner/sun50i-a64-pinephone.dtb</code> and <code>arch/arm64/boot/dts/allwinner/sun50i-a64-pinephone.dts</code> to the root of the <code>boot</code> partition.<br />
<br />
For pinetab <code>arch/arm64/boot/dts/allwinner/sun50i-a64-pinetab.dtb</code> and <code>arch/arm64/boot/dts/allwinner/sun50i-a64-pinetab.dts</code> to the root of the <code>boot</code> partition.<br />
# <b>Modules</b> from <code>../linux_modules</code> to <code>/lib/modules</code> on the <code>data</code> partition.<br />
<br />
==Nemo Mobile==<br />
<br />
Nemo Mobile have same MW with SFOS but use gcc8 have aarch64 support and use newset version of packages.<br />
<br />
git of device config: https://github.com/neochapay/nemo-device-dont_be_evil<br />
<br />
For build last release of nemo use this ks file https://gist.github.com/neochapay/8d40f9ee1e5fd621e0053aa126d39e81<br />
<br />
==Sailfish OS==<br />
<br />
===Github & OBS project===<br />
<br />
- https://github.com/sailfish-on-dontbeevil<br />
<br />
- https://build.merproject.org/project/show/nemo:devel:hw:pine:dontbeevil<br />
<br />
===Flash rootFS===<br />
You can download the latest rootFS from the Gitlab SailfishOS Porters CI: https://gitlab.com/sailfishos-porters-ci/dont_be_evil-ci (see the artifacts of the latest CI job).<br />
<br />
This <code>tar.gz</code> archive should be burned to the <code>data</code> partition of the SD card.<br />
It's important to burn it as the root user (not with sudo) to preserve extended attributes and ACLs: <br />
<br />
sudo su<br />
bsdtar -xpf <SAILFISH OS ROOTFS>.tar.bz2 -C <MOUNTPOINT OF /DATA><br />
<br />
===Device repos===<br />
To boot Lipstick, you need to add the device specific repos to the devkit.<br />
All the following commands are executed in a shell on the devkit.<br />
<br />
''Make sure you configure the ethernet interface first before you continue!''<br />
''You need to have access to the WWW to fetch the necessary repository data and packages.''<br />
<br />
Install zypper manually:<br />
curl -o augeas-lib.rpm http://repo.merproject.org/obs/mer:/core/latest_armv7hl/armv7hl/augeas-libs-1.6.0+git1-1.10.6.armv7hl.rpm<br />
curl -o zypper.rpm http://repo.merproject.org/obs/mer:/core/latest_armv7hl/armv7hl/zypper-1.14.6+git3-1.24.5.armv7hl.rpm<br />
rpm -Uvh *rpm<br />
<br />
Use <code>ssu</code> to add the repo<br />
ssu ar common http://repo.merproject.org/obs/nemo:/devel:/hw:/common/sailfish_latest_armv7hl/<br />
ssu ar dontbeevil http://repo.merproject.org/obs/home:/piggz:/dontbeevil/sailfishos_3.0.3.9_latest_armv7hl/<br />
ssu ar jolla https://releases.jolla.com/releases/3.0.3.9/jolla/armv7hl/<br />
<br />
Refresh the repo:<br />
zypper refresh<br />
<br />
Install the device packages:<br />
zypper install dontbeevil:qt5-qtcore dontbeevil:qt5-qttest dontbeevil:lipstick-qt5<br />
zypper install droid-config-dontbeevil # Select 1 for vendor change<br />
zypper install droid-config-dontbeevil-sailfish<br />
zypper install qt5-plugin-platform-eglfs # EGLFS LIMA plugin<br />
zypper install qt5-plugin-generic-evdev # evdev input plugins<br />
<br />
Other useful packages<br />
zypper install mce-tools #useful for mcetool (mcetool -U activates the screen)<br />
<br />
===Unknown password===<br />
The Sailfish OS rootFS sets a random password when booting for the first time.<br />
You can only log in through the <code>telnet</code> debug interface.<br />
Since the <code>eth0</code> interface still requires manually setup, you can't access <code>telnet</code>.<br />
<br />
To circumvent this issue, you can login through the UART TTY interface. <br />
However you don't know the password of the <code>root</code> nor <code>nemo</code> users!<br />
To disable the <code>root</code> and <code>nemo</code> passwords, we can modify the <code>/etc/shadow</code> file:<br />
<br />
sudo chmod +w <SD card data partition>/etc/shadow<br />
sudo vim <SD card data partition>/etc/shadow # Remove any characters where <HASHED PASSWORD> is written: user1:<HASHED PASSWORD>:16092:0:99999:7:::.<br />
sudo chmod -w <SD card data partition>/etc/shadow<br />
<br />
By removing the hashed password, we can login with the user without entering a password.<br />
You can set a new password afterwards by running as a logged in user:<br />
<br />
passwd<br />
<br />
===Init eth0===<br />
Enabling the <code>eth0</code> interface has to be done manually for now:<br />
<br />
ifconfig eth0 <YOUR_IP><br />
route add default gw <DEFAULT_GATEWAY_IP><br />
echo "nameserver <DNS_SERVER_IP>" > /etc/resolv.conf<br />
<br />
Test your configuration with <code>ping</code>:<br />
<br />
ping jolla.com<br />
<br />
<br />
===Lipstick crashing===<br />
<br />
Install Lipstick from the <code>dontbeevil</code> repository:<br />
<br />
zypper install dontbeevil:lipstick-qt5<br />
<br />
As from 3.1.0.12, this fix is obsolete.<br />
<br />
===No setup wizard===<br />
<br />
Make sure the configuration package is installed:<br />
<br />
zypper install droid-config-dontbeevil-sailfish<br />
<br />
===Missing regulatory.db for RT8723BS WiFi/BT module===<br />
<br />
git clone git://git.kernel.org/pub/scm/linux/kernel/git/sforshee/wireless-regdb.git<br />
cd wireless-regdb<br />
cp regulatory* /lib/firmware</div>Dylanvanasschttps://wiki.merproject.org/wiki/Adaptations/PinePhone64Adaptations/PinePhone642019-10-15T18:51:47Z<p>Dylanvanassc: /* Prepare SD card */</p>
<hr />
<div>=Hardware Support=<br />
<br />
Full information of hardware spec [https://wiki.pine64.org/index.php/Project_Don't_be_evil Here]<br />
<br />
PostMarket OS hardware information [https://wiki.postmarketos.org/wiki/Pine_Don%27t_be_evil_devkit_(pine-dontbeevil) PostMarketOS Wiki]<br />
<br />
==WiFi/BT RTL8723CS==<br />
<br />
=== WiFi ===<br />
The WiFi driver isn't available in the Linux kernel yet. However, we can compile it as an out-of-tree driver for now.<br />
See kernel building for more instruction<br />
<br />
=== Bluetooth ===<br />
The production version of the PineTab and PinePhone are both using the Realtek 8723CS WiFi/BT module.<br />
BT is natively supported after adding the necessary firmware from [https://github.com/anarsoul/rtl8723bt-firmware/tree/master/rtl_bt https://github.com/anarsoul/rtl8723bt-firmware/tree/master/rtl_bt]<br />
Download all the <code>*.bin</code> files and copy them to the <code>/lib/firmware/rtl_bt</code> directory in the rootFS.<br />
<br />
==Modem EC25==<br />
<br />
===Setup===<br />
<br />
1. Make sure that the <code>qmimodem</code> plugin is enabled in the <code>.spec</code> of <code>ofono</code>.<br />
<br />
2. Remove the <code>noplugin.conf</code> file under <code>/lib/environment/ofono/noplugin.conf</code>.<br />
<br />
3. Restart <code>ofono</code><br />
systemctl restart ofono<br />
<br />
4. Check if the QMI modem is properly detected:<br />
/usr/lib/ofono/test/list-modems<br />
<br />
5. Unlock you SIM card (if needed):<br />
/usr/lib/ofono/test/enter-pin /quectelqmi_0 pin <PIN CODE><br />
<br />
The EC25 Quectel modem is now ready :)<br />
Thanks to SuperPrower for the hard work!<br />
<br />
===Sending SMS===<br />
<br />
/usr/lib/ofono/test/send-sms <PHONE NUMBER RECEIVER> <MESSAGE> <DELIVERY REPORT><br />
<br />
To skip the delivery report, use <code>0</code> as argument.<br />
<br />
==Cameras==<br />
<br />
Thanks to: https://wiki.postmarketos.org/wiki/Pine_Don't_be_evil_devkit_(pine-dontbeevil)#Cameras<br />
Only the back camera is supported by the mainline kernel.<br />
To use it, you need to configure it first:<br />
<br />
media-ctl --set-v4l2 '"ov5640 2-003c":0[fmt:UYVY8_2X8/1280x7200]' -d /dev/media1<br />
<br />
Afterwards, you can take a picture with:<br />
<br />
ffmpeg -s 1280x720 -f video4linux2 -i /dev/video1 -vframes 1 selfie.jpg<br />
<br />
- <code>/dev/media1</code> is the controller interface of the back camera<br />
<br />
- <code>/dev/video1</code> is the back camera stream interface<br />
<br />
If that works, you can try <code>gstreamer</code> to make the camera available for system wide usage:]<br />
<br />
gst-launch-1.0 v4l2src device=/dev/video1 num-buffers=1 ! 'video/x-raw,format=UYVY,width=1280,height=720' ! jpegenc ! filesink location=selfie.jpg<br />
cp selfie.jpg /home/nemo/Pictures<br />
<br />
This command generates a <code>selfie.jpg</code> file and by copying it to <code>/home/nemo/Pictures</code> you can view it with the Gallery app.<br />
<br />
== Audio ==<br />
<br />
1. Unmuting the <code>AIF1 Slot 0 Digital DAC</code> channel using <code>alsamixer</code>. Use <code>m</code> to unmute.<br />
<br />
2. Copy the default PulseAudio config: <br />
cp /etc/pulse/default.pa /etc/pulse/arm_native_config.pa<br />
<br />
3. Enable ALSA modules in the new config:<br />
load-module module-alsa-sink<br />
load-module module-alsa-source device=hw:1,0<br />
They are commented out by default.<br />
<br />
4. Configure PulseAudio by changing <code>arm_droid_config.pa</code> to <code>/arm_native_config.pa</code> in <code>/etc/sysconfig/pulseaudio</code>.<br />
<br />
5. Restart PulseAudio or reboot.<br />
<br />
6. Go to the Settings app and test the sound output by playing a ringtone under Sounds and Feedback.<br />
<br />
==PineTab==<br />
<br />
In pinetab we have jack to uart port cable. For enable UART console move selector nearby sd-card slot away from sd-card slot.<br />
<br />
==Testing the vibrator motor==<br />
<br />
You need to have the <code>CONFIG_GPIO_SYSFS</code> enabled in your kernel config for this!<br />
<br />
Vibrator motor is on pin <code>PD2</code>.<br />
You can calculate the PIN number for PD2 as followed ([https://linux-sunxi.org/GPIO more information]):<br />
<code>(4-1) * 32 + 2 = 98</code><br />
<br />
echo "98" > /sys/class/gpio/export # Make pin available<br />
echo "out" > /sys/class/gpio/gpio98/direction # Set as output<br />
echo "1" > /sys/class/gpio/gpio98/value # On<br />
echo "1" > /sys/class/gpio/gpio98/value # Off<br />
echo "98" > /sys/class/gpio/unexport # When you're done<br />
<br />
==Notification LED==<br />
<br />
export COLOR=red # or green, blue is broken due to a hardware fault<br />
# Activate LED<br />
echo 1 > /sys/class/leds/$COLOR/brightness<br />
# Deactivate LED<br />
echo 0 > /sys/class/leds/$COLOR/brightness<br />
<br />
The LED can be controlled in Mer by MCE. You need the <code>mce-plugin-libhybris-nondroid</code> for this.<br />
<br />
=Installation=<br />
==Prepare SD card==<br />
<br />
Use GParted or any other tool to create the following <code>EXT4</code> partitions:<br />
<br />
# <b>boot</b>: Holds the mainline kernel Image and Device Tree files<br />
# <b>data</b>: Holds the Sailfish OS rootFS<br />
<br />
GParted will ask you to leave the first MB free of the SD card when creating the first partition, this is correct.<br />
This 1 MB will be used to store the U-boot boot loader.<br />
<br />
<b>Note</b>: Make sure you have a <code>msdos</code> partition table! If not, the U-boot flashing will make partition table unusable (in case of GPT for example)!<br />
<br />
==U-Boot==<br />
<br />
We will now build the mainline U-boot boot loader from Git.<br />
<br />
=== Clone ARM Trusted Firmware (master branch) ===<br />
<br />
git clone https://github.com/ARM-software/arm-trusted-firmware.git<br />
<br />
=== Build the BL31.bin ===<br />
<br />
Follow the instructions here: https://github.com/u-boot/u-boot/blob/master/board/sunxi/README.sunxi64<br />
<br />
Quick start:<br />
<br />
export CROSS_COMPILE=aarch64-linux-gnu-<br />
ARCH=arm64 make PLAT=sun50i_a64 DEBUG=1 bl31<br />
export BL31=/path/to/bl31.bin<br />
<br />
=== Clone U-boot (master branch): ===<br />
<br />
You can find the U-boot mirror repository on Github:<br />
<br />
git clone https://github.com/u-boot/u-boot.git<br />
<br />
=== Compile U-boot ===<br />
<br />
You have to cross compile U-boot with the <code>arm64</code> arch:<br />
<br />
export CROSS_COMPILE=aarch64-linux-gnu-<br />
ARCH=arm64 make clean<br />
ARCH=arm64 make sopine_baseboard_defconfig<br />
ARCH=arm64 make<br />
<br />
The <code>sopine_baseboard_defconfig</code> is the same for the Don't Be Evil devkit.<br />
<br />
=== Burn U-boot to your SD card ===<br />
<br />
Copy the compiled U-boot bootloader to the first sector on your SD card:<br />
<br />
sudo dd if=u-boot-sunxi-with-spl.bin of=/dev/sdX bs=8k seek=1<br />
<br />
<br />
=== Manually loading the kernel ===<br />
<br />
Serial TTY Baudrate over UART = 115200 for screen, example: <code>screen /dev/ttyUSB0 115200</code><br />
You have to start screen first, before turning on the devkit.<br />
<br />
Interrupt the U-boot autoboot process when you see a message in the U-boot prompt. <br />
We need to access the U-boot prompt to load the Kernel image and boot it manually!<br />
<br />
Set bootargs:<br />
<br />
setenv bootargs root=/dev/mmcblk0p2 rootwait panic=10<br />
<br />
Kernel Image loading and Device Tree files:<br />
<br />
ext4load mmc 0:1 ${kernel_addr_r} /Image <br />
ext4load mmc 0:1 ${fdt_addr_r} /sun50i-a64-pinephone.dtb <br />
<br />
Boot the kernel:<br />
<br />
booti ${kernel_addr_r} - ${fdt_addr_r}<br />
<br />
=== Automatic boot ===<br />
<br />
Create a <code>boot.cmd</code> file for the '''PinePhone''':<br />
<br />
echo Setting bootargs<br />
setenv bootargs console=tty0 console=ttyS0,115200 root=/dev/mmcblk0p2 no_console_suspend rootwait <br />
earlycon=uart,mmio32,0x01c28000 panic=10 consoleblank=0 loglevel=1<br />
printenv<br />
echo Loading DTB<br />
load mmc 0:1 ${fdt_addr_r} /sun50i-a64-pinephone.dtb<br />
echo Loading kernel Image<br />
load mmc 0:1 ${kernel_addr_r} /Image<br />
echo Booting kernel NOW<br />
booti ${kernel_addr_r} - ${fdt_addr_r}<br />
<br />
Create a <code>boot.cmd</code> file for the '''PineTab''':<br />
<br />
echo Setting bootargs<br />
setenv bootargs console=tty0 console=ttyS0,115200 root=/dev/mmcblk0p2 no_console_suspend rootwait <br />
earlycon=uart,mmio32,0x01c28000 panic=10 consoleblank=0 loglevel=1<br />
printenv<br />
echo Loading DTB<br />
load mmc 0:1 ${fdt_addr_r} /sun50i-a64-pinetab.dtb<br />
echo Loading kernel Image<br />
load mmc 0:1 ${kernel_addr_r} /Image<br />
echo Booting kernel NOW<br />
booti ${kernel_addr_r} - ${fdt_addr_r}<br />
<br />
Mount your <code>boot</code> partition and run the following command:<br />
sudo mkimage -C none -A arm -T script -d /mnt/boot.cmd /mnt/boot.scr<br />
<br />
This will translate the <code>boot.cmd</code> file into a U-boot script.<br />
<br />
If you don't have the <code>mkimage</code> command available, you can install it from the <code>uboot-tools</code> package.<br />
<br />
==Kernel==<br />
<br />
The PinePhone runs a mainline kernel, device tree modifications are done by all the PinePhone OS developers on Gitlab (https://gitlab.com/pine64-org/linux).<br />
<br />
=== Clone the kernel ===<br />
<br />
git clone https://gitlab.com/pine64-org/linux<br />
cd linux<br />
git checkout pine64-kernel<br />
<br />
=== Configure the kernel ===<br />
<br />
# <b>Copy our kernel config</b>: https://gitlab.com/pinephone-sailfish-os/linux-kernel/raw/master/pinephone-config<br />
# <b>Enter the <code>linux</code> project</b>: <code>cd linux</code><br />
# <b>Copy the config file</b> to <code>.config</code> in the main directory<br />
<br />
=== Enable WiFi out-of-tree driver ===<br />
<br />
Add the driver to the kernel:<br />
cd drivers/staging<br />
git clone https://github.com/Icenowy/rtl8723cs.git<br />
<br />
Configure the kernel build system now:<br />
<br />
# <b>Add this line to <code>drivers/staging/Kconfig</code></b>: <code>source "drivers/staging/rtl8723cs/Kconfig"</code><br />
# <b>Add this line to <code>drivers/staging/Makefile</code></b>: <code>obj-$(CONFIG_RTL8723CS) += rtl8723cs/</code><br />
# <b>Enable the driver in the kernel config:</b> <code>CONFIG_RTL8723CS=m</code><br />
<br />
See: [https://gitlab.com/postmarketOS/pmaports/blob/master/main/linux-postmarketos-allwinner/rtl8723cs.patch https://gitlab.com/postmarketOS/pmaports/blob/master/main/linux-postmarketos-allwinner/rtl8723cs.patch]<br />
<br />
=== Build the kernel ===<br />
<br />
We cross compile the kernel for ARM64.<br />
The <code>LOCALVERSION</code> variable can be used to add a version to the build.<br />
<br />
Cross compile the kernel:<br />
export ARCH=arm64<br />
export CROSS_COMPILE=aarch64-linux-gnu-<br />
export LOCALVERSION=-nemo<br />
make clean<br />
make oldconfig<br />
make -j4 Image modules dtbs<br />
<br />
Install the kernel modules in a different path: <br />
make modules_install INSTALL_MOD_PATH=../linux_modules/<br />
<br />
=== Install kernel ===<br />
<br />
Copy the following things:<br />
<br />
# <b>Image</b> from <code>arch/arm64/boot/Image</code> to the root of the <code>boot</code> partition.<br />
# <b>Device tree files</b> <br />
For pinethone <code>arch/arm64/boot/dts/allwinner/sun50i-a64-pinephone.dtb</code> and <code>arch/arm64/boot/dts/allwinner/sun50i-a64-pinephone.dts</code> to the root of the <code>boot</code> partition.<br />
<br />
For pinetab <code>arch/arm64/boot/dts/allwinner/sun50i-a64-pinetab.dtb</code> and <code>arch/arm64/boot/dts/allwinner/sun50i-a64-pinetab.dts</code> to the root of the <code>boot</code> partition.<br />
# <b>Modules</b> from <code>../linux_modules</code> to <code>/lib/modules</code> on the <code>data</code> partition.<br />
<br />
=== Wlan Module ===<br />
<br />
On PinePhone we have mainline kernel driver. But in PineTab we must use https://github.com/Icenowy/rtl8723cs driver.<br />
<br />
==Nemo Mobile==<br />
<br />
For build last release of nemo use this ks file https://gist.github.com/neochapay/8d40f9ee1e5fd621e0053aa126d39e81<br />
<br />
==Sailfish OS==<br />
<br />
===Github & OBS project===<br />
<br />
- https://github.com/sailfish-on-dontbeevil<br />
<br />
- https://build.merproject.org/project/show/nemo:devel:hw:pine:dontbeevil<br />
<br />
===Flash rootFS===<br />
You can download the latest rootFS from the Gitlab SailfishOS Porters CI: https://gitlab.com/sailfishos-porters-ci/dont_be_evil-ci (see the artifacts of the latest CI job).<br />
<br />
This <code>tar.gz</code> archive should be burned to the <code>data</code> partition of the SD card.<br />
It's important to burn it as the root user (not with sudo) to preserve extended attributes and ACLs: <br />
<br />
sudo su<br />
bsdtar -xpf <SAILFISH OS ROOTFS>.tar.bz2 -C <MOUNTPOINT OF /DATA><br />
<br />
===Device repos===<br />
To boot Lipstick, you need to add the device specific repos to the devkit.<br />
All the following commands are executed in a shell on the devkit.<br />
<br />
''Make sure you configure the ethernet interface first before you continue!''<br />
''You need to have access to the WWW to fetch the necessary repository data and packages.''<br />
<br />
Install zypper manually:<br />
curl -o augeas-lib.rpm http://repo.merproject.org/obs/mer:/core/latest_armv7hl/armv7hl/augeas-libs-1.6.0+git1-1.10.6.armv7hl.rpm<br />
curl -o zypper.rpm http://repo.merproject.org/obs/mer:/core/latest_armv7hl/armv7hl/zypper-1.14.6+git3-1.24.5.armv7hl.rpm<br />
rpm -Uvh *rpm<br />
<br />
Use <code>ssu</code> to add the repo<br />
ssu ar common http://repo.merproject.org/obs/nemo:/devel:/hw:/common/sailfish_latest_armv7hl/<br />
ssu ar dontbeevil http://repo.merproject.org/obs/home:/piggz:/dontbeevil/sailfishos_3.0.3.9_latest_armv7hl/<br />
ssu ar jolla https://releases.jolla.com/releases/3.0.3.9/jolla/armv7hl/<br />
<br />
Refresh the repo:<br />
zypper refresh<br />
<br />
Install the device packages:<br />
zypper install dontbeevil:qt5-qtcore dontbeevil:qt5-qttest dontbeevil:lipstick-qt5<br />
zypper install droid-config-dontbeevil # Select 1 for vendor change<br />
zypper install droid-config-dontbeevil-sailfish<br />
zypper install qt5-plugin-platform-eglfs # EGLFS LIMA plugin<br />
zypper install qt5-plugin-generic-evdev # evdev input plugins<br />
<br />
Other useful packages<br />
zypper install mce-tools #useful for mcetool (mcetool -U activates the screen)<br />
<br />
===Unknown password===<br />
The Sailfish OS rootFS sets a random password when booting for the first time.<br />
You can only log in through the <code>telnet</code> debug interface.<br />
Since the <code>eth0</code> interface still requires manually setup, you can't access <code>telnet</code>.<br />
<br />
To circumvent this issue, you can login through the UART TTY interface. <br />
However you don't know the password of the <code>root</code> nor <code>nemo</code> users!<br />
To disable the <code>root</code> and <code>nemo</code> passwords, we can modify the <code>/etc/shadow</code> file:<br />
<br />
sudo chmod +w <SD card data partition>/etc/shadow<br />
sudo vim <SD card data partition>/etc/shadow # Remove any characters where <HASHED PASSWORD> is written: user1:<HASHED PASSWORD>:16092:0:99999:7:::.<br />
sudo chmod -w <SD card data partition>/etc/shadow<br />
<br />
By removing the hashed password, we can login with the user without entering a password.<br />
You can set a new password afterwards by running as a logged in user:<br />
<br />
passwd<br />
<br />
===Init eth0===<br />
Enabling the <code>eth0</code> interface has to be done manually for now:<br />
<br />
ifconfig eth0 <YOUR_IP><br />
route add default gw <DEFAULT_GATEWAY_IP><br />
echo "nameserver <DNS_SERVER_IP>" > /etc/resolv.conf<br />
<br />
Test your configuration with <code>ping</code>:<br />
<br />
ping jolla.com<br />
<br />
<br />
===Lipstick crashing===<br />
<br />
Install Lipstick from the <code>dontbeevil</code> repository:<br />
<br />
zypper install dontbeevil:lipstick-qt5<br />
<br />
As from 3.1.0.12, this fix is obsolete.<br />
<br />
===No setup wizard===<br />
<br />
Make sure the configuration package is installed:<br />
<br />
zypper install droid-config-dontbeevil-sailfish<br />
<br />
===Missing regulatory.db for RT8723BS WiFi/BT module===<br />
<br />
git clone git://git.kernel.org/pub/scm/linux/kernel/git/sforshee/wireless-regdb.git<br />
cd wireless-regdb<br />
cp regulatory* /lib/firmware</div>Dylanvanasschttps://wiki.merproject.org/wiki/Adaptations/PinePhone64Adaptations/PinePhone642019-10-15T18:51:20Z<p>Dylanvanassc: /* Prepare SD card */</p>
<hr />
<div>=Hardware Support=<br />
<br />
Full information of hardware spec [https://wiki.pine64.org/index.php/Project_Don't_be_evil Here]<br />
<br />
PostMarket OS hardware information [https://wiki.postmarketos.org/wiki/Pine_Don%27t_be_evil_devkit_(pine-dontbeevil) PostMarketOS Wiki]<br />
<br />
==WiFi/BT RTL8723CS==<br />
<br />
=== WiFi ===<br />
The WiFi driver isn't available in the Linux kernel yet. However, we can compile it as an out-of-tree driver for now.<br />
See kernel building for more instruction<br />
<br />
=== Bluetooth ===<br />
The production version of the PineTab and PinePhone are both using the Realtek 8723CS WiFi/BT module.<br />
BT is natively supported after adding the necessary firmware from [https://github.com/anarsoul/rtl8723bt-firmware/tree/master/rtl_bt https://github.com/anarsoul/rtl8723bt-firmware/tree/master/rtl_bt]<br />
Download all the <code>*.bin</code> files and copy them to the <code>/lib/firmware/rtl_bt</code> directory in the rootFS.<br />
<br />
==Modem EC25==<br />
<br />
===Setup===<br />
<br />
1. Make sure that the <code>qmimodem</code> plugin is enabled in the <code>.spec</code> of <code>ofono</code>.<br />
<br />
2. Remove the <code>noplugin.conf</code> file under <code>/lib/environment/ofono/noplugin.conf</code>.<br />
<br />
3. Restart <code>ofono</code><br />
systemctl restart ofono<br />
<br />
4. Check if the QMI modem is properly detected:<br />
/usr/lib/ofono/test/list-modems<br />
<br />
5. Unlock you SIM card (if needed):<br />
/usr/lib/ofono/test/enter-pin /quectelqmi_0 pin <PIN CODE><br />
<br />
The EC25 Quectel modem is now ready :)<br />
Thanks to SuperPrower for the hard work!<br />
<br />
===Sending SMS===<br />
<br />
/usr/lib/ofono/test/send-sms <PHONE NUMBER RECEIVER> <MESSAGE> <DELIVERY REPORT><br />
<br />
To skip the delivery report, use <code>0</code> as argument.<br />
<br />
==Cameras==<br />
<br />
Thanks to: https://wiki.postmarketos.org/wiki/Pine_Don't_be_evil_devkit_(pine-dontbeevil)#Cameras<br />
Only the back camera is supported by the mainline kernel.<br />
To use it, you need to configure it first:<br />
<br />
media-ctl --set-v4l2 '"ov5640 2-003c":0[fmt:UYVY8_2X8/1280x7200]' -d /dev/media1<br />
<br />
Afterwards, you can take a picture with:<br />
<br />
ffmpeg -s 1280x720 -f video4linux2 -i /dev/video1 -vframes 1 selfie.jpg<br />
<br />
- <code>/dev/media1</code> is the controller interface of the back camera<br />
<br />
- <code>/dev/video1</code> is the back camera stream interface<br />
<br />
If that works, you can try <code>gstreamer</code> to make the camera available for system wide usage:]<br />
<br />
gst-launch-1.0 v4l2src device=/dev/video1 num-buffers=1 ! 'video/x-raw,format=UYVY,width=1280,height=720' ! jpegenc ! filesink location=selfie.jpg<br />
cp selfie.jpg /home/nemo/Pictures<br />
<br />
This command generates a <code>selfie.jpg</code> file and by copying it to <code>/home/nemo/Pictures</code> you can view it with the Gallery app.<br />
<br />
== Audio ==<br />
<br />
1. Unmuting the <code>AIF1 Slot 0 Digital DAC</code> channel using <code>alsamixer</code>. Use <code>m</code> to unmute.<br />
<br />
2. Copy the default PulseAudio config: <br />
cp /etc/pulse/default.pa /etc/pulse/arm_native_config.pa<br />
<br />
3. Enable ALSA modules in the new config:<br />
load-module module-alsa-sink<br />
load-module module-alsa-source device=hw:1,0<br />
They are commented out by default.<br />
<br />
4. Configure PulseAudio by changing <code>arm_droid_config.pa</code> to <code>/arm_native_config.pa</code> in <code>/etc/sysconfig/pulseaudio</code>.<br />
<br />
5. Restart PulseAudio or reboot.<br />
<br />
6. Go to the Settings app and test the sound output by playing a ringtone under Sounds and Feedback.<br />
<br />
==PineTab==<br />
<br />
In pinetab we have jack to uart port cable. For enable UART console move selector nearby sd-card slot away from sd-card slot.<br />
<br />
==Testing the vibrator motor==<br />
<br />
You need to have the <code>CONFIG_GPIO_SYSFS</code> enabled in your kernel config for this!<br />
<br />
Vibrator motor is on pin <code>PD2</code>.<br />
You can calculate the PIN number for PD2 as followed ([https://linux-sunxi.org/GPIO more information]):<br />
<code>(4-1) * 32 + 2 = 98</code><br />
<br />
echo "98" > /sys/class/gpio/export # Make pin available<br />
echo "out" > /sys/class/gpio/gpio98/direction # Set as output<br />
echo "1" > /sys/class/gpio/gpio98/value # On<br />
echo "1" > /sys/class/gpio/gpio98/value # Off<br />
echo "98" > /sys/class/gpio/unexport # When you're done<br />
<br />
==Notification LED==<br />
<br />
export COLOR=red # or green, blue is broken due to a hardware fault<br />
# Activate LED<br />
echo 1 > /sys/class/leds/$COLOR/brightness<br />
# Deactivate LED<br />
echo 0 > /sys/class/leds/$COLOR/brightness<br />
<br />
The LED can be controlled in Mer by MCE. You need the <code>mce-plugin-libhybris-nondroid</code> for this.<br />
<br />
=Installation=<br />
==Prepare SD card==<br />
<br />
Use GParted or any other tool to create the following <code>EXT4</code> partitions:<br />
<br />
# <b>boot</b>: Holds the mainline kernel Image and Device Tree files<br />
# <b>data</b>: Holds the Sailfish OS rootFS<br />
<br />
GParted will ask you to leave the first MB free of the SD card when creating the first partition, this is correct.<br />
This 1 MB will be used to store the U-boot boot loader.<br />
<br />
<b>Note</b>: Make sure you have a <code>msdos</code> partition table! If not, the U-boot flashing will make the GPT table corrupt!<br />
<br />
==U-Boot==<br />
<br />
We will now build the mainline U-boot boot loader from Git.<br />
<br />
=== Clone ARM Trusted Firmware (master branch) ===<br />
<br />
git clone https://github.com/ARM-software/arm-trusted-firmware.git<br />
<br />
=== Build the BL31.bin ===<br />
<br />
Follow the instructions here: https://github.com/u-boot/u-boot/blob/master/board/sunxi/README.sunxi64<br />
<br />
Quick start:<br />
<br />
export CROSS_COMPILE=aarch64-linux-gnu-<br />
ARCH=arm64 make PLAT=sun50i_a64 DEBUG=1 bl31<br />
export BL31=/path/to/bl31.bin<br />
<br />
=== Clone U-boot (master branch): ===<br />
<br />
You can find the U-boot mirror repository on Github:<br />
<br />
git clone https://github.com/u-boot/u-boot.git<br />
<br />
=== Compile U-boot ===<br />
<br />
You have to cross compile U-boot with the <code>arm64</code> arch:<br />
<br />
export CROSS_COMPILE=aarch64-linux-gnu-<br />
ARCH=arm64 make clean<br />
ARCH=arm64 make sopine_baseboard_defconfig<br />
ARCH=arm64 make<br />
<br />
The <code>sopine_baseboard_defconfig</code> is the same for the Don't Be Evil devkit.<br />
<br />
=== Burn U-boot to your SD card ===<br />
<br />
Copy the compiled U-boot bootloader to the first sector on your SD card:<br />
<br />
sudo dd if=u-boot-sunxi-with-spl.bin of=/dev/sdX bs=8k seek=1<br />
<br />
<br />
=== Manually loading the kernel ===<br />
<br />
Serial TTY Baudrate over UART = 115200 for screen, example: <code>screen /dev/ttyUSB0 115200</code><br />
You have to start screen first, before turning on the devkit.<br />
<br />
Interrupt the U-boot autoboot process when you see a message in the U-boot prompt. <br />
We need to access the U-boot prompt to load the Kernel image and boot it manually!<br />
<br />
Set bootargs:<br />
<br />
setenv bootargs root=/dev/mmcblk0p2 rootwait panic=10<br />
<br />
Kernel Image loading and Device Tree files:<br />
<br />
ext4load mmc 0:1 ${kernel_addr_r} /Image <br />
ext4load mmc 0:1 ${fdt_addr_r} /sun50i-a64-pinephone.dtb <br />
<br />
Boot the kernel:<br />
<br />
booti ${kernel_addr_r} - ${fdt_addr_r}<br />
<br />
=== Automatic boot ===<br />
<br />
Create a <code>boot.cmd</code> file for the '''PinePhone''':<br />
<br />
echo Setting bootargs<br />
setenv bootargs console=tty0 console=ttyS0,115200 root=/dev/mmcblk0p2 no_console_suspend rootwait <br />
earlycon=uart,mmio32,0x01c28000 panic=10 consoleblank=0 loglevel=1<br />
printenv<br />
echo Loading DTB<br />
load mmc 0:1 ${fdt_addr_r} /sun50i-a64-pinephone.dtb<br />
echo Loading kernel Image<br />
load mmc 0:1 ${kernel_addr_r} /Image<br />
echo Booting kernel NOW<br />
booti ${kernel_addr_r} - ${fdt_addr_r}<br />
<br />
Create a <code>boot.cmd</code> file for the '''PineTab''':<br />
<br />
echo Setting bootargs<br />
setenv bootargs console=tty0 console=ttyS0,115200 root=/dev/mmcblk0p2 no_console_suspend rootwait <br />
earlycon=uart,mmio32,0x01c28000 panic=10 consoleblank=0 loglevel=1<br />
printenv<br />
echo Loading DTB<br />
load mmc 0:1 ${fdt_addr_r} /sun50i-a64-pinetab.dtb<br />
echo Loading kernel Image<br />
load mmc 0:1 ${kernel_addr_r} /Image<br />
echo Booting kernel NOW<br />
booti ${kernel_addr_r} - ${fdt_addr_r}<br />
<br />
Mount your <code>boot</code> partition and run the following command:<br />
sudo mkimage -C none -A arm -T script -d /mnt/boot.cmd /mnt/boot.scr<br />
<br />
This will translate the <code>boot.cmd</code> file into a U-boot script.<br />
<br />
If you don't have the <code>mkimage</code> command available, you can install it from the <code>uboot-tools</code> package.<br />
<br />
==Kernel==<br />
<br />
The PinePhone runs a mainline kernel, device tree modifications are done by all the PinePhone OS developers on Gitlab (https://gitlab.com/pine64-org/linux).<br />
<br />
=== Clone the kernel ===<br />
<br />
git clone https://gitlab.com/pine64-org/linux<br />
cd linux<br />
git checkout pine64-kernel<br />
<br />
=== Configure the kernel ===<br />
<br />
# <b>Copy our kernel config</b>: https://gitlab.com/pinephone-sailfish-os/linux-kernel/raw/master/pinephone-config<br />
# <b>Enter the <code>linux</code> project</b>: <code>cd linux</code><br />
# <b>Copy the config file</b> to <code>.config</code> in the main directory<br />
<br />
=== Enable WiFi out-of-tree driver ===<br />
<br />
Add the driver to the kernel:<br />
cd drivers/staging<br />
git clone https://github.com/Icenowy/rtl8723cs.git<br />
<br />
Configure the kernel build system now:<br />
<br />
# <b>Add this line to <code>drivers/staging/Kconfig</code></b>: <code>source "drivers/staging/rtl8723cs/Kconfig"</code><br />
# <b>Add this line to <code>drivers/staging/Makefile</code></b>: <code>obj-$(CONFIG_RTL8723CS) += rtl8723cs/</code><br />
# <b>Enable the driver in the kernel config:</b> <code>CONFIG_RTL8723CS=m</code><br />
<br />
See: [https://gitlab.com/postmarketOS/pmaports/blob/master/main/linux-postmarketos-allwinner/rtl8723cs.patch https://gitlab.com/postmarketOS/pmaports/blob/master/main/linux-postmarketos-allwinner/rtl8723cs.patch]<br />
<br />
=== Build the kernel ===<br />
<br />
We cross compile the kernel for ARM64.<br />
The <code>LOCALVERSION</code> variable can be used to add a version to the build.<br />
<br />
Cross compile the kernel:<br />
export ARCH=arm64<br />
export CROSS_COMPILE=aarch64-linux-gnu-<br />
export LOCALVERSION=-nemo<br />
make clean<br />
make oldconfig<br />
make -j4 Image modules dtbs<br />
<br />
Install the kernel modules in a different path: <br />
make modules_install INSTALL_MOD_PATH=../linux_modules/<br />
<br />
=== Install kernel ===<br />
<br />
Copy the following things:<br />
<br />
# <b>Image</b> from <code>arch/arm64/boot/Image</code> to the root of the <code>boot</code> partition.<br />
# <b>Device tree files</b> <br />
For pinethone <code>arch/arm64/boot/dts/allwinner/sun50i-a64-pinephone.dtb</code> and <code>arch/arm64/boot/dts/allwinner/sun50i-a64-pinephone.dts</code> to the root of the <code>boot</code> partition.<br />
<br />
For pinetab <code>arch/arm64/boot/dts/allwinner/sun50i-a64-pinetab.dtb</code> and <code>arch/arm64/boot/dts/allwinner/sun50i-a64-pinetab.dts</code> to the root of the <code>boot</code> partition.<br />
# <b>Modules</b> from <code>../linux_modules</code> to <code>/lib/modules</code> on the <code>data</code> partition.<br />
<br />
=== Wlan Module ===<br />
<br />
On PinePhone we have mainline kernel driver. But in PineTab we must use https://github.com/Icenowy/rtl8723cs driver.<br />
<br />
==Nemo Mobile==<br />
<br />
For build last release of nemo use this ks file https://gist.github.com/neochapay/8d40f9ee1e5fd621e0053aa126d39e81<br />
<br />
==Sailfish OS==<br />
<br />
===Github & OBS project===<br />
<br />
- https://github.com/sailfish-on-dontbeevil<br />
<br />
- https://build.merproject.org/project/show/nemo:devel:hw:pine:dontbeevil<br />
<br />
===Flash rootFS===<br />
You can download the latest rootFS from the Gitlab SailfishOS Porters CI: https://gitlab.com/sailfishos-porters-ci/dont_be_evil-ci (see the artifacts of the latest CI job).<br />
<br />
This <code>tar.gz</code> archive should be burned to the <code>data</code> partition of the SD card.<br />
It's important to burn it as the root user (not with sudo) to preserve extended attributes and ACLs: <br />
<br />
sudo su<br />
bsdtar -xpf <SAILFISH OS ROOTFS>.tar.bz2 -C <MOUNTPOINT OF /DATA><br />
<br />
===Device repos===<br />
To boot Lipstick, you need to add the device specific repos to the devkit.<br />
All the following commands are executed in a shell on the devkit.<br />
<br />
''Make sure you configure the ethernet interface first before you continue!''<br />
''You need to have access to the WWW to fetch the necessary repository data and packages.''<br />
<br />
Install zypper manually:<br />
curl -o augeas-lib.rpm http://repo.merproject.org/obs/mer:/core/latest_armv7hl/armv7hl/augeas-libs-1.6.0+git1-1.10.6.armv7hl.rpm<br />
curl -o zypper.rpm http://repo.merproject.org/obs/mer:/core/latest_armv7hl/armv7hl/zypper-1.14.6+git3-1.24.5.armv7hl.rpm<br />
rpm -Uvh *rpm<br />
<br />
Use <code>ssu</code> to add the repo<br />
ssu ar common http://repo.merproject.org/obs/nemo:/devel:/hw:/common/sailfish_latest_armv7hl/<br />
ssu ar dontbeevil http://repo.merproject.org/obs/home:/piggz:/dontbeevil/sailfishos_3.0.3.9_latest_armv7hl/<br />
ssu ar jolla https://releases.jolla.com/releases/3.0.3.9/jolla/armv7hl/<br />
<br />
Refresh the repo:<br />
zypper refresh<br />
<br />
Install the device packages:<br />
zypper install dontbeevil:qt5-qtcore dontbeevil:qt5-qttest dontbeevil:lipstick-qt5<br />
zypper install droid-config-dontbeevil # Select 1 for vendor change<br />
zypper install droid-config-dontbeevil-sailfish<br />
zypper install qt5-plugin-platform-eglfs # EGLFS LIMA plugin<br />
zypper install qt5-plugin-generic-evdev # evdev input plugins<br />
<br />
Other useful packages<br />
zypper install mce-tools #useful for mcetool (mcetool -U activates the screen)<br />
<br />
===Unknown password===<br />
The Sailfish OS rootFS sets a random password when booting for the first time.<br />
You can only log in through the <code>telnet</code> debug interface.<br />
Since the <code>eth0</code> interface still requires manually setup, you can't access <code>telnet</code>.<br />
<br />
To circumvent this issue, you can login through the UART TTY interface. <br />
However you don't know the password of the <code>root</code> nor <code>nemo</code> users!<br />
To disable the <code>root</code> and <code>nemo</code> passwords, we can modify the <code>/etc/shadow</code> file:<br />
<br />
sudo chmod +w <SD card data partition>/etc/shadow<br />
sudo vim <SD card data partition>/etc/shadow # Remove any characters where <HASHED PASSWORD> is written: user1:<HASHED PASSWORD>:16092:0:99999:7:::.<br />
sudo chmod -w <SD card data partition>/etc/shadow<br />
<br />
By removing the hashed password, we can login with the user without entering a password.<br />
You can set a new password afterwards by running as a logged in user:<br />
<br />
passwd<br />
<br />
===Init eth0===<br />
Enabling the <code>eth0</code> interface has to be done manually for now:<br />
<br />
ifconfig eth0 <YOUR_IP><br />
route add default gw <DEFAULT_GATEWAY_IP><br />
echo "nameserver <DNS_SERVER_IP>" > /etc/resolv.conf<br />
<br />
Test your configuration with <code>ping</code>:<br />
<br />
ping jolla.com<br />
<br />
<br />
===Lipstick crashing===<br />
<br />
Install Lipstick from the <code>dontbeevil</code> repository:<br />
<br />
zypper install dontbeevil:lipstick-qt5<br />
<br />
As from 3.1.0.12, this fix is obsolete.<br />
<br />
===No setup wizard===<br />
<br />
Make sure the configuration package is installed:<br />
<br />
zypper install droid-config-dontbeevil-sailfish<br />
<br />
===Missing regulatory.db for RT8723BS WiFi/BT module===<br />
<br />
git clone git://git.kernel.org/pub/scm/linux/kernel/git/sforshee/wireless-regdb.git<br />
cd wireless-regdb<br />
cp regulatory* /lib/firmware</div>Dylanvanasschttps://wiki.merproject.org/wiki/Adaptations/PinePhone64Adaptations/PinePhone642019-10-05T14:12:52Z<p>Dylanvanassc: /* Lipstick crashing */</p>
<hr />
<div>=Hardware Support=<br />
<br />
Full information of hardware spec [https://wiki.pine64.org/index.php/Project_Don't_be_evil Here]<br />
<br />
PostMarket OS hardware information [https://wiki.postmarketos.org/wiki/Pine_Don%27t_be_evil_devkit_(pine-dontbeevil) PostMarketOS Wiki]<br />
<br />
==WiFi/BT RTL8723CS==<br />
<br />
=== WiFi ===<br />
The WiFi driver isn't available in the Linux kernel yet. However, we can compile it as an out-of-tree driver for now.<br />
See kernel building for more instruction<br />
<br />
=== Bluetooth ===<br />
The production version of the PineTab and PinePhone are both using the Realtek 8723CS WiFi/BT module.<br />
BT is natively supported after adding the necessary firmware from [https://github.com/anarsoul/rtl8723bt-firmware/tree/master/rtl_bt https://github.com/anarsoul/rtl8723bt-firmware/tree/master/rtl_bt]<br />
Download all the <code>*.bin</code> files and copy them to the <code>/lib/firmware/rtl_bt</code> directory in the rootFS.<br />
<br />
==Modem EC25==<br />
<br />
===Setup===<br />
<br />
1. Make sure that the <code>qmimodem</code> plugin is enabled in the <code>.spec</code> of <code>ofono</code>.<br />
<br />
2. Remove the <code>noplugin.conf</code> file under <code>/lib/environment/ofono/noplugin.conf</code>.<br />
<br />
3. Restart <code>ofono</code><br />
systemctl restart ofono<br />
<br />
4. Check if the QMI modem is properly detected:<br />
/usr/lib/ofono/test/list-modems<br />
<br />
5. Unlock you SIM card (if needed):<br />
/usr/lib/ofono/test/enter-pin /quectelqmi_0 pin <PIN CODE><br />
<br />
The EC25 Quectel modem is now ready :)<br />
Thanks to SuperPrower for the hard work!<br />
<br />
===Sending SMS===<br />
<br />
/usr/lib/ofono/test/send-sms <PHONE NUMBER RECEIVER> <MESSAGE> <DELIVERY REPORT><br />
<br />
To skip the delivery report, use <code>0</code> as argument.<br />
<br />
==Cameras==<br />
<br />
Thanks to: https://wiki.postmarketos.org/wiki/Pine_Don't_be_evil_devkit_(pine-dontbeevil)#Cameras<br />
Only the back camera is supported by the mainline kernel.<br />
To use it, you need to configure it first:<br />
<br />
media-ctl --set-v4l2 '"ov5640 2-003c":0[fmt:UYVY8_2X8/1280x7200]' -d /dev/media1<br />
<br />
Afterwards, you can take a picture with:<br />
<br />
ffmpeg -s 1280x720 -f video4linux2 -i /dev/video1 -vframes 1 selfie.jpg<br />
<br />
- <code>/dev/media1</code> is the controller interface of the back camera<br />
<br />
- <code>/dev/video1</code> is the back camera stream interface<br />
<br />
If that works, you can try <code>gstreamer</code> to make the camera available for system wide usage:]<br />
<br />
gst-launch-1.0 v4l2src device=/dev/video1 num-buffers=1 ! 'video/x-raw,format=UYVY,width=1280,height=720' ! jpegenc ! filesink location=selfie.jpg<br />
cp selfie.jpg /home/nemo/Pictures<br />
<br />
This command generates a <code>selfie.jpg</code> file and by copying it to <code>/home/nemo/Pictures</code> you can view it with the Gallery app.<br />
<br />
== Audio ==<br />
<br />
1. Unmuting the <code>AIF1 Slot 0 Digital DAC</code> channel using <code>alsamixer</code>. Use <code>m</code> to unmute.<br />
<br />
2. Copy the default PulseAudio config: <br />
cp /etc/pulse/default.pa /etc/pulse/arm_native_config.pa<br />
<br />
3. Enable ALSA modules in the new config:<br />
load-module module-alsa-sink<br />
load-module module-alsa-source device=hw:1,0<br />
They are commented out by default.<br />
<br />
4. Configure PulseAudio by changing <code>arm_droid_config.pa</code> to <code>/arm_native_config.pa</code> in <code>/etc/sysconfig/pulseaudio</code>.<br />
<br />
5. Restart PulseAudio or reboot.<br />
<br />
6. Go to the Settings app and test the sound output by playing a ringtone under Sounds and Feedback.<br />
<br />
==PineTab==<br />
<br />
In pinetab we have jack to uart port cable. For enable UART console move selector nearby sd-card slot away from sd-card slot.<br />
<br />
==Testing the vibrator motor==<br />
<br />
You need to have the <code>CONFIG_GPIO_SYSFS</code> enabled in your kernel config for this!<br />
<br />
Vibrator motor is on pin <code>PD2</code>.<br />
You can calculate the PIN number for PD2 as followed ([https://linux-sunxi.org/GPIO more information]):<br />
<code>(4-1) * 32 + 2 = 98</code><br />
<br />
echo "98" > /sys/class/gpio/export # Make pin available<br />
echo "out" > /sys/class/gpio/gpio98/direction # Set as output<br />
echo "1" > /sys/class/gpio/gpio98/value # On<br />
echo "1" > /sys/class/gpio/gpio98/value # Off<br />
echo "98" > /sys/class/gpio/unexport # When you're done<br />
<br />
==Notification LED==<br />
<br />
export COLOR=red # or green, blue is broken due to a hardware fault<br />
# Activate LED<br />
echo 1 > /sys/class/leds/$COLOR/brightness<br />
# Deactivate LED<br />
echo 0 > /sys/class/leds/$COLOR/brightness<br />
<br />
The LED can be controlled in Mer by MCE. You need the <code>mce-plugin-libhybris-nondroid</code> for this.<br />
<br />
=Installation=<br />
==Prepare SD card==<br />
<br />
Use GParted or any other tool to create the following <code>EXT4</code> partitions:<br />
<br />
# <b>boot</b>: Holds the mainline kernel Image and Device Tree files<br />
# <b>data</b>: Holds the Sailfish OS rootFS<br />
<br />
GParted will ask you to leave the first MB free of the SD card when creating the first partition, this is correct.<br />
This 1 MB will be used to store the U-boot boot loader.<br />
<br />
==U-Boot==<br />
<br />
We will now build the mainline U-boot boot loader from Git.<br />
<br />
=== Clone ARM Trusted Firmware (master branch) ===<br />
<br />
git clone https://github.com/ARM-software/arm-trusted-firmware.git<br />
<br />
=== Build the BL31.bin ===<br />
<br />
Follow the instructions here: https://github.com/u-boot/u-boot/blob/master/board/sunxi/README.sunxi64<br />
<br />
Quick start:<br />
<br />
export CROSS_COMPILE=aarch64-linux-gnu-<br />
ARCH=arm64 make PLAT=sun50i_a64 DEBUG=1 bl31<br />
export BL31=/path/to/bl31.bin<br />
<br />
=== Clone U-boot (master branch): ===<br />
<br />
You can find the U-boot mirror repository on Github:<br />
<br />
git clone https://github.com/u-boot/u-boot.git<br />
<br />
=== Compile U-boot ===<br />
<br />
You have to cross compile U-boot with the <code>arm64</code> arch:<br />
<br />
export CROSS_COMPILE=aarch64-linux-gnu-<br />
ARCH=arm64 make clean<br />
ARCH=arm64 make sopine_baseboard_defconfig<br />
ARCH=arm64 make<br />
<br />
The <code>sopine_baseboard_defconfig</code> is the same for the Don't Be Evil devkit.<br />
<br />
=== Burn U-boot to your SD card ===<br />
<br />
Copy the compiled U-boot bootloader to the first sector on your SD card:<br />
<br />
sudo dd if=u-boot-sunxi-with-spl.bin of=/dev/sdX bs=8k seek=1<br />
<br />
<br />
=== Manually loading the kernel ===<br />
<br />
Serial TTY Baudrate over UART = 115200 for screen, example: <code>screen /dev/ttyUSB0 115200</code><br />
You have to start screen first, before turning on the devkit.<br />
<br />
Interrupt the U-boot autoboot process when you see a message in the U-boot prompt. <br />
We need to access the U-boot prompt to load the Kernel image and boot it manually!<br />
<br />
Set bootargs:<br />
<br />
setenv bootargs root=/dev/mmcblk0p2 rootwait panic=10<br />
<br />
Kernel Image loading and Device Tree files:<br />
<br />
ext4load mmc 0:1 ${kernel_addr_r} /Image <br />
ext4load mmc 0:1 ${fdt_addr_r} /sun50i-a64-pinephone.dtb <br />
<br />
Boot the kernel:<br />
<br />
booti ${kernel_addr_r} - ${fdt_addr_r}<br />
<br />
=== Automatic boot ===<br />
<br />
Create a <code>boot.cmd</code> file for the '''PinePhone''':<br />
<br />
echo Setting bootargs<br />
setenv bootargs console=tty0 console=ttyS0,115200 root=/dev/mmcblk0p2 no_console_suspend rootwait <br />
earlycon=uart,mmio32,0x01c28000 panic=10 consoleblank=0 loglevel=1<br />
printenv<br />
echo Loading DTB<br />
load mmc 0:1 ${fdt_addr_r} /sun50i-a64-pinephone.dtb<br />
echo Loading kernel Image<br />
load mmc 0:1 ${kernel_addr_r} /Image<br />
echo Booting kernel NOW<br />
booti ${kernel_addr_r} - ${fdt_addr_r}<br />
<br />
Create a <code>boot.cmd</code> file for the '''PineTab''':<br />
<br />
echo Setting bootargs<br />
setenv bootargs console=tty0 console=ttyS0,115200 root=/dev/mmcblk0p2 no_console_suspend rootwait <br />
earlycon=uart,mmio32,0x01c28000 panic=10 consoleblank=0 loglevel=1<br />
printenv<br />
echo Loading DTB<br />
load mmc 0:1 ${fdt_addr_r} /sun50i-a64-pinetab.dtb<br />
echo Loading kernel Image<br />
load mmc 0:1 ${kernel_addr_r} /Image<br />
echo Booting kernel NOW<br />
booti ${kernel_addr_r} - ${fdt_addr_r}<br />
<br />
Mount your <code>boot</code> partition and run the following command:<br />
sudo mkimage -C none -A arm -T script -d /mnt/boot.cmd /mnt/boot.scr<br />
<br />
This will translate the <code>boot.cmd</code> file into a U-boot script.<br />
<br />
If you don't have the <code>mkimage</code> command available, you can install it from the <code>uboot-tools</code> package.<br />
<br />
==Kernel==<br />
<br />
The PinePhone runs a mainline kernel, device tree modifications are done by all the PinePhone OS developers on Gitlab (https://gitlab.com/pine64-org/linux).<br />
<br />
=== Clone the kernel ===<br />
<br />
git clone https://gitlab.com/pine64-org/linux<br />
cd linux<br />
git checkout pine64-kernel<br />
<br />
=== Configure the kernel ===<br />
<br />
# <b>Copy our kernel config</b>: https://gitlab.com/pinephone-sailfish-os/linux-kernel/raw/master/pinephone-config<br />
# <b>Enter the <code>linux</code> project</b>: <code>cd linux</code><br />
# <b>Copy the config file</b> to <code>.config</code> in the main directory<br />
<br />
=== Enable WiFi out-of-tree driver ===<br />
<br />
Add the driver to the kernel:<br />
cd drivers/staging<br />
git clone https://github.com/Icenowy/rtl8723cs.git<br />
<br />
Configure the kernel build system now:<br />
<br />
# <b>Add this line to <code>drivers/staging/Kconfig</code></b>: <code>source "drivers/staging/rtl8723cs/Kconfig"</code><br />
# <b>Add this line to <code>drivers/staging/Makefile</code></b>: <code>obj-$(CONFIG_RTL8723CS) += rtl8723cs/</code><br />
# <b>Enable the driver in the kernel config:</b> <code>CONFIG_RTL8723CS=m</code><br />
<br />
See: [https://gitlab.com/postmarketOS/pmaports/blob/master/main/linux-postmarketos-allwinner/rtl8723cs.patch https://gitlab.com/postmarketOS/pmaports/blob/master/main/linux-postmarketos-allwinner/rtl8723cs.patch]<br />
<br />
=== Build the kernel ===<br />
<br />
We cross compile the kernel for ARM64.<br />
The <code>LOCALVERSION</code> variable can be used to add a version to the build.<br />
<br />
Cross compile the kernel:<br />
export ARCH=arm64<br />
export CROSS_COMPILE=aarch64-linux-gnu-<br />
export LOCALVERSION=-nemo<br />
make clean<br />
make oldconfig<br />
make -j4 Image modules dtbs<br />
<br />
Install the kernel modules in a different path: <br />
make modules_install INSTALL_MOD_PATH=../linux_modules/<br />
<br />
=== Install kernel ===<br />
<br />
Copy the following things:<br />
<br />
# <b>Image</b> from <code>arch/arm64/boot/Image</code> to the root of the <code>boot</code> partition.<br />
# <b>Device tree files</b> <br />
For pinethone <code>arch/arm64/boot/dts/allwinner/sun50i-a64-pinephone.dtb</code> and <code>arch/arm64/boot/dts/allwinner/sun50i-a64-pinephone.dts</code> to the root of the <code>boot</code> partition.<br />
<br />
For pinetab <code>arch/arm64/boot/dts/allwinner/sun50i-a64-pinetab.dtb</code> and <code>arch/arm64/boot/dts/allwinner/sun50i-a64-pinetab.dts</code> to the root of the <code>boot</code> partition.<br />
# <b>Modules</b> from <code>../linux_modules</code> to <code>/lib/modules</code> on the <code>data</code> partition.<br />
<br />
=== Wlan Module ===<br />
<br />
On PinePhone we have mainline kernel driver. But in PineTab we must use https://github.com/Icenowy/rtl8723cs driver.<br />
<br />
==Nemo Mobile==<br />
<br />
For build last release of nemo use this ks file https://gist.github.com/neochapay/8d40f9ee1e5fd621e0053aa126d39e81<br />
<br />
==Sailfish OS==<br />
<br />
===Github & OBS project===<br />
<br />
- https://github.com/sailfish-on-dontbeevil<br />
<br />
- https://build.merproject.org/project/show/nemo:devel:hw:pine:dontbeevil<br />
<br />
===Flash rootFS===<br />
You can download the latest rootFS from the Gitlab SailfishOS Porters CI: https://gitlab.com/sailfishos-porters-ci/dont_be_evil-ci (see the artifacts of the latest CI job).<br />
<br />
This <code>tar.gz</code> archive should be burned to the <code>data</code> partition of the SD card.<br />
It's important to burn it as the root user (not with sudo) to preserve extended attributes and ACLs: <br />
<br />
sudo su<br />
bsdtar -xpf <SAILFISH OS ROOTFS>.tar.bz2 -C <MOUNTPOINT OF /DATA><br />
<br />
===Device repos===<br />
To boot Lipstick, you need to add the device specific repos to the devkit.<br />
All the following commands are executed in a shell on the devkit.<br />
<br />
''Make sure you configure the ethernet interface first before you continue!''<br />
''You need to have access to the WWW to fetch the necessary repository data and packages.''<br />
<br />
Install zypper manually:<br />
curl -o augeas-lib.rpm http://repo.merproject.org/obs/mer:/core/latest_armv7hl/armv7hl/augeas-libs-1.6.0+git1-1.10.6.armv7hl.rpm<br />
curl -o zypper.rpm http://repo.merproject.org/obs/mer:/core/latest_armv7hl/armv7hl/zypper-1.14.6+git3-1.24.5.armv7hl.rpm<br />
rpm -Uvh *rpm<br />
<br />
Use <code>ssu</code> to add the repo<br />
ssu ar common http://repo.merproject.org/obs/nemo:/devel:/hw:/common/sailfish_latest_armv7hl/<br />
ssu ar dontbeevil http://repo.merproject.org/obs/home:/piggz:/dontbeevil/sailfishos_3.0.3.9_latest_armv7hl/<br />
ssu ar jolla https://releases.jolla.com/releases/3.0.3.9/jolla/armv7hl/<br />
<br />
Refresh the repo:<br />
zypper refresh<br />
<br />
Install the device packages:<br />
zypper install dontbeevil:qt5-qtcore dontbeevil:qt5-qttest dontbeevil:lipstick-qt5<br />
zypper install droid-config-dontbeevil # Select 1 for vendor change<br />
zypper install droid-config-dontbeevil-sailfish<br />
zypper install qt5-plugin-platform-eglfs # EGLFS LIMA plugin<br />
zypper install qt5-plugin-generic-evdev # evdev input plugins<br />
<br />
Other useful packages<br />
zypper install mce-tools #useful for mcetool (mcetool -U activates the screen)<br />
<br />
===Unknown password===<br />
The Sailfish OS rootFS sets a random password when booting for the first time.<br />
You can only log in through the <code>telnet</code> debug interface.<br />
Since the <code>eth0</code> interface still requires manually setup, you can't access <code>telnet</code>.<br />
<br />
To circumvent this issue, you can login through the UART TTY interface. <br />
However you don't know the password of the <code>root</code> nor <code>nemo</code> users!<br />
To disable the <code>root</code> and <code>nemo</code> passwords, we can modify the <code>/etc/shadow</code> file:<br />
<br />
sudo chmod +w <SD card data partition>/etc/shadow<br />
sudo vim <SD card data partition>/etc/shadow # Remove any characters where <HASHED PASSWORD> is written: user1:<HASHED PASSWORD>:16092:0:99999:7:::.<br />
sudo chmod -w <SD card data partition>/etc/shadow<br />
<br />
By removing the hashed password, we can login with the user without entering a password.<br />
You can set a new password afterwards by running as a logged in user:<br />
<br />
passwd<br />
<br />
===Init eth0===<br />
Enabling the <code>eth0</code> interface has to be done manually for now:<br />
<br />
ifconfig eth0 <YOUR_IP><br />
route add default gw <DEFAULT_GATEWAY_IP><br />
echo "nameserver <DNS_SERVER_IP>" > /etc/resolv.conf<br />
<br />
Test your configuration with <code>ping</code>:<br />
<br />
ping jolla.com<br />
<br />
<br />
===Lipstick crashing===<br />
<br />
Install Lipstick from the <code>dontbeevil</code> repository:<br />
<br />
zypper install dontbeevil:lipstick-qt5<br />
<br />
As from 3.1.0.12, this fix is obsolete.<br />
<br />
===No setup wizard===<br />
<br />
Make sure the configuration package is installed:<br />
<br />
zypper install droid-config-dontbeevil-sailfish<br />
<br />
===Missing regulatory.db for RT8723BS WiFi/BT module===<br />
<br />
git clone git://git.kernel.org/pub/scm/linux/kernel/git/sforshee/wireless-regdb.git<br />
cd wireless-regdb<br />
cp regulatory* /lib/firmware</div>Dylanvanasschttps://wiki.merproject.org/wiki/Adaptations/PinePhone64Adaptations/PinePhone642019-10-05T14:11:42Z<p>Dylanvanassc: /* Install kernel */</p>
<hr />
<div>=Hardware Support=<br />
<br />
Full information of hardware spec [https://wiki.pine64.org/index.php/Project_Don't_be_evil Here]<br />
<br />
PostMarket OS hardware information [https://wiki.postmarketos.org/wiki/Pine_Don%27t_be_evil_devkit_(pine-dontbeevil) PostMarketOS Wiki]<br />
<br />
==WiFi/BT RTL8723CS==<br />
<br />
=== WiFi ===<br />
The WiFi driver isn't available in the Linux kernel yet. However, we can compile it as an out-of-tree driver for now.<br />
See kernel building for more instruction<br />
<br />
=== Bluetooth ===<br />
The production version of the PineTab and PinePhone are both using the Realtek 8723CS WiFi/BT module.<br />
BT is natively supported after adding the necessary firmware from [https://github.com/anarsoul/rtl8723bt-firmware/tree/master/rtl_bt https://github.com/anarsoul/rtl8723bt-firmware/tree/master/rtl_bt]<br />
Download all the <code>*.bin</code> files and copy them to the <code>/lib/firmware/rtl_bt</code> directory in the rootFS.<br />
<br />
==Modem EC25==<br />
<br />
===Setup===<br />
<br />
1. Make sure that the <code>qmimodem</code> plugin is enabled in the <code>.spec</code> of <code>ofono</code>.<br />
<br />
2. Remove the <code>noplugin.conf</code> file under <code>/lib/environment/ofono/noplugin.conf</code>.<br />
<br />
3. Restart <code>ofono</code><br />
systemctl restart ofono<br />
<br />
4. Check if the QMI modem is properly detected:<br />
/usr/lib/ofono/test/list-modems<br />
<br />
5. Unlock you SIM card (if needed):<br />
/usr/lib/ofono/test/enter-pin /quectelqmi_0 pin <PIN CODE><br />
<br />
The EC25 Quectel modem is now ready :)<br />
Thanks to SuperPrower for the hard work!<br />
<br />
===Sending SMS===<br />
<br />
/usr/lib/ofono/test/send-sms <PHONE NUMBER RECEIVER> <MESSAGE> <DELIVERY REPORT><br />
<br />
To skip the delivery report, use <code>0</code> as argument.<br />
<br />
==Cameras==<br />
<br />
Thanks to: https://wiki.postmarketos.org/wiki/Pine_Don't_be_evil_devkit_(pine-dontbeevil)#Cameras<br />
Only the back camera is supported by the mainline kernel.<br />
To use it, you need to configure it first:<br />
<br />
media-ctl --set-v4l2 '"ov5640 2-003c":0[fmt:UYVY8_2X8/1280x7200]' -d /dev/media1<br />
<br />
Afterwards, you can take a picture with:<br />
<br />
ffmpeg -s 1280x720 -f video4linux2 -i /dev/video1 -vframes 1 selfie.jpg<br />
<br />
- <code>/dev/media1</code> is the controller interface of the back camera<br />
<br />
- <code>/dev/video1</code> is the back camera stream interface<br />
<br />
If that works, you can try <code>gstreamer</code> to make the camera available for system wide usage:]<br />
<br />
gst-launch-1.0 v4l2src device=/dev/video1 num-buffers=1 ! 'video/x-raw,format=UYVY,width=1280,height=720' ! jpegenc ! filesink location=selfie.jpg<br />
cp selfie.jpg /home/nemo/Pictures<br />
<br />
This command generates a <code>selfie.jpg</code> file and by copying it to <code>/home/nemo/Pictures</code> you can view it with the Gallery app.<br />
<br />
== Audio ==<br />
<br />
1. Unmuting the <code>AIF1 Slot 0 Digital DAC</code> channel using <code>alsamixer</code>. Use <code>m</code> to unmute.<br />
<br />
2. Copy the default PulseAudio config: <br />
cp /etc/pulse/default.pa /etc/pulse/arm_native_config.pa<br />
<br />
3. Enable ALSA modules in the new config:<br />
load-module module-alsa-sink<br />
load-module module-alsa-source device=hw:1,0<br />
They are commented out by default.<br />
<br />
4. Configure PulseAudio by changing <code>arm_droid_config.pa</code> to <code>/arm_native_config.pa</code> in <code>/etc/sysconfig/pulseaudio</code>.<br />
<br />
5. Restart PulseAudio or reboot.<br />
<br />
6. Go to the Settings app and test the sound output by playing a ringtone under Sounds and Feedback.<br />
<br />
==PineTab==<br />
<br />
In pinetab we have jack to uart port cable. For enable UART console move selector nearby sd-card slot away from sd-card slot.<br />
<br />
==Testing the vibrator motor==<br />
<br />
You need to have the <code>CONFIG_GPIO_SYSFS</code> enabled in your kernel config for this!<br />
<br />
Vibrator motor is on pin <code>PD2</code>.<br />
You can calculate the PIN number for PD2 as followed ([https://linux-sunxi.org/GPIO more information]):<br />
<code>(4-1) * 32 + 2 = 98</code><br />
<br />
echo "98" > /sys/class/gpio/export # Make pin available<br />
echo "out" > /sys/class/gpio/gpio98/direction # Set as output<br />
echo "1" > /sys/class/gpio/gpio98/value # On<br />
echo "1" > /sys/class/gpio/gpio98/value # Off<br />
echo "98" > /sys/class/gpio/unexport # When you're done<br />
<br />
==Notification LED==<br />
<br />
export COLOR=red # or green, blue is broken due to a hardware fault<br />
# Activate LED<br />
echo 1 > /sys/class/leds/$COLOR/brightness<br />
# Deactivate LED<br />
echo 0 > /sys/class/leds/$COLOR/brightness<br />
<br />
The LED can be controlled in Mer by MCE. You need the <code>mce-plugin-libhybris-nondroid</code> for this.<br />
<br />
=Installation=<br />
==Prepare SD card==<br />
<br />
Use GParted or any other tool to create the following <code>EXT4</code> partitions:<br />
<br />
# <b>boot</b>: Holds the mainline kernel Image and Device Tree files<br />
# <b>data</b>: Holds the Sailfish OS rootFS<br />
<br />
GParted will ask you to leave the first MB free of the SD card when creating the first partition, this is correct.<br />
This 1 MB will be used to store the U-boot boot loader.<br />
<br />
==U-Boot==<br />
<br />
We will now build the mainline U-boot boot loader from Git.<br />
<br />
=== Clone ARM Trusted Firmware (master branch) ===<br />
<br />
git clone https://github.com/ARM-software/arm-trusted-firmware.git<br />
<br />
=== Build the BL31.bin ===<br />
<br />
Follow the instructions here: https://github.com/u-boot/u-boot/blob/master/board/sunxi/README.sunxi64<br />
<br />
Quick start:<br />
<br />
export CROSS_COMPILE=aarch64-linux-gnu-<br />
ARCH=arm64 make PLAT=sun50i_a64 DEBUG=1 bl31<br />
export BL31=/path/to/bl31.bin<br />
<br />
=== Clone U-boot (master branch): ===<br />
<br />
You can find the U-boot mirror repository on Github:<br />
<br />
git clone https://github.com/u-boot/u-boot.git<br />
<br />
=== Compile U-boot ===<br />
<br />
You have to cross compile U-boot with the <code>arm64</code> arch:<br />
<br />
export CROSS_COMPILE=aarch64-linux-gnu-<br />
ARCH=arm64 make clean<br />
ARCH=arm64 make sopine_baseboard_defconfig<br />
ARCH=arm64 make<br />
<br />
The <code>sopine_baseboard_defconfig</code> is the same for the Don't Be Evil devkit.<br />
<br />
=== Burn U-boot to your SD card ===<br />
<br />
Copy the compiled U-boot bootloader to the first sector on your SD card:<br />
<br />
sudo dd if=u-boot-sunxi-with-spl.bin of=/dev/sdX bs=8k seek=1<br />
<br />
<br />
=== Manually loading the kernel ===<br />
<br />
Serial TTY Baudrate over UART = 115200 for screen, example: <code>screen /dev/ttyUSB0 115200</code><br />
You have to start screen first, before turning on the devkit.<br />
<br />
Interrupt the U-boot autoboot process when you see a message in the U-boot prompt. <br />
We need to access the U-boot prompt to load the Kernel image and boot it manually!<br />
<br />
Set bootargs:<br />
<br />
setenv bootargs root=/dev/mmcblk0p2 rootwait panic=10<br />
<br />
Kernel Image loading and Device Tree files:<br />
<br />
ext4load mmc 0:1 ${kernel_addr_r} /Image <br />
ext4load mmc 0:1 ${fdt_addr_r} /sun50i-a64-pinephone.dtb <br />
<br />
Boot the kernel:<br />
<br />
booti ${kernel_addr_r} - ${fdt_addr_r}<br />
<br />
=== Automatic boot ===<br />
<br />
Create a <code>boot.cmd</code> file for the '''PinePhone''':<br />
<br />
echo Setting bootargs<br />
setenv bootargs console=tty0 console=ttyS0,115200 root=/dev/mmcblk0p2 no_console_suspend rootwait <br />
earlycon=uart,mmio32,0x01c28000 panic=10 consoleblank=0 loglevel=1<br />
printenv<br />
echo Loading DTB<br />
load mmc 0:1 ${fdt_addr_r} /sun50i-a64-pinephone.dtb<br />
echo Loading kernel Image<br />
load mmc 0:1 ${kernel_addr_r} /Image<br />
echo Booting kernel NOW<br />
booti ${kernel_addr_r} - ${fdt_addr_r}<br />
<br />
Create a <code>boot.cmd</code> file for the '''PineTab''':<br />
<br />
echo Setting bootargs<br />
setenv bootargs console=tty0 console=ttyS0,115200 root=/dev/mmcblk0p2 no_console_suspend rootwait <br />
earlycon=uart,mmio32,0x01c28000 panic=10 consoleblank=0 loglevel=1<br />
printenv<br />
echo Loading DTB<br />
load mmc 0:1 ${fdt_addr_r} /sun50i-a64-pinetab.dtb<br />
echo Loading kernel Image<br />
load mmc 0:1 ${kernel_addr_r} /Image<br />
echo Booting kernel NOW<br />
booti ${kernel_addr_r} - ${fdt_addr_r}<br />
<br />
Mount your <code>boot</code> partition and run the following command:<br />
sudo mkimage -C none -A arm -T script -d /mnt/boot.cmd /mnt/boot.scr<br />
<br />
This will translate the <code>boot.cmd</code> file into a U-boot script.<br />
<br />
If you don't have the <code>mkimage</code> command available, you can install it from the <code>uboot-tools</code> package.<br />
<br />
==Kernel==<br />
<br />
The PinePhone runs a mainline kernel, device tree modifications are done by all the PinePhone OS developers on Gitlab (https://gitlab.com/pine64-org/linux).<br />
<br />
=== Clone the kernel ===<br />
<br />
git clone https://gitlab.com/pine64-org/linux<br />
cd linux<br />
git checkout pine64-kernel<br />
<br />
=== Configure the kernel ===<br />
<br />
# <b>Copy our kernel config</b>: https://gitlab.com/pinephone-sailfish-os/linux-kernel/raw/master/pinephone-config<br />
# <b>Enter the <code>linux</code> project</b>: <code>cd linux</code><br />
# <b>Copy the config file</b> to <code>.config</code> in the main directory<br />
<br />
=== Enable WiFi out-of-tree driver ===<br />
<br />
Add the driver to the kernel:<br />
cd drivers/staging<br />
git clone https://github.com/Icenowy/rtl8723cs.git<br />
<br />
Configure the kernel build system now:<br />
<br />
# <b>Add this line to <code>drivers/staging/Kconfig</code></b>: <code>source "drivers/staging/rtl8723cs/Kconfig"</code><br />
# <b>Add this line to <code>drivers/staging/Makefile</code></b>: <code>obj-$(CONFIG_RTL8723CS) += rtl8723cs/</code><br />
# <b>Enable the driver in the kernel config:</b> <code>CONFIG_RTL8723CS=m</code><br />
<br />
See: [https://gitlab.com/postmarketOS/pmaports/blob/master/main/linux-postmarketos-allwinner/rtl8723cs.patch https://gitlab.com/postmarketOS/pmaports/blob/master/main/linux-postmarketos-allwinner/rtl8723cs.patch]<br />
<br />
=== Build the kernel ===<br />
<br />
We cross compile the kernel for ARM64.<br />
The <code>LOCALVERSION</code> variable can be used to add a version to the build.<br />
<br />
Cross compile the kernel:<br />
export ARCH=arm64<br />
export CROSS_COMPILE=aarch64-linux-gnu-<br />
export LOCALVERSION=-nemo<br />
make clean<br />
make oldconfig<br />
make -j4 Image modules dtbs<br />
<br />
Install the kernel modules in a different path: <br />
make modules_install INSTALL_MOD_PATH=../linux_modules/<br />
<br />
=== Install kernel ===<br />
<br />
Copy the following things:<br />
<br />
# <b>Image</b> from <code>arch/arm64/boot/Image</code> to the root of the <code>boot</code> partition.<br />
# <b>Device tree files</b> <br />
For pinethone <code>arch/arm64/boot/dts/allwinner/sun50i-a64-pinephone.dtb</code> and <code>arch/arm64/boot/dts/allwinner/sun50i-a64-pinephone.dts</code> to the root of the <code>boot</code> partition.<br />
<br />
For pinetab <code>arch/arm64/boot/dts/allwinner/sun50i-a64-pinetab.dtb</code> and <code>arch/arm64/boot/dts/allwinner/sun50i-a64-pinetab.dts</code> to the root of the <code>boot</code> partition.<br />
# <b>Modules</b> from <code>../linux_modules</code> to <code>/lib/modules</code> on the <code>data</code> partition.<br />
<br />
=== Wlan Module ===<br />
<br />
On PinePhone we have mainline kernel driver. But in PineTab we must use https://github.com/Icenowy/rtl8723cs driver.<br />
<br />
==Nemo Mobile==<br />
<br />
For build last release of nemo use this ks file https://gist.github.com/neochapay/8d40f9ee1e5fd621e0053aa126d39e81<br />
<br />
==Sailfish OS==<br />
<br />
===Github & OBS project===<br />
<br />
- https://github.com/sailfish-on-dontbeevil<br />
<br />
- https://build.merproject.org/project/show/nemo:devel:hw:pine:dontbeevil<br />
<br />
===Flash rootFS===<br />
You can download the latest rootFS from the Gitlab SailfishOS Porters CI: https://gitlab.com/sailfishos-porters-ci/dont_be_evil-ci (see the artifacts of the latest CI job).<br />
<br />
This <code>tar.gz</code> archive should be burned to the <code>data</code> partition of the SD card.<br />
It's important to burn it as the root user (not with sudo) to preserve extended attributes and ACLs: <br />
<br />
sudo su<br />
bsdtar -xpf <SAILFISH OS ROOTFS>.tar.bz2 -C <MOUNTPOINT OF /DATA><br />
<br />
===Device repos===<br />
To boot Lipstick, you need to add the device specific repos to the devkit.<br />
All the following commands are executed in a shell on the devkit.<br />
<br />
''Make sure you configure the ethernet interface first before you continue!''<br />
''You need to have access to the WWW to fetch the necessary repository data and packages.''<br />
<br />
Install zypper manually:<br />
curl -o augeas-lib.rpm http://repo.merproject.org/obs/mer:/core/latest_armv7hl/armv7hl/augeas-libs-1.6.0+git1-1.10.6.armv7hl.rpm<br />
curl -o zypper.rpm http://repo.merproject.org/obs/mer:/core/latest_armv7hl/armv7hl/zypper-1.14.6+git3-1.24.5.armv7hl.rpm<br />
rpm -Uvh *rpm<br />
<br />
Use <code>ssu</code> to add the repo<br />
ssu ar common http://repo.merproject.org/obs/nemo:/devel:/hw:/common/sailfish_latest_armv7hl/<br />
ssu ar dontbeevil http://repo.merproject.org/obs/home:/piggz:/dontbeevil/sailfishos_3.0.3.9_latest_armv7hl/<br />
ssu ar jolla https://releases.jolla.com/releases/3.0.3.9/jolla/armv7hl/<br />
<br />
Refresh the repo:<br />
zypper refresh<br />
<br />
Install the device packages:<br />
zypper install dontbeevil:qt5-qtcore dontbeevil:qt5-qttest dontbeevil:lipstick-qt5<br />
zypper install droid-config-dontbeevil # Select 1 for vendor change<br />
zypper install droid-config-dontbeevil-sailfish<br />
zypper install qt5-plugin-platform-eglfs # EGLFS LIMA plugin<br />
zypper install qt5-plugin-generic-evdev # evdev input plugins<br />
<br />
Other useful packages<br />
zypper install mce-tools #useful for mcetool (mcetool -U activates the screen)<br />
<br />
===Unknown password===<br />
The Sailfish OS rootFS sets a random password when booting for the first time.<br />
You can only log in through the <code>telnet</code> debug interface.<br />
Since the <code>eth0</code> interface still requires manually setup, you can't access <code>telnet</code>.<br />
<br />
To circumvent this issue, you can login through the UART TTY interface. <br />
However you don't know the password of the <code>root</code> nor <code>nemo</code> users!<br />
To disable the <code>root</code> and <code>nemo</code> passwords, we can modify the <code>/etc/shadow</code> file:<br />
<br />
sudo chmod +w <SD card data partition>/etc/shadow<br />
sudo vim <SD card data partition>/etc/shadow # Remove any characters where <HASHED PASSWORD> is written: user1:<HASHED PASSWORD>:16092:0:99999:7:::.<br />
sudo chmod -w <SD card data partition>/etc/shadow<br />
<br />
By removing the hashed password, we can login with the user without entering a password.<br />
You can set a new password afterwards by running as a logged in user:<br />
<br />
passwd<br />
<br />
===Init eth0===<br />
Enabling the <code>eth0</code> interface has to be done manually for now:<br />
<br />
ifconfig eth0 <YOUR_IP><br />
route add default gw <DEFAULT_GATEWAY_IP><br />
echo "nameserver <DNS_SERVER_IP>" > /etc/resolv.conf<br />
<br />
Test your configuration with <code>ping</code>:<br />
<br />
ping jolla.com<br />
<br />
<br />
===Lipstick crashing===<br />
<br />
Install Lipstick from the <code>dontbeevil</code> repository:<br />
<br />
zypper install dontbeevil:lipstick-qt5<br />
<br />
===No setup wizard===<br />
<br />
Make sure the configuration package is installed:<br />
<br />
zypper install droid-config-dontbeevil-sailfish<br />
<br />
===Missing regulatory.db for RT8723BS WiFi/BT module===<br />
<br />
git clone git://git.kernel.org/pub/scm/linux/kernel/git/sforshee/wireless-regdb.git<br />
cd wireless-regdb<br />
cp regulatory* /lib/firmware</div>Dylanvanasschttps://wiki.merproject.org/wiki/Adaptations/PinePhone64Adaptations/PinePhone642019-10-05T14:10:39Z<p>Dylanvanassc: /* Enable WiFi out-of-tree driver */</p>
<hr />
<div>=Hardware Support=<br />
<br />
Full information of hardware spec [https://wiki.pine64.org/index.php/Project_Don't_be_evil Here]<br />
<br />
PostMarket OS hardware information [https://wiki.postmarketos.org/wiki/Pine_Don%27t_be_evil_devkit_(pine-dontbeevil) PostMarketOS Wiki]<br />
<br />
==WiFi/BT RTL8723CS==<br />
<br />
=== WiFi ===<br />
The WiFi driver isn't available in the Linux kernel yet. However, we can compile it as an out-of-tree driver for now.<br />
See kernel building for more instruction<br />
<br />
=== Bluetooth ===<br />
The production version of the PineTab and PinePhone are both using the Realtek 8723CS WiFi/BT module.<br />
BT is natively supported after adding the necessary firmware from [https://github.com/anarsoul/rtl8723bt-firmware/tree/master/rtl_bt https://github.com/anarsoul/rtl8723bt-firmware/tree/master/rtl_bt]<br />
Download all the <code>*.bin</code> files and copy them to the <code>/lib/firmware/rtl_bt</code> directory in the rootFS.<br />
<br />
==Modem EC25==<br />
<br />
===Setup===<br />
<br />
1. Make sure that the <code>qmimodem</code> plugin is enabled in the <code>.spec</code> of <code>ofono</code>.<br />
<br />
2. Remove the <code>noplugin.conf</code> file under <code>/lib/environment/ofono/noplugin.conf</code>.<br />
<br />
3. Restart <code>ofono</code><br />
systemctl restart ofono<br />
<br />
4. Check if the QMI modem is properly detected:<br />
/usr/lib/ofono/test/list-modems<br />
<br />
5. Unlock you SIM card (if needed):<br />
/usr/lib/ofono/test/enter-pin /quectelqmi_0 pin <PIN CODE><br />
<br />
The EC25 Quectel modem is now ready :)<br />
Thanks to SuperPrower for the hard work!<br />
<br />
===Sending SMS===<br />
<br />
/usr/lib/ofono/test/send-sms <PHONE NUMBER RECEIVER> <MESSAGE> <DELIVERY REPORT><br />
<br />
To skip the delivery report, use <code>0</code> as argument.<br />
<br />
==Cameras==<br />
<br />
Thanks to: https://wiki.postmarketos.org/wiki/Pine_Don't_be_evil_devkit_(pine-dontbeevil)#Cameras<br />
Only the back camera is supported by the mainline kernel.<br />
To use it, you need to configure it first:<br />
<br />
media-ctl --set-v4l2 '"ov5640 2-003c":0[fmt:UYVY8_2X8/1280x7200]' -d /dev/media1<br />
<br />
Afterwards, you can take a picture with:<br />
<br />
ffmpeg -s 1280x720 -f video4linux2 -i /dev/video1 -vframes 1 selfie.jpg<br />
<br />
- <code>/dev/media1</code> is the controller interface of the back camera<br />
<br />
- <code>/dev/video1</code> is the back camera stream interface<br />
<br />
If that works, you can try <code>gstreamer</code> to make the camera available for system wide usage:]<br />
<br />
gst-launch-1.0 v4l2src device=/dev/video1 num-buffers=1 ! 'video/x-raw,format=UYVY,width=1280,height=720' ! jpegenc ! filesink location=selfie.jpg<br />
cp selfie.jpg /home/nemo/Pictures<br />
<br />
This command generates a <code>selfie.jpg</code> file and by copying it to <code>/home/nemo/Pictures</code> you can view it with the Gallery app.<br />
<br />
== Audio ==<br />
<br />
1. Unmuting the <code>AIF1 Slot 0 Digital DAC</code> channel using <code>alsamixer</code>. Use <code>m</code> to unmute.<br />
<br />
2. Copy the default PulseAudio config: <br />
cp /etc/pulse/default.pa /etc/pulse/arm_native_config.pa<br />
<br />
3. Enable ALSA modules in the new config:<br />
load-module module-alsa-sink<br />
load-module module-alsa-source device=hw:1,0<br />
They are commented out by default.<br />
<br />
4. Configure PulseAudio by changing <code>arm_droid_config.pa</code> to <code>/arm_native_config.pa</code> in <code>/etc/sysconfig/pulseaudio</code>.<br />
<br />
5. Restart PulseAudio or reboot.<br />
<br />
6. Go to the Settings app and test the sound output by playing a ringtone under Sounds and Feedback.<br />
<br />
==PineTab==<br />
<br />
In pinetab we have jack to uart port cable. For enable UART console move selector nearby sd-card slot away from sd-card slot.<br />
<br />
==Testing the vibrator motor==<br />
<br />
You need to have the <code>CONFIG_GPIO_SYSFS</code> enabled in your kernel config for this!<br />
<br />
Vibrator motor is on pin <code>PD2</code>.<br />
You can calculate the PIN number for PD2 as followed ([https://linux-sunxi.org/GPIO more information]):<br />
<code>(4-1) * 32 + 2 = 98</code><br />
<br />
echo "98" > /sys/class/gpio/export # Make pin available<br />
echo "out" > /sys/class/gpio/gpio98/direction # Set as output<br />
echo "1" > /sys/class/gpio/gpio98/value # On<br />
echo "1" > /sys/class/gpio/gpio98/value # Off<br />
echo "98" > /sys/class/gpio/unexport # When you're done<br />
<br />
==Notification LED==<br />
<br />
export COLOR=red # or green, blue is broken due to a hardware fault<br />
# Activate LED<br />
echo 1 > /sys/class/leds/$COLOR/brightness<br />
# Deactivate LED<br />
echo 0 > /sys/class/leds/$COLOR/brightness<br />
<br />
The LED can be controlled in Mer by MCE. You need the <code>mce-plugin-libhybris-nondroid</code> for this.<br />
<br />
=Installation=<br />
==Prepare SD card==<br />
<br />
Use GParted or any other tool to create the following <code>EXT4</code> partitions:<br />
<br />
# <b>boot</b>: Holds the mainline kernel Image and Device Tree files<br />
# <b>data</b>: Holds the Sailfish OS rootFS<br />
<br />
GParted will ask you to leave the first MB free of the SD card when creating the first partition, this is correct.<br />
This 1 MB will be used to store the U-boot boot loader.<br />
<br />
==U-Boot==<br />
<br />
We will now build the mainline U-boot boot loader from Git.<br />
<br />
=== Clone ARM Trusted Firmware (master branch) ===<br />
<br />
git clone https://github.com/ARM-software/arm-trusted-firmware.git<br />
<br />
=== Build the BL31.bin ===<br />
<br />
Follow the instructions here: https://github.com/u-boot/u-boot/blob/master/board/sunxi/README.sunxi64<br />
<br />
Quick start:<br />
<br />
export CROSS_COMPILE=aarch64-linux-gnu-<br />
ARCH=arm64 make PLAT=sun50i_a64 DEBUG=1 bl31<br />
export BL31=/path/to/bl31.bin<br />
<br />
=== Clone U-boot (master branch): ===<br />
<br />
You can find the U-boot mirror repository on Github:<br />
<br />
git clone https://github.com/u-boot/u-boot.git<br />
<br />
=== Compile U-boot ===<br />
<br />
You have to cross compile U-boot with the <code>arm64</code> arch:<br />
<br />
export CROSS_COMPILE=aarch64-linux-gnu-<br />
ARCH=arm64 make clean<br />
ARCH=arm64 make sopine_baseboard_defconfig<br />
ARCH=arm64 make<br />
<br />
The <code>sopine_baseboard_defconfig</code> is the same for the Don't Be Evil devkit.<br />
<br />
=== Burn U-boot to your SD card ===<br />
<br />
Copy the compiled U-boot bootloader to the first sector on your SD card:<br />
<br />
sudo dd if=u-boot-sunxi-with-spl.bin of=/dev/sdX bs=8k seek=1<br />
<br />
<br />
=== Manually loading the kernel ===<br />
<br />
Serial TTY Baudrate over UART = 115200 for screen, example: <code>screen /dev/ttyUSB0 115200</code><br />
You have to start screen first, before turning on the devkit.<br />
<br />
Interrupt the U-boot autoboot process when you see a message in the U-boot prompt. <br />
We need to access the U-boot prompt to load the Kernel image and boot it manually!<br />
<br />
Set bootargs:<br />
<br />
setenv bootargs root=/dev/mmcblk0p2 rootwait panic=10<br />
<br />
Kernel Image loading and Device Tree files:<br />
<br />
ext4load mmc 0:1 ${kernel_addr_r} /Image <br />
ext4load mmc 0:1 ${fdt_addr_r} /sun50i-a64-pinephone.dtb <br />
<br />
Boot the kernel:<br />
<br />
booti ${kernel_addr_r} - ${fdt_addr_r}<br />
<br />
=== Automatic boot ===<br />
<br />
Create a <code>boot.cmd</code> file for the '''PinePhone''':<br />
<br />
echo Setting bootargs<br />
setenv bootargs console=tty0 console=ttyS0,115200 root=/dev/mmcblk0p2 no_console_suspend rootwait <br />
earlycon=uart,mmio32,0x01c28000 panic=10 consoleblank=0 loglevel=1<br />
printenv<br />
echo Loading DTB<br />
load mmc 0:1 ${fdt_addr_r} /sun50i-a64-pinephone.dtb<br />
echo Loading kernel Image<br />
load mmc 0:1 ${kernel_addr_r} /Image<br />
echo Booting kernel NOW<br />
booti ${kernel_addr_r} - ${fdt_addr_r}<br />
<br />
Create a <code>boot.cmd</code> file for the '''PineTab''':<br />
<br />
echo Setting bootargs<br />
setenv bootargs console=tty0 console=ttyS0,115200 root=/dev/mmcblk0p2 no_console_suspend rootwait <br />
earlycon=uart,mmio32,0x01c28000 panic=10 consoleblank=0 loglevel=1<br />
printenv<br />
echo Loading DTB<br />
load mmc 0:1 ${fdt_addr_r} /sun50i-a64-pinetab.dtb<br />
echo Loading kernel Image<br />
load mmc 0:1 ${kernel_addr_r} /Image<br />
echo Booting kernel NOW<br />
booti ${kernel_addr_r} - ${fdt_addr_r}<br />
<br />
Mount your <code>boot</code> partition and run the following command:<br />
sudo mkimage -C none -A arm -T script -d /mnt/boot.cmd /mnt/boot.scr<br />
<br />
This will translate the <code>boot.cmd</code> file into a U-boot script.<br />
<br />
If you don't have the <code>mkimage</code> command available, you can install it from the <code>uboot-tools</code> package.<br />
<br />
==Kernel==<br />
<br />
The PinePhone runs a mainline kernel, device tree modifications are done by all the PinePhone OS developers on Gitlab (https://gitlab.com/pine64-org/linux).<br />
<br />
=== Clone the kernel ===<br />
<br />
git clone https://gitlab.com/pine64-org/linux<br />
cd linux<br />
git checkout pine64-kernel<br />
<br />
=== Configure the kernel ===<br />
<br />
# <b>Copy our kernel config</b>: https://gitlab.com/pinephone-sailfish-os/linux-kernel/raw/master/pinephone-config<br />
# <b>Enter the <code>linux</code> project</b>: <code>cd linux</code><br />
# <b>Copy the config file</b> to <code>.config</code> in the main directory<br />
<br />
=== Enable WiFi out-of-tree driver ===<br />
<br />
Add the driver to the kernel:<br />
cd drivers/staging<br />
git clone https://github.com/Icenowy/rtl8723cs.git<br />
<br />
Configure the kernel build system now:<br />
<br />
# <b>Add this line to <code>drivers/staging/Kconfig</code></b>: <code>source "drivers/staging/rtl8723cs/Kconfig"</code><br />
# <b>Add this line to <code>drivers/staging/Makefile</code></b>: <code>obj-$(CONFIG_RTL8723CS) += rtl8723cs/</code><br />
# <b>Enable the driver in the kernel config:</b> <code>CONFIG_RTL8723CS=m</code><br />
<br />
See: [https://gitlab.com/postmarketOS/pmaports/blob/master/main/linux-postmarketos-allwinner/rtl8723cs.patch https://gitlab.com/postmarketOS/pmaports/blob/master/main/linux-postmarketos-allwinner/rtl8723cs.patch]<br />
<br />
=== Build the kernel ===<br />
<br />
We cross compile the kernel for ARM64.<br />
The <code>LOCALVERSION</code> variable can be used to add a version to the build.<br />
<br />
Cross compile the kernel:<br />
export ARCH=arm64<br />
export CROSS_COMPILE=aarch64-linux-gnu-<br />
export LOCALVERSION=-nemo<br />
make clean<br />
make oldconfig<br />
make -j4 Image modules dtbs<br />
<br />
Install the kernel modules in a different path: <br />
make modules_install INSTALL_MOD_PATH=../linux_modules/<br />
<br />
=== Install kernel ===<br />
<br />
Copy the following things:<br />
<br />
# <b>Image</b> from <code>arch/arm64/boot/Image</code> to the root of the <code>boot</code> partition.<br />
# <b>Device tree files</b> <br />
For pinethone <code>arch/arm64/boot/dts/allwinner/sun50i-a64-pinephone.dtb</code> and <code>arch/arm64/boot/dts/allwinner/sun50i-a64-pinephone.dts</code> to the root of the <code>boot</code> partition.<br />
<br />
For pinetab <code>arch/arm64/boot/dts/allwinner/sun50i-a64-pinetab.dtb</code> and <code>arch/arm64/boot/dts/allwinner/sun50i-a64-pinetab.dts</code> to the root of the <code>boot</code> partition.<br />
# <b>Modules</b> from <code>../linux_modules</code> to <code>/lib/modules</code> on the <code>boot</code> partition.<br />
<br />
=== Wlan Module ===<br />
<br />
On PinePhone we have mainline kernel driver. But in PineTab we must use https://github.com/Icenowy/rtl8723cs driver.<br />
<br />
==Nemo Mobile==<br />
<br />
For build last release of nemo use this ks file https://gist.github.com/neochapay/8d40f9ee1e5fd621e0053aa126d39e81<br />
<br />
==Sailfish OS==<br />
<br />
===Github & OBS project===<br />
<br />
- https://github.com/sailfish-on-dontbeevil<br />
<br />
- https://build.merproject.org/project/show/nemo:devel:hw:pine:dontbeevil<br />
<br />
===Flash rootFS===<br />
You can download the latest rootFS from the Gitlab SailfishOS Porters CI: https://gitlab.com/sailfishos-porters-ci/dont_be_evil-ci (see the artifacts of the latest CI job).<br />
<br />
This <code>tar.gz</code> archive should be burned to the <code>data</code> partition of the SD card.<br />
It's important to burn it as the root user (not with sudo) to preserve extended attributes and ACLs: <br />
<br />
sudo su<br />
bsdtar -xpf <SAILFISH OS ROOTFS>.tar.bz2 -C <MOUNTPOINT OF /DATA><br />
<br />
===Device repos===<br />
To boot Lipstick, you need to add the device specific repos to the devkit.<br />
All the following commands are executed in a shell on the devkit.<br />
<br />
''Make sure you configure the ethernet interface first before you continue!''<br />
''You need to have access to the WWW to fetch the necessary repository data and packages.''<br />
<br />
Install zypper manually:<br />
curl -o augeas-lib.rpm http://repo.merproject.org/obs/mer:/core/latest_armv7hl/armv7hl/augeas-libs-1.6.0+git1-1.10.6.armv7hl.rpm<br />
curl -o zypper.rpm http://repo.merproject.org/obs/mer:/core/latest_armv7hl/armv7hl/zypper-1.14.6+git3-1.24.5.armv7hl.rpm<br />
rpm -Uvh *rpm<br />
<br />
Use <code>ssu</code> to add the repo<br />
ssu ar common http://repo.merproject.org/obs/nemo:/devel:/hw:/common/sailfish_latest_armv7hl/<br />
ssu ar dontbeevil http://repo.merproject.org/obs/home:/piggz:/dontbeevil/sailfishos_3.0.3.9_latest_armv7hl/<br />
ssu ar jolla https://releases.jolla.com/releases/3.0.3.9/jolla/armv7hl/<br />
<br />
Refresh the repo:<br />
zypper refresh<br />
<br />
Install the device packages:<br />
zypper install dontbeevil:qt5-qtcore dontbeevil:qt5-qttest dontbeevil:lipstick-qt5<br />
zypper install droid-config-dontbeevil # Select 1 for vendor change<br />
zypper install droid-config-dontbeevil-sailfish<br />
zypper install qt5-plugin-platform-eglfs # EGLFS LIMA plugin<br />
zypper install qt5-plugin-generic-evdev # evdev input plugins<br />
<br />
Other useful packages<br />
zypper install mce-tools #useful for mcetool (mcetool -U activates the screen)<br />
<br />
===Unknown password===<br />
The Sailfish OS rootFS sets a random password when booting for the first time.<br />
You can only log in through the <code>telnet</code> debug interface.<br />
Since the <code>eth0</code> interface still requires manually setup, you can't access <code>telnet</code>.<br />
<br />
To circumvent this issue, you can login through the UART TTY interface. <br />
However you don't know the password of the <code>root</code> nor <code>nemo</code> users!<br />
To disable the <code>root</code> and <code>nemo</code> passwords, we can modify the <code>/etc/shadow</code> file:<br />
<br />
sudo chmod +w <SD card data partition>/etc/shadow<br />
sudo vim <SD card data partition>/etc/shadow # Remove any characters where <HASHED PASSWORD> is written: user1:<HASHED PASSWORD>:16092:0:99999:7:::.<br />
sudo chmod -w <SD card data partition>/etc/shadow<br />
<br />
By removing the hashed password, we can login with the user without entering a password.<br />
You can set a new password afterwards by running as a logged in user:<br />
<br />
passwd<br />
<br />
===Init eth0===<br />
Enabling the <code>eth0</code> interface has to be done manually for now:<br />
<br />
ifconfig eth0 <YOUR_IP><br />
route add default gw <DEFAULT_GATEWAY_IP><br />
echo "nameserver <DNS_SERVER_IP>" > /etc/resolv.conf<br />
<br />
Test your configuration with <code>ping</code>:<br />
<br />
ping jolla.com<br />
<br />
<br />
===Lipstick crashing===<br />
<br />
Install Lipstick from the <code>dontbeevil</code> repository:<br />
<br />
zypper install dontbeevil:lipstick-qt5<br />
<br />
===No setup wizard===<br />
<br />
Make sure the configuration package is installed:<br />
<br />
zypper install droid-config-dontbeevil-sailfish<br />
<br />
===Missing regulatory.db for RT8723BS WiFi/BT module===<br />
<br />
git clone git://git.kernel.org/pub/scm/linux/kernel/git/sforshee/wireless-regdb.git<br />
cd wireless-regdb<br />
cp regulatory* /lib/firmware</div>Dylanvanasschttps://wiki.merproject.org/wiki/Adaptations/PinePhone64Adaptations/PinePhone642019-10-05T14:09:59Z<p>Dylanvanassc: /* Build the kernel */</p>
<hr />
<div>=Hardware Support=<br />
<br />
Full information of hardware spec [https://wiki.pine64.org/index.php/Project_Don't_be_evil Here]<br />
<br />
PostMarket OS hardware information [https://wiki.postmarketos.org/wiki/Pine_Don%27t_be_evil_devkit_(pine-dontbeevil) PostMarketOS Wiki]<br />
<br />
==WiFi/BT RTL8723CS==<br />
<br />
=== WiFi ===<br />
The WiFi driver isn't available in the Linux kernel yet. However, we can compile it as an out-of-tree driver for now.<br />
See kernel building for more instruction<br />
<br />
=== Bluetooth ===<br />
The production version of the PineTab and PinePhone are both using the Realtek 8723CS WiFi/BT module.<br />
BT is natively supported after adding the necessary firmware from [https://github.com/anarsoul/rtl8723bt-firmware/tree/master/rtl_bt https://github.com/anarsoul/rtl8723bt-firmware/tree/master/rtl_bt]<br />
Download all the <code>*.bin</code> files and copy them to the <code>/lib/firmware/rtl_bt</code> directory in the rootFS.<br />
<br />
==Modem EC25==<br />
<br />
===Setup===<br />
<br />
1. Make sure that the <code>qmimodem</code> plugin is enabled in the <code>.spec</code> of <code>ofono</code>.<br />
<br />
2. Remove the <code>noplugin.conf</code> file under <code>/lib/environment/ofono/noplugin.conf</code>.<br />
<br />
3. Restart <code>ofono</code><br />
systemctl restart ofono<br />
<br />
4. Check if the QMI modem is properly detected:<br />
/usr/lib/ofono/test/list-modems<br />
<br />
5. Unlock you SIM card (if needed):<br />
/usr/lib/ofono/test/enter-pin /quectelqmi_0 pin <PIN CODE><br />
<br />
The EC25 Quectel modem is now ready :)<br />
Thanks to SuperPrower for the hard work!<br />
<br />
===Sending SMS===<br />
<br />
/usr/lib/ofono/test/send-sms <PHONE NUMBER RECEIVER> <MESSAGE> <DELIVERY REPORT><br />
<br />
To skip the delivery report, use <code>0</code> as argument.<br />
<br />
==Cameras==<br />
<br />
Thanks to: https://wiki.postmarketos.org/wiki/Pine_Don't_be_evil_devkit_(pine-dontbeevil)#Cameras<br />
Only the back camera is supported by the mainline kernel.<br />
To use it, you need to configure it first:<br />
<br />
media-ctl --set-v4l2 '"ov5640 2-003c":0[fmt:UYVY8_2X8/1280x7200]' -d /dev/media1<br />
<br />
Afterwards, you can take a picture with:<br />
<br />
ffmpeg -s 1280x720 -f video4linux2 -i /dev/video1 -vframes 1 selfie.jpg<br />
<br />
- <code>/dev/media1</code> is the controller interface of the back camera<br />
<br />
- <code>/dev/video1</code> is the back camera stream interface<br />
<br />
If that works, you can try <code>gstreamer</code> to make the camera available for system wide usage:]<br />
<br />
gst-launch-1.0 v4l2src device=/dev/video1 num-buffers=1 ! 'video/x-raw,format=UYVY,width=1280,height=720' ! jpegenc ! filesink location=selfie.jpg<br />
cp selfie.jpg /home/nemo/Pictures<br />
<br />
This command generates a <code>selfie.jpg</code> file and by copying it to <code>/home/nemo/Pictures</code> you can view it with the Gallery app.<br />
<br />
== Audio ==<br />
<br />
1. Unmuting the <code>AIF1 Slot 0 Digital DAC</code> channel using <code>alsamixer</code>. Use <code>m</code> to unmute.<br />
<br />
2. Copy the default PulseAudio config: <br />
cp /etc/pulse/default.pa /etc/pulse/arm_native_config.pa<br />
<br />
3. Enable ALSA modules in the new config:<br />
load-module module-alsa-sink<br />
load-module module-alsa-source device=hw:1,0<br />
They are commented out by default.<br />
<br />
4. Configure PulseAudio by changing <code>arm_droid_config.pa</code> to <code>/arm_native_config.pa</code> in <code>/etc/sysconfig/pulseaudio</code>.<br />
<br />
5. Restart PulseAudio or reboot.<br />
<br />
6. Go to the Settings app and test the sound output by playing a ringtone under Sounds and Feedback.<br />
<br />
==PineTab==<br />
<br />
In pinetab we have jack to uart port cable. For enable UART console move selector nearby sd-card slot away from sd-card slot.<br />
<br />
==Testing the vibrator motor==<br />
<br />
You need to have the <code>CONFIG_GPIO_SYSFS</code> enabled in your kernel config for this!<br />
<br />
Vibrator motor is on pin <code>PD2</code>.<br />
You can calculate the PIN number for PD2 as followed ([https://linux-sunxi.org/GPIO more information]):<br />
<code>(4-1) * 32 + 2 = 98</code><br />
<br />
echo "98" > /sys/class/gpio/export # Make pin available<br />
echo "out" > /sys/class/gpio/gpio98/direction # Set as output<br />
echo "1" > /sys/class/gpio/gpio98/value # On<br />
echo "1" > /sys/class/gpio/gpio98/value # Off<br />
echo "98" > /sys/class/gpio/unexport # When you're done<br />
<br />
==Notification LED==<br />
<br />
export COLOR=red # or green, blue is broken due to a hardware fault<br />
# Activate LED<br />
echo 1 > /sys/class/leds/$COLOR/brightness<br />
# Deactivate LED<br />
echo 0 > /sys/class/leds/$COLOR/brightness<br />
<br />
The LED can be controlled in Mer by MCE. You need the <code>mce-plugin-libhybris-nondroid</code> for this.<br />
<br />
=Installation=<br />
==Prepare SD card==<br />
<br />
Use GParted or any other tool to create the following <code>EXT4</code> partitions:<br />
<br />
# <b>boot</b>: Holds the mainline kernel Image and Device Tree files<br />
# <b>data</b>: Holds the Sailfish OS rootFS<br />
<br />
GParted will ask you to leave the first MB free of the SD card when creating the first partition, this is correct.<br />
This 1 MB will be used to store the U-boot boot loader.<br />
<br />
==U-Boot==<br />
<br />
We will now build the mainline U-boot boot loader from Git.<br />
<br />
=== Clone ARM Trusted Firmware (master branch) ===<br />
<br />
git clone https://github.com/ARM-software/arm-trusted-firmware.git<br />
<br />
=== Build the BL31.bin ===<br />
<br />
Follow the instructions here: https://github.com/u-boot/u-boot/blob/master/board/sunxi/README.sunxi64<br />
<br />
Quick start:<br />
<br />
export CROSS_COMPILE=aarch64-linux-gnu-<br />
ARCH=arm64 make PLAT=sun50i_a64 DEBUG=1 bl31<br />
export BL31=/path/to/bl31.bin<br />
<br />
=== Clone U-boot (master branch): ===<br />
<br />
You can find the U-boot mirror repository on Github:<br />
<br />
git clone https://github.com/u-boot/u-boot.git<br />
<br />
=== Compile U-boot ===<br />
<br />
You have to cross compile U-boot with the <code>arm64</code> arch:<br />
<br />
export CROSS_COMPILE=aarch64-linux-gnu-<br />
ARCH=arm64 make clean<br />
ARCH=arm64 make sopine_baseboard_defconfig<br />
ARCH=arm64 make<br />
<br />
The <code>sopine_baseboard_defconfig</code> is the same for the Don't Be Evil devkit.<br />
<br />
=== Burn U-boot to your SD card ===<br />
<br />
Copy the compiled U-boot bootloader to the first sector on your SD card:<br />
<br />
sudo dd if=u-boot-sunxi-with-spl.bin of=/dev/sdX bs=8k seek=1<br />
<br />
<br />
=== Manually loading the kernel ===<br />
<br />
Serial TTY Baudrate over UART = 115200 for screen, example: <code>screen /dev/ttyUSB0 115200</code><br />
You have to start screen first, before turning on the devkit.<br />
<br />
Interrupt the U-boot autoboot process when you see a message in the U-boot prompt. <br />
We need to access the U-boot prompt to load the Kernel image and boot it manually!<br />
<br />
Set bootargs:<br />
<br />
setenv bootargs root=/dev/mmcblk0p2 rootwait panic=10<br />
<br />
Kernel Image loading and Device Tree files:<br />
<br />
ext4load mmc 0:1 ${kernel_addr_r} /Image <br />
ext4load mmc 0:1 ${fdt_addr_r} /sun50i-a64-pinephone.dtb <br />
<br />
Boot the kernel:<br />
<br />
booti ${kernel_addr_r} - ${fdt_addr_r}<br />
<br />
=== Automatic boot ===<br />
<br />
Create a <code>boot.cmd</code> file for the '''PinePhone''':<br />
<br />
echo Setting bootargs<br />
setenv bootargs console=tty0 console=ttyS0,115200 root=/dev/mmcblk0p2 no_console_suspend rootwait <br />
earlycon=uart,mmio32,0x01c28000 panic=10 consoleblank=0 loglevel=1<br />
printenv<br />
echo Loading DTB<br />
load mmc 0:1 ${fdt_addr_r} /sun50i-a64-pinephone.dtb<br />
echo Loading kernel Image<br />
load mmc 0:1 ${kernel_addr_r} /Image<br />
echo Booting kernel NOW<br />
booti ${kernel_addr_r} - ${fdt_addr_r}<br />
<br />
Create a <code>boot.cmd</code> file for the '''PineTab''':<br />
<br />
echo Setting bootargs<br />
setenv bootargs console=tty0 console=ttyS0,115200 root=/dev/mmcblk0p2 no_console_suspend rootwait <br />
earlycon=uart,mmio32,0x01c28000 panic=10 consoleblank=0 loglevel=1<br />
printenv<br />
echo Loading DTB<br />
load mmc 0:1 ${fdt_addr_r} /sun50i-a64-pinetab.dtb<br />
echo Loading kernel Image<br />
load mmc 0:1 ${kernel_addr_r} /Image<br />
echo Booting kernel NOW<br />
booti ${kernel_addr_r} - ${fdt_addr_r}<br />
<br />
Mount your <code>boot</code> partition and run the following command:<br />
sudo mkimage -C none -A arm -T script -d /mnt/boot.cmd /mnt/boot.scr<br />
<br />
This will translate the <code>boot.cmd</code> file into a U-boot script.<br />
<br />
If you don't have the <code>mkimage</code> command available, you can install it from the <code>uboot-tools</code> package.<br />
<br />
==Kernel==<br />
<br />
The PinePhone runs a mainline kernel, device tree modifications are done by all the PinePhone OS developers on Gitlab (https://gitlab.com/pine64-org/linux).<br />
<br />
=== Clone the kernel ===<br />
<br />
git clone https://gitlab.com/pine64-org/linux<br />
cd linux<br />
git checkout pine64-kernel<br />
<br />
=== Configure the kernel ===<br />
<br />
# <b>Copy our kernel config</b>: https://gitlab.com/pinephone-sailfish-os/linux-kernel/raw/master/pinephone-config<br />
# <b>Enter the <code>linux</code> project</b>: <code>cd linux</code><br />
# <b>Copy the config file</b> to <code>.config</code> in the main directory<br />
<br />
=== Enable WiFi out-of-tree driver ===<br />
<br />
Add the driver to the kernel:<br />
cd drivers/staging<br />
git clone https://github.com/Icenowy/rtl8723cs.git<br />
<br />
Configure the kernel build system now:<br />
<br />
# <b>Add this line to <code>drivers/staging/Kconfig</code></b>: <code>source "drivers/staging/rtl8723cs/Kconfig"</code><br />
# <b>Add this line to <code>drivers/staging/Makefile</code></b>: <code>obj-$(CONFIG_RTL8723CS) += rtl8723cs/</code><br />
<br />
See: [https://gitlab.com/postmarketOS/pmaports/blob/master/main/linux-postmarketos-allwinner/rtl8723cs.patch https://gitlab.com/postmarketOS/pmaports/blob/master/main/linux-postmarketos-allwinner/rtl8723cs.patch]<br />
<br />
=== Build the kernel ===<br />
<br />
We cross compile the kernel for ARM64.<br />
The <code>LOCALVERSION</code> variable can be used to add a version to the build.<br />
<br />
Cross compile the kernel:<br />
export ARCH=arm64<br />
export CROSS_COMPILE=aarch64-linux-gnu-<br />
export LOCALVERSION=-nemo<br />
make clean<br />
make oldconfig<br />
make -j4 Image modules dtbs<br />
<br />
Install the kernel modules in a different path: <br />
make modules_install INSTALL_MOD_PATH=../linux_modules/<br />
<br />
=== Install kernel ===<br />
<br />
Copy the following things:<br />
<br />
# <b>Image</b> from <code>arch/arm64/boot/Image</code> to the root of the <code>boot</code> partition.<br />
# <b>Device tree files</b> <br />
For pinethone <code>arch/arm64/boot/dts/allwinner/sun50i-a64-pinephone.dtb</code> and <code>arch/arm64/boot/dts/allwinner/sun50i-a64-pinephone.dts</code> to the root of the <code>boot</code> partition.<br />
<br />
For pinetab <code>arch/arm64/boot/dts/allwinner/sun50i-a64-pinetab.dtb</code> and <code>arch/arm64/boot/dts/allwinner/sun50i-a64-pinetab.dts</code> to the root of the <code>boot</code> partition.<br />
# <b>Modules</b> from <code>../linux_modules</code> to <code>/lib/modules</code> on the <code>boot</code> partition.<br />
<br />
=== Wlan Module ===<br />
<br />
On PinePhone we have mainline kernel driver. But in PineTab we must use https://github.com/Icenowy/rtl8723cs driver.<br />
<br />
==Nemo Mobile==<br />
<br />
For build last release of nemo use this ks file https://gist.github.com/neochapay/8d40f9ee1e5fd621e0053aa126d39e81<br />
<br />
==Sailfish OS==<br />
<br />
===Github & OBS project===<br />
<br />
- https://github.com/sailfish-on-dontbeevil<br />
<br />
- https://build.merproject.org/project/show/nemo:devel:hw:pine:dontbeevil<br />
<br />
===Flash rootFS===<br />
You can download the latest rootFS from the Gitlab SailfishOS Porters CI: https://gitlab.com/sailfishos-porters-ci/dont_be_evil-ci (see the artifacts of the latest CI job).<br />
<br />
This <code>tar.gz</code> archive should be burned to the <code>data</code> partition of the SD card.<br />
It's important to burn it as the root user (not with sudo) to preserve extended attributes and ACLs: <br />
<br />
sudo su<br />
bsdtar -xpf <SAILFISH OS ROOTFS>.tar.bz2 -C <MOUNTPOINT OF /DATA><br />
<br />
===Device repos===<br />
To boot Lipstick, you need to add the device specific repos to the devkit.<br />
All the following commands are executed in a shell on the devkit.<br />
<br />
''Make sure you configure the ethernet interface first before you continue!''<br />
''You need to have access to the WWW to fetch the necessary repository data and packages.''<br />
<br />
Install zypper manually:<br />
curl -o augeas-lib.rpm http://repo.merproject.org/obs/mer:/core/latest_armv7hl/armv7hl/augeas-libs-1.6.0+git1-1.10.6.armv7hl.rpm<br />
curl -o zypper.rpm http://repo.merproject.org/obs/mer:/core/latest_armv7hl/armv7hl/zypper-1.14.6+git3-1.24.5.armv7hl.rpm<br />
rpm -Uvh *rpm<br />
<br />
Use <code>ssu</code> to add the repo<br />
ssu ar common http://repo.merproject.org/obs/nemo:/devel:/hw:/common/sailfish_latest_armv7hl/<br />
ssu ar dontbeevil http://repo.merproject.org/obs/home:/piggz:/dontbeevil/sailfishos_3.0.3.9_latest_armv7hl/<br />
ssu ar jolla https://releases.jolla.com/releases/3.0.3.9/jolla/armv7hl/<br />
<br />
Refresh the repo:<br />
zypper refresh<br />
<br />
Install the device packages:<br />
zypper install dontbeevil:qt5-qtcore dontbeevil:qt5-qttest dontbeevil:lipstick-qt5<br />
zypper install droid-config-dontbeevil # Select 1 for vendor change<br />
zypper install droid-config-dontbeevil-sailfish<br />
zypper install qt5-plugin-platform-eglfs # EGLFS LIMA plugin<br />
zypper install qt5-plugin-generic-evdev # evdev input plugins<br />
<br />
Other useful packages<br />
zypper install mce-tools #useful for mcetool (mcetool -U activates the screen)<br />
<br />
===Unknown password===<br />
The Sailfish OS rootFS sets a random password when booting for the first time.<br />
You can only log in through the <code>telnet</code> debug interface.<br />
Since the <code>eth0</code> interface still requires manually setup, you can't access <code>telnet</code>.<br />
<br />
To circumvent this issue, you can login through the UART TTY interface. <br />
However you don't know the password of the <code>root</code> nor <code>nemo</code> users!<br />
To disable the <code>root</code> and <code>nemo</code> passwords, we can modify the <code>/etc/shadow</code> file:<br />
<br />
sudo chmod +w <SD card data partition>/etc/shadow<br />
sudo vim <SD card data partition>/etc/shadow # Remove any characters where <HASHED PASSWORD> is written: user1:<HASHED PASSWORD>:16092:0:99999:7:::.<br />
sudo chmod -w <SD card data partition>/etc/shadow<br />
<br />
By removing the hashed password, we can login with the user without entering a password.<br />
You can set a new password afterwards by running as a logged in user:<br />
<br />
passwd<br />
<br />
===Init eth0===<br />
Enabling the <code>eth0</code> interface has to be done manually for now:<br />
<br />
ifconfig eth0 <YOUR_IP><br />
route add default gw <DEFAULT_GATEWAY_IP><br />
echo "nameserver <DNS_SERVER_IP>" > /etc/resolv.conf<br />
<br />
Test your configuration with <code>ping</code>:<br />
<br />
ping jolla.com<br />
<br />
<br />
===Lipstick crashing===<br />
<br />
Install Lipstick from the <code>dontbeevil</code> repository:<br />
<br />
zypper install dontbeevil:lipstick-qt5<br />
<br />
===No setup wizard===<br />
<br />
Make sure the configuration package is installed:<br />
<br />
zypper install droid-config-dontbeevil-sailfish<br />
<br />
===Missing regulatory.db for RT8723BS WiFi/BT module===<br />
<br />
git clone git://git.kernel.org/pub/scm/linux/kernel/git/sforshee/wireless-regdb.git<br />
cd wireless-regdb<br />
cp regulatory* /lib/firmware</div>Dylanvanasschttps://wiki.merproject.org/wiki/Adaptations/PinePhone64Adaptations/PinePhone642019-10-05T14:08:13Z<p>Dylanvanassc: /* Kernel */</p>
<hr />
<div>=Hardware Support=<br />
<br />
Full information of hardware spec [https://wiki.pine64.org/index.php/Project_Don't_be_evil Here]<br />
<br />
PostMarket OS hardware information [https://wiki.postmarketos.org/wiki/Pine_Don%27t_be_evil_devkit_(pine-dontbeevil) PostMarketOS Wiki]<br />
<br />
==WiFi/BT RTL8723CS==<br />
<br />
=== WiFi ===<br />
The WiFi driver isn't available in the Linux kernel yet. However, we can compile it as an out-of-tree driver for now.<br />
See kernel building for more instruction<br />
<br />
=== Bluetooth ===<br />
The production version of the PineTab and PinePhone are both using the Realtek 8723CS WiFi/BT module.<br />
BT is natively supported after adding the necessary firmware from [https://github.com/anarsoul/rtl8723bt-firmware/tree/master/rtl_bt https://github.com/anarsoul/rtl8723bt-firmware/tree/master/rtl_bt]<br />
Download all the <code>*.bin</code> files and copy them to the <code>/lib/firmware/rtl_bt</code> directory in the rootFS.<br />
<br />
==Modem EC25==<br />
<br />
===Setup===<br />
<br />
1. Make sure that the <code>qmimodem</code> plugin is enabled in the <code>.spec</code> of <code>ofono</code>.<br />
<br />
2. Remove the <code>noplugin.conf</code> file under <code>/lib/environment/ofono/noplugin.conf</code>.<br />
<br />
3. Restart <code>ofono</code><br />
systemctl restart ofono<br />
<br />
4. Check if the QMI modem is properly detected:<br />
/usr/lib/ofono/test/list-modems<br />
<br />
5. Unlock you SIM card (if needed):<br />
/usr/lib/ofono/test/enter-pin /quectelqmi_0 pin <PIN CODE><br />
<br />
The EC25 Quectel modem is now ready :)<br />
Thanks to SuperPrower for the hard work!<br />
<br />
===Sending SMS===<br />
<br />
/usr/lib/ofono/test/send-sms <PHONE NUMBER RECEIVER> <MESSAGE> <DELIVERY REPORT><br />
<br />
To skip the delivery report, use <code>0</code> as argument.<br />
<br />
==Cameras==<br />
<br />
Thanks to: https://wiki.postmarketos.org/wiki/Pine_Don't_be_evil_devkit_(pine-dontbeevil)#Cameras<br />
Only the back camera is supported by the mainline kernel.<br />
To use it, you need to configure it first:<br />
<br />
media-ctl --set-v4l2 '"ov5640 2-003c":0[fmt:UYVY8_2X8/1280x7200]' -d /dev/media1<br />
<br />
Afterwards, you can take a picture with:<br />
<br />
ffmpeg -s 1280x720 -f video4linux2 -i /dev/video1 -vframes 1 selfie.jpg<br />
<br />
- <code>/dev/media1</code> is the controller interface of the back camera<br />
<br />
- <code>/dev/video1</code> is the back camera stream interface<br />
<br />
If that works, you can try <code>gstreamer</code> to make the camera available for system wide usage:]<br />
<br />
gst-launch-1.0 v4l2src device=/dev/video1 num-buffers=1 ! 'video/x-raw,format=UYVY,width=1280,height=720' ! jpegenc ! filesink location=selfie.jpg<br />
cp selfie.jpg /home/nemo/Pictures<br />
<br />
This command generates a <code>selfie.jpg</code> file and by copying it to <code>/home/nemo/Pictures</code> you can view it with the Gallery app.<br />
<br />
== Audio ==<br />
<br />
1. Unmuting the <code>AIF1 Slot 0 Digital DAC</code> channel using <code>alsamixer</code>. Use <code>m</code> to unmute.<br />
<br />
2. Copy the default PulseAudio config: <br />
cp /etc/pulse/default.pa /etc/pulse/arm_native_config.pa<br />
<br />
3. Enable ALSA modules in the new config:<br />
load-module module-alsa-sink<br />
load-module module-alsa-source device=hw:1,0<br />
They are commented out by default.<br />
<br />
4. Configure PulseAudio by changing <code>arm_droid_config.pa</code> to <code>/arm_native_config.pa</code> in <code>/etc/sysconfig/pulseaudio</code>.<br />
<br />
5. Restart PulseAudio or reboot.<br />
<br />
6. Go to the Settings app and test the sound output by playing a ringtone under Sounds and Feedback.<br />
<br />
==PineTab==<br />
<br />
In pinetab we have jack to uart port cable. For enable UART console move selector nearby sd-card slot away from sd-card slot.<br />
<br />
==Testing the vibrator motor==<br />
<br />
You need to have the <code>CONFIG_GPIO_SYSFS</code> enabled in your kernel config for this!<br />
<br />
Vibrator motor is on pin <code>PD2</code>.<br />
You can calculate the PIN number for PD2 as followed ([https://linux-sunxi.org/GPIO more information]):<br />
<code>(4-1) * 32 + 2 = 98</code><br />
<br />
echo "98" > /sys/class/gpio/export # Make pin available<br />
echo "out" > /sys/class/gpio/gpio98/direction # Set as output<br />
echo "1" > /sys/class/gpio/gpio98/value # On<br />
echo "1" > /sys/class/gpio/gpio98/value # Off<br />
echo "98" > /sys/class/gpio/unexport # When you're done<br />
<br />
==Notification LED==<br />
<br />
export COLOR=red # or green, blue is broken due to a hardware fault<br />
# Activate LED<br />
echo 1 > /sys/class/leds/$COLOR/brightness<br />
# Deactivate LED<br />
echo 0 > /sys/class/leds/$COLOR/brightness<br />
<br />
The LED can be controlled in Mer by MCE. You need the <code>mce-plugin-libhybris-nondroid</code> for this.<br />
<br />
=Installation=<br />
==Prepare SD card==<br />
<br />
Use GParted or any other tool to create the following <code>EXT4</code> partitions:<br />
<br />
# <b>boot</b>: Holds the mainline kernel Image and Device Tree files<br />
# <b>data</b>: Holds the Sailfish OS rootFS<br />
<br />
GParted will ask you to leave the first MB free of the SD card when creating the first partition, this is correct.<br />
This 1 MB will be used to store the U-boot boot loader.<br />
<br />
==U-Boot==<br />
<br />
We will now build the mainline U-boot boot loader from Git.<br />
<br />
=== Clone ARM Trusted Firmware (master branch) ===<br />
<br />
git clone https://github.com/ARM-software/arm-trusted-firmware.git<br />
<br />
=== Build the BL31.bin ===<br />
<br />
Follow the instructions here: https://github.com/u-boot/u-boot/blob/master/board/sunxi/README.sunxi64<br />
<br />
Quick start:<br />
<br />
export CROSS_COMPILE=aarch64-linux-gnu-<br />
ARCH=arm64 make PLAT=sun50i_a64 DEBUG=1 bl31<br />
export BL31=/path/to/bl31.bin<br />
<br />
=== Clone U-boot (master branch): ===<br />
<br />
You can find the U-boot mirror repository on Github:<br />
<br />
git clone https://github.com/u-boot/u-boot.git<br />
<br />
=== Compile U-boot ===<br />
<br />
You have to cross compile U-boot with the <code>arm64</code> arch:<br />
<br />
export CROSS_COMPILE=aarch64-linux-gnu-<br />
ARCH=arm64 make clean<br />
ARCH=arm64 make sopine_baseboard_defconfig<br />
ARCH=arm64 make<br />
<br />
The <code>sopine_baseboard_defconfig</code> is the same for the Don't Be Evil devkit.<br />
<br />
=== Burn U-boot to your SD card ===<br />
<br />
Copy the compiled U-boot bootloader to the first sector on your SD card:<br />
<br />
sudo dd if=u-boot-sunxi-with-spl.bin of=/dev/sdX bs=8k seek=1<br />
<br />
<br />
=== Manually loading the kernel ===<br />
<br />
Serial TTY Baudrate over UART = 115200 for screen, example: <code>screen /dev/ttyUSB0 115200</code><br />
You have to start screen first, before turning on the devkit.<br />
<br />
Interrupt the U-boot autoboot process when you see a message in the U-boot prompt. <br />
We need to access the U-boot prompt to load the Kernel image and boot it manually!<br />
<br />
Set bootargs:<br />
<br />
setenv bootargs root=/dev/mmcblk0p2 rootwait panic=10<br />
<br />
Kernel Image loading and Device Tree files:<br />
<br />
ext4load mmc 0:1 ${kernel_addr_r} /Image <br />
ext4load mmc 0:1 ${fdt_addr_r} /sun50i-a64-pinephone.dtb <br />
<br />
Boot the kernel:<br />
<br />
booti ${kernel_addr_r} - ${fdt_addr_r}<br />
<br />
=== Automatic boot ===<br />
<br />
Create a <code>boot.cmd</code> file for the '''PinePhone''':<br />
<br />
echo Setting bootargs<br />
setenv bootargs console=tty0 console=ttyS0,115200 root=/dev/mmcblk0p2 no_console_suspend rootwait <br />
earlycon=uart,mmio32,0x01c28000 panic=10 consoleblank=0 loglevel=1<br />
printenv<br />
echo Loading DTB<br />
load mmc 0:1 ${fdt_addr_r} /sun50i-a64-pinephone.dtb<br />
echo Loading kernel Image<br />
load mmc 0:1 ${kernel_addr_r} /Image<br />
echo Booting kernel NOW<br />
booti ${kernel_addr_r} - ${fdt_addr_r}<br />
<br />
Create a <code>boot.cmd</code> file for the '''PineTab''':<br />
<br />
echo Setting bootargs<br />
setenv bootargs console=tty0 console=ttyS0,115200 root=/dev/mmcblk0p2 no_console_suspend rootwait <br />
earlycon=uart,mmio32,0x01c28000 panic=10 consoleblank=0 loglevel=1<br />
printenv<br />
echo Loading DTB<br />
load mmc 0:1 ${fdt_addr_r} /sun50i-a64-pinetab.dtb<br />
echo Loading kernel Image<br />
load mmc 0:1 ${kernel_addr_r} /Image<br />
echo Booting kernel NOW<br />
booti ${kernel_addr_r} - ${fdt_addr_r}<br />
<br />
Mount your <code>boot</code> partition and run the following command:<br />
sudo mkimage -C none -A arm -T script -d /mnt/boot.cmd /mnt/boot.scr<br />
<br />
This will translate the <code>boot.cmd</code> file into a U-boot script.<br />
<br />
If you don't have the <code>mkimage</code> command available, you can install it from the <code>uboot-tools</code> package.<br />
<br />
==Kernel==<br />
<br />
The PinePhone runs a mainline kernel, device tree modifications are done by all the PinePhone OS developers on Gitlab (https://gitlab.com/pine64-org/linux).<br />
<br />
=== Clone the kernel ===<br />
<br />
git clone https://gitlab.com/pine64-org/linux<br />
cd linux<br />
git checkout pine64-kernel<br />
<br />
=== Configure the kernel ===<br />
<br />
# <b>Copy our kernel config</b>: https://gitlab.com/pinephone-sailfish-os/linux-kernel/raw/master/pinephone-config<br />
# <b>Enter the <code>linux</code> project</b>: <code>cd linux</code><br />
# <b>Copy the config file</b> to <code>.config</code> in the main directory<br />
<br />
=== Enable WiFi out-of-tree driver ===<br />
<br />
Add the driver to the kernel:<br />
cd drivers/staging<br />
git clone https://github.com/Icenowy/rtl8723cs.git<br />
<br />
Configure the kernel build system now:<br />
<br />
# <b>Add this line to <code>drivers/staging/Kconfig</code></b>: <code>source "drivers/staging/rtl8723cs/Kconfig"</code><br />
# <b>Add this line to <code>drivers/staging/Makefile</code></b>: <code>obj-$(CONFIG_RTL8723CS) += rtl8723cs/</code><br />
<br />
See: [https://gitlab.com/postmarketOS/pmaports/blob/master/main/linux-postmarketos-allwinner/rtl8723cs.patch https://gitlab.com/postmarketOS/pmaports/blob/master/main/linux-postmarketos-allwinner/rtl8723cs.patch]<br />
<br />
=== Build the kernel ===<br />
<br />
We cross compile the kernel for ARM64.<br />
The <code>LOCALVERSION</code> variable can be used to add a version to the build.<br />
<br />
Cross compile the kernel:<br />
export ARCH=arm64<br />
export CROSS_COMPILE=aarch64-linux-gnu-<br />
export LOCALVERSION=-nemo<br />
make clean<br />
make oldconfig<br />
make Image modules dtbs<br />
<br />
Install the kernel modules in a different path: <br />
make modules_install INSTALL_MOD_PATH=../linux_modules/<br />
<br />
=== Install kernel ===<br />
<br />
Copy the following things:<br />
<br />
# <b>Image</b> from <code>arch/arm64/boot/Image</code> to the root of the <code>boot</code> partition.<br />
# <b>Device tree files</b> <br />
For pinethone <code>arch/arm64/boot/dts/allwinner/sun50i-a64-pinephone.dtb</code> and <code>arch/arm64/boot/dts/allwinner/sun50i-a64-pinephone.dts</code> to the root of the <code>boot</code> partition.<br />
<br />
For pinetab <code>arch/arm64/boot/dts/allwinner/sun50i-a64-pinetab.dtb</code> and <code>arch/arm64/boot/dts/allwinner/sun50i-a64-pinetab.dts</code> to the root of the <code>boot</code> partition.<br />
# <b>Modules</b> from <code>../linux_modules</code> to <code>/lib/modules</code> on the <code>boot</code> partition.<br />
<br />
=== Wlan Module ===<br />
<br />
On PinePhone we have mainline kernel driver. But in PineTab we must use https://github.com/Icenowy/rtl8723cs driver.<br />
<br />
==Nemo Mobile==<br />
<br />
For build last release of nemo use this ks file https://gist.github.com/neochapay/8d40f9ee1e5fd621e0053aa126d39e81<br />
<br />
==Sailfish OS==<br />
<br />
===Github & OBS project===<br />
<br />
- https://github.com/sailfish-on-dontbeevil<br />
<br />
- https://build.merproject.org/project/show/nemo:devel:hw:pine:dontbeevil<br />
<br />
===Flash rootFS===<br />
You can download the latest rootFS from the Gitlab SailfishOS Porters CI: https://gitlab.com/sailfishos-porters-ci/dont_be_evil-ci (see the artifacts of the latest CI job).<br />
<br />
This <code>tar.gz</code> archive should be burned to the <code>data</code> partition of the SD card.<br />
It's important to burn it as the root user (not with sudo) to preserve extended attributes and ACLs: <br />
<br />
sudo su<br />
bsdtar -xpf <SAILFISH OS ROOTFS>.tar.bz2 -C <MOUNTPOINT OF /DATA><br />
<br />
===Device repos===<br />
To boot Lipstick, you need to add the device specific repos to the devkit.<br />
All the following commands are executed in a shell on the devkit.<br />
<br />
''Make sure you configure the ethernet interface first before you continue!''<br />
''You need to have access to the WWW to fetch the necessary repository data and packages.''<br />
<br />
Install zypper manually:<br />
curl -o augeas-lib.rpm http://repo.merproject.org/obs/mer:/core/latest_armv7hl/armv7hl/augeas-libs-1.6.0+git1-1.10.6.armv7hl.rpm<br />
curl -o zypper.rpm http://repo.merproject.org/obs/mer:/core/latest_armv7hl/armv7hl/zypper-1.14.6+git3-1.24.5.armv7hl.rpm<br />
rpm -Uvh *rpm<br />
<br />
Use <code>ssu</code> to add the repo<br />
ssu ar common http://repo.merproject.org/obs/nemo:/devel:/hw:/common/sailfish_latest_armv7hl/<br />
ssu ar dontbeevil http://repo.merproject.org/obs/home:/piggz:/dontbeevil/sailfishos_3.0.3.9_latest_armv7hl/<br />
ssu ar jolla https://releases.jolla.com/releases/3.0.3.9/jolla/armv7hl/<br />
<br />
Refresh the repo:<br />
zypper refresh<br />
<br />
Install the device packages:<br />
zypper install dontbeevil:qt5-qtcore dontbeevil:qt5-qttest dontbeevil:lipstick-qt5<br />
zypper install droid-config-dontbeevil # Select 1 for vendor change<br />
zypper install droid-config-dontbeevil-sailfish<br />
zypper install qt5-plugin-platform-eglfs # EGLFS LIMA plugin<br />
zypper install qt5-plugin-generic-evdev # evdev input plugins<br />
<br />
Other useful packages<br />
zypper install mce-tools #useful for mcetool (mcetool -U activates the screen)<br />
<br />
===Unknown password===<br />
The Sailfish OS rootFS sets a random password when booting for the first time.<br />
You can only log in through the <code>telnet</code> debug interface.<br />
Since the <code>eth0</code> interface still requires manually setup, you can't access <code>telnet</code>.<br />
<br />
To circumvent this issue, you can login through the UART TTY interface. <br />
However you don't know the password of the <code>root</code> nor <code>nemo</code> users!<br />
To disable the <code>root</code> and <code>nemo</code> passwords, we can modify the <code>/etc/shadow</code> file:<br />
<br />
sudo chmod +w <SD card data partition>/etc/shadow<br />
sudo vim <SD card data partition>/etc/shadow # Remove any characters where <HASHED PASSWORD> is written: user1:<HASHED PASSWORD>:16092:0:99999:7:::.<br />
sudo chmod -w <SD card data partition>/etc/shadow<br />
<br />
By removing the hashed password, we can login with the user without entering a password.<br />
You can set a new password afterwards by running as a logged in user:<br />
<br />
passwd<br />
<br />
===Init eth0===<br />
Enabling the <code>eth0</code> interface has to be done manually for now:<br />
<br />
ifconfig eth0 <YOUR_IP><br />
route add default gw <DEFAULT_GATEWAY_IP><br />
echo "nameserver <DNS_SERVER_IP>" > /etc/resolv.conf<br />
<br />
Test your configuration with <code>ping</code>:<br />
<br />
ping jolla.com<br />
<br />
<br />
===Lipstick crashing===<br />
<br />
Install Lipstick from the <code>dontbeevil</code> repository:<br />
<br />
zypper install dontbeevil:lipstick-qt5<br />
<br />
===No setup wizard===<br />
<br />
Make sure the configuration package is installed:<br />
<br />
zypper install droid-config-dontbeevil-sailfish<br />
<br />
===Missing regulatory.db for RT8723BS WiFi/BT module===<br />
<br />
git clone git://git.kernel.org/pub/scm/linux/kernel/git/sforshee/wireless-regdb.git<br />
cd wireless-regdb<br />
cp regulatory* /lib/firmware</div>Dylanvanasschttps://wiki.merproject.org/wiki/Adaptations/PinePhone64Adaptations/PinePhone642019-10-05T14:03:30Z<p>Dylanvanassc: /* WiFi */</p>
<hr />
<div>=Hardware Support=<br />
<br />
Full information of hardware spec [https://wiki.pine64.org/index.php/Project_Don't_be_evil Here]<br />
<br />
PostMarket OS hardware information [https://wiki.postmarketos.org/wiki/Pine_Don%27t_be_evil_devkit_(pine-dontbeevil) PostMarketOS Wiki]<br />
<br />
==WiFi/BT RTL8723CS==<br />
<br />
=== WiFi ===<br />
The WiFi driver isn't available in the Linux kernel yet. However, we can compile it as an out-of-tree driver for now.<br />
See kernel building for more instruction<br />
<br />
=== Bluetooth ===<br />
The production version of the PineTab and PinePhone are both using the Realtek 8723CS WiFi/BT module.<br />
BT is natively supported after adding the necessary firmware from [https://github.com/anarsoul/rtl8723bt-firmware/tree/master/rtl_bt https://github.com/anarsoul/rtl8723bt-firmware/tree/master/rtl_bt]<br />
Download all the <code>*.bin</code> files and copy them to the <code>/lib/firmware/rtl_bt</code> directory in the rootFS.<br />
<br />
==Modem EC25==<br />
<br />
===Setup===<br />
<br />
1. Make sure that the <code>qmimodem</code> plugin is enabled in the <code>.spec</code> of <code>ofono</code>.<br />
<br />
2. Remove the <code>noplugin.conf</code> file under <code>/lib/environment/ofono/noplugin.conf</code>.<br />
<br />
3. Restart <code>ofono</code><br />
systemctl restart ofono<br />
<br />
4. Check if the QMI modem is properly detected:<br />
/usr/lib/ofono/test/list-modems<br />
<br />
5. Unlock you SIM card (if needed):<br />
/usr/lib/ofono/test/enter-pin /quectelqmi_0 pin <PIN CODE><br />
<br />
The EC25 Quectel modem is now ready :)<br />
Thanks to SuperPrower for the hard work!<br />
<br />
===Sending SMS===<br />
<br />
/usr/lib/ofono/test/send-sms <PHONE NUMBER RECEIVER> <MESSAGE> <DELIVERY REPORT><br />
<br />
To skip the delivery report, use <code>0</code> as argument.<br />
<br />
==Cameras==<br />
<br />
Thanks to: https://wiki.postmarketos.org/wiki/Pine_Don't_be_evil_devkit_(pine-dontbeevil)#Cameras<br />
Only the back camera is supported by the mainline kernel.<br />
To use it, you need to configure it first:<br />
<br />
media-ctl --set-v4l2 '"ov5640 2-003c":0[fmt:UYVY8_2X8/1280x7200]' -d /dev/media1<br />
<br />
Afterwards, you can take a picture with:<br />
<br />
ffmpeg -s 1280x720 -f video4linux2 -i /dev/video1 -vframes 1 selfie.jpg<br />
<br />
- <code>/dev/media1</code> is the controller interface of the back camera<br />
<br />
- <code>/dev/video1</code> is the back camera stream interface<br />
<br />
If that works, you can try <code>gstreamer</code> to make the camera available for system wide usage:]<br />
<br />
gst-launch-1.0 v4l2src device=/dev/video1 num-buffers=1 ! 'video/x-raw,format=UYVY,width=1280,height=720' ! jpegenc ! filesink location=selfie.jpg<br />
cp selfie.jpg /home/nemo/Pictures<br />
<br />
This command generates a <code>selfie.jpg</code> file and by copying it to <code>/home/nemo/Pictures</code> you can view it with the Gallery app.<br />
<br />
== Audio ==<br />
<br />
1. Unmuting the <code>AIF1 Slot 0 Digital DAC</code> channel using <code>alsamixer</code>. Use <code>m</code> to unmute.<br />
<br />
2. Copy the default PulseAudio config: <br />
cp /etc/pulse/default.pa /etc/pulse/arm_native_config.pa<br />
<br />
3. Enable ALSA modules in the new config:<br />
load-module module-alsa-sink<br />
load-module module-alsa-source device=hw:1,0<br />
They are commented out by default.<br />
<br />
4. Configure PulseAudio by changing <code>arm_droid_config.pa</code> to <code>/arm_native_config.pa</code> in <code>/etc/sysconfig/pulseaudio</code>.<br />
<br />
5. Restart PulseAudio or reboot.<br />
<br />
6. Go to the Settings app and test the sound output by playing a ringtone under Sounds and Feedback.<br />
<br />
==PineTab==<br />
<br />
In pinetab we have jack to uart port cable. For enable UART console move selector nearby sd-card slot away from sd-card slot.<br />
<br />
==Testing the vibrator motor==<br />
<br />
You need to have the <code>CONFIG_GPIO_SYSFS</code> enabled in your kernel config for this!<br />
<br />
Vibrator motor is on pin <code>PD2</code>.<br />
You can calculate the PIN number for PD2 as followed ([https://linux-sunxi.org/GPIO more information]):<br />
<code>(4-1) * 32 + 2 = 98</code><br />
<br />
echo "98" > /sys/class/gpio/export # Make pin available<br />
echo "out" > /sys/class/gpio/gpio98/direction # Set as output<br />
echo "1" > /sys/class/gpio/gpio98/value # On<br />
echo "1" > /sys/class/gpio/gpio98/value # Off<br />
echo "98" > /sys/class/gpio/unexport # When you're done<br />
<br />
==Notification LED==<br />
<br />
export COLOR=red # or green, blue is broken due to a hardware fault<br />
# Activate LED<br />
echo 1 > /sys/class/leds/$COLOR/brightness<br />
# Deactivate LED<br />
echo 0 > /sys/class/leds/$COLOR/brightness<br />
<br />
The LED can be controlled in Mer by MCE. You need the <code>mce-plugin-libhybris-nondroid</code> for this.<br />
<br />
=Installation=<br />
==Prepare SD card==<br />
<br />
Use GParted or any other tool to create the following <code>EXT4</code> partitions:<br />
<br />
# <b>boot</b>: Holds the mainline kernel Image and Device Tree files<br />
# <b>data</b>: Holds the Sailfish OS rootFS<br />
<br />
GParted will ask you to leave the first MB free of the SD card when creating the first partition, this is correct.<br />
This 1 MB will be used to store the U-boot boot loader.<br />
<br />
==U-Boot==<br />
<br />
We will now build the mainline U-boot boot loader from Git.<br />
<br />
=== Clone ARM Trusted Firmware (master branch) ===<br />
<br />
git clone https://github.com/ARM-software/arm-trusted-firmware.git<br />
<br />
=== Build the BL31.bin ===<br />
<br />
Follow the instructions here: https://github.com/u-boot/u-boot/blob/master/board/sunxi/README.sunxi64<br />
<br />
Quick start:<br />
<br />
export CROSS_COMPILE=aarch64-linux-gnu-<br />
ARCH=arm64 make PLAT=sun50i_a64 DEBUG=1 bl31<br />
export BL31=/path/to/bl31.bin<br />
<br />
=== Clone U-boot (master branch): ===<br />
<br />
You can find the U-boot mirror repository on Github:<br />
<br />
git clone https://github.com/u-boot/u-boot.git<br />
<br />
=== Compile U-boot ===<br />
<br />
You have to cross compile U-boot with the <code>arm64</code> arch:<br />
<br />
export CROSS_COMPILE=aarch64-linux-gnu-<br />
ARCH=arm64 make clean<br />
ARCH=arm64 make sopine_baseboard_defconfig<br />
ARCH=arm64 make<br />
<br />
The <code>sopine_baseboard_defconfig</code> is the same for the Don't Be Evil devkit.<br />
<br />
=== Burn U-boot to your SD card ===<br />
<br />
Copy the compiled U-boot bootloader to the first sector on your SD card:<br />
<br />
sudo dd if=u-boot-sunxi-with-spl.bin of=/dev/sdX bs=8k seek=1<br />
<br />
<br />
=== Manually loading the kernel ===<br />
<br />
Serial TTY Baudrate over UART = 115200 for screen, example: <code>screen /dev/ttyUSB0 115200</code><br />
You have to start screen first, before turning on the devkit.<br />
<br />
Interrupt the U-boot autoboot process when you see a message in the U-boot prompt. <br />
We need to access the U-boot prompt to load the Kernel image and boot it manually!<br />
<br />
Set bootargs:<br />
<br />
setenv bootargs root=/dev/mmcblk0p2 rootwait panic=10<br />
<br />
Kernel Image loading and Device Tree files:<br />
<br />
ext4load mmc 0:1 ${kernel_addr_r} /Image <br />
ext4load mmc 0:1 ${fdt_addr_r} /sun50i-a64-pinephone.dtb <br />
<br />
Boot the kernel:<br />
<br />
booti ${kernel_addr_r} - ${fdt_addr_r}<br />
<br />
=== Automatic boot ===<br />
<br />
Create a <code>boot.cmd</code> file for the '''PinePhone''':<br />
<br />
echo Setting bootargs<br />
setenv bootargs console=tty0 console=ttyS0,115200 root=/dev/mmcblk0p2 no_console_suspend rootwait <br />
earlycon=uart,mmio32,0x01c28000 panic=10 consoleblank=0 loglevel=1<br />
printenv<br />
echo Loading DTB<br />
load mmc 0:1 ${fdt_addr_r} /sun50i-a64-pinephone.dtb<br />
echo Loading kernel Image<br />
load mmc 0:1 ${kernel_addr_r} /Image<br />
echo Booting kernel NOW<br />
booti ${kernel_addr_r} - ${fdt_addr_r}<br />
<br />
Create a <code>boot.cmd</code> file for the '''PineTab''':<br />
<br />
echo Setting bootargs<br />
setenv bootargs console=tty0 console=ttyS0,115200 root=/dev/mmcblk0p2 no_console_suspend rootwait <br />
earlycon=uart,mmio32,0x01c28000 panic=10 consoleblank=0 loglevel=1<br />
printenv<br />
echo Loading DTB<br />
load mmc 0:1 ${fdt_addr_r} /sun50i-a64-pinetab.dtb<br />
echo Loading kernel Image<br />
load mmc 0:1 ${kernel_addr_r} /Image<br />
echo Booting kernel NOW<br />
booti ${kernel_addr_r} - ${fdt_addr_r}<br />
<br />
Mount your <code>boot</code> partition and run the following command:<br />
sudo mkimage -C none -A arm -T script -d /mnt/boot.cmd /mnt/boot.scr<br />
<br />
This will translate the <code>boot.cmd</code> file into a U-boot script.<br />
<br />
If you don't have the <code>mkimage</code> command available, you can install it from the <code>uboot-tools</code> package.<br />
<br />
==Kernel==<br />
<br />
The PinePhone runs a mainline kernel, device tree modifications are done by all the PinePhone OS developers on Gitlab (https://gitlab.com/pine64-org/linux).<br />
<br />
=== Clone the kernel ===<br />
<br />
git clone https://gitlab.com/pine64-org/linux<br />
cd linux<br />
git checkout pine64-kernel<br />
<br />
=== Configure the kernel ===<br />
<br />
# <b>Copy our kernel config</b>: https://gitlab.com/pinephone-sailfish-os/linux-kernel/raw/master/pinephone-config<br />
# <b>Enter the <code>linux</code> project</b>: <code>cd linux</code><br />
# <b>Copy the config file</b> to <code>.config</code> in the main directory<br />
<br />
=== Build the kernel ===<br />
<br />
We cross compile the kernel for ARM64.<br />
The <code>LOCALVERSION</code> variable can be used to add a version to the build.<br />
<br />
Cross compile the kernel:<br />
export ARCH=arm64<br />
export CROSS_COMPILE=aarch64-linux-gnu-<br />
export LOCALVERSION=-nemo<br />
make clean<br />
make oldconfig<br />
make Image modules dtbs<br />
<br />
Install the kernel modules in a different path: <br />
make modules_install INSTALL_MOD_PATH=../linux_modules/<br />
<br />
=== Install kernel ===<br />
<br />
Copy the following things:<br />
<br />
# <b>Image</b> from <code>arch/arm64/boot/Image</code> to the root of the <code>boot</code> partition.<br />
# <b>Device tree files</b> <br />
For pinethone <code>arch/arm64/boot/dts/allwinner/sun50i-a64-pinephone.dtb</code> and <code>arch/arm64/boot/dts/allwinner/sun50i-a64-pinephone.dts</code> to the root of the <code>boot</code> partition.<br />
<br />
For pinetab <code>arch/arm64/boot/dts/allwinner/sun50i-a64-pinetab.dtb</code> and <code>arch/arm64/boot/dts/allwinner/sun50i-a64-pinetab.dts</code> to the root of the <code>boot</code> partition.<br />
# <b>Modules</b> from <code>../linux_modules</code> to <code>/lib/modules</code> on the <code>boot</code> partition.<br />
<br />
=== Wlan Module ===<br />
<br />
On PinePhone we have mainline kernel driver. But in PineTab we must use https://github.com/Icenowy/rtl8723cs driver.<br />
<br />
==Nemo Mobile==<br />
<br />
For build last release of nemo use this ks file https://gist.github.com/neochapay/8d40f9ee1e5fd621e0053aa126d39e81<br />
<br />
==Sailfish OS==<br />
<br />
===Github & OBS project===<br />
<br />
- https://github.com/sailfish-on-dontbeevil<br />
<br />
- https://build.merproject.org/project/show/nemo:devel:hw:pine:dontbeevil<br />
<br />
===Flash rootFS===<br />
You can download the latest rootFS from the Gitlab SailfishOS Porters CI: https://gitlab.com/sailfishos-porters-ci/dont_be_evil-ci (see the artifacts of the latest CI job).<br />
<br />
This <code>tar.gz</code> archive should be burned to the <code>data</code> partition of the SD card.<br />
It's important to burn it as the root user (not with sudo) to preserve extended attributes and ACLs: <br />
<br />
sudo su<br />
bsdtar -xpf <SAILFISH OS ROOTFS>.tar.bz2 -C <MOUNTPOINT OF /DATA><br />
<br />
===Device repos===<br />
To boot Lipstick, you need to add the device specific repos to the devkit.<br />
All the following commands are executed in a shell on the devkit.<br />
<br />
''Make sure you configure the ethernet interface first before you continue!''<br />
''You need to have access to the WWW to fetch the necessary repository data and packages.''<br />
<br />
Install zypper manually:<br />
curl -o augeas-lib.rpm http://repo.merproject.org/obs/mer:/core/latest_armv7hl/armv7hl/augeas-libs-1.6.0+git1-1.10.6.armv7hl.rpm<br />
curl -o zypper.rpm http://repo.merproject.org/obs/mer:/core/latest_armv7hl/armv7hl/zypper-1.14.6+git3-1.24.5.armv7hl.rpm<br />
rpm -Uvh *rpm<br />
<br />
Use <code>ssu</code> to add the repo<br />
ssu ar common http://repo.merproject.org/obs/nemo:/devel:/hw:/common/sailfish_latest_armv7hl/<br />
ssu ar dontbeevil http://repo.merproject.org/obs/home:/piggz:/dontbeevil/sailfishos_3.0.3.9_latest_armv7hl/<br />
ssu ar jolla https://releases.jolla.com/releases/3.0.3.9/jolla/armv7hl/<br />
<br />
Refresh the repo:<br />
zypper refresh<br />
<br />
Install the device packages:<br />
zypper install dontbeevil:qt5-qtcore dontbeevil:qt5-qttest dontbeevil:lipstick-qt5<br />
zypper install droid-config-dontbeevil # Select 1 for vendor change<br />
zypper install droid-config-dontbeevil-sailfish<br />
zypper install qt5-plugin-platform-eglfs # EGLFS LIMA plugin<br />
zypper install qt5-plugin-generic-evdev # evdev input plugins<br />
<br />
Other useful packages<br />
zypper install mce-tools #useful for mcetool (mcetool -U activates the screen)<br />
<br />
===Unknown password===<br />
The Sailfish OS rootFS sets a random password when booting for the first time.<br />
You can only log in through the <code>telnet</code> debug interface.<br />
Since the <code>eth0</code> interface still requires manually setup, you can't access <code>telnet</code>.<br />
<br />
To circumvent this issue, you can login through the UART TTY interface. <br />
However you don't know the password of the <code>root</code> nor <code>nemo</code> users!<br />
To disable the <code>root</code> and <code>nemo</code> passwords, we can modify the <code>/etc/shadow</code> file:<br />
<br />
sudo chmod +w <SD card data partition>/etc/shadow<br />
sudo vim <SD card data partition>/etc/shadow # Remove any characters where <HASHED PASSWORD> is written: user1:<HASHED PASSWORD>:16092:0:99999:7:::.<br />
sudo chmod -w <SD card data partition>/etc/shadow<br />
<br />
By removing the hashed password, we can login with the user without entering a password.<br />
You can set a new password afterwards by running as a logged in user:<br />
<br />
passwd<br />
<br />
===Init eth0===<br />
Enabling the <code>eth0</code> interface has to be done manually for now:<br />
<br />
ifconfig eth0 <YOUR_IP><br />
route add default gw <DEFAULT_GATEWAY_IP><br />
echo "nameserver <DNS_SERVER_IP>" > /etc/resolv.conf<br />
<br />
Test your configuration with <code>ping</code>:<br />
<br />
ping jolla.com<br />
<br />
<br />
===Lipstick crashing===<br />
<br />
Install Lipstick from the <code>dontbeevil</code> repository:<br />
<br />
zypper install dontbeevil:lipstick-qt5<br />
<br />
===No setup wizard===<br />
<br />
Make sure the configuration package is installed:<br />
<br />
zypper install droid-config-dontbeevil-sailfish<br />
<br />
===Missing regulatory.db for RT8723BS WiFi/BT module===<br />
<br />
git clone git://git.kernel.org/pub/scm/linux/kernel/git/sforshee/wireless-regdb.git<br />
cd wireless-regdb<br />
cp regulatory* /lib/firmware</div>Dylanvanasschttps://wiki.merproject.org/wiki/Adaptations/PinePhone64Adaptations/PinePhone642019-10-05T13:46:50Z<p>Dylanvanassc: /* WiFi */</p>
<hr />
<div>=Hardware Support=<br />
<br />
Full information of hardware spec [https://wiki.pine64.org/index.php/Project_Don't_be_evil Here]<br />
<br />
PostMarket OS hardware information [https://wiki.postmarketos.org/wiki/Pine_Don%27t_be_evil_devkit_(pine-dontbeevil) PostMarketOS Wiki]<br />
<br />
==WiFi/BT RTL8723CS==<br />
<br />
=== WiFi ===<br />
The WiFi driver isn't available in the Linux kernel yet. However, we can compile it as an out-of-tree driver for now:<br />
<br />
git clone https://github.com/Icenowy/rtl8723cs.git<br />
cd rtl8723cs<br />
export CROSS_COMPILE=aarch64-linux-gnu-<br />
ARCH=arm64 make clean<br />
ARCH=arm64 make<br />
ARCH=arm64 make install<br />
<br />
Copy the driver to the rootFS modules directory:<br />
<br />
WIP, TODO<br />
<br />
=== Bluetooth ===<br />
The production version of the PineTab and PinePhone are both using the Realtek 8723CS WiFi/BT module.<br />
BT is natively supported after adding the necessary firmware from [https://github.com/anarsoul/rtl8723bt-firmware/tree/master/rtl_bt https://github.com/anarsoul/rtl8723bt-firmware/tree/master/rtl_bt]<br />
Download all the <code>*.bin</code> files and copy them to the <code>/lib/firmware/rtl_bt</code> directory in the rootFS.<br />
<br />
==Modem EC25==<br />
<br />
===Setup===<br />
<br />
1. Make sure that the <code>qmimodem</code> plugin is enabled in the <code>.spec</code> of <code>ofono</code>.<br />
<br />
2. Remove the <code>noplugin.conf</code> file under <code>/lib/environment/ofono/noplugin.conf</code>.<br />
<br />
3. Restart <code>ofono</code><br />
systemctl restart ofono<br />
<br />
4. Check if the QMI modem is properly detected:<br />
/usr/lib/ofono/test/list-modems<br />
<br />
5. Unlock you SIM card (if needed):<br />
/usr/lib/ofono/test/enter-pin /quectelqmi_0 pin <PIN CODE><br />
<br />
The EC25 Quectel modem is now ready :)<br />
Thanks to SuperPrower for the hard work!<br />
<br />
===Sending SMS===<br />
<br />
/usr/lib/ofono/test/send-sms <PHONE NUMBER RECEIVER> <MESSAGE> <DELIVERY REPORT><br />
<br />
To skip the delivery report, use <code>0</code> as argument.<br />
<br />
==Cameras==<br />
<br />
Thanks to: https://wiki.postmarketos.org/wiki/Pine_Don't_be_evil_devkit_(pine-dontbeevil)#Cameras<br />
Only the back camera is supported by the mainline kernel.<br />
To use it, you need to configure it first:<br />
<br />
media-ctl --set-v4l2 '"ov5640 2-003c":0[fmt:UYVY8_2X8/1280x7200]' -d /dev/media1<br />
<br />
Afterwards, you can take a picture with:<br />
<br />
ffmpeg -s 1280x720 -f video4linux2 -i /dev/video1 -vframes 1 selfie.jpg<br />
<br />
- <code>/dev/media1</code> is the controller interface of the back camera<br />
<br />
- <code>/dev/video1</code> is the back camera stream interface<br />
<br />
If that works, you can try <code>gstreamer</code> to make the camera available for system wide usage:]<br />
<br />
gst-launch-1.0 v4l2src device=/dev/video1 num-buffers=1 ! 'video/x-raw,format=UYVY,width=1280,height=720' ! jpegenc ! filesink location=selfie.jpg<br />
cp selfie.jpg /home/nemo/Pictures<br />
<br />
This command generates a <code>selfie.jpg</code> file and by copying it to <code>/home/nemo/Pictures</code> you can view it with the Gallery app.<br />
<br />
== Audio ==<br />
<br />
1. Unmuting the <code>AIF1 Slot 0 Digital DAC</code> channel using <code>alsamixer</code>. Use <code>m</code> to unmute.<br />
<br />
2. Copy the default PulseAudio config: <br />
cp /etc/pulse/default.pa /etc/pulse/arm_native_config.pa<br />
<br />
3. Enable ALSA modules in the new config:<br />
load-module module-alsa-sink<br />
load-module module-alsa-source device=hw:1,0<br />
They are commented out by default.<br />
<br />
4. Configure PulseAudio by changing <code>arm_droid_config.pa</code> to <code>/arm_native_config.pa</code> in <code>/etc/sysconfig/pulseaudio</code>.<br />
<br />
5. Restart PulseAudio or reboot.<br />
<br />
6. Go to the Settings app and test the sound output by playing a ringtone under Sounds and Feedback.<br />
<br />
==PineTab==<br />
<br />
In pinetab we have jack to uart port cable. For enable UART console move selector nearby sd-card slot away from sd-card slot.<br />
<br />
==Testing the vibrator motor==<br />
<br />
You need to have the <code>CONFIG_GPIO_SYSFS</code> enabled in your kernel config for this!<br />
<br />
Vibrator motor is on pin <code>PD2</code>.<br />
You can calculate the PIN number for PD2 as followed ([https://linux-sunxi.org/GPIO more information]):<br />
<code>(4-1) * 32 + 2 = 98</code><br />
<br />
echo "98" > /sys/class/gpio/export # Make pin available<br />
echo "out" > /sys/class/gpio/gpio98/direction # Set as output<br />
echo "1" > /sys/class/gpio/gpio98/value # On<br />
echo "1" > /sys/class/gpio/gpio98/value # Off<br />
echo "98" > /sys/class/gpio/unexport # When you're done<br />
<br />
==Notification LED==<br />
<br />
export COLOR=red # or green, blue is broken due to a hardware fault<br />
# Activate LED<br />
echo 1 > /sys/class/leds/$COLOR/brightness<br />
# Deactivate LED<br />
echo 0 > /sys/class/leds/$COLOR/brightness<br />
<br />
The LED can be controlled in Mer by MCE. You need the <code>mce-plugin-libhybris-nondroid</code> for this.<br />
<br />
=Installation=<br />
==Prepare SD card==<br />
<br />
Use GParted or any other tool to create the following <code>EXT4</code> partitions:<br />
<br />
# <b>boot</b>: Holds the mainline kernel Image and Device Tree files<br />
# <b>data</b>: Holds the Sailfish OS rootFS<br />
<br />
GParted will ask you to leave the first MB free of the SD card when creating the first partition, this is correct.<br />
This 1 MB will be used to store the U-boot boot loader.<br />
<br />
==U-Boot==<br />
<br />
We will now build the mainline U-boot boot loader from Git.<br />
<br />
=== Clone ARM Trusted Firmware (master branch) ===<br />
<br />
git clone https://github.com/ARM-software/arm-trusted-firmware.git<br />
<br />
=== Build the BL31.bin ===<br />
<br />
Follow the instructions here: https://github.com/u-boot/u-boot/blob/master/board/sunxi/README.sunxi64<br />
<br />
Quick start:<br />
<br />
export CROSS_COMPILE=aarch64-linux-gnu-<br />
ARCH=arm64 make PLAT=sun50i_a64 DEBUG=1 bl31<br />
export BL31=/path/to/bl31.bin<br />
<br />
=== Clone U-boot (master branch): ===<br />
<br />
You can find the U-boot mirror repository on Github:<br />
<br />
git clone https://github.com/u-boot/u-boot.git<br />
<br />
=== Compile U-boot ===<br />
<br />
You have to cross compile U-boot with the <code>arm64</code> arch:<br />
<br />
export CROSS_COMPILE=aarch64-linux-gnu-<br />
ARCH=arm64 make clean<br />
ARCH=arm64 make sopine_baseboard_defconfig<br />
ARCH=arm64 make<br />
<br />
The <code>sopine_baseboard_defconfig</code> is the same for the Don't Be Evil devkit.<br />
<br />
=== Burn U-boot to your SD card ===<br />
<br />
Copy the compiled U-boot bootloader to the first sector on your SD card:<br />
<br />
sudo dd if=u-boot-sunxi-with-spl.bin of=/dev/sdX bs=8k seek=1<br />
<br />
<br />
=== Manually loading the kernel ===<br />
<br />
Serial TTY Baudrate over UART = 115200 for screen, example: <code>screen /dev/ttyUSB0 115200</code><br />
You have to start screen first, before turning on the devkit.<br />
<br />
Interrupt the U-boot autoboot process when you see a message in the U-boot prompt. <br />
We need to access the U-boot prompt to load the Kernel image and boot it manually!<br />
<br />
Set bootargs:<br />
<br />
setenv bootargs root=/dev/mmcblk0p2 rootwait panic=10<br />
<br />
Kernel Image loading and Device Tree files:<br />
<br />
ext4load mmc 0:1 ${kernel_addr_r} /Image <br />
ext4load mmc 0:1 ${fdt_addr_r} /sun50i-a64-pinephone.dtb <br />
<br />
Boot the kernel:<br />
<br />
booti ${kernel_addr_r} - ${fdt_addr_r}<br />
<br />
=== Automatic boot ===<br />
<br />
Create a <code>boot.cmd</code> file for the '''PinePhone''':<br />
<br />
echo Setting bootargs<br />
setenv bootargs console=tty0 console=ttyS0,115200 root=/dev/mmcblk0p2 no_console_suspend rootwait <br />
earlycon=uart,mmio32,0x01c28000 panic=10 consoleblank=0 loglevel=1<br />
printenv<br />
echo Loading DTB<br />
load mmc 0:1 ${fdt_addr_r} /sun50i-a64-pinephone.dtb<br />
echo Loading kernel Image<br />
load mmc 0:1 ${kernel_addr_r} /Image<br />
echo Booting kernel NOW<br />
booti ${kernel_addr_r} - ${fdt_addr_r}<br />
<br />
Create a <code>boot.cmd</code> file for the '''PineTab''':<br />
<br />
echo Setting bootargs<br />
setenv bootargs console=tty0 console=ttyS0,115200 root=/dev/mmcblk0p2 no_console_suspend rootwait <br />
earlycon=uart,mmio32,0x01c28000 panic=10 consoleblank=0 loglevel=1<br />
printenv<br />
echo Loading DTB<br />
load mmc 0:1 ${fdt_addr_r} /sun50i-a64-pinetab.dtb<br />
echo Loading kernel Image<br />
load mmc 0:1 ${kernel_addr_r} /Image<br />
echo Booting kernel NOW<br />
booti ${kernel_addr_r} - ${fdt_addr_r}<br />
<br />
Mount your <code>boot</code> partition and run the following command:<br />
sudo mkimage -C none -A arm -T script -d /mnt/boot.cmd /mnt/boot.scr<br />
<br />
This will translate the <code>boot.cmd</code> file into a U-boot script.<br />
<br />
If you don't have the <code>mkimage</code> command available, you can install it from the <code>uboot-tools</code> package.<br />
<br />
==Kernel==<br />
<br />
The PinePhone runs a mainline kernel, device tree modifications are done by all the PinePhone OS developers on Gitlab (https://gitlab.com/pine64-org/linux).<br />
<br />
=== Clone the kernel ===<br />
<br />
git clone https://gitlab.com/pine64-org/linux<br />
cd linux<br />
git checkout pine64-kernel<br />
<br />
=== Configure the kernel ===<br />
<br />
# <b>Copy our kernel config</b>: https://gitlab.com/pinephone-sailfish-os/linux-kernel/raw/master/pinephone-config<br />
# <b>Enter the <code>linux</code> project</b>: <code>cd linux</code><br />
# <b>Copy the config file</b> to <code>.config</code> in the main directory<br />
<br />
=== Build the kernel ===<br />
<br />
We cross compile the kernel for ARM64.<br />
The <code>LOCALVERSION</code> variable can be used to add a version to the build.<br />
<br />
Cross compile the kernel:<br />
export ARCH=arm64<br />
export CROSS_COMPILE=aarch64-linux-gnu-<br />
export LOCALVERSION=-nemo<br />
make clean<br />
make oldconfig<br />
make Image modules dtbs<br />
<br />
Install the kernel modules in a different path: <br />
make modules_install INSTALL_MOD_PATH=../linux_modules/<br />
<br />
=== Install kernel ===<br />
<br />
Copy the following things:<br />
<br />
# <b>Image</b> from <code>arch/arm64/boot/Image</code> to the root of the <code>boot</code> partition.<br />
# <b>Device tree files</b> <br />
For pinethone <code>arch/arm64/boot/dts/allwinner/sun50i-a64-pinephone.dtb</code> and <code>arch/arm64/boot/dts/allwinner/sun50i-a64-pinephone.dts</code> to the root of the <code>boot</code> partition.<br />
<br />
For pinetab <code>arch/arm64/boot/dts/allwinner/sun50i-a64-pinetab.dtb</code> and <code>arch/arm64/boot/dts/allwinner/sun50i-a64-pinetab.dts</code> to the root of the <code>boot</code> partition.<br />
# <b>Modules</b> from <code>../linux_modules</code> to <code>/lib/modules</code> on the <code>boot</code> partition.<br />
<br />
=== Wlan Module ===<br />
<br />
On PinePhone we have mainline kernel driver. But in PineTab we must use https://github.com/Icenowy/rtl8723cs driver.<br />
<br />
==Nemo Mobile==<br />
<br />
For build last release of nemo use this ks file https://gist.github.com/neochapay/8d40f9ee1e5fd621e0053aa126d39e81<br />
<br />
==Sailfish OS==<br />
<br />
===Github & OBS project===<br />
<br />
- https://github.com/sailfish-on-dontbeevil<br />
<br />
- https://build.merproject.org/project/show/nemo:devel:hw:pine:dontbeevil<br />
<br />
===Flash rootFS===<br />
You can download the latest rootFS from the Gitlab SailfishOS Porters CI: https://gitlab.com/sailfishos-porters-ci/dont_be_evil-ci (see the artifacts of the latest CI job).<br />
<br />
This <code>tar.gz</code> archive should be burned to the <code>data</code> partition of the SD card.<br />
It's important to burn it as the root user (not with sudo) to preserve extended attributes and ACLs: <br />
<br />
sudo su<br />
bsdtar -xpf <SAILFISH OS ROOTFS>.tar.bz2 -C <MOUNTPOINT OF /DATA><br />
<br />
===Device repos===<br />
To boot Lipstick, you need to add the device specific repos to the devkit.<br />
All the following commands are executed in a shell on the devkit.<br />
<br />
''Make sure you configure the ethernet interface first before you continue!''<br />
''You need to have access to the WWW to fetch the necessary repository data and packages.''<br />
<br />
Install zypper manually:<br />
curl -o augeas-lib.rpm http://repo.merproject.org/obs/mer:/core/latest_armv7hl/armv7hl/augeas-libs-1.6.0+git1-1.10.6.armv7hl.rpm<br />
curl -o zypper.rpm http://repo.merproject.org/obs/mer:/core/latest_armv7hl/armv7hl/zypper-1.14.6+git3-1.24.5.armv7hl.rpm<br />
rpm -Uvh *rpm<br />
<br />
Use <code>ssu</code> to add the repo<br />
ssu ar common http://repo.merproject.org/obs/nemo:/devel:/hw:/common/sailfish_latest_armv7hl/<br />
ssu ar dontbeevil http://repo.merproject.org/obs/home:/piggz:/dontbeevil/sailfishos_3.0.3.9_latest_armv7hl/<br />
ssu ar jolla https://releases.jolla.com/releases/3.0.3.9/jolla/armv7hl/<br />
<br />
Refresh the repo:<br />
zypper refresh<br />
<br />
Install the device packages:<br />
zypper install dontbeevil:qt5-qtcore dontbeevil:qt5-qttest dontbeevil:lipstick-qt5<br />
zypper install droid-config-dontbeevil # Select 1 for vendor change<br />
zypper install droid-config-dontbeevil-sailfish<br />
zypper install qt5-plugin-platform-eglfs # EGLFS LIMA plugin<br />
zypper install qt5-plugin-generic-evdev # evdev input plugins<br />
<br />
Other useful packages<br />
zypper install mce-tools #useful for mcetool (mcetool -U activates the screen)<br />
<br />
===Unknown password===<br />
The Sailfish OS rootFS sets a random password when booting for the first time.<br />
You can only log in through the <code>telnet</code> debug interface.<br />
Since the <code>eth0</code> interface still requires manually setup, you can't access <code>telnet</code>.<br />
<br />
To circumvent this issue, you can login through the UART TTY interface. <br />
However you don't know the password of the <code>root</code> nor <code>nemo</code> users!<br />
To disable the <code>root</code> and <code>nemo</code> passwords, we can modify the <code>/etc/shadow</code> file:<br />
<br />
sudo chmod +w <SD card data partition>/etc/shadow<br />
sudo vim <SD card data partition>/etc/shadow # Remove any characters where <HASHED PASSWORD> is written: user1:<HASHED PASSWORD>:16092:0:99999:7:::.<br />
sudo chmod -w <SD card data partition>/etc/shadow<br />
<br />
By removing the hashed password, we can login with the user without entering a password.<br />
You can set a new password afterwards by running as a logged in user:<br />
<br />
passwd<br />
<br />
===Init eth0===<br />
Enabling the <code>eth0</code> interface has to be done manually for now:<br />
<br />
ifconfig eth0 <YOUR_IP><br />
route add default gw <DEFAULT_GATEWAY_IP><br />
echo "nameserver <DNS_SERVER_IP>" > /etc/resolv.conf<br />
<br />
Test your configuration with <code>ping</code>:<br />
<br />
ping jolla.com<br />
<br />
<br />
===Lipstick crashing===<br />
<br />
Install Lipstick from the <code>dontbeevil</code> repository:<br />
<br />
zypper install dontbeevil:lipstick-qt5<br />
<br />
===No setup wizard===<br />
<br />
Make sure the configuration package is installed:<br />
<br />
zypper install droid-config-dontbeevil-sailfish<br />
<br />
===Missing regulatory.db for RT8723BS WiFi/BT module===<br />
<br />
git clone git://git.kernel.org/pub/scm/linux/kernel/git/sforshee/wireless-regdb.git<br />
cd wireless-regdb<br />
cp regulatory* /lib/firmware</div>Dylanvanasschttps://wiki.merproject.org/wiki/Adaptations/PinePhone64Adaptations/PinePhone642019-10-05T13:33:35Z<p>Dylanvanassc: /* Hardware Support */</p>
<hr />
<div>=Hardware Support=<br />
<br />
Full information of hardware spec [https://wiki.pine64.org/index.php/Project_Don't_be_evil Here]<br />
<br />
PostMarket OS hardware information [https://wiki.postmarketos.org/wiki/Pine_Don%27t_be_evil_devkit_(pine-dontbeevil) PostMarketOS Wiki]<br />
<br />
==WiFi/BT RTL8723CS==<br />
<br />
=== WiFi ===<br />
The WiFi driver isn't available in the Linux kernel yet. However, we can compile it as an out-of-tree driver for now:<br />
<br />
export CROSS_COMPILE=aarch64-linux-gnu-<br />
ARCH=arm64 make clean<br />
ARCH=arm64 make<br />
ARCH=arm64 make install<br />
<br />
Copy the driver to the rootFS modules directory:<br />
<br />
WIP, TODO<br />
<br />
=== Bluetooth ===<br />
The production version of the PineTab and PinePhone are both using the Realtek 8723CS WiFi/BT module.<br />
BT is natively supported after adding the necessary firmware from [https://github.com/anarsoul/rtl8723bt-firmware/tree/master/rtl_bt https://github.com/anarsoul/rtl8723bt-firmware/tree/master/rtl_bt]<br />
Download all the <code>*.bin</code> files and copy them to the <code>/lib/firmware/rtl_bt</code> directory in the rootFS.<br />
<br />
==Modem EC25==<br />
<br />
===Setup===<br />
<br />
1. Make sure that the <code>qmimodem</code> plugin is enabled in the <code>.spec</code> of <code>ofono</code>.<br />
<br />
2. Remove the <code>noplugin.conf</code> file under <code>/lib/environment/ofono/noplugin.conf</code>.<br />
<br />
3. Restart <code>ofono</code><br />
systemctl restart ofono<br />
<br />
4. Check if the QMI modem is properly detected:<br />
/usr/lib/ofono/test/list-modems<br />
<br />
5. Unlock you SIM card (if needed):<br />
/usr/lib/ofono/test/enter-pin /quectelqmi_0 pin <PIN CODE><br />
<br />
The EC25 Quectel modem is now ready :)<br />
Thanks to SuperPrower for the hard work!<br />
<br />
===Sending SMS===<br />
<br />
/usr/lib/ofono/test/send-sms <PHONE NUMBER RECEIVER> <MESSAGE> <DELIVERY REPORT><br />
<br />
To skip the delivery report, use <code>0</code> as argument.<br />
<br />
==Cameras==<br />
<br />
Thanks to: https://wiki.postmarketos.org/wiki/Pine_Don't_be_evil_devkit_(pine-dontbeevil)#Cameras<br />
Only the back camera is supported by the mainline kernel.<br />
To use it, you need to configure it first:<br />
<br />
media-ctl --set-v4l2 '"ov5640 2-003c":0[fmt:UYVY8_2X8/1280x7200]' -d /dev/media1<br />
<br />
Afterwards, you can take a picture with:<br />
<br />
ffmpeg -s 1280x720 -f video4linux2 -i /dev/video1 -vframes 1 selfie.jpg<br />
<br />
- <code>/dev/media1</code> is the controller interface of the back camera<br />
<br />
- <code>/dev/video1</code> is the back camera stream interface<br />
<br />
If that works, you can try <code>gstreamer</code> to make the camera available for system wide usage:]<br />
<br />
gst-launch-1.0 v4l2src device=/dev/video1 num-buffers=1 ! 'video/x-raw,format=UYVY,width=1280,height=720' ! jpegenc ! filesink location=selfie.jpg<br />
cp selfie.jpg /home/nemo/Pictures<br />
<br />
This command generates a <code>selfie.jpg</code> file and by copying it to <code>/home/nemo/Pictures</code> you can view it with the Gallery app.<br />
<br />
== Audio ==<br />
<br />
1. Unmuting the <code>AIF1 Slot 0 Digital DAC</code> channel using <code>alsamixer</code>. Use <code>m</code> to unmute.<br />
<br />
2. Copy the default PulseAudio config: <br />
cp /etc/pulse/default.pa /etc/pulse/arm_native_config.pa<br />
<br />
3. Enable ALSA modules in the new config:<br />
load-module module-alsa-sink<br />
load-module module-alsa-source device=hw:1,0<br />
They are commented out by default.<br />
<br />
4. Configure PulseAudio by changing <code>arm_droid_config.pa</code> to <code>/arm_native_config.pa</code> in <code>/etc/sysconfig/pulseaudio</code>.<br />
<br />
5. Restart PulseAudio or reboot.<br />
<br />
6. Go to the Settings app and test the sound output by playing a ringtone under Sounds and Feedback.<br />
<br />
==PineTab==<br />
<br />
In pinetab we have jack to uart port cable. For enable UART console move selector nearby sd-card slot away from sd-card slot.<br />
<br />
==Testing the vibrator motor==<br />
<br />
You need to have the <code>CONFIG_GPIO_SYSFS</code> enabled in your kernel config for this!<br />
<br />
Vibrator motor is on pin <code>PD2</code>.<br />
You can calculate the PIN number for PD2 as followed ([https://linux-sunxi.org/GPIO more information]):<br />
<code>(4-1) * 32 + 2 = 98</code><br />
<br />
echo "98" > /sys/class/gpio/export # Make pin available<br />
echo "out" > /sys/class/gpio/gpio98/direction # Set as output<br />
echo "1" > /sys/class/gpio/gpio98/value # On<br />
echo "1" > /sys/class/gpio/gpio98/value # Off<br />
echo "98" > /sys/class/gpio/unexport # When you're done<br />
<br />
==Notification LED==<br />
<br />
export COLOR=red # or green, blue is broken due to a hardware fault<br />
# Activate LED<br />
echo 1 > /sys/class/leds/$COLOR/brightness<br />
# Deactivate LED<br />
echo 0 > /sys/class/leds/$COLOR/brightness<br />
<br />
The LED can be controlled in Mer by MCE. You need the <code>mce-plugin-libhybris-nondroid</code> for this.<br />
<br />
=Installation=<br />
==Prepare SD card==<br />
<br />
Use GParted or any other tool to create the following <code>EXT4</code> partitions:<br />
<br />
# <b>boot</b>: Holds the mainline kernel Image and Device Tree files<br />
# <b>data</b>: Holds the Sailfish OS rootFS<br />
<br />
GParted will ask you to leave the first MB free of the SD card when creating the first partition, this is correct.<br />
This 1 MB will be used to store the U-boot boot loader.<br />
<br />
==U-Boot==<br />
<br />
We will now build the mainline U-boot boot loader from Git.<br />
<br />
=== Clone ARM Trusted Firmware (master branch) ===<br />
<br />
git clone https://github.com/ARM-software/arm-trusted-firmware.git<br />
<br />
=== Build the BL31.bin ===<br />
<br />
Follow the instructions here: https://github.com/u-boot/u-boot/blob/master/board/sunxi/README.sunxi64<br />
<br />
Quick start:<br />
<br />
export CROSS_COMPILE=aarch64-linux-gnu-<br />
ARCH=arm64 make PLAT=sun50i_a64 DEBUG=1 bl31<br />
export BL31=/path/to/bl31.bin<br />
<br />
=== Clone U-boot (master branch): ===<br />
<br />
You can find the U-boot mirror repository on Github:<br />
<br />
git clone https://github.com/u-boot/u-boot.git<br />
<br />
=== Compile U-boot ===<br />
<br />
You have to cross compile U-boot with the <code>arm64</code> arch:<br />
<br />
export CROSS_COMPILE=aarch64-linux-gnu-<br />
ARCH=arm64 make clean<br />
ARCH=arm64 make sopine_baseboard_defconfig<br />
ARCH=arm64 make<br />
<br />
The <code>sopine_baseboard_defconfig</code> is the same for the Don't Be Evil devkit.<br />
<br />
=== Burn U-boot to your SD card ===<br />
<br />
Copy the compiled U-boot bootloader to the first sector on your SD card:<br />
<br />
sudo dd if=u-boot-sunxi-with-spl.bin of=/dev/sdX bs=8k seek=1<br />
<br />
<br />
=== Manually loading the kernel ===<br />
<br />
Serial TTY Baudrate over UART = 115200 for screen, example: <code>screen /dev/ttyUSB0 115200</code><br />
You have to start screen first, before turning on the devkit.<br />
<br />
Interrupt the U-boot autoboot process when you see a message in the U-boot prompt. <br />
We need to access the U-boot prompt to load the Kernel image and boot it manually!<br />
<br />
Set bootargs:<br />
<br />
setenv bootargs root=/dev/mmcblk0p2 rootwait panic=10<br />
<br />
Kernel Image loading and Device Tree files:<br />
<br />
ext4load mmc 0:1 ${kernel_addr_r} /Image <br />
ext4load mmc 0:1 ${fdt_addr_r} /sun50i-a64-pinephone.dtb <br />
<br />
Boot the kernel:<br />
<br />
booti ${kernel_addr_r} - ${fdt_addr_r}<br />
<br />
=== Automatic boot ===<br />
<br />
Create a <code>boot.cmd</code> file for the '''PinePhone''':<br />
<br />
echo Setting bootargs<br />
setenv bootargs console=tty0 console=ttyS0,115200 root=/dev/mmcblk0p2 no_console_suspend rootwait <br />
earlycon=uart,mmio32,0x01c28000 panic=10 consoleblank=0 loglevel=1<br />
printenv<br />
echo Loading DTB<br />
load mmc 0:1 ${fdt_addr_r} /sun50i-a64-pinephone.dtb<br />
echo Loading kernel Image<br />
load mmc 0:1 ${kernel_addr_r} /Image<br />
echo Booting kernel NOW<br />
booti ${kernel_addr_r} - ${fdt_addr_r}<br />
<br />
Create a <code>boot.cmd</code> file for the '''PineTab''':<br />
<br />
echo Setting bootargs<br />
setenv bootargs console=tty0 console=ttyS0,115200 root=/dev/mmcblk0p2 no_console_suspend rootwait <br />
earlycon=uart,mmio32,0x01c28000 panic=10 consoleblank=0 loglevel=1<br />
printenv<br />
echo Loading DTB<br />
load mmc 0:1 ${fdt_addr_r} /sun50i-a64-pinetab.dtb<br />
echo Loading kernel Image<br />
load mmc 0:1 ${kernel_addr_r} /Image<br />
echo Booting kernel NOW<br />
booti ${kernel_addr_r} - ${fdt_addr_r}<br />
<br />
Mount your <code>boot</code> partition and run the following command:<br />
sudo mkimage -C none -A arm -T script -d /mnt/boot.cmd /mnt/boot.scr<br />
<br />
This will translate the <code>boot.cmd</code> file into a U-boot script.<br />
<br />
If you don't have the <code>mkimage</code> command available, you can install it from the <code>uboot-tools</code> package.<br />
<br />
==Kernel==<br />
<br />
The PinePhone runs a mainline kernel, device tree modifications are done by all the PinePhone OS developers on Gitlab (https://gitlab.com/pine64-org/linux).<br />
<br />
=== Clone the kernel ===<br />
<br />
git clone https://gitlab.com/pine64-org/linux<br />
cd linux<br />
git checkout pine64-kernel<br />
<br />
=== Configure the kernel ===<br />
<br />
# <b>Copy our kernel config</b>: https://gitlab.com/pinephone-sailfish-os/linux-kernel/raw/master/pinephone-config<br />
# <b>Enter the <code>linux</code> project</b>: <code>cd linux</code><br />
# <b>Copy the config file</b> to <code>.config</code> in the main directory<br />
<br />
=== Build the kernel ===<br />
<br />
We cross compile the kernel for ARM64.<br />
The <code>LOCALVERSION</code> variable can be used to add a version to the build.<br />
<br />
Cross compile the kernel:<br />
export ARCH=arm64<br />
export CROSS_COMPILE=aarch64-linux-gnu-<br />
export LOCALVERSION=-nemo<br />
make clean<br />
make oldconfig<br />
make Image modules dtbs<br />
<br />
Install the kernel modules in a different path: <br />
make modules_install INSTALL_MOD_PATH=../linux_modules/<br />
<br />
=== Install kernel ===<br />
<br />
Copy the following things:<br />
<br />
# <b>Image</b> from <code>arch/arm64/boot/Image</code> to the root of the <code>boot</code> partition.<br />
# <b>Device tree files</b> <br />
For pinethone <code>arch/arm64/boot/dts/allwinner/sun50i-a64-pinephone.dtb</code> and <code>arch/arm64/boot/dts/allwinner/sun50i-a64-pinephone.dts</code> to the root of the <code>boot</code> partition.<br />
<br />
For pinetab <code>arch/arm64/boot/dts/allwinner/sun50i-a64-pinetab.dtb</code> and <code>arch/arm64/boot/dts/allwinner/sun50i-a64-pinetab.dts</code> to the root of the <code>boot</code> partition.<br />
# <b>Modules</b> from <code>../linux_modules</code> to <code>/lib/modules</code> on the <code>boot</code> partition.<br />
<br />
=== Wlan Module ===<br />
<br />
On PinePhone we have mainline kernel driver. But in PineTab we must use https://github.com/Icenowy/rtl8723cs driver.<br />
<br />
==Nemo Mobile==<br />
<br />
For build last release of nemo use this ks file https://gist.github.com/neochapay/8d40f9ee1e5fd621e0053aa126d39e81<br />
<br />
==Sailfish OS==<br />
<br />
===Github & OBS project===<br />
<br />
- https://github.com/sailfish-on-dontbeevil<br />
<br />
- https://build.merproject.org/project/show/nemo:devel:hw:pine:dontbeevil<br />
<br />
===Flash rootFS===<br />
You can download the latest rootFS from the Gitlab SailfishOS Porters CI: https://gitlab.com/sailfishos-porters-ci/dont_be_evil-ci (see the artifacts of the latest CI job).<br />
<br />
This <code>tar.gz</code> archive should be burned to the <code>data</code> partition of the SD card.<br />
It's important to burn it as the root user (not with sudo) to preserve extended attributes and ACLs: <br />
<br />
sudo su<br />
bsdtar -xpf <SAILFISH OS ROOTFS>.tar.bz2 -C <MOUNTPOINT OF /DATA><br />
<br />
===Device repos===<br />
To boot Lipstick, you need to add the device specific repos to the devkit.<br />
All the following commands are executed in a shell on the devkit.<br />
<br />
''Make sure you configure the ethernet interface first before you continue!''<br />
''You need to have access to the WWW to fetch the necessary repository data and packages.''<br />
<br />
Install zypper manually:<br />
curl -o augeas-lib.rpm http://repo.merproject.org/obs/mer:/core/latest_armv7hl/armv7hl/augeas-libs-1.6.0+git1-1.10.6.armv7hl.rpm<br />
curl -o zypper.rpm http://repo.merproject.org/obs/mer:/core/latest_armv7hl/armv7hl/zypper-1.14.6+git3-1.24.5.armv7hl.rpm<br />
rpm -Uvh *rpm<br />
<br />
Use <code>ssu</code> to add the repo<br />
ssu ar common http://repo.merproject.org/obs/nemo:/devel:/hw:/common/sailfish_latest_armv7hl/<br />
ssu ar dontbeevil http://repo.merproject.org/obs/home:/piggz:/dontbeevil/sailfishos_3.0.3.9_latest_armv7hl/<br />
ssu ar jolla https://releases.jolla.com/releases/3.0.3.9/jolla/armv7hl/<br />
<br />
Refresh the repo:<br />
zypper refresh<br />
<br />
Install the device packages:<br />
zypper install dontbeevil:qt5-qtcore dontbeevil:qt5-qttest dontbeevil:lipstick-qt5<br />
zypper install droid-config-dontbeevil # Select 1 for vendor change<br />
zypper install droid-config-dontbeevil-sailfish<br />
zypper install qt5-plugin-platform-eglfs # EGLFS LIMA plugin<br />
zypper install qt5-plugin-generic-evdev # evdev input plugins<br />
<br />
Other useful packages<br />
zypper install mce-tools #useful for mcetool (mcetool -U activates the screen)<br />
<br />
===Unknown password===<br />
The Sailfish OS rootFS sets a random password when booting for the first time.<br />
You can only log in through the <code>telnet</code> debug interface.<br />
Since the <code>eth0</code> interface still requires manually setup, you can't access <code>telnet</code>.<br />
<br />
To circumvent this issue, you can login through the UART TTY interface. <br />
However you don't know the password of the <code>root</code> nor <code>nemo</code> users!<br />
To disable the <code>root</code> and <code>nemo</code> passwords, we can modify the <code>/etc/shadow</code> file:<br />
<br />
sudo chmod +w <SD card data partition>/etc/shadow<br />
sudo vim <SD card data partition>/etc/shadow # Remove any characters where <HASHED PASSWORD> is written: user1:<HASHED PASSWORD>:16092:0:99999:7:::.<br />
sudo chmod -w <SD card data partition>/etc/shadow<br />
<br />
By removing the hashed password, we can login with the user without entering a password.<br />
You can set a new password afterwards by running as a logged in user:<br />
<br />
passwd<br />
<br />
===Init eth0===<br />
Enabling the <code>eth0</code> interface has to be done manually for now:<br />
<br />
ifconfig eth0 <YOUR_IP><br />
route add default gw <DEFAULT_GATEWAY_IP><br />
echo "nameserver <DNS_SERVER_IP>" > /etc/resolv.conf<br />
<br />
Test your configuration with <code>ping</code>:<br />
<br />
ping jolla.com<br />
<br />
<br />
===Lipstick crashing===<br />
<br />
Install Lipstick from the <code>dontbeevil</code> repository:<br />
<br />
zypper install dontbeevil:lipstick-qt5<br />
<br />
===No setup wizard===<br />
<br />
Make sure the configuration package is installed:<br />
<br />
zypper install droid-config-dontbeevil-sailfish<br />
<br />
===Missing regulatory.db for RT8723BS WiFi/BT module===<br />
<br />
git clone git://git.kernel.org/pub/scm/linux/kernel/git/sforshee/wireless-regdb.git<br />
cd wireless-regdb<br />
cp regulatory* /lib/firmware</div>Dylanvanasschttps://wiki.merproject.org/wiki/Adaptations/PinePhone64Adaptations/PinePhone642019-10-03T18:25:24Z<p>Dylanvanassc: /* Automatic boot */</p>
<hr />
<div>=Hardware Support=<br />
<br />
Full information of hardware spec [https://wiki.pine64.org/index.php/Project_Don't_be_evil Here]<br />
<br />
PostMarket OS hardware information [https://wiki.postmarketos.org/wiki/Pine_Don%27t_be_evil_devkit_(pine-dontbeevil) PostMarketOS Wiki]<br />
<br />
==Modem EC25==<br />
<br />
===Setup===<br />
<br />
1. Make sure that the <code>qmimodem</code> plugin is enabled in the <code>.spec</code> of <code>ofono</code>.<br />
<br />
2. Remove the <code>noplugin.conf</code> file under <code>/lib/environment/ofono/noplugin.conf</code>.<br />
<br />
3. Restart <code>ofono</code><br />
systemctl restart ofono<br />
<br />
4. Check if the QMI modem is properly detected:<br />
/usr/lib/ofono/test/list-modems<br />
<br />
5. Unlock you SIM card (if needed):<br />
/usr/lib/ofono/test/enter-pin /quectelqmi_0 pin <PIN CODE><br />
<br />
The EC25 Quectel modem is now ready :)<br />
Thanks to SuperPrower for the hard work!<br />
<br />
===Sending SMS===<br />
<br />
/usr/lib/ofono/test/send-sms <PHONE NUMBER RECEIVER> <MESSAGE> <DELIVERY REPORT><br />
<br />
To skip the delivery report, use <code>0</code> as argument.<br />
<br />
==Cameras==<br />
<br />
Thanks to: https://wiki.postmarketos.org/wiki/Pine_Don't_be_evil_devkit_(pine-dontbeevil)#Cameras<br />
Only the back camera is supported by the mainline kernel.<br />
To use it, you need to configure it first:<br />
<br />
media-ctl --set-v4l2 '"ov5640 2-003c":0[fmt:UYVY8_2X8/1280x7200]' -d /dev/media1<br />
<br />
Afterwards, you can take a picture with:<br />
<br />
ffmpeg -s 1280x720 -f video4linux2 -i /dev/video1 -vframes 1 selfie.jpg<br />
<br />
- <code>/dev/media1</code> is the controller interface of the back camera<br />
<br />
- <code>/dev/video1</code> is the back camera stream interface<br />
<br />
If that works, you can try <code>gstreamer</code> to make the camera available for system wide usage:]<br />
<br />
gst-launch-1.0 v4l2src device=/dev/video1 num-buffers=1 ! 'video/x-raw,format=UYVY,width=1280,height=720' ! jpegenc ! filesink location=selfie.jpg<br />
cp selfie.jpg /home/nemo/Pictures<br />
<br />
This command generates a <code>selfie.jpg</code> file and by copying it to <code>/home/nemo/Pictures</code> you can view it with the Gallery app.<br />
<br />
== Audio ==<br />
<br />
1. Unmuting the <code>AIF1 Slot 0 Digital DAC</code> channel using <code>alsamixer</code>. Use <code>m</code> to unmute.<br />
<br />
2. Copy the default PulseAudio config: <br />
cp /etc/pulse/default.pa /etc/pulse/arm_native_config.pa<br />
<br />
3. Enable ALSA modules in the new config:<br />
load-module module-alsa-sink<br />
load-module module-alsa-source device=hw:1,0<br />
They are commented out by default.<br />
<br />
4. Configure PulseAudio by changing <code>arm_droid_config.pa</code> to <code>/arm_native_config.pa</code> in <code>/etc/sysconfig/pulseaudio</code>.<br />
<br />
5. Restart PulseAudio or reboot.<br />
<br />
6. Go to the Settings app and test the sound output by playing a ringtone under Sounds and Feedback.<br />
<br />
==PineTab==<br />
<br />
In pinetab we have jack to uart port cable. For enable UART console move selector nearby sd-card slot away from sd-card slot.<br />
<br />
==Testing the vibrator motor==<br />
<br />
You need to have the <code>CONFIG_GPIO_SYSFS</code> enabled in your kernel config for this!<br />
<br />
Vibrator motor is on pin <code>PD2</code>.<br />
You can calculate the PIN number for PD2 as followed ([https://linux-sunxi.org/GPIO more information]):<br />
<code>(4-1) * 32 + 2 = 98</code><br />
<br />
echo "98" > /sys/class/gpio/export # Make pin available<br />
echo "out" > /sys/class/gpio/gpio98/direction # Set as output<br />
echo "1" > /sys/class/gpio/gpio98/value # On<br />
echo "1" > /sys/class/gpio/gpio98/value # Off<br />
echo "98" > /sys/class/gpio/unexport # When you're done<br />
<br />
==Notification LED==<br />
<br />
export COLOR=red # or green, blue is broken due to a hardware fault<br />
# Activate LED<br />
echo 1 > /sys/class/leds/$COLOR/brightness<br />
# Deactivate LED<br />
echo 0 > /sys/class/leds/$COLOR/brightness<br />
<br />
The LED can be controlled in Mer by MCE. You need the <code>mce-plugin-libhybris-nondroid</code> for this.<br />
<br />
=Installation=<br />
==Prepare SD card==<br />
<br />
Use GParted or any other tool to create the following <code>EXT4</code> partitions:<br />
<br />
# <b>boot</b>: Holds the mainline kernel Image and Device Tree files<br />
# <b>data</b>: Holds the Sailfish OS rootFS<br />
<br />
GParted will ask you to leave the first MB free of the SD card when creating the first partition, this is correct.<br />
This 1 MB will be used to store the U-boot boot loader.<br />
<br />
==U-Boot==<br />
<br />
We will now build the mainline U-boot boot loader from Git.<br />
<br />
=== Clone ARM Trusted Firmware (master branch) ===<br />
<br />
git clone https://github.com/ARM-software/arm-trusted-firmware.git<br />
<br />
=== Build the BL31.bin ===<br />
<br />
Follow the instructions here: https://github.com/u-boot/u-boot/blob/master/board/sunxi/README.sunxi64<br />
<br />
Quick start:<br />
<br />
export CROSS_COMPILE=aarch64-linux-gnu-<br />
ARCH=arm64 make PLAT=sun50i_a64 DEBUG=1 bl31<br />
export BL31=/path/to/bl31.bin<br />
<br />
=== Clone U-boot (master branch): ===<br />
<br />
You can find the U-boot mirror repository on Github:<br />
<br />
git clone https://github.com/u-boot/u-boot.git<br />
<br />
=== Compile U-boot ===<br />
<br />
You have to cross compile U-boot with the <code>arm64</code> arch:<br />
<br />
export CROSS_COMPILE=aarch64-linux-gnu-<br />
ARCH=arm64 make clean<br />
ARCH=arm64 make sopine_baseboard_defconfig<br />
ARCH=arm64 make<br />
<br />
The <code>sopine_baseboard_defconfig</code> is the same for the Don't Be Evil devkit.<br />
<br />
=== Burn U-boot to your SD card ===<br />
<br />
Copy the compiled U-boot bootloader to the first sector on your SD card:<br />
<br />
sudo dd if=u-boot-sunxi-with-spl.bin of=/dev/sdX bs=8k seek=1<br />
<br />
<br />
=== Manually loading the kernel ===<br />
<br />
Serial TTY Baudrate over UART = 115200 for screen, example: <code>screen /dev/ttyUSB0 115200</code><br />
You have to start screen first, before turning on the devkit.<br />
<br />
Interrupt the U-boot autoboot process when you see a message in the U-boot prompt. <br />
We need to access the U-boot prompt to load the Kernel image and boot it manually!<br />
<br />
Set bootargs:<br />
<br />
setenv bootargs root=/dev/mmcblk0p2 rootwait panic=10<br />
<br />
Kernel Image loading and Device Tree files:<br />
<br />
ext4load mmc 0:1 ${kernel_addr_r} /Image <br />
ext4load mmc 0:1 ${fdt_addr_r} /sun50i-a64-pinephone.dtb <br />
<br />
Boot the kernel:<br />
<br />
booti ${kernel_addr_r} - ${fdt_addr_r}<br />
<br />
=== Automatic boot ===<br />
<br />
Create a <code>boot.cmd</code> file for the '''PinePhone''':<br />
<br />
echo Setting bootargs<br />
setenv bootargs console=tty0 console=ttyS0,115200 root=/dev/mmcblk0p2 no_console_suspend rootwait <br />
earlycon=uart,mmio32,0x01c28000 panic=10 consoleblank=0 loglevel=1<br />
printenv<br />
echo Loading DTB<br />
load mmc 0:1 ${fdt_addr_r} /sun50i-a64-pinephone.dtb<br />
echo Loading kernel Image<br />
load mmc 0:1 ${kernel_addr_r} /Image<br />
echo Booting kernel NOW<br />
booti ${kernel_addr_r} - ${fdt_addr_r}<br />
<br />
Create a <code>boot.cmd</code> file for the '''PineTab''':<br />
<br />
echo Setting bootargs<br />
setenv bootargs console=tty0 console=ttyS0,115200 root=/dev/mmcblk0p2 no_console_suspend rootwait <br />
earlycon=uart,mmio32,0x01c28000 panic=10 consoleblank=0 loglevel=1<br />
printenv<br />
echo Loading DTB<br />
load mmc 0:1 ${fdt_addr_r} /sun50i-a64-pinetab.dtb<br />
echo Loading kernel Image<br />
load mmc 0:1 ${kernel_addr_r} /Image<br />
echo Booting kernel NOW<br />
booti ${kernel_addr_r} - ${fdt_addr_r}<br />
<br />
Mount your <code>boot</code> partition and run the following command:<br />
sudo mkimage -C none -A arm -T script -d /mnt/boot.cmd /mnt/boot.scr<br />
<br />
This will translate the <code>boot.cmd</code> file into a U-boot script.<br />
<br />
If you don't have the <code>mkimage</code> command available, you can install it from the <code>uboot-tools</code> package.<br />
<br />
==Kernel==<br />
<br />
The PinePhone runs a mainline kernel, device tree modifications are done by all the PinePhone OS developers on Gitlab (https://gitlab.com/pine64-org/linux).<br />
<br />
=== Clone the kernel ===<br />
<br />
git clone https://gitlab.com/pine64-org/linux<br />
cd linux<br />
git checkout pine64-kernel<br />
<br />
=== Configure the kernel ===<br />
<br />
# <b>Copy our kernel config</b>: https://gitlab.com/pinephone-sailfish-os/linux-kernel/raw/master/pinephone-config<br />
# <b>Enter the <code>linux</code> project</b>: <code>cd linux</code><br />
# <b>Copy the config file</b> to <code>.config</code> in the main directory<br />
<br />
=== Build the kernel ===<br />
<br />
We cross compile the kernel for ARM64.<br />
The <code>LOCALVERSION</code> variable can be used to add a version to the build.<br />
<br />
Cross compile the kernel:<br />
export ARCH=arm64<br />
export CROSS_COMPILE=aarch64-linux-gnu-<br />
export LOCALVERSION=-nemo<br />
make clean<br />
make oldconfig<br />
make Image modules dtbs<br />
<br />
Install the kernel modules in a different path: <br />
make modules_install INSTALL_MOD_PATH=../linux_modules/<br />
<br />
=== Install kernel ===<br />
<br />
Copy the following things:<br />
<br />
# <b>Image</b> from <code>arch/arm64/boot/Image</code> to the root of the <code>boot</code> partition.<br />
# <b>Device tree files</b> <br />
For pinethone <code>arch/arm64/boot/dts/allwinner/sun50i-a64-pinephone.dtb</code> and <code>arch/arm64/boot/dts/allwinner/sun50i-a64-pinephone.dts</code> to the root of the <code>boot</code> partition.<br />
<br />
For pinetab <code>arch/arm64/boot/dts/allwinner/sun50i-a64-pinetab.dtb</code> and <code>arch/arm64/boot/dts/allwinner/sun50i-a64-pinetab.dts</code> to the root of the <code>boot</code> partition.<br />
# <b>Modules</b> from <code>../linux_modules</code> to <code>/lib/modules</code> on the <code>boot</code> partition.<br />
<br />
=== Wlan Module ===<br />
<br />
On PinePhone we have mainline kernel driver. But in PineTab we must use https://github.com/Icenowy/rtl8723cs driver.<br />
<br />
==Nemo Mobile==<br />
<br />
For build last release of nemo use this ks file https://gist.github.com/neochapay/8d40f9ee1e5fd621e0053aa126d39e81<br />
<br />
==Sailfish OS==<br />
<br />
===Github & OBS project===<br />
<br />
- https://github.com/sailfish-on-dontbeevil<br />
<br />
- https://build.merproject.org/project/show/nemo:devel:hw:pine:dontbeevil<br />
<br />
===Flash rootFS===<br />
You can download the latest rootFS from the Gitlab SailfishOS Porters CI: https://gitlab.com/sailfishos-porters-ci/dont_be_evil-ci (see the artifacts of the latest CI job).<br />
<br />
This <code>tar.gz</code> archive should be burned to the <code>data</code> partition of the SD card.<br />
It's important to burn it as the root user (not with sudo) to preserve extended attributes and ACLs: <br />
<br />
sudo su<br />
bsdtar -xpf <SAILFISH OS ROOTFS>.tar.bz2 -C <MOUNTPOINT OF /DATA><br />
<br />
===Device repos===<br />
To boot Lipstick, you need to add the device specific repos to the devkit.<br />
All the following commands are executed in a shell on the devkit.<br />
<br />
''Make sure you configure the ethernet interface first before you continue!''<br />
''You need to have access to the WWW to fetch the necessary repository data and packages.''<br />
<br />
Install zypper manually:<br />
curl -o augeas-lib.rpm http://repo.merproject.org/obs/mer:/core/latest_armv7hl/armv7hl/augeas-libs-1.6.0+git1-1.10.6.armv7hl.rpm<br />
curl -o zypper.rpm http://repo.merproject.org/obs/mer:/core/latest_armv7hl/armv7hl/zypper-1.14.6+git3-1.24.5.armv7hl.rpm<br />
rpm -Uvh *rpm<br />
<br />
Use <code>ssu</code> to add the repo<br />
ssu ar common http://repo.merproject.org/obs/nemo:/devel:/hw:/common/sailfish_latest_armv7hl/<br />
ssu ar dontbeevil http://repo.merproject.org/obs/home:/piggz:/dontbeevil/sailfishos_3.0.3.9_latest_armv7hl/<br />
ssu ar jolla https://releases.jolla.com/releases/3.0.3.9/jolla/armv7hl/<br />
<br />
Refresh the repo:<br />
zypper refresh<br />
<br />
Install the device packages:<br />
zypper install dontbeevil:qt5-qtcore dontbeevil:qt5-qttest dontbeevil:lipstick-qt5<br />
zypper install droid-config-dontbeevil # Select 1 for vendor change<br />
zypper install droid-config-dontbeevil-sailfish<br />
zypper install qt5-plugin-platform-eglfs # EGLFS LIMA plugin<br />
zypper install qt5-plugin-generic-evdev # evdev input plugins<br />
<br />
Other useful packages<br />
zypper install mce-tools #useful for mcetool (mcetool -U activates the screen)<br />
<br />
===Unknown password===<br />
The Sailfish OS rootFS sets a random password when booting for the first time.<br />
You can only log in through the <code>telnet</code> debug interface.<br />
Since the <code>eth0</code> interface still requires manually setup, you can't access <code>telnet</code>.<br />
<br />
To circumvent this issue, you can login through the UART TTY interface. <br />
However you don't know the password of the <code>root</code> nor <code>nemo</code> users!<br />
To disable the <code>root</code> and <code>nemo</code> passwords, we can modify the <code>/etc/shadow</code> file:<br />
<br />
sudo chmod +w <SD card data partition>/etc/shadow<br />
sudo vim <SD card data partition>/etc/shadow # Remove any characters where <HASHED PASSWORD> is written: user1:<HASHED PASSWORD>:16092:0:99999:7:::.<br />
sudo chmod -w <SD card data partition>/etc/shadow<br />
<br />
By removing the hashed password, we can login with the user without entering a password.<br />
You can set a new password afterwards by running as a logged in user:<br />
<br />
passwd<br />
<br />
===Init eth0===<br />
Enabling the <code>eth0</code> interface has to be done manually for now:<br />
<br />
ifconfig eth0 <YOUR_IP><br />
route add default gw <DEFAULT_GATEWAY_IP><br />
echo "nameserver <DNS_SERVER_IP>" > /etc/resolv.conf<br />
<br />
Test your configuration with <code>ping</code>:<br />
<br />
ping jolla.com<br />
<br />
<br />
===Lipstick crashing===<br />
<br />
Install Lipstick from the <code>dontbeevil</code> repository:<br />
<br />
zypper install dontbeevil:lipstick-qt5<br />
<br />
===No setup wizard===<br />
<br />
Make sure the configuration package is installed:<br />
<br />
zypper install droid-config-dontbeevil-sailfish<br />
<br />
===Missing regulatory.db for RT8723BS WiFi/BT module===<br />
<br />
git clone git://git.kernel.org/pub/scm/linux/kernel/git/sforshee/wireless-regdb.git<br />
cd wireless-regdb<br />
cp regulatory* /lib/firmware</div>Dylanvanasschttps://wiki.merproject.org/wiki/Adaptations/PinePhone64Adaptations/PinePhone642019-10-03T18:23:21Z<p>Dylanvanassc: /* Build the BL31.bin */</p>
<hr />
<div>=Hardware Support=<br />
<br />
Full information of hardware spec [https://wiki.pine64.org/index.php/Project_Don't_be_evil Here]<br />
<br />
PostMarket OS hardware information [https://wiki.postmarketos.org/wiki/Pine_Don%27t_be_evil_devkit_(pine-dontbeevil) PostMarketOS Wiki]<br />
<br />
==Modem EC25==<br />
<br />
===Setup===<br />
<br />
1. Make sure that the <code>qmimodem</code> plugin is enabled in the <code>.spec</code> of <code>ofono</code>.<br />
<br />
2. Remove the <code>noplugin.conf</code> file under <code>/lib/environment/ofono/noplugin.conf</code>.<br />
<br />
3. Restart <code>ofono</code><br />
systemctl restart ofono<br />
<br />
4. Check if the QMI modem is properly detected:<br />
/usr/lib/ofono/test/list-modems<br />
<br />
5. Unlock you SIM card (if needed):<br />
/usr/lib/ofono/test/enter-pin /quectelqmi_0 pin <PIN CODE><br />
<br />
The EC25 Quectel modem is now ready :)<br />
Thanks to SuperPrower for the hard work!<br />
<br />
===Sending SMS===<br />
<br />
/usr/lib/ofono/test/send-sms <PHONE NUMBER RECEIVER> <MESSAGE> <DELIVERY REPORT><br />
<br />
To skip the delivery report, use <code>0</code> as argument.<br />
<br />
==Cameras==<br />
<br />
Thanks to: https://wiki.postmarketos.org/wiki/Pine_Don't_be_evil_devkit_(pine-dontbeevil)#Cameras<br />
Only the back camera is supported by the mainline kernel.<br />
To use it, you need to configure it first:<br />
<br />
media-ctl --set-v4l2 '"ov5640 2-003c":0[fmt:UYVY8_2X8/1280x7200]' -d /dev/media1<br />
<br />
Afterwards, you can take a picture with:<br />
<br />
ffmpeg -s 1280x720 -f video4linux2 -i /dev/video1 -vframes 1 selfie.jpg<br />
<br />
- <code>/dev/media1</code> is the controller interface of the back camera<br />
<br />
- <code>/dev/video1</code> is the back camera stream interface<br />
<br />
If that works, you can try <code>gstreamer</code> to make the camera available for system wide usage:]<br />
<br />
gst-launch-1.0 v4l2src device=/dev/video1 num-buffers=1 ! 'video/x-raw,format=UYVY,width=1280,height=720' ! jpegenc ! filesink location=selfie.jpg<br />
cp selfie.jpg /home/nemo/Pictures<br />
<br />
This command generates a <code>selfie.jpg</code> file and by copying it to <code>/home/nemo/Pictures</code> you can view it with the Gallery app.<br />
<br />
== Audio ==<br />
<br />
1. Unmuting the <code>AIF1 Slot 0 Digital DAC</code> channel using <code>alsamixer</code>. Use <code>m</code> to unmute.<br />
<br />
2. Copy the default PulseAudio config: <br />
cp /etc/pulse/default.pa /etc/pulse/arm_native_config.pa<br />
<br />
3. Enable ALSA modules in the new config:<br />
load-module module-alsa-sink<br />
load-module module-alsa-source device=hw:1,0<br />
They are commented out by default.<br />
<br />
4. Configure PulseAudio by changing <code>arm_droid_config.pa</code> to <code>/arm_native_config.pa</code> in <code>/etc/sysconfig/pulseaudio</code>.<br />
<br />
5. Restart PulseAudio or reboot.<br />
<br />
6. Go to the Settings app and test the sound output by playing a ringtone under Sounds and Feedback.<br />
<br />
==PineTab==<br />
<br />
In pinetab we have jack to uart port cable. For enable UART console move selector nearby sd-card slot away from sd-card slot.<br />
<br />
==Testing the vibrator motor==<br />
<br />
You need to have the <code>CONFIG_GPIO_SYSFS</code> enabled in your kernel config for this!<br />
<br />
Vibrator motor is on pin <code>PD2</code>.<br />
You can calculate the PIN number for PD2 as followed ([https://linux-sunxi.org/GPIO more information]):<br />
<code>(4-1) * 32 + 2 = 98</code><br />
<br />
echo "98" > /sys/class/gpio/export # Make pin available<br />
echo "out" > /sys/class/gpio/gpio98/direction # Set as output<br />
echo "1" > /sys/class/gpio/gpio98/value # On<br />
echo "1" > /sys/class/gpio/gpio98/value # Off<br />
echo "98" > /sys/class/gpio/unexport # When you're done<br />
<br />
==Notification LED==<br />
<br />
export COLOR=red # or green, blue is broken due to a hardware fault<br />
# Activate LED<br />
echo 1 > /sys/class/leds/$COLOR/brightness<br />
# Deactivate LED<br />
echo 0 > /sys/class/leds/$COLOR/brightness<br />
<br />
The LED can be controlled in Mer by MCE. You need the <code>mce-plugin-libhybris-nondroid</code> for this.<br />
<br />
=Installation=<br />
==Prepare SD card==<br />
<br />
Use GParted or any other tool to create the following <code>EXT4</code> partitions:<br />
<br />
# <b>boot</b>: Holds the mainline kernel Image and Device Tree files<br />
# <b>data</b>: Holds the Sailfish OS rootFS<br />
<br />
GParted will ask you to leave the first MB free of the SD card when creating the first partition, this is correct.<br />
This 1 MB will be used to store the U-boot boot loader.<br />
<br />
==U-Boot==<br />
<br />
We will now build the mainline U-boot boot loader from Git.<br />
<br />
=== Clone ARM Trusted Firmware (master branch) ===<br />
<br />
git clone https://github.com/ARM-software/arm-trusted-firmware.git<br />
<br />
=== Build the BL31.bin ===<br />
<br />
Follow the instructions here: https://github.com/u-boot/u-boot/blob/master/board/sunxi/README.sunxi64<br />
<br />
Quick start:<br />
<br />
export CROSS_COMPILE=aarch64-linux-gnu-<br />
ARCH=arm64 make PLAT=sun50i_a64 DEBUG=1 bl31<br />
export BL31=/path/to/bl31.bin<br />
<br />
=== Clone U-boot (master branch): ===<br />
<br />
You can find the U-boot mirror repository on Github:<br />
<br />
git clone https://github.com/u-boot/u-boot.git<br />
<br />
=== Compile U-boot ===<br />
<br />
You have to cross compile U-boot with the <code>arm64</code> arch:<br />
<br />
export CROSS_COMPILE=aarch64-linux-gnu-<br />
ARCH=arm64 make clean<br />
ARCH=arm64 make sopine_baseboard_defconfig<br />
ARCH=arm64 make<br />
<br />
The <code>sopine_baseboard_defconfig</code> is the same for the Don't Be Evil devkit.<br />
<br />
=== Burn U-boot to your SD card ===<br />
<br />
Copy the compiled U-boot bootloader to the first sector on your SD card:<br />
<br />
sudo dd if=u-boot-sunxi-with-spl.bin of=/dev/sdX bs=8k seek=1<br />
<br />
<br />
=== Manually loading the kernel ===<br />
<br />
Serial TTY Baudrate over UART = 115200 for screen, example: <code>screen /dev/ttyUSB0 115200</code><br />
You have to start screen first, before turning on the devkit.<br />
<br />
Interrupt the U-boot autoboot process when you see a message in the U-boot prompt. <br />
We need to access the U-boot prompt to load the Kernel image and boot it manually!<br />
<br />
Set bootargs:<br />
<br />
setenv bootargs root=/dev/mmcblk0p2 rootwait panic=10<br />
<br />
Kernel Image loading and Device Tree files:<br />
<br />
ext4load mmc 0:1 ${kernel_addr_r} /Image <br />
ext4load mmc 0:1 ${fdt_addr_r} /sun50i-a64-pinephone.dtb <br />
<br />
Boot the kernel:<br />
<br />
booti ${kernel_addr_r} - ${fdt_addr_r}<br />
<br />
=== Automatic boot ===<br />
<br />
Create a <code>boot.cmd</code> file:<br />
<br />
echo Setting bootargs<br />
setenv bootargs console=tty0 console=ttyS0,115200 root=/dev/mmcblk0p2 no_console_suspend rootwait <br />
earlycon=uart,mmio32,0x01c28000 panic=10 consoleblank=0 loglevel=1<br />
printenv<br />
echo Loading DTB<br />
load mmc 0:1 ${fdt_addr_r} /sun50i-a64-pinephone.dtb<br />
echo Loading kernel Image<br />
load mmc 0:1 ${kernel_addr_r} /Image<br />
echo Booting kernel NOW<br />
booti ${kernel_addr_r} - ${fdt_addr_r}<br />
<br />
Mount your <code>boot</code> partition and run the following command:<br />
sudo mkimage -C none -A arm -T script -d /mnt/boot.cmd /mnt/boot.scr<br />
<br />
This will translate the <code>boot.cmd</code> file into a U-boot script.<br />
<br />
If you don't have the <code>mkimage</code> command available, you can install it from the <code>uboot-tools</code> package.<br />
<br />
==Kernel==<br />
<br />
The PinePhone runs a mainline kernel, device tree modifications are done by all the PinePhone OS developers on Gitlab (https://gitlab.com/pine64-org/linux).<br />
<br />
=== Clone the kernel ===<br />
<br />
git clone https://gitlab.com/pine64-org/linux<br />
cd linux<br />
git checkout pine64-kernel<br />
<br />
=== Configure the kernel ===<br />
<br />
# <b>Copy our kernel config</b>: https://gitlab.com/pinephone-sailfish-os/linux-kernel/raw/master/pinephone-config<br />
# <b>Enter the <code>linux</code> project</b>: <code>cd linux</code><br />
# <b>Copy the config file</b> to <code>.config</code> in the main directory<br />
<br />
=== Build the kernel ===<br />
<br />
We cross compile the kernel for ARM64.<br />
The <code>LOCALVERSION</code> variable can be used to add a version to the build.<br />
<br />
Cross compile the kernel:<br />
export ARCH=arm64<br />
export CROSS_COMPILE=aarch64-linux-gnu-<br />
export LOCALVERSION=-nemo<br />
make clean<br />
make oldconfig<br />
make Image modules dtbs<br />
<br />
Install the kernel modules in a different path: <br />
make modules_install INSTALL_MOD_PATH=../linux_modules/<br />
<br />
=== Install kernel ===<br />
<br />
Copy the following things:<br />
<br />
# <b>Image</b> from <code>arch/arm64/boot/Image</code> to the root of the <code>boot</code> partition.<br />
# <b>Device tree files</b> <br />
For pinethone <code>arch/arm64/boot/dts/allwinner/sun50i-a64-pinephone.dtb</code> and <code>arch/arm64/boot/dts/allwinner/sun50i-a64-pinephone.dts</code> to the root of the <code>boot</code> partition.<br />
<br />
For pinetab <code>arch/arm64/boot/dts/allwinner/sun50i-a64-pinetab.dtb</code> and <code>arch/arm64/boot/dts/allwinner/sun50i-a64-pinetab.dts</code> to the root of the <code>boot</code> partition.<br />
# <b>Modules</b> from <code>../linux_modules</code> to <code>/lib/modules</code> on the <code>boot</code> partition.<br />
<br />
=== Wlan Module ===<br />
<br />
On PinePhone we have mainline kernel driver. But in PineTab we must use https://github.com/Icenowy/rtl8723cs driver.<br />
<br />
==Nemo Mobile==<br />
<br />
For build last release of nemo use this ks file https://gist.github.com/neochapay/8d40f9ee1e5fd621e0053aa126d39e81<br />
<br />
==Sailfish OS==<br />
<br />
===Github & OBS project===<br />
<br />
- https://github.com/sailfish-on-dontbeevil<br />
<br />
- https://build.merproject.org/project/show/nemo:devel:hw:pine:dontbeevil<br />
<br />
===Flash rootFS===<br />
You can download the latest rootFS from the Gitlab SailfishOS Porters CI: https://gitlab.com/sailfishos-porters-ci/dont_be_evil-ci (see the artifacts of the latest CI job).<br />
<br />
This <code>tar.gz</code> archive should be burned to the <code>data</code> partition of the SD card.<br />
It's important to burn it as the root user (not with sudo) to preserve extended attributes and ACLs: <br />
<br />
sudo su<br />
bsdtar -xpf <SAILFISH OS ROOTFS>.tar.bz2 -C <MOUNTPOINT OF /DATA><br />
<br />
===Device repos===<br />
To boot Lipstick, you need to add the device specific repos to the devkit.<br />
All the following commands are executed in a shell on the devkit.<br />
<br />
''Make sure you configure the ethernet interface first before you continue!''<br />
''You need to have access to the WWW to fetch the necessary repository data and packages.''<br />
<br />
Install zypper manually:<br />
curl -o augeas-lib.rpm http://repo.merproject.org/obs/mer:/core/latest_armv7hl/armv7hl/augeas-libs-1.6.0+git1-1.10.6.armv7hl.rpm<br />
curl -o zypper.rpm http://repo.merproject.org/obs/mer:/core/latest_armv7hl/armv7hl/zypper-1.14.6+git3-1.24.5.armv7hl.rpm<br />
rpm -Uvh *rpm<br />
<br />
Use <code>ssu</code> to add the repo<br />
ssu ar common http://repo.merproject.org/obs/nemo:/devel:/hw:/common/sailfish_latest_armv7hl/<br />
ssu ar dontbeevil http://repo.merproject.org/obs/home:/piggz:/dontbeevil/sailfishos_3.0.3.9_latest_armv7hl/<br />
ssu ar jolla https://releases.jolla.com/releases/3.0.3.9/jolla/armv7hl/<br />
<br />
Refresh the repo:<br />
zypper refresh<br />
<br />
Install the device packages:<br />
zypper install dontbeevil:qt5-qtcore dontbeevil:qt5-qttest dontbeevil:lipstick-qt5<br />
zypper install droid-config-dontbeevil # Select 1 for vendor change<br />
zypper install droid-config-dontbeevil-sailfish<br />
zypper install qt5-plugin-platform-eglfs # EGLFS LIMA plugin<br />
zypper install qt5-plugin-generic-evdev # evdev input plugins<br />
<br />
Other useful packages<br />
zypper install mce-tools #useful for mcetool (mcetool -U activates the screen)<br />
<br />
===Unknown password===<br />
The Sailfish OS rootFS sets a random password when booting for the first time.<br />
You can only log in through the <code>telnet</code> debug interface.<br />
Since the <code>eth0</code> interface still requires manually setup, you can't access <code>telnet</code>.<br />
<br />
To circumvent this issue, you can login through the UART TTY interface. <br />
However you don't know the password of the <code>root</code> nor <code>nemo</code> users!<br />
To disable the <code>root</code> and <code>nemo</code> passwords, we can modify the <code>/etc/shadow</code> file:<br />
<br />
sudo chmod +w <SD card data partition>/etc/shadow<br />
sudo vim <SD card data partition>/etc/shadow # Remove any characters where <HASHED PASSWORD> is written: user1:<HASHED PASSWORD>:16092:0:99999:7:::.<br />
sudo chmod -w <SD card data partition>/etc/shadow<br />
<br />
By removing the hashed password, we can login with the user without entering a password.<br />
You can set a new password afterwards by running as a logged in user:<br />
<br />
passwd<br />
<br />
===Init eth0===<br />
Enabling the <code>eth0</code> interface has to be done manually for now:<br />
<br />
ifconfig eth0 <YOUR_IP><br />
route add default gw <DEFAULT_GATEWAY_IP><br />
echo "nameserver <DNS_SERVER_IP>" > /etc/resolv.conf<br />
<br />
Test your configuration with <code>ping</code>:<br />
<br />
ping jolla.com<br />
<br />
<br />
===Lipstick crashing===<br />
<br />
Install Lipstick from the <code>dontbeevil</code> repository:<br />
<br />
zypper install dontbeevil:lipstick-qt5<br />
<br />
===No setup wizard===<br />
<br />
Make sure the configuration package is installed:<br />
<br />
zypper install droid-config-dontbeevil-sailfish<br />
<br />
===Missing regulatory.db for RT8723BS WiFi/BT module===<br />
<br />
git clone git://git.kernel.org/pub/scm/linux/kernel/git/sforshee/wireless-regdb.git<br />
cd wireless-regdb<br />
cp regulatory* /lib/firmware</div>Dylanvanasschttps://wiki.merproject.org/wiki/Adaptations/PinePhone64Adaptations/PinePhone642019-10-03T18:23:07Z<p>Dylanvanassc: /* Build the BL31.bin */</p>
<hr />
<div>=Hardware Support=<br />
<br />
Full information of hardware spec [https://wiki.pine64.org/index.php/Project_Don't_be_evil Here]<br />
<br />
PostMarket OS hardware information [https://wiki.postmarketos.org/wiki/Pine_Don%27t_be_evil_devkit_(pine-dontbeevil) PostMarketOS Wiki]<br />
<br />
==Modem EC25==<br />
<br />
===Setup===<br />
<br />
1. Make sure that the <code>qmimodem</code> plugin is enabled in the <code>.spec</code> of <code>ofono</code>.<br />
<br />
2. Remove the <code>noplugin.conf</code> file under <code>/lib/environment/ofono/noplugin.conf</code>.<br />
<br />
3. Restart <code>ofono</code><br />
systemctl restart ofono<br />
<br />
4. Check if the QMI modem is properly detected:<br />
/usr/lib/ofono/test/list-modems<br />
<br />
5. Unlock you SIM card (if needed):<br />
/usr/lib/ofono/test/enter-pin /quectelqmi_0 pin <PIN CODE><br />
<br />
The EC25 Quectel modem is now ready :)<br />
Thanks to SuperPrower for the hard work!<br />
<br />
===Sending SMS===<br />
<br />
/usr/lib/ofono/test/send-sms <PHONE NUMBER RECEIVER> <MESSAGE> <DELIVERY REPORT><br />
<br />
To skip the delivery report, use <code>0</code> as argument.<br />
<br />
==Cameras==<br />
<br />
Thanks to: https://wiki.postmarketos.org/wiki/Pine_Don't_be_evil_devkit_(pine-dontbeevil)#Cameras<br />
Only the back camera is supported by the mainline kernel.<br />
To use it, you need to configure it first:<br />
<br />
media-ctl --set-v4l2 '"ov5640 2-003c":0[fmt:UYVY8_2X8/1280x7200]' -d /dev/media1<br />
<br />
Afterwards, you can take a picture with:<br />
<br />
ffmpeg -s 1280x720 -f video4linux2 -i /dev/video1 -vframes 1 selfie.jpg<br />
<br />
- <code>/dev/media1</code> is the controller interface of the back camera<br />
<br />
- <code>/dev/video1</code> is the back camera stream interface<br />
<br />
If that works, you can try <code>gstreamer</code> to make the camera available for system wide usage:]<br />
<br />
gst-launch-1.0 v4l2src device=/dev/video1 num-buffers=1 ! 'video/x-raw,format=UYVY,width=1280,height=720' ! jpegenc ! filesink location=selfie.jpg<br />
cp selfie.jpg /home/nemo/Pictures<br />
<br />
This command generates a <code>selfie.jpg</code> file and by copying it to <code>/home/nemo/Pictures</code> you can view it with the Gallery app.<br />
<br />
== Audio ==<br />
<br />
1. Unmuting the <code>AIF1 Slot 0 Digital DAC</code> channel using <code>alsamixer</code>. Use <code>m</code> to unmute.<br />
<br />
2. Copy the default PulseAudio config: <br />
cp /etc/pulse/default.pa /etc/pulse/arm_native_config.pa<br />
<br />
3. Enable ALSA modules in the new config:<br />
load-module module-alsa-sink<br />
load-module module-alsa-source device=hw:1,0<br />
They are commented out by default.<br />
<br />
4. Configure PulseAudio by changing <code>arm_droid_config.pa</code> to <code>/arm_native_config.pa</code> in <code>/etc/sysconfig/pulseaudio</code>.<br />
<br />
5. Restart PulseAudio or reboot.<br />
<br />
6. Go to the Settings app and test the sound output by playing a ringtone under Sounds and Feedback.<br />
<br />
==PineTab==<br />
<br />
In pinetab we have jack to uart port cable. For enable UART console move selector nearby sd-card slot away from sd-card slot.<br />
<br />
==Testing the vibrator motor==<br />
<br />
You need to have the <code>CONFIG_GPIO_SYSFS</code> enabled in your kernel config for this!<br />
<br />
Vibrator motor is on pin <code>PD2</code>.<br />
You can calculate the PIN number for PD2 as followed ([https://linux-sunxi.org/GPIO more information]):<br />
<code>(4-1) * 32 + 2 = 98</code><br />
<br />
echo "98" > /sys/class/gpio/export # Make pin available<br />
echo "out" > /sys/class/gpio/gpio98/direction # Set as output<br />
echo "1" > /sys/class/gpio/gpio98/value # On<br />
echo "1" > /sys/class/gpio/gpio98/value # Off<br />
echo "98" > /sys/class/gpio/unexport # When you're done<br />
<br />
==Notification LED==<br />
<br />
export COLOR=red # or green, blue is broken due to a hardware fault<br />
# Activate LED<br />
echo 1 > /sys/class/leds/$COLOR/brightness<br />
# Deactivate LED<br />
echo 0 > /sys/class/leds/$COLOR/brightness<br />
<br />
The LED can be controlled in Mer by MCE. You need the <code>mce-plugin-libhybris-nondroid</code> for this.<br />
<br />
=Installation=<br />
==Prepare SD card==<br />
<br />
Use GParted or any other tool to create the following <code>EXT4</code> partitions:<br />
<br />
# <b>boot</b>: Holds the mainline kernel Image and Device Tree files<br />
# <b>data</b>: Holds the Sailfish OS rootFS<br />
<br />
GParted will ask you to leave the first MB free of the SD card when creating the first partition, this is correct.<br />
This 1 MB will be used to store the U-boot boot loader.<br />
<br />
==U-Boot==<br />
<br />
We will now build the mainline U-boot boot loader from Git.<br />
<br />
=== Clone ARM Trusted Firmware (master branch) ===<br />
<br />
git clone https://github.com/ARM-software/arm-trusted-firmware.git<br />
<br />
=== Build the BL31.bin ===<br />
<br />
Follow the instructions here: https://github.com/u-boot/u-boot/blob/master/board/sunxi/README.sunxi64<br />
<br />
Quick start:<br />
<br />
- Build the ARM Trusted Firmware binary (see "ARM Trusted Firmware (ATF)" below)<br />
<br />
export CROSS_COMPILE=aarch64-linux-gnu-<br />
ARCH=arm64 make PLAT=sun50i_a64 DEBUG=1 bl31<br />
export BL31=/path/to/bl31.bin<br />
<br />
=== Clone U-boot (master branch): ===<br />
<br />
You can find the U-boot mirror repository on Github:<br />
<br />
git clone https://github.com/u-boot/u-boot.git<br />
<br />
=== Compile U-boot ===<br />
<br />
You have to cross compile U-boot with the <code>arm64</code> arch:<br />
<br />
export CROSS_COMPILE=aarch64-linux-gnu-<br />
ARCH=arm64 make clean<br />
ARCH=arm64 make sopine_baseboard_defconfig<br />
ARCH=arm64 make<br />
<br />
The <code>sopine_baseboard_defconfig</code> is the same for the Don't Be Evil devkit.<br />
<br />
=== Burn U-boot to your SD card ===<br />
<br />
Copy the compiled U-boot bootloader to the first sector on your SD card:<br />
<br />
sudo dd if=u-boot-sunxi-with-spl.bin of=/dev/sdX bs=8k seek=1<br />
<br />
<br />
=== Manually loading the kernel ===<br />
<br />
Serial TTY Baudrate over UART = 115200 for screen, example: <code>screen /dev/ttyUSB0 115200</code><br />
You have to start screen first, before turning on the devkit.<br />
<br />
Interrupt the U-boot autoboot process when you see a message in the U-boot prompt. <br />
We need to access the U-boot prompt to load the Kernel image and boot it manually!<br />
<br />
Set bootargs:<br />
<br />
setenv bootargs root=/dev/mmcblk0p2 rootwait panic=10<br />
<br />
Kernel Image loading and Device Tree files:<br />
<br />
ext4load mmc 0:1 ${kernel_addr_r} /Image <br />
ext4load mmc 0:1 ${fdt_addr_r} /sun50i-a64-pinephone.dtb <br />
<br />
Boot the kernel:<br />
<br />
booti ${kernel_addr_r} - ${fdt_addr_r}<br />
<br />
=== Automatic boot ===<br />
<br />
Create a <code>boot.cmd</code> file:<br />
<br />
echo Setting bootargs<br />
setenv bootargs console=tty0 console=ttyS0,115200 root=/dev/mmcblk0p2 no_console_suspend rootwait <br />
earlycon=uart,mmio32,0x01c28000 panic=10 consoleblank=0 loglevel=1<br />
printenv<br />
echo Loading DTB<br />
load mmc 0:1 ${fdt_addr_r} /sun50i-a64-pinephone.dtb<br />
echo Loading kernel Image<br />
load mmc 0:1 ${kernel_addr_r} /Image<br />
echo Booting kernel NOW<br />
booti ${kernel_addr_r} - ${fdt_addr_r}<br />
<br />
Mount your <code>boot</code> partition and run the following command:<br />
sudo mkimage -C none -A arm -T script -d /mnt/boot.cmd /mnt/boot.scr<br />
<br />
This will translate the <code>boot.cmd</code> file into a U-boot script.<br />
<br />
If you don't have the <code>mkimage</code> command available, you can install it from the <code>uboot-tools</code> package.<br />
<br />
==Kernel==<br />
<br />
The PinePhone runs a mainline kernel, device tree modifications are done by all the PinePhone OS developers on Gitlab (https://gitlab.com/pine64-org/linux).<br />
<br />
=== Clone the kernel ===<br />
<br />
git clone https://gitlab.com/pine64-org/linux<br />
cd linux<br />
git checkout pine64-kernel<br />
<br />
=== Configure the kernel ===<br />
<br />
# <b>Copy our kernel config</b>: https://gitlab.com/pinephone-sailfish-os/linux-kernel/raw/master/pinephone-config<br />
# <b>Enter the <code>linux</code> project</b>: <code>cd linux</code><br />
# <b>Copy the config file</b> to <code>.config</code> in the main directory<br />
<br />
=== Build the kernel ===<br />
<br />
We cross compile the kernel for ARM64.<br />
The <code>LOCALVERSION</code> variable can be used to add a version to the build.<br />
<br />
Cross compile the kernel:<br />
export ARCH=arm64<br />
export CROSS_COMPILE=aarch64-linux-gnu-<br />
export LOCALVERSION=-nemo<br />
make clean<br />
make oldconfig<br />
make Image modules dtbs<br />
<br />
Install the kernel modules in a different path: <br />
make modules_install INSTALL_MOD_PATH=../linux_modules/<br />
<br />
=== Install kernel ===<br />
<br />
Copy the following things:<br />
<br />
# <b>Image</b> from <code>arch/arm64/boot/Image</code> to the root of the <code>boot</code> partition.<br />
# <b>Device tree files</b> <br />
For pinethone <code>arch/arm64/boot/dts/allwinner/sun50i-a64-pinephone.dtb</code> and <code>arch/arm64/boot/dts/allwinner/sun50i-a64-pinephone.dts</code> to the root of the <code>boot</code> partition.<br />
<br />
For pinetab <code>arch/arm64/boot/dts/allwinner/sun50i-a64-pinetab.dtb</code> and <code>arch/arm64/boot/dts/allwinner/sun50i-a64-pinetab.dts</code> to the root of the <code>boot</code> partition.<br />
# <b>Modules</b> from <code>../linux_modules</code> to <code>/lib/modules</code> on the <code>boot</code> partition.<br />
<br />
=== Wlan Module ===<br />
<br />
On PinePhone we have mainline kernel driver. But in PineTab we must use https://github.com/Icenowy/rtl8723cs driver.<br />
<br />
==Nemo Mobile==<br />
<br />
For build last release of nemo use this ks file https://gist.github.com/neochapay/8d40f9ee1e5fd621e0053aa126d39e81<br />
<br />
==Sailfish OS==<br />
<br />
===Github & OBS project===<br />
<br />
- https://github.com/sailfish-on-dontbeevil<br />
<br />
- https://build.merproject.org/project/show/nemo:devel:hw:pine:dontbeevil<br />
<br />
===Flash rootFS===<br />
You can download the latest rootFS from the Gitlab SailfishOS Porters CI: https://gitlab.com/sailfishos-porters-ci/dont_be_evil-ci (see the artifacts of the latest CI job).<br />
<br />
This <code>tar.gz</code> archive should be burned to the <code>data</code> partition of the SD card.<br />
It's important to burn it as the root user (not with sudo) to preserve extended attributes and ACLs: <br />
<br />
sudo su<br />
bsdtar -xpf <SAILFISH OS ROOTFS>.tar.bz2 -C <MOUNTPOINT OF /DATA><br />
<br />
===Device repos===<br />
To boot Lipstick, you need to add the device specific repos to the devkit.<br />
All the following commands are executed in a shell on the devkit.<br />
<br />
''Make sure you configure the ethernet interface first before you continue!''<br />
''You need to have access to the WWW to fetch the necessary repository data and packages.''<br />
<br />
Install zypper manually:<br />
curl -o augeas-lib.rpm http://repo.merproject.org/obs/mer:/core/latest_armv7hl/armv7hl/augeas-libs-1.6.0+git1-1.10.6.armv7hl.rpm<br />
curl -o zypper.rpm http://repo.merproject.org/obs/mer:/core/latest_armv7hl/armv7hl/zypper-1.14.6+git3-1.24.5.armv7hl.rpm<br />
rpm -Uvh *rpm<br />
<br />
Use <code>ssu</code> to add the repo<br />
ssu ar common http://repo.merproject.org/obs/nemo:/devel:/hw:/common/sailfish_latest_armv7hl/<br />
ssu ar dontbeevil http://repo.merproject.org/obs/home:/piggz:/dontbeevil/sailfishos_3.0.3.9_latest_armv7hl/<br />
ssu ar jolla https://releases.jolla.com/releases/3.0.3.9/jolla/armv7hl/<br />
<br />
Refresh the repo:<br />
zypper refresh<br />
<br />
Install the device packages:<br />
zypper install dontbeevil:qt5-qtcore dontbeevil:qt5-qttest dontbeevil:lipstick-qt5<br />
zypper install droid-config-dontbeevil # Select 1 for vendor change<br />
zypper install droid-config-dontbeevil-sailfish<br />
zypper install qt5-plugin-platform-eglfs # EGLFS LIMA plugin<br />
zypper install qt5-plugin-generic-evdev # evdev input plugins<br />
<br />
Other useful packages<br />
zypper install mce-tools #useful for mcetool (mcetool -U activates the screen)<br />
<br />
===Unknown password===<br />
The Sailfish OS rootFS sets a random password when booting for the first time.<br />
You can only log in through the <code>telnet</code> debug interface.<br />
Since the <code>eth0</code> interface still requires manually setup, you can't access <code>telnet</code>.<br />
<br />
To circumvent this issue, you can login through the UART TTY interface. <br />
However you don't know the password of the <code>root</code> nor <code>nemo</code> users!<br />
To disable the <code>root</code> and <code>nemo</code> passwords, we can modify the <code>/etc/shadow</code> file:<br />
<br />
sudo chmod +w <SD card data partition>/etc/shadow<br />
sudo vim <SD card data partition>/etc/shadow # Remove any characters where <HASHED PASSWORD> is written: user1:<HASHED PASSWORD>:16092:0:99999:7:::.<br />
sudo chmod -w <SD card data partition>/etc/shadow<br />
<br />
By removing the hashed password, we can login with the user without entering a password.<br />
You can set a new password afterwards by running as a logged in user:<br />
<br />
passwd<br />
<br />
===Init eth0===<br />
Enabling the <code>eth0</code> interface has to be done manually for now:<br />
<br />
ifconfig eth0 <YOUR_IP><br />
route add default gw <DEFAULT_GATEWAY_IP><br />
echo "nameserver <DNS_SERVER_IP>" > /etc/resolv.conf<br />
<br />
Test your configuration with <code>ping</code>:<br />
<br />
ping jolla.com<br />
<br />
<br />
===Lipstick crashing===<br />
<br />
Install Lipstick from the <code>dontbeevil</code> repository:<br />
<br />
zypper install dontbeevil:lipstick-qt5<br />
<br />
===No setup wizard===<br />
<br />
Make sure the configuration package is installed:<br />
<br />
zypper install droid-config-dontbeevil-sailfish<br />
<br />
===Missing regulatory.db for RT8723BS WiFi/BT module===<br />
<br />
git clone git://git.kernel.org/pub/scm/linux/kernel/git/sforshee/wireless-regdb.git<br />
cd wireless-regdb<br />
cp regulatory* /lib/firmware</div>Dylanvanasschttps://wiki.merproject.org/wiki/Adaptations/PinePhone64Adaptations/PinePhone642019-10-03T18:22:40Z<p>Dylanvanassc: /* U-Boot */</p>
<hr />
<div>=Hardware Support=<br />
<br />
Full information of hardware spec [https://wiki.pine64.org/index.php/Project_Don't_be_evil Here]<br />
<br />
PostMarket OS hardware information [https://wiki.postmarketos.org/wiki/Pine_Don%27t_be_evil_devkit_(pine-dontbeevil) PostMarketOS Wiki]<br />
<br />
==Modem EC25==<br />
<br />
===Setup===<br />
<br />
1. Make sure that the <code>qmimodem</code> plugin is enabled in the <code>.spec</code> of <code>ofono</code>.<br />
<br />
2. Remove the <code>noplugin.conf</code> file under <code>/lib/environment/ofono/noplugin.conf</code>.<br />
<br />
3. Restart <code>ofono</code><br />
systemctl restart ofono<br />
<br />
4. Check if the QMI modem is properly detected:<br />
/usr/lib/ofono/test/list-modems<br />
<br />
5. Unlock you SIM card (if needed):<br />
/usr/lib/ofono/test/enter-pin /quectelqmi_0 pin <PIN CODE><br />
<br />
The EC25 Quectel modem is now ready :)<br />
Thanks to SuperPrower for the hard work!<br />
<br />
===Sending SMS===<br />
<br />
/usr/lib/ofono/test/send-sms <PHONE NUMBER RECEIVER> <MESSAGE> <DELIVERY REPORT><br />
<br />
To skip the delivery report, use <code>0</code> as argument.<br />
<br />
==Cameras==<br />
<br />
Thanks to: https://wiki.postmarketos.org/wiki/Pine_Don't_be_evil_devkit_(pine-dontbeevil)#Cameras<br />
Only the back camera is supported by the mainline kernel.<br />
To use it, you need to configure it first:<br />
<br />
media-ctl --set-v4l2 '"ov5640 2-003c":0[fmt:UYVY8_2X8/1280x7200]' -d /dev/media1<br />
<br />
Afterwards, you can take a picture with:<br />
<br />
ffmpeg -s 1280x720 -f video4linux2 -i /dev/video1 -vframes 1 selfie.jpg<br />
<br />
- <code>/dev/media1</code> is the controller interface of the back camera<br />
<br />
- <code>/dev/video1</code> is the back camera stream interface<br />
<br />
If that works, you can try <code>gstreamer</code> to make the camera available for system wide usage:]<br />
<br />
gst-launch-1.0 v4l2src device=/dev/video1 num-buffers=1 ! 'video/x-raw,format=UYVY,width=1280,height=720' ! jpegenc ! filesink location=selfie.jpg<br />
cp selfie.jpg /home/nemo/Pictures<br />
<br />
This command generates a <code>selfie.jpg</code> file and by copying it to <code>/home/nemo/Pictures</code> you can view it with the Gallery app.<br />
<br />
== Audio ==<br />
<br />
1. Unmuting the <code>AIF1 Slot 0 Digital DAC</code> channel using <code>alsamixer</code>. Use <code>m</code> to unmute.<br />
<br />
2. Copy the default PulseAudio config: <br />
cp /etc/pulse/default.pa /etc/pulse/arm_native_config.pa<br />
<br />
3. Enable ALSA modules in the new config:<br />
load-module module-alsa-sink<br />
load-module module-alsa-source device=hw:1,0<br />
They are commented out by default.<br />
<br />
4. Configure PulseAudio by changing <code>arm_droid_config.pa</code> to <code>/arm_native_config.pa</code> in <code>/etc/sysconfig/pulseaudio</code>.<br />
<br />
5. Restart PulseAudio or reboot.<br />
<br />
6. Go to the Settings app and test the sound output by playing a ringtone under Sounds and Feedback.<br />
<br />
==PineTab==<br />
<br />
In pinetab we have jack to uart port cable. For enable UART console move selector nearby sd-card slot away from sd-card slot.<br />
<br />
==Testing the vibrator motor==<br />
<br />
You need to have the <code>CONFIG_GPIO_SYSFS</code> enabled in your kernel config for this!<br />
<br />
Vibrator motor is on pin <code>PD2</code>.<br />
You can calculate the PIN number for PD2 as followed ([https://linux-sunxi.org/GPIO more information]):<br />
<code>(4-1) * 32 + 2 = 98</code><br />
<br />
echo "98" > /sys/class/gpio/export # Make pin available<br />
echo "out" > /sys/class/gpio/gpio98/direction # Set as output<br />
echo "1" > /sys/class/gpio/gpio98/value # On<br />
echo "1" > /sys/class/gpio/gpio98/value # Off<br />
echo "98" > /sys/class/gpio/unexport # When you're done<br />
<br />
==Notification LED==<br />
<br />
export COLOR=red # or green, blue is broken due to a hardware fault<br />
# Activate LED<br />
echo 1 > /sys/class/leds/$COLOR/brightness<br />
# Deactivate LED<br />
echo 0 > /sys/class/leds/$COLOR/brightness<br />
<br />
The LED can be controlled in Mer by MCE. You need the <code>mce-plugin-libhybris-nondroid</code> for this.<br />
<br />
=Installation=<br />
==Prepare SD card==<br />
<br />
Use GParted or any other tool to create the following <code>EXT4</code> partitions:<br />
<br />
# <b>boot</b>: Holds the mainline kernel Image and Device Tree files<br />
# <b>data</b>: Holds the Sailfish OS rootFS<br />
<br />
GParted will ask you to leave the first MB free of the SD card when creating the first partition, this is correct.<br />
This 1 MB will be used to store the U-boot boot loader.<br />
<br />
==U-Boot==<br />
<br />
We will now build the mainline U-boot boot loader from Git.<br />
<br />
=== Clone ARM Trusted Firmware (master branch) ===<br />
<br />
git clone https://github.com/ARM-software/arm-trusted-firmware.git<br />
<br />
=== Build the BL31.bin ===<br />
<br />
Follow the instructions here: https://github.com/u-boot/u-boot/blob/master/board/sunxi/README.sunxi64<br />
<br />
Quick start:<br />
<br />
- Build the ARM Trusted Firmware binary (see "ARM Trusted Firmware (ATF)" below)<br />
<br />
export CROSS_COMPILE=aarch64-linux-gnu-<br />
ARCH=arm64 make PLAT=sun50i_a64 DEBUG=1 bl31<br />
ARCH=arm64 export BL31=/path/to/bl31.bin<br />
<br />
=== Clone U-boot (master branch): ===<br />
<br />
You can find the U-boot mirror repository on Github:<br />
<br />
git clone https://github.com/u-boot/u-boot.git<br />
<br />
=== Compile U-boot ===<br />
<br />
You have to cross compile U-boot with the <code>arm64</code> arch:<br />
<br />
export CROSS_COMPILE=aarch64-linux-gnu-<br />
ARCH=arm64 make clean<br />
ARCH=arm64 make sopine_baseboard_defconfig<br />
ARCH=arm64 make<br />
<br />
The <code>sopine_baseboard_defconfig</code> is the same for the Don't Be Evil devkit.<br />
<br />
=== Burn U-boot to your SD card ===<br />
<br />
Copy the compiled U-boot bootloader to the first sector on your SD card:<br />
<br />
sudo dd if=u-boot-sunxi-with-spl.bin of=/dev/sdX bs=8k seek=1<br />
<br />
<br />
=== Manually loading the kernel ===<br />
<br />
Serial TTY Baudrate over UART = 115200 for screen, example: <code>screen /dev/ttyUSB0 115200</code><br />
You have to start screen first, before turning on the devkit.<br />
<br />
Interrupt the U-boot autoboot process when you see a message in the U-boot prompt. <br />
We need to access the U-boot prompt to load the Kernel image and boot it manually!<br />
<br />
Set bootargs:<br />
<br />
setenv bootargs root=/dev/mmcblk0p2 rootwait panic=10<br />
<br />
Kernel Image loading and Device Tree files:<br />
<br />
ext4load mmc 0:1 ${kernel_addr_r} /Image <br />
ext4load mmc 0:1 ${fdt_addr_r} /sun50i-a64-pinephone.dtb <br />
<br />
Boot the kernel:<br />
<br />
booti ${kernel_addr_r} - ${fdt_addr_r}<br />
<br />
=== Automatic boot ===<br />
<br />
Create a <code>boot.cmd</code> file:<br />
<br />
echo Setting bootargs<br />
setenv bootargs console=tty0 console=ttyS0,115200 root=/dev/mmcblk0p2 no_console_suspend rootwait <br />
earlycon=uart,mmio32,0x01c28000 panic=10 consoleblank=0 loglevel=1<br />
printenv<br />
echo Loading DTB<br />
load mmc 0:1 ${fdt_addr_r} /sun50i-a64-pinephone.dtb<br />
echo Loading kernel Image<br />
load mmc 0:1 ${kernel_addr_r} /Image<br />
echo Booting kernel NOW<br />
booti ${kernel_addr_r} - ${fdt_addr_r}<br />
<br />
Mount your <code>boot</code> partition and run the following command:<br />
sudo mkimage -C none -A arm -T script -d /mnt/boot.cmd /mnt/boot.scr<br />
<br />
This will translate the <code>boot.cmd</code> file into a U-boot script.<br />
<br />
If you don't have the <code>mkimage</code> command available, you can install it from the <code>uboot-tools</code> package.<br />
<br />
==Kernel==<br />
<br />
The PinePhone runs a mainline kernel, device tree modifications are done by all the PinePhone OS developers on Gitlab (https://gitlab.com/pine64-org/linux).<br />
<br />
=== Clone the kernel ===<br />
<br />
git clone https://gitlab.com/pine64-org/linux<br />
cd linux<br />
git checkout pine64-kernel<br />
<br />
=== Configure the kernel ===<br />
<br />
# <b>Copy our kernel config</b>: https://gitlab.com/pinephone-sailfish-os/linux-kernel/raw/master/pinephone-config<br />
# <b>Enter the <code>linux</code> project</b>: <code>cd linux</code><br />
# <b>Copy the config file</b> to <code>.config</code> in the main directory<br />
<br />
=== Build the kernel ===<br />
<br />
We cross compile the kernel for ARM64.<br />
The <code>LOCALVERSION</code> variable can be used to add a version to the build.<br />
<br />
Cross compile the kernel:<br />
export ARCH=arm64<br />
export CROSS_COMPILE=aarch64-linux-gnu-<br />
export LOCALVERSION=-nemo<br />
make clean<br />
make oldconfig<br />
make Image modules dtbs<br />
<br />
Install the kernel modules in a different path: <br />
make modules_install INSTALL_MOD_PATH=../linux_modules/<br />
<br />
=== Install kernel ===<br />
<br />
Copy the following things:<br />
<br />
# <b>Image</b> from <code>arch/arm64/boot/Image</code> to the root of the <code>boot</code> partition.<br />
# <b>Device tree files</b> <br />
For pinethone <code>arch/arm64/boot/dts/allwinner/sun50i-a64-pinephone.dtb</code> and <code>arch/arm64/boot/dts/allwinner/sun50i-a64-pinephone.dts</code> to the root of the <code>boot</code> partition.<br />
<br />
For pinetab <code>arch/arm64/boot/dts/allwinner/sun50i-a64-pinetab.dtb</code> and <code>arch/arm64/boot/dts/allwinner/sun50i-a64-pinetab.dts</code> to the root of the <code>boot</code> partition.<br />
# <b>Modules</b> from <code>../linux_modules</code> to <code>/lib/modules</code> on the <code>boot</code> partition.<br />
<br />
=== Wlan Module ===<br />
<br />
On PinePhone we have mainline kernel driver. But in PineTab we must use https://github.com/Icenowy/rtl8723cs driver.<br />
<br />
==Nemo Mobile==<br />
<br />
For build last release of nemo use this ks file https://gist.github.com/neochapay/8d40f9ee1e5fd621e0053aa126d39e81<br />
<br />
==Sailfish OS==<br />
<br />
===Github & OBS project===<br />
<br />
- https://github.com/sailfish-on-dontbeevil<br />
<br />
- https://build.merproject.org/project/show/nemo:devel:hw:pine:dontbeevil<br />
<br />
===Flash rootFS===<br />
You can download the latest rootFS from the Gitlab SailfishOS Porters CI: https://gitlab.com/sailfishos-porters-ci/dont_be_evil-ci (see the artifacts of the latest CI job).<br />
<br />
This <code>tar.gz</code> archive should be burned to the <code>data</code> partition of the SD card.<br />
It's important to burn it as the root user (not with sudo) to preserve extended attributes and ACLs: <br />
<br />
sudo su<br />
bsdtar -xpf <SAILFISH OS ROOTFS>.tar.bz2 -C <MOUNTPOINT OF /DATA><br />
<br />
===Device repos===<br />
To boot Lipstick, you need to add the device specific repos to the devkit.<br />
All the following commands are executed in a shell on the devkit.<br />
<br />
''Make sure you configure the ethernet interface first before you continue!''<br />
''You need to have access to the WWW to fetch the necessary repository data and packages.''<br />
<br />
Install zypper manually:<br />
curl -o augeas-lib.rpm http://repo.merproject.org/obs/mer:/core/latest_armv7hl/armv7hl/augeas-libs-1.6.0+git1-1.10.6.armv7hl.rpm<br />
curl -o zypper.rpm http://repo.merproject.org/obs/mer:/core/latest_armv7hl/armv7hl/zypper-1.14.6+git3-1.24.5.armv7hl.rpm<br />
rpm -Uvh *rpm<br />
<br />
Use <code>ssu</code> to add the repo<br />
ssu ar common http://repo.merproject.org/obs/nemo:/devel:/hw:/common/sailfish_latest_armv7hl/<br />
ssu ar dontbeevil http://repo.merproject.org/obs/home:/piggz:/dontbeevil/sailfishos_3.0.3.9_latest_armv7hl/<br />
ssu ar jolla https://releases.jolla.com/releases/3.0.3.9/jolla/armv7hl/<br />
<br />
Refresh the repo:<br />
zypper refresh<br />
<br />
Install the device packages:<br />
zypper install dontbeevil:qt5-qtcore dontbeevil:qt5-qttest dontbeevil:lipstick-qt5<br />
zypper install droid-config-dontbeevil # Select 1 for vendor change<br />
zypper install droid-config-dontbeevil-sailfish<br />
zypper install qt5-plugin-platform-eglfs # EGLFS LIMA plugin<br />
zypper install qt5-plugin-generic-evdev # evdev input plugins<br />
<br />
Other useful packages<br />
zypper install mce-tools #useful for mcetool (mcetool -U activates the screen)<br />
<br />
===Unknown password===<br />
The Sailfish OS rootFS sets a random password when booting for the first time.<br />
You can only log in through the <code>telnet</code> debug interface.<br />
Since the <code>eth0</code> interface still requires manually setup, you can't access <code>telnet</code>.<br />
<br />
To circumvent this issue, you can login through the UART TTY interface. <br />
However you don't know the password of the <code>root</code> nor <code>nemo</code> users!<br />
To disable the <code>root</code> and <code>nemo</code> passwords, we can modify the <code>/etc/shadow</code> file:<br />
<br />
sudo chmod +w <SD card data partition>/etc/shadow<br />
sudo vim <SD card data partition>/etc/shadow # Remove any characters where <HASHED PASSWORD> is written: user1:<HASHED PASSWORD>:16092:0:99999:7:::.<br />
sudo chmod -w <SD card data partition>/etc/shadow<br />
<br />
By removing the hashed password, we can login with the user without entering a password.<br />
You can set a new password afterwards by running as a logged in user:<br />
<br />
passwd<br />
<br />
===Init eth0===<br />
Enabling the <code>eth0</code> interface has to be done manually for now:<br />
<br />
ifconfig eth0 <YOUR_IP><br />
route add default gw <DEFAULT_GATEWAY_IP><br />
echo "nameserver <DNS_SERVER_IP>" > /etc/resolv.conf<br />
<br />
Test your configuration with <code>ping</code>:<br />
<br />
ping jolla.com<br />
<br />
<br />
===Lipstick crashing===<br />
<br />
Install Lipstick from the <code>dontbeevil</code> repository:<br />
<br />
zypper install dontbeevil:lipstick-qt5<br />
<br />
===No setup wizard===<br />
<br />
Make sure the configuration package is installed:<br />
<br />
zypper install droid-config-dontbeevil-sailfish<br />
<br />
===Missing regulatory.db for RT8723BS WiFi/BT module===<br />
<br />
git clone git://git.kernel.org/pub/scm/linux/kernel/git/sforshee/wireless-regdb.git<br />
cd wireless-regdb<br />
cp regulatory* /lib/firmware</div>Dylanvanasschttps://wiki.merproject.org/wiki/Adaptations/PinePhone64Adaptations/PinePhone642019-10-03T18:11:11Z<p>Dylanvanassc: /* Clone U-boot (master branch): */</p>
<hr />
<div>=Hardware Support=<br />
<br />
Full information of hardware spec [https://wiki.pine64.org/index.php/Project_Don't_be_evil Here]<br />
<br />
PostMarket OS hardware information [https://wiki.postmarketos.org/wiki/Pine_Don%27t_be_evil_devkit_(pine-dontbeevil) PostMarketOS Wiki]<br />
<br />
==Modem EC25==<br />
<br />
===Setup===<br />
<br />
1. Make sure that the <code>qmimodem</code> plugin is enabled in the <code>.spec</code> of <code>ofono</code>.<br />
<br />
2. Remove the <code>noplugin.conf</code> file under <code>/lib/environment/ofono/noplugin.conf</code>.<br />
<br />
3. Restart <code>ofono</code><br />
systemctl restart ofono<br />
<br />
4. Check if the QMI modem is properly detected:<br />
/usr/lib/ofono/test/list-modems<br />
<br />
5. Unlock you SIM card (if needed):<br />
/usr/lib/ofono/test/enter-pin /quectelqmi_0 pin <PIN CODE><br />
<br />
The EC25 Quectel modem is now ready :)<br />
Thanks to SuperPrower for the hard work!<br />
<br />
===Sending SMS===<br />
<br />
/usr/lib/ofono/test/send-sms <PHONE NUMBER RECEIVER> <MESSAGE> <DELIVERY REPORT><br />
<br />
To skip the delivery report, use <code>0</code> as argument.<br />
<br />
==Cameras==<br />
<br />
Thanks to: https://wiki.postmarketos.org/wiki/Pine_Don't_be_evil_devkit_(pine-dontbeevil)#Cameras<br />
Only the back camera is supported by the mainline kernel.<br />
To use it, you need to configure it first:<br />
<br />
media-ctl --set-v4l2 '"ov5640 2-003c":0[fmt:UYVY8_2X8/1280x7200]' -d /dev/media1<br />
<br />
Afterwards, you can take a picture with:<br />
<br />
ffmpeg -s 1280x720 -f video4linux2 -i /dev/video1 -vframes 1 selfie.jpg<br />
<br />
- <code>/dev/media1</code> is the controller interface of the back camera<br />
<br />
- <code>/dev/video1</code> is the back camera stream interface<br />
<br />
If that works, you can try <code>gstreamer</code> to make the camera available for system wide usage:]<br />
<br />
gst-launch-1.0 v4l2src device=/dev/video1 num-buffers=1 ! 'video/x-raw,format=UYVY,width=1280,height=720' ! jpegenc ! filesink location=selfie.jpg<br />
cp selfie.jpg /home/nemo/Pictures<br />
<br />
This command generates a <code>selfie.jpg</code> file and by copying it to <code>/home/nemo/Pictures</code> you can view it with the Gallery app.<br />
<br />
== Audio ==<br />
<br />
1. Unmuting the <code>AIF1 Slot 0 Digital DAC</code> channel using <code>alsamixer</code>. Use <code>m</code> to unmute.<br />
<br />
2. Copy the default PulseAudio config: <br />
cp /etc/pulse/default.pa /etc/pulse/arm_native_config.pa<br />
<br />
3. Enable ALSA modules in the new config:<br />
load-module module-alsa-sink<br />
load-module module-alsa-source device=hw:1,0<br />
They are commented out by default.<br />
<br />
4. Configure PulseAudio by changing <code>arm_droid_config.pa</code> to <code>/arm_native_config.pa</code> in <code>/etc/sysconfig/pulseaudio</code>.<br />
<br />
5. Restart PulseAudio or reboot.<br />
<br />
6. Go to the Settings app and test the sound output by playing a ringtone under Sounds and Feedback.<br />
<br />
==PineTab==<br />
<br />
In pinetab we have jack to uart port cable. For enable UART console move selector nearby sd-card slot away from sd-card slot.<br />
<br />
==Testing the vibrator motor==<br />
<br />
You need to have the <code>CONFIG_GPIO_SYSFS</code> enabled in your kernel config for this!<br />
<br />
Vibrator motor is on pin <code>PD2</code>.<br />
You can calculate the PIN number for PD2 as followed ([https://linux-sunxi.org/GPIO more information]):<br />
<code>(4-1) * 32 + 2 = 98</code><br />
<br />
echo "98" > /sys/class/gpio/export # Make pin available<br />
echo "out" > /sys/class/gpio/gpio98/direction # Set as output<br />
echo "1" > /sys/class/gpio/gpio98/value # On<br />
echo "1" > /sys/class/gpio/gpio98/value # Off<br />
echo "98" > /sys/class/gpio/unexport # When you're done<br />
<br />
==Notification LED==<br />
<br />
export COLOR=red # or green, blue is broken due to a hardware fault<br />
# Activate LED<br />
echo 1 > /sys/class/leds/$COLOR/brightness<br />
# Deactivate LED<br />
echo 0 > /sys/class/leds/$COLOR/brightness<br />
<br />
The LED can be controlled in Mer by MCE. You need the <code>mce-plugin-libhybris-nondroid</code> for this.<br />
<br />
=Installation=<br />
==Prepare SD card==<br />
<br />
Use GParted or any other tool to create the following <code>EXT4</code> partitions:<br />
<br />
# <b>boot</b>: Holds the mainline kernel Image and Device Tree files<br />
# <b>data</b>: Holds the Sailfish OS rootFS<br />
<br />
GParted will ask you to leave the first MB free of the SD card when creating the first partition, this is correct.<br />
This 1 MB will be used to store the U-boot boot loader.<br />
<br />
==U-Boot==<br />
<br />
We will now build the mainline U-boot boot loader from Git.<br />
<br />
=== Clone U-boot (master branch): ===<br />
<br />
You can find the U-boot mirror repository on Github:<br />
<br />
git clone https://github.com/u-boot/u-boot<br />
<br />
=== Compile U-boot ===<br />
<br />
You have to cross compile U-boot with the <code>arm64</code> arch:<br />
<br />
export CROSS_COMPILE=aarch64-linux-gnu-<br />
ARCH=arm64 make clean<br />
ARCH=arm64 make sopine_baseboard_defconfig<br />
ARCH=arm64 make<br />
<br />
The <code>sopine_baseboard_defconfig</code> is the same for the Don't Be Evil devkit.<br />
<br />
=== Burn U-boot to your SD card ===<br />
<br />
Copy the compiled U-boot bootloader to the first sector on your SD card:<br />
<br />
sudo dd if=u-boot-sunxi-with-spl.bin of=/dev/sdX bs=8k seek=1<br />
<br />
<br />
=== Manually loading the kernel ===<br />
<br />
Serial TTY Baudrate over UART = 115200 for screen, example: <code>screen /dev/ttyUSB0 115200</code><br />
You have to start screen first, before turning on the devkit.<br />
<br />
Interrupt the U-boot autoboot process when you see a message in the U-boot prompt. <br />
We need to access the U-boot prompt to load the Kernel image and boot it manually!<br />
<br />
Set bootargs:<br />
<br />
setenv bootargs root=/dev/mmcblk0p2 rootwait panic=10<br />
<br />
Kernel Image loading and Device Tree files:<br />
<br />
ext4load mmc 0:1 ${kernel_addr_r} /Image <br />
ext4load mmc 0:1 ${fdt_addr_r} /sun50i-a64-pinephone.dtb <br />
<br />
Boot the kernel:<br />
<br />
booti ${kernel_addr_r} - ${fdt_addr_r}<br />
<br />
=== Automatic boot ===<br />
<br />
Create a <code>boot.cmd</code> file:<br />
<br />
echo Setting bootargs<br />
setenv bootargs console=tty0 console=ttyS0,115200 root=/dev/mmcblk0p2 no_console_suspend rootwait <br />
earlycon=uart,mmio32,0x01c28000 panic=10 consoleblank=0 loglevel=1<br />
printenv<br />
echo Loading DTB<br />
load mmc 0:1 ${fdt_addr_r} /sun50i-a64-pinephone.dtb<br />
echo Loading kernel Image<br />
load mmc 0:1 ${kernel_addr_r} /Image<br />
echo Booting kernel NOW<br />
booti ${kernel_addr_r} - ${fdt_addr_r}<br />
<br />
Mount your <code>boot</code> partition and run the following command:<br />
sudo mkimage -C none -A arm -T script -d /mnt/boot.cmd /mnt/boot.scr<br />
<br />
This will translate the <code>boot.cmd</code> file into a U-boot script.<br />
<br />
If you don't have the <code>mkimage</code> command available, you can install it from the <code>uboot-tools</code> package.<br />
<br />
==Kernel==<br />
<br />
The PinePhone runs a mainline kernel, device tree modifications are done by all the PinePhone OS developers on Gitlab (https://gitlab.com/pine64-org/linux).<br />
<br />
=== Clone the kernel ===<br />
<br />
git clone https://gitlab.com/pine64-org/linux<br />
cd linux<br />
git checkout pine64-kernel<br />
<br />
=== Configure the kernel ===<br />
<br />
# <b>Copy our kernel config</b>: https://gitlab.com/pinephone-sailfish-os/linux-kernel/raw/master/pinephone-config<br />
# <b>Enter the <code>linux</code> project</b>: <code>cd linux</code><br />
# <b>Copy the config file</b> to <code>.config</code> in the main directory<br />
<br />
=== Build the kernel ===<br />
<br />
We cross compile the kernel for ARM64.<br />
The <code>LOCALVERSION</code> variable can be used to add a version to the build.<br />
<br />
Cross compile the kernel:<br />
export ARCH=arm64<br />
export CROSS_COMPILE=aarch64-linux-gnu-<br />
export LOCALVERSION=-nemo<br />
make clean<br />
make oldconfig<br />
make Image modules dtbs<br />
<br />
Install the kernel modules in a different path: <br />
make modules_install INSTALL_MOD_PATH=../linux_modules/<br />
<br />
=== Install kernel ===<br />
<br />
Copy the following things:<br />
<br />
# <b>Image</b> from <code>arch/arm64/boot/Image</code> to the root of the <code>boot</code> partition.<br />
# <b>Device tree files</b> <br />
For pinethone <code>arch/arm64/boot/dts/allwinner/sun50i-a64-pinephone.dtb</code> and <code>arch/arm64/boot/dts/allwinner/sun50i-a64-pinephone.dts</code> to the root of the <code>boot</code> partition.<br />
<br />
For pinetab <code>arch/arm64/boot/dts/allwinner/sun50i-a64-pinetab.dtb</code> and <code>arch/arm64/boot/dts/allwinner/sun50i-a64-pinetab.dts</code> to the root of the <code>boot</code> partition.<br />
# <b>Modules</b> from <code>../linux_modules</code> to <code>/lib/modules</code> on the <code>boot</code> partition.<br />
<br />
=== Wlan Module ===<br />
<br />
On PinePhone we have mainline kernel driver. But in PineTab we must use https://github.com/Icenowy/rtl8723cs driver.<br />
<br />
==Nemo Mobile==<br />
<br />
For build last release of nemo use this ks file https://gist.github.com/neochapay/8d40f9ee1e5fd621e0053aa126d39e81<br />
<br />
==Sailfish OS==<br />
<br />
===Github & OBS project===<br />
<br />
- https://github.com/sailfish-on-dontbeevil<br />
<br />
- https://build.merproject.org/project/show/nemo:devel:hw:pine:dontbeevil<br />
<br />
===Flash rootFS===<br />
You can download the latest rootFS from the Gitlab SailfishOS Porters CI: https://gitlab.com/sailfishos-porters-ci/dont_be_evil-ci (see the artifacts of the latest CI job).<br />
<br />
This <code>tar.gz</code> archive should be burned to the <code>data</code> partition of the SD card.<br />
It's important to burn it as the root user (not with sudo) to preserve extended attributes and ACLs: <br />
<br />
sudo su<br />
bsdtar -xpf <SAILFISH OS ROOTFS>.tar.bz2 -C <MOUNTPOINT OF /DATA><br />
<br />
===Device repos===<br />
To boot Lipstick, you need to add the device specific repos to the devkit.<br />
All the following commands are executed in a shell on the devkit.<br />
<br />
''Make sure you configure the ethernet interface first before you continue!''<br />
''You need to have access to the WWW to fetch the necessary repository data and packages.''<br />
<br />
Install zypper manually:<br />
curl -o augeas-lib.rpm http://repo.merproject.org/obs/mer:/core/latest_armv7hl/armv7hl/augeas-libs-1.6.0+git1-1.10.6.armv7hl.rpm<br />
curl -o zypper.rpm http://repo.merproject.org/obs/mer:/core/latest_armv7hl/armv7hl/zypper-1.14.6+git3-1.24.5.armv7hl.rpm<br />
rpm -Uvh *rpm<br />
<br />
Use <code>ssu</code> to add the repo<br />
ssu ar common http://repo.merproject.org/obs/nemo:/devel:/hw:/common/sailfish_latest_armv7hl/<br />
ssu ar dontbeevil http://repo.merproject.org/obs/home:/piggz:/dontbeevil/sailfishos_3.0.3.9_latest_armv7hl/<br />
ssu ar jolla https://releases.jolla.com/releases/3.0.3.9/jolla/armv7hl/<br />
<br />
Refresh the repo:<br />
zypper refresh<br />
<br />
Install the device packages:<br />
zypper install dontbeevil:qt5-qtcore dontbeevil:qt5-qttest dontbeevil:lipstick-qt5<br />
zypper install droid-config-dontbeevil # Select 1 for vendor change<br />
zypper install droid-config-dontbeevil-sailfish<br />
zypper install qt5-plugin-platform-eglfs # EGLFS LIMA plugin<br />
zypper install qt5-plugin-generic-evdev # evdev input plugins<br />
<br />
Other useful packages<br />
zypper install mce-tools #useful for mcetool (mcetool -U activates the screen)<br />
<br />
===Unknown password===<br />
The Sailfish OS rootFS sets a random password when booting for the first time.<br />
You can only log in through the <code>telnet</code> debug interface.<br />
Since the <code>eth0</code> interface still requires manually setup, you can't access <code>telnet</code>.<br />
<br />
To circumvent this issue, you can login through the UART TTY interface. <br />
However you don't know the password of the <code>root</code> nor <code>nemo</code> users!<br />
To disable the <code>root</code> and <code>nemo</code> passwords, we can modify the <code>/etc/shadow</code> file:<br />
<br />
sudo chmod +w <SD card data partition>/etc/shadow<br />
sudo vim <SD card data partition>/etc/shadow # Remove any characters where <HASHED PASSWORD> is written: user1:<HASHED PASSWORD>:16092:0:99999:7:::.<br />
sudo chmod -w <SD card data partition>/etc/shadow<br />
<br />
By removing the hashed password, we can login with the user without entering a password.<br />
You can set a new password afterwards by running as a logged in user:<br />
<br />
passwd<br />
<br />
===Init eth0===<br />
Enabling the <code>eth0</code> interface has to be done manually for now:<br />
<br />
ifconfig eth0 <YOUR_IP><br />
route add default gw <DEFAULT_GATEWAY_IP><br />
echo "nameserver <DNS_SERVER_IP>" > /etc/resolv.conf<br />
<br />
Test your configuration with <code>ping</code>:<br />
<br />
ping jolla.com<br />
<br />
<br />
===Lipstick crashing===<br />
<br />
Install Lipstick from the <code>dontbeevil</code> repository:<br />
<br />
zypper install dontbeevil:lipstick-qt5<br />
<br />
===No setup wizard===<br />
<br />
Make sure the configuration package is installed:<br />
<br />
zypper install droid-config-dontbeevil-sailfish<br />
<br />
===Missing regulatory.db for RT8723BS WiFi/BT module===<br />
<br />
git clone git://git.kernel.org/pub/scm/linux/kernel/git/sforshee/wireless-regdb.git<br />
cd wireless-regdb<br />
cp regulatory* /lib/firmware</div>Dylanvanasschttps://wiki.merproject.org/wiki/Adaptations/PinePhone64Adaptations/PinePhone642019-09-12T07:45:48Z<p>Dylanvanassc: /* Audio */</p>
<hr />
<div>=Hardware Support=<br />
<br />
Full information of hardware spec [https://wiki.pine64.org/index.php/Project_Don't_be_evil Here]<br />
<br />
PostMarket OS hardware information [https://wiki.postmarketos.org/wiki/Pine_Don%27t_be_evil_devkit_(pine-dontbeevil) PostMarketOS Wiki]<br />
<br />
==Modem EC25==<br />
<br />
===Setup===<br />
<br />
1. Make sure that the <code>qmimodem</code> plugin is enabled in the <code>.spec</code> of <code>ofono</code>.<br />
<br />
2. Remove the <code>noplugin.conf</code> file under <code>/lib/environment/ofono/noplugin.conf</code>.<br />
<br />
3. Restart <code>ofono</code><br />
systemctl restart ofono<br />
<br />
4. Check if the QMI modem is properly detected:<br />
/usr/lib/ofono/test/list-modems<br />
<br />
5. Unlock you SIM card (if needed):<br />
/usr/lib/ofono/test/enter-pin /quectelqmi_0 pin <PIN CODE><br />
<br />
The EC25 Quectel modem is now ready :)<br />
Thanks to SuperPrower for the hard work!<br />
<br />
===Sending SMS===<br />
<br />
/usr/lib/ofono/test/send-sms <PHONE NUMBER RECEIVER> <MESSAGE> <DELIVERY REPORT><br />
<br />
To skip the delivery report, use <code>0</code> as argument.<br />
<br />
==Cameras==<br />
<br />
Thanks to: https://wiki.postmarketos.org/wiki/Pine_Don't_be_evil_devkit_(pine-dontbeevil)#Cameras<br />
Only the back camera is supported by the mainline kernel.<br />
To use it, you need to configure it first:<br />
<br />
media-ctl --set-v4l2 '"ov5640 2-003c":0[fmt:UYVY8_2X8/1280x7200]' -d /dev/media1<br />
<br />
Afterwards, you can take a picture with:<br />
<br />
ffmpeg -s 1280x720 -f video4linux2 -i /dev/video1 -vframes 1 selfie.jpg<br />
<br />
- <code>/dev/media1</code> is the controller interface of the back camera<br />
<br />
- <code>/dev/video1</code> is the back camera stream interface<br />
<br />
If that works, you can try <code>gstreamer</code> to make the camera available for system wide usage:]<br />
<br />
gst-launch-1.0 v4l2src device=/dev/video1 num-buffers=1 ! 'video/x-raw,format=UYVY,width=1280,height=720' ! jpegenc ! filesink location=selfie.jpg<br />
cp selfie.jpg /home/nemo/Pictures<br />
<br />
This command generates a <code>selfie.jpg</code> file and by copying it to <code>/home/nemo/Pictures</code> you can view it with the Gallery app.<br />
<br />
== Audio ==<br />
<br />
1. Unmuting the <code>AIF1 Slot 0 Digital DAC</code> channel using <code>alsamixer</code>. Use <code>m</code> to unmute.<br />
<br />
2. Copy the default PulseAudio config: <br />
cp /etc/pulse/default.pa /etc/pulse/arm_native_config.pa<br />
<br />
3. Enable ALSA modules in the new config:<br />
load-module module-alsa-sink<br />
load-module module-alsa-source device=hw:1,0<br />
They are commented out by default.<br />
<br />
4. Configure PulseAudio by changing <code>arm_droid_config.pa</code> to <code>/arm_native_config.pa</code> in <code>/etc/sysconfig/pulseaudio</code>.<br />
<br />
5. Restart PulseAudio or reboot.<br />
<br />
6. Go to the Settings app and test the sound output by playing a ringtone under Sounds and Feedback.<br />
<br />
==PineTab==<br />
<br />
In pinetab we have jack to uart port cable. For enable UART console move selector nearby sd-card slot away from sd-card slot.<br />
<br />
==Testing the vibrator motor==<br />
<br />
You need to have the <code>CONFIG_GPIO_SYSFS</code> enabled in your kernel config for this!<br />
<br />
Vibrator motor is on pin <code>PD2</code>.<br />
You can calculate the PIN number for PD2 as followed ([https://linux-sunxi.org/GPIO more information]):<br />
<code>(4-1) * 32 + 2 = 98</code><br />
<br />
echo "98" > /sys/class/gpio/export # Make pin available<br />
echo "out" > /sys/class/gpio/gpio98/direction # Set as output<br />
echo "1" > /sys/class/gpio/gpio98/value # On<br />
echo "1" > /sys/class/gpio/gpio98/value # Off<br />
echo "98" > /sys/class/gpio/unexport # When you're done<br />
<br />
==Notification LED==<br />
<br />
export COLOR=red # or green, blue is broken due to a hardware fault<br />
# Activate LED<br />
echo 1 > /sys/class/leds/$COLOR/brightness<br />
# Deactivate LED<br />
echo 0 > /sys/class/leds/$COLOR/brightness<br />
<br />
The LED can be controlled in Mer by MCE. You need the <code>mce-plugin-libhybris-nondroid</code> for this.<br />
<br />
=Installation=<br />
==Prepare SD card==<br />
<br />
Use GParted or any other tool to create the following <code>EXT4</code> partitions:<br />
<br />
# <b>boot</b>: Holds the mainline kernel Image and Device Tree files<br />
# <b>data</b>: Holds the Sailfish OS rootFS<br />
<br />
GParted will ask you to leave the first MB free of the SD card when creating the first partition, this is correct.<br />
This 1 MB will be used to store the U-boot boot loader.<br />
<br />
==U-Boot==<br />
<br />
We will now build the mainline U-boot boot loader from Git.<br />
<br />
=== Clone U-boot (master branch): ===<br />
<br />
You can find the U-boot mirror repository on Github:<br />
<br />
git clone github.com/u-boot/u-boot<br />
<br />
=== Compile U-boot ===<br />
<br />
You have to cross compile U-boot with the <code>arm64</code> arch:<br />
<br />
export CROSS_COMPILE=aarch64-linux-gnu-<br />
ARCH=arm64 make clean<br />
ARCH=arm64 make sopine_baseboard_defconfig<br />
ARCH=arm64 make<br />
<br />
The <code>sopine_baseboard_defconfig</code> is the same for the Don't Be Evil devkit.<br />
<br />
=== Burn U-boot to your SD card ===<br />
<br />
Copy the compiled U-boot bootloader to the first sector on your SD card:<br />
<br />
sudo dd if=u-boot-sunxi-with-spl.bin of=/dev/sdX bs=8k seek=1<br />
<br />
<br />
=== Manually loading the kernel ===<br />
<br />
Serial TTY Baudrate over UART = 115200 for screen, example: <code>screen /dev/ttyUSB0 115200</code><br />
You have to start screen first, before turning on the devkit.<br />
<br />
Interrupt the U-boot autoboot process when you see a message in the U-boot prompt. <br />
We need to access the U-boot prompt to load the Kernel image and boot it manually!<br />
<br />
Set bootargs:<br />
<br />
setenv bootargs root=/dev/mmcblk0p2 rootwait panic=10<br />
<br />
Kernel Image loading and Device Tree files:<br />
<br />
ext4load mmc 0:1 ${kernel_addr_r} /Image <br />
ext4load mmc 0:1 ${fdt_addr_r} /sun50i-a64-dontbeevil.dtb <br />
<br />
Boot the kernel:<br />
<br />
booti ${kernel_addr_r} - ${fdt_addr_r}<br />
<br />
=== Automatic boot ===<br />
<br />
Create a <code>boot.cmd</code> file:<br />
<br />
echo Setting bootargs<br />
setenv bootargs console=tty0 console=ttyS0,115200 root=/dev/mmcblk0p2 no_console_suspend rootwait <br />
earlycon=uart,mmio32,0x01c28000 panic=10 consoleblank=0 loglevel=1<br />
printenv<br />
echo Loading DTB<br />
load mmc 0:1 ${fdt_addr_r} /sun50i-a64-dontbeevil.dtb<br />
echo Loading kernel Image<br />
load mmc 0:1 ${kernel_addr_r} /Image<br />
echo Booting kernel NOW<br />
booti ${kernel_addr_r} - ${fdt_addr_r}<br />
<br />
Mount your <code>boot</code> partition and run the following command:<br />
sudo mkimage -C none -A arm -T script -d /mnt/boot.cmd /mnt/boot.scr<br />
<br />
This will translate the <code>boot.cmd</code> file into a U-boot script.<br />
<br />
If you don't have the <code>mkimage</code> command available, you can install it from the <code>uboot-tools</code> package.<br />
<br />
==Kernel==<br />
<br />
The PinePhone runs a mainline kernel, device tree modifications are done by all the PinePhone OS developers on Gitlab (https://gitlab.com/pine64-org/linux).<br />
<br />
=== Clone the kernel ===<br />
<br />
git clone https://gitlab.com/pine64-org/linux<br />
cd linux<br />
git checkout pinephone-dontbeevil<br />
<br />
=== Configure the kernel ===<br />
<br />
# <b>Copy our kernel config</b>: https://gitlab.com/pinephone-sailfish-os/linux-kernel/raw/master/pinephone-config<br />
# <b>Enter the <code>linux</code> project</b>: <code>cd linux</code><br />
# <b>Copy the config file</b> to <code>.config</code> in the main directory<br />
<br />
=== Build the kernel ===<br />
<br />
We cross compile the kernel for ARM64.<br />
The <code>LOCALVERSION</code> variable can be used to add a version to the build.<br />
<br />
Cross compile the kernel:<br />
export ARCH=arm64<br />
export CROSS_COMPILE=aarch64-linux-gnu-<br />
export LOCALVERSION=-nemo<br />
make clean<br />
make oldconfig<br />
make Image modules dtbs<br />
<br />
Install the kernel modules in a different path: <br />
make modules_install INSTALL_MOD_PATH=../linux_modules/<br />
<br />
=== Install kernel ===<br />
<br />
Copy the following things:<br />
<br />
# <b>Image</b> from <code>arch/arm64/boot/Image</code> to the root of the <code>boot</code> partition.<br />
# <b>Device tree files</b> <br />
For pinethone <code>arch/arm64/boot/dts/allwinner/sun50i-a64-dontbeevil.dtb</code> and <code>arch/arm64/boot/dts/allwinner/sun50i-a64-dontbeevil.dts</code> to the root of the <code>boot</code> partition.<br />
<br />
For pinetab <code>arch/arm64/boot/dts/allwinner/sun50i-a64-pinetab.dtb</code> and <code>arch/arm64/boot/dts/allwinner/sun50i-a64-pinetab.dts</code> to the root of the <code>boot</code> partition.<br />
# <b>Modules</b> from <code>../linux_modules</code> to <code>/lib/modules</code> on the <code>boot</code> partition.<br />
<br />
=== Wlan Module ===<br />
<br />
On PinePhone we have mainline kernel driver. But in PineTab we must use https://github.com/Icenowy/rtl8723cs driver.<br />
<br />
==Nemo Mobile==<br />
<br />
For build last release of nemo use this ks file https://gist.github.com/neochapay/8d40f9ee1e5fd621e0053aa126d39e81<br />
<br />
==Sailfish OS==<br />
<br />
===Github & OBS project===<br />
<br />
- https://github.com/sailfish-on-dontbeevil<br />
<br />
- https://build.merproject.org/project/show/nemo:devel:hw:pine:dontbeevil<br />
<br />
===Flash rootFS===<br />
You can download the latest rootFS from the Gitlab SailfishOS Porters CI: https://gitlab.com/sailfishos-porters-ci/dont_be_evil-ci (see the artifacts of the latest CI job).<br />
<br />
This <code>tar.gz</code> archive should be burned to the <code>data</code> partition of the SD card.<br />
It's important to burn it as the root user (not with sudo) to preserve extended attributes and ACLs: <br />
<br />
sudo su<br />
bsdtar -xpf <SAILFISH OS ROOTFS>.tar.bz2 -C <MOUNTPOINT OF /DATA><br />
<br />
===Device repos===<br />
To boot Lipstick, you need to add the device specific repos to the devkit.<br />
All the following commands are executed in a shell on the devkit.<br />
<br />
''Make sure you configure the ethernet interface first before you continue!''<br />
''You need to have access to the WWW to fetch the necessary repository data and packages.''<br />
<br />
Install zypper manually:<br />
curl -o augeas-lib.rpm http://repo.merproject.org/obs/mer:/core/latest_armv7hl/armv7hl/augeas-libs-1.6.0+git1-1.10.6.armv7hl.rpm<br />
curl -o zypper.rpm http://repo.merproject.org/obs/mer:/core/latest_armv7hl/armv7hl/zypper-1.14.6+git3-1.24.5.armv7hl.rpm<br />
rpm -Uvh *rpm<br />
<br />
Use <code>ssu</code> to add the repo<br />
ssu ar common http://repo.merproject.org/obs/nemo:/devel:/hw:/common/sailfish_latest_armv7hl/<br />
ssu ar dontbeevil http://repo.merproject.org/obs/home:/piggz:/dontbeevil/sailfishos_3.0.3.9_latest_armv7hl/<br />
ssu ar jolla https://releases.jolla.com/releases/3.0.3.9/jolla/armv7hl/<br />
<br />
Refresh the repo:<br />
zypper refresh<br />
<br />
Install the device packages:<br />
zypper install dontbeevil:qt5-qtcore dontbeevil:qt5-qttest dontbeevil:lipstick-qt5<br />
zypper install droid-config-dontbeevil # Select 1 for vendor change<br />
zypper install droid-config-dontbeevil-sailfish<br />
zypper install qt5-plugin-platform-eglfs # EGLFS LIMA plugin<br />
zypper install qt5-plugin-generic-evdev # evdev input plugins<br />
<br />
Other useful packages<br />
zypper install mce-tools #useful for mcetool (mcetool -U activates the screen)<br />
<br />
===Unknown password===<br />
The Sailfish OS rootFS sets a random password when booting for the first time.<br />
You can only log in through the <code>telnet</code> debug interface.<br />
Since the <code>eth0</code> interface still requires manually setup, you can't access <code>telnet</code>.<br />
<br />
To circumvent this issue, you can login through the UART TTY interface. <br />
However you don't know the password of the <code>root</code> nor <code>nemo</code> users!<br />
To disable the <code>root</code> and <code>nemo</code> passwords, we can modify the <code>/etc/shadow</code> file:<br />
<br />
sudo chmod +w <SD card data partition>/etc/shadow<br />
sudo vim <SD card data partition>/etc/shadow # Remove any characters where <HASHED PASSWORD> is written: user1:<HASHED PASSWORD>:16092:0:99999:7:::.<br />
sudo chmod -w <SD card data partition>/etc/shadow<br />
<br />
By removing the hashed password, we can login with the user without entering a password.<br />
You can set a new password afterwards by running as a logged in user:<br />
<br />
passwd<br />
<br />
===Init eth0===<br />
Enabling the <code>eth0</code> interface has to be done manually for now:<br />
<br />
ifconfig eth0 <YOUR_IP><br />
route add default gw <DEFAULT_GATEWAY_IP><br />
echo "nameserver <DNS_SERVER_IP>" > /etc/resolv.conf<br />
<br />
Test your configuration with <code>ping</code>:<br />
<br />
ping jolla.com<br />
<br />
<br />
===Lipstick crashing===<br />
<br />
Install Lipstick from the <code>dontbeevil</code> repository:<br />
<br />
zypper install dontbeevil:lipstick-qt5<br />
<br />
===No setup wizard===<br />
<br />
Make sure the configuration package is installed:<br />
<br />
zypper install droid-config-dontbeevil-sailfish<br />
<br />
===Missing regulatory.db for RT8723BS WiFi/BT module===<br />
<br />
git clone git://git.kernel.org/pub/scm/linux/kernel/git/sforshee/wireless-regdb.git<br />
cd wireless-regdb<br />
cp regulatory* /lib/firmware</div>Dylanvanasschttps://wiki.merproject.org/wiki/Adaptations/PinePhone64Adaptations/PinePhone642019-09-12T07:45:27Z<p>Dylanvanassc: /* Audio */</p>
<hr />
<div>=Hardware Support=<br />
<br />
Full information of hardware spec [https://wiki.pine64.org/index.php/Project_Don't_be_evil Here]<br />
<br />
PostMarket OS hardware information [https://wiki.postmarketos.org/wiki/Pine_Don%27t_be_evil_devkit_(pine-dontbeevil) PostMarketOS Wiki]<br />
<br />
==Modem EC25==<br />
<br />
===Setup===<br />
<br />
1. Make sure that the <code>qmimodem</code> plugin is enabled in the <code>.spec</code> of <code>ofono</code>.<br />
<br />
2. Remove the <code>noplugin.conf</code> file under <code>/lib/environment/ofono/noplugin.conf</code>.<br />
<br />
3. Restart <code>ofono</code><br />
systemctl restart ofono<br />
<br />
4. Check if the QMI modem is properly detected:<br />
/usr/lib/ofono/test/list-modems<br />
<br />
5. Unlock you SIM card (if needed):<br />
/usr/lib/ofono/test/enter-pin /quectelqmi_0 pin <PIN CODE><br />
<br />
The EC25 Quectel modem is now ready :)<br />
Thanks to SuperPrower for the hard work!<br />
<br />
===Sending SMS===<br />
<br />
/usr/lib/ofono/test/send-sms <PHONE NUMBER RECEIVER> <MESSAGE> <DELIVERY REPORT><br />
<br />
To skip the delivery report, use <code>0</code> as argument.<br />
<br />
==Cameras==<br />
<br />
Thanks to: https://wiki.postmarketos.org/wiki/Pine_Don't_be_evil_devkit_(pine-dontbeevil)#Cameras<br />
Only the back camera is supported by the mainline kernel.<br />
To use it, you need to configure it first:<br />
<br />
media-ctl --set-v4l2 '"ov5640 2-003c":0[fmt:UYVY8_2X8/1280x7200]' -d /dev/media1<br />
<br />
Afterwards, you can take a picture with:<br />
<br />
ffmpeg -s 1280x720 -f video4linux2 -i /dev/video1 -vframes 1 selfie.jpg<br />
<br />
- <code>/dev/media1</code> is the controller interface of the back camera<br />
<br />
- <code>/dev/video1</code> is the back camera stream interface<br />
<br />
If that works, you can try <code>gstreamer</code> to make the camera available for system wide usage:]<br />
<br />
gst-launch-1.0 v4l2src device=/dev/video1 num-buffers=1 ! 'video/x-raw,format=UYVY,width=1280,height=720' ! jpegenc ! filesink location=selfie.jpg<br />
cp selfie.jpg /home/nemo/Pictures<br />
<br />
This command generates a <code>selfie.jpg</code> file and by copying it to <code>/home/nemo/Pictures</code> you can view it with the Gallery app.<br />
<br />
== Audio ==<br />
<br />
1. Unmuting the <code>AIF1 Slot 0 Digital DAC</code> channel using <code>alsamixer</code>. Use <code>m</code> to unmute.<br />
<br />
2. Copy the default PulseAudio config: <br />
cp /etc/pulse/default.pa /etc/pulse/arm_native_config.pa<br />
<br />
3. Enable ALSA modules in the new config:<br />
load-module module-alsa-sink<br />
load-module module-alsa-source device=hw:1,0<br />
They are commented out by default<br />
<br />
4. Configure PulseAudio by changing <code>arm_droid_config.pa</code> to <code>/arm_native_config.pa</code> in <code>/etc/sysconfig/pulseaudio</code><br />
<br />
5. Restart PulseAudio or reboot<br />
<br />
6. Go to the Settings app and test the sound output by playing a ringtone under Sounds and Feedback.<br />
<br />
==PineTab==<br />
<br />
In pinetab we have jack to uart port cable. For enable UART console move selector nearby sd-card slot away from sd-card slot.<br />
<br />
==Testing the vibrator motor==<br />
<br />
You need to have the <code>CONFIG_GPIO_SYSFS</code> enabled in your kernel config for this!<br />
<br />
Vibrator motor is on pin <code>PD2</code>.<br />
You can calculate the PIN number for PD2 as followed ([https://linux-sunxi.org/GPIO more information]):<br />
<code>(4-1) * 32 + 2 = 98</code><br />
<br />
echo "98" > /sys/class/gpio/export # Make pin available<br />
echo "out" > /sys/class/gpio/gpio98/direction # Set as output<br />
echo "1" > /sys/class/gpio/gpio98/value # On<br />
echo "1" > /sys/class/gpio/gpio98/value # Off<br />
echo "98" > /sys/class/gpio/unexport # When you're done<br />
<br />
==Notification LED==<br />
<br />
export COLOR=red # or green, blue is broken due to a hardware fault<br />
# Activate LED<br />
echo 1 > /sys/class/leds/$COLOR/brightness<br />
# Deactivate LED<br />
echo 0 > /sys/class/leds/$COLOR/brightness<br />
<br />
The LED can be controlled in Mer by MCE. You need the <code>mce-plugin-libhybris-nondroid</code> for this.<br />
<br />
=Installation=<br />
==Prepare SD card==<br />
<br />
Use GParted or any other tool to create the following <code>EXT4</code> partitions:<br />
<br />
# <b>boot</b>: Holds the mainline kernel Image and Device Tree files<br />
# <b>data</b>: Holds the Sailfish OS rootFS<br />
<br />
GParted will ask you to leave the first MB free of the SD card when creating the first partition, this is correct.<br />
This 1 MB will be used to store the U-boot boot loader.<br />
<br />
==U-Boot==<br />
<br />
We will now build the mainline U-boot boot loader from Git.<br />
<br />
=== Clone U-boot (master branch): ===<br />
<br />
You can find the U-boot mirror repository on Github:<br />
<br />
git clone github.com/u-boot/u-boot<br />
<br />
=== Compile U-boot ===<br />
<br />
You have to cross compile U-boot with the <code>arm64</code> arch:<br />
<br />
export CROSS_COMPILE=aarch64-linux-gnu-<br />
ARCH=arm64 make clean<br />
ARCH=arm64 make sopine_baseboard_defconfig<br />
ARCH=arm64 make<br />
<br />
The <code>sopine_baseboard_defconfig</code> is the same for the Don't Be Evil devkit.<br />
<br />
=== Burn U-boot to your SD card ===<br />
<br />
Copy the compiled U-boot bootloader to the first sector on your SD card:<br />
<br />
sudo dd if=u-boot-sunxi-with-spl.bin of=/dev/sdX bs=8k seek=1<br />
<br />
<br />
=== Manually loading the kernel ===<br />
<br />
Serial TTY Baudrate over UART = 115200 for screen, example: <code>screen /dev/ttyUSB0 115200</code><br />
You have to start screen first, before turning on the devkit.<br />
<br />
Interrupt the U-boot autoboot process when you see a message in the U-boot prompt. <br />
We need to access the U-boot prompt to load the Kernel image and boot it manually!<br />
<br />
Set bootargs:<br />
<br />
setenv bootargs root=/dev/mmcblk0p2 rootwait panic=10<br />
<br />
Kernel Image loading and Device Tree files:<br />
<br />
ext4load mmc 0:1 ${kernel_addr_r} /Image <br />
ext4load mmc 0:1 ${fdt_addr_r} /sun50i-a64-dontbeevil.dtb <br />
<br />
Boot the kernel:<br />
<br />
booti ${kernel_addr_r} - ${fdt_addr_r}<br />
<br />
=== Automatic boot ===<br />
<br />
Create a <code>boot.cmd</code> file:<br />
<br />
echo Setting bootargs<br />
setenv bootargs console=tty0 console=ttyS0,115200 root=/dev/mmcblk0p2 no_console_suspend rootwait <br />
earlycon=uart,mmio32,0x01c28000 panic=10 consoleblank=0 loglevel=1<br />
printenv<br />
echo Loading DTB<br />
load mmc 0:1 ${fdt_addr_r} /sun50i-a64-dontbeevil.dtb<br />
echo Loading kernel Image<br />
load mmc 0:1 ${kernel_addr_r} /Image<br />
echo Booting kernel NOW<br />
booti ${kernel_addr_r} - ${fdt_addr_r}<br />
<br />
Mount your <code>boot</code> partition and run the following command:<br />
sudo mkimage -C none -A arm -T script -d /mnt/boot.cmd /mnt/boot.scr<br />
<br />
This will translate the <code>boot.cmd</code> file into a U-boot script.<br />
<br />
If you don't have the <code>mkimage</code> command available, you can install it from the <code>uboot-tools</code> package.<br />
<br />
==Kernel==<br />
<br />
The PinePhone runs a mainline kernel, device tree modifications are done by all the PinePhone OS developers on Gitlab (https://gitlab.com/pine64-org/linux).<br />
<br />
=== Clone the kernel ===<br />
<br />
git clone https://gitlab.com/pine64-org/linux<br />
cd linux<br />
git checkout pinephone-dontbeevil<br />
<br />
=== Configure the kernel ===<br />
<br />
# <b>Copy our kernel config</b>: https://gitlab.com/pinephone-sailfish-os/linux-kernel/raw/master/pinephone-config<br />
# <b>Enter the <code>linux</code> project</b>: <code>cd linux</code><br />
# <b>Copy the config file</b> to <code>.config</code> in the main directory<br />
<br />
=== Build the kernel ===<br />
<br />
We cross compile the kernel for ARM64.<br />
The <code>LOCALVERSION</code> variable can be used to add a version to the build.<br />
<br />
Cross compile the kernel:<br />
export ARCH=arm64<br />
export CROSS_COMPILE=aarch64-linux-gnu-<br />
export LOCALVERSION=-nemo<br />
make clean<br />
make oldconfig<br />
make Image modules dtbs<br />
<br />
Install the kernel modules in a different path: <br />
make modules_install INSTALL_MOD_PATH=../linux_modules/<br />
<br />
=== Install kernel ===<br />
<br />
Copy the following things:<br />
<br />
# <b>Image</b> from <code>arch/arm64/boot/Image</code> to the root of the <code>boot</code> partition.<br />
# <b>Device tree files</b> <br />
For pinethone <code>arch/arm64/boot/dts/allwinner/sun50i-a64-dontbeevil.dtb</code> and <code>arch/arm64/boot/dts/allwinner/sun50i-a64-dontbeevil.dts</code> to the root of the <code>boot</code> partition.<br />
<br />
For pinetab <code>arch/arm64/boot/dts/allwinner/sun50i-a64-pinetab.dtb</code> and <code>arch/arm64/boot/dts/allwinner/sun50i-a64-pinetab.dts</code> to the root of the <code>boot</code> partition.<br />
# <b>Modules</b> from <code>../linux_modules</code> to <code>/lib/modules</code> on the <code>boot</code> partition.<br />
<br />
=== Wlan Module ===<br />
<br />
On PinePhone we have mainline kernel driver. But in PineTab we must use https://github.com/Icenowy/rtl8723cs driver.<br />
<br />
==Nemo Mobile==<br />
<br />
For build last release of nemo use this ks file https://gist.github.com/neochapay/8d40f9ee1e5fd621e0053aa126d39e81<br />
<br />
==Sailfish OS==<br />
<br />
===Github & OBS project===<br />
<br />
- https://github.com/sailfish-on-dontbeevil<br />
<br />
- https://build.merproject.org/project/show/nemo:devel:hw:pine:dontbeevil<br />
<br />
===Flash rootFS===<br />
You can download the latest rootFS from the Gitlab SailfishOS Porters CI: https://gitlab.com/sailfishos-porters-ci/dont_be_evil-ci (see the artifacts of the latest CI job).<br />
<br />
This <code>tar.gz</code> archive should be burned to the <code>data</code> partition of the SD card.<br />
It's important to burn it as the root user (not with sudo) to preserve extended attributes and ACLs: <br />
<br />
sudo su<br />
bsdtar -xpf <SAILFISH OS ROOTFS>.tar.bz2 -C <MOUNTPOINT OF /DATA><br />
<br />
===Device repos===<br />
To boot Lipstick, you need to add the device specific repos to the devkit.<br />
All the following commands are executed in a shell on the devkit.<br />
<br />
''Make sure you configure the ethernet interface first before you continue!''<br />
''You need to have access to the WWW to fetch the necessary repository data and packages.''<br />
<br />
Install zypper manually:<br />
curl -o augeas-lib.rpm http://repo.merproject.org/obs/mer:/core/latest_armv7hl/armv7hl/augeas-libs-1.6.0+git1-1.10.6.armv7hl.rpm<br />
curl -o zypper.rpm http://repo.merproject.org/obs/mer:/core/latest_armv7hl/armv7hl/zypper-1.14.6+git3-1.24.5.armv7hl.rpm<br />
rpm -Uvh *rpm<br />
<br />
Use <code>ssu</code> to add the repo<br />
ssu ar common http://repo.merproject.org/obs/nemo:/devel:/hw:/common/sailfish_latest_armv7hl/<br />
ssu ar dontbeevil http://repo.merproject.org/obs/home:/piggz:/dontbeevil/sailfishos_3.0.3.9_latest_armv7hl/<br />
ssu ar jolla https://releases.jolla.com/releases/3.0.3.9/jolla/armv7hl/<br />
<br />
Refresh the repo:<br />
zypper refresh<br />
<br />
Install the device packages:<br />
zypper install dontbeevil:qt5-qtcore dontbeevil:qt5-qttest dontbeevil:lipstick-qt5<br />
zypper install droid-config-dontbeevil # Select 1 for vendor change<br />
zypper install droid-config-dontbeevil-sailfish<br />
zypper install qt5-plugin-platform-eglfs # EGLFS LIMA plugin<br />
zypper install qt5-plugin-generic-evdev # evdev input plugins<br />
<br />
Other useful packages<br />
zypper install mce-tools #useful for mcetool (mcetool -U activates the screen)<br />
<br />
===Unknown password===<br />
The Sailfish OS rootFS sets a random password when booting for the first time.<br />
You can only log in through the <code>telnet</code> debug interface.<br />
Since the <code>eth0</code> interface still requires manually setup, you can't access <code>telnet</code>.<br />
<br />
To circumvent this issue, you can login through the UART TTY interface. <br />
However you don't know the password of the <code>root</code> nor <code>nemo</code> users!<br />
To disable the <code>root</code> and <code>nemo</code> passwords, we can modify the <code>/etc/shadow</code> file:<br />
<br />
sudo chmod +w <SD card data partition>/etc/shadow<br />
sudo vim <SD card data partition>/etc/shadow # Remove any characters where <HASHED PASSWORD> is written: user1:<HASHED PASSWORD>:16092:0:99999:7:::.<br />
sudo chmod -w <SD card data partition>/etc/shadow<br />
<br />
By removing the hashed password, we can login with the user without entering a password.<br />
You can set a new password afterwards by running as a logged in user:<br />
<br />
passwd<br />
<br />
===Init eth0===<br />
Enabling the <code>eth0</code> interface has to be done manually for now:<br />
<br />
ifconfig eth0 <YOUR_IP><br />
route add default gw <DEFAULT_GATEWAY_IP><br />
echo "nameserver <DNS_SERVER_IP>" > /etc/resolv.conf<br />
<br />
Test your configuration with <code>ping</code>:<br />
<br />
ping jolla.com<br />
<br />
<br />
===Lipstick crashing===<br />
<br />
Install Lipstick from the <code>dontbeevil</code> repository:<br />
<br />
zypper install dontbeevil:lipstick-qt5<br />
<br />
===No setup wizard===<br />
<br />
Make sure the configuration package is installed:<br />
<br />
zypper install droid-config-dontbeevil-sailfish<br />
<br />
===Missing regulatory.db for RT8723BS WiFi/BT module===<br />
<br />
git clone git://git.kernel.org/pub/scm/linux/kernel/git/sforshee/wireless-regdb.git<br />
cd wireless-regdb<br />
cp regulatory* /lib/firmware</div>Dylanvanasschttps://wiki.merproject.org/wiki/Adaptations/PinePhone64Adaptations/PinePhone642019-09-11T18:37:30Z<p>Dylanvanassc: /* Hardware Support */</p>
<hr />
<div>=Hardware Support=<br />
<br />
Full information of hardware spec [https://wiki.pine64.org/index.php/Project_Don't_be_evil Here]<br />
<br />
PostMarket OS hardware information [https://wiki.postmarketos.org/wiki/Pine_Don%27t_be_evil_devkit_(pine-dontbeevil) PostMarketOS Wiki]<br />
<br />
==Modem EC25==<br />
<br />
===Setup===<br />
<br />
1. Make sure that the <code>qmimodem</code> plugin is enabled in the <code>.spec</code> of <code>ofono</code>.<br />
<br />
2. Remove the <code>noplugin.conf</code> file under <code>/lib/environment/ofono/noplugin.conf</code>.<br />
<br />
3. Restart <code>ofono</code><br />
systemctl restart ofono<br />
<br />
4. Check if the QMI modem is properly detected:<br />
/usr/lib/ofono/test/list-modems<br />
<br />
5. Unlock you SIM card (if needed):<br />
/usr/lib/ofono/test/enter-pin /quectelqmi_0 pin <PIN CODE><br />
<br />
The EC25 Quectel modem is now ready :)<br />
Thanks to SuperPrower for the hard work!<br />
<br />
===Sending SMS===<br />
<br />
/usr/lib/ofono/test/send-sms <PHONE NUMBER RECEIVER> <MESSAGE> <DELIVERY REPORT><br />
<br />
To skip the delivery report, use <code>0</code> as argument.<br />
<br />
==Cameras==<br />
<br />
Thanks to: https://wiki.postmarketos.org/wiki/Pine_Don't_be_evil_devkit_(pine-dontbeevil)#Cameras<br />
Only the back camera is supported by the mainline kernel.<br />
To use it, you need to configure it first:<br />
<br />
media-ctl --set-v4l2 '"ov5640 2-003c":0[fmt:UYVY8_2X8/1280x7200]' -d /dev/media1<br />
<br />
Afterwards, you can take a picture with:<br />
<br />
ffmpeg -s 1280x720 -f video4linux2 -i /dev/video1 -vframes 1 selfie.jpg<br />
<br />
- <code>/dev/media1</code> is the controller interface of the back camera<br />
<br />
- <code>/dev/video1</code> is the back camera stream interface<br />
<br />
If that works, you can try <code>gstreamer</code> to make the camera available for system wide usage:]<br />
<br />
gst-launch-1.0 v4l2src device=/dev/video1 num-buffers=1 ! 'video/x-raw,format=UYVY,width=1280,height=720' ! jpegenc ! filesink location=selfie.jpg<br />
cp selfie.jpg /home/nemo/Pictures<br />
<br />
This command generates a <code>selfie.jpg</code> file and by copying it to <code>/home/nemo/Pictures</code> you can view it with the Gallery app.<br />
<br />
== Audio ==<br />
<br />
Unmuting the <code>AIF0</code><br />
<br />
==PineTab==<br />
<br />
In pinetab we have jack to uart port cable. For enable UART console move selector nearby sd-card slot away from sd-card slot.<br />
<br />
==Testing the vibrator motor==<br />
<br />
You need to have the <code>CONFIG_GPIO_SYSFS</code> enabled in your kernel config for this!<br />
<br />
Vibrator motor is on pin <code>PD2</code>.<br />
You can calculate the PIN number for PD2 as followed ([https://linux-sunxi.org/GPIO more information]):<br />
<code>(4-1) * 32 + 2 = 98</code><br />
<br />
echo "98" > /sys/class/gpio/export # Make pin available<br />
echo "out" > /sys/class/gpio/gpio98/direction # Set as output<br />
echo "1" > /sys/class/gpio/gpio98/value # On<br />
echo "1" > /sys/class/gpio/gpio98/value # Off<br />
echo "98" > /sys/class/gpio/unexport # When you're done<br />
<br />
==Notification LED==<br />
<br />
export COLOR=red # or green, blue is broken due to a hardware fault<br />
# Activate LED<br />
echo 1 > /sys/class/leds/$COLOR/brightness<br />
# Deactivate LED<br />
echo 0 > /sys/class/leds/$COLOR/brightness<br />
<br />
The LED can be controlled in Mer by MCE. You need the <code>mce-plugin-libhybris-nondroid</code> for this.<br />
<br />
=Installation=<br />
==Prepare SD card==<br />
<br />
Use GParted or any other tool to create the following <code>EXT4</code> partitions:<br />
<br />
# <b>boot</b>: Holds the mainline kernel Image and Device Tree files<br />
# <b>data</b>: Holds the Sailfish OS rootFS<br />
<br />
GParted will ask you to leave the first MB free of the SD card when creating the first partition, this is correct.<br />
This 1 MB will be used to store the U-boot boot loader.<br />
<br />
==U-Boot==<br />
<br />
We will now build the mainline U-boot boot loader from Git.<br />
<br />
=== Clone U-boot (master branch): ===<br />
<br />
You can find the U-boot mirror repository on Github:<br />
<br />
git clone github.com/u-boot/u-boot<br />
<br />
=== Compile U-boot ===<br />
<br />
You have to cross compile U-boot with the <code>arm64</code> arch:<br />
<br />
export CROSS_COMPILE=aarch64-linux-gnu-<br />
ARCH=arm64 make clean<br />
ARCH=arm64 make sopine_baseboard_defconfig<br />
ARCH=arm64 make<br />
<br />
The <code>sopine_baseboard_defconfig</code> is the same for the Don't Be Evil devkit.<br />
<br />
=== Burn U-boot to your SD card ===<br />
<br />
Copy the compiled U-boot bootloader to the first sector on your SD card:<br />
<br />
sudo dd if=u-boot-sunxi-with-spl.bin of=/dev/sdX bs=8k seek=1<br />
<br />
<br />
=== Manually loading the kernel ===<br />
<br />
Serial TTY Baudrate over UART = 115200 for screen, example: <code>screen /dev/ttyUSB0 115200</code><br />
You have to start screen first, before turning on the devkit.<br />
<br />
Interrupt the U-boot autoboot process when you see a message in the U-boot prompt. <br />
We need to access the U-boot prompt to load the Kernel image and boot it manually!<br />
<br />
Set bootargs:<br />
<br />
setenv bootargs root=/dev/mmcblk0p2 rootwait panic=10<br />
<br />
Kernel Image loading and Device Tree files:<br />
<br />
ext4load mmc 0:1 ${kernel_addr_r} /Image <br />
ext4load mmc 0:1 ${fdt_addr_r} /sun50i-a64-dontbeevil.dtb <br />
<br />
Boot the kernel:<br />
<br />
booti ${kernel_addr_r} - ${fdt_addr_r}<br />
<br />
=== Automatic boot ===<br />
<br />
Create a <code>boot.cmd</code> file:<br />
<br />
echo Setting bootargs<br />
setenv bootargs console=tty0 console=ttyS0,115200 root=/dev/mmcblk0p2 no_console_suspend rootwait <br />
earlycon=uart,mmio32,0x01c28000 panic=10 consoleblank=0 loglevel=1<br />
printenv<br />
echo Loading DTB<br />
load mmc 0:1 ${fdt_addr_r} /sun50i-a64-dontbeevil.dtb<br />
echo Loading kernel Image<br />
load mmc 0:1 ${kernel_addr_r} /Image<br />
echo Booting kernel NOW<br />
booti ${kernel_addr_r} - ${fdt_addr_r}<br />
<br />
Mount your <code>boot</code> partition and run the following command:<br />
sudo mkimage -C none -A arm -T script -d /mnt/boot.cmd /mnt/boot.scr<br />
<br />
This will translate the <code>boot.cmd</code> file into a U-boot script.<br />
<br />
If you don't have the <code>mkimage</code> command available, you can install it from the <code>uboot-tools</code> package.<br />
<br />
==Kernel==<br />
<br />
The PinePhone runs a mainline kernel, device tree modifications are done by all the PinePhone OS developers on Gitlab (https://gitlab.com/pine64-org/linux).<br />
<br />
=== Clone the kernel ===<br />
<br />
git clone https://gitlab.com/pine64-org/linux<br />
cd linux<br />
git checkout pinephone-dontbeevil<br />
<br />
=== Configure the kernel ===<br />
<br />
# <b>Copy our kernel config</b>: https://gitlab.com/pinephone-sailfish-os/linux-kernel/raw/master/pinephone-config<br />
# <b>Enter the <code>linux</code> project</b>: <code>cd linux</code><br />
# <b>Copy the config file</b> to <code>.config</code> in the main directory<br />
<br />
=== Build the kernel ===<br />
<br />
We cross compile the kernel for ARM64.<br />
The <code>LOCALVERSION</code> variable can be used to add a version to the build.<br />
<br />
Cross compile the kernel:<br />
export ARCH=arm64<br />
export CROSS_COMPILE=aarch64-linux-gnu-<br />
export LOCALVERSION=-nemo<br />
make clean<br />
make oldconfig<br />
make Image modules dtbs<br />
<br />
Install the kernel modules in a different path: <br />
make modules_install INSTALL_MOD_PATH=../linux_modules/<br />
<br />
=== Install kernel ===<br />
<br />
Copy the following things:<br />
<br />
# <b>Image</b> from <code>arch/arm64/boot/Image</code> to the root of the <code>boot</code> partition.<br />
# <b>Device tree files</b> <br />
For pinethone <code>arch/arm64/boot/dts/allwinner/sun50i-a64-dontbeevil.dtb</code> and <code>arch/arm64/boot/dts/allwinner/sun50i-a64-dontbeevil.dts</code> to the root of the <code>boot</code> partition.<br />
<br />
For pinetab <code>arch/arm64/boot/dts/allwinner/sun50i-a64-pinetab.dtb</code> and <code>arch/arm64/boot/dts/allwinner/sun50i-a64-pinetab.dts</code> to the root of the <code>boot</code> partition.<br />
# <b>Modules</b> from <code>../linux_modules</code> to <code>/lib/modules</code> on the <code>boot</code> partition.<br />
<br />
=== Wlan Module ===<br />
<br />
On PinePhone we have mainline kernel driver. But in PineTab we must use https://github.com/Icenowy/rtl8723cs driver.<br />
<br />
==Nemo Mobile==<br />
<br />
For build last release of nemo use this ks file https://gist.github.com/neochapay/8d40f9ee1e5fd621e0053aa126d39e81<br />
<br />
==Sailfish OS==<br />
<br />
===Github & OBS project===<br />
<br />
- https://github.com/sailfish-on-dontbeevil<br />
<br />
- https://build.merproject.org/project/show/nemo:devel:hw:pine:dontbeevil<br />
<br />
===Flash rootFS===<br />
You can download the latest rootFS from the Gitlab SailfishOS Porters CI: https://gitlab.com/sailfishos-porters-ci/dont_be_evil-ci (see the artifacts of the latest CI job).<br />
<br />
This <code>tar.gz</code> archive should be burned to the <code>data</code> partition of the SD card.<br />
It's important to burn it as the root user (not with sudo) to preserve extended attributes and ACLs: <br />
<br />
sudo su<br />
bsdtar -xpf <SAILFISH OS ROOTFS>.tar.bz2 -C <MOUNTPOINT OF /DATA><br />
<br />
===Device repos===<br />
To boot Lipstick, you need to add the device specific repos to the devkit.<br />
All the following commands are executed in a shell on the devkit.<br />
<br />
''Make sure you configure the ethernet interface first before you continue!''<br />
''You need to have access to the WWW to fetch the necessary repository data and packages.''<br />
<br />
Install zypper manually:<br />
curl -o augeas-lib.rpm http://repo.merproject.org/obs/mer:/core/latest_armv7hl/armv7hl/augeas-libs-1.6.0+git1-1.10.6.armv7hl.rpm<br />
curl -o zypper.rpm http://repo.merproject.org/obs/mer:/core/latest_armv7hl/armv7hl/zypper-1.14.6+git3-1.24.5.armv7hl.rpm<br />
rpm -Uvh *rpm<br />
<br />
Use <code>ssu</code> to add the repo<br />
ssu ar common http://repo.merproject.org/obs/nemo:/devel:/hw:/common/sailfish_latest_armv7hl/<br />
ssu ar dontbeevil http://repo.merproject.org/obs/home:/piggz:/dontbeevil/sailfishos_3.0.3.9_latest_armv7hl/<br />
ssu ar jolla https://releases.jolla.com/releases/3.0.3.9/jolla/armv7hl/<br />
<br />
Refresh the repo:<br />
zypper refresh<br />
<br />
Install the device packages:<br />
zypper install dontbeevil:qt5-qtcore dontbeevil:qt5-qttest dontbeevil:lipstick-qt5<br />
zypper install droid-config-dontbeevil # Select 1 for vendor change<br />
zypper install droid-config-dontbeevil-sailfish<br />
zypper install qt5-plugin-platform-eglfs # EGLFS LIMA plugin<br />
zypper install qt5-plugin-generic-evdev # evdev input plugins<br />
<br />
Other useful packages<br />
zypper install mce-tools #useful for mcetool (mcetool -U activates the screen)<br />
<br />
===Unknown password===<br />
The Sailfish OS rootFS sets a random password when booting for the first time.<br />
You can only log in through the <code>telnet</code> debug interface.<br />
Since the <code>eth0</code> interface still requires manually setup, you can't access <code>telnet</code>.<br />
<br />
To circumvent this issue, you can login through the UART TTY interface. <br />
However you don't know the password of the <code>root</code> nor <code>nemo</code> users!<br />
To disable the <code>root</code> and <code>nemo</code> passwords, we can modify the <code>/etc/shadow</code> file:<br />
<br />
sudo chmod +w <SD card data partition>/etc/shadow<br />
sudo vim <SD card data partition>/etc/shadow # Remove any characters where <HASHED PASSWORD> is written: user1:<HASHED PASSWORD>:16092:0:99999:7:::.<br />
sudo chmod -w <SD card data partition>/etc/shadow<br />
<br />
By removing the hashed password, we can login with the user without entering a password.<br />
You can set a new password afterwards by running as a logged in user:<br />
<br />
passwd<br />
<br />
===Init eth0===<br />
Enabling the <code>eth0</code> interface has to be done manually for now:<br />
<br />
ifconfig eth0 <YOUR_IP><br />
route add default gw <DEFAULT_GATEWAY_IP><br />
echo "nameserver <DNS_SERVER_IP>" > /etc/resolv.conf<br />
<br />
Test your configuration with <code>ping</code>:<br />
<br />
ping jolla.com<br />
<br />
<br />
===Lipstick crashing===<br />
<br />
Install Lipstick from the <code>dontbeevil</code> repository:<br />
<br />
zypper install dontbeevil:lipstick-qt5<br />
<br />
===No setup wizard===<br />
<br />
Make sure the configuration package is installed:<br />
<br />
zypper install droid-config-dontbeevil-sailfish<br />
<br />
===Missing regulatory.db for RT8723BS WiFi/BT module===<br />
<br />
git clone git://git.kernel.org/pub/scm/linux/kernel/git/sforshee/wireless-regdb.git<br />
cd wireless-regdb<br />
cp regulatory* /lib/firmware</div>Dylanvanasschttps://wiki.merproject.org/wiki/Adaptations/PinePhone64Adaptations/PinePhone642019-09-11T08:12:16Z<p>Dylanvanassc: /* Cameras */</p>
<hr />
<div>=Hardware Support=<br />
<br />
Full information of hardware spec [https://wiki.pine64.org/index.php/Project_Don't_be_evil Here]<br />
<br />
PostMarket OS hardware information [https://wiki.postmarketos.org/wiki/Pine_Don%27t_be_evil_devkit_(pine-dontbeevil) PostMarketOS Wiki]<br />
<br />
==Modem EC25==<br />
<br />
===Setup===<br />
<br />
1. Make sure that the <code>qmimodem</code> plugin is enabled in the <code>.spec</code> of <code>ofono</code>.<br />
<br />
2. Remove the <code>noplugin.conf</code> file under <code>/lib/environment/ofono/noplugin.conf</code>.<br />
<br />
3. Restart <code>ofono</code><br />
systemctl restart ofono<br />
<br />
4. Check if the QMI modem is properly detected:<br />
/usr/lib/ofono/test/list-modems<br />
<br />
5. Unlock you SIM card (if needed):<br />
/usr/lib/ofono/test/enter-pin /quectelqmi_0 pin <PIN CODE><br />
<br />
The EC25 Quectel modem is now ready :)<br />
Thanks to SuperPrower for the hard work!<br />
<br />
===Sending SMS===<br />
<br />
/usr/lib/ofono/test/send-sms <PHONE NUMBER RECEIVER> <MESSAGE> <DELIVERY REPORT><br />
<br />
To skip the delivery report, use <code>0</code> as argument.<br />
<br />
==Cameras==<br />
<br />
Thanks to: https://wiki.postmarketos.org/wiki/Pine_Don't_be_evil_devkit_(pine-dontbeevil)#Cameras<br />
Only the back camera is supported by the mainline kernel.<br />
To use it, you need to configure it first:<br />
<br />
media-ctl --set-v4l2 '"ov5640 2-003c":0[fmt:UYVY8_2X8/1280x7200]' -d /dev/media1<br />
<br />
Afterwards, you can take a picture with:<br />
<br />
ffmpeg -s 1280x720 -f video4linux2 -i /dev/video1 -vframes 1 selfie.jpg<br />
<br />
- <code>/dev/media1</code> is the controller interface of the back camera<br />
<br />
- <code>/dev/video1</code> is the back camera stream interface<br />
<br />
If that works, you can try <code>gstreamer</code> to make the camera available for system wide usage:]<br />
<br />
gst-launch-1.0 v4l2src device=/dev/video1 num-buffers=1 ! 'video/x-raw,format=UYVY,width=1280,height=720' ! jpegenc ! filesink location=selfie.jpg<br />
cp selfie.jpg /home/nemo/Pictures<br />
<br />
This command generates a <code>selfie.jpg</code> file and by copying it to <code>/home/nemo/Pictures</code> you can view it with the Gallery app.<br />
<br />
==PineTab==<br />
<br />
In pinetab we have jack to uart port cable. For enable UART console move selector nearby sd-card slot away from sd-card slot.<br />
<br />
==Testing the vibrator motor==<br />
<br />
You need to have the <code>CONFIG_GPIO_SYSFS</code> enabled in your kernel config for this!<br />
<br />
Vibrator motor is on pin <code>PD2</code>.<br />
You can calculate the PIN number for PD2 as followed ([https://linux-sunxi.org/GPIO more information]):<br />
<code>(4-1) * 32 + 2 = 98</code><br />
<br />
echo "98" > /sys/class/gpio/export # Make pin available<br />
echo "out" > /sys/class/gpio/gpio98/direction # Set as output<br />
echo "1" > /sys/class/gpio/gpio98/value # On<br />
echo "1" > /sys/class/gpio/gpio98/value # Off<br />
echo "98" > /sys/class/gpio/unexport # When you're done<br />
<br />
==Notification LED==<br />
<br />
export COLOR=red # or green, blue is broken due to a hardware fault<br />
# Activate LED<br />
echo 1 > /sys/class/leds/$COLOR/brightness<br />
# Deactivate LED<br />
echo 0 > /sys/class/leds/$COLOR/brightness<br />
<br />
The LED can be controlled in Mer by MCE. You need the <code>mce-plugin-libhybris-nondroid</code> for this.<br />
<br />
=Installation=<br />
==Prepare SD card==<br />
<br />
Use GParted or any other tool to create the following <code>EXT4</code> partitions:<br />
<br />
# <b>boot</b>: Holds the mainline kernel Image and Device Tree files<br />
# <b>data</b>: Holds the Sailfish OS rootFS<br />
<br />
GParted will ask you to leave the first MB free of the SD card when creating the first partition, this is correct.<br />
This 1 MB will be used to store the U-boot boot loader.<br />
<br />
==U-Boot==<br />
<br />
We will now build the mainline U-boot boot loader from Git.<br />
<br />
=== Clone U-boot (master branch): ===<br />
<br />
You can find the U-boot mirror repository on Github:<br />
<br />
git clone github.com/u-boot/u-boot<br />
<br />
=== Compile U-boot ===<br />
<br />
You have to cross compile U-boot with the <code>arm64</code> arch:<br />
<br />
export CROSS_COMPILE=aarch64-linux-gnu-<br />
ARCH=arm64 make clean<br />
ARCH=arm64 make sopine_baseboard_defconfig<br />
ARCH=arm64 make<br />
<br />
The <code>sopine_baseboard_defconfig</code> is the same for the Don't Be Evil devkit.<br />
<br />
=== Burn U-boot to your SD card ===<br />
<br />
Copy the compiled U-boot bootloader to the first sector on your SD card:<br />
<br />
sudo dd if=u-boot-sunxi-with-spl.bin of=/dev/sdX bs=8k seek=1<br />
<br />
<br />
=== Manually loading the kernel ===<br />
<br />
Serial TTY Baudrate over UART = 115200 for screen, example: <code>screen /dev/ttyUSB0 115200</code><br />
You have to start screen first, before turning on the devkit.<br />
<br />
Interrupt the U-boot autoboot process when you see a message in the U-boot prompt. <br />
We need to access the U-boot prompt to load the Kernel image and boot it manually!<br />
<br />
Set bootargs:<br />
<br />
setenv bootargs root=/dev/mmcblk0p2 rootwait panic=10<br />
<br />
Kernel Image loading and Device Tree files:<br />
<br />
ext4load mmc 0:1 ${kernel_addr_r} /Image <br />
ext4load mmc 0:1 ${fdt_addr_r} /sun50i-a64-dontbeevil.dtb <br />
<br />
Boot the kernel:<br />
<br />
booti ${kernel_addr_r} - ${fdt_addr_r}<br />
<br />
=== Automatic boot ===<br />
<br />
Create a <code>boot.cmd</code> file:<br />
<br />
echo Setting bootargs<br />
setenv bootargs console=tty0 console=ttyS0,115200 root=/dev/mmcblk0p2 no_console_suspend rootwait <br />
earlycon=uart,mmio32,0x01c28000 panic=10 consoleblank=0 loglevel=1<br />
printenv<br />
echo Loading DTB<br />
load mmc 0:1 ${fdt_addr_r} /sun50i-a64-dontbeevil.dtb<br />
echo Loading kernel Image<br />
load mmc 0:1 ${kernel_addr_r} /Image<br />
echo Booting kernel NOW<br />
booti ${kernel_addr_r} - ${fdt_addr_r}<br />
<br />
Mount your <code>boot</code> partition and run the following command:<br />
sudo mkimage -C none -A arm -T script -d /mnt/boot.cmd /mnt/boot.scr<br />
<br />
This will translate the <code>boot.cmd</code> file into a U-boot script.<br />
<br />
If you don't have the <code>mkimage</code> command available, you can install it from the <code>uboot-tools</code> package.<br />
<br />
==Kernel==<br />
<br />
The PinePhone runs a mainline kernel, device tree modifications are done by all the PinePhone OS developers on Gitlab (https://gitlab.com/pine64-org/linux).<br />
<br />
=== Clone the kernel ===<br />
<br />
git clone https://gitlab.com/pine64-org/linux<br />
cd linux<br />
git checkout pinephone-dontbeevil<br />
<br />
=== Configure the kernel ===<br />
<br />
# <b>Copy our kernel config</b>: https://gitlab.com/pinephone-sailfish-os/linux-kernel/raw/master/pinephone-config<br />
# <b>Enter the <code>linux</code> project</b>: <code>cd linux</code><br />
# <b>Copy the config file</b> to <code>.config</code> in the main directory<br />
<br />
=== Build the kernel ===<br />
<br />
We cross compile the kernel for ARM64.<br />
The <code>LOCALVERSION</code> variable can be used to add a version to the build.<br />
<br />
Cross compile the kernel:<br />
export ARCH=arm64<br />
export CROSS_COMPILE=aarch64-linux-gnu-<br />
export LOCALVERSION=-nemo<br />
make clean<br />
make oldconfig<br />
make Image modules dtbs<br />
<br />
Install the kernel modules in a different path: <br />
make modules_install INSTALL_MOD_PATH=../linux_modules/<br />
<br />
=== Install kernel ===<br />
<br />
Copy the following things:<br />
<br />
# <b>Image</b> from <code>arch/arm64/boot/Image</code> to the root of the <code>boot</code> partition.<br />
# <b>Device tree files</b> <br />
For pinethone <code>arch/arm64/boot/dts/allwinner/sun50i-a64-dontbeevil.dtb</code> and <code>arch/arm64/boot/dts/allwinner/sun50i-a64-dontbeevil.dts</code> to the root of the <code>boot</code> partition.<br />
<br />
For pinetab <code>arch/arm64/boot/dts/allwinner/sun50i-a64-pinetab.dtb</code> and <code>arch/arm64/boot/dts/allwinner/sun50i-a64-pinetab.dts</code> to the root of the <code>boot</code> partition.<br />
# <b>Modules</b> from <code>../linux_modules</code> to <code>/lib/modules</code> on the <code>boot</code> partition.<br />
<br />
=== Wlan Module ===<br />
<br />
On PinePhone we have mainline kernel driver. But in PineTab we must use https://github.com/Icenowy/rtl8723cs driver.<br />
<br />
==Nemo Mobile==<br />
<br />
For build last release of nemo use this ks file https://gist.github.com/neochapay/8d40f9ee1e5fd621e0053aa126d39e81<br />
<br />
==Sailfish OS==<br />
<br />
===Github & OBS project===<br />
<br />
- https://github.com/sailfish-on-dontbeevil<br />
<br />
- https://build.merproject.org/project/show/nemo:devel:hw:pine:dontbeevil<br />
<br />
===Flash rootFS===<br />
You can download the latest rootFS from the Gitlab SailfishOS Porters CI: https://gitlab.com/sailfishos-porters-ci/dont_be_evil-ci (see the artifacts of the latest CI job).<br />
<br />
This <code>tar.gz</code> archive should be burned to the <code>data</code> partition of the SD card.<br />
It's important to burn it as the root user (not with sudo) to preserve extended attributes and ACLs: <br />
<br />
sudo su<br />
bsdtar -xpf <SAILFISH OS ROOTFS>.tar.bz2 -C <MOUNTPOINT OF /DATA><br />
<br />
===Device repos===<br />
To boot Lipstick, you need to add the device specific repos to the devkit.<br />
All the following commands are executed in a shell on the devkit.<br />
<br />
''Make sure you configure the ethernet interface first before you continue!''<br />
''You need to have access to the WWW to fetch the necessary repository data and packages.''<br />
<br />
Install zypper manually:<br />
curl -o augeas-lib.rpm http://repo.merproject.org/obs/mer:/core/latest_armv7hl/armv7hl/augeas-libs-1.6.0+git1-1.10.6.armv7hl.rpm<br />
curl -o zypper.rpm http://repo.merproject.org/obs/mer:/core/latest_armv7hl/armv7hl/zypper-1.14.6+git3-1.24.5.armv7hl.rpm<br />
rpm -Uvh *rpm<br />
<br />
Use <code>ssu</code> to add the repo<br />
ssu ar common http://repo.merproject.org/obs/nemo:/devel:/hw:/common/sailfish_latest_armv7hl/<br />
ssu ar dontbeevil http://repo.merproject.org/obs/home:/piggz:/dontbeevil/sailfishos_3.0.3.9_latest_armv7hl/<br />
ssu ar jolla https://releases.jolla.com/releases/3.0.3.9/jolla/armv7hl/<br />
<br />
Refresh the repo:<br />
zypper refresh<br />
<br />
Install the device packages:<br />
zypper install dontbeevil:qt5-qtcore dontbeevil:qt5-qttest dontbeevil:lipstick-qt5<br />
zypper install droid-config-dontbeevil # Select 1 for vendor change<br />
zypper install droid-config-dontbeevil-sailfish<br />
zypper install qt5-plugin-platform-eglfs # EGLFS LIMA plugin<br />
zypper install qt5-plugin-generic-evdev # evdev input plugins<br />
<br />
Other useful packages<br />
zypper install mce-tools #useful for mcetool (mcetool -U activates the screen)<br />
<br />
===Unknown password===<br />
The Sailfish OS rootFS sets a random password when booting for the first time.<br />
You can only log in through the <code>telnet</code> debug interface.<br />
Since the <code>eth0</code> interface still requires manually setup, you can't access <code>telnet</code>.<br />
<br />
To circumvent this issue, you can login through the UART TTY interface. <br />
However you don't know the password of the <code>root</code> nor <code>nemo</code> users!<br />
To disable the <code>root</code> and <code>nemo</code> passwords, we can modify the <code>/etc/shadow</code> file:<br />
<br />
sudo chmod +w <SD card data partition>/etc/shadow<br />
sudo vim <SD card data partition>/etc/shadow # Remove any characters where <HASHED PASSWORD> is written: user1:<HASHED PASSWORD>:16092:0:99999:7:::.<br />
sudo chmod -w <SD card data partition>/etc/shadow<br />
<br />
By removing the hashed password, we can login with the user without entering a password.<br />
You can set a new password afterwards by running as a logged in user:<br />
<br />
passwd<br />
<br />
===Init eth0===<br />
Enabling the <code>eth0</code> interface has to be done manually for now:<br />
<br />
ifconfig eth0 <YOUR_IP><br />
route add default gw <DEFAULT_GATEWAY_IP><br />
echo "nameserver <DNS_SERVER_IP>" > /etc/resolv.conf<br />
<br />
Test your configuration with <code>ping</code>:<br />
<br />
ping jolla.com<br />
<br />
<br />
===Lipstick crashing===<br />
<br />
Install Lipstick from the <code>dontbeevil</code> repository:<br />
<br />
zypper install dontbeevil:lipstick-qt5<br />
<br />
===No setup wizard===<br />
<br />
Make sure the configuration package is installed:<br />
<br />
zypper install droid-config-dontbeevil-sailfish<br />
<br />
===Missing regulatory.db for RT8723BS WiFi/BT module===<br />
<br />
git clone git://git.kernel.org/pub/scm/linux/kernel/git/sforshee/wireless-regdb.git<br />
cd wireless-regdb<br />
cp regulatory* /lib/firmware</div>Dylanvanasschttps://wiki.merproject.org/wiki/Adaptations/PinePhone64Adaptations/PinePhone642019-09-03T16:54:42Z<p>Dylanvanassc: /* Cameras */</p>
<hr />
<div>=Hardware Support=<br />
<br />
Full information of hardware spec [https://wiki.pine64.org/index.php/Project_Don't_be_evil Here]<br />
<br />
PostMarket OS hardware information [https://wiki.postmarketos.org/wiki/Pine_Don%27t_be_evil_devkit_(pine-dontbeevil) PostMarketOS Wiki]<br />
<br />
==Modem EC25==<br />
<br />
===Setup===<br />
<br />
1. Make sure that the <code>qmimodem</code> plugin is enabled in the <code>.spec</code> of <code>ofono</code>.<br />
<br />
2. Remove the <code>noplugin.conf</code> file under <code>/lib/environment/ofono/noplugin.conf</code>.<br />
<br />
3. Restart <code>ofono</code><br />
systemctl restart ofono<br />
<br />
4. Check if the QMI modem is properly detected:<br />
/usr/lib/ofono/test/list-modems<br />
<br />
5. Unlock you SIM card (if needed):<br />
/usr/lib/ofono/test/enter-pin /quectelqmi_0 pin <PIN CODE><br />
<br />
The EC25 Quectel modem is now ready :)<br />
Thanks to SuperPrower for the hard work!<br />
<br />
===Sending SMS===<br />
<br />
/usr/lib/ofono/test/send-sms <PHONE NUMBER RECEIVER> <MESSAGE> <DELIVERY REPORT><br />
<br />
To skip the delivery report, use <code>0</code> as argument.<br />
<br />
==Cameras==<br />
<br />
Thanks to: https://wiki.postmarketos.org/wiki/Pine_Don't_be_evil_devkit_(pine-dontbeevil)#Cameras<br />
Only the back camera is supported by the mainline kernel.<br />
To use it, you need to configure it first:<br />
<br />
media-ctl --set-v4l2 '"ov5640 2-003c":0[fmt:UYVY8_2X8/1280x7200]' -d /dev/media1<br />
<br />
Afterwards, you can take a picture with:<br />
<br />
ffmpeg -s 1280x720 -f video4linux2 -i /dev/video1 -vframes 1 selfie.jpg<br />
<br />
This last part is not tested yet (WIP)<br />
<br />
- <code>/dev/media1</code> is the controller interface of the back camera<br />
<br />
- <code>/dev/video1</code> is the back camera stream interface<br />
<br />
==PineTab==<br />
<br />
In pinetab we have jack to uart port cable. For enable UART console move selector nearby sd-card slot away from sd-card slot.<br />
<br />
==Testing the vibrator motor==<br />
<br />
You need to have the <code>CONFIG_GPIO_SYSFS</code> enabled in your kernel config for this!<br />
<br />
Vibrator motor is on pin <code>PD2</code>.<br />
You can calculate the PIN number for PD2 as followed ([https://linux-sunxi.org/GPIO more information]):<br />
<code>(4-1) * 32 + 2 = 98</code><br />
<br />
echo "98" > /sys/class/gpio/export # Make pin available<br />
echo "out" > /sys/class/gpio/gpio98/direction # Set as output<br />
echo "1" > /sys/class/gpio/gpio98/value # On<br />
echo "1" > /sys/class/gpio/gpio98/value # Off<br />
echo "98" > /sys/class/gpio/unexport # When you're done<br />
<br />
==Notification LED==<br />
<br />
export COLOR=red # or green, blue is broken due to a hardware fault<br />
# Activate LED<br />
echo 1 > /sys/class/leds/$COLOR/brightness<br />
# Deactivate LED<br />
echo 0 > /sys/class/leds/$COLOR/brightness<br />
<br />
The LED can be controlled in Mer by MCE. You need the <code>mce-plugin-libhybris-nondroid</code> for this.<br />
<br />
=Installation=<br />
==Prepare SD card==<br />
<br />
Use GParted or any other tool to create the following <code>EXT4</code> partitions:<br />
<br />
# <b>boot</b>: Holds the mainline kernel Image and Device Tree files<br />
# <b>data</b>: Holds the Sailfish OS rootFS<br />
<br />
GParted will ask you to leave the first MB free of the SD card when creating the first partition, this is correct.<br />
This 1 MB will be used to store the U-boot boot loader.<br />
<br />
==U-Boot==<br />
<br />
We will now build the mainline U-boot boot loader from Git.<br />
<br />
=== Clone U-boot (master branch): ===<br />
<br />
You can find the U-boot mirror repository on Github:<br />
<br />
git clone github.com/u-boot/u-boot<br />
<br />
=== Compile U-boot ===<br />
<br />
You have to cross compile U-boot with the <code>arm64</code> arch:<br />
<br />
export CROSS_COMPILE=aarch64-linux-gnu-<br />
ARCH=arm64 make clean<br />
ARCH=arm64 make sopine_baseboard_defconfig<br />
ARCH=arm64 make<br />
<br />
The <code>sopine_baseboard_defconfig</code> is the same for the Don't Be Evil devkit.<br />
<br />
=== Burn U-boot to your SD card ===<br />
<br />
Copy the compiled U-boot bootloader to the first sector on your SD card:<br />
<br />
sudo dd if=u-boot-sunxi-with-spl.bin of=/dev/sdX bs=8k seek=1<br />
<br />
<br />
=== Manually loading the kernel ===<br />
<br />
Serial TTY Baudrate over UART = 115200 for screen, example: <code>screen /dev/ttyUSB0 115200</code><br />
You have to start screen first, before turning on the devkit.<br />
<br />
Interrupt the U-boot autoboot process when you see a message in the U-boot prompt. <br />
We need to access the U-boot prompt to load the Kernel image and boot it manually!<br />
<br />
Set bootargs:<br />
<br />
setenv bootargs root=/dev/mmcblk0p2 rootwait panic=10<br />
<br />
Kernel Image loading and Device Tree files:<br />
<br />
ext4load mmc 0:1 ${kernel_addr_r} /Image <br />
ext4load mmc 0:1 ${fdt_addr_r} /sun50i-a64-dontbeevil.dtb <br />
<br />
Boot the kernel:<br />
<br />
booti ${kernel_addr_r} - ${fdt_addr_r}<br />
<br />
=== Automatic boot ===<br />
<br />
Create a <code>boot.cmd</code> file:<br />
<br />
echo Setting bootargs<br />
setenv bootargs console=tty0 console=ttyS0,115200 root=/dev/mmcblk0p2 no_console_suspend rootwait <br />
earlycon=uart,mmio32,0x01c28000 panic=10 consoleblank=0 loglevel=1<br />
printenv<br />
echo Loading DTB<br />
load mmc 0:1 ${fdt_addr_r} /sun50i-a64-dontbeevil.dtb<br />
echo Loading kernel Image<br />
load mmc 0:1 ${kernel_addr_r} /Image<br />
echo Booting kernel NOW<br />
booti ${kernel_addr_r} - ${fdt_addr_r}<br />
<br />
Mount your <code>boot</code> partition and run the following command:<br />
sudo mkimage -C none -A arm -T script -d /mnt/boot.cmd /mnt/boot.scr<br />
<br />
This will translate the <code>boot.cmd</code> file into a U-boot script.<br />
<br />
If you don't have the <code>mkimage</code> command available, you can install it from the <code>uboot-tools</code> package.<br />
<br />
==Kernel==<br />
<br />
The PinePhone runs a mainline kernel, device tree modifications are done by all the PinePhone OS developers on Gitlab (https://gitlab.com/pine64-org/linux).<br />
<br />
=== Clone the kernel ===<br />
<br />
git clone https://gitlab.com/pine64-org/linux<br />
cd linux<br />
git checkout pinephone-dontbeevil<br />
<br />
=== Configure the kernel ===<br />
<br />
# <b>Copy our kernel config</b>: https://gitlab.com/pinephone-sailfish-os/linux-kernel/raw/master/pinephone-config<br />
# <b>Enter the <code>linux</code> project</b>: <code>cd linux</code><br />
# <b>Copy the config file</b> to <code>.config</code> in the main directory<br />
<br />
=== Build the kernel ===<br />
<br />
We cross compile the kernel for ARM64.<br />
The <code>LOCALVERSION</code> variable can be used to add a version to the build.<br />
<br />
Cross compile the kernel:<br />
export ARCH=arm64<br />
export CROSS_COMPILE=aarch64-linux-gnu-<br />
export LOCALVERSION=-nemo<br />
make clean<br />
make oldconfig<br />
make Image modules dtbs<br />
<br />
Install the kernel modules in a different path: <br />
make modules_install INSTALL_MOD_PATH=../linux_modules/<br />
<br />
=== Install kernel ===<br />
<br />
Copy the following things:<br />
<br />
# <b>Image</b> from <code>arch/arm64/boot/Image</code> to the root of the <code>boot</code> partition.<br />
# <b>Device tree files</b> <br />
For pinethone <code>arch/arm64/boot/dts/allwinner/sun50i-a64-dontbeevil.dtb</code> and <code>arch/arm64/boot/dts/allwinner/sun50i-a64-dontbeevil.dts</code> to the root of the <code>boot</code> partition.<br />
<br />
For pinetab <code>arch/arm64/boot/dts/allwinner/sun50i-a64-pinetab.dtb</code> and <code>arch/arm64/boot/dts/allwinner/sun50i-a64-pinetab.dts</code> to the root of the <code>boot</code> partition.<br />
# <b>Modules</b> from <code>../linux_modules</code> to <code>/lib/modules</code> on the <code>boot</code> partition.<br />
<br />
=== Wlan Module ===<br />
<br />
On PinePhone we have mainline kernel driver. But in PineTab we must use https://github.com/Icenowy/rtl8723cs driver.<br />
<br />
==Nemo Mobile==<br />
<br />
For build last release of nemo use this ks file https://gist.github.com/neochapay/8d40f9ee1e5fd621e0053aa126d39e81<br />
<br />
==Sailfish OS==<br />
<br />
===Github & OBS project===<br />
<br />
- https://github.com/sailfish-on-dontbeevil<br />
<br />
- https://build.merproject.org/project/show/nemo:devel:hw:pine:dontbeevil<br />
<br />
===Flash rootFS===<br />
You can download the latest rootFS from the Gitlab SailfishOS Porters CI: https://gitlab.com/sailfishos-porters-ci/dont_be_evil-ci (see the artifacts of the latest CI job).<br />
<br />
This <code>tar.gz</code> archive should be burned to the <code>data</code> partition of the SD card.<br />
It's important to burn it as the root user (not with sudo) to preserve extended attributes and ACLs: <br />
<br />
sudo su<br />
bsdtar -xpf <SAILFISH OS ROOTFS>.tar.bz2 -C <MOUNTPOINT OF /DATA><br />
<br />
===Device repos===<br />
To boot Lipstick, you need to add the device specific repos to the devkit.<br />
All the following commands are executed in a shell on the devkit.<br />
<br />
''Make sure you configure the ethernet interface first before you continue!''<br />
''You need to have access to the WWW to fetch the necessary repository data and packages.''<br />
<br />
Install zypper manually:<br />
curl -o augeas-lib.rpm http://repo.merproject.org/obs/mer:/core/latest_armv7hl/armv7hl/augeas-libs-1.6.0+git1-1.10.6.armv7hl.rpm<br />
curl -o zypper.rpm http://repo.merproject.org/obs/mer:/core/latest_armv7hl/armv7hl/zypper-1.14.6+git3-1.24.5.armv7hl.rpm<br />
rpm -Uvh *rpm<br />
<br />
Use <code>ssu</code> to add the repo<br />
ssu ar common http://repo.merproject.org/obs/nemo:/devel:/hw:/common/sailfish_latest_armv7hl/<br />
ssu ar dontbeevil http://repo.merproject.org/obs/home:/piggz:/dontbeevil/sailfishos_3.0.3.9_latest_armv7hl/<br />
ssu ar jolla https://releases.jolla.com/releases/3.0.3.9/jolla/armv7hl/<br />
<br />
Refresh the repo:<br />
zypper refresh<br />
<br />
Install the device packages:<br />
zypper install dontbeevil:qt5-qtcore dontbeevil:qt5-qttest dontbeevil:lipstick-qt5<br />
zypper install droid-config-dontbeevil # Select 1 for vendor change<br />
zypper install droid-config-dontbeevil-sailfish<br />
zypper install qt5-plugin-platform-eglfs # EGLFS LIMA plugin<br />
zypper install qt5-plugin-generic-evdev # evdev input plugins<br />
<br />
Other useful packages<br />
zypper install mce-tools #useful for mcetool (mcetool -U activates the screen)<br />
<br />
===Unknown password===<br />
The Sailfish OS rootFS sets a random password when booting for the first time.<br />
You can only log in through the <code>telnet</code> debug interface.<br />
Since the <code>eth0</code> interface still requires manually setup, you can't access <code>telnet</code>.<br />
<br />
To circumvent this issue, you can login through the UART TTY interface. <br />
However you don't know the password of the <code>root</code> nor <code>nemo</code> users!<br />
To disable the <code>root</code> and <code>nemo</code> passwords, we can modify the <code>/etc/shadow</code> file:<br />
<br />
sudo chmod +w <SD card data partition>/etc/shadow<br />
sudo vim <SD card data partition>/etc/shadow # Remove any characters where <HASHED PASSWORD> is written: user1:<HASHED PASSWORD>:16092:0:99999:7:::.<br />
sudo chmod -w <SD card data partition>/etc/shadow<br />
<br />
By removing the hashed password, we can login with the user without entering a password.<br />
You can set a new password afterwards by running as a logged in user:<br />
<br />
passwd<br />
<br />
===Init eth0===<br />
Enabling the <code>eth0</code> interface has to be done manually for now:<br />
<br />
ifconfig eth0 <YOUR_IP><br />
route add default gw <DEFAULT_GATEWAY_IP><br />
echo "nameserver <DNS_SERVER_IP>" > /etc/resolv.conf<br />
<br />
Test your configuration with <code>ping</code>:<br />
<br />
ping jolla.com<br />
<br />
<br />
===Lipstick crashing===<br />
<br />
Install Lipstick from the <code>dontbeevil</code> repository:<br />
<br />
zypper install dontbeevil:lipstick-qt5<br />
<br />
===No setup wizard===<br />
<br />
Make sure the configuration package is installed:<br />
<br />
zypper install droid-config-dontbeevil-sailfish<br />
<br />
===Missing regulatory.db for RT8723BS WiFi/BT module===<br />
<br />
git clone git://git.kernel.org/pub/scm/linux/kernel/git/sforshee/wireless-regdb.git<br />
cd wireless-regdb<br />
cp regulatory* /lib/firmware</div>Dylanvanasschttps://wiki.merproject.org/wiki/Adaptations/PinePhone64Adaptations/PinePhone642019-09-03T16:54:37Z<p>Dylanvanassc: /* Cameras */</p>
<hr />
<div>=Hardware Support=<br />
<br />
Full information of hardware spec [https://wiki.pine64.org/index.php/Project_Don't_be_evil Here]<br />
<br />
PostMarket OS hardware information [https://wiki.postmarketos.org/wiki/Pine_Don%27t_be_evil_devkit_(pine-dontbeevil) PostMarketOS Wiki]<br />
<br />
==Modem EC25==<br />
<br />
===Setup===<br />
<br />
1. Make sure that the <code>qmimodem</code> plugin is enabled in the <code>.spec</code> of <code>ofono</code>.<br />
<br />
2. Remove the <code>noplugin.conf</code> file under <code>/lib/environment/ofono/noplugin.conf</code>.<br />
<br />
3. Restart <code>ofono</code><br />
systemctl restart ofono<br />
<br />
4. Check if the QMI modem is properly detected:<br />
/usr/lib/ofono/test/list-modems<br />
<br />
5. Unlock you SIM card (if needed):<br />
/usr/lib/ofono/test/enter-pin /quectelqmi_0 pin <PIN CODE><br />
<br />
The EC25 Quectel modem is now ready :)<br />
Thanks to SuperPrower for the hard work!<br />
<br />
===Sending SMS===<br />
<br />
/usr/lib/ofono/test/send-sms <PHONE NUMBER RECEIVER> <MESSAGE> <DELIVERY REPORT><br />
<br />
To skip the delivery report, use <code>0</code> as argument.<br />
<br />
==Cameras==<br />
<br />
Thanks to: https://wiki.postmarketos.org/wiki/Pine_Don't_be_evil_devkit_(pine-dontbeevil)#Cameras<br />
Only the back camera is supported by the mainline kernel.<br />
To use it, you need to configure it first:<br />
<br />
media-ctl --set-v4l2 '"ov5640 2-003c":0[fmt:UYVY8_2X8/1280x7200]' -d /dev/media1<br />
<br />
Afterwards, you can take a picture with:<br />
<br />
ffmpeg -s 1280x720 -f video4linux2 -i /dev/video1 -vframes 1 selfie.jpg<br />
<br />
This last part is not tested yet (WIP)<br />
<br />
- <code>/dev/media1</code> is the controller interface of the back camera<br />
- <code>/dev/video1</code> is the back camera stream interface<br />
<br />
==PineTab==<br />
<br />
In pinetab we have jack to uart port cable. For enable UART console move selector nearby sd-card slot away from sd-card slot.<br />
<br />
==Testing the vibrator motor==<br />
<br />
You need to have the <code>CONFIG_GPIO_SYSFS</code> enabled in your kernel config for this!<br />
<br />
Vibrator motor is on pin <code>PD2</code>.<br />
You can calculate the PIN number for PD2 as followed ([https://linux-sunxi.org/GPIO more information]):<br />
<code>(4-1) * 32 + 2 = 98</code><br />
<br />
echo "98" > /sys/class/gpio/export # Make pin available<br />
echo "out" > /sys/class/gpio/gpio98/direction # Set as output<br />
echo "1" > /sys/class/gpio/gpio98/value # On<br />
echo "1" > /sys/class/gpio/gpio98/value # Off<br />
echo "98" > /sys/class/gpio/unexport # When you're done<br />
<br />
==Notification LED==<br />
<br />
export COLOR=red # or green, blue is broken due to a hardware fault<br />
# Activate LED<br />
echo 1 > /sys/class/leds/$COLOR/brightness<br />
# Deactivate LED<br />
echo 0 > /sys/class/leds/$COLOR/brightness<br />
<br />
The LED can be controlled in Mer by MCE. You need the <code>mce-plugin-libhybris-nondroid</code> for this.<br />
<br />
=Installation=<br />
==Prepare SD card==<br />
<br />
Use GParted or any other tool to create the following <code>EXT4</code> partitions:<br />
<br />
# <b>boot</b>: Holds the mainline kernel Image and Device Tree files<br />
# <b>data</b>: Holds the Sailfish OS rootFS<br />
<br />
GParted will ask you to leave the first MB free of the SD card when creating the first partition, this is correct.<br />
This 1 MB will be used to store the U-boot boot loader.<br />
<br />
==U-Boot==<br />
<br />
We will now build the mainline U-boot boot loader from Git.<br />
<br />
=== Clone U-boot (master branch): ===<br />
<br />
You can find the U-boot mirror repository on Github:<br />
<br />
git clone github.com/u-boot/u-boot<br />
<br />
=== Compile U-boot ===<br />
<br />
You have to cross compile U-boot with the <code>arm64</code> arch:<br />
<br />
export CROSS_COMPILE=aarch64-linux-gnu-<br />
ARCH=arm64 make clean<br />
ARCH=arm64 make sopine_baseboard_defconfig<br />
ARCH=arm64 make<br />
<br />
The <code>sopine_baseboard_defconfig</code> is the same for the Don't Be Evil devkit.<br />
<br />
=== Burn U-boot to your SD card ===<br />
<br />
Copy the compiled U-boot bootloader to the first sector on your SD card:<br />
<br />
sudo dd if=u-boot-sunxi-with-spl.bin of=/dev/sdX bs=8k seek=1<br />
<br />
<br />
=== Manually loading the kernel ===<br />
<br />
Serial TTY Baudrate over UART = 115200 for screen, example: <code>screen /dev/ttyUSB0 115200</code><br />
You have to start screen first, before turning on the devkit.<br />
<br />
Interrupt the U-boot autoboot process when you see a message in the U-boot prompt. <br />
We need to access the U-boot prompt to load the Kernel image and boot it manually!<br />
<br />
Set bootargs:<br />
<br />
setenv bootargs root=/dev/mmcblk0p2 rootwait panic=10<br />
<br />
Kernel Image loading and Device Tree files:<br />
<br />
ext4load mmc 0:1 ${kernel_addr_r} /Image <br />
ext4load mmc 0:1 ${fdt_addr_r} /sun50i-a64-dontbeevil.dtb <br />
<br />
Boot the kernel:<br />
<br />
booti ${kernel_addr_r} - ${fdt_addr_r}<br />
<br />
=== Automatic boot ===<br />
<br />
Create a <code>boot.cmd</code> file:<br />
<br />
echo Setting bootargs<br />
setenv bootargs console=tty0 console=ttyS0,115200 root=/dev/mmcblk0p2 no_console_suspend rootwait <br />
earlycon=uart,mmio32,0x01c28000 panic=10 consoleblank=0 loglevel=1<br />
printenv<br />
echo Loading DTB<br />
load mmc 0:1 ${fdt_addr_r} /sun50i-a64-dontbeevil.dtb<br />
echo Loading kernel Image<br />
load mmc 0:1 ${kernel_addr_r} /Image<br />
echo Booting kernel NOW<br />
booti ${kernel_addr_r} - ${fdt_addr_r}<br />
<br />
Mount your <code>boot</code> partition and run the following command:<br />
sudo mkimage -C none -A arm -T script -d /mnt/boot.cmd /mnt/boot.scr<br />
<br />
This will translate the <code>boot.cmd</code> file into a U-boot script.<br />
<br />
If you don't have the <code>mkimage</code> command available, you can install it from the <code>uboot-tools</code> package.<br />
<br />
==Kernel==<br />
<br />
The PinePhone runs a mainline kernel, device tree modifications are done by all the PinePhone OS developers on Gitlab (https://gitlab.com/pine64-org/linux).<br />
<br />
=== Clone the kernel ===<br />
<br />
git clone https://gitlab.com/pine64-org/linux<br />
cd linux<br />
git checkout pinephone-dontbeevil<br />
<br />
=== Configure the kernel ===<br />
<br />
# <b>Copy our kernel config</b>: https://gitlab.com/pinephone-sailfish-os/linux-kernel/raw/master/pinephone-config<br />
# <b>Enter the <code>linux</code> project</b>: <code>cd linux</code><br />
# <b>Copy the config file</b> to <code>.config</code> in the main directory<br />
<br />
=== Build the kernel ===<br />
<br />
We cross compile the kernel for ARM64.<br />
The <code>LOCALVERSION</code> variable can be used to add a version to the build.<br />
<br />
Cross compile the kernel:<br />
export ARCH=arm64<br />
export CROSS_COMPILE=aarch64-linux-gnu-<br />
export LOCALVERSION=-nemo<br />
make clean<br />
make oldconfig<br />
make Image modules dtbs<br />
<br />
Install the kernel modules in a different path: <br />
make modules_install INSTALL_MOD_PATH=../linux_modules/<br />
<br />
=== Install kernel ===<br />
<br />
Copy the following things:<br />
<br />
# <b>Image</b> from <code>arch/arm64/boot/Image</code> to the root of the <code>boot</code> partition.<br />
# <b>Device tree files</b> <br />
For pinethone <code>arch/arm64/boot/dts/allwinner/sun50i-a64-dontbeevil.dtb</code> and <code>arch/arm64/boot/dts/allwinner/sun50i-a64-dontbeevil.dts</code> to the root of the <code>boot</code> partition.<br />
<br />
For pinetab <code>arch/arm64/boot/dts/allwinner/sun50i-a64-pinetab.dtb</code> and <code>arch/arm64/boot/dts/allwinner/sun50i-a64-pinetab.dts</code> to the root of the <code>boot</code> partition.<br />
# <b>Modules</b> from <code>../linux_modules</code> to <code>/lib/modules</code> on the <code>boot</code> partition.<br />
<br />
=== Wlan Module ===<br />
<br />
On PinePhone we have mainline kernel driver. But in PineTab we must use https://github.com/Icenowy/rtl8723cs driver.<br />
<br />
==Nemo Mobile==<br />
<br />
For build last release of nemo use this ks file https://gist.github.com/neochapay/8d40f9ee1e5fd621e0053aa126d39e81<br />
<br />
==Sailfish OS==<br />
<br />
===Github & OBS project===<br />
<br />
- https://github.com/sailfish-on-dontbeevil<br />
<br />
- https://build.merproject.org/project/show/nemo:devel:hw:pine:dontbeevil<br />
<br />
===Flash rootFS===<br />
You can download the latest rootFS from the Gitlab SailfishOS Porters CI: https://gitlab.com/sailfishos-porters-ci/dont_be_evil-ci (see the artifacts of the latest CI job).<br />
<br />
This <code>tar.gz</code> archive should be burned to the <code>data</code> partition of the SD card.<br />
It's important to burn it as the root user (not with sudo) to preserve extended attributes and ACLs: <br />
<br />
sudo su<br />
bsdtar -xpf <SAILFISH OS ROOTFS>.tar.bz2 -C <MOUNTPOINT OF /DATA><br />
<br />
===Device repos===<br />
To boot Lipstick, you need to add the device specific repos to the devkit.<br />
All the following commands are executed in a shell on the devkit.<br />
<br />
''Make sure you configure the ethernet interface first before you continue!''<br />
''You need to have access to the WWW to fetch the necessary repository data and packages.''<br />
<br />
Install zypper manually:<br />
curl -o augeas-lib.rpm http://repo.merproject.org/obs/mer:/core/latest_armv7hl/armv7hl/augeas-libs-1.6.0+git1-1.10.6.armv7hl.rpm<br />
curl -o zypper.rpm http://repo.merproject.org/obs/mer:/core/latest_armv7hl/armv7hl/zypper-1.14.6+git3-1.24.5.armv7hl.rpm<br />
rpm -Uvh *rpm<br />
<br />
Use <code>ssu</code> to add the repo<br />
ssu ar common http://repo.merproject.org/obs/nemo:/devel:/hw:/common/sailfish_latest_armv7hl/<br />
ssu ar dontbeevil http://repo.merproject.org/obs/home:/piggz:/dontbeevil/sailfishos_3.0.3.9_latest_armv7hl/<br />
ssu ar jolla https://releases.jolla.com/releases/3.0.3.9/jolla/armv7hl/<br />
<br />
Refresh the repo:<br />
zypper refresh<br />
<br />
Install the device packages:<br />
zypper install dontbeevil:qt5-qtcore dontbeevil:qt5-qttest dontbeevil:lipstick-qt5<br />
zypper install droid-config-dontbeevil # Select 1 for vendor change<br />
zypper install droid-config-dontbeevil-sailfish<br />
zypper install qt5-plugin-platform-eglfs # EGLFS LIMA plugin<br />
zypper install qt5-plugin-generic-evdev # evdev input plugins<br />
<br />
Other useful packages<br />
zypper install mce-tools #useful for mcetool (mcetool -U activates the screen)<br />
<br />
===Unknown password===<br />
The Sailfish OS rootFS sets a random password when booting for the first time.<br />
You can only log in through the <code>telnet</code> debug interface.<br />
Since the <code>eth0</code> interface still requires manually setup, you can't access <code>telnet</code>.<br />
<br />
To circumvent this issue, you can login through the UART TTY interface. <br />
However you don't know the password of the <code>root</code> nor <code>nemo</code> users!<br />
To disable the <code>root</code> and <code>nemo</code> passwords, we can modify the <code>/etc/shadow</code> file:<br />
<br />
sudo chmod +w <SD card data partition>/etc/shadow<br />
sudo vim <SD card data partition>/etc/shadow # Remove any characters where <HASHED PASSWORD> is written: user1:<HASHED PASSWORD>:16092:0:99999:7:::.<br />
sudo chmod -w <SD card data partition>/etc/shadow<br />
<br />
By removing the hashed password, we can login with the user without entering a password.<br />
You can set a new password afterwards by running as a logged in user:<br />
<br />
passwd<br />
<br />
===Init eth0===<br />
Enabling the <code>eth0</code> interface has to be done manually for now:<br />
<br />
ifconfig eth0 <YOUR_IP><br />
route add default gw <DEFAULT_GATEWAY_IP><br />
echo "nameserver <DNS_SERVER_IP>" > /etc/resolv.conf<br />
<br />
Test your configuration with <code>ping</code>:<br />
<br />
ping jolla.com<br />
<br />
<br />
===Lipstick crashing===<br />
<br />
Install Lipstick from the <code>dontbeevil</code> repository:<br />
<br />
zypper install dontbeevil:lipstick-qt5<br />
<br />
===No setup wizard===<br />
<br />
Make sure the configuration package is installed:<br />
<br />
zypper install droid-config-dontbeevil-sailfish<br />
<br />
===Missing regulatory.db for RT8723BS WiFi/BT module===<br />
<br />
git clone git://git.kernel.org/pub/scm/linux/kernel/git/sforshee/wireless-regdb.git<br />
cd wireless-regdb<br />
cp regulatory* /lib/firmware</div>Dylanvanasschttps://wiki.merproject.org/wiki/Adaptations/PinePhone64Adaptations/PinePhone642019-09-03T16:49:24Z<p>Dylanvanassc: /* Hardware Support */</p>
<hr />
<div>=Hardware Support=<br />
<br />
Full information of hardware spec [https://wiki.pine64.org/index.php/Project_Don't_be_evil Here]<br />
<br />
PostMarket OS hardware information [https://wiki.postmarketos.org/wiki/Pine_Don%27t_be_evil_devkit_(pine-dontbeevil) PostMarketOS Wiki]<br />
<br />
==Modem EC25==<br />
<br />
===Setup===<br />
<br />
1. Make sure that the <code>qmimodem</code> plugin is enabled in the <code>.spec</code> of <code>ofono</code>.<br />
<br />
2. Remove the <code>noplugin.conf</code> file under <code>/lib/environment/ofono/noplugin.conf</code>.<br />
<br />
3. Restart <code>ofono</code><br />
systemctl restart ofono<br />
<br />
4. Check if the QMI modem is properly detected:<br />
/usr/lib/ofono/test/list-modems<br />
<br />
5. Unlock you SIM card (if needed):<br />
/usr/lib/ofono/test/enter-pin /quectelqmi_0 pin <PIN CODE><br />
<br />
The EC25 Quectel modem is now ready :)<br />
Thanks to SuperPrower for the hard work!<br />
<br />
===Sending SMS===<br />
<br />
/usr/lib/ofono/test/send-sms <PHONE NUMBER RECEIVER> <MESSAGE> <DELIVERY REPORT><br />
<br />
To skip the delivery report, use <code>0</code> as argument.<br />
<br />
==Cameras==<br />
<br />
Thanks to: https://wiki.postmarketos.org/wiki/Pine_Don't_be_evil_devkit_(pine-dontbeevil)#Cameras<br />
Only the back camera is supported by the mainline kernel.<br />
To use it, you need to configure it first:<br />
<br />
media-ctl --set-v4l2 '"ov5640 2-003c":0[fmt:UYVY8_2X8/1280x7200]' -d /dev/media1<br />
<br />
Afterwards, you can take a picture with:<br />
<br />
ffmpeg -s 1280x720 -f video4linux2 -i /dev/video0 -vframes 1 selfie.jpg<br />
<br />
This last part is not tested yet (WIP)<br />
<br />
==PineTab==<br />
<br />
In pinetab we have jack to uart port cable. For enable UART console move selector nearby sd-card slot away from sd-card slot.<br />
<br />
==Testing the vibrator motor==<br />
<br />
You need to have the <code>CONFIG_GPIO_SYSFS</code> enabled in your kernel config for this!<br />
<br />
Vibrator motor is on pin <code>PD2</code>.<br />
You can calculate the PIN number for PD2 as followed ([https://linux-sunxi.org/GPIO more information]):<br />
<code>(4-1) * 32 + 2 = 98</code><br />
<br />
echo "98" > /sys/class/gpio/export # Make pin available<br />
echo "out" > /sys/class/gpio/gpio98/direction # Set as output<br />
echo "1" > /sys/class/gpio/gpio98/value # On<br />
echo "1" > /sys/class/gpio/gpio98/value # Off<br />
echo "98" > /sys/class/gpio/unexport # When you're done<br />
<br />
==Notification LED==<br />
<br />
export COLOR=red # or green, blue is broken due to a hardware fault<br />
# Activate LED<br />
echo 1 > /sys/class/leds/$COLOR/brightness<br />
# Deactivate LED<br />
echo 0 > /sys/class/leds/$COLOR/brightness<br />
<br />
The LED can be controlled in Mer by MCE. You need the <code>mce-plugin-libhybris-nondroid</code> for this.<br />
<br />
=Installation=<br />
==Prepare SD card==<br />
<br />
Use GParted or any other tool to create the following <code>EXT4</code> partitions:<br />
<br />
# <b>boot</b>: Holds the mainline kernel Image and Device Tree files<br />
# <b>data</b>: Holds the Sailfish OS rootFS<br />
<br />
GParted will ask you to leave the first MB free of the SD card when creating the first partition, this is correct.<br />
This 1 MB will be used to store the U-boot boot loader.<br />
<br />
==U-Boot==<br />
<br />
We will now build the mainline U-boot boot loader from Git.<br />
<br />
=== Clone U-boot (master branch): ===<br />
<br />
You can find the U-boot mirror repository on Github:<br />
<br />
git clone github.com/u-boot/u-boot<br />
<br />
=== Compile U-boot ===<br />
<br />
You have to cross compile U-boot with the <code>arm64</code> arch:<br />
<br />
export CROSS_COMPILE=aarch64-linux-gnu-<br />
ARCH=arm64 make clean<br />
ARCH=arm64 make sopine_baseboard_defconfig<br />
ARCH=arm64 make<br />
<br />
The <code>sopine_baseboard_defconfig</code> is the same for the Don't Be Evil devkit.<br />
<br />
=== Burn U-boot to your SD card ===<br />
<br />
Copy the compiled U-boot bootloader to the first sector on your SD card:<br />
<br />
sudo dd if=u-boot-sunxi-with-spl.bin of=/dev/sdX bs=8k seek=1<br />
<br />
<br />
=== Manually loading the kernel ===<br />
<br />
Serial TTY Baudrate over UART = 115200 for screen, example: <code>screen /dev/ttyUSB0 115200</code><br />
You have to start screen first, before turning on the devkit.<br />
<br />
Interrupt the U-boot autoboot process when you see a message in the U-boot prompt. <br />
We need to access the U-boot prompt to load the Kernel image and boot it manually!<br />
<br />
Set bootargs:<br />
<br />
setenv bootargs root=/dev/mmcblk0p2 rootwait panic=10<br />
<br />
Kernel Image loading and Device Tree files:<br />
<br />
ext4load mmc 0:1 ${kernel_addr_r} /Image <br />
ext4load mmc 0:1 ${fdt_addr_r} /sun50i-a64-dontbeevil.dtb <br />
<br />
Boot the kernel:<br />
<br />
booti ${kernel_addr_r} - ${fdt_addr_r}<br />
<br />
=== Automatic boot ===<br />
<br />
Create a <code>boot.cmd</code> file:<br />
<br />
echo Setting bootargs<br />
setenv bootargs console=tty0 console=ttyS0,115200 root=/dev/mmcblk0p2 no_console_suspend rootwait <br />
earlycon=uart,mmio32,0x01c28000 panic=10 consoleblank=0 loglevel=1<br />
printenv<br />
echo Loading DTB<br />
load mmc 0:1 ${fdt_addr_r} /sun50i-a64-dontbeevil.dtb<br />
echo Loading kernel Image<br />
load mmc 0:1 ${kernel_addr_r} /Image<br />
echo Booting kernel NOW<br />
booti ${kernel_addr_r} - ${fdt_addr_r}<br />
<br />
Mount your <code>boot</code> partition and run the following command:<br />
sudo mkimage -C none -A arm -T script -d /mnt/boot.cmd /mnt/boot.scr<br />
<br />
This will translate the <code>boot.cmd</code> file into a U-boot script.<br />
<br />
If you don't have the <code>mkimage</code> command available, you can install it from the <code>uboot-tools</code> package.<br />
<br />
==Kernel==<br />
<br />
The PinePhone runs a mainline kernel, device tree modifications are done by all the PinePhone OS developers on Gitlab (https://gitlab.com/pine64-org/linux).<br />
<br />
=== Clone the kernel ===<br />
<br />
git clone https://gitlab.com/pine64-org/linux<br />
cd linux<br />
git checkout pinephone-dontbeevil<br />
<br />
=== Configure the kernel ===<br />
<br />
# <b>Copy our kernel config</b>: https://gitlab.com/pinephone-sailfish-os/linux-kernel/raw/master/pinephone-config<br />
# <b>Enter the <code>linux</code> project</b>: <code>cd linux</code><br />
# <b>Copy the config file</b> to <code>.config</code> in the main directory<br />
<br />
=== Build the kernel ===<br />
<br />
We cross compile the kernel for ARM64.<br />
The <code>LOCALVERSION</code> variable can be used to add a version to the build.<br />
<br />
Cross compile the kernel:<br />
export ARCH=arm64<br />
export CROSS_COMPILE=aarch64-linux-gnu-<br />
export LOCALVERSION=-nemo<br />
make clean<br />
make oldconfig<br />
make Image modules dtbs<br />
<br />
Install the kernel modules in a different path: <br />
make modules_install INSTALL_MOD_PATH=../linux_modules/<br />
<br />
=== Install kernel ===<br />
<br />
Copy the following things:<br />
<br />
# <b>Image</b> from <code>arch/arm64/boot/Image</code> to the root of the <code>boot</code> partition.<br />
# <b>Device tree files</b> <br />
For pinethone <code>arch/arm64/boot/dts/allwinner/sun50i-a64-dontbeevil.dtb</code> and <code>arch/arm64/boot/dts/allwinner/sun50i-a64-dontbeevil.dts</code> to the root of the <code>boot</code> partition.<br />
<br />
For pinetab <code>arch/arm64/boot/dts/allwinner/sun50i-a64-pinetab.dtb</code> and <code>arch/arm64/boot/dts/allwinner/sun50i-a64-pinetab.dts</code> to the root of the <code>boot</code> partition.<br />
# <b>Modules</b> from <code>../linux_modules</code> to <code>/lib/modules</code> on the <code>boot</code> partition.<br />
<br />
=== Wlan Module ===<br />
<br />
On PinePhone we have mainline kernel driver. But in PineTab we must use https://github.com/Icenowy/rtl8723cs driver.<br />
<br />
==Nemo Mobile==<br />
<br />
For build last release of nemo use this ks file https://gist.github.com/neochapay/8d40f9ee1e5fd621e0053aa126d39e81<br />
<br />
==Sailfish OS==<br />
<br />
===Github & OBS project===<br />
<br />
- https://github.com/sailfish-on-dontbeevil<br />
<br />
- https://build.merproject.org/project/show/nemo:devel:hw:pine:dontbeevil<br />
<br />
===Flash rootFS===<br />
You can download the latest rootFS from the Gitlab SailfishOS Porters CI: https://gitlab.com/sailfishos-porters-ci/dont_be_evil-ci (see the artifacts of the latest CI job).<br />
<br />
This <code>tar.gz</code> archive should be burned to the <code>data</code> partition of the SD card.<br />
It's important to burn it as the root user (not with sudo) to preserve extended attributes and ACLs: <br />
<br />
sudo su<br />
bsdtar -xpf <SAILFISH OS ROOTFS>.tar.bz2 -C <MOUNTPOINT OF /DATA><br />
<br />
===Device repos===<br />
To boot Lipstick, you need to add the device specific repos to the devkit.<br />
All the following commands are executed in a shell on the devkit.<br />
<br />
''Make sure you configure the ethernet interface first before you continue!''<br />
''You need to have access to the WWW to fetch the necessary repository data and packages.''<br />
<br />
Install zypper manually:<br />
curl -o augeas-lib.rpm http://repo.merproject.org/obs/mer:/core/latest_armv7hl/armv7hl/augeas-libs-1.6.0+git1-1.10.6.armv7hl.rpm<br />
curl -o zypper.rpm http://repo.merproject.org/obs/mer:/core/latest_armv7hl/armv7hl/zypper-1.14.6+git3-1.24.5.armv7hl.rpm<br />
rpm -Uvh *rpm<br />
<br />
Use <code>ssu</code> to add the repo<br />
ssu ar common http://repo.merproject.org/obs/nemo:/devel:/hw:/common/sailfish_latest_armv7hl/<br />
ssu ar dontbeevil http://repo.merproject.org/obs/home:/piggz:/dontbeevil/sailfishos_3.0.3.9_latest_armv7hl/<br />
ssu ar jolla https://releases.jolla.com/releases/3.0.3.9/jolla/armv7hl/<br />
<br />
Refresh the repo:<br />
zypper refresh<br />
<br />
Install the device packages:<br />
zypper install dontbeevil:qt5-qtcore dontbeevil:qt5-qttest dontbeevil:lipstick-qt5<br />
zypper install droid-config-dontbeevil # Select 1 for vendor change<br />
zypper install droid-config-dontbeevil-sailfish<br />
zypper install qt5-plugin-platform-eglfs # EGLFS LIMA plugin<br />
zypper install qt5-plugin-generic-evdev # evdev input plugins<br />
<br />
Other useful packages<br />
zypper install mce-tools #useful for mcetool (mcetool -U activates the screen)<br />
<br />
===Unknown password===<br />
The Sailfish OS rootFS sets a random password when booting for the first time.<br />
You can only log in through the <code>telnet</code> debug interface.<br />
Since the <code>eth0</code> interface still requires manually setup, you can't access <code>telnet</code>.<br />
<br />
To circumvent this issue, you can login through the UART TTY interface. <br />
However you don't know the password of the <code>root</code> nor <code>nemo</code> users!<br />
To disable the <code>root</code> and <code>nemo</code> passwords, we can modify the <code>/etc/shadow</code> file:<br />
<br />
sudo chmod +w <SD card data partition>/etc/shadow<br />
sudo vim <SD card data partition>/etc/shadow # Remove any characters where <HASHED PASSWORD> is written: user1:<HASHED PASSWORD>:16092:0:99999:7:::.<br />
sudo chmod -w <SD card data partition>/etc/shadow<br />
<br />
By removing the hashed password, we can login with the user without entering a password.<br />
You can set a new password afterwards by running as a logged in user:<br />
<br />
passwd<br />
<br />
===Init eth0===<br />
Enabling the <code>eth0</code> interface has to be done manually for now:<br />
<br />
ifconfig eth0 <YOUR_IP><br />
route add default gw <DEFAULT_GATEWAY_IP><br />
echo "nameserver <DNS_SERVER_IP>" > /etc/resolv.conf<br />
<br />
Test your configuration with <code>ping</code>:<br />
<br />
ping jolla.com<br />
<br />
<br />
===Lipstick crashing===<br />
<br />
Install Lipstick from the <code>dontbeevil</code> repository:<br />
<br />
zypper install dontbeevil:lipstick-qt5<br />
<br />
===No setup wizard===<br />
<br />
Make sure the configuration package is installed:<br />
<br />
zypper install droid-config-dontbeevil-sailfish<br />
<br />
===Missing regulatory.db for RT8723BS WiFi/BT module===<br />
<br />
git clone git://git.kernel.org/pub/scm/linux/kernel/git/sforshee/wireless-regdb.git<br />
cd wireless-regdb<br />
cp regulatory* /lib/firmware</div>Dylanvanasschttps://wiki.merproject.org/wiki/Adaptations/PinePhone64Adaptations/PinePhone642019-09-03T12:33:03Z<p>Dylanvanassc: /* Modem EC25 */</p>
<hr />
<div>=Hardware Support=<br />
<br />
Full information of hardware spec [https://wiki.pine64.org/index.php/Project_Don't_be_evil Here]<br />
<br />
PostMarket OS hardware information [https://wiki.postmarketos.org/wiki/Pine_Don%27t_be_evil_devkit_(pine-dontbeevil) PostMarketOS Wiki]<br />
<br />
==Modem EC25==<br />
<br />
===Setup===<br />
<br />
1. Make sure that the <code>qmimodem</code> plugin is enabled in the <code>.spec</code> of <code>ofono</code>.<br />
<br />
2. Remove the <code>noplugin.conf</code> file under <code>/lib/environment/ofono/noplugin.conf</code>.<br />
<br />
3. Restart <code>ofono</code><br />
systemctl restart ofono<br />
<br />
4. Check if the QMI modem is properly detected:<br />
/usr/lib/ofono/test/list-modems<br />
<br />
5. Unlock you SIM card (if needed):<br />
/usr/lib/ofono/test/enter-pin /quectelqmi_0 pin <PIN CODE><br />
<br />
The EC25 Quectel modem is now ready :)<br />
Thanks to SuperPrower for the hard work!<br />
<br />
===Sending SMS===<br />
<br />
/usr/lib/ofono/test/send-sms <PHONE NUMBER RECEIVER> <MESSAGE> <DELIVERY REPORT><br />
<br />
To skip the delivery report, use <code>0</code> as argument.<br />
<br />
==PineTab==<br />
<br />
In pinetab we have jack to uart port cable. For enable UART console move selector nearby sd-card slot away from sd-card slot.<br />
<br />
==Testing the vibrator motor==<br />
<br />
You need to have the <code>CONFIG_GPIO_SYSFS</code> enabled in your kernel config for this!<br />
<br />
Vibrator motor is on pin <code>PD2</code>.<br />
You can calculate the PIN number for PD2 as followed ([https://linux-sunxi.org/GPIO more information]):<br />
<code>(4-1) * 32 + 2 = 98</code><br />
<br />
echo "98" > /sys/class/gpio/export # Make pin available<br />
echo "out" > /sys/class/gpio/gpio98/direction # Set as output<br />
echo "1" > /sys/class/gpio/gpio98/value # On<br />
echo "1" > /sys/class/gpio/gpio98/value # Off<br />
echo "98" > /sys/class/gpio/unexport # When you're done<br />
<br />
==Notification LED==<br />
<br />
export COLOR=red # or green, blue is broken due to a hardware fault<br />
# Activate LED<br />
echo 1 > /sys/class/leds/$COLOR/brightness<br />
# Deactivate LED<br />
echo 0 > /sys/class/leds/$COLOR/brightness<br />
<br />
The LED can be controlled in Mer by MCE. You need the <code>mce-plugin-libhybris-nondroid</code> for this.<br />
<br />
=Installation=<br />
==Prepare SD card==<br />
<br />
Use GParted or any other tool to create the following <code>EXT4</code> partitions:<br />
<br />
# <b>boot</b>: Holds the mainline kernel Image and Device Tree files<br />
# <b>data</b>: Holds the Sailfish OS rootFS<br />
<br />
GParted will ask you to leave the first MB free of the SD card when creating the first partition, this is correct.<br />
This 1 MB will be used to store the U-boot boot loader.<br />
<br />
==U-Boot==<br />
<br />
We will now build the mainline U-boot boot loader from Git.<br />
<br />
=== Clone U-boot (master branch): ===<br />
<br />
You can find the U-boot mirror repository on Github:<br />
<br />
git clone github.com/u-boot/u-boot<br />
<br />
=== Compile U-boot ===<br />
<br />
You have to cross compile U-boot with the <code>arm64</code> arch:<br />
<br />
export CROSS_COMPILE=aarch64-linux-gnu-<br />
ARCH=arm64 make clean<br />
ARCH=arm64 make sopine_baseboard_defconfig<br />
ARCH=arm64 make<br />
<br />
The <code>sopine_baseboard_defconfig</code> is the same for the Don't Be Evil devkit.<br />
<br />
=== Burn U-boot to your SD card ===<br />
<br />
Copy the compiled U-boot bootloader to the first sector on your SD card:<br />
<br />
sudo dd if=u-boot-sunxi-with-spl.bin of=/dev/sdX bs=8k seek=1<br />
<br />
<br />
=== Manually loading the kernel ===<br />
<br />
Serial TTY Baudrate over UART = 115200 for screen, example: <code>screen /dev/ttyUSB0 115200</code><br />
You have to start screen first, before turning on the devkit.<br />
<br />
Interrupt the U-boot autoboot process when you see a message in the U-boot prompt. <br />
We need to access the U-boot prompt to load the Kernel image and boot it manually!<br />
<br />
Set bootargs:<br />
<br />
setenv bootargs root=/dev/mmcblk0p2 rootwait panic=10<br />
<br />
Kernel Image loading and Device Tree files:<br />
<br />
ext4load mmc 0:1 ${kernel_addr_r} /Image <br />
ext4load mmc 0:1 ${fdt_addr_r} /sun50i-a64-dontbeevil.dtb <br />
<br />
Boot the kernel:<br />
<br />
booti ${kernel_addr_r} - ${fdt_addr_r}<br />
<br />
=== Automatic boot ===<br />
<br />
Create a <code>boot.cmd</code> file:<br />
<br />
echo Setting bootargs<br />
setenv bootargs console=tty0 console=ttyS0,115200 root=/dev/mmcblk0p2 no_console_suspend rootwait <br />
earlycon=uart,mmio32,0x01c28000 panic=10 consoleblank=0 loglevel=1<br />
printenv<br />
echo Loading DTB<br />
load mmc 0:1 ${fdt_addr_r} /sun50i-a64-dontbeevil.dtb<br />
echo Loading kernel Image<br />
load mmc 0:1 ${kernel_addr_r} /Image<br />
echo Booting kernel NOW<br />
booti ${kernel_addr_r} - ${fdt_addr_r}<br />
<br />
Mount your <code>boot</code> partition and run the following command:<br />
sudo mkimage -C none -A arm -T script -d /mnt/boot.cmd /mnt/boot.scr<br />
<br />
This will translate the <code>boot.cmd</code> file into a U-boot script.<br />
<br />
If you don't have the <code>mkimage</code> command available, you can install it from the <code>uboot-tools</code> package.<br />
<br />
==Kernel==<br />
<br />
The PinePhone runs a mainline kernel, device tree modifications are done by all the PinePhone OS developers on Gitlab (https://gitlab.com/pine64-org/linux).<br />
<br />
=== Clone the kernel ===<br />
<br />
git clone https://gitlab.com/pine64-org/linux<br />
cd linux<br />
git checkout pinephone-dontbeevil<br />
<br />
=== Configure the kernel ===<br />
<br />
# <b>Copy our kernel config</b>: https://gitlab.com/pinephone-sailfish-os/linux-kernel/raw/master/pinephone-config<br />
# <b>Enter the <code>linux</code> project</b>: <code>cd linux</code><br />
# <b>Copy the config file</b> to <code>.config</code> in the main directory<br />
<br />
=== Build the kernel ===<br />
<br />
We cross compile the kernel for ARM64.<br />
The <code>LOCALVERSION</code> variable can be used to add a version to the build.<br />
<br />
Cross compile the kernel:<br />
export ARCH=arm64<br />
export CROSS_COMPILE=aarch64-linux-gnu-<br />
export LOCALVERSION=-nemo<br />
make clean<br />
make oldconfig<br />
make Image modules dtbs<br />
<br />
Install the kernel modules in a different path: <br />
make modules_install INSTALL_MOD_PATH=../linux_modules/<br />
<br />
=== Install kernel ===<br />
<br />
Copy the following things:<br />
<br />
# <b>Image</b> from <code>arch/arm64/boot/Image</code> to the root of the <code>boot</code> partition.<br />
# <b>Device tree files</b> <br />
For pinethone <code>arch/arm64/boot/dts/allwinner/sun50i-a64-dontbeevil.dtb</code> and <code>arch/arm64/boot/dts/allwinner/sun50i-a64-dontbeevil.dts</code> to the root of the <code>boot</code> partition.<br />
<br />
For pinetab <code>arch/arm64/boot/dts/allwinner/sun50i-a64-pinetab.dtb</code> and <code>arch/arm64/boot/dts/allwinner/sun50i-a64-pinetab.dts</code> to the root of the <code>boot</code> partition.<br />
# <b>Modules</b> from <code>../linux_modules</code> to <code>/lib/modules</code> on the <code>boot</code> partition.<br />
<br />
=== Wlan Module ===<br />
<br />
On PinePhone we have mainline kernel driver. But in PineTab we must use https://github.com/Icenowy/rtl8723cs driver.<br />
<br />
==Nemo Mobile==<br />
<br />
For build last release of nemo use this ks file https://gist.github.com/neochapay/8d40f9ee1e5fd621e0053aa126d39e81<br />
<br />
==Sailfish OS==<br />
<br />
===Github & OBS project===<br />
<br />
- https://github.com/sailfish-on-dontbeevil<br />
<br />
- https://build.merproject.org/project/show/nemo:devel:hw:pine:dontbeevil<br />
<br />
===Flash rootFS===<br />
You can download the latest rootFS from the Gitlab SailfishOS Porters CI: https://gitlab.com/sailfishos-porters-ci/dont_be_evil-ci (see the artifacts of the latest CI job).<br />
<br />
This <code>tar.gz</code> archive should be burned to the <code>data</code> partition of the SD card.<br />
It's important to burn it as the root user (not with sudo) to preserve extended attributes and ACLs: <br />
<br />
sudo su<br />
bsdtar -xpf <SAILFISH OS ROOTFS>.tar.bz2 -C <MOUNTPOINT OF /DATA><br />
<br />
===Device repos===<br />
To boot Lipstick, you need to add the device specific repos to the devkit.<br />
All the following commands are executed in a shell on the devkit.<br />
<br />
''Make sure you configure the ethernet interface first before you continue!''<br />
''You need to have access to the WWW to fetch the necessary repository data and packages.''<br />
<br />
Install zypper manually:<br />
curl -o augeas-lib.rpm http://repo.merproject.org/obs/mer:/core/latest_armv7hl/armv7hl/augeas-libs-1.6.0+git1-1.10.6.armv7hl.rpm<br />
curl -o zypper.rpm http://repo.merproject.org/obs/mer:/core/latest_armv7hl/armv7hl/zypper-1.14.6+git3-1.24.5.armv7hl.rpm<br />
rpm -Uvh *rpm<br />
<br />
Use <code>ssu</code> to add the repo<br />
ssu ar common http://repo.merproject.org/obs/nemo:/devel:/hw:/common/sailfish_latest_armv7hl/<br />
ssu ar dontbeevil http://repo.merproject.org/obs/home:/piggz:/dontbeevil/sailfishos_3.0.3.9_latest_armv7hl/<br />
ssu ar jolla https://releases.jolla.com/releases/3.0.3.9/jolla/armv7hl/<br />
<br />
Refresh the repo:<br />
zypper refresh<br />
<br />
Install the device packages:<br />
zypper install dontbeevil:qt5-qtcore dontbeevil:qt5-qttest dontbeevil:lipstick-qt5<br />
zypper install droid-config-dontbeevil # Select 1 for vendor change<br />
zypper install droid-config-dontbeevil-sailfish<br />
zypper install qt5-plugin-platform-eglfs # EGLFS LIMA plugin<br />
zypper install qt5-plugin-generic-evdev # evdev input plugins<br />
<br />
Other useful packages<br />
zypper install mce-tools #useful for mcetool (mcetool -U activates the screen)<br />
<br />
===Unknown password===<br />
The Sailfish OS rootFS sets a random password when booting for the first time.<br />
You can only log in through the <code>telnet</code> debug interface.<br />
Since the <code>eth0</code> interface still requires manually setup, you can't access <code>telnet</code>.<br />
<br />
To circumvent this issue, you can login through the UART TTY interface. <br />
However you don't know the password of the <code>root</code> nor <code>nemo</code> users!<br />
To disable the <code>root</code> and <code>nemo</code> passwords, we can modify the <code>/etc/shadow</code> file:<br />
<br />
sudo chmod +w <SD card data partition>/etc/shadow<br />
sudo vim <SD card data partition>/etc/shadow # Remove any characters where <HASHED PASSWORD> is written: user1:<HASHED PASSWORD>:16092:0:99999:7:::.<br />
sudo chmod -w <SD card data partition>/etc/shadow<br />
<br />
By removing the hashed password, we can login with the user without entering a password.<br />
You can set a new password afterwards by running as a logged in user:<br />
<br />
passwd<br />
<br />
===Init eth0===<br />
Enabling the <code>eth0</code> interface has to be done manually for now:<br />
<br />
ifconfig eth0 <YOUR_IP><br />
route add default gw <DEFAULT_GATEWAY_IP><br />
echo "nameserver <DNS_SERVER_IP>" > /etc/resolv.conf<br />
<br />
Test your configuration with <code>ping</code>:<br />
<br />
ping jolla.com<br />
<br />
<br />
===Lipstick crashing===<br />
<br />
Install Lipstick from the <code>dontbeevil</code> repository:<br />
<br />
zypper install dontbeevil:lipstick-qt5<br />
<br />
===No setup wizard===<br />
<br />
Make sure the configuration package is installed:<br />
<br />
zypper install droid-config-dontbeevil-sailfish<br />
<br />
===Missing regulatory.db for RT8723BS WiFi/BT module===<br />
<br />
git clone git://git.kernel.org/pub/scm/linux/kernel/git/sforshee/wireless-regdb.git<br />
cd wireless-regdb<br />
cp regulatory* /lib/firmware</div>Dylanvanasschttps://wiki.merproject.org/wiki/Adaptations/PinePhone64Adaptations/PinePhone642019-09-03T12:27:38Z<p>Dylanvanassc: /* Hardware Support */</p>
<hr />
<div>=Hardware Support=<br />
<br />
Full information of hardware spec [https://wiki.pine64.org/index.php/Project_Don't_be_evil Here]<br />
<br />
PostMarket OS hardware information [https://wiki.postmarketos.org/wiki/Pine_Don%27t_be_evil_devkit_(pine-dontbeevil) PostMarketOS Wiki]<br />
<br />
==Modem EC25==<br />
<br />
1. Make sure that the <code>qmimodem</code> plugin is enabled in the <code>.spec</code> of <code>ofono</code>.<br />
<br />
2. Remove the <code>noplugin.conf</code> file under <code>/lib/environment/ofono/noplugin.conf</code>.<br />
<br />
3. Restart <code>ofono</code><br />
systemctl restart ofono<br />
<br />
4. Check if the QMI modem is properly detected:<br />
/usr/lib/ofono/test/list-modems<br />
<br />
5. Unlock you SIM card (if needed):<br />
/usr/lib/ofono/test/enter-pin /quectelqmi_0 pin <PIN CODE><br />
<br />
The EC25 Quectel modem is now ready :)<br />
Thanks to SuperPrower for the hard work!<br />
<br />
<br />
==PineTab==<br />
<br />
In pinetab we have jack to uart port cable. For enable UART console move selector nearby sd-card slot away from sd-card slot.<br />
<br />
==Testing the vibrator motor==<br />
<br />
You need to have the <code>CONFIG_GPIO_SYSFS</code> enabled in your kernel config for this!<br />
<br />
Vibrator motor is on pin <code>PD2</code>.<br />
You can calculate the PIN number for PD2 as followed ([https://linux-sunxi.org/GPIO more information]):<br />
<code>(4-1) * 32 + 2 = 98</code><br />
<br />
echo "98" > /sys/class/gpio/export # Make pin available<br />
echo "out" > /sys/class/gpio/gpio98/direction # Set as output<br />
echo "1" > /sys/class/gpio/gpio98/value # On<br />
echo "1" > /sys/class/gpio/gpio98/value # Off<br />
echo "98" > /sys/class/gpio/unexport # When you're done<br />
<br />
==Notification LED==<br />
<br />
export COLOR=red # or green, blue is broken due to a hardware fault<br />
# Activate LED<br />
echo 1 > /sys/class/leds/$COLOR/brightness<br />
# Deactivate LED<br />
echo 0 > /sys/class/leds/$COLOR/brightness<br />
<br />
The LED can be controlled in Mer by MCE. You need the <code>mce-plugin-libhybris-nondroid</code> for this.<br />
<br />
=Installation=<br />
==Prepare SD card==<br />
<br />
Use GParted or any other tool to create the following <code>EXT4</code> partitions:<br />
<br />
# <b>boot</b>: Holds the mainline kernel Image and Device Tree files<br />
# <b>data</b>: Holds the Sailfish OS rootFS<br />
<br />
GParted will ask you to leave the first MB free of the SD card when creating the first partition, this is correct.<br />
This 1 MB will be used to store the U-boot boot loader.<br />
<br />
==U-Boot==<br />
<br />
We will now build the mainline U-boot boot loader from Git.<br />
<br />
=== Clone U-boot (master branch): ===<br />
<br />
You can find the U-boot mirror repository on Github:<br />
<br />
git clone github.com/u-boot/u-boot<br />
<br />
=== Compile U-boot ===<br />
<br />
You have to cross compile U-boot with the <code>arm64</code> arch:<br />
<br />
export CROSS_COMPILE=aarch64-linux-gnu-<br />
ARCH=arm64 make clean<br />
ARCH=arm64 make sopine_baseboard_defconfig<br />
ARCH=arm64 make<br />
<br />
The <code>sopine_baseboard_defconfig</code> is the same for the Don't Be Evil devkit.<br />
<br />
=== Burn U-boot to your SD card ===<br />
<br />
Copy the compiled U-boot bootloader to the first sector on your SD card:<br />
<br />
sudo dd if=u-boot-sunxi-with-spl.bin of=/dev/sdX bs=8k seek=1<br />
<br />
<br />
=== Manually loading the kernel ===<br />
<br />
Serial TTY Baudrate over UART = 115200 for screen, example: <code>screen /dev/ttyUSB0 115200</code><br />
You have to start screen first, before turning on the devkit.<br />
<br />
Interrupt the U-boot autoboot process when you see a message in the U-boot prompt. <br />
We need to access the U-boot prompt to load the Kernel image and boot it manually!<br />
<br />
Set bootargs:<br />
<br />
setenv bootargs root=/dev/mmcblk0p2 rootwait panic=10<br />
<br />
Kernel Image loading and Device Tree files:<br />
<br />
ext4load mmc 0:1 ${kernel_addr_r} /Image <br />
ext4load mmc 0:1 ${fdt_addr_r} /sun50i-a64-dontbeevil.dtb <br />
<br />
Boot the kernel:<br />
<br />
booti ${kernel_addr_r} - ${fdt_addr_r}<br />
<br />
=== Automatic boot ===<br />
<br />
Create a <code>boot.cmd</code> file:<br />
<br />
echo Setting bootargs<br />
setenv bootargs console=tty0 console=ttyS0,115200 root=/dev/mmcblk0p2 no_console_suspend rootwait <br />
earlycon=uart,mmio32,0x01c28000 panic=10 consoleblank=0 loglevel=1<br />
printenv<br />
echo Loading DTB<br />
load mmc 0:1 ${fdt_addr_r} /sun50i-a64-dontbeevil.dtb<br />
echo Loading kernel Image<br />
load mmc 0:1 ${kernel_addr_r} /Image<br />
echo Booting kernel NOW<br />
booti ${kernel_addr_r} - ${fdt_addr_r}<br />
<br />
Mount your <code>boot</code> partition and run the following command:<br />
sudo mkimage -C none -A arm -T script -d /mnt/boot.cmd /mnt/boot.scr<br />
<br />
This will translate the <code>boot.cmd</code> file into a U-boot script.<br />
<br />
If you don't have the <code>mkimage</code> command available, you can install it from the <code>uboot-tools</code> package.<br />
<br />
==Kernel==<br />
<br />
The PinePhone runs a mainline kernel, device tree modifications are done by all the PinePhone OS developers on Gitlab (https://gitlab.com/pine64-org/linux).<br />
<br />
=== Clone the kernel ===<br />
<br />
git clone https://gitlab.com/pine64-org/linux<br />
cd linux<br />
git checkout pinephone-dontbeevil<br />
<br />
=== Configure the kernel ===<br />
<br />
# <b>Copy our kernel config</b>: https://gitlab.com/pinephone-sailfish-os/linux-kernel/raw/master/pinephone-config<br />
# <b>Enter the <code>linux</code> project</b>: <code>cd linux</code><br />
# <b>Copy the config file</b> to <code>.config</code> in the main directory<br />
<br />
=== Build the kernel ===<br />
<br />
We cross compile the kernel for ARM64.<br />
The <code>LOCALVERSION</code> variable can be used to add a version to the build.<br />
<br />
Cross compile the kernel:<br />
export ARCH=arm64<br />
export CROSS_COMPILE=aarch64-linux-gnu-<br />
export LOCALVERSION=-nemo<br />
make clean<br />
make oldconfig<br />
make Image modules dtbs<br />
<br />
Install the kernel modules in a different path: <br />
make modules_install INSTALL_MOD_PATH=../linux_modules/<br />
<br />
=== Install kernel ===<br />
<br />
Copy the following things:<br />
<br />
# <b>Image</b> from <code>arch/arm64/boot/Image</code> to the root of the <code>boot</code> partition.<br />
# <b>Device tree files</b> <br />
For pinethone <code>arch/arm64/boot/dts/allwinner/sun50i-a64-dontbeevil.dtb</code> and <code>arch/arm64/boot/dts/allwinner/sun50i-a64-dontbeevil.dts</code> to the root of the <code>boot</code> partition.<br />
<br />
For pinetab <code>arch/arm64/boot/dts/allwinner/sun50i-a64-pinetab.dtb</code> and <code>arch/arm64/boot/dts/allwinner/sun50i-a64-pinetab.dts</code> to the root of the <code>boot</code> partition.<br />
# <b>Modules</b> from <code>../linux_modules</code> to <code>/lib/modules</code> on the <code>boot</code> partition.<br />
<br />
=== Wlan Module ===<br />
<br />
On PinePhone we have mainline kernel driver. But in PineTab we must use https://github.com/Icenowy/rtl8723cs driver.<br />
<br />
==Nemo Mobile==<br />
<br />
For build last release of nemo use this ks file https://gist.github.com/neochapay/8d40f9ee1e5fd621e0053aa126d39e81<br />
<br />
==Sailfish OS==<br />
<br />
===Github & OBS project===<br />
<br />
- https://github.com/sailfish-on-dontbeevil<br />
<br />
- https://build.merproject.org/project/show/nemo:devel:hw:pine:dontbeevil<br />
<br />
===Flash rootFS===<br />
You can download the latest rootFS from the Gitlab SailfishOS Porters CI: https://gitlab.com/sailfishos-porters-ci/dont_be_evil-ci (see the artifacts of the latest CI job).<br />
<br />
This <code>tar.gz</code> archive should be burned to the <code>data</code> partition of the SD card.<br />
It's important to burn it as the root user (not with sudo) to preserve extended attributes and ACLs: <br />
<br />
sudo su<br />
bsdtar -xpf <SAILFISH OS ROOTFS>.tar.bz2 -C <MOUNTPOINT OF /DATA><br />
<br />
===Device repos===<br />
To boot Lipstick, you need to add the device specific repos to the devkit.<br />
All the following commands are executed in a shell on the devkit.<br />
<br />
''Make sure you configure the ethernet interface first before you continue!''<br />
''You need to have access to the WWW to fetch the necessary repository data and packages.''<br />
<br />
Install zypper manually:<br />
curl -o augeas-lib.rpm http://repo.merproject.org/obs/mer:/core/latest_armv7hl/armv7hl/augeas-libs-1.6.0+git1-1.10.6.armv7hl.rpm<br />
curl -o zypper.rpm http://repo.merproject.org/obs/mer:/core/latest_armv7hl/armv7hl/zypper-1.14.6+git3-1.24.5.armv7hl.rpm<br />
rpm -Uvh *rpm<br />
<br />
Use <code>ssu</code> to add the repo<br />
ssu ar common http://repo.merproject.org/obs/nemo:/devel:/hw:/common/sailfish_latest_armv7hl/<br />
ssu ar dontbeevil http://repo.merproject.org/obs/home:/piggz:/dontbeevil/sailfishos_3.0.3.9_latest_armv7hl/<br />
ssu ar jolla https://releases.jolla.com/releases/3.0.3.9/jolla/armv7hl/<br />
<br />
Refresh the repo:<br />
zypper refresh<br />
<br />
Install the device packages:<br />
zypper install dontbeevil:qt5-qtcore dontbeevil:qt5-qttest dontbeevil:lipstick-qt5<br />
zypper install droid-config-dontbeevil # Select 1 for vendor change<br />
zypper install droid-config-dontbeevil-sailfish<br />
zypper install qt5-plugin-platform-eglfs # EGLFS LIMA plugin<br />
zypper install qt5-plugin-generic-evdev # evdev input plugins<br />
<br />
Other useful packages<br />
zypper install mce-tools #useful for mcetool (mcetool -U activates the screen)<br />
<br />
===Unknown password===<br />
The Sailfish OS rootFS sets a random password when booting for the first time.<br />
You can only log in through the <code>telnet</code> debug interface.<br />
Since the <code>eth0</code> interface still requires manually setup, you can't access <code>telnet</code>.<br />
<br />
To circumvent this issue, you can login through the UART TTY interface. <br />
However you don't know the password of the <code>root</code> nor <code>nemo</code> users!<br />
To disable the <code>root</code> and <code>nemo</code> passwords, we can modify the <code>/etc/shadow</code> file:<br />
<br />
sudo chmod +w <SD card data partition>/etc/shadow<br />
sudo vim <SD card data partition>/etc/shadow # Remove any characters where <HASHED PASSWORD> is written: user1:<HASHED PASSWORD>:16092:0:99999:7:::.<br />
sudo chmod -w <SD card data partition>/etc/shadow<br />
<br />
By removing the hashed password, we can login with the user without entering a password.<br />
You can set a new password afterwards by running as a logged in user:<br />
<br />
passwd<br />
<br />
===Init eth0===<br />
Enabling the <code>eth0</code> interface has to be done manually for now:<br />
<br />
ifconfig eth0 <YOUR_IP><br />
route add default gw <DEFAULT_GATEWAY_IP><br />
echo "nameserver <DNS_SERVER_IP>" > /etc/resolv.conf<br />
<br />
Test your configuration with <code>ping</code>:<br />
<br />
ping jolla.com<br />
<br />
<br />
===Lipstick crashing===<br />
<br />
Install Lipstick from the <code>dontbeevil</code> repository:<br />
<br />
zypper install dontbeevil:lipstick-qt5<br />
<br />
===No setup wizard===<br />
<br />
Make sure the configuration package is installed:<br />
<br />
zypper install droid-config-dontbeevil-sailfish<br />
<br />
===Missing regulatory.db for RT8723BS WiFi/BT module===<br />
<br />
git clone git://git.kernel.org/pub/scm/linux/kernel/git/sforshee/wireless-regdb.git<br />
cd wireless-regdb<br />
cp regulatory* /lib/firmware</div>Dylanvanasschttps://wiki.merproject.org/wiki/Adaptations/PinePhone64Adaptations/PinePhone642019-08-29T18:56:32Z<p>Dylanvanassc: /* Sailfish OS */</p>
<hr />
<div>=Hardware Support=<br />
<br />
Full information of hardware spec [https://wiki.pine64.org/index.php/Project_Don't_be_evil Here]<br />
<br />
PostMarket OS hardware information [https://wiki.postmarketos.org/wiki/Pine_Don%27t_be_evil_devkit_(pine-dontbeevil) PostMarketOS Wiki]<br />
<br />
==PineTab==<br />
<br />
In pinetab we have jack to uart port cable. For enable UART console move selector nearby sd-card slot away from sd-card slot.<br />
<br />
==Testing the vibrator motor==<br />
<br />
You need to have the <code>CONFIG_GPIO_SYSFS</code> enabled in your kernel config for this!<br />
<br />
Vibrator motor is on pin <code>PD2</code>.<br />
You can calculate the PIN number for PD2 as followed ([https://linux-sunxi.org/GPIO more information]):<br />
<code>(4-1) * 32 + 2 = 98</code><br />
<br />
echo "98" > /sys/class/gpio/export # Make pin available<br />
echo "out" > /sys/class/gpio/gpio98/direction # Set as output<br />
echo "1" > /sys/class/gpio/gpio98/value # On<br />
echo "1" > /sys/class/gpio/gpio98/value # Off<br />
echo "98" > /sys/class/gpio/unexport # When you're done<br />
<br />
==Notification LED==<br />
<br />
export COLOR=red # or green, blue is broken due to a hardware fault<br />
# Activate LED<br />
echo 1 > /sys/class/leds/$COLOR/brightness<br />
# Deactivate LED<br />
echo 0 > /sys/class/leds/$COLOR/brightness<br />
<br />
The LED can be controlled in Mer by MCE. You need the <code>mce-plugin-libhybris-nondroid</code> for this.<br />
<br />
=Installation=<br />
==Prepare SD card==<br />
<br />
Use GParted or any other tool to create the following <code>EXT4</code> partitions:<br />
<br />
# <b>boot</b>: Holds the mainline kernel Image and Device Tree files<br />
# <b>data</b>: Holds the Sailfish OS rootFS<br />
<br />
GParted will ask you to leave the first MB free of the SD card when creating the first partition, this is correct.<br />
This 1 MB will be used to store the U-boot boot loader.<br />
<br />
==U-Boot==<br />
<br />
We will now build the mainline U-boot boot loader from Git.<br />
<br />
=== Clone U-boot (master branch): ===<br />
<br />
You can find the U-boot mirror repository on Github:<br />
<br />
git clone github.com/u-boot/u-boot<br />
<br />
=== Compile U-boot ===<br />
<br />
You have to cross compile U-boot with the <code>arm64</code> arch:<br />
<br />
export CROSS_COMPILE=aarch64-linux-gnu-<br />
ARCH=arm64 make clean<br />
ARCH=arm64 make sopine_baseboard_defconfig<br />
ARCH=arm64 make<br />
<br />
The <code>sopine_baseboard_defconfig</code> is the same for the Don't Be Evil devkit.<br />
<br />
=== Burn U-boot to your SD card ===<br />
<br />
Copy the compiled U-boot bootloader to the first sector on your SD card:<br />
<br />
sudo dd if=u-boot-sunxi-with-spl.bin of=/dev/sdX bs=8k seek=1<br />
<br />
<br />
=== Manually loading the kernel ===<br />
<br />
Serial TTY Baudrate over UART = 115200 for screen, example: <code>screen /dev/ttyUSB0 115200</code><br />
You have to start screen first, before turning on the devkit.<br />
<br />
Interrupt the U-boot autoboot process when you see a message in the U-boot prompt. <br />
We need to access the U-boot prompt to load the Kernel image and boot it manually!<br />
<br />
Set bootargs:<br />
<br />
setenv bootargs root=/dev/mmcblk0p2 rootwait panic=10<br />
<br />
Kernel Image loading and Device Tree files:<br />
<br />
ext4load mmc 0:1 ${kernel_addr_r} /Image <br />
ext4load mmc 0:1 ${fdt_addr_r} /sun50i-a64-dontbeevil.dtb <br />
<br />
Boot the kernel:<br />
<br />
booti ${kernel_addr_r} - ${fdt_addr_r}<br />
<br />
=== Automatic boot ===<br />
<br />
Create a <code>boot.cmd</code> file:<br />
<br />
echo Setting bootargs<br />
setenv bootargs console=tty0 console=ttyS0,115200 root=/dev/mmcblk0p2 no_console_suspend rootwait <br />
earlycon=uart,mmio32,0x01c28000 panic=10 consoleblank=0 loglevel=1<br />
printenv<br />
echo Loading DTB<br />
load mmc 0:1 ${fdt_addr_r} /sun50i-a64-dontbeevil.dtb<br />
echo Loading kernel Image<br />
load mmc 0:1 ${kernel_addr_r} /Image<br />
echo Booting kernel NOW<br />
booti ${kernel_addr_r} - ${fdt_addr_r}<br />
<br />
Mount your <code>boot</code> partition and run the following command:<br />
sudo mkimage -C none -A arm -T script -d /mnt/boot.cmd /mnt/boot.scr<br />
<br />
This will translate the <code>boot.cmd</code> file into a U-boot script.<br />
<br />
If you don't have the <code>mkimage</code> command available, you can install it from the <code>uboot-tools</code> package.<br />
<br />
==Kernel==<br />
<br />
The PinePhone runs a mainline kernel, device tree modifications are done by all the PinePhone OS developers on Gitlab (https://gitlab.com/pine64-org/linux).<br />
<br />
=== Clone the kernel ===<br />
<br />
git clone https://gitlab.com/pine64-org/linux<br />
cd linux<br />
git checkout pinephone-dontbeevil<br />
<br />
=== Configure the kernel ===<br />
<br />
# <b>Copy our kernel config</b>: https://gitlab.com/pinephone-sailfish-os/linux-kernel/raw/master/pinephone-config<br />
# <b>Enter the <code>linux</code> project</b>: <code>cd linux</code><br />
# <b>Copy the config file</b> to <code>.config</code> in the main directory<br />
<br />
=== Build the kernel ===<br />
<br />
We cross compile the kernel for ARM64.<br />
The <code>LOCALVERSION</code> variable can be used to add a version to the build.<br />
<br />
Cross compile the kernel:<br />
export ARCH=arm64<br />
export CROSS_COMPILE=aarch64-linux-gnu-<br />
export LOCALVERSION=-nemo<br />
make clean<br />
make oldconfig<br />
make Image modules dtbs<br />
<br />
Install the kernel modules in a different path: <br />
make modules_install INSTALL_MOD_PATH=../linux_modules/<br />
<br />
=== Install kernel ===<br />
<br />
Copy the following things:<br />
<br />
# <b>Image</b> from <code>arch/arm64/boot/Image</code> to the root of the <code>boot</code> partition.<br />
# <b>Device tree files</b> <br />
For pinethone <code>arch/arm64/boot/dts/allwinner/sun50i-a64-dontbeevil.dtb</code> and <code>arch/arm64/boot/dts/allwinner/sun50i-a64-dontbeevil.dts</code> to the root of the <code>boot</code> partition.<br />
<br />
For pinetab <code>arch/arm64/boot/dts/allwinner/sun50i-a64-pinetab.dtb</code> and <code>arch/arm64/boot/dts/allwinner/sun50i-a64-pinetab.dts</code> to the root of the <code>boot</code> partition.<br />
# <b>Modules</b> from <code>../linux_modules</code> to <code>/lib/modules</code> on the <code>boot</code> partition.<br />
<br />
=== Wlan Module ===<br />
<br />
On PinePhone we have mainline kernel driver. But in PineTab we must use https://github.com/Icenowy/rtl8723cs driver.<br />
<br />
==Nemo Mobile==<br />
<br />
For build last release of nemo use this ks file https://gist.github.com/neochapay/8d40f9ee1e5fd621e0053aa126d39e81<br />
<br />
==Sailfish OS==<br />
<br />
===Github & OBS project===<br />
<br />
- https://github.com/sailfish-on-dontbeevil<br />
<br />
- https://build.merproject.org/project/show/nemo:devel:hw:pine:dontbeevil<br />
<br />
===Flash rootFS===<br />
You can download the latest rootFS from the Gitlab SailfishOS Porters CI: https://gitlab.com/sailfishos-porters-ci/dont_be_evil-ci (see the artifacts of the latest CI job).<br />
<br />
This <code>tar.gz</code> archive should be burned to the <code>data</code> partition of the SD card.<br />
It's important to burn it as the root user (not with sudo) to preserve extended attributes and ACLs: <br />
<br />
sudo su<br />
bsdtar -xpf <SAILFISH OS ROOTFS>.tar.bz2 -C <MOUNTPOINT OF /DATA><br />
<br />
===Device repos===<br />
To boot Lipstick, you need to add the device specific repos to the devkit.<br />
All the following commands are executed in a shell on the devkit.<br />
<br />
''Make sure you configure the ethernet interface first before you continue!''<br />
''You need to have access to the WWW to fetch the necessary repository data and packages.''<br />
<br />
Install zypper manually:<br />
curl -o augeas-lib.rpm http://repo.merproject.org/obs/mer:/core/latest_armv7hl/armv7hl/augeas-libs-1.6.0+git1-1.10.6.armv7hl.rpm<br />
curl -o zypper.rpm http://repo.merproject.org/obs/mer:/core/latest_armv7hl/armv7hl/zypper-1.14.6+git3-1.24.5.armv7hl.rpm<br />
rpm -Uvh *rpm<br />
<br />
Use <code>ssu</code> to add the repo<br />
ssu ar common http://repo.merproject.org/obs/nemo:/devel:/hw:/common/sailfish_latest_armv7hl/<br />
ssu ar dontbeevil http://repo.merproject.org/obs/home:/piggz:/dontbeevil/sailfishos_3.0.3.9_latest_armv7hl/<br />
ssu ar jolla https://releases.jolla.com/releases/3.0.3.9/jolla/armv7hl/<br />
<br />
Refresh the repo:<br />
zypper refresh<br />
<br />
Install the device packages:<br />
zypper install dontbeevil:qt5-qtcore dontbeevil:qt5-qttest dontbeevil:lipstick-qt5<br />
zypper install droid-config-dontbeevil # Select 1 for vendor change<br />
zypper install droid-config-dontbeevil-sailfish<br />
zypper install qt5-plugin-platform-eglfs # EGLFS LIMA plugin<br />
zypper install qt5-plugin-generic-evdev # evdev input plugins<br />
<br />
Other useful packages<br />
zypper install mce-tools #useful for mcetool (mcetool -U activates the screen)<br />
<br />
===Unknown password===<br />
The Sailfish OS rootFS sets a random password when booting for the first time.<br />
You can only log in through the <code>telnet</code> debug interface.<br />
Since the <code>eth0</code> interface still requires manually setup, you can't access <code>telnet</code>.<br />
<br />
To circumvent this issue, you can login through the UART TTY interface. <br />
However you don't know the password of the <code>root</code> nor <code>nemo</code> users!<br />
To disable the <code>root</code> and <code>nemo</code> passwords, we can modify the <code>/etc/shadow</code> file:<br />
<br />
sudo chmod +w <SD card data partition>/etc/shadow<br />
sudo vim <SD card data partition>/etc/shadow # Remove any characters where <HASHED PASSWORD> is written: user1:<HASHED PASSWORD>:16092:0:99999:7:::.<br />
sudo chmod -w <SD card data partition>/etc/shadow<br />
<br />
By removing the hashed password, we can login with the user without entering a password.<br />
You can set a new password afterwards by running as a logged in user:<br />
<br />
passwd<br />
<br />
===Init eth0===<br />
Enabling the <code>eth0</code> interface has to be done manually for now:<br />
<br />
ifconfig eth0 <YOUR_IP><br />
route add default gw <DEFAULT_GATEWAY_IP><br />
echo "nameserver <DNS_SERVER_IP>" > /etc/resolv.conf<br />
<br />
Test your configuration with <code>ping</code>:<br />
<br />
ping jolla.com<br />
<br />
<br />
===Lipstick crashing===<br />
<br />
Install Lipstick from the <code>dontbeevil</code> repository:<br />
<br />
zypper install dontbeevil:lipstick-qt5<br />
<br />
===No setup wizard===<br />
<br />
Make sure the configuration package is installed:<br />
<br />
zypper install droid-config-dontbeevil-sailfish<br />
<br />
===Missing regulatory.db for RT8723BS WiFi/BT module===<br />
<br />
git clone git://git.kernel.org/pub/scm/linux/kernel/git/sforshee/wireless-regdb.git<br />
cd wireless-regdb<br />
cp regulatory* /lib/firmware</div>Dylanvanasschttps://wiki.merproject.org/wiki/Adaptations/PinePhone64Adaptations/PinePhone642019-08-22T18:45:34Z<p>Dylanvanassc: /* Hardware Support */</p>
<hr />
<div>=Hardware Support=<br />
<br />
Full information of hardware spec [https://wiki.pine64.org/index.php/Project_Don't_be_evil Here]<br />
<br />
PostMarket OS hardware information [https://wiki.postmarketos.org/wiki/Pine_Don%27t_be_evil_devkit_(pine-dontbeevil) PostMarketOS Wiki]<br />
<br />
==PineTab==<br />
<br />
In pinetab we have jack to uart port cable. For enable UART console move selector nearby sd-card slot away from sd-card slot.<br />
<br />
==Testing the vibrator motor==<br />
<br />
You need to have the <code>CONFIG_GPIO_SYSFS</code> enabled in your kernel config for this!<br />
<br />
Vibrator motor is on pin <code>PD2</code>.<br />
You can calculate the PIN number for PD2 as followed ([https://linux-sunxi.org/GPIO more information]):<br />
<code>(4-1) * 32 + 2 = 98</code><br />
<br />
echo "98" > /sys/class/gpio/export # Make pin available<br />
echo "out" > /sys/class/gpio/gpio98/direction # Set as output<br />
echo "1" > /sys/class/gpio/gpio98/value # On<br />
echo "1" > /sys/class/gpio/gpio98/value # Off<br />
echo "98" > /sys/class/gpio/unexport # When you're done<br />
<br />
==Notification LED==<br />
<br />
export COLOR=red # or green, blue is broken due to a hardware fault<br />
# Activate LED<br />
echo 1 > /sys/class/leds/$COLOR/brightness<br />
# Deactivate LED<br />
echo 0 > /sys/class/leds/$COLOR/brightness<br />
<br />
The LED can be controlled in Mer by MCE. You need the <code>mce-plugin-libhybris-nondroid</code> for this.<br />
<br />
=Installation=<br />
==Prepare SD card==<br />
<br />
Use GParted or any other tool to create the following <code>EXT4</code> partitions:<br />
<br />
# <b>boot</b>: Holds the mainline kernel Image and Device Tree files<br />
# <b>data</b>: Holds the Sailfish OS rootFS<br />
<br />
GParted will ask you to leave the first MB free of the SD card when creating the first partition, this is correct.<br />
This 1 MB will be used to store the U-boot boot loader.<br />
<br />
==U-Boot==<br />
<br />
We will now build the mainline U-boot boot loader from Git.<br />
<br />
=== Clone U-boot (master branch): ===<br />
<br />
You can find the U-boot mirror repository on Github:<br />
<br />
git clone github.com/u-boot/u-boot<br />
<br />
=== Compile U-boot ===<br />
<br />
You have to cross compile U-boot with the <code>arm64</code> arch:<br />
<br />
export CROSS_COMPILE=aarch64-linux-gnu-<br />
ARCH=arm64 make clean<br />
ARCH=arm64 make sopine_baseboard_defconfig<br />
ARCH=arm64 make<br />
<br />
The <code>sopine_baseboard_defconfig</code> is the same for the Don't Be Evil devkit.<br />
<br />
=== Burn U-boot to your SD card ===<br />
<br />
Copy the compiled U-boot bootloader to the first sector on your SD card:<br />
<br />
sudo dd if=u-boot-sunxi-with-spl.bin of=/dev/sdX bs=8k seek=1<br />
<br />
<br />
=== Manually loading the kernel ===<br />
<br />
Serial TTY Baudrate over UART = 115200 for screen, example: <code>screen /dev/ttyUSB0 115200</code><br />
You have to start screen first, before turning on the devkit.<br />
<br />
Interrupt the U-boot autoboot process when you see a message in the U-boot prompt. <br />
We need to access the U-boot prompt to load the Kernel image and boot it manually!<br />
<br />
Set bootargs:<br />
<br />
setenv bootargs root=/dev/mmcblk0p2 rootwait panic=10<br />
<br />
Kernel Image loading and Device Tree files:<br />
<br />
ext4load mmc 0:1 ${kernel_addr_r} /Image <br />
ext4load mmc 0:1 ${fdt_addr_r} /sun50i-a64-dontbeevil.dtb <br />
<br />
Boot the kernel:<br />
<br />
booti ${kernel_addr_r} - ${fdt_addr_r}<br />
<br />
=== Automatic boot ===<br />
<br />
Create a <code>boot.cmd</code> file:<br />
<br />
echo Setting bootargs<br />
setenv bootargs console=tty0 console=ttyS0,115200 root=/dev/mmcblk0p2 no_console_suspend rootwait <br />
earlycon=uart,mmio32,0x01c28000 panic=10 consoleblank=0 loglevel=1<br />
printenv<br />
echo Loading DTB<br />
load mmc 0:1 ${fdt_addr_r} /sun50i-a64-dontbeevil.dtb<br />
echo Loading kernel Image<br />
load mmc 0:1 ${kernel_addr_r} /Image<br />
echo Booting kernel NOW<br />
booti ${kernel_addr_r} - ${fdt_addr_r}<br />
<br />
Mount your <code>boot</code> partition and run the following command:<br />
sudo mkimage -C none -A arm -T script -d /mnt/boot.cmd /mnt/boot.scr<br />
<br />
This will translate the <code>boot.cmd</code> file into a U-boot script.<br />
<br />
If you don't have the <code>mkimage</code> command available, you can install it from the <code>uboot-tools</code> package.<br />
<br />
==Kernel==<br />
<br />
The PinePhone runs a mainline kernel, device tree modifications are done by all the PinePhone OS developers on Gitlab (https://gitlab.com/pine64-org/linux).<br />
<br />
=== Clone the kernel ===<br />
<br />
git clone https://gitlab.com/pine64-org/linux<br />
cd linux<br />
git checkout pinephone-dontbeevil<br />
<br />
=== Configure the kernel ===<br />
<br />
# <b>Copy our kernel config</b>: https://gitlab.com/pinephone-sailfish-os/linux-kernel/raw/master/pinephone-config<br />
# <b>Enter the <code>linux</code> project</b>: <code>cd linux</code><br />
# <b>Copy the config file</b> to <code>.config</code> in the main directory<br />
<br />
=== Build the kernel ===<br />
<br />
We cross compile the kernel for ARM64.<br />
The <code>LOCALVERSION</code> variable can be used to add a version to the build.<br />
<br />
Cross compile the kernel:<br />
export ARCH=arm64<br />
export CROSS_COMPILE=aarch64-linux-gnu-<br />
export LOCALVERSION=-nemo<br />
make clean<br />
make oldconfig<br />
make Image modules dtbs<br />
<br />
Install the kernel modules in a different path: <br />
make modules_install INSTALL_MOD_PATH=../linux_modules/<br />
<br />
=== Install kernel ===<br />
<br />
Copy the following things:<br />
<br />
# <b>Image</b> from <code>arch/arm64/boot/Image</code> to the root of the <code>boot</code> partition.<br />
# <b>Device tree files</b> <br />
For pinethone <code>arch/arm64/boot/dts/allwinner/sun50i-a64-dontbeevil.dtb</code> and <code>arch/arm64/boot/dts/allwinner/sun50i-a64-dontbeevil.dts</code> to the root of the <code>boot</code> partition.<br />
<br />
For pinetab <code>arch/arm64/boot/dts/allwinner/sun50i-a64-pinetab.dtb</code> and <code>arch/arm64/boot/dts/allwinner/sun50i-a64-pinetab.dts</code> to the root of the <code>boot</code> partition.<br />
# <b>Modules</b> from <code>../linux_modules</code> to <code>/lib/modules</code> on the <code>boot</code> partition.<br />
<br />
=== Wlan Module ===<br />
<br />
On PinePhone we have mainline kernel driver. But in PineTab we must use https://github.com/Icenowy/rtl8723cs driver.<br />
<br />
==Nemo Mobile==<br />
<br />
For build last release of nemo use this ks file https://gist.github.com/neochapay/8d40f9ee1e5fd621e0053aa126d39e81<br />
<br />
==Sailfish OS==<br />
<br />
===Flash rootFS===<br />
You can download the latest rootFS from the Gitlab SailfishOS Porters CI: https://gitlab.com/sailfishos-porters-ci/dont_be_evil-ci (see the artifacts of the latest CI job).<br />
<br />
This <code>tar.gz</code> archive should be burned to the <code>data</code> partition of the SD card.<br />
It's important to burn it as the root user (not with sudo) to preserve extended attributes and ACLs: <br />
<br />
sudo su<br />
bsdtar -xpf <SAILFISH OS ROOTFS>.tar.bz2 -C <MOUNTPOINT OF /DATA><br />
<br />
===Device repos===<br />
To boot Lipstick, you need to add the device specific repos to the devkit.<br />
All the following commands are executed in a shell on the devkit.<br />
<br />
''Make sure you configure the ethernet interface first before you continue!''<br />
''You need to have access to the WWW to fetch the necessary repository data and packages.''<br />
<br />
Install zypper manually:<br />
curl -o augeas-lib.rpm http://repo.merproject.org/obs/mer:/core/latest_armv7hl/armv7hl/augeas-libs-1.6.0+git1-1.10.6.armv7hl.rpm<br />
curl -o zypper.rpm http://repo.merproject.org/obs/mer:/core/latest_armv7hl/armv7hl/zypper-1.14.6+git3-1.24.5.armv7hl.rpm<br />
rpm -Uvh *rpm<br />
<br />
Use <code>ssu</code> to add the repo<br />
ssu ar common http://repo.merproject.org/obs/nemo:/devel:/hw:/common/sailfish_latest_armv7hl/<br />
ssu ar dontbeevil http://repo.merproject.org/obs/home:/piggz:/dontbeevil/sailfishos_3.0.3.9_latest_armv7hl/<br />
ssu ar jolla https://releases.jolla.com/releases/3.0.3.9/jolla/armv7hl/<br />
<br />
Refresh the repo:<br />
zypper refresh<br />
<br />
Install the device packages:<br />
zypper install dontbeevil:qt5-qtcore dontbeevil:qt5-qttest dontbeevil:lipstick-qt5<br />
zypper install droid-config-dontbeevil # Select 1 for vendor change<br />
zypper install droid-config-dontbeevil-sailfish<br />
zypper install qt5-plugin-platform-eglfs # EGLFS LIMA plugin<br />
zypper install qt5-plugin-generic-evdev # evdev input plugins<br />
<br />
Other useful packages<br />
zypper install mce-tools #useful for mcetool (mcetool -U activates the screen)<br />
<br />
===Unknown password===<br />
The Sailfish OS rootFS sets a random password when booting for the first time.<br />
You can only log in through the <code>telnet</code> debug interface.<br />
Since the <code>eth0</code> interface still requires manually setup, you can't access <code>telnet</code>.<br />
<br />
To circumvent this issue, you can login through the UART TTY interface. <br />
However you don't know the password of the <code>root</code> nor <code>nemo</code> users!<br />
To disable the <code>root</code> and <code>nemo</code> passwords, we can modify the <code>/etc/shadow</code> file:<br />
<br />
sudo chmod +w <SD card data partition>/etc/shadow<br />
sudo vim <SD card data partition>/etc/shadow # Remove any characters where <HASHED PASSWORD> is written: user1:<HASHED PASSWORD>:16092:0:99999:7:::.<br />
sudo chmod -w <SD card data partition>/etc/shadow<br />
<br />
By removing the hashed password, we can login with the user without entering a password.<br />
You can set a new password afterwards by running as a logged in user:<br />
<br />
passwd<br />
<br />
===Init eth0===<br />
Enabling the <code>eth0</code> interface has to be done manually for now:<br />
<br />
ifconfig eth0 <YOUR_IP><br />
route add default gw <DEFAULT_GATEWAY_IP><br />
echo "nameserver <DNS_SERVER_IP>" > /etc/resolv.conf<br />
<br />
Test your configuration with <code>ping</code>:<br />
<br />
ping jolla.com<br />
<br />
<br />
===Lipstick crashing===<br />
<br />
Install Lipstick from the <code>dontbeevil</code> repository:<br />
<br />
zypper install dontbeevil:lipstick-qt5<br />
<br />
===No setup wizard===<br />
<br />
Make sure the configuration package is installed:<br />
<br />
zypper install droid-config-dontbeevil-sailfish<br />
<br />
===Missing regulatory.db for RT8723BS WiFi/BT module===<br />
<br />
git clone git://git.kernel.org/pub/scm/linux/kernel/git/sforshee/wireless-regdb.git<br />
cd wireless-regdb<br />
cp regulatory* /lib/firmware</div>Dylanvanasschttps://wiki.merproject.org/wiki/Adaptations/PinePhone64Adaptations/PinePhone642019-08-22T14:34:55Z<p>Dylanvanassc: /* Build the kernel */</p>
<hr />
<div>=Hardware Support=<br />
<br />
Full information of hardware spec [https://wiki.pine64.org/index.php/Project_Don't_be_evil Here]<br />
<br />
==PineTab==<br />
<br />
In pinetab we have jack to uart port cable. For enable UART console move selector nearby sd-card slot away from sd-card slot.<br />
<br />
==Testing the vibrator motor==<br />
<br />
You need to have the <code>CONFIG_GPIO_SYSFS</code> enabled in your kernel config for this!<br />
<br />
Vibrator motor is on pin <code>PD2</code>.<br />
You can calculate the PIN number for PD2 as followed ([https://linux-sunxi.org/GPIO more information]):<br />
<code>(4-1) * 32 + 2 = 98</code><br />
<br />
echo "98" > /sys/class/gpio/export # Make pin available<br />
echo "out" > /sys/class/gpio/gpio98/direction # Set as output<br />
echo "1" > /sys/class/gpio/gpio98/value # On<br />
echo "1" > /sys/class/gpio/gpio98/value # Off<br />
echo "98" > /sys/class/gpio/unexport # When you're done<br />
<br />
=Installation=<br />
==Prepare SD card==<br />
<br />
Use GParted or any other tool to create the following <code>EXT4</code> partitions:<br />
<br />
# <b>boot</b>: Holds the mainline kernel Image and Device Tree files<br />
# <b>data</b>: Holds the Sailfish OS rootFS<br />
<br />
GParted will ask you to leave the first MB free of the SD card when creating the first partition, this is correct.<br />
This 1 MB will be used to store the U-boot boot loader.<br />
<br />
==U-Boot==<br />
<br />
We will now build the mainline U-boot boot loader from Git.<br />
<br />
=== Clone U-boot (master branch): ===<br />
<br />
You can find the U-boot mirror repository on Github:<br />
<br />
git clone github.com/u-boot/u-boot<br />
<br />
=== Compile U-boot ===<br />
<br />
You have to cross compile U-boot with the <code>arm64</code> arch:<br />
<br />
export CROSS_COMPILE=aarch64-linux-gnu-<br />
ARCH=arm64 make clean<br />
ARCH=arm64 make sopine_baseboard_defconfig<br />
ARCH=arm64 make<br />
<br />
The <code>sopine_baseboard_defconfig</code> is the same for the Don't Be Evil devkit.<br />
<br />
=== Burn U-boot to your SD card ===<br />
<br />
Copy the compiled U-boot bootloader to the first sector on your SD card:<br />
<br />
sudo dd if=u-boot-sunxi-with-spl.bin of=/dev/sdX bs=8k seek=1<br />
<br />
<br />
=== Manually loading the kernel ===<br />
<br />
Serial TTY Baudrate over UART = 115200 for screen, example: <code>screen /dev/ttyUSB0 115200</code><br />
You have to start screen first, before turning on the devkit.<br />
<br />
Interrupt the U-boot autoboot process when you see a message in the U-boot prompt. <br />
We need to access the U-boot prompt to load the Kernel image and boot it manually!<br />
<br />
Set bootargs:<br />
<br />
setenv bootargs root=/dev/mmcblk0p2 rootwait panic=10<br />
<br />
Kernel Image loading and Device Tree files:<br />
<br />
ext4load mmc 0:1 ${kernel_addr_r} /Image <br />
ext4load mmc 0:1 ${fdt_addr_r} /sun50i-a64-dontbeevil.dtb <br />
<br />
Boot the kernel:<br />
<br />
booti ${kernel_addr_r} - ${fdt_addr_r}<br />
<br />
=== Automatic boot ===<br />
<br />
Create a <code>boot.cmd</code> file:<br />
<br />
echo Setting bootargs<br />
setenv bootargs console=tty0 console=ttyS0,115200 root=/dev/mmcblk0p2 no_console_suspend rootwait <br />
earlycon=uart,mmio32,0x01c28000 panic=10 consoleblank=0 loglevel=1<br />
printenv<br />
echo Loading DTB<br />
load mmc 0:1 ${fdt_addr_r} /sun50i-a64-dontbeevil.dtb<br />
echo Loading kernel Image<br />
load mmc 0:1 ${kernel_addr_r} /Image<br />
echo Booting kernel NOW<br />
booti ${kernel_addr_r} - ${fdt_addr_r}<br />
<br />
Mount your <code>boot</code> partition and run the following command:<br />
sudo mkimage -C none -A arm -T script -d /mnt/boot.cmd /mnt/boot.scr<br />
<br />
This will translate the <code>boot.cmd</code> file into a U-boot script.<br />
<br />
If you don't have the <code>mkimage</code> command available, you can install it from the <code>uboot-tools</code> package.<br />
<br />
==Kernel==<br />
<br />
The PinePhone runs a mainline kernel, device tree modifications are done by all the PinePhone OS developers on Gitlab (https://gitlab.com/pine64-org/linux).<br />
<br />
=== Clone the kernel ===<br />
<br />
git clone https://gitlab.com/pine64-org/linux<br />
cd linux<br />
git checkout pinephone-dontbeevil<br />
<br />
=== Configure the kernel ===<br />
<br />
# <b>Copy our kernel config</b>: https://gitlab.com/pinephone-sailfish-os/linux-kernel/raw/master/pinephone-config<br />
# <b>Enter the <code>linux</code> project</b>: <code>cd linux</code><br />
# <b>Copy the config file</b> to <code>.config</code> in the main directory<br />
<br />
=== Build the kernel ===<br />
<br />
We cross compile the kernel for ARM64.<br />
The <code>LOCALVERSION</code> variable can be used to add a version to the build.<br />
<br />
Cross compile the kernel:<br />
export ARCH=arm64<br />
export CROSS_COMPILE=aarch64-linux-gnu-<br />
export LOCALVERSION=-nemo<br />
make clean<br />
make oldconfig<br />
make Image modules dtbs<br />
<br />
Install the kernel modules in a different path: <br />
make modules_install INSTALL_MOD_PATH=../linux_modules/<br />
<br />
=== Install kernel ===<br />
<br />
Copy the following things:<br />
<br />
# <b>Image</b> from <code>arch/arm64/boot/Image</code> to the root of the <code>boot</code> partition.<br />
# <b>Device tree files</b> <br />
For pinethone <code>arch/arm64/boot/dts/allwinner/sun50i-a64-dontbeevil.dtb</code> and <code>arch/arm64/boot/dts/allwinner/sun50i-a64-dontbeevil.dts</code> to the root of the <code>boot</code> partition.<br />
<br />
For pinetab <code>arch/arm64/boot/dts/allwinner/sun50i-a64-pinetab.dtb</code> and <code>arch/arm64/boot/dts/allwinner/sun50i-a64-pinetab.dts</code> to the root of the <code>boot</code> partition.<br />
# <b>Modules</b> from <code>../linux_modules</code> to <code>/lib/modules</code> on the <code>boot</code> partition.<br />
<br />
=== Wlan Module ===<br />
<br />
On PinePhone we have mainline kernel driver. But in PineTab we must use https://github.com/Icenowy/rtl8723cs driver.<br />
<br />
==Nemo Mobile==<br />
<br />
For build last release of nemo use this ks file https://gist.github.com/neochapay/8d40f9ee1e5fd621e0053aa126d39e81<br />
<br />
==Sailfish OS==<br />
<br />
===Flash rootFS===<br />
You can download the latest rootFS from the Gitlab SailfishOS Porters CI: https://gitlab.com/sailfishos-porters-ci/dont_be_evil-ci (see the artifacts of the latest CI job).<br />
<br />
This <code>tar.gz</code> archive should be burned to the <code>data</code> partition of the SD card.<br />
It's important to burn it as the root user (not with sudo) to preserve extended attributes and ACLs: <br />
<br />
sudo su<br />
bsdtar -xpf <SAILFISH OS ROOTFS>.tar.bz2 -C <MOUNTPOINT OF /DATA><br />
<br />
===Device repos===<br />
To boot Lipstick, you need to add the device specific repos to the devkit.<br />
All the following commands are executed in a shell on the devkit.<br />
<br />
''Make sure you configure the ethernet interface first before you continue!''<br />
''You need to have access to the WWW to fetch the necessary repository data and packages.''<br />
<br />
Install zypper manually:<br />
curl -o augeas-lib.rpm http://repo.merproject.org/obs/mer:/core/latest_armv7hl/armv7hl/augeas-libs-1.6.0+git1-1.10.6.armv7hl.rpm<br />
curl -o zypper.rpm http://repo.merproject.org/obs/mer:/core/latest_armv7hl/armv7hl/zypper-1.14.6+git3-1.24.5.armv7hl.rpm<br />
rpm -Uvh *rpm<br />
<br />
Use <code>ssu</code> to add the repo<br />
ssu ar common http://repo.merproject.org/obs/nemo:/devel:/hw:/common/sailfish_latest_armv7hl/<br />
ssu ar dontbeevil http://repo.merproject.org/obs/home:/piggz:/dontbeevil/sailfishos_3.0.3.9_latest_armv7hl/<br />
ssu ar jolla https://releases.jolla.com/releases/3.0.3.9/jolla/armv7hl/<br />
<br />
Refresh the repo:<br />
zypper refresh<br />
<br />
Install the device packages:<br />
zypper install dontbeevil:qt5-qtcore dontbeevil:qt5-qttest dontbeevil:lipstick-qt5<br />
zypper install droid-config-dontbeevil # Select 1 for vendor change<br />
zypper install droid-config-dontbeevil-sailfish<br />
zypper install qt5-plugin-platform-eglfs # EGLFS LIMA plugin<br />
zypper install qt5-plugin-generic-evdev # evdev input plugins<br />
<br />
Other useful packages<br />
zypper install mce-tools #useful for mcetool (mcetool -U activates the screen)<br />
<br />
===Unknown password===<br />
The Sailfish OS rootFS sets a random password when booting for the first time.<br />
You can only log in through the <code>telnet</code> debug interface.<br />
Since the <code>eth0</code> interface still requires manually setup, you can't access <code>telnet</code>.<br />
<br />
To circumvent this issue, you can login through the UART TTY interface. <br />
However you don't know the password of the <code>root</code> nor <code>nemo</code> users!<br />
To disable the <code>root</code> and <code>nemo</code> passwords, we can modify the <code>/etc/shadow</code> file:<br />
<br />
sudo chmod +w <SD card data partition>/etc/shadow<br />
sudo vim <SD card data partition>/etc/shadow # Remove any characters where <HASHED PASSWORD> is written: user1:<HASHED PASSWORD>:16092:0:99999:7:::.<br />
sudo chmod -w <SD card data partition>/etc/shadow<br />
<br />
By removing the hashed password, we can login with the user without entering a password.<br />
You can set a new password afterwards by running as a logged in user:<br />
<br />
passwd<br />
<br />
===Init eth0===<br />
Enabling the <code>eth0</code> interface has to be done manually for now:<br />
<br />
ifconfig eth0 <YOUR_IP><br />
route add default gw <DEFAULT_GATEWAY_IP><br />
echo "nameserver <DNS_SERVER_IP>" > /etc/resolv.conf<br />
<br />
Test your configuration with <code>ping</code>:<br />
<br />
ping jolla.com<br />
<br />
<br />
===Lipstick crashing===<br />
<br />
Install Lipstick from the <code>dontbeevil</code> repository:<br />
<br />
zypper install dontbeevil:lipstick-qt5<br />
<br />
===No setup wizard===<br />
<br />
Make sure the configuration package is installed:<br />
<br />
zypper install droid-config-dontbeevil-sailfish<br />
<br />
===Missing regulatory.db for RT8723BS WiFi/BT module===<br />
<br />
git clone git://git.kernel.org/pub/scm/linux/kernel/git/sforshee/wireless-regdb.git<br />
cd wireless-regdb<br />
cp regulatory* /lib/firmware</div>Dylanvanasschttps://wiki.merproject.org/wiki/Adaptations/PinePhone64Adaptations/PinePhone642019-08-22T13:57:54Z<p>Dylanvanassc: /* Automatic boot */</p>
<hr />
<div>=Hardware Support=<br />
<br />
Full information of hardware spec [https://wiki.pine64.org/index.php/Project_Don't_be_evil Here]<br />
<br />
==PineTab==<br />
<br />
In pinetab we have jack to uart port cable. For enable UART console move selector nearby sd-card slot away from sd-card slot.<br />
<br />
==Testing the vibrator motor==<br />
<br />
You need to have the <code>CONFIG_GPIO_SYSFS</code> enabled in your kernel config for this!<br />
<br />
Vibrator motor is on pin <code>PD2</code>.<br />
You can calculate the PIN number for PD2 as followed ([https://linux-sunxi.org/GPIO more information]):<br />
<code>(4-1) * 32 + 2 = 98</code><br />
<br />
echo "98" > /sys/class/gpio/export # Make pin available<br />
echo "out" > /sys/class/gpio/gpio98/direction # Set as output<br />
echo "1" > /sys/class/gpio/gpio98/value # On<br />
echo "1" > /sys/class/gpio/gpio98/value # Off<br />
echo "98" > /sys/class/gpio/unexport # When you're done<br />
<br />
=Installation=<br />
==Prepare SD card==<br />
<br />
Use GParted or any other tool to create the following <code>EXT4</code> partitions:<br />
<br />
# <b>boot</b>: Holds the mainline kernel Image and Device Tree files<br />
# <b>data</b>: Holds the Sailfish OS rootFS<br />
<br />
GParted will ask you to leave the first MB free of the SD card when creating the first partition, this is correct.<br />
This 1 MB will be used to store the U-boot boot loader.<br />
<br />
==U-Boot==<br />
<br />
We will now build the mainline U-boot boot loader from Git.<br />
<br />
=== Clone U-boot (master branch): ===<br />
<br />
You can find the U-boot mirror repository on Github:<br />
<br />
git clone github.com/u-boot/u-boot<br />
<br />
=== Compile U-boot ===<br />
<br />
You have to cross compile U-boot with the <code>arm64</code> arch:<br />
<br />
export CROSS_COMPILE=aarch64-linux-gnu-<br />
ARCH=arm64 make clean<br />
ARCH=arm64 make sopine_baseboard_defconfig<br />
ARCH=arm64 make<br />
<br />
The <code>sopine_baseboard_defconfig</code> is the same for the Don't Be Evil devkit.<br />
<br />
=== Burn U-boot to your SD card ===<br />
<br />
Copy the compiled U-boot bootloader to the first sector on your SD card:<br />
<br />
sudo dd if=u-boot-sunxi-with-spl.bin of=/dev/sdX bs=8k seek=1<br />
<br />
<br />
=== Manually loading the kernel ===<br />
<br />
Serial TTY Baudrate over UART = 115200 for screen, example: <code>screen /dev/ttyUSB0 115200</code><br />
You have to start screen first, before turning on the devkit.<br />
<br />
Interrupt the U-boot autoboot process when you see a message in the U-boot prompt. <br />
We need to access the U-boot prompt to load the Kernel image and boot it manually!<br />
<br />
Set bootargs:<br />
<br />
setenv bootargs root=/dev/mmcblk0p2 rootwait panic=10<br />
<br />
Kernel Image loading and Device Tree files:<br />
<br />
ext4load mmc 0:1 ${kernel_addr_r} /Image <br />
ext4load mmc 0:1 ${fdt_addr_r} /sun50i-a64-dontbeevil.dtb <br />
<br />
Boot the kernel:<br />
<br />
booti ${kernel_addr_r} - ${fdt_addr_r}<br />
<br />
=== Automatic boot ===<br />
<br />
Create a <code>boot.cmd</code> file:<br />
<br />
echo Setting bootargs<br />
setenv bootargs console=tty0 console=ttyS0,115200 root=/dev/mmcblk0p2 no_console_suspend rootwait <br />
earlycon=uart,mmio32,0x01c28000 panic=10 consoleblank=0 loglevel=1<br />
printenv<br />
echo Loading DTB<br />
load mmc 0:1 ${fdt_addr_r} /sun50i-a64-dontbeevil.dtb<br />
echo Loading kernel Image<br />
load mmc 0:1 ${kernel_addr_r} /Image<br />
echo Booting kernel NOW<br />
booti ${kernel_addr_r} - ${fdt_addr_r}<br />
<br />
Mount your <code>boot</code> partition and run the following command:<br />
sudo mkimage -C none -A arm -T script -d /mnt/boot.cmd /mnt/boot.scr<br />
<br />
This will translate the <code>boot.cmd</code> file into a U-boot script.<br />
<br />
If you don't have the <code>mkimage</code> command available, you can install it from the <code>uboot-tools</code> package.<br />
<br />
==Kernel==<br />
<br />
The PinePhone runs a mainline kernel, device tree modifications are done by all the PinePhone OS developers on Gitlab (https://gitlab.com/pine64-org/linux).<br />
<br />
=== Clone the kernel ===<br />
<br />
git clone https://gitlab.com/pine64-org/linux<br />
cd linux<br />
git checkout pinephone-dontbeevil<br />
<br />
=== Configure the kernel ===<br />
<br />
# <b>Copy our kernel config</b>: https://gitlab.com/pinephone-sailfish-os/linux-kernel/raw/master/pinephone-config<br />
# <b>Enter the <code>linux</code> project</b>: <code>cd linux</code><br />
# <b>Copy the config file</b> to <code>.config</code> in the main directory<br />
<br />
=== Build the kernel ===<br />
<br />
We cross compile the kernel for ARM64.<br />
The <code>LOCALVERSION</code> variable can be used to add a version to the build.<br />
<br />
Cross compile the kernel:<br />
export ARCH=arm64<br />
export CROSS_COMPILE=aarch64-linux-gnu-<br />
export LOCALVERSION=-nemo<br />
make clean<br />
make olddefconfig<br />
make Image modules dtbs<br />
<br />
Install the kernel modules in a different path: <br />
make modules_install INSTALL_MOD_PATH=../linux_modules/<br />
<br />
=== Install kernel ===<br />
<br />
Copy the following things:<br />
<br />
# <b>Image</b> from <code>arch/arm64/boot/Image</code> to the root of the <code>boot</code> partition.<br />
# <b>Device tree files</b> <br />
For pinethone <code>arch/arm64/boot/dts/allwinner/sun50i-a64-dontbeevil.dtb</code> and <code>arch/arm64/boot/dts/allwinner/sun50i-a64-dontbeevil.dts</code> to the root of the <code>boot</code> partition.<br />
<br />
For pinetab <code>arch/arm64/boot/dts/allwinner/sun50i-a64-pinetab.dtb</code> and <code>arch/arm64/boot/dts/allwinner/sun50i-a64-pinetab.dts</code> to the root of the <code>boot</code> partition.<br />
# <b>Modules</b> from <code>../linux_modules</code> to <code>/lib/modules</code> on the <code>boot</code> partition.<br />
<br />
=== Wlan Module ===<br />
<br />
On PinePhone we have mainline kernel driver. But in PineTab we must use https://github.com/Icenowy/rtl8723cs driver.<br />
<br />
==Nemo Mobile==<br />
<br />
For build last release of nemo use this ks file https://gist.github.com/neochapay/8d40f9ee1e5fd621e0053aa126d39e81<br />
<br />
==Sailfish OS==<br />
<br />
===Flash rootFS===<br />
You can download the latest rootFS from the Gitlab SailfishOS Porters CI: https://gitlab.com/sailfishos-porters-ci/dont_be_evil-ci (see the artifacts of the latest CI job).<br />
<br />
This <code>tar.gz</code> archive should be burned to the <code>data</code> partition of the SD card.<br />
It's important to burn it as the root user (not with sudo) to preserve extended attributes and ACLs: <br />
<br />
sudo su<br />
bsdtar -xpf <SAILFISH OS ROOTFS>.tar.bz2 -C <MOUNTPOINT OF /DATA><br />
<br />
===Device repos===<br />
To boot Lipstick, you need to add the device specific repos to the devkit.<br />
All the following commands are executed in a shell on the devkit.<br />
<br />
''Make sure you configure the ethernet interface first before you continue!''<br />
''You need to have access to the WWW to fetch the necessary repository data and packages.''<br />
<br />
Install zypper manually:<br />
curl -o augeas-lib.rpm http://repo.merproject.org/obs/mer:/core/latest_armv7hl/armv7hl/augeas-libs-1.6.0+git1-1.10.6.armv7hl.rpm<br />
curl -o zypper.rpm http://repo.merproject.org/obs/mer:/core/latest_armv7hl/armv7hl/zypper-1.14.6+git3-1.24.5.armv7hl.rpm<br />
rpm -Uvh *rpm<br />
<br />
Use <code>ssu</code> to add the repo<br />
ssu ar common http://repo.merproject.org/obs/nemo:/devel:/hw:/common/sailfish_latest_armv7hl/<br />
ssu ar dontbeevil http://repo.merproject.org/obs/home:/piggz:/dontbeevil/sailfishos_3.0.3.9_latest_armv7hl/<br />
ssu ar jolla https://releases.jolla.com/releases/3.0.3.9/jolla/armv7hl/<br />
<br />
Refresh the repo:<br />
zypper refresh<br />
<br />
Install the device packages:<br />
zypper install dontbeevil:qt5-qtcore dontbeevil:qt5-qttest dontbeevil:lipstick-qt5<br />
zypper install droid-config-dontbeevil # Select 1 for vendor change<br />
zypper install droid-config-dontbeevil-sailfish<br />
zypper install qt5-plugin-platform-eglfs # EGLFS LIMA plugin<br />
zypper install qt5-plugin-generic-evdev # evdev input plugins<br />
<br />
Other useful packages<br />
zypper install mce-tools #useful for mcetool (mcetool -U activates the screen)<br />
<br />
===Unknown password===<br />
The Sailfish OS rootFS sets a random password when booting for the first time.<br />
You can only log in through the <code>telnet</code> debug interface.<br />
Since the <code>eth0</code> interface still requires manually setup, you can't access <code>telnet</code>.<br />
<br />
To circumvent this issue, you can login through the UART TTY interface. <br />
However you don't know the password of the <code>root</code> nor <code>nemo</code> users!<br />
To disable the <code>root</code> and <code>nemo</code> passwords, we can modify the <code>/etc/shadow</code> file:<br />
<br />
sudo chmod +w <SD card data partition>/etc/shadow<br />
sudo vim <SD card data partition>/etc/shadow # Remove any characters where <HASHED PASSWORD> is written: user1:<HASHED PASSWORD>:16092:0:99999:7:::.<br />
sudo chmod -w <SD card data partition>/etc/shadow<br />
<br />
By removing the hashed password, we can login with the user without entering a password.<br />
You can set a new password afterwards by running as a logged in user:<br />
<br />
passwd<br />
<br />
===Init eth0===<br />
Enabling the <code>eth0</code> interface has to be done manually for now:<br />
<br />
ifconfig eth0 <YOUR_IP><br />
route add default gw <DEFAULT_GATEWAY_IP><br />
echo "nameserver <DNS_SERVER_IP>" > /etc/resolv.conf<br />
<br />
Test your configuration with <code>ping</code>:<br />
<br />
ping jolla.com<br />
<br />
<br />
===Lipstick crashing===<br />
<br />
Install Lipstick from the <code>dontbeevil</code> repository:<br />
<br />
zypper install dontbeevil:lipstick-qt5<br />
<br />
===No setup wizard===<br />
<br />
Make sure the configuration package is installed:<br />
<br />
zypper install droid-config-dontbeevil-sailfish<br />
<br />
===Missing regulatory.db for RT8723BS WiFi/BT module===<br />
<br />
git clone git://git.kernel.org/pub/scm/linux/kernel/git/sforshee/wireless-regdb.git<br />
cd wireless-regdb<br />
cp regulatory* /lib/firmware</div>Dylanvanasschttps://wiki.merproject.org/wiki/Adaptations/PinePhone64Adaptations/PinePhone642019-08-07T20:07:04Z<p>Dylanvanassc: /* Sailfish OS */</p>
<hr />
<div>=Hardware Support=<br />
<br />
Full information of hardware spec [https://wiki.pine64.org/index.php/Project_Don't_be_evil Here]<br />
<br />
==Testing the vibrator motor==<br />
<br />
You need to have the <code>CONFIG_GPIO_SYSFS</code> enabled in your kernel config for this!<br />
<br />
Vibrator motor is on pin <code>PD2</code>.<br />
You can calculate the PIN number for PD2 as followed ([https://linux-sunxi.org/GPIO more information]):<br />
<code>(4-1) * 32 + 2 = 98</code><br />
<br />
echo "98" > /sys/class/gpio/export # Make pin available<br />
echo "out" > /sys/class/gpio/gpio98/direction # Set as output<br />
echo "1" > /sys/class/gpio/gpio98/value # On<br />
echo "1" > /sys/class/gpio/gpio98/value # Off<br />
echo "98" > /sys/class/gpio/unexport # When you're done<br />
<br />
=Installation=<br />
==Prepare SD card==<br />
<br />
Use GParted or any other tool to create the following <code>EXT4</code> partitions:<br />
<br />
# <b>boot</b>: Holds the mainline kernel Image and Device Tree files<br />
# <b>data</b>: Holds the Sailfish OS rootFS<br />
<br />
GParted will ask you to leave the first MB free of the SD card when creating the first partition, this is correct.<br />
This 1 MB will be used to store the U-boot boot loader.<br />
<br />
==U-Boot==<br />
<br />
We will now build the mainline U-boot boot loader from Git.<br />
<br />
=== Clone U-boot (master branch): ===<br />
<br />
You can find the U-boot mirror repository on Github:<br />
<br />
git clone github.com/u-boot/u-boot<br />
<br />
=== Compile U-boot ===<br />
<br />
You have to cross compile U-boot with the <code>arm64</code> arch:<br />
<br />
export CROSS_COMPILE=aarch64-linux-gnu-<br />
ARCH=arm64 make clean<br />
ARCH=arm64 make sopine_baseboard_defconfig<br />
ARCH=arm64 make<br />
<br />
The <code>sopine_baseboard_defconfig</code> is the same for the Don't Be Evil devkit.<br />
<br />
=== Burn U-boot to your SD card ===<br />
<br />
Copy the compiled U-boot bootloader to the first sector on your SD card:<br />
<br />
sudo dd if=u-boot-sunxi-with-spl.bin of=/dev/sdX bs=8k seek=1<br />
<br />
<br />
=== Manually loading the kernel ===<br />
<br />
Serial TTY Baudrate over UART = 115200 for screen, example: <code>screen /dev/ttyUSB0 115200</code><br />
You have to start screen first, before turning on the devkit.<br />
<br />
Interrupt the U-boot autoboot process when you see a message in the U-boot prompt. <br />
We need to access the U-boot prompt to load the Kernel image and boot it manually!<br />
<br />
Set bootargs:<br />
<br />
setenv bootargs root=/dev/mmcblk0p2 rootwait panic=10<br />
<br />
Kernel Image loading and Device Tree files:<br />
<br />
ext4load mmc 0:1 ${kernel_addr_r} /Image <br />
ext4load mmc 0:1 ${fdt_addr_r} /sun50i-a64-dontbeevil.dtb <br />
<br />
Boot the kernel:<br />
<br />
booti ${kernel_addr_r} - ${fdt_addr_r}<br />
<br />
=== Automatic boot ===<br />
<br />
Create a <code>boot.cmd</code> file:<br />
<br />
echo Setting bootargs<br />
setenv bootargs console=tty0 console=ttyS0,115200 root=/dev/mmcblk0p2 no_console_suspend rootwait <br />
earlycon=uart,mmio32,0x01c28000 panic=10 consoleblank=0 loglevel=1<br />
printenv<br />
echo Loading DTB<br />
load mmc 0:1 ${fdt_addr_r} /sun50i-a64-dontbeevil.dtb<br />
echo Loading kernel Image<br />
load mmc 0:1 ${kernel_addr_r} /Image<br />
echo Booting kernel NOW<br />
booti ${kernel_addr_r} - ${fdt_addr_r}<br />
<br />
Mount your <code>boot</code> partition and run the following command:<br />
sudo mkimage -C none -A arm -T script -d /mnt/boot.cmd /mnt/boot.scr<br />
<br />
This will translate the <code>boot.cmd</code> file into a U-boot script.<br />
<br />
==Kernel==<br />
<br />
The PinePhone runs a mainline kernel, device tree modifications are done by all the PinePhone OS developers on Gitlab (https://gitlab.com/pine64-org/linux).<br />
<br />
=== Clone the kernel ===<br />
<br />
git clone https://gitlab.com/pine64-org/linux<br />
cd linux<br />
git checkout pinephone-dontbeevil<br />
<br />
=== Configure the kernel ===<br />
<br />
# <b>Copy our kernel config</b>: https://gitlab.com/pinephone-sailfish-os/linux-kernel/raw/master/pinephone-config<br />
# <b>Enter the <code>linux</code> project</b>: <code>cd linux</code><br />
# <b>Copy the config file</b> to <code>.config</code> in the main directory<br />
<br />
=== Build the kernel ===<br />
<br />
We cross compile the kernel for ARM64.<br />
The <code>LOCALVERSION</code> variable can be used to add a version to the build.<br />
<br />
Cross compile the kernel:<br />
export ARCH=arm64<br />
export CROSS_COMPILE=aarch64-linux-gnu-<br />
export LOCALVERSION=-nemo<br />
make clean<br />
make oldconfig<br />
make Image modules dtbs<br />
<br />
Install the kernel modules in a different path: <br />
make modules_install INSTALL_MOD_PATH=../linux_modules/<br />
<br />
=== Install kernel ===<br />
<br />
Copy the following things:<br />
<br />
# <b>Image</b> from <code>arch/arm64/boot/Image</code> to the root of the <code>boot</code> partition.<br />
# <b>Device tree files</b> from <code>arch/arm64/boot/dts/allwinner/sun50i-a64-dontbeevil.dtb</code> and <code>arch/arm64/boot/dts/allwinner/sun50i-a64-dontbeevil.dts</code> to the root of the <code>boot</code> partition.<br />
# <b>Modules</b> from <code>../linux_modules</code> to <code>/lib/modules</code> on the <code>boot</code> partition.<br />
<br />
==Nemo Mobile==<br />
<br />
For build last release of nemo use this ks file https://gist.github.com/neochapay/8d40f9ee1e5fd621e0053aa126d39e81<br />
<br />
==Sailfish OS==<br />
<br />
===Flash rootFS===<br />
You can download the latest rootFS from the Gitlab SailfishOS Porters CI: https://gitlab.com/sailfishos-porters-ci/dont_be_evil-ci (see the artifacts of the latest CI job).<br />
<br />
This <code>tar.gz</code> archive should be burned to the <code>data</code> partition of the SD card.<br />
It's important to burn it as the root user (not with sudo) to preserve extended attributes and ACLs: <br />
<br />
sudo su<br />
bsdtar -xpf <SAILFISH OS ROOTFS>.tar.bz2 -C <MOUNTPOINT OF /DATA><br />
<br />
===Device repos===<br />
To boot Lipstick, you need to add the device specific repos to the devkit.<br />
All the following commands are executed in a shell on the devkit.<br />
<br />
''Make sure you configure the ethernet interface first before you continue!''<br />
''You need to have access to the WWW to fetch the necessary repository data and packages.''<br />
<br />
Install zypper manually:<br />
curl -o augeas-lib.rpm http://repo.merproject.org/obs/mer:/core/latest_armv7hl/armv7hl/augeas-libs-1.6.0+git1-1.10.6.armv7hl.rpm<br />
curl -o zypper.rpm http://repo.merproject.org/obs/mer:/core/latest_armv7hl/armv7hl/zypper-1.14.6+git3-1.24.5.armv7hl.rpm<br />
rpm -Uvh *rpm<br />
<br />
Use <code>ssu</code> to add the repo<br />
ssu ar common http://repo.merproject.org/obs/nemo:/devel:/hw:/common/sailfish_latest_armv7hl/<br />
ssu ar dontbeevil http://repo.merproject.org/obs/home:/piggz:/dontbeevil/sailfishos_3.0.3.9_latest_armv7hl/<br />
ssu ar jolla https://releases.jolla.com/releases/3.0.3.9/jolla/armv7hl/<br />
<br />
Refresh the repo:<br />
zypper refresh<br />
<br />
Install the device packages:<br />
zypper install dontbeevil:qt5-qtcore dontbeevil:qt5-qttest dontbeevil:lipstick-qt5<br />
zypper install droid-config-dontbeevil # Select 1 for vendor change<br />
zypper install droid-config-dontbeevil-sailfish<br />
zypper install qt5-plugin-platform-eglfs # EGLFS LIMA plugin<br />
zypper install qt5-plugin-generic-evdev # evdev input plugins<br />
<br />
Other useful packages<br />
zypper install mce-tools #useful for mcetool (mcetool -U activates the screen)<br />
<br />
===Unknown password===<br />
The Sailfish OS rootFS sets a random password when booting for the first time.<br />
You can only log in through the <code>telnet</code> debug interface.<br />
Since the <code>eth0</code> interface still requires manually setup, you can't access <code>telnet</code>.<br />
<br />
To circumvent this issue, you can login through the UART TTY interface. <br />
However you don't know the password of the <code>root</code> nor <code>nemo</code> users!<br />
To disable the <code>root</code> and <code>nemo</code> passwords, we can modify the <code>/etc/shadow</code> file:<br />
<br />
sudo chmod +w <SD card data partition>/etc/shadow<br />
sudo vim <SD card data partition>/etc/shadow # Remove any characters where <HASHED PASSWORD> is written: user1:<HASHED PASSWORD>:16092:0:99999:7:::.<br />
sudo chmod -w <SD card data partition>/etc/shadow<br />
<br />
By removing the hashed password, we can login with the user without entering a password.<br />
You can set a new password afterwards by running as a logged in user:<br />
<br />
passwd<br />
<br />
===Init eth0===<br />
Enabling the <code>eth0</code> interface has to be done manually for now:<br />
<br />
ifconfig eth0 <YOUR_IP><br />
route add default gw <DEFAULT_GATEWAY_IP><br />
echo "nameserver <DNS_SERVER_IP>" > /etc/resolv.conf<br />
<br />
Test your configuration with <code>ping</code>:<br />
<br />
ping jolla.com<br />
<br />
<br />
===Lipstick crashing===<br />
<br />
Install Lipstick from the <code>dontbeevil</code> repository:<br />
<br />
zypper install dontbeevil:lipstick-qt5<br />
<br />
===No setup wizard===<br />
<br />
Make sure the configuration package is installed:<br />
<br />
zypper install droid-config-dontbeevil-sailfish<br />
<br />
===Missing regulatory.db for RT8723BS WiFi/BT module===<br />
<br />
git clone git://git.kernel.org/pub/scm/linux/kernel/git/sforshee/wireless-regdb.git<br />
cd wireless-regdb<br />
cp regulatory* /lib/firmware</div>Dylanvanasschttps://wiki.merproject.org/wiki/Adaptations/PinePhone64Adaptations/PinePhone642019-08-07T08:27:20Z<p>Dylanvanassc: /* Sailfish OS */</p>
<hr />
<div>=Hardware Support=<br />
<br />
Full information of hardware spec [https://wiki.pine64.org/index.php/Project_Don't_be_evil Here]<br />
<br />
==Testing the vibrator motor==<br />
<br />
You need to have the <code>CONFIG_GPIO_SYSFS</code> enabled in your kernel config for this!<br />
<br />
Vibrator motor is on pin <code>PD2</code>.<br />
You can calculate the PIN number for PD2 as followed ([https://linux-sunxi.org/GPIO more information]):<br />
<code>(4-1) * 32 + 2 = 98</code><br />
<br />
echo "98" > /sys/class/gpio/export # Make pin available<br />
echo "out" > /sys/class/gpio/gpio98/direction # Set as output<br />
echo "1" > /sys/class/gpio/gpio98/value # On<br />
echo "1" > /sys/class/gpio/gpio98/value # Off<br />
echo "98" > /sys/class/gpio/unexport # When you're done<br />
<br />
=Installation=<br />
==Prepare SD card==<br />
<br />
Use GParted or any other tool to create the following <code>EXT4</code> partitions:<br />
<br />
# <b>boot</b>: Holds the mainline kernel Image and Device Tree files<br />
# <b>data</b>: Holds the Sailfish OS rootFS<br />
<br />
GParted will ask you to leave the first MB free of the SD card when creating the first partition, this is correct.<br />
This 1 MB will be used to store the U-boot boot loader.<br />
<br />
==U-Boot==<br />
<br />
We will now build the mainline U-boot boot loader from Git.<br />
<br />
=== Clone U-boot (master branch): ===<br />
<br />
You can find the U-boot mirror repository on Github:<br />
<br />
git clone github.com/u-boot/u-boot<br />
<br />
=== Compile U-boot ===<br />
<br />
You have to cross compile U-boot with the <code>arm64</code> arch:<br />
<br />
export CROSS_COMPILE=aarch64-linux-gnu-<br />
ARCH=arm64 make clean<br />
ARCH=arm64 make sopine_baseboard_defconfig<br />
ARCH=arm64 make<br />
<br />
The <code>sopine_baseboard_defconfig</code> is the same for the Don't Be Evil devkit.<br />
<br />
=== Burn U-boot to your SD card ===<br />
<br />
Copy the compiled U-boot bootloader to the first sector on your SD card:<br />
<br />
sudo dd if=u-boot-sunxi-with-spl.bin of=/dev/sdX bs=8k seek=1<br />
<br />
<br />
=== Manually loading the kernel ===<br />
<br />
Serial TTY Baudrate over UART = 115200 for screen, example: <code>screen /dev/ttyUSB0 115200</code><br />
You have to start screen first, before turning on the devkit.<br />
<br />
Interrupt the U-boot autoboot process when you see a message in the U-boot prompt. <br />
We need to access the U-boot prompt to load the Kernel image and boot it manually!<br />
<br />
Set bootargs:<br />
<br />
setenv bootargs root=/dev/mmcblk0p2 rootwait panic=10<br />
<br />
Kernel Image loading and Device Tree files:<br />
<br />
ext4load mmc 0:1 ${kernel_addr_r} /Image <br />
ext4load mmc 0:1 ${fdt_addr_r} /sun50i-a64-dontbeevil.dtb <br />
<br />
Boot the kernel:<br />
<br />
booti ${kernel_addr_r} - ${fdt_addr_r}<br />
<br />
=== Automatic boot ===<br />
<br />
Create a <code>boot.cmd</code> file:<br />
<br />
echo Setting bootargs<br />
setenv bootargs console=tty0 console=ttyS0,115200 root=/dev/mmcblk0p2 no_console_suspend rootwait <br />
earlycon=uart,mmio32,0x01c28000 panic=10 consoleblank=0 loglevel=1<br />
printenv<br />
echo Loading DTB<br />
load mmc 0:1 ${fdt_addr_r} /sun50i-a64-dontbeevil.dtb<br />
echo Loading kernel Image<br />
load mmc 0:1 ${kernel_addr_r} /Image<br />
echo Booting kernel NOW<br />
booti ${kernel_addr_r} - ${fdt_addr_r}<br />
<br />
Mount your <code>boot</code> partition and run the following command:<br />
sudo mkimage -C none -A arm -T script -d /mnt/boot.cmd /mnt/boot.scr<br />
<br />
This will translate the <code>boot.cmd</code> file into a U-boot script.<br />
<br />
==Kernel==<br />
<br />
The PinePhone runs a mainline kernel, device tree modifications are done by all the PinePhone OS developers on Gitlab (https://gitlab.com/pine64-org/linux).<br />
<br />
=== Clone the kernel ===<br />
<br />
git clone https://gitlab.com/pine64-org/linux<br />
cd linux<br />
git checkout pinephone-dontbeevil<br />
<br />
=== Configure the kernel ===<br />
<br />
# <b>Copy our kernel config</b>: https://gitlab.com/pinephone-sailfish-os/linux-kernel/raw/master/pinephone-config<br />
# <b>Enter the <code>linux</code> project</b>: <code>cd linux</code><br />
# <b>Copy the config file</b> to <code>.config</code> in the main directory<br />
<br />
=== Build the kernel ===<br />
<br />
We cross compile the kernel for ARM64.<br />
The <code>LOCALVERSION</code> variable can be used to add a version to the build.<br />
<br />
Cross compile the kernel:<br />
export ARCH=arm64<br />
export CROSS_COMPILE=aarch64-linux-gnu-<br />
export LOCALVERSION=-nemo<br />
make clean<br />
make oldconfig<br />
make Image modules dtbs<br />
<br />
Install the kernel modules in a different path: <br />
make modules_install INSTALL_MOD_PATH=../linux_modules/<br />
<br />
=== Install kernel ===<br />
<br />
Copy the following things:<br />
<br />
# <b>Image</b> from <code>arch/arm64/boot/Image</code> to the root of the <code>boot</code> partition.<br />
# <b>Device tree files</b> from <code>arch/arm64/boot/dts/allwinner/sun50i-a64-dontbeevil.dtb</code> and <code>arch/arm64/boot/dts/allwinner/sun50i-a64-dontbeevil.dts</code> to the root of the <code>boot</code> partition.<br />
# <b>Modules</b> from <code>../linux_modules</code> to <code>/lib/modules</code> on the <code>boot</code> partition.<br />
<br />
==Nemo Mobile==<br />
<br />
For build last release of nemo use this ks file https://gist.github.com/neochapay/8d40f9ee1e5fd621e0053aa126d39e81<br />
<br />
==Sailfish OS==<br />
<br />
===Flash rootFS===<br />
You can download the latest rootFS from the Gitlab SailfishOS Porters CI: https://gitlab.com/sailfishos-porters-ci/dont_be_evil-ci (see the artifacts of the latest CI job).<br />
<br />
This <code>tar.gz</code> archive should be burned to the <code>data</code> partition of the SD card.<br />
It's important to burn it as the root user (not with sudo) to preserve extended attributes and ACLs: <br />
<br />
sudo su<br />
bsdtar -xpf <SAILFISH OS ROOTFS>.tar.bz2 -C <MOUNTPOINT OF /DATA><br />
<br />
===Device repos===<br />
To boot Lipstick, you need to add the device specific repos to the devkit.<br />
All the following commands are executed in a shell on the devkit.<br />
<br />
''Make sure you configure the ethernet interface first before you continue!''<br />
''You need to have access to the WWW to fetch the necessary repository data and packages.''<br />
<br />
Install zypper manually:<br />
curl -o augeas-lib.rpm http://repo.merproject.org/obs/mer:/core/latest_armv7hl/armv7hl/augeas-libs-1.6.0+git1-1.10.6.armv7hl.rpm<br />
curl -o zypper.rpm http://repo.merproject.org/obs/mer:/core/latest_armv7hl/armv7hl/zypper-1.14.6+git3-1.24.5.armv7hl.rpm<br />
rpm -Uvh *rpm<br />
<br />
Use <code>ssu</code> to add the repo<br />
ssu ar common http://repo.merproject.org/obs/nemo:/devel:/hw:/common/sailfish_latest_armv7hl/<br />
ssu ar dontbeevil http://repo.merproject.org/obs/home:/piggz:/dontbeevil/sailfishos_3.0.3.9_latest_armv7hl/<br />
ssu ar jolla https://releases.jolla.com/releases/3.0.3.9/jolla/armv7hl/<br />
<br />
Refresh the repo:<br />
zypper refresh<br />
<br />
Install the device packages:<br />
zypper install dontbeevil:qt5-qtcore dontbeevil:qt5-qttest dontbeevil:lipstick-qt5<br />
zypper install droid-config-dontbeevil # Select 1 for vendor change<br />
zypper install droid-config-dontbeevil-sailfish<br />
zypper install qt5-plugin-platform-eglfs # EGLFS LIMA plugin<br />
zypper install qt5-plugin-generic-evdev # evdev input plugins<br />
<br />
Other useful packages<br />
zypper install mce-tools #useful for mcetool (mcetool -U activates the screen)<br />
<br />
===Unknown password===<br />
The Sailfish OS rootFS sets a random password when booting for the first time.<br />
You can only log in through the <code>telnet</code> debug interface.<br />
Since the <code>eth0</code> interface still requires manually setup, you can't access <code>telnet</code>.<br />
<br />
To circumvent this issue, you can login through the UART TTY interface. <br />
However you don't know the password of the <code>root</code> nor <code>nemo</code> users!<br />
To disable the <code>root</code> and <code>nemo</code> passwords, we can modify the <code>/etc/shadow</code> file:<br />
<br />
sudo chmod +w <SD card data partition>/etc/shadow<br />
sudo vim <SD card data partition>/etc/shadow # Remove any characters where <HASHED PASSWORD> is written: user1:<HASHED PASSWORD>:16092:0:99999:7:::.<br />
sudo chmod -w <SD card data partition>/etc/shadow<br />
<br />
By removing the hashed password, we can login with the user without entering a password.<br />
You can set a new password afterwards by running as a logged in user:<br />
<br />
passwd<br />
<br />
===Init eth0===<br />
Enabling the <code>eth0</code> interface has to be done manually for now:<br />
<br />
ifconfig eth0 <YOUR_IP><br />
route add default gw <DEFAULT_GATEWAY_IP><br />
echo "nameserver <DNS_SERVER_IP>" > /etc/resolv.conf<br />
<br />
Test your configuration with <code>ping</code>:<br />
<br />
ping jolla.com<br />
<br />
<br />
===Lipstick crashing===<br />
<br />
Install Lipstick from the <code>dontbeevil</code> repository:<br />
<br />
zypper install dontbeevil:lipstick-qt5<br />
<br />
===No setup wizard===<br />
<br />
Make sure the configuration package is installed:<br />
<br />
zypper install droid-config-dontbeevil-sailfish</div>Dylanvanasschttps://wiki.merproject.org/wiki/Adaptations/PinePhone64Adaptations/PinePhone642019-05-30T16:13:12Z<p>Dylanvanassc: /* Device repos */</p>
<hr />
<div>=Hardware Support=<br />
<br />
Full information of hardware spec [https://wiki.pine64.org/index.php/Project_Don't_be_evil Here]<br />
<br />
==Testing the vibrator motor==<br />
<br />
You need to have the <code>CONFIG_GPIO_SYSFS</code> enabled in your kernel config for this!<br />
<br />
Vibrator motor is on pin <code>PD2</code>.<br />
You can calculate the PIN number for PD2 as followed ([https://linux-sunxi.org/GPIO more information]):<br />
<code>(4-1) * 32 + 2 = 98</code><br />
<br />
echo "98" > /sys/class/gpio/export # Make pin available<br />
echo "out" > /sys/class/gpio/gpio98/direction # Set as output<br />
echo "1" > /sys/class/gpio/gpio98/value # On<br />
echo "1" > /sys/class/gpio/gpio98/value # Off<br />
echo "98" > /sys/class/gpio/unexport # When you're done<br />
<br />
=Installation=<br />
==Prepare SD card==<br />
<br />
Use GParted or any other tool to create the following <code>EXT4</code> partitions:<br />
<br />
# <b>boot</b>: Holds the mainline kernel Image and Device Tree files<br />
# <b>data</b>: Holds the Sailfish OS rootFS<br />
<br />
GParted will ask you to leave the first MB free of the SD card when creating the first partition, this is correct.<br />
This 1 MB will be used to store the U-boot boot loader.<br />
<br />
==U-Boot==<br />
<br />
We will now build the mainline U-boot boot loader from Git.<br />
<br />
=== Clone U-boot (master branch): ===<br />
<br />
You can find the U-boot mirror repository on Github:<br />
<br />
git clone github.com/u-boot/u-boot<br />
<br />
=== Compile U-boot ===<br />
<br />
You have to cross compile U-boot with the <code>arm64</code> arch:<br />
<br />
export CROSS_COMPILE=aarch64-linux-gnu-<br />
ARCH=arm64 make clean<br />
ARCH=arm64 make sopine_baseboard_defconfig<br />
ARCH=arm64 make<br />
<br />
The <code>sopine_baseboard_defconfig</code> is the same for the Don't Be Evil devkit.<br />
<br />
=== Burn U-boot to your SD card ===<br />
<br />
Copy the compiled U-boot bootloader to the first sector on your SD card:<br />
<br />
sudo dd if=u-boot-sunxi-with-spl.bin of=/dev/sdX bs=8k seek=1<br />
<br />
<br />
=== Manually loading the kernel ===<br />
<br />
Serial TTY Baudrate over UART = 115200 for screen, example: <code>screen /dev/ttyUSB0 115200</code><br />
You have to start screen first, before turning on the devkit.<br />
<br />
Interrupt the U-boot autoboot process when you see a message in the U-boot prompt. <br />
We need to access the U-boot prompt to load the Kernel image and boot it manually!<br />
<br />
Set bootargs:<br />
<br />
setenv bootargs root=/dev/mmcblk0p2 rootwait panic=10<br />
<br />
Kernel Image loading and Device Tree files:<br />
<br />
ext4load mmc 0:1 ${kernel_addr_r} /Image <br />
ext4load mmc 0:1 ${fdt_addr_r} /sun50i-a64-dontbeevil.dtb <br />
<br />
Boot the kernel:<br />
<br />
booti ${kernel_addr_r} - ${fdt_addr_r}<br />
<br />
=== Automatic boot ===<br />
<br />
Create a <code>boot.cmd</code> file:<br />
<br />
echo Setting bootargs<br />
setenv bootargs console=tty0 console=ttyS0,115200 root=/dev/mmcblk0p2 no_console_suspend rootwait <br />
earlycon=uart,mmio32,0x01c28000 panic=10 consoleblank=0 loglevel=1<br />
printenv<br />
echo Loading DTB<br />
load mmc 0:1 ${fdt_addr_r} /sun50i-a64-dontbeevil.dtb<br />
echo Loading kernel Image<br />
load mmc 0:1 ${kernel_addr_r} /Image<br />
echo Booting kernel NOW<br />
booti ${kernel_addr_r} - ${fdt_addr_r}<br />
<br />
Mount your <code>boot</code> partition and run the following command:<br />
sudo mkimage -C none -A arm -T script -d /mnt/boot.cmd /mnt/boot.scr<br />
<br />
This will translate the <code>boot.cmd</code> file into a U-boot script.<br />
<br />
==Kernel==<br />
<br />
The PinePhone runs a mainline kernel, device tree modifications are done by all the PinePhone OS developers on Gitlab (https://gitlab.com/pine64-org/linux).<br />
<br />
=== Clone the kernel ===<br />
<br />
git clone https://gitlab.com/pine64-org/linux<br />
cd linux<br />
git checkout pinephone-dontbeevil<br />
<br />
=== Configure the kernel ===<br />
<br />
# <b>Copy our kernel config</b>: https://gitlab.com/pinephone-sailfish-os/linux-kernel/raw/master/pinephone-config<br />
# <b>Enter the <code>linux</code> project</b>: <code>cd linux</code><br />
# <b>Copy the config file</b> to <code>.config</code> in the main directory<br />
<br />
=== Build the kernel ===<br />
<br />
We cross compile the kernel for ARM64.<br />
The <code>LOCALVERSION</code> variable can be used to add a version to the build.<br />
<br />
Cross compile the kernel:<br />
export ARCH=arm64<br />
export CROSS_COMPILE=aarch64-linux-gnu-<br />
export LOCALVERSION=-nemo<br />
make clean<br />
make oldconfig<br />
make Image modules dtbs<br />
<br />
Install the kernel modules in a different path: <br />
make modules_install INSTALL_MOD_PATH=../linux_modules/<br />
<br />
=== Install kernel ===<br />
<br />
Copy the following things:<br />
<br />
# <b>Image</b> from <code>arch/arm64/boot/Image</code> to the root of the <code>boot</code> partition.<br />
# <b>Device tree files</b> from <code>arch/arm64/boot/dts/allwinner/sun50i-a64-dontbeevil.dtb</code> and <code>arch/arm64/boot/dts/allwinner/sun50i-a64-dontbeevil.dts</code> to the root of the <code>boot</code> partition.<br />
# <b>Modules</b> from <code>../linux_modules</code> to <code>/lib/modules</code> on the <code>boot</code> partition.<br />
<br />
==Nemo Mobile==<br />
<br />
==Sailfish OS==<br />
<br />
===Flash rootFS===<br />
You can download the latest rootFS from the Gitlab SailfishOS Porters CI: https://gitlab.com/sailfishos-porters-ci/dont_be_evil-ci (see the artifacts of the latest CI job).<br />
<br />
This <code>tar.gz</code> archive should be burned to the <code>data</code> partition of the SD card.<br />
It's important to burn it as the root user (not with sudo) to preserve extended attributes and ACLs: <br />
<br />
sudo su<br />
bsdtar -xpf <SAILFISH OS ROOTFS>.tar.bz2 -C <MOUNTPOINT OF /DATA><br />
<br />
===Device repos===<br />
To boot Lipstick, you need to add the device specific repos to the devkit.<br />
All the following commands are executed in a shell on the devkit.<br />
<br />
''Make sure you configure the ethernet interface first before you continue!''<br />
''You need to have access to the WWW to fetch the necessary repository data and packages.''<br />
<br />
Install zypper manually:<br />
curl -o augeas-lib.rpm http://repo.merproject.org/obs/mer:/core/latest_armv7hl/armv7hl/augeas-libs-1.6.0+git1-1.10.6.armv7hl.rpm<br />
curl -o zypper.rpm http://repo.merproject.org/obs/mer:/core/latest_armv7hl/armv7hl/zypper-1.14.6+git3-1.24.5.armv7hl.rpm<br />
rpm -Uvh *rpm<br />
<br />
Use <code>ssu</code> to add the repo<br />
ssu ar common http://repo.merproject.org/obs/nemo:/devel:/hw:/common/sailfish_latest_armv7hl/<br />
ssu ar dontbeevil http://repo.merproject.org/obs/home:/piggz:/dontbeevil/sailfishos_3.0.3.9_latest_armv7hl/<br />
<br />
Refresh the repo:<br />
zypper refresh<br />
<br />
Install the device packages:<br />
zypper install dontbeevil:qt5-qtcore dontbeevil:qt5-qttest dontbeevil:lipstick-qt5<br />
zypper install droid-config-dontbeevil # Select 1 for vendor change<br />
zypper install qt5-plugin-platform-eglfs # EGLFS LIMA plugin<br />
<br />
===Unknown password===<br />
The Sailfish OS rootFS sets a random password when booting for the first time.<br />
You can only log in through the <code>telnet</code> debug interface.<br />
Since the <code>eth0</code> interface still requires manually setup, you can't access <code>telnet</code>.<br />
<br />
To circumvent this issue, you can login through the UART TTY interface. <br />
However you don't know the password of the <code>root</code> nor <code>nemo</code> users!<br />
To disable the <code>root</code> and <code>nemo</code> passwords, we can modify the <code>/etc/shadow</code> file:<br />
<br />
sudo chmod +w <SD card data partition>/etc/shadow<br />
sudo vim <SD card data partition>/etc/shadow # Remove any characters where <HASHED PASSWORD> is written: user1:<HASHED PASSWORD>:16092:0:99999:7:::.<br />
sudo chmod -w <SD card data partition>/etc/shadow<br />
<br />
By removing the hashed password, we can login with the user without entering a password.<br />
You can set a new password afterwards by running as a logged in user:<br />
<br />
passwd<br />
<br />
===Init eth0===<br />
Enabling the <code>eth0</code> interface has to be done manually for now:<br />
<br />
ifconfig eth0 <YOUR_IP><br />
route add default gw <DEFAULT_GATEWAY_IP><br />
echo "nameserver <DNS_SERVER_IP>" > /etc/resolv.conf<br />
<br />
Test your configuration with <code>ping</code>:<br />
<br />
ping jolla.com</div>Dylanvanasschttps://wiki.merproject.org/wiki/Adaptations/PinePhone64Adaptations/PinePhone642019-05-30T16:05:10Z<p>Dylanvanassc: /* Device repos */</p>
<hr />
<div>=Hardware Support=<br />
<br />
Full information of hardware spec [https://wiki.pine64.org/index.php/Project_Don't_be_evil Here]<br />
<br />
==Testing the vibrator motor==<br />
<br />
You need to have the <code>CONFIG_GPIO_SYSFS</code> enabled in your kernel config for this!<br />
<br />
Vibrator motor is on pin <code>PD2</code>.<br />
You can calculate the PIN number for PD2 as followed ([https://linux-sunxi.org/GPIO more information]):<br />
<code>(4-1) * 32 + 2 = 98</code><br />
<br />
echo "98" > /sys/class/gpio/export # Make pin available<br />
echo "out" > /sys/class/gpio/gpio98/direction # Set as output<br />
echo "1" > /sys/class/gpio/gpio98/value # On<br />
echo "1" > /sys/class/gpio/gpio98/value # Off<br />
echo "98" > /sys/class/gpio/unexport # When you're done<br />
<br />
=Installation=<br />
==Prepare SD card==<br />
<br />
Use GParted or any other tool to create the following <code>EXT4</code> partitions:<br />
<br />
# <b>boot</b>: Holds the mainline kernel Image and Device Tree files<br />
# <b>data</b>: Holds the Sailfish OS rootFS<br />
<br />
GParted will ask you to leave the first MB free of the SD card when creating the first partition, this is correct.<br />
This 1 MB will be used to store the U-boot boot loader.<br />
<br />
==U-Boot==<br />
<br />
We will now build the mainline U-boot boot loader from Git.<br />
<br />
=== Clone U-boot (master branch): ===<br />
<br />
You can find the U-boot mirror repository on Github:<br />
<br />
git clone github.com/u-boot/u-boot<br />
<br />
=== Compile U-boot ===<br />
<br />
You have to cross compile U-boot with the <code>arm64</code> arch:<br />
<br />
export CROSS_COMPILE=aarch64-linux-gnu-<br />
ARCH=arm64 make clean<br />
ARCH=arm64 make sopine_baseboard_defconfig<br />
ARCH=arm64 make<br />
<br />
The <code>sopine_baseboard_defconfig</code> is the same for the Don't Be Evil devkit.<br />
<br />
=== Burn U-boot to your SD card ===<br />
<br />
Copy the compiled U-boot bootloader to the first sector on your SD card:<br />
<br />
sudo dd if=u-boot-sunxi-with-spl.bin of=/dev/sdX bs=8k seek=1<br />
<br />
<br />
=== Manually loading the kernel ===<br />
<br />
Serial TTY Baudrate over UART = 115200 for screen, example: <code>screen /dev/ttyUSB0 115200</code><br />
You have to start screen first, before turning on the devkit.<br />
<br />
Interrupt the U-boot autoboot process when you see a message in the U-boot prompt. <br />
We need to access the U-boot prompt to load the Kernel image and boot it manually!<br />
<br />
Set bootargs:<br />
<br />
setenv bootargs root=/dev/mmcblk0p2 rootwait panic=10<br />
<br />
Kernel Image loading and Device Tree files:<br />
<br />
ext4load mmc 0:1 ${kernel_addr_r} /Image <br />
ext4load mmc 0:1 ${fdt_addr_r} /sun50i-a64-dontbeevil.dtb <br />
<br />
Boot the kernel:<br />
<br />
booti ${kernel_addr_r} - ${fdt_addr_r}<br />
<br />
=== Automatic boot ===<br />
<br />
Create a <code>boot.cmd</code> file:<br />
<br />
echo Setting bootargs<br />
setenv bootargs console=tty0 console=ttyS0,115200 root=/dev/mmcblk0p2 no_console_suspend rootwait <br />
earlycon=uart,mmio32,0x01c28000 panic=10 consoleblank=0 loglevel=1<br />
printenv<br />
echo Loading DTB<br />
load mmc 0:1 ${fdt_addr_r} /sun50i-a64-dontbeevil.dtb<br />
echo Loading kernel Image<br />
load mmc 0:1 ${kernel_addr_r} /Image<br />
echo Booting kernel NOW<br />
booti ${kernel_addr_r} - ${fdt_addr_r}<br />
<br />
Mount your <code>boot</code> partition and run the following command:<br />
sudo mkimage -C none -A arm -T script -d /mnt/boot.cmd /mnt/boot.scr<br />
<br />
This will translate the <code>boot.cmd</code> file into a U-boot script.<br />
<br />
==Kernel==<br />
<br />
The PinePhone runs a mainline kernel, device tree modifications are done by all the PinePhone OS developers on Gitlab (https://gitlab.com/pine64-org/linux).<br />
<br />
=== Clone the kernel ===<br />
<br />
git clone https://gitlab.com/pine64-org/linux<br />
cd linux<br />
git checkout pinephone-dontbeevil<br />
<br />
=== Configure the kernel ===<br />
<br />
# <b>Copy our kernel config</b>: https://gitlab.com/pinephone-sailfish-os/linux-kernel/raw/master/pinephone-config<br />
# <b>Enter the <code>linux</code> project</b>: <code>cd linux</code><br />
# <b>Copy the config file</b> to <code>.config</code> in the main directory<br />
<br />
=== Build the kernel ===<br />
<br />
We cross compile the kernel for ARM64.<br />
The <code>LOCALVERSION</code> variable can be used to add a version to the build.<br />
<br />
Cross compile the kernel:<br />
export ARCH=arm64<br />
export CROSS_COMPILE=aarch64-linux-gnu-<br />
export LOCALVERSION=-nemo<br />
make clean<br />
make oldconfig<br />
make Image modules dtbs<br />
<br />
Install the kernel modules in a different path: <br />
make modules_install INSTALL_MOD_PATH=../linux_modules/<br />
<br />
=== Install kernel ===<br />
<br />
Copy the following things:<br />
<br />
# <b>Image</b> from <code>arch/arm64/boot/Image</code> to the root of the <code>boot</code> partition.<br />
# <b>Device tree files</b> from <code>arch/arm64/boot/dts/allwinner/sun50i-a64-dontbeevil.dtb</code> and <code>arch/arm64/boot/dts/allwinner/sun50i-a64-dontbeevil.dts</code> to the root of the <code>boot</code> partition.<br />
# <b>Modules</b> from <code>../linux_modules</code> to <code>/lib/modules</code> on the <code>boot</code> partition.<br />
<br />
==Nemo Mobile==<br />
<br />
==Sailfish OS==<br />
<br />
===Flash rootFS===<br />
You can download the latest rootFS from the Gitlab SailfishOS Porters CI: https://gitlab.com/sailfishos-porters-ci/dont_be_evil-ci (see the artifacts of the latest CI job).<br />
<br />
This <code>tar.gz</code> archive should be burned to the <code>data</code> partition of the SD card.<br />
It's important to burn it as the root user (not with sudo) to preserve extended attributes and ACLs: <br />
<br />
sudo su<br />
bsdtar -xpf <SAILFISH OS ROOTFS>.tar.bz2 -C <MOUNTPOINT OF /DATA><br />
<br />
===Device repos===<br />
To boot Lipstick, you need to add the device specific repos to the devkit.<br />
All the following commands are executed in a shell on the devkit.<br />
<br />
''Make sure you configure the ethernet interface first before you continue!''<br />
''You need to have access to the WWW to fetch the necessary repository data and packages.''<br />
<br />
Install zypper manually:<br />
curl -o augeas-lib.rpm http://repo.merproject.org/obs/mer:/core/latest_armv7hl/armv7hl/augeas-libs-1.6.0+git1-1.10.6.armv7hl.rpm<br />
curl -o zypper.rpm http://repo.merproject.org/obs/mer:/core/latest_armv7hl/armv7hl/zypper-1.14.6+git3-1.24.5.armv7hl.rpm<br />
rpm -Uvh *rpm<br />
<br />
Use <code>ssu</code> to add the repo<br />
ssu ar common http://repo.merproject.org/obs/nemo:/devel:/hw:/common/sailfish_latest_armv7hl/<br />
ssu ar dontbeevil http://repo.merproject.org/obs/home:/piggz:/dontbeevil/sailfishos_3.0.3.9_latest_armv7hl/<br />
<br />
Refresh the repo:<br />
zypper refresh<br />
<br />
Install the device packages:<br />
zypper install dontbeevil:qt5-qtcore dontbeevil:qt5-qttest dontbeevil:lipstick-qt5<br />
zypper install droid-config-dontbeevil # Select 1 for vendor change<br />
<br />
===Unknown password===<br />
The Sailfish OS rootFS sets a random password when booting for the first time.<br />
You can only log in through the <code>telnet</code> debug interface.<br />
Since the <code>eth0</code> interface still requires manually setup, you can't access <code>telnet</code>.<br />
<br />
To circumvent this issue, you can login through the UART TTY interface. <br />
However you don't know the password of the <code>root</code> nor <code>nemo</code> users!<br />
To disable the <code>root</code> and <code>nemo</code> passwords, we can modify the <code>/etc/shadow</code> file:<br />
<br />
sudo chmod +w <SD card data partition>/etc/shadow<br />
sudo vim <SD card data partition>/etc/shadow # Remove any characters where <HASHED PASSWORD> is written: user1:<HASHED PASSWORD>:16092:0:99999:7:::.<br />
sudo chmod -w <SD card data partition>/etc/shadow<br />
<br />
By removing the hashed password, we can login with the user without entering a password.<br />
You can set a new password afterwards by running as a logged in user:<br />
<br />
passwd<br />
<br />
===Init eth0===<br />
Enabling the <code>eth0</code> interface has to be done manually for now:<br />
<br />
ifconfig eth0 <YOUR_IP><br />
route add default gw <DEFAULT_GATEWAY_IP><br />
echo "nameserver <DNS_SERVER_IP>" > /etc/resolv.conf<br />
<br />
Test your configuration with <code>ping</code>:<br />
<br />
ping jolla.com</div>Dylanvanasschttps://wiki.merproject.org/wiki/Adaptations/PinePhone64Adaptations/PinePhone642019-05-30T16:05:00Z<p>Dylanvanassc: /* Device repos */</p>
<hr />
<div>=Hardware Support=<br />
<br />
Full information of hardware spec [https://wiki.pine64.org/index.php/Project_Don't_be_evil Here]<br />
<br />
==Testing the vibrator motor==<br />
<br />
You need to have the <code>CONFIG_GPIO_SYSFS</code> enabled in your kernel config for this!<br />
<br />
Vibrator motor is on pin <code>PD2</code>.<br />
You can calculate the PIN number for PD2 as followed ([https://linux-sunxi.org/GPIO more information]):<br />
<code>(4-1) * 32 + 2 = 98</code><br />
<br />
echo "98" > /sys/class/gpio/export # Make pin available<br />
echo "out" > /sys/class/gpio/gpio98/direction # Set as output<br />
echo "1" > /sys/class/gpio/gpio98/value # On<br />
echo "1" > /sys/class/gpio/gpio98/value # Off<br />
echo "98" > /sys/class/gpio/unexport # When you're done<br />
<br />
=Installation=<br />
==Prepare SD card==<br />
<br />
Use GParted or any other tool to create the following <code>EXT4</code> partitions:<br />
<br />
# <b>boot</b>: Holds the mainline kernel Image and Device Tree files<br />
# <b>data</b>: Holds the Sailfish OS rootFS<br />
<br />
GParted will ask you to leave the first MB free of the SD card when creating the first partition, this is correct.<br />
This 1 MB will be used to store the U-boot boot loader.<br />
<br />
==U-Boot==<br />
<br />
We will now build the mainline U-boot boot loader from Git.<br />
<br />
=== Clone U-boot (master branch): ===<br />
<br />
You can find the U-boot mirror repository on Github:<br />
<br />
git clone github.com/u-boot/u-boot<br />
<br />
=== Compile U-boot ===<br />
<br />
You have to cross compile U-boot with the <code>arm64</code> arch:<br />
<br />
export CROSS_COMPILE=aarch64-linux-gnu-<br />
ARCH=arm64 make clean<br />
ARCH=arm64 make sopine_baseboard_defconfig<br />
ARCH=arm64 make<br />
<br />
The <code>sopine_baseboard_defconfig</code> is the same for the Don't Be Evil devkit.<br />
<br />
=== Burn U-boot to your SD card ===<br />
<br />
Copy the compiled U-boot bootloader to the first sector on your SD card:<br />
<br />
sudo dd if=u-boot-sunxi-with-spl.bin of=/dev/sdX bs=8k seek=1<br />
<br />
<br />
=== Manually loading the kernel ===<br />
<br />
Serial TTY Baudrate over UART = 115200 for screen, example: <code>screen /dev/ttyUSB0 115200</code><br />
You have to start screen first, before turning on the devkit.<br />
<br />
Interrupt the U-boot autoboot process when you see a message in the U-boot prompt. <br />
We need to access the U-boot prompt to load the Kernel image and boot it manually!<br />
<br />
Set bootargs:<br />
<br />
setenv bootargs root=/dev/mmcblk0p2 rootwait panic=10<br />
<br />
Kernel Image loading and Device Tree files:<br />
<br />
ext4load mmc 0:1 ${kernel_addr_r} /Image <br />
ext4load mmc 0:1 ${fdt_addr_r} /sun50i-a64-dontbeevil.dtb <br />
<br />
Boot the kernel:<br />
<br />
booti ${kernel_addr_r} - ${fdt_addr_r}<br />
<br />
=== Automatic boot ===<br />
<br />
Create a <code>boot.cmd</code> file:<br />
<br />
echo Setting bootargs<br />
setenv bootargs console=tty0 console=ttyS0,115200 root=/dev/mmcblk0p2 no_console_suspend rootwait <br />
earlycon=uart,mmio32,0x01c28000 panic=10 consoleblank=0 loglevel=1<br />
printenv<br />
echo Loading DTB<br />
load mmc 0:1 ${fdt_addr_r} /sun50i-a64-dontbeevil.dtb<br />
echo Loading kernel Image<br />
load mmc 0:1 ${kernel_addr_r} /Image<br />
echo Booting kernel NOW<br />
booti ${kernel_addr_r} - ${fdt_addr_r}<br />
<br />
Mount your <code>boot</code> partition and run the following command:<br />
sudo mkimage -C none -A arm -T script -d /mnt/boot.cmd /mnt/boot.scr<br />
<br />
This will translate the <code>boot.cmd</code> file into a U-boot script.<br />
<br />
==Kernel==<br />
<br />
The PinePhone runs a mainline kernel, device tree modifications are done by all the PinePhone OS developers on Gitlab (https://gitlab.com/pine64-org/linux).<br />
<br />
=== Clone the kernel ===<br />
<br />
git clone https://gitlab.com/pine64-org/linux<br />
cd linux<br />
git checkout pinephone-dontbeevil<br />
<br />
=== Configure the kernel ===<br />
<br />
# <b>Copy our kernel config</b>: https://gitlab.com/pinephone-sailfish-os/linux-kernel/raw/master/pinephone-config<br />
# <b>Enter the <code>linux</code> project</b>: <code>cd linux</code><br />
# <b>Copy the config file</b> to <code>.config</code> in the main directory<br />
<br />
=== Build the kernel ===<br />
<br />
We cross compile the kernel for ARM64.<br />
The <code>LOCALVERSION</code> variable can be used to add a version to the build.<br />
<br />
Cross compile the kernel:<br />
export ARCH=arm64<br />
export CROSS_COMPILE=aarch64-linux-gnu-<br />
export LOCALVERSION=-nemo<br />
make clean<br />
make oldconfig<br />
make Image modules dtbs<br />
<br />
Install the kernel modules in a different path: <br />
make modules_install INSTALL_MOD_PATH=../linux_modules/<br />
<br />
=== Install kernel ===<br />
<br />
Copy the following things:<br />
<br />
# <b>Image</b> from <code>arch/arm64/boot/Image</code> to the root of the <code>boot</code> partition.<br />
# <b>Device tree files</b> from <code>arch/arm64/boot/dts/allwinner/sun50i-a64-dontbeevil.dtb</code> and <code>arch/arm64/boot/dts/allwinner/sun50i-a64-dontbeevil.dts</code> to the root of the <code>boot</code> partition.<br />
# <b>Modules</b> from <code>../linux_modules</code> to <code>/lib/modules</code> on the <code>boot</code> partition.<br />
<br />
==Nemo Mobile==<br />
<br />
==Sailfish OS==<br />
<br />
===Flash rootFS===<br />
You can download the latest rootFS from the Gitlab SailfishOS Porters CI: https://gitlab.com/sailfishos-porters-ci/dont_be_evil-ci (see the artifacts of the latest CI job).<br />
<br />
This <code>tar.gz</code> archive should be burned to the <code>data</code> partition of the SD card.<br />
It's important to burn it as the root user (not with sudo) to preserve extended attributes and ACLs: <br />
<br />
sudo su<br />
bsdtar -xpf <SAILFISH OS ROOTFS>.tar.bz2 -C <MOUNTPOINT OF /DATA><br />
<br />
===Device repos===<br />
To boot Lipstick, you need to add the device specific repos to the devkit.<br />
All the following commands are executed in a shell on the devkit.<br />
<br />
''Make sure you configure the ethernet interface first before you continue!''<br />
''You need to have access to the WWW to fetch the necessary repository data and packages.''<br />
<br />
Install zypper manually:<br />
curl -o augeas-lib.rpm http://repo.merproject.org/obs/mer:/core/latest_armv7hl/armv7hl/augeas-libs-1.6.0+git1-1.10.6.armv7hl.rpm<br />
curl -o zypper.rpm http://repo.merproject.org/obs/mer:/core/latest_armv7hl/armv7hl/zypper-1.14.6+git3-1.24.5.armv7hl.rpm<br />
rpm -Uvh *rpm<br />
<br />
Use <code>ssu</code> to add the repo<br />
ssu ar common http://repo.merproject.org/obs/nemo:/devel:/hw:/common/sailfish_latest_armv7hl/<br />
ssu ar dontbeevil http://repo.merproject.org/obs/home:/piggz:/dontbeevil/sailfishos_3.0.3.9_latest_armv7hl/<br />
<br />
Refresh the repo:<br />
zypper refresh<br />
<br />
Install the device packages:<br />
zypper install dontbeevil:qt5-qtcore dontbeevil:qt5-qttest dontbeevil:lipstick-qt5<br />
zypper in droid-config-dontbeevil # Select 1 for vendor change<br />
<br />
===Unknown password===<br />
The Sailfish OS rootFS sets a random password when booting for the first time.<br />
You can only log in through the <code>telnet</code> debug interface.<br />
Since the <code>eth0</code> interface still requires manually setup, you can't access <code>telnet</code>.<br />
<br />
To circumvent this issue, you can login through the UART TTY interface. <br />
However you don't know the password of the <code>root</code> nor <code>nemo</code> users!<br />
To disable the <code>root</code> and <code>nemo</code> passwords, we can modify the <code>/etc/shadow</code> file:<br />
<br />
sudo chmod +w <SD card data partition>/etc/shadow<br />
sudo vim <SD card data partition>/etc/shadow # Remove any characters where <HASHED PASSWORD> is written: user1:<HASHED PASSWORD>:16092:0:99999:7:::.<br />
sudo chmod -w <SD card data partition>/etc/shadow<br />
<br />
By removing the hashed password, we can login with the user without entering a password.<br />
You can set a new password afterwards by running as a logged in user:<br />
<br />
passwd<br />
<br />
===Init eth0===<br />
Enabling the <code>eth0</code> interface has to be done manually for now:<br />
<br />
ifconfig eth0 <YOUR_IP><br />
route add default gw <DEFAULT_GATEWAY_IP><br />
echo "nameserver <DNS_SERVER_IP>" > /etc/resolv.conf<br />
<br />
Test your configuration with <code>ping</code>:<br />
<br />
ping jolla.com</div>Dylanvanasschttps://wiki.merproject.org/wiki/Adaptations/PinePhone64Adaptations/PinePhone642019-05-30T16:02:48Z<p>Dylanvanassc: /* Device repos */</p>
<hr />
<div>=Hardware Support=<br />
<br />
Full information of hardware spec [https://wiki.pine64.org/index.php/Project_Don't_be_evil Here]<br />
<br />
==Testing the vibrator motor==<br />
<br />
You need to have the <code>CONFIG_GPIO_SYSFS</code> enabled in your kernel config for this!<br />
<br />
Vibrator motor is on pin <code>PD2</code>.<br />
You can calculate the PIN number for PD2 as followed ([https://linux-sunxi.org/GPIO more information]):<br />
<code>(4-1) * 32 + 2 = 98</code><br />
<br />
echo "98" > /sys/class/gpio/export # Make pin available<br />
echo "out" > /sys/class/gpio/gpio98/direction # Set as output<br />
echo "1" > /sys/class/gpio/gpio98/value # On<br />
echo "1" > /sys/class/gpio/gpio98/value # Off<br />
echo "98" > /sys/class/gpio/unexport # When you're done<br />
<br />
=Installation=<br />
==Prepare SD card==<br />
<br />
Use GParted or any other tool to create the following <code>EXT4</code> partitions:<br />
<br />
# <b>boot</b>: Holds the mainline kernel Image and Device Tree files<br />
# <b>data</b>: Holds the Sailfish OS rootFS<br />
<br />
GParted will ask you to leave the first MB free of the SD card when creating the first partition, this is correct.<br />
This 1 MB will be used to store the U-boot boot loader.<br />
<br />
==U-Boot==<br />
<br />
We will now build the mainline U-boot boot loader from Git.<br />
<br />
=== Clone U-boot (master branch): ===<br />
<br />
You can find the U-boot mirror repository on Github:<br />
<br />
git clone github.com/u-boot/u-boot<br />
<br />
=== Compile U-boot ===<br />
<br />
You have to cross compile U-boot with the <code>arm64</code> arch:<br />
<br />
export CROSS_COMPILE=aarch64-linux-gnu-<br />
ARCH=arm64 make clean<br />
ARCH=arm64 make sopine_baseboard_defconfig<br />
ARCH=arm64 make<br />
<br />
The <code>sopine_baseboard_defconfig</code> is the same for the Don't Be Evil devkit.<br />
<br />
=== Burn U-boot to your SD card ===<br />
<br />
Copy the compiled U-boot bootloader to the first sector on your SD card:<br />
<br />
sudo dd if=u-boot-sunxi-with-spl.bin of=/dev/sdX bs=8k seek=1<br />
<br />
<br />
=== Manually loading the kernel ===<br />
<br />
Serial TTY Baudrate over UART = 115200 for screen, example: <code>screen /dev/ttyUSB0 115200</code><br />
You have to start screen first, before turning on the devkit.<br />
<br />
Interrupt the U-boot autoboot process when you see a message in the U-boot prompt. <br />
We need to access the U-boot prompt to load the Kernel image and boot it manually!<br />
<br />
Set bootargs:<br />
<br />
setenv bootargs root=/dev/mmcblk0p2 rootwait panic=10<br />
<br />
Kernel Image loading and Device Tree files:<br />
<br />
ext4load mmc 0:1 ${kernel_addr_r} /Image <br />
ext4load mmc 0:1 ${fdt_addr_r} /sun50i-a64-dontbeevil.dtb <br />
<br />
Boot the kernel:<br />
<br />
booti ${kernel_addr_r} - ${fdt_addr_r}<br />
<br />
=== Automatic boot ===<br />
<br />
Create a <code>boot.cmd</code> file:<br />
<br />
echo Setting bootargs<br />
setenv bootargs console=tty0 console=ttyS0,115200 root=/dev/mmcblk0p2 no_console_suspend rootwait <br />
earlycon=uart,mmio32,0x01c28000 panic=10 consoleblank=0 loglevel=1<br />
printenv<br />
echo Loading DTB<br />
load mmc 0:1 ${fdt_addr_r} /sun50i-a64-dontbeevil.dtb<br />
echo Loading kernel Image<br />
load mmc 0:1 ${kernel_addr_r} /Image<br />
echo Booting kernel NOW<br />
booti ${kernel_addr_r} - ${fdt_addr_r}<br />
<br />
Mount your <code>boot</code> partition and run the following command:<br />
sudo mkimage -C none -A arm -T script -d /mnt/boot.cmd /mnt/boot.scr<br />
<br />
This will translate the <code>boot.cmd</code> file into a U-boot script.<br />
<br />
==Kernel==<br />
<br />
The PinePhone runs a mainline kernel, device tree modifications are done by all the PinePhone OS developers on Gitlab (https://gitlab.com/pine64-org/linux).<br />
<br />
=== Clone the kernel ===<br />
<br />
git clone https://gitlab.com/pine64-org/linux<br />
cd linux<br />
git checkout pinephone-dontbeevil<br />
<br />
=== Configure the kernel ===<br />
<br />
# <b>Copy our kernel config</b>: https://gitlab.com/pinephone-sailfish-os/linux-kernel/raw/master/pinephone-config<br />
# <b>Enter the <code>linux</code> project</b>: <code>cd linux</code><br />
# <b>Copy the config file</b> to <code>.config</code> in the main directory<br />
<br />
=== Build the kernel ===<br />
<br />
We cross compile the kernel for ARM64.<br />
The <code>LOCALVERSION</code> variable can be used to add a version to the build.<br />
<br />
Cross compile the kernel:<br />
export ARCH=arm64<br />
export CROSS_COMPILE=aarch64-linux-gnu-<br />
export LOCALVERSION=-nemo<br />
make clean<br />
make oldconfig<br />
make Image modules dtbs<br />
<br />
Install the kernel modules in a different path: <br />
make modules_install INSTALL_MOD_PATH=../linux_modules/<br />
<br />
=== Install kernel ===<br />
<br />
Copy the following things:<br />
<br />
# <b>Image</b> from <code>arch/arm64/boot/Image</code> to the root of the <code>boot</code> partition.<br />
# <b>Device tree files</b> from <code>arch/arm64/boot/dts/allwinner/sun50i-a64-dontbeevil.dtb</code> and <code>arch/arm64/boot/dts/allwinner/sun50i-a64-dontbeevil.dts</code> to the root of the <code>boot</code> partition.<br />
# <b>Modules</b> from <code>../linux_modules</code> to <code>/lib/modules</code> on the <code>boot</code> partition.<br />
<br />
==Nemo Mobile==<br />
<br />
==Sailfish OS==<br />
<br />
===Flash rootFS===<br />
You can download the latest rootFS from the Gitlab SailfishOS Porters CI: https://gitlab.com/sailfishos-porters-ci/dont_be_evil-ci (see the artifacts of the latest CI job).<br />
<br />
This <code>tar.gz</code> archive should be burned to the <code>data</code> partition of the SD card.<br />
It's important to burn it as the root user (not with sudo) to preserve extended attributes and ACLs: <br />
<br />
sudo su<br />
bsdtar -xpf <SAILFISH OS ROOTFS>.tar.bz2 -C <MOUNTPOINT OF /DATA><br />
<br />
===Device repos===<br />
To boot Lipstick, you need to add the device specific repos to the devkit.<br />
All the following commands are executed in a shell on the devkit.<br />
<br />
''Make sure you configure the ethernet interface first before you continue!''<br />
''You need to have access to the WWW to fetch the necessary repository data and packages.''<br />
<br />
Install zypper manually:<br />
curl -o augeas-lib.rpm http://repo.merproject.org/obs/mer:/core/latest_armv7hl/armv7hl/augeas-libs-1.6.0+git1-1.10.6.armv7hl.rpm<br />
curl -o zypper.rpm http://repo.merproject.org/obs/mer:/core/latest_armv7hl/armv7hl/zypper-1.14.6+git3-1.24.5.armv7hl.rpm<br />
rpm -Uvh *rpm<br />
<br />
Use <code>ssu</code> to add the repo<br />
ssu ar common http://repo.merproject.org/obs/nemo:/devel:/hw:/common/sailfish_latest_armv7hl/<br />
ssu ar dontbeevil http://repo.merproject.org/obs/home:/piggz:/dontbeevil/sailfishos_3.0.3.9_latest_armv7hl/<br />
<br />
Refresh the repo:<br />
zypper refresh<br />
<br />
Install the device packages:<br />
zypper install dontbeevil:qt5-qtcore dontbeevil:qt5-qttest dontbeevil:lipstick-qt5<br />
<br />
===Unknown password===<br />
The Sailfish OS rootFS sets a random password when booting for the first time.<br />
You can only log in through the <code>telnet</code> debug interface.<br />
Since the <code>eth0</code> interface still requires manually setup, you can't access <code>telnet</code>.<br />
<br />
To circumvent this issue, you can login through the UART TTY interface. <br />
However you don't know the password of the <code>root</code> nor <code>nemo</code> users!<br />
To disable the <code>root</code> and <code>nemo</code> passwords, we can modify the <code>/etc/shadow</code> file:<br />
<br />
sudo chmod +w <SD card data partition>/etc/shadow<br />
sudo vim <SD card data partition>/etc/shadow # Remove any characters where <HASHED PASSWORD> is written: user1:<HASHED PASSWORD>:16092:0:99999:7:::.<br />
sudo chmod -w <SD card data partition>/etc/shadow<br />
<br />
By removing the hashed password, we can login with the user without entering a password.<br />
You can set a new password afterwards by running as a logged in user:<br />
<br />
passwd<br />
<br />
===Init eth0===<br />
Enabling the <code>eth0</code> interface has to be done manually for now:<br />
<br />
ifconfig eth0 <YOUR_IP><br />
route add default gw <DEFAULT_GATEWAY_IP><br />
echo "nameserver <DNS_SERVER_IP>" > /etc/resolv.conf<br />
<br />
Test your configuration with <code>ping</code>:<br />
<br />
ping jolla.com</div>Dylanvanasschttps://wiki.merproject.org/wiki/Adaptations/PinePhone64Adaptations/PinePhone642019-05-30T16:02:18Z<p>Dylanvanassc: /* Device repos */</p>
<hr />
<div>=Hardware Support=<br />
<br />
Full information of hardware spec [https://wiki.pine64.org/index.php/Project_Don't_be_evil Here]<br />
<br />
==Testing the vibrator motor==<br />
<br />
You need to have the <code>CONFIG_GPIO_SYSFS</code> enabled in your kernel config for this!<br />
<br />
Vibrator motor is on pin <code>PD2</code>.<br />
You can calculate the PIN number for PD2 as followed ([https://linux-sunxi.org/GPIO more information]):<br />
<code>(4-1) * 32 + 2 = 98</code><br />
<br />
echo "98" > /sys/class/gpio/export # Make pin available<br />
echo "out" > /sys/class/gpio/gpio98/direction # Set as output<br />
echo "1" > /sys/class/gpio/gpio98/value # On<br />
echo "1" > /sys/class/gpio/gpio98/value # Off<br />
echo "98" > /sys/class/gpio/unexport # When you're done<br />
<br />
=Installation=<br />
==Prepare SD card==<br />
<br />
Use GParted or any other tool to create the following <code>EXT4</code> partitions:<br />
<br />
# <b>boot</b>: Holds the mainline kernel Image and Device Tree files<br />
# <b>data</b>: Holds the Sailfish OS rootFS<br />
<br />
GParted will ask you to leave the first MB free of the SD card when creating the first partition, this is correct.<br />
This 1 MB will be used to store the U-boot boot loader.<br />
<br />
==U-Boot==<br />
<br />
We will now build the mainline U-boot boot loader from Git.<br />
<br />
=== Clone U-boot (master branch): ===<br />
<br />
You can find the U-boot mirror repository on Github:<br />
<br />
git clone github.com/u-boot/u-boot<br />
<br />
=== Compile U-boot ===<br />
<br />
You have to cross compile U-boot with the <code>arm64</code> arch:<br />
<br />
export CROSS_COMPILE=aarch64-linux-gnu-<br />
ARCH=arm64 make clean<br />
ARCH=arm64 make sopine_baseboard_defconfig<br />
ARCH=arm64 make<br />
<br />
The <code>sopine_baseboard_defconfig</code> is the same for the Don't Be Evil devkit.<br />
<br />
=== Burn U-boot to your SD card ===<br />
<br />
Copy the compiled U-boot bootloader to the first sector on your SD card:<br />
<br />
sudo dd if=u-boot-sunxi-with-spl.bin of=/dev/sdX bs=8k seek=1<br />
<br />
<br />
=== Manually loading the kernel ===<br />
<br />
Serial TTY Baudrate over UART = 115200 for screen, example: <code>screen /dev/ttyUSB0 115200</code><br />
You have to start screen first, before turning on the devkit.<br />
<br />
Interrupt the U-boot autoboot process when you see a message in the U-boot prompt. <br />
We need to access the U-boot prompt to load the Kernel image and boot it manually!<br />
<br />
Set bootargs:<br />
<br />
setenv bootargs root=/dev/mmcblk0p2 rootwait panic=10<br />
<br />
Kernel Image loading and Device Tree files:<br />
<br />
ext4load mmc 0:1 ${kernel_addr_r} /Image <br />
ext4load mmc 0:1 ${fdt_addr_r} /sun50i-a64-dontbeevil.dtb <br />
<br />
Boot the kernel:<br />
<br />
booti ${kernel_addr_r} - ${fdt_addr_r}<br />
<br />
=== Automatic boot ===<br />
<br />
Create a <code>boot.cmd</code> file:<br />
<br />
echo Setting bootargs<br />
setenv bootargs console=tty0 console=ttyS0,115200 root=/dev/mmcblk0p2 no_console_suspend rootwait <br />
earlycon=uart,mmio32,0x01c28000 panic=10 consoleblank=0 loglevel=1<br />
printenv<br />
echo Loading DTB<br />
load mmc 0:1 ${fdt_addr_r} /sun50i-a64-dontbeevil.dtb<br />
echo Loading kernel Image<br />
load mmc 0:1 ${kernel_addr_r} /Image<br />
echo Booting kernel NOW<br />
booti ${kernel_addr_r} - ${fdt_addr_r}<br />
<br />
Mount your <code>boot</code> partition and run the following command:<br />
sudo mkimage -C none -A arm -T script -d /mnt/boot.cmd /mnt/boot.scr<br />
<br />
This will translate the <code>boot.cmd</code> file into a U-boot script.<br />
<br />
==Kernel==<br />
<br />
The PinePhone runs a mainline kernel, device tree modifications are done by all the PinePhone OS developers on Gitlab (https://gitlab.com/pine64-org/linux).<br />
<br />
=== Clone the kernel ===<br />
<br />
git clone https://gitlab.com/pine64-org/linux<br />
cd linux<br />
git checkout pinephone-dontbeevil<br />
<br />
=== Configure the kernel ===<br />
<br />
# <b>Copy our kernel config</b>: https://gitlab.com/pinephone-sailfish-os/linux-kernel/raw/master/pinephone-config<br />
# <b>Enter the <code>linux</code> project</b>: <code>cd linux</code><br />
# <b>Copy the config file</b> to <code>.config</code> in the main directory<br />
<br />
=== Build the kernel ===<br />
<br />
We cross compile the kernel for ARM64.<br />
The <code>LOCALVERSION</code> variable can be used to add a version to the build.<br />
<br />
Cross compile the kernel:<br />
export ARCH=arm64<br />
export CROSS_COMPILE=aarch64-linux-gnu-<br />
export LOCALVERSION=-nemo<br />
make clean<br />
make oldconfig<br />
make Image modules dtbs<br />
<br />
Install the kernel modules in a different path: <br />
make modules_install INSTALL_MOD_PATH=../linux_modules/<br />
<br />
=== Install kernel ===<br />
<br />
Copy the following things:<br />
<br />
# <b>Image</b> from <code>arch/arm64/boot/Image</code> to the root of the <code>boot</code> partition.<br />
# <b>Device tree files</b> from <code>arch/arm64/boot/dts/allwinner/sun50i-a64-dontbeevil.dtb</code> and <code>arch/arm64/boot/dts/allwinner/sun50i-a64-dontbeevil.dts</code> to the root of the <code>boot</code> partition.<br />
# <b>Modules</b> from <code>../linux_modules</code> to <code>/lib/modules</code> on the <code>boot</code> partition.<br />
<br />
==Nemo Mobile==<br />
<br />
==Sailfish OS==<br />
<br />
===Flash rootFS===<br />
You can download the latest rootFS from the Gitlab SailfishOS Porters CI: https://gitlab.com/sailfishos-porters-ci/dont_be_evil-ci (see the artifacts of the latest CI job).<br />
<br />
This <code>tar.gz</code> archive should be burned to the <code>data</code> partition of the SD card.<br />
It's important to burn it as the root user (not with sudo) to preserve extended attributes and ACLs: <br />
<br />
sudo su<br />
bsdtar -xpf <SAILFISH OS ROOTFS>.tar.bz2 -C <MOUNTPOINT OF /DATA><br />
<br />
===Device repos===<br />
To boot Lipstick, you need to add the device specific repos to the devkit.<br />
All the following commands are executed in a shell on the devkit.<br />
<br />
''Make sure you configure the ethernet interface first before you continue!''<br />
''You need to have access to the WWW to fetch the necessary repository data and packages.''<br />
<br />
Install zypper manually:<br />
curl -o augeas-lib.rpm http://repo.merproject.org/obs/mer:/core/latest_armv7hl/armv7hl/augeas-libs-1.6.0+git1-1.10.6.armv7hl.rpm<br />
curl -o zypper.rpm http://repo.merproject.org/obs/mer:/core/latest_armv7hl/armv7hl/zypper-1.14.6+git3-1.24.5.armv7hl.rpm<br />
rpm -Uvh *rpm<br />
<br />
Use <code>ssu</code> to add the repo<br />
ssu ar common http://repo.merproject.org/obs/nemo:/devel:/hw:/common/sailfish_latest_armv7hl/<br />
ssu ar dontbeevil http://repo.merproject.org/obs/home:/piggz:/dontbeevil/sailfishos_3.0.3.9_latest_armv7hl/<br />
<br />
Refresh the repo:<br />
zypper refresh<br />
<br />
Install the device packages:<br />
zypper install dontbeevil:qt5-core dontbeevil:qt5-qttest dontbeevil:lipstick-qt5<br />
<br />
===Unknown password===<br />
The Sailfish OS rootFS sets a random password when booting for the first time.<br />
You can only log in through the <code>telnet</code> debug interface.<br />
Since the <code>eth0</code> interface still requires manually setup, you can't access <code>telnet</code>.<br />
<br />
To circumvent this issue, you can login through the UART TTY interface. <br />
However you don't know the password of the <code>root</code> nor <code>nemo</code> users!<br />
To disable the <code>root</code> and <code>nemo</code> passwords, we can modify the <code>/etc/shadow</code> file:<br />
<br />
sudo chmod +w <SD card data partition>/etc/shadow<br />
sudo vim <SD card data partition>/etc/shadow # Remove any characters where <HASHED PASSWORD> is written: user1:<HASHED PASSWORD>:16092:0:99999:7:::.<br />
sudo chmod -w <SD card data partition>/etc/shadow<br />
<br />
By removing the hashed password, we can login with the user without entering a password.<br />
You can set a new password afterwards by running as a logged in user:<br />
<br />
passwd<br />
<br />
===Init eth0===<br />
Enabling the <code>eth0</code> interface has to be done manually for now:<br />
<br />
ifconfig eth0 <YOUR_IP><br />
route add default gw <DEFAULT_GATEWAY_IP><br />
echo "nameserver <DNS_SERVER_IP>" > /etc/resolv.conf<br />
<br />
Test your configuration with <code>ping</code>:<br />
<br />
ping jolla.com</div>Dylanvanasschttps://wiki.merproject.org/wiki/Adaptations/PinePhone64Adaptations/PinePhone642019-05-30T16:01:52Z<p>Dylanvanassc: /* Device repos */</p>
<hr />
<div>=Hardware Support=<br />
<br />
Full information of hardware spec [https://wiki.pine64.org/index.php/Project_Don't_be_evil Here]<br />
<br />
==Testing the vibrator motor==<br />
<br />
You need to have the <code>CONFIG_GPIO_SYSFS</code> enabled in your kernel config for this!<br />
<br />
Vibrator motor is on pin <code>PD2</code>.<br />
You can calculate the PIN number for PD2 as followed ([https://linux-sunxi.org/GPIO more information]):<br />
<code>(4-1) * 32 + 2 = 98</code><br />
<br />
echo "98" > /sys/class/gpio/export # Make pin available<br />
echo "out" > /sys/class/gpio/gpio98/direction # Set as output<br />
echo "1" > /sys/class/gpio/gpio98/value # On<br />
echo "1" > /sys/class/gpio/gpio98/value # Off<br />
echo "98" > /sys/class/gpio/unexport # When you're done<br />
<br />
=Installation=<br />
==Prepare SD card==<br />
<br />
Use GParted or any other tool to create the following <code>EXT4</code> partitions:<br />
<br />
# <b>boot</b>: Holds the mainline kernel Image and Device Tree files<br />
# <b>data</b>: Holds the Sailfish OS rootFS<br />
<br />
GParted will ask you to leave the first MB free of the SD card when creating the first partition, this is correct.<br />
This 1 MB will be used to store the U-boot boot loader.<br />
<br />
==U-Boot==<br />
<br />
We will now build the mainline U-boot boot loader from Git.<br />
<br />
=== Clone U-boot (master branch): ===<br />
<br />
You can find the U-boot mirror repository on Github:<br />
<br />
git clone github.com/u-boot/u-boot<br />
<br />
=== Compile U-boot ===<br />
<br />
You have to cross compile U-boot with the <code>arm64</code> arch:<br />
<br />
export CROSS_COMPILE=aarch64-linux-gnu-<br />
ARCH=arm64 make clean<br />
ARCH=arm64 make sopine_baseboard_defconfig<br />
ARCH=arm64 make<br />
<br />
The <code>sopine_baseboard_defconfig</code> is the same for the Don't Be Evil devkit.<br />
<br />
=== Burn U-boot to your SD card ===<br />
<br />
Copy the compiled U-boot bootloader to the first sector on your SD card:<br />
<br />
sudo dd if=u-boot-sunxi-with-spl.bin of=/dev/sdX bs=8k seek=1<br />
<br />
<br />
=== Manually loading the kernel ===<br />
<br />
Serial TTY Baudrate over UART = 115200 for screen, example: <code>screen /dev/ttyUSB0 115200</code><br />
You have to start screen first, before turning on the devkit.<br />
<br />
Interrupt the U-boot autoboot process when you see a message in the U-boot prompt. <br />
We need to access the U-boot prompt to load the Kernel image and boot it manually!<br />
<br />
Set bootargs:<br />
<br />
setenv bootargs root=/dev/mmcblk0p2 rootwait panic=10<br />
<br />
Kernel Image loading and Device Tree files:<br />
<br />
ext4load mmc 0:1 ${kernel_addr_r} /Image <br />
ext4load mmc 0:1 ${fdt_addr_r} /sun50i-a64-dontbeevil.dtb <br />
<br />
Boot the kernel:<br />
<br />
booti ${kernel_addr_r} - ${fdt_addr_r}<br />
<br />
=== Automatic boot ===<br />
<br />
Create a <code>boot.cmd</code> file:<br />
<br />
echo Setting bootargs<br />
setenv bootargs console=tty0 console=ttyS0,115200 root=/dev/mmcblk0p2 no_console_suspend rootwait <br />
earlycon=uart,mmio32,0x01c28000 panic=10 consoleblank=0 loglevel=1<br />
printenv<br />
echo Loading DTB<br />
load mmc 0:1 ${fdt_addr_r} /sun50i-a64-dontbeevil.dtb<br />
echo Loading kernel Image<br />
load mmc 0:1 ${kernel_addr_r} /Image<br />
echo Booting kernel NOW<br />
booti ${kernel_addr_r} - ${fdt_addr_r}<br />
<br />
Mount your <code>boot</code> partition and run the following command:<br />
sudo mkimage -C none -A arm -T script -d /mnt/boot.cmd /mnt/boot.scr<br />
<br />
This will translate the <code>boot.cmd</code> file into a U-boot script.<br />
<br />
==Kernel==<br />
<br />
The PinePhone runs a mainline kernel, device tree modifications are done by all the PinePhone OS developers on Gitlab (https://gitlab.com/pine64-org/linux).<br />
<br />
=== Clone the kernel ===<br />
<br />
git clone https://gitlab.com/pine64-org/linux<br />
cd linux<br />
git checkout pinephone-dontbeevil<br />
<br />
=== Configure the kernel ===<br />
<br />
# <b>Copy our kernel config</b>: https://gitlab.com/pinephone-sailfish-os/linux-kernel/raw/master/pinephone-config<br />
# <b>Enter the <code>linux</code> project</b>: <code>cd linux</code><br />
# <b>Copy the config file</b> to <code>.config</code> in the main directory<br />
<br />
=== Build the kernel ===<br />
<br />
We cross compile the kernel for ARM64.<br />
The <code>LOCALVERSION</code> variable can be used to add a version to the build.<br />
<br />
Cross compile the kernel:<br />
export ARCH=arm64<br />
export CROSS_COMPILE=aarch64-linux-gnu-<br />
export LOCALVERSION=-nemo<br />
make clean<br />
make oldconfig<br />
make Image modules dtbs<br />
<br />
Install the kernel modules in a different path: <br />
make modules_install INSTALL_MOD_PATH=../linux_modules/<br />
<br />
=== Install kernel ===<br />
<br />
Copy the following things:<br />
<br />
# <b>Image</b> from <code>arch/arm64/boot/Image</code> to the root of the <code>boot</code> partition.<br />
# <b>Device tree files</b> from <code>arch/arm64/boot/dts/allwinner/sun50i-a64-dontbeevil.dtb</code> and <code>arch/arm64/boot/dts/allwinner/sun50i-a64-dontbeevil.dts</code> to the root of the <code>boot</code> partition.<br />
# <b>Modules</b> from <code>../linux_modules</code> to <code>/lib/modules</code> on the <code>boot</code> partition.<br />
<br />
==Nemo Mobile==<br />
<br />
==Sailfish OS==<br />
<br />
===Flash rootFS===<br />
You can download the latest rootFS from the Gitlab SailfishOS Porters CI: https://gitlab.com/sailfishos-porters-ci/dont_be_evil-ci (see the artifacts of the latest CI job).<br />
<br />
This <code>tar.gz</code> archive should be burned to the <code>data</code> partition of the SD card.<br />
It's important to burn it as the root user (not with sudo) to preserve extended attributes and ACLs: <br />
<br />
sudo su<br />
bsdtar -xpf <SAILFISH OS ROOTFS>.tar.bz2 -C <MOUNTPOINT OF /DATA><br />
<br />
===Device repos===<br />
To boot Lipstick, you need to add the device specific repos to the devkit.<br />
All the following commands are executed in a shell on the devkit.<br />
<br />
''Make sure you configure the ethernet interface first before you continue!''<br />
''You need to have access to the WWW to fetch the necessary repository data and packages.''<br />
<br />
Install zypper manually:<br />
curl -o augeas-lib.rpm http://repo.merproject.org/obs/mer:/core/latest_armv7hl/armv7hl/augeas-libs-1.6.0+git1-1.10.6.armv7hl.rpm<br />
curl -o zypper.rpm http://repo.merproject.org/obs/mer:/core/latest_armv7hl/armv7hl/zypper-1.14.6+git3-1.24.5.armv7hl.rpm<br />
rpm -Uvh *rpm<br />
<br />
Use <code>ssu</code> to add the repo<br />
ssu ar common http://repo.merproject.org/obs/nemo:/devel:/hw:/common/sailfish_latest_armv7hl/<br />
ssu ar dontbeevil http://repo.merproject.org/obs/home:/piggz:/dontbeevil/sailfishos_3.0.3.9_latest_armv7hl/<br />
<br />
Refresh the repo:<br />
zypper refresh<br />
<br />
Install the device packages:<br />
zypper install qt5-core qt5-qttest lipstick-qt5<br />
<br />
===Unknown password===<br />
The Sailfish OS rootFS sets a random password when booting for the first time.<br />
You can only log in through the <code>telnet</code> debug interface.<br />
Since the <code>eth0</code> interface still requires manually setup, you can't access <code>telnet</code>.<br />
<br />
To circumvent this issue, you can login through the UART TTY interface. <br />
However you don't know the password of the <code>root</code> nor <code>nemo</code> users!<br />
To disable the <code>root</code> and <code>nemo</code> passwords, we can modify the <code>/etc/shadow</code> file:<br />
<br />
sudo chmod +w <SD card data partition>/etc/shadow<br />
sudo vim <SD card data partition>/etc/shadow # Remove any characters where <HASHED PASSWORD> is written: user1:<HASHED PASSWORD>:16092:0:99999:7:::.<br />
sudo chmod -w <SD card data partition>/etc/shadow<br />
<br />
By removing the hashed password, we can login with the user without entering a password.<br />
You can set a new password afterwards by running as a logged in user:<br />
<br />
passwd<br />
<br />
===Init eth0===<br />
Enabling the <code>eth0</code> interface has to be done manually for now:<br />
<br />
ifconfig eth0 <YOUR_IP><br />
route add default gw <DEFAULT_GATEWAY_IP><br />
echo "nameserver <DNS_SERVER_IP>" > /etc/resolv.conf<br />
<br />
Test your configuration with <code>ping</code>:<br />
<br />
ping jolla.com</div>Dylanvanasschttps://wiki.merproject.org/wiki/Adaptations/PinePhone64Adaptations/PinePhone642019-05-30T15:58:26Z<p>Dylanvanassc: /* Device repos */</p>
<hr />
<div>=Hardware Support=<br />
<br />
Full information of hardware spec [https://wiki.pine64.org/index.php/Project_Don't_be_evil Here]<br />
<br />
==Testing the vibrator motor==<br />
<br />
You need to have the <code>CONFIG_GPIO_SYSFS</code> enabled in your kernel config for this!<br />
<br />
Vibrator motor is on pin <code>PD2</code>.<br />
You can calculate the PIN number for PD2 as followed ([https://linux-sunxi.org/GPIO more information]):<br />
<code>(4-1) * 32 + 2 = 98</code><br />
<br />
echo "98" > /sys/class/gpio/export # Make pin available<br />
echo "out" > /sys/class/gpio/gpio98/direction # Set as output<br />
echo "1" > /sys/class/gpio/gpio98/value # On<br />
echo "1" > /sys/class/gpio/gpio98/value # Off<br />
echo "98" > /sys/class/gpio/unexport # When you're done<br />
<br />
=Installation=<br />
==Prepare SD card==<br />
<br />
Use GParted or any other tool to create the following <code>EXT4</code> partitions:<br />
<br />
# <b>boot</b>: Holds the mainline kernel Image and Device Tree files<br />
# <b>data</b>: Holds the Sailfish OS rootFS<br />
<br />
GParted will ask you to leave the first MB free of the SD card when creating the first partition, this is correct.<br />
This 1 MB will be used to store the U-boot boot loader.<br />
<br />
==U-Boot==<br />
<br />
We will now build the mainline U-boot boot loader from Git.<br />
<br />
=== Clone U-boot (master branch): ===<br />
<br />
You can find the U-boot mirror repository on Github:<br />
<br />
git clone github.com/u-boot/u-boot<br />
<br />
=== Compile U-boot ===<br />
<br />
You have to cross compile U-boot with the <code>arm64</code> arch:<br />
<br />
export CROSS_COMPILE=aarch64-linux-gnu-<br />
ARCH=arm64 make clean<br />
ARCH=arm64 make sopine_baseboard_defconfig<br />
ARCH=arm64 make<br />
<br />
The <code>sopine_baseboard_defconfig</code> is the same for the Don't Be Evil devkit.<br />
<br />
=== Burn U-boot to your SD card ===<br />
<br />
Copy the compiled U-boot bootloader to the first sector on your SD card:<br />
<br />
sudo dd if=u-boot-sunxi-with-spl.bin of=/dev/sdX bs=8k seek=1<br />
<br />
<br />
=== Manually loading the kernel ===<br />
<br />
Serial TTY Baudrate over UART = 115200 for screen, example: <code>screen /dev/ttyUSB0 115200</code><br />
You have to start screen first, before turning on the devkit.<br />
<br />
Interrupt the U-boot autoboot process when you see a message in the U-boot prompt. <br />
We need to access the U-boot prompt to load the Kernel image and boot it manually!<br />
<br />
Set bootargs:<br />
<br />
setenv bootargs root=/dev/mmcblk0p2 rootwait panic=10<br />
<br />
Kernel Image loading and Device Tree files:<br />
<br />
ext4load mmc 0:1 ${kernel_addr_r} /Image <br />
ext4load mmc 0:1 ${fdt_addr_r} /sun50i-a64-dontbeevil.dtb <br />
<br />
Boot the kernel:<br />
<br />
booti ${kernel_addr_r} - ${fdt_addr_r}<br />
<br />
=== Automatic boot ===<br />
<br />
Create a <code>boot.cmd</code> file:<br />
<br />
echo Setting bootargs<br />
setenv bootargs console=tty0 console=ttyS0,115200 root=/dev/mmcblk0p2 no_console_suspend rootwait <br />
earlycon=uart,mmio32,0x01c28000 panic=10 consoleblank=0 loglevel=1<br />
printenv<br />
echo Loading DTB<br />
load mmc 0:1 ${fdt_addr_r} /sun50i-a64-dontbeevil.dtb<br />
echo Loading kernel Image<br />
load mmc 0:1 ${kernel_addr_r} /Image<br />
echo Booting kernel NOW<br />
booti ${kernel_addr_r} - ${fdt_addr_r}<br />
<br />
Mount your <code>boot</code> partition and run the following command:<br />
sudo mkimage -C none -A arm -T script -d /mnt/boot.cmd /mnt/boot.scr<br />
<br />
This will translate the <code>boot.cmd</code> file into a U-boot script.<br />
<br />
==Kernel==<br />
<br />
The PinePhone runs a mainline kernel, device tree modifications are done by all the PinePhone OS developers on Gitlab (https://gitlab.com/pine64-org/linux).<br />
<br />
=== Clone the kernel ===<br />
<br />
git clone https://gitlab.com/pine64-org/linux<br />
cd linux<br />
git checkout pinephone-dontbeevil<br />
<br />
=== Configure the kernel ===<br />
<br />
# <b>Copy our kernel config</b>: https://gitlab.com/pinephone-sailfish-os/linux-kernel/raw/master/pinephone-config<br />
# <b>Enter the <code>linux</code> project</b>: <code>cd linux</code><br />
# <b>Copy the config file</b> to <code>.config</code> in the main directory<br />
<br />
=== Build the kernel ===<br />
<br />
We cross compile the kernel for ARM64.<br />
The <code>LOCALVERSION</code> variable can be used to add a version to the build.<br />
<br />
Cross compile the kernel:<br />
export ARCH=arm64<br />
export CROSS_COMPILE=aarch64-linux-gnu-<br />
export LOCALVERSION=-nemo<br />
make clean<br />
make oldconfig<br />
make Image modules dtbs<br />
<br />
Install the kernel modules in a different path: <br />
make modules_install INSTALL_MOD_PATH=../linux_modules/<br />
<br />
=== Install kernel ===<br />
<br />
Copy the following things:<br />
<br />
# <b>Image</b> from <code>arch/arm64/boot/Image</code> to the root of the <code>boot</code> partition.<br />
# <b>Device tree files</b> from <code>arch/arm64/boot/dts/allwinner/sun50i-a64-dontbeevil.dtb</code> and <code>arch/arm64/boot/dts/allwinner/sun50i-a64-dontbeevil.dts</code> to the root of the <code>boot</code> partition.<br />
# <b>Modules</b> from <code>../linux_modules</code> to <code>/lib/modules</code> on the <code>boot</code> partition.<br />
<br />
==Nemo Mobile==<br />
<br />
==Sailfish OS==<br />
<br />
===Flash rootFS===<br />
You can download the latest rootFS from the Gitlab SailfishOS Porters CI: https://gitlab.com/sailfishos-porters-ci/dont_be_evil-ci (see the artifacts of the latest CI job).<br />
<br />
This <code>tar.gz</code> archive should be burned to the <code>data</code> partition of the SD card.<br />
It's important to burn it as the root user (not with sudo) to preserve extended attributes and ACLs: <br />
<br />
sudo su<br />
bsdtar -xpf <SAILFISH OS ROOTFS>.tar.bz2 -C <MOUNTPOINT OF /DATA><br />
<br />
===Device repos===<br />
To boot Lipstick, you need to add the device specific repos to the devkit.<br />
All the following commands are executed in a shell on the devkit.<br />
<br />
''Make sure you configure the ethernet interface first before you continue!''<br />
''You need to have access to the WWW to fetch the necessary repository data and packages.''<br />
<br />
Install zypper manually:<br />
curl -o augeas-lib.rpm http://repo.merproject.org/obs/mer:/core/latest_armv7hl/armv7hl/augeas-libs-1.6.0+git1-1.10.6.armv7hl.rpm<br />
curl -o zypper.rpm http://repo.merproject.org/obs/mer:/core/latest_armv7hl/armv7hl/zypper-1.14.6+git3-1.24.5.armv7hl.rpm<br />
rpm -Uvh *rpm<br />
<br />
Use <code>ssu</code> to add the repo<br />
ssu ar common http://repo.merproject.org/obs/nemo:/devel:/hw:/common/sailfish_latest_armv7hl/<br />
ssu ar dontbeevil http://repo.merproject.org/obs/home:/piggz:/dontbeevil/sailfishos_3.0.3.9_latest_armv7hl/<br />
<br />
Refresh the repo:<br />
zypper refresh<br />
<br />
Install the device packages:<br />
zypper install <TO DO><br />
<br />
===Unknown password===<br />
The Sailfish OS rootFS sets a random password when booting for the first time.<br />
You can only log in through the <code>telnet</code> debug interface.<br />
Since the <code>eth0</code> interface still requires manually setup, you can't access <code>telnet</code>.<br />
<br />
To circumvent this issue, you can login through the UART TTY interface. <br />
However you don't know the password of the <code>root</code> nor <code>nemo</code> users!<br />
To disable the <code>root</code> and <code>nemo</code> passwords, we can modify the <code>/etc/shadow</code> file:<br />
<br />
sudo chmod +w <SD card data partition>/etc/shadow<br />
sudo vim <SD card data partition>/etc/shadow # Remove any characters where <HASHED PASSWORD> is written: user1:<HASHED PASSWORD>:16092:0:99999:7:::.<br />
sudo chmod -w <SD card data partition>/etc/shadow<br />
<br />
By removing the hashed password, we can login with the user without entering a password.<br />
You can set a new password afterwards by running as a logged in user:<br />
<br />
passwd<br />
<br />
===Init eth0===<br />
Enabling the <code>eth0</code> interface has to be done manually for now:<br />
<br />
ifconfig eth0 <YOUR_IP><br />
route add default gw <DEFAULT_GATEWAY_IP><br />
echo "nameserver <DNS_SERVER_IP>" > /etc/resolv.conf<br />
<br />
Test your configuration with <code>ping</code>:<br />
<br />
ping jolla.com</div>Dylanvanasschttps://wiki.merproject.org/wiki/Adaptations/PinePhone64Adaptations/PinePhone642019-05-30T15:48:11Z<p>Dylanvanassc: /* Device repos */</p>
<hr />
<div>=Hardware Support=<br />
<br />
Full information of hardware spec [https://wiki.pine64.org/index.php/Project_Don't_be_evil Here]<br />
<br />
==Testing the vibrator motor==<br />
<br />
You need to have the <code>CONFIG_GPIO_SYSFS</code> enabled in your kernel config for this!<br />
<br />
Vibrator motor is on pin <code>PD2</code>.<br />
You can calculate the PIN number for PD2 as followed ([https://linux-sunxi.org/GPIO more information]):<br />
<code>(4-1) * 32 + 2 = 98</code><br />
<br />
echo "98" > /sys/class/gpio/export # Make pin available<br />
echo "out" > /sys/class/gpio/gpio98/direction # Set as output<br />
echo "1" > /sys/class/gpio/gpio98/value # On<br />
echo "1" > /sys/class/gpio/gpio98/value # Off<br />
echo "98" > /sys/class/gpio/unexport # When you're done<br />
<br />
=Installation=<br />
==Prepare SD card==<br />
<br />
Use GParted or any other tool to create the following <code>EXT4</code> partitions:<br />
<br />
# <b>boot</b>: Holds the mainline kernel Image and Device Tree files<br />
# <b>data</b>: Holds the Sailfish OS rootFS<br />
<br />
GParted will ask you to leave the first MB free of the SD card when creating the first partition, this is correct.<br />
This 1 MB will be used to store the U-boot boot loader.<br />
<br />
==U-Boot==<br />
<br />
We will now build the mainline U-boot boot loader from Git.<br />
<br />
=== Clone U-boot (master branch): ===<br />
<br />
You can find the U-boot mirror repository on Github:<br />
<br />
git clone github.com/u-boot/u-boot<br />
<br />
=== Compile U-boot ===<br />
<br />
You have to cross compile U-boot with the <code>arm64</code> arch:<br />
<br />
export CROSS_COMPILE=aarch64-linux-gnu-<br />
ARCH=arm64 make clean<br />
ARCH=arm64 make sopine_baseboard_defconfig<br />
ARCH=arm64 make<br />
<br />
The <code>sopine_baseboard_defconfig</code> is the same for the Don't Be Evil devkit.<br />
<br />
=== Burn U-boot to your SD card ===<br />
<br />
Copy the compiled U-boot bootloader to the first sector on your SD card:<br />
<br />
sudo dd if=u-boot-sunxi-with-spl.bin of=/dev/sdX bs=8k seek=1<br />
<br />
<br />
=== Manually loading the kernel ===<br />
<br />
Serial TTY Baudrate over UART = 115200 for screen, example: <code>screen /dev/ttyUSB0 115200</code><br />
You have to start screen first, before turning on the devkit.<br />
<br />
Interrupt the U-boot autoboot process when you see a message in the U-boot prompt. <br />
We need to access the U-boot prompt to load the Kernel image and boot it manually!<br />
<br />
Set bootargs:<br />
<br />
setenv bootargs root=/dev/mmcblk0p2 rootwait panic=10<br />
<br />
Kernel Image loading and Device Tree files:<br />
<br />
ext4load mmc 0:1 ${kernel_addr_r} /Image <br />
ext4load mmc 0:1 ${fdt_addr_r} /sun50i-a64-dontbeevil.dtb <br />
<br />
Boot the kernel:<br />
<br />
booti ${kernel_addr_r} - ${fdt_addr_r}<br />
<br />
=== Automatic boot ===<br />
<br />
Create a <code>boot.cmd</code> file:<br />
<br />
echo Setting bootargs<br />
setenv bootargs console=tty0 console=ttyS0,115200 root=/dev/mmcblk0p2 no_console_suspend rootwait <br />
earlycon=uart,mmio32,0x01c28000 panic=10 consoleblank=0 loglevel=1<br />
printenv<br />
echo Loading DTB<br />
load mmc 0:1 ${fdt_addr_r} /sun50i-a64-dontbeevil.dtb<br />
echo Loading kernel Image<br />
load mmc 0:1 ${kernel_addr_r} /Image<br />
echo Booting kernel NOW<br />
booti ${kernel_addr_r} - ${fdt_addr_r}<br />
<br />
Mount your <code>boot</code> partition and run the following command:<br />
sudo mkimage -C none -A arm -T script -d /mnt/boot.cmd /mnt/boot.scr<br />
<br />
This will translate the <code>boot.cmd</code> file into a U-boot script.<br />
<br />
==Kernel==<br />
<br />
The PinePhone runs a mainline kernel, device tree modifications are done by all the PinePhone OS developers on Gitlab (https://gitlab.com/pine64-org/linux).<br />
<br />
=== Clone the kernel ===<br />
<br />
git clone https://gitlab.com/pine64-org/linux<br />
cd linux<br />
git checkout pinephone-dontbeevil<br />
<br />
=== Configure the kernel ===<br />
<br />
# <b>Copy our kernel config</b>: https://gitlab.com/pinephone-sailfish-os/linux-kernel/raw/master/pinephone-config<br />
# <b>Enter the <code>linux</code> project</b>: <code>cd linux</code><br />
# <b>Copy the config file</b> to <code>.config</code> in the main directory<br />
<br />
=== Build the kernel ===<br />
<br />
We cross compile the kernel for ARM64.<br />
The <code>LOCALVERSION</code> variable can be used to add a version to the build.<br />
<br />
Cross compile the kernel:<br />
export ARCH=arm64<br />
export CROSS_COMPILE=aarch64-linux-gnu-<br />
export LOCALVERSION=-nemo<br />
make clean<br />
make oldconfig<br />
make Image modules dtbs<br />
<br />
Install the kernel modules in a different path: <br />
make modules_install INSTALL_MOD_PATH=../linux_modules/<br />
<br />
=== Install kernel ===<br />
<br />
Copy the following things:<br />
<br />
# <b>Image</b> from <code>arch/arm64/boot/Image</code> to the root of the <code>boot</code> partition.<br />
# <b>Device tree files</b> from <code>arch/arm64/boot/dts/allwinner/sun50i-a64-dontbeevil.dtb</code> and <code>arch/arm64/boot/dts/allwinner/sun50i-a64-dontbeevil.dts</code> to the root of the <code>boot</code> partition.<br />
# <b>Modules</b> from <code>../linux_modules</code> to <code>/lib/modules</code> on the <code>boot</code> partition.<br />
<br />
==Nemo Mobile==<br />
<br />
==Sailfish OS==<br />
<br />
===Flash rootFS===<br />
You can download the latest rootFS from the Gitlab SailfishOS Porters CI: https://gitlab.com/sailfishos-porters-ci/dont_be_evil-ci (see the artifacts of the latest CI job).<br />
<br />
This <code>tar.gz</code> archive should be burned to the <code>data</code> partition of the SD card.<br />
It's important to burn it as the root user (not with sudo) to preserve extended attributes and ACLs: <br />
<br />
sudo su<br />
bsdtar -xpf <SAILFISH OS ROOTFS>.tar.bz2 -C <MOUNTPOINT OF /DATA><br />
<br />
===Device repos===<br />
To boot Lipstick, you need to add the device specific repos to the devkit.<br />
All the following commands are executed in a shell on the devkit.<br />
<br />
''Make sure you configure the ethernet interface first before you continue!''<br />
''You need to have access to the WWW to fetch the necessary repository data and packages.''<br />
<br />
Install zypper manually:<br />
curl -o augeas.rpm http://repo.merproject.org/obs/mer:/core/latest_armv7hl/armv7hl/augeas-1.6.0+git1-1.10.6.armv7hl.rpm<br />
curl -o zypper.rpm http://repo.merproject.org/obs/mer:/core/latest_armv7hl/armv7hl/zypper-1.14.6+git3-1.24.5.armv7hl.rpm<br />
rpm -Uvh *rpm<br />
<br />
Use <code>ssu</code> to add the repo<br />
ssu ar common http://repo.merproject.org/obs/nemo:/devel:/hw:/common/sailfish_latest_armv7hl/<br />
ssu ar dontbeevil http://repo.merproject.org/obs/home:/piggz:/dontbeevil/sailfishos_3.0.3.9_latest_armv7hl/<br />
<br />
Refresh the repo:<br />
zypper refresh<br />
<br />
Install the device packages:<br />
zypper install <TO DO><br />
<br />
===Unknown password===<br />
The Sailfish OS rootFS sets a random password when booting for the first time.<br />
You can only log in through the <code>telnet</code> debug interface.<br />
Since the <code>eth0</code> interface still requires manually setup, you can't access <code>telnet</code>.<br />
<br />
To circumvent this issue, you can login through the UART TTY interface. <br />
However you don't know the password of the <code>root</code> nor <code>nemo</code> users!<br />
To disable the <code>root</code> and <code>nemo</code> passwords, we can modify the <code>/etc/shadow</code> file:<br />
<br />
sudo chmod +w <SD card data partition>/etc/shadow<br />
sudo vim <SD card data partition>/etc/shadow # Remove any characters where <HASHED PASSWORD> is written: user1:<HASHED PASSWORD>:16092:0:99999:7:::.<br />
sudo chmod -w <SD card data partition>/etc/shadow<br />
<br />
By removing the hashed password, we can login with the user without entering a password.<br />
You can set a new password afterwards by running as a logged in user:<br />
<br />
passwd<br />
<br />
===Init eth0===<br />
Enabling the <code>eth0</code> interface has to be done manually for now:<br />
<br />
ifconfig eth0 <YOUR_IP><br />
route add default gw <DEFAULT_GATEWAY_IP><br />
echo "nameserver <DNS_SERVER_IP>" > /etc/resolv.conf<br />
<br />
Test your configuration with <code>ping</code>:<br />
<br />
ping jolla.com</div>Dylanvanasschttps://wiki.merproject.org/wiki/Adaptations/PinePhone64Adaptations/PinePhone642019-05-30T15:47:37Z<p>Dylanvanassc: /* Device repos */</p>
<hr />
<div>=Hardware Support=<br />
<br />
Full information of hardware spec [https://wiki.pine64.org/index.php/Project_Don't_be_evil Here]<br />
<br />
==Testing the vibrator motor==<br />
<br />
You need to have the <code>CONFIG_GPIO_SYSFS</code> enabled in your kernel config for this!<br />
<br />
Vibrator motor is on pin <code>PD2</code>.<br />
You can calculate the PIN number for PD2 as followed ([https://linux-sunxi.org/GPIO more information]):<br />
<code>(4-1) * 32 + 2 = 98</code><br />
<br />
echo "98" > /sys/class/gpio/export # Make pin available<br />
echo "out" > /sys/class/gpio/gpio98/direction # Set as output<br />
echo "1" > /sys/class/gpio/gpio98/value # On<br />
echo "1" > /sys/class/gpio/gpio98/value # Off<br />
echo "98" > /sys/class/gpio/unexport # When you're done<br />
<br />
=Installation=<br />
==Prepare SD card==<br />
<br />
Use GParted or any other tool to create the following <code>EXT4</code> partitions:<br />
<br />
# <b>boot</b>: Holds the mainline kernel Image and Device Tree files<br />
# <b>data</b>: Holds the Sailfish OS rootFS<br />
<br />
GParted will ask you to leave the first MB free of the SD card when creating the first partition, this is correct.<br />
This 1 MB will be used to store the U-boot boot loader.<br />
<br />
==U-Boot==<br />
<br />
We will now build the mainline U-boot boot loader from Git.<br />
<br />
=== Clone U-boot (master branch): ===<br />
<br />
You can find the U-boot mirror repository on Github:<br />
<br />
git clone github.com/u-boot/u-boot<br />
<br />
=== Compile U-boot ===<br />
<br />
You have to cross compile U-boot with the <code>arm64</code> arch:<br />
<br />
export CROSS_COMPILE=aarch64-linux-gnu-<br />
ARCH=arm64 make clean<br />
ARCH=arm64 make sopine_baseboard_defconfig<br />
ARCH=arm64 make<br />
<br />
The <code>sopine_baseboard_defconfig</code> is the same for the Don't Be Evil devkit.<br />
<br />
=== Burn U-boot to your SD card ===<br />
<br />
Copy the compiled U-boot bootloader to the first sector on your SD card:<br />
<br />
sudo dd if=u-boot-sunxi-with-spl.bin of=/dev/sdX bs=8k seek=1<br />
<br />
<br />
=== Manually loading the kernel ===<br />
<br />
Serial TTY Baudrate over UART = 115200 for screen, example: <code>screen /dev/ttyUSB0 115200</code><br />
You have to start screen first, before turning on the devkit.<br />
<br />
Interrupt the U-boot autoboot process when you see a message in the U-boot prompt. <br />
We need to access the U-boot prompt to load the Kernel image and boot it manually!<br />
<br />
Set bootargs:<br />
<br />
setenv bootargs root=/dev/mmcblk0p2 rootwait panic=10<br />
<br />
Kernel Image loading and Device Tree files:<br />
<br />
ext4load mmc 0:1 ${kernel_addr_r} /Image <br />
ext4load mmc 0:1 ${fdt_addr_r} /sun50i-a64-dontbeevil.dtb <br />
<br />
Boot the kernel:<br />
<br />
booti ${kernel_addr_r} - ${fdt_addr_r}<br />
<br />
=== Automatic boot ===<br />
<br />
Create a <code>boot.cmd</code> file:<br />
<br />
echo Setting bootargs<br />
setenv bootargs console=tty0 console=ttyS0,115200 root=/dev/mmcblk0p2 no_console_suspend rootwait <br />
earlycon=uart,mmio32,0x01c28000 panic=10 consoleblank=0 loglevel=1<br />
printenv<br />
echo Loading DTB<br />
load mmc 0:1 ${fdt_addr_r} /sun50i-a64-dontbeevil.dtb<br />
echo Loading kernel Image<br />
load mmc 0:1 ${kernel_addr_r} /Image<br />
echo Booting kernel NOW<br />
booti ${kernel_addr_r} - ${fdt_addr_r}<br />
<br />
Mount your <code>boot</code> partition and run the following command:<br />
sudo mkimage -C none -A arm -T script -d /mnt/boot.cmd /mnt/boot.scr<br />
<br />
This will translate the <code>boot.cmd</code> file into a U-boot script.<br />
<br />
==Kernel==<br />
<br />
The PinePhone runs a mainline kernel, device tree modifications are done by all the PinePhone OS developers on Gitlab (https://gitlab.com/pine64-org/linux).<br />
<br />
=== Clone the kernel ===<br />
<br />
git clone https://gitlab.com/pine64-org/linux<br />
cd linux<br />
git checkout pinephone-dontbeevil<br />
<br />
=== Configure the kernel ===<br />
<br />
# <b>Copy our kernel config</b>: https://gitlab.com/pinephone-sailfish-os/linux-kernel/raw/master/pinephone-config<br />
# <b>Enter the <code>linux</code> project</b>: <code>cd linux</code><br />
# <b>Copy the config file</b> to <code>.config</code> in the main directory<br />
<br />
=== Build the kernel ===<br />
<br />
We cross compile the kernel for ARM64.<br />
The <code>LOCALVERSION</code> variable can be used to add a version to the build.<br />
<br />
Cross compile the kernel:<br />
export ARCH=arm64<br />
export CROSS_COMPILE=aarch64-linux-gnu-<br />
export LOCALVERSION=-nemo<br />
make clean<br />
make oldconfig<br />
make Image modules dtbs<br />
<br />
Install the kernel modules in a different path: <br />
make modules_install INSTALL_MOD_PATH=../linux_modules/<br />
<br />
=== Install kernel ===<br />
<br />
Copy the following things:<br />
<br />
# <b>Image</b> from <code>arch/arm64/boot/Image</code> to the root of the <code>boot</code> partition.<br />
# <b>Device tree files</b> from <code>arch/arm64/boot/dts/allwinner/sun50i-a64-dontbeevil.dtb</code> and <code>arch/arm64/boot/dts/allwinner/sun50i-a64-dontbeevil.dts</code> to the root of the <code>boot</code> partition.<br />
# <b>Modules</b> from <code>../linux_modules</code> to <code>/lib/modules</code> on the <code>boot</code> partition.<br />
<br />
==Nemo Mobile==<br />
<br />
==Sailfish OS==<br />
<br />
===Flash rootFS===<br />
You can download the latest rootFS from the Gitlab SailfishOS Porters CI: https://gitlab.com/sailfishos-porters-ci/dont_be_evil-ci (see the artifacts of the latest CI job).<br />
<br />
This <code>tar.gz</code> archive should be burned to the <code>data</code> partition of the SD card.<br />
It's important to burn it as the root user (not with sudo) to preserve extended attributes and ACLs: <br />
<br />
sudo su<br />
bsdtar -xpf <SAILFISH OS ROOTFS>.tar.bz2 -C <MOUNTPOINT OF /DATA><br />
<br />
===Device repos===<br />
To boot Lipstick, you need to add the device specific repos to the devkit.<br />
<br />
''Make sure you configure the ethernet interface first before you continue!''<br />
''You need to have access to the WWW to fetch the necessary repository data and packages.''<br />
<br />
Install zypper manually:<br />
curl -o augeas.rpm http://repo.merproject.org/obs/mer:/core/latest_armv7hl/armv7hl/augeas-1.6.0+git1-1.10.6.armv7hl.rpm<br />
curl -o zypper.rpm http://repo.merproject.org/obs/mer:/core/latest_armv7hl/armv7hl/zypper-1.14.6+git3-1.24.5.armv7hl.rpm<br />
rpm -Uvh *rpm<br />
<br />
Use <code>ssu</code> to add the repo<br />
ssu ar common http://repo.merproject.org/obs/nemo:/devel:/hw:/common/sailfish_latest_armv7hl/<br />
ssu ar dontbeevil http://repo.merproject.org/obs/home:/piggz:/dontbeevil/sailfishos_3.0.3.9_latest_armv7hl/<br />
<br />
Refresh the repo:<br />
zypper refresh<br />
<br />
Install the device packages:<br />
zypper install <TO DO><br />
<br />
===Unknown password===<br />
The Sailfish OS rootFS sets a random password when booting for the first time.<br />
You can only log in through the <code>telnet</code> debug interface.<br />
Since the <code>eth0</code> interface still requires manually setup, you can't access <code>telnet</code>.<br />
<br />
To circumvent this issue, you can login through the UART TTY interface. <br />
However you don't know the password of the <code>root</code> nor <code>nemo</code> users!<br />
To disable the <code>root</code> and <code>nemo</code> passwords, we can modify the <code>/etc/shadow</code> file:<br />
<br />
sudo chmod +w <SD card data partition>/etc/shadow<br />
sudo vim <SD card data partition>/etc/shadow # Remove any characters where <HASHED PASSWORD> is written: user1:<HASHED PASSWORD>:16092:0:99999:7:::.<br />
sudo chmod -w <SD card data partition>/etc/shadow<br />
<br />
By removing the hashed password, we can login with the user without entering a password.<br />
You can set a new password afterwards by running as a logged in user:<br />
<br />
passwd<br />
<br />
===Init eth0===<br />
Enabling the <code>eth0</code> interface has to be done manually for now:<br />
<br />
ifconfig eth0 <YOUR_IP><br />
route add default gw <DEFAULT_GATEWAY_IP><br />
echo "nameserver <DNS_SERVER_IP>" > /etc/resolv.conf<br />
<br />
Test your configuration with <code>ping</code>:<br />
<br />
ping jolla.com</div>Dylanvanasschttps://wiki.merproject.org/wiki/Adaptations/PinePhone64Adaptations/PinePhone642019-05-30T15:40:11Z<p>Dylanvanassc: /* Sailfish OS */</p>
<hr />
<div>=Hardware Support=<br />
<br />
Full information of hardware spec [https://wiki.pine64.org/index.php/Project_Don't_be_evil Here]<br />
<br />
==Testing the vibrator motor==<br />
<br />
You need to have the <code>CONFIG_GPIO_SYSFS</code> enabled in your kernel config for this!<br />
<br />
Vibrator motor is on pin <code>PD2</code>.<br />
You can calculate the PIN number for PD2 as followed ([https://linux-sunxi.org/GPIO more information]):<br />
<code>(4-1) * 32 + 2 = 98</code><br />
<br />
echo "98" > /sys/class/gpio/export # Make pin available<br />
echo "out" > /sys/class/gpio/gpio98/direction # Set as output<br />
echo "1" > /sys/class/gpio/gpio98/value # On<br />
echo "1" > /sys/class/gpio/gpio98/value # Off<br />
echo "98" > /sys/class/gpio/unexport # When you're done<br />
<br />
=Installation=<br />
==Prepare SD card==<br />
<br />
Use GParted or any other tool to create the following <code>EXT4</code> partitions:<br />
<br />
# <b>boot</b>: Holds the mainline kernel Image and Device Tree files<br />
# <b>data</b>: Holds the Sailfish OS rootFS<br />
<br />
GParted will ask you to leave the first MB free of the SD card when creating the first partition, this is correct.<br />
This 1 MB will be used to store the U-boot boot loader.<br />
<br />
==U-Boot==<br />
<br />
We will now build the mainline U-boot boot loader from Git.<br />
<br />
=== Clone U-boot (master branch): ===<br />
<br />
You can find the U-boot mirror repository on Github:<br />
<br />
git clone github.com/u-boot/u-boot<br />
<br />
=== Compile U-boot ===<br />
<br />
You have to cross compile U-boot with the <code>arm64</code> arch:<br />
<br />
export CROSS_COMPILE=aarch64-linux-gnu-<br />
ARCH=arm64 make clean<br />
ARCH=arm64 make sopine_baseboard_defconfig<br />
ARCH=arm64 make<br />
<br />
The <code>sopine_baseboard_defconfig</code> is the same for the Don't Be Evil devkit.<br />
<br />
=== Burn U-boot to your SD card ===<br />
<br />
Copy the compiled U-boot bootloader to the first sector on your SD card:<br />
<br />
sudo dd if=u-boot-sunxi-with-spl.bin of=/dev/sdX bs=8k seek=1<br />
<br />
<br />
=== Manually loading the kernel ===<br />
<br />
Serial TTY Baudrate over UART = 115200 for screen, example: <code>screen /dev/ttyUSB0 115200</code><br />
You have to start screen first, before turning on the devkit.<br />
<br />
Interrupt the U-boot autoboot process when you see a message in the U-boot prompt. <br />
We need to access the U-boot prompt to load the Kernel image and boot it manually!<br />
<br />
Set bootargs:<br />
<br />
setenv bootargs root=/dev/mmcblk0p2 rootwait panic=10<br />
<br />
Kernel Image loading and Device Tree files:<br />
<br />
ext4load mmc 0:1 ${kernel_addr_r} /Image <br />
ext4load mmc 0:1 ${fdt_addr_r} /sun50i-a64-dontbeevil.dtb <br />
<br />
Boot the kernel:<br />
<br />
booti ${kernel_addr_r} - ${fdt_addr_r}<br />
<br />
=== Automatic boot ===<br />
<br />
Create a <code>boot.cmd</code> file:<br />
<br />
echo Setting bootargs<br />
setenv bootargs console=tty0 console=ttyS0,115200 root=/dev/mmcblk0p2 no_console_suspend rootwait <br />
earlycon=uart,mmio32,0x01c28000 panic=10 consoleblank=0 loglevel=1<br />
printenv<br />
echo Loading DTB<br />
load mmc 0:1 ${fdt_addr_r} /sun50i-a64-dontbeevil.dtb<br />
echo Loading kernel Image<br />
load mmc 0:1 ${kernel_addr_r} /Image<br />
echo Booting kernel NOW<br />
booti ${kernel_addr_r} - ${fdt_addr_r}<br />
<br />
Mount your <code>boot</code> partition and run the following command:<br />
sudo mkimage -C none -A arm -T script -d /mnt/boot.cmd /mnt/boot.scr<br />
<br />
This will translate the <code>boot.cmd</code> file into a U-boot script.<br />
<br />
==Kernel==<br />
<br />
The PinePhone runs a mainline kernel, device tree modifications are done by all the PinePhone OS developers on Gitlab (https://gitlab.com/pine64-org/linux).<br />
<br />
=== Clone the kernel ===<br />
<br />
git clone https://gitlab.com/pine64-org/linux<br />
cd linux<br />
git checkout pinephone-dontbeevil<br />
<br />
=== Configure the kernel ===<br />
<br />
# <b>Copy our kernel config</b>: https://gitlab.com/pinephone-sailfish-os/linux-kernel/raw/master/pinephone-config<br />
# <b>Enter the <code>linux</code> project</b>: <code>cd linux</code><br />
# <b>Copy the config file</b> to <code>.config</code> in the main directory<br />
<br />
=== Build the kernel ===<br />
<br />
We cross compile the kernel for ARM64.<br />
The <code>LOCALVERSION</code> variable can be used to add a version to the build.<br />
<br />
Cross compile the kernel:<br />
export ARCH=arm64<br />
export CROSS_COMPILE=aarch64-linux-gnu-<br />
export LOCALVERSION=-nemo<br />
make clean<br />
make oldconfig<br />
make Image modules dtbs<br />
<br />
Install the kernel modules in a different path: <br />
make modules_install INSTALL_MOD_PATH=../linux_modules/<br />
<br />
=== Install kernel ===<br />
<br />
Copy the following things:<br />
<br />
# <b>Image</b> from <code>arch/arm64/boot/Image</code> to the root of the <code>boot</code> partition.<br />
# <b>Device tree files</b> from <code>arch/arm64/boot/dts/allwinner/sun50i-a64-dontbeevil.dtb</code> and <code>arch/arm64/boot/dts/allwinner/sun50i-a64-dontbeevil.dts</code> to the root of the <code>boot</code> partition.<br />
# <b>Modules</b> from <code>../linux_modules</code> to <code>/lib/modules</code> on the <code>boot</code> partition.<br />
<br />
==Nemo Mobile==<br />
<br />
==Sailfish OS==<br />
<br />
===Flash rootFS===<br />
You can download the latest rootFS from the Gitlab SailfishOS Porters CI: https://gitlab.com/sailfishos-porters-ci/dont_be_evil-ci (see the artifacts of the latest CI job).<br />
<br />
This <code>tar.gz</code> archive should be burned to the <code>data</code> partition of the SD card.<br />
It's important to burn it as the root user (not with sudo) to preserve extended attributes and ACLs: <br />
<br />
sudo su<br />
bsdtar -xpf <SAILFISH OS ROOTFS>.tar.bz2 -C <MOUNTPOINT OF /DATA><br />
<br />
===Device repos===<br />
To boot Lipstick, you need to add the device specific repos to the devkit.<br />
<br />
''Make sure you configure the ethernet interface first before you continue!''<br />
''You need to have access to the WWW to fetch the necessary repository data and packages.''<br />
<br />
Use <code>ssu</code> to add the repo<br />
ssu ar common http://repo.merproject.org/obs/nemo:/devel:/hw:/common/sailfish_latest_armv7hl/<br />
ssu ar dontbeevil http://repo.merproject.org/obs/home:/piggz:/dontbeevil/sailfishos_3.0.3.9_latest_armv7hl/<br />
<br />
Refresh the repo:<br />
zypper refresh<br />
<br />
Install the device packages:<br />
zypper install <TO DO><br />
<br />
===Unknown password===<br />
The Sailfish OS rootFS sets a random password when booting for the first time.<br />
You can only log in through the <code>telnet</code> debug interface.<br />
Since the <code>eth0</code> interface still requires manually setup, you can't access <code>telnet</code>.<br />
<br />
To circumvent this issue, you can login through the UART TTY interface. <br />
However you don't know the password of the <code>root</code> nor <code>nemo</code> users!<br />
To disable the <code>root</code> and <code>nemo</code> passwords, we can modify the <code>/etc/shadow</code> file:<br />
<br />
sudo chmod +w <SD card data partition>/etc/shadow<br />
sudo vim <SD card data partition>/etc/shadow # Remove any characters where <HASHED PASSWORD> is written: user1:<HASHED PASSWORD>:16092:0:99999:7:::.<br />
sudo chmod -w <SD card data partition>/etc/shadow<br />
<br />
By removing the hashed password, we can login with the user without entering a password.<br />
You can set a new password afterwards by running as a logged in user:<br />
<br />
passwd<br />
<br />
===Init eth0===<br />
Enabling the <code>eth0</code> interface has to be done manually for now:<br />
<br />
ifconfig eth0 <YOUR_IP><br />
route add default gw <DEFAULT_GATEWAY_IP><br />
echo "nameserver <DNS_SERVER_IP>" > /etc/resolv.conf<br />
<br />
Test your configuration with <code>ping</code>:<br />
<br />
ping jolla.com</div>Dylanvanasschttps://wiki.merproject.org/wiki/Adaptations/PinePhone64Adaptations/PinePhone642019-05-22T08:34:01Z<p>Dylanvanassc: /* Testing the vibrator motor */</p>
<hr />
<div>=Hardware Support=<br />
<br />
Full information of hardware spec [https://wiki.pine64.org/index.php/Project_Don't_be_evil Here]<br />
<br />
==Testing the vibrator motor==<br />
<br />
You need to have the <code>CONFIG_GPIO_SYSFS</code> enabled in your kernel config for this!<br />
<br />
Vibrator motor is on pin <code>PD2</code>.<br />
You can calculate the PIN number for PD2 as followed ([https://linux-sunxi.org/GPIO more information]):<br />
<code>(4-1) * 32 + 2 = 98</code><br />
<br />
echo "98" > /sys/class/gpio/export # Make pin available<br />
echo "out" > /sys/class/gpio/gpio98/direction # Set as output<br />
echo "1" > /sys/class/gpio/gpio98/value # On<br />
echo "1" > /sys/class/gpio/gpio98/value # Off<br />
echo "98" > /sys/class/gpio/unexport # When you're done<br />
<br />
=Installation=<br />
==Prepare SD card==<br />
<br />
Use GParted or any other tool to create the following <code>EXT4</code> partitions:<br />
<br />
# <b>boot</b>: Holds the mainline kernel Image and Device Tree files<br />
# <b>data</b>: Holds the Sailfish OS rootFS<br />
<br />
GParted will ask you to leave the first MB free of the SD card when creating the first partition, this is correct.<br />
This 1 MB will be used to store the U-boot boot loader.<br />
<br />
==U-Boot==<br />
<br />
We will now build the mainline U-boot boot loader from Git.<br />
<br />
=== Clone U-boot (master branch): ===<br />
<br />
You can find the U-boot mirror repository on Github:<br />
<br />
git clone github.com/u-boot/u-boot<br />
<br />
=== Compile U-boot ===<br />
<br />
You have to cross compile U-boot with the <code>arm64</code> arch:<br />
<br />
export CROSS_COMPILE=aarch64-linux-gnu-<br />
ARCH=arm64 make clean<br />
ARCH=arm64 make sopine_baseboard_defconfig<br />
ARCH=arm64 make<br />
<br />
The <code>sopine_baseboard_defconfig</code> is the same for the Don't Be Evil devkit.<br />
<br />
=== Burn U-boot to your SD card ===<br />
<br />
Copy the compiled U-boot bootloader to the first sector on your SD card:<br />
<br />
sudo dd if=u-boot-sunxi-with-spl.bin of=/dev/sdX bs=8k seek=1<br />
<br />
<br />
=== Manually loading the kernel ===<br />
<br />
Serial TTY Baudrate over UART = 115200 for screen, example: <code>screen /dev/ttyUSB0 115200</code><br />
You have to start screen first, before turning on the devkit.<br />
<br />
Interrupt the U-boot autoboot process when you see a message in the U-boot prompt. <br />
We need to access the U-boot prompt to load the Kernel image and boot it manually!<br />
<br />
Set bootargs:<br />
<br />
setenv bootargs root=/dev/mmcblk0p2 rootwait panic=10<br />
<br />
Kernel Image loading and Device Tree files:<br />
<br />
ext4load mmc 0:1 ${kernel_addr_r} /Image <br />
ext4load mmc 0:1 ${fdt_addr_r} /sun50i-a64-dontbeevil.dtb <br />
<br />
Boot the kernel:<br />
<br />
booti ${kernel_addr_r} - ${fdt_addr_r}<br />
<br />
=== Automatic boot ===<br />
<br />
Create a <code>boot.cmd</code> file:<br />
<br />
echo Setting bootargs<br />
setenv bootargs console=tty0 console=ttyS0,115200 root=/dev/mmcblk0p2 no_console_suspend rootwait <br />
earlycon=uart,mmio32,0x01c28000 panic=10 consoleblank=0 loglevel=1<br />
printenv<br />
echo Loading DTB<br />
load mmc 0:1 ${fdt_addr_r} /sun50i-a64-dontbeevil.dtb<br />
echo Loading kernel Image<br />
load mmc 0:1 ${kernel_addr_r} /Image<br />
echo Booting kernel NOW<br />
booti ${kernel_addr_r} - ${fdt_addr_r}<br />
<br />
Mount your <code>boot</code> partition and run the following command:<br />
sudo mkimage -C none -A arm -T script -d /mnt/boot.cmd /mnt/boot.scr<br />
<br />
This will translate the <code>boot.cmd</code> file into a U-boot script.<br />
<br />
==Kernel==<br />
<br />
The PinePhone runs a mainline kernel, device tree modifications are done by all the PinePhone OS developers on Gitlab (https://gitlab.com/pine64-org/linux).<br />
<br />
=== Clone the kernel ===<br />
<br />
git clone https://gitlab.com/pine64-org/linux<br />
cd linux<br />
git checkout pinephone-dontbeevil<br />
<br />
=== Configure the kernel ===<br />
<br />
# <b>Copy our kernel config</b>: https://gitlab.com/pinephone-sailfish-os/linux-kernel/raw/master/pinephone-config<br />
# <b>Enter the <code>linux</code> project</b>: <code>cd linux</code><br />
# <b>Copy the config file</b> to <code>.config</code> in the main directory<br />
<br />
=== Build the kernel ===<br />
<br />
We cross compile the kernel for ARM64.<br />
The <code>LOCALVERSION</code> variable can be used to add a version to the build.<br />
<br />
Cross compile the kernel:<br />
export ARCH=arm64<br />
export CROSS_COMPILE=aarch64-linux-gnu-<br />
export LOCALVERSION=-nemo<br />
make clean<br />
make oldconfig<br />
make Image modules dtbs<br />
<br />
Install the kernel modules in a different path: <br />
make modules_install INSTALL_MOD_PATH=../linux_modules/<br />
<br />
=== Install kernel ===<br />
<br />
Copy the following things:<br />
<br />
# <b>Image</b> from <code>arch/arm64/boot/Image</code> to the root of the <code>boot</code> partition.<br />
# <b>Device tree files</b> from <code>arch/arm64/boot/dts/allwinner/sun50i-a64-dontbeevil.dtb</code> and <code>arch/arm64/boot/dts/allwinner/sun50i-a64-dontbeevil.dts</code> to the root of the <code>boot</code> partition.<br />
# <b>Modules</b> from <code>../linux_modules</code> to <code>/lib/modules</code> on the <code>boot</code> partition.<br />
<br />
==Nemo Mobile==<br />
<br />
==Sailfish OS==<br />
<br />
===Flash rootFS===<br />
You can download the latest rootFS from the Gitlab SailfishOS Porters CI: https://gitlab.com/sailfishos-porters-ci/dont_be_evil-ci (see the artifacts of the latest CI job).<br />
<br />
This <code>tar.gz</code> archive should be burned to the <code>data</code> partition of the SD card.<br />
It's important to burn it as the root user (not with sudo) to preserve extended attributes and ACLs: <br />
<br />
sudo su<br />
bsdtar -xpf <SAILFISH OS ROOTFS>.tar.bz2 -C <MOUNTPOINT OF /DATA><br />
<br />
===Unknown password===<br />
The Sailfish OS rootFS sets a random password when booting for the first time.<br />
You can only log in through the <code>telnet</code> debug interface.<br />
Since the <code>eth0</code> interface still requires manually setup, you can't access <code>telnet</code>.<br />
<br />
To circumvent this issue, you can login through the UART TTY interface. <br />
However you don't know the password of the <code>root</code> nor <code>nemo</code> users!<br />
To disable the <code>root</code> and <code>nemo</code> passwords, we can modify the <code>/etc/shadow</code> file:<br />
<br />
sudo chmod +w <SD card data partition>/etc/shadow<br />
sudo vim <SD card data partition>/etc/shadow # Remove any characters where <HASHED PASSWORD> is written: user1:<HASHED PASSWORD>:16092:0:99999:7:::.<br />
sudo chmod -w <SD card data partition>/etc/shadow<br />
<br />
By removing the hashed password, we can login with the user without entering a password.<br />
You can set a new password afterwards by running as a logged in user:<br />
<br />
passwd<br />
<br />
===Init eth0===<br />
Enabling the <code>eth0</code> interface has to be done manually for now:<br />
<br />
ifconfig eth0 <YOUR_IP><br />
route add default gw <DEFAULT_GATEWAY_IP><br />
echo "nameserver <DNS_SERVER_IP>" > /etc/resolv.conf<br />
<br />
Test your configuration with <code>ping</code>:<br />
<br />
ping jolla.com</div>Dylanvanasschttps://wiki.merproject.org/wiki/Adaptations/PinePhone64Adaptations/PinePhone642019-05-22T08:32:53Z<p>Dylanvanassc: /* Hardware Support */</p>
<hr />
<div>=Hardware Support=<br />
<br />
Full information of hardware spec [https://wiki.pine64.org/index.php/Project_Don't_be_evil Here]<br />
<br />
==Testing the vibrator motor==<br />
<br />
Vibrator motor is on pin <code>PD2</code>.<br />
You can calculate the PIN number for PD2 as followed ([https://linux-sunxi.org/GPIO more information]):<br />
<code>(4-1) * 32 + 2 = 98</code><br />
<br />
echo "98" > /sys/class/gpio/export<br />
echo "out" > /sys/class/gpio/gpio98/direction<br />
echo "1" > /sys/class/gpio/gpio98/value # On<br />
echo "1" > /sys/class/gpio/gpio98/value # Off<br />
<br />
=Installation=<br />
==Prepare SD card==<br />
<br />
Use GParted or any other tool to create the following <code>EXT4</code> partitions:<br />
<br />
# <b>boot</b>: Holds the mainline kernel Image and Device Tree files<br />
# <b>data</b>: Holds the Sailfish OS rootFS<br />
<br />
GParted will ask you to leave the first MB free of the SD card when creating the first partition, this is correct.<br />
This 1 MB will be used to store the U-boot boot loader.<br />
<br />
==U-Boot==<br />
<br />
We will now build the mainline U-boot boot loader from Git.<br />
<br />
=== Clone U-boot (master branch): ===<br />
<br />
You can find the U-boot mirror repository on Github:<br />
<br />
git clone github.com/u-boot/u-boot<br />
<br />
=== Compile U-boot ===<br />
<br />
You have to cross compile U-boot with the <code>arm64</code> arch:<br />
<br />
export CROSS_COMPILE=aarch64-linux-gnu-<br />
ARCH=arm64 make clean<br />
ARCH=arm64 make sopine_baseboard_defconfig<br />
ARCH=arm64 make<br />
<br />
The <code>sopine_baseboard_defconfig</code> is the same for the Don't Be Evil devkit.<br />
<br />
=== Burn U-boot to your SD card ===<br />
<br />
Copy the compiled U-boot bootloader to the first sector on your SD card:<br />
<br />
sudo dd if=u-boot-sunxi-with-spl.bin of=/dev/sdX bs=8k seek=1<br />
<br />
<br />
=== Manually loading the kernel ===<br />
<br />
Serial TTY Baudrate over UART = 115200 for screen, example: <code>screen /dev/ttyUSB0 115200</code><br />
You have to start screen first, before turning on the devkit.<br />
<br />
Interrupt the U-boot autoboot process when you see a message in the U-boot prompt. <br />
We need to access the U-boot prompt to load the Kernel image and boot it manually!<br />
<br />
Set bootargs:<br />
<br />
setenv bootargs root=/dev/mmcblk0p2 rootwait panic=10<br />
<br />
Kernel Image loading and Device Tree files:<br />
<br />
ext4load mmc 0:1 ${kernel_addr_r} /Image <br />
ext4load mmc 0:1 ${fdt_addr_r} /sun50i-a64-dontbeevil.dtb <br />
<br />
Boot the kernel:<br />
<br />
booti ${kernel_addr_r} - ${fdt_addr_r}<br />
<br />
=== Automatic boot ===<br />
<br />
Create a <code>boot.cmd</code> file:<br />
<br />
echo Setting bootargs<br />
setenv bootargs console=tty0 console=ttyS0,115200 root=/dev/mmcblk0p2 no_console_suspend rootwait <br />
earlycon=uart,mmio32,0x01c28000 panic=10 consoleblank=0 loglevel=1<br />
printenv<br />
echo Loading DTB<br />
load mmc 0:1 ${fdt_addr_r} /sun50i-a64-dontbeevil.dtb<br />
echo Loading kernel Image<br />
load mmc 0:1 ${kernel_addr_r} /Image<br />
echo Booting kernel NOW<br />
booti ${kernel_addr_r} - ${fdt_addr_r}<br />
<br />
Mount your <code>boot</code> partition and run the following command:<br />
sudo mkimage -C none -A arm -T script -d /mnt/boot.cmd /mnt/boot.scr<br />
<br />
This will translate the <code>boot.cmd</code> file into a U-boot script.<br />
<br />
==Kernel==<br />
<br />
The PinePhone runs a mainline kernel, device tree modifications are done by all the PinePhone OS developers on Gitlab (https://gitlab.com/pine64-org/linux).<br />
<br />
=== Clone the kernel ===<br />
<br />
git clone https://gitlab.com/pine64-org/linux<br />
cd linux<br />
git checkout pinephone-dontbeevil<br />
<br />
=== Configure the kernel ===<br />
<br />
# <b>Copy our kernel config</b>: https://gitlab.com/pinephone-sailfish-os/linux-kernel/raw/master/pinephone-config<br />
# <b>Enter the <code>linux</code> project</b>: <code>cd linux</code><br />
# <b>Copy the config file</b> to <code>.config</code> in the main directory<br />
<br />
=== Build the kernel ===<br />
<br />
We cross compile the kernel for ARM64.<br />
The <code>LOCALVERSION</code> variable can be used to add a version to the build.<br />
<br />
Cross compile the kernel:<br />
export ARCH=arm64<br />
export CROSS_COMPILE=aarch64-linux-gnu-<br />
export LOCALVERSION=-nemo<br />
make clean<br />
make oldconfig<br />
make Image modules dtbs<br />
<br />
Install the kernel modules in a different path: <br />
make modules_install INSTALL_MOD_PATH=../linux_modules/<br />
<br />
=== Install kernel ===<br />
<br />
Copy the following things:<br />
<br />
# <b>Image</b> from <code>arch/arm64/boot/Image</code> to the root of the <code>boot</code> partition.<br />
# <b>Device tree files</b> from <code>arch/arm64/boot/dts/allwinner/sun50i-a64-dontbeevil.dtb</code> and <code>arch/arm64/boot/dts/allwinner/sun50i-a64-dontbeevil.dts</code> to the root of the <code>boot</code> partition.<br />
# <b>Modules</b> from <code>../linux_modules</code> to <code>/lib/modules</code> on the <code>boot</code> partition.<br />
<br />
==Nemo Mobile==<br />
<br />
==Sailfish OS==<br />
<br />
===Flash rootFS===<br />
You can download the latest rootFS from the Gitlab SailfishOS Porters CI: https://gitlab.com/sailfishos-porters-ci/dont_be_evil-ci (see the artifacts of the latest CI job).<br />
<br />
This <code>tar.gz</code> archive should be burned to the <code>data</code> partition of the SD card.<br />
It's important to burn it as the root user (not with sudo) to preserve extended attributes and ACLs: <br />
<br />
sudo su<br />
bsdtar -xpf <SAILFISH OS ROOTFS>.tar.bz2 -C <MOUNTPOINT OF /DATA><br />
<br />
===Unknown password===<br />
The Sailfish OS rootFS sets a random password when booting for the first time.<br />
You can only log in through the <code>telnet</code> debug interface.<br />
Since the <code>eth0</code> interface still requires manually setup, you can't access <code>telnet</code>.<br />
<br />
To circumvent this issue, you can login through the UART TTY interface. <br />
However you don't know the password of the <code>root</code> nor <code>nemo</code> users!<br />
To disable the <code>root</code> and <code>nemo</code> passwords, we can modify the <code>/etc/shadow</code> file:<br />
<br />
sudo chmod +w <SD card data partition>/etc/shadow<br />
sudo vim <SD card data partition>/etc/shadow # Remove any characters where <HASHED PASSWORD> is written: user1:<HASHED PASSWORD>:16092:0:99999:7:::.<br />
sudo chmod -w <SD card data partition>/etc/shadow<br />
<br />
By removing the hashed password, we can login with the user without entering a password.<br />
You can set a new password afterwards by running as a logged in user:<br />
<br />
passwd<br />
<br />
===Init eth0===<br />
Enabling the <code>eth0</code> interface has to be done manually for now:<br />
<br />
ifconfig eth0 <YOUR_IP><br />
route add default gw <DEFAULT_GATEWAY_IP><br />
echo "nameserver <DNS_SERVER_IP>" > /etc/resolv.conf<br />
<br />
Test your configuration with <code>ping</code>:<br />
<br />
ping jolla.com</div>Dylanvanassc