I.MX6ubuntu-core-14.04ApachephpmysqlQt5

zengjf發表於2016-11-03
/***************************************************************************
 *           I.MX6 ubuntu-core-14.04 Apache php mysql Qt5
 * 說明:
 *     之前有嘗試過12.04版本的,這裡再繼續嘗試一下14.04,看一下有什麼不同的
 * 地方。相對前一次的嘗試,這次相對來說更深入了一點點,遺憾就是沒有吧Qt5跑
 * 起來,雖然編譯通過,但執行的時候HDMI上沒有顯示。
 *
 *                                      2016-11-3 深圳 南山平山村 曾劍鋒
 *************************************************************************/

一、參考文件:
    1. I.MX6 Ubuntu core porting
        http://www.cnblogs.com/zengjfgit/p/5405477.html
    2. 樹莓派3上安裝Qt5
        http://www.mamicode.com/info-detail-1400876.html
    3. Ubuntu 14.04 配置 LAMP+phpMyAdmin PHP(5.5.9)開發環境
        http://blog.csdn.net/tecn14/article/details/27515241
    4. Qt5 從頭學(2)--手動構建HelloWold
        http://www.cnblogs.com/csulennon/p/4479236.html
    5. How do i set up the server`s fully qualified domain name?
        http://stackoverflow.com/questions/9445772/how-do-i-set-up-the-servers-fully-qualified-domain-name

二、下載地址:
    1. http://mirror1.ku.ac.th/ubuntu-cdimages/ubuntu-core/releases/14.04/release/
    2. ubuntu-core-14.04-core-armhf.tar.gz

三、修改內容:
    1. cat /etc/init/ttymxc.conf
        # tty5 - getty
        #
        # This service maintains a getty on tty5 from the point the system is
        # started until it is shut down again.

        start on runlevel [23] and not-container

        stop on runlevel [!2345]

        respawn
        exec /sbin/getty -L 115200 ttymxc0 vt102
    2. cat /etc/network/interfaces
        # interfaces(5) file used by ifup(8) and ifdown(8)
        # Include files from /etc/network/interfaces.d:
        source-directory /etc/network/interfaces.d
        
        auto eth0
        iface eth0 inet dhcp
            hwaddress ether 70:B3:D5:10:6F:92
    3. cat /etc/passwd
        root::0:0:root:/root:/bin/bash
        daemon:x:1:1:daemon:/usr/sbin:/usr/sbin/nologin
        bin:x:2:2:bin:/bin:/usr/sbin/nologin
        sys:x:3:3:sys:/dev:/usr/sbin/nologin
        sync:x:4:65534:sync:/bin:/bin/sync
        games:x:5:60:games:/usr/games:/usr/sbin/nologin
        man:x:6:12:man:/var/cache/man:/usr/sbin/nologin
        lp:x:7:7:lp:/var/spool/lpd:/usr/sbin/nologin
        mail:x:8:8:mail:/var/mail:/usr/sbin/nologin
        news:x:9:9:news:/var/spool/news:/usr/sbin/nologin
        uucp:x:10:10:uucp:/var/spool/uucp:/usr/sbin/nologin
        proxy:x:13:13:proxy:/bin:/usr/sbin/nologin
        www-data:x:33:33:www-data:/var/www:/usr/sbin/nologin
        backup:x:34:34:backup:/var/backups:/usr/sbin/nologin
        list:x:38:38:Mailing List Manager:/var/list:/usr/sbin/nologin
        irc:x:39:39:ircd:/var/run/ircd:/usr/sbin/nologin
        gnats:x:41:41:Gnats Bug-Reporting System (admin):/var/lib/gnats:/usr/sbin/nologin
        nobody:x:65534:65534:nobody:/nonexistent:/usr/sbin/nologin
        libuuid:x:100:101::/var/lib/libuuid:
        syslog:x:101:104::/home/syslog:/bin/false
        mysql:x:102:105:MySQL Server,,,:/nonexistent:/bin/false  (mysql預設是沒安裝的,這是另外安裝好的)
        root@localhost:/# 

四、檢視情況:
    1. 網路:
        root@localhost:/# ifconfig
        eth0      Link encap:Ethernet  HWaddr 00:04:9f:02:b4:0a  
                  inet addr:10.0.2.12  Bcast:10.0.2.255  Mask:255.255.255.0
                  inet6 addr: fe80::204:9fff:fe02:b40a/64 Scope:Link
                  UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
                  RX packets:51 errors:0 dropped:0 overruns:0 frame:0
                  TX packets:57 errors:0 dropped:0 overruns:0 carrier:0
                  collisions:0 txqueuelen:1000 
                  RX bytes:5761 (5.7 KB)  TX bytes:5627 (5.6 KB)

        lo        Link encap:Local Loopback  
                  inet addr:127.0.0.1  Mask:255.0.0.0
                  inet6 addr: ::1/128 Scope:Host
                  UP LOOPBACK RUNNING  MTU:65536  Metric:1
                  RX packets:0 errors:0 dropped:0 overruns:0 frame:0
                  TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
                  collisions:0 txqueuelen:0 
                  RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

        root@localhost:/# 
    2. 更新:
        apt-get update
    3. 安裝mysql(已安裝成功):
        apt-get install mysql-server
    4. Vim:
        apt-get install vim
    5. 安裝php5,結果自動安裝了apache:
        1. apt-get install php5
        2. 上面命令自動安裝了apache2
        3. 解決報錯:
            1. localhost login: AH00557: apache2: apr_sockaddr_info_get() failed for localhost.localdomain
AH00558: apache2: Could not reliably determine the server`s fully qualified domain name, using 127.0.0.1. Set the `ServerName` directive globally to suppress this message
            2. cat /etc/apache2/apache2.conf
                ......
                ServerName <your server name>   # 新增在最後,如果本身有這個欄位,修改就OK了
    6. 安裝qt5-default1. apt-get install qt5-default
        2. apt-get install make g++
        3. 測試程式:http://zetcode.com/gui/qt5/widgets/
        4. 編譯指令碼remake.sh:
            #!/bin/bash

            qmake -project
            qmake
            sleep 1
            echo "QT += widgets" >> root.pro
            make
    7. 安裝dbus
        1. apt-get install dbus
        2. apt-get install libegl1-mesa-dev
        3. dbus-uuidgen > /var/lib/dbus/machine-id