|
Edited by markusp at 2016-7-9 02:22
Linux Kernel is always under developing. Armbian includes common kernel patches. Author of Armbian provides easy-to-use system for building custom kernels and completely OS distributions. At this moment only "legacy-kernel" provides basic support for H3 SoC - accelerated video, audio drivers.
For setting custom video resolution you need:
- to patch kernel sources
- compile kernel
- install new kernel into target OS
Unfortunately, for realizing these simple steps, we must pass 7 circles of hell.
As described in http://docs.armbian.com/Developer-Guide_Build-Preparation/:
1. Setup VirtualBox.
For kernel compilation 10 Gb virtual drive is enough. Also Network Adapter must be set to "Bridged Adapter", for accessing VM through Samba and SSH.
2. Get base Ubuntu OS
Download Ubuntu Trusty 14.04 mini.iso, boot and install base system to VM.
http://archive.ubuntu.com/ubuntu ... es/netboot/mini.iso
3. Login as root to your VM's Ubuntu.
For enabling root account, set root password: https://www.server-world.info/en ... &p=initial_conf&f=2 : sudo passwd root
4. Install samba and ssh-server.
http://help.ubuntu.ru/wiki/samba.
to grant access to the whole rootfs add the following lines to your /etc/samba/smb.conf and restart service:
[root]
path = /
guest ok = yes
browseable = yes
read only = no
sudo service smbd restart
Setup dropbear for SSH connection https://www.howtoinstall.co/en/ubuntu/trusty/dropbear
sudo update-rc.d dropbear defaults
sudo service dropbear start
now you can:
connect to your VM using any ssh client (dbclient root@ubuntu)
open VM's rootfs as a network share.
5. Download Armbian build system and kernel sources.
mkdir /root/armbian
cd /root/armbian
apt-get -y -qq install git
git clone --depth 1 https://github.com/igorpecovnik/lib
cp lib/compile.sh .
6. Making patches
Kernel sources are in ./sources/linux-sun8i/sun8i
You need make changes to 4 files, but make changes directly to the kernel source is not allowed by default. Because compilation scripts will revert all changes . So we need make patches:
copy original files elsewhere:
mkdir -p respatch/a
cd ./sources/linux-sun8i/sun8i
cp --parents drivers/video/sunxi/disp/de/disp_display.c ../../../respatch/a
cp --parents drivers/video/sunxi/disp2/disp/de/disp_display.c ../../../respatch/a
cp --parents drivers/video/sunxi/disp2/hdmi/aw/hdmi_core.c ../../../respatch/a
cp --parents drivers/video/sunxi/disp2/hdmi/aw/hdmi_edid.c ../../../respatch/a
cd ../../../respatch
cp -r a b
Now edit 4 files under b/ directory. As described here https://github.com/dni1337/Orang ... 460b8586276d20e8fb6
b/drivers/video/sunxi/disp/de/disp_display.c
b/drivers/video/sunxi/disp2/disp/de/disp_display.c
b/drivers/video/sunxi/disp2/hdmi/aw/hdmi_core.c
b/drivers/video/sunxi/disp2/hdmi/aw/hdmi_edid.c
For example in first file disp_display.c goto line ~726 (approximately), find line similar to shown and make changes marked with green color. Then goto line ~780 replace values, save changes and close file. Now change other 3 files.make patch:
make sure you are in respatch directory, run:
diff -ur a b > res-1280x1024.patch
cd ..
copy patch to patches dir:
cp respatch/res-1280x1024.patch lib/patch/kernel/sun8i-default
7. Compilation
./compile.sh
Select what to build: "Kernel, U-boot and other packages"
Select one of supported boards: "your board"
Select one of supported kernels: "default 3.4.x - 3.14.x legacy"
First compilation may takes hour or two, second - 10-20 min.
When finished move all *.dep packages from output/debs to the flash drive or directly to boot device.
all other stuffs going on board's system itself...
8. Install new packages
Boot Armbian as usual, login and run:
h3disp -m 5 -d
(http://forum.armbian.com/index.p ... -devices/#entry5676)
Insert flash drive, navigate deb packages and install all of them:
sudo dpkg -i *.deb
9. Edit script.fex
cd /boot
bin2fex script.bin script.fex
As mentioned here by dni http://www.orangepi.org/orangepi ... 475&page=5#pid7126. Open script.fex in the text editor, search for pll_video and (for 1280x1024) change it's value to:
pll_video = 432
save file and convert it to bin
fex2bin script.fex script.bin
10. Change default soundcard.
On Debian Jessie default sound card is hdmisnd. But if you are using HDMI-DVI or HDMI monitor without speakers, you may want to use analog audio output by default. Replace all "card 1" to "card 0" in /etc/asound.conf.
11. reboot
Following https://github.com/dni1337/OrangePI-Kernel/commits/master it is possible to change resolution to 1024x768. In this case you need right value of pll_video. In other cases you'll need pll_video and correct parameters for hdmi_core.c.
|
|