Quad Core UDOO – Debian – compiling kernel 4.0.8

U-Boot 2015 http://www.igorpecovnik.com/2015/02/20/udoo-quad-debian-sd-image/

Download the software:

wget http://mirror.igorpecovnik.com/kernel/4.0.8-udoo-next.tar

extract it and only install the u-boot package:

dpkg -i linux-u-boot-4.0.8-udoo_1.8_armhf.deb

 

Kernel based on https://github.com/patrykk/linux-udoo

Install prerequisites:

apt-get install lzop kernel-package u-boot-tools dblatex docbook-utils \
 kernel-common libsgmls-perl libsp1c2 libtinfo-dev sgmlspl sp texlive \
 texlive-bibtex-extra texlive-math-extra xmlto xsltproc libncurses5-dev

Getting the kernel:

cd /tmp
mkdir kernel4.0.8
cd kernel4.0.8
wget https://github.com/patrykk/linux-udoo/archive/4.0.8.zip
unzip 4.0.8.zip

now change directory to the kernel folder and configure it:

make menuconfig

compile it – in my case it took approx 2 hours:

make uImage LOADADDR=0x10008000  modules

install the modules:

make modules_install

copy the kernel to /boot folder

cp arch/arm/boot/uImage /boot/
 cp arch/arm/boot/zImage /boot/

compile the dtb file:

make imx6q-udoo.dtb

copy dtb file
cp arch/arm/boot/dts/imx6q-udoo.dtb /boot/dts/
copy firmware
cp firmware/imx/sdma/sdma-imx6q.bin /lib/firmware/sdma/
configure your uboot
nano /boot/boot.cmd
then copy and paste this
setenv bootargs root=/dev/mmcblk0p1 rootfstype=ext4 rootwait console=ttymxc1,115200
ext2load mmc 0 0x18000000 /boot/dtb/imx6q-udoo.dtb
ext2load mmc 0 0x12000000 /boot/zImage
bootz 0x12000000 - 0x18000000

if you use graphical interface you will probably want to replace the first line with:

setenv bootargs root=/dev/mmcblk0p1 rootfstype=ext4 rootwait console=tty1 video=mxcfb0:dev=hdmi,1920x1080M@60,if=RGB24,bpp=32 ahci_imx.hotplug=1 quiet

then convert it to uboot format
mkimage -C none -A arm -T script -d /boot/boot.cmd /boot/boot.scr

Now cross fingers, connect console cable and restart the device

 

U-Boot 2015.04-dirty (Jul 13 2015 - 12:27:45)
CPU:   Freescale i.MX6Q rev1.2 at 792 MHz
 Reset cause: WDOG
 Board: Udoo
 DRAM:  1 GiB
 MMC:   FSL_SDHC: 0
 *** Warning - bad CRC, using default environment
In:    serial
 Out:   serial
 Err:   serial
 Net:   using phy at 6
 FEC [PRIME]
 Hit any key to stop autoboot:  0
 switch to partitions #0, OK
 mmc0 is current device
 295 bytes read in 63 ms (3.9 KiB/s)
 Running bootscript from mmc ...
 ## Executing script at 12000000
 35681 bytes read in 138 ms (252 KiB/s)
 6491688 bytes read in 374 ms (16.6 MiB/s)
 Kernel image @ 0x12000000 [ 0x000000 - 0x630e28 ]
 ## Flattened Device Tree blob at 18000000
 Booting using the fdt blob at 0x18000000
 Using Device Tree in place at 18000000, end 1800bb60
Starting kernel ...
Booting Linux on physical CPU 0x0
 Linux version 4.0.8 (root@UDOO) (gcc version 4.9.2 (Debian 4.9.2-10) ) #3 SMP Fri
 Jul 31 19:05:40 BST 2015
 CPU: ARMv7 Processor [412fc09a] revision 10 (ARMv7), cr=10c5387d
 CPU: PIPT / VIPT nonaliasing data cache, VIPT aliasing instruction cache
 Machine model: Udoo i.MX6 Quad Board
 cma: Reserved 256 MiB at 0x40000000
 Memory policy: Data cache writealloc
 PERCPU: Embedded 11 pages/cpu @af731000 s12480 r8192 d24384 u45056
 Built 1 zonelists in Zone order, mobility grouping on.  Total pages: 260096
 Kernel command line: root=/dev/mmcblk0p1 rootfstype=ext4 rootwait console=ttymxc
 1,115200 ahci_imx.hotplug=1
 PID hash table entries: 4096 (order: 2, 16384 bytes)
 Dentry cache hash table entries: 131072 (order: 7, 524288 bytes)
 Inode-cache hash table entries: 65536 (order: 6, 262144 bytes)
 Memory: 764764K/1048576K available (8251K kernel code, 298K rwdata, 2472K rodata
 , 352K init, 440K bss, 21668K reserved, 262144K cma-reserved, 0K highmem)
 Virtual kernel memory layout:
 vector  : 0xffff0000 - 0xffff1000   (   4 kB)
 fixmap  : 0xffc00000 - 0xfff00000   (3072 kB)
 vmalloc : 0xc0800000 - 0xff000000   (1000 MB)
 lowmem  : 0x80000000 - 0xc0000000   (1024 MB)
 pkmap   : 0x7fe00000 - 0x80000000   (   2 MB)
 modules : 0x7f000000 - 0x7fe00000   (  14 MB)
 .text : 0x80008000 - 0x80a811a8   (10725 kB)
 .init : 0x80a82000 - 0x80ada000   ( 352 kB)
 .data : 0x80ada000 - 0x80b24860   ( 299 kB)
 .bss : 0x80b24860 - 0x80b92b48   ( 441 kB)
 SLUB: HWalign=64, Order=0-3, MinObjects=0, CPUs=4, Nodes=1
 Hierarchical RCU implementation.
 NR_IRQS:16 nr_irqs:16 16
 L2C-310 erratum 769419 enabled
 L2C-310 enabling early BRESP for Cortex-A9
 L2C-310 full line of zeros enabled for Cortex-A9
 L2C-310 ID prefetch enabled, offset 1 lines
 L2C-310 dynamic clock gating enabled, standby mode enabled
 L2C-310 cache controller enabled, 16 ways, 1024 kB
 L2C-310: CACHE_ID 0x410000c7, AUX_CTRL 0x76070001
 VPU 352M is enabled!
 Switching to timer-based delay loop, resolution 333ns
 sched_clock: 32 bits at 3000kHz, resolution 333ns, wraps every 1431655765682ns
 Console: colour dummy device 80x30
 Calibrating delay loop (skipped), value calculated using timer frequency.. 6.00
 BogoMIPS (lpj=30000)
 pid_max: default: 32768 minimum: 301
 Mount-cache hash table entries: 2048 (order: 1, 8192 bytes)
 Mountpoint-cache hash table entries: 2048 (order: 1, 8192 bytes)
 Initializing cgroup subsys net_cls
 CPU: Testing write buffer coherency: ok
 CPU0: thread -1, cpu 0, socket 0, mpidr 80000000
 Setting up static identity map for 0x107da3e8 - 0x107da440
 CPU1: thread -1, cpu 1, socket 0, mpidr 80000001
 CPU2: thread -1, cpu 2, socket 0, mpidr 80000002
 CPU3: thread -1, cpu 3, socket 0, mpidr 80000003
 Brought up 4 CPUs
 SMP: Total of 4 processors activated (24.00 BogoMIPS).
 CPU: All CPU(s) started in SVC mode.
[......]

 

Job Done.

How to install and configure CherryMusic on a Debian

Installation

CherryMusic depends on Python. To install Python 3, issue:

apt-get install python3

now install dependencies:

apt-get install ffmpeg imagemagick python3-unidecode lame flack vorbis-tools

Config

Create user dedicated account:

adduser cherrymusic

The easiest way to get the latest CherryMusic code and to update CherryMusic regularly is to use Git. Install Git with:

apt-get install git

Now, switch to the newly created user:

su cherrymusic

and get CherryMusic:

git clone --branch devel git://github.com/devsnd/cherrymusic.git /home/cherrymusic/cherrymusic-devel
cd /home/cherrymusic/cherrymusic-devel
python3 ./cherrymusic --help

cherry1

cherry2

Now, do the initial startup to generate the configuration and data files in your home directory:

python3 ./cherrymusic

This creates the configuration file “~/.config/cherrymusic/cherrymusic.conf”

now we need to edit the config file:

nano~/.config/cherrymusic/cherrymusic.conf

under “basedir” enter the path to your music collection – to make it easier to add further libraries I set the “basedir” to a folder /home/cherrymusic/music_dir and created symlinks in that directory pointing to the location of my music

mkdir /home/cherrymusic/music_dir
ln -s Path_to_your_music /home/cherrymusic/music_dir

now we need to update the cherrymusic database:

python3./cherrymusic--update

and then start the server to test it:

python3./cherrymusic

 

Finalization

By default cherrymusic will run on http – for security we will set it to run on https:

I already have certificate created and openssl installed so I go ahead and change the CherryMusic config:

cd /home/cherrymusic/cherrymusic-devel
 nano ~/.config/cherrymusic/cherrymusic.conf

and change the following lines accordingly:

[...]
 ssl_enabled = True
 [...]
 ssl_certificate = /etc/ssl/certs/server.crt
 [...]
 ssl_private_key = /etc/ssl/private/server.key
 [...]

Now, when you connect to CherryMusic, you should automatically be redirected to the SSL port and therefore have a secure connection.

sysvinit startup script

One final thing is to set it up as a service – instructions are provided on Lord-Simon’s github:
https://github.com/Lord-Simon/Scripts/tree/master/cherrymusic

wget --no-check-certificate https://github.com/Lord-Simon/Scripts/raw/master/cherrymusic/cherrymusic -O /etc/init.d/cherrymusic

then make the file executable:

chmod +x /etc/init.d/cherrymusic

open it for editing:

nano /etc/init.d/cherrymusic

and:
1. Add the path of your cherrymusic folder to DIR (/home/cherrymusic/cherrymusic-devel)
2. Add the python executable path to the PYTHON (/usr/bin/python3)
3. Set the USER and GROUP under which the service will run

Test the the init script by running:

service cherrymusic start

 

Once all is working OK do this:

update-rc.d /etc/init.d/cherrymusic defaults

 

Systemd startup script

I recently moved my cherrymusic service to brand new debian 8 box running systemd and so here is the systemd service script:

[Unit]
Description=CherryMusic Service
After=network.target

[Service]
User=cherrymusic
ExecStart=/usr/bin/python3 /home/cherrymusic/folder/cherrymusic #use your path to cm

[Install]
WantedBy=multi-user.target

saved that file to /etc/systemd/system as a cherrymusic.service
then to start it up just run:

systemctl start cherrymusic

to ensure it starts automatically enable the service:

systemctl enable cherrymusic

cherry3

UDOO – How to install WordPress in Ubuntu Server 12.04 LTS

Taken from: http://ubuntuserverguide.com/2012/05/how-to-install-latest-wordpress-in-ubuntu-server-12-04-lts.html

1. Install LAMP server on ubuntu server.

sudo apt-get install wordpress

2. Make a symbolic link to the Apache2 directory /var/www/ , The wordpress installation placed in directory /usr/share/wordpress folder

sudo ln -s /usr/share/wordpress /var/www/wordpress

3. install WordPress with the default script, script location: /usr/share/doc/wordpress/examples/. 

sudo bash /usr/share/doc/wordpress/examples/setup-mysql -n wordpress localhost

After execute this script, it will creates the MySQL database and user wordpress for the new MySQL database named localhost. If you have installed virtual host on server and/or already know your URL, it is best to name your database the same as your URL. Also if you plan on hosting multiple blogs with different virtual hosts, each needs a differently named database.

sudo bash /usr/share/doc/wordpress/examples/setup-mysql -n wordpress_name blog.domain.com

4. For automatic updates to occur, the folder and all its files and subfolders wordpress must be owned by www-data:

chown -R www-data /usr/share/wordpress

Now, open your web browser to install wordpress, type on address bar http://localhost/wordpress