Difference between revisions of "Distribution"

From Rockchip open source Document
Jump to: navigation, search
Line 23: Line 23:
  
 
download and extract ubuntu-xenial
 
download and extract ubuntu-xenial
<pre><code>wget [http://cdimage.ubuntu.com/ubuntu-base/releases/16.04/release/ubuntu-base-16.04-core-armhf.tar.gz http://cdimage.ubuntu.com/ubuntu-base/releases/16.04/release/ubuntu-base-16.04-core-armhf.tar.gz]
+
<pre>wget [http://cdimage.ubuntu.com/ubuntu-base/releases/16.04/release/ubuntu-base-16.04-core-armhf.tar.gz http://cdimage.ubuntu.com/ubuntu-base/releases/16.04/release/ubuntu-base-16.04-core-armhf.tar.gz]
sudo tar -xpf ubuntu-base-16.04-core-armhf.tar.gz</code>
+
sudo tar -xpf ubuntu-base-16.04-core-armhf.tar.gz
 
</pre>
 
</pre>
  
 
copy qemu
 
copy qemu
<pre><code>sudo apt-get install qemu-user-static
+
<pre>sudo apt-get install qemu-user-static
sudo cp /usr/bin/qemu-arm-static usr/bin/</code>
+
sudo cp /usr/bin/qemu-arm-static usr/bin/
 
</pre>
 
</pre>
  
 
copy host's dns to rootfs
 
copy host's dns to rootfs
<pre><code>sudo cp -b /etc/resolv.conf  etc/resolv.conf</code>
+
<pre>sudo cp -b /etc/resolv.conf  etc/resolv.conf
 
</pre>
 
</pre>
  
 
add the following repository to etc/apt/source.list(for compiling xserver)
 
add the following repository to etc/apt/source.list(for compiling xserver)
<pre><code>deb [http://ports.ubuntu.com/ubuntu-ports/ http://ports.ubuntu.com/ubuntu-ports/] xenial main universe
+
<pre>deb [http://ports.ubuntu.com/ubuntu-ports/ http://ports.ubuntu.com/ubuntu-ports/] xenial main universe
deb-src [http://ports.ubuntu.com/ubuntu-ports/ http://ports.ubuntu.com/ubuntu-ports/] xenial main universe</code>
+
deb-src [http://ports.ubuntu.com/ubuntu-ports/ http://ports.ubuntu.com/ubuntu-ports/] xenial main universe
 
</pre>
 
</pre>
  
 
chroot to target rootfs<br/> [https://github.com/wzyy2/Scripts/blob/master/ch-mount.sh ch-mount.sh]
 
chroot to target rootfs<br/> [https://github.com/wzyy2/Scripts/blob/master/ch-mount.sh ch-mount.sh]
<pre><code>ch-mount.sh -m ubuntu/</code>
+
<pre>ch-mount.sh -m ubuntu/
 
</pre>
 
</pre>
  
 
install desktop
 
install desktop
<pre><code>apt-get install lightdm vim git
+
<pre>apt-get install lightdm vim git
apt-get build-dep xserver-xorg-core</code>
+
apt-get build-dep xserver-xorg-core
 
</pre>
 
</pre>
  
 
extract libmali-rk-dev_1.4-4_armhf.deb and libmali-rk-midgard0_1.4-4_armhf.deb(only debian/ubutnu, link by yourself if you are using other distributions) and copy them to target system.<br/> delete origin egl,gles library(For insurance)
 
extract libmali-rk-dev_1.4-4_armhf.deb and libmali-rk-midgard0_1.4-4_armhf.deb(only debian/ubutnu, link by yourself if you are using other distributions) and copy them to target system.<br/> delete origin egl,gles library(For insurance)
<pre><code>rm -rf /usr/lib/arm-linux-gnueabihf/mesa-egl</code>
+
<pre>rm -rf /usr/lib/arm-linux-gnueabihf/mesa-egl
 
</pre>
 
</pre>
  
 
download xserver
 
download xserver
<pre><code>git clone [https://github.com/rockchip-linux/xserver.git https://github.com/rockchip-linux/xserver.git]</code>
+
<pre>git clone [https://github.com/rockchip-linux/xserver.git https://github.com/rockchip-linux/xserver.git]
 
</pre>
 
</pre>
  
 
delete those in configure.ac
 
delete those in configure.ac
<pre><code>AC_CHECK_DECL(GBM_BO_USE_LINEAR,
+
<pre>AC_CHECK_DECL(GBM_BO_USE_LINEAR,
                         [AC_DEFINE(GLAMOR_HAS_GBM_LINEAR, 1, [Have GBM_BO_USE_LINEAR])], []</code>
+
                         [AC_DEFINE(GLAMOR_HAS_GBM_LINEAR, 1, [Have GBM_BO_USE_LINEAR])], []
 
</pre>
 
</pre>
  
 
build xserver<br/> (You can also use 'make install DESTDIR=/opt/x-build' to get files and copy them to a clean system)<br/> (This method is easy but slow, it'better to cross compile xserver under the ubuntu/debian multiarch environment)
 
build xserver<br/> (You can also use 'make install DESTDIR=/opt/x-build' to get files and copy them to a clean system)<br/> (This method is easy but slow, it'better to cross compile xserver under the ubuntu/debian multiarch environment)
<pre><code>./autogen.sh --prefix=/usr --enable-aiglx --enable-composite --enable-record --enable-xv --enable-xvmc --enable-dga --enable-screensaver --enable-xdmcp --enable-xdm-auth-1 --enable-glx --enable-dri --enable-dri2 --enable-glamor --enable-dri3 --enable-libdrm --enable-present --enable-xinerama --enable-xf86vidmode --enable-xace --enable-xselinux --enable-xfree86-utils --enable-xwayland --enable-systemd-logind --with-systemd-daemon --enable-suid-wrapper --enable-dmx --enable-xvfb --enable-xnest --enable-kdrive --enable-xephyr --enable-xmir --with-sha1=libgcrypt --enable-xcsecurity  --with-log-dir=/var/log
+
<pre>./autogen.sh --prefix=/usr --enable-aiglx --enable-composite --enable-record --enable-xv --enable-xvmc --enable-dga --enable-screensaver --enable-xdmcp --enable-xdm-auth-1 --enable-glx --enable-dri --enable-dri2 --enable-glamor --enable-dri3 --enable-libdrm --enable-present --enable-xinerama --enable-xf86vidmode --enable-xace --enable-xselinux --enable-xfree86-utils --enable-xwayland --enable-systemd-logind --with-systemd-daemon --enable-suid-wrapper --enable-dmx --enable-xvfb --enable-xnest --enable-kdrive --enable-xephyr --enable-xmir --with-sha1=libgcrypt --enable-xcsecurity  --with-log-dir=/var/log
 
make
 
make
make install</code>
+
make install
 
</pre>
 
</pre>
  
 
set password
 
set password
<pre><code>useradd -s '/bin/bash' -m -G adm,sudo rk
+
<pre>useradd -s '/bin/bash' -m -G adm,sudo rk
 
echo "Set password for rk:"
 
echo "Set password for rk:"
 
passwd rk
 
passwd rk
 
echo "Set password for root:"
 
echo "Set password for root:"
passwd root</code>
+
passwd root
 
</pre>
 
</pre>
  
 
exit chroot
 
exit chroot
<pre><code>exit
+
<pre>exit
ch-mount.sh -u ubuntu/</code>
+
ch-mount.sh -u ubuntu/
 
</pre>
 
</pre>
  
Line 85: Line 85:
  
 
make image
 
make image
<pre><code>dd if=/dev/zero of=ubuntu.img  bs=1M count=3000
+
<pre>dd if=/dev/zero of=ubuntu.img  bs=1M count=3000
 
sudo mkfs.ext4 ubuntu.img
 
sudo mkfs.ext4 ubuntu.img
 
mkdir ubuntu-mount
 
mkdir ubuntu-mount
Line 92: Line 92:
 
sudo umount ubuntu-mount
 
sudo umount ubuntu-mount
 
e2fsck -p -f ubuntu.img
 
e2fsck -p -f ubuntu.img
resize2fs -M ubuntu.img</code>
+
resize2fs -M ubuntu.img
 
</pre>
 
</pre>
  

Revision as of 13:10, 16 March 2017

The release rootfs image is based on linaro-alip-jessie.If you want to use other distributions, you need to compile and install components we provide.Do not install the deb under rk-rootfs-build directly.

We currently provide several components, the guide below only help you make xserver work.
For more details Please refer to each package's wiki.

There are also many other districbutions support by community or developers.

ARCH Linux

Here is the guide from Arch Linux

https://archlinuxarm.org/platforms/armv7/rockchip

https://archlinuxarm.org/platforms/armv8/rockchip/

and source code here:

https://github.com/archlinuxarm/PKGBUILDs/tree/master/core/linux-gru

 

Ubuntu 16.04

download and extract ubuntu-xenial

wget [http://cdimage.ubuntu.com/ubuntu-base/releases/16.04/release/ubuntu-base-16.04-core-armhf.tar.gz http://cdimage.ubuntu.com/ubuntu-base/releases/16.04/release/ubuntu-base-16.04-core-armhf.tar.gz]
sudo tar -xpf ubuntu-base-16.04-core-armhf.tar.gz

copy qemu

sudo apt-get install qemu-user-static
sudo cp /usr/bin/qemu-arm-static usr/bin/

copy host's dns to rootfs

sudo cp -b /etc/resolv.conf  etc/resolv.conf

add the following repository to etc/apt/source.list(for compiling xserver)

deb [http://ports.ubuntu.com/ubuntu-ports/ http://ports.ubuntu.com/ubuntu-ports/] xenial main universe
deb-src [http://ports.ubuntu.com/ubuntu-ports/ http://ports.ubuntu.com/ubuntu-ports/] xenial main universe

chroot to target rootfs
ch-mount.sh

ch-mount.sh -m ubuntu/

install desktop

apt-get install lightdm vim git
apt-get build-dep xserver-xorg-core

extract libmali-rk-dev_1.4-4_armhf.deb and libmali-rk-midgard0_1.4-4_armhf.deb(only debian/ubutnu, link by yourself if you are using other distributions) and copy them to target system.
delete origin egl,gles library(For insurance)

rm -rf /usr/lib/arm-linux-gnueabihf/mesa-egl

download xserver

git clone [https://github.com/rockchip-linux/xserver.git https://github.com/rockchip-linux/xserver.git]

delete those in configure.ac

AC_CHECK_DECL(GBM_BO_USE_LINEAR,
                        [AC_DEFINE(GLAMOR_HAS_GBM_LINEAR, 1, [Have GBM_BO_USE_LINEAR])], []

build xserver
(You can also use 'make install DESTDIR=/opt/x-build' to get files and copy them to a clean system)
(This method is easy but slow, it'better to cross compile xserver under the ubuntu/debian multiarch environment)

./autogen.sh --prefix=/usr --enable-aiglx --enable-composite --enable-record --enable-xv --enable-xvmc --enable-dga --enable-screensaver --enable-xdmcp --enable-xdm-auth-1 --enable-glx --enable-dri --enable-dri2 --enable-glamor --enable-dri3 --enable-libdrm --enable-present --enable-xinerama --enable-xf86vidmode --enable-xace --enable-xselinux --enable-xfree86-utils --enable-xwayland --enable-systemd-logind --with-systemd-daemon --enable-suid-wrapper --enable-dmx --enable-xvfb --enable-xnest --enable-kdrive --enable-xephyr --enable-xmir --with-sha1=libgcrypt --enable-xcsecurity  --with-log-dir=/var/log
make
make install

set password

useradd -s '/bin/bash' -m -G adm,sudo rk
echo "Set password for rk:"
passwd rk
echo "Set password for root:"
passwd root

exit chroot

exit
ch-mount.sh -u ubuntu/


copy ttyS2.conf and udev directory to target rootfs from rk-rootfs.build

make image

dd if=/dev/zero of=ubuntu.img  bs=1M count=3000
sudo mkfs.ext4 ubuntu.img
mkdir ubuntu-mount
sudo mount  ubuntu.img ubuntu-mount
sudo cp -rfp ubuntu ubuntu-mount
sudo umount ubuntu-mount
e2fsck -p -f ubuntu.img
resize2fs -M ubuntu.img

update

There is a ubuntu build script in our rootfs-build repo. It's different from the above example, it unpack the debian packages rather than compile from source.
Please refer to the readme.