Procedures for porting Qt in Ubuntu

Source: Internet
Author: User

Configure TFTP

To configure the TFTP service, follow these steps:

1. Install related software packages: tftpd (server), TFTP (client), and xinetd

Sudo apt-Get install tftpd TFTP xinetd

2. Create a configuration file

Create a configuration file TFTP under/etc/xinetd. d/

Sudo VI TFTP

Enter the following content in the file:

Service tftp

{

Socket_type = dgram

Protocol = UDP

Wait = Yes

User = root

Server =/usr/sbin/in. tftpd

Server_args =-S/tftpboot

Disable = No

Per_source = 11

CPIs = 100 2

Flags = IPv4

}

Save and exit

3. Create a TFTP service file directory (where files are uploaded and downloaded) and change its permissions.

Sudo mkdir/tftpboot

Sudo chmod 777/tftpboot-R

4. Restart the service

Sudo/etc/init. d/xinetd restart

Now that the TFTP service has been installed, you can test it. (Assume there is a test file test.txt in the current directory)

$ TFTP 127.0.0.1

TFTP> put test.txt

Sent 1018 bytes in 0.0 seconds

TFTP> Get test.txt

Received 1018 bytes in 0.1 seconds

TFTP> quit

$

With the getcommand, you can upload the test.txt file under the current directory to its service file directory through TFTP. In this case, test.txt appears under/tftpboot.
File. Run the PUT command to download the test.txt file from/tftpboot. This verifies the correctness of the TFTP service configuration. After the file is uploaded and downloaded
Exit with the quit command.

You can configure the TFTP service strictly according to the preceding steps. If you cannot get or put data, check whether the firewall is disabled.

Configure NFS server

To install and configure the NFS service in Ubuntu, follow these steps:

1. Install NFS

The NFS server is not installed on Ubuntu by default. Therefore, we must first install the NFS server:

$ Sudo apt-Get install nfs-kernel-Server

In some documents, it is suggested that you also need to use apt-get to manually install NFS client nfs-common and port er Portmap. However, this is not necessary, this is because apt automatically installs nfs-kernel-server for us.

2. Configure/etc/exports

The directories and permissions that NFS allows to be mounted are defined in the file/etc/exports.

For example, to share the rootfs directory under the root directory, we need to add the following line at the end of the/etc/exports file:/rootfs * (RW, sync, no_root_squash)

Where:/rootfs is the directory to be shared, * indicates that all network segments are allowed to access, RW is the read/write permission, sync is the data synchronization write memory and hard disk, no_root_squash
Is the permission of the NFS client share directory user. If the client uses the root user, the client has the root permission for the shared directory.

Other common NFS parameters include:

RO read-only access

RW read/write access to sync all data written and shared upon request

Async NFS can respond to requests before writing data

Secure NFS is sent through the secure TCP/IP ports below 1024

Insecure NFS is sent over port 1024

Wdelay if multiple users want to write data to the NFS Directory, group write (default)

No_wdelay if multiple users want to write data to the NFS Directory, write the data immediately. This setting is not required when async is used.

Hide does not share its subdirectories in the NFS shared directory.

No_hide shares the subdirectory of the NFS Directory

Subtree_check if sub-directories such as/usr/bin are shared, force NFS to check the permissions of the parent directory (default)

No_subtree_check is opposite to the above. The parent directory permission is not checked.

All_squash: The UID and gid of the shared file are mapped to the anonymous user anonymous, which is suitable for public directories.

No_all_squash retains the UID and gid of the shared file (default)

Root_squash all requests of the root user are mapped to the same permissions as those of the anonymous user (default)

The no_root_squas root user has full management access permissions to the root directory.

Anonuid = xxx specifies the UID of an anonymous user in the NFS server/etc/passwd file

Anongid = xxx specifies the GID of anonymous users in the NFS server/etc/passwd file

3. Restart the service

$ Sudo/etc/init. d/Portmap restart

$ Sudo/etc/init. d/nfs-kernel-server restart

4. Test NFS

Run the following command to display the shared directory:

$ Showmount-e

Alternatively, you can use the following command to mount it to a local disk, for example, Mount/rootfs to/mnt:

$ Sudo Mount-t nfs localhost:/rootfs/mnt

Run the DF command to check whether the mounting is successful. Run the following command to uninstall the SDK:

$ Sudo umount/mnt

Porting qt4 to the S3C2410 Platform

1. Development Platform: Ubuntu platform.

2. Target Platform: S3C2410, 320*240 touch screen, linux-2.6.26.5, u-boot-1.3.4

3. The migration steps are as follows:

(1) first configure the Linux kernel, support the LCD driver, then light up your screen, and support framebuffer. The specific Kernel configuration is as follows:

Device Drivers ---> graphics support ---> <*> support for frame buffer devices --->

<*> S3C2410 LCD framebuffer support

Of course, there are still some details involved, so I will not talk about them here. If you have any questions about this, you can raise them!

(2) If you want to support USB mouse and USB keyboard, you only need to configure the kernel:

Device Drivers ---> [*] hid devices ---> <*> USB Human Interface Device (full hid) Support

(3) Compile the kernel for testing.

(4) Next we will start porting qt4 based on the above work. First download source code: ftp://ftp.trolltech.no/qt/source/qt-
Embedded-linux-opensource-src-4.4.3.tar.gz, placed in a directory of your normal users, such as/home/yoyoili
/Qt4_port. Extract.

(5) enter the extracted directory.

(6) The next step is the key configuration. The port of qt4 is to configure whether to support certain features, such as OpenSSL. You can configure the configuration according to your own needs. Here, we refer to an article on the website for configuration, as shown below:

./Configure/

-Prefix/home/yoyoili/qt4_port/QT/build // specify the installation directory, which is consistent with the directory running on the Development Board.

-Release-shared/

-Fast/

-PCH/

-No-qt3support/

-QT-SQL-SQLite/

-No-LibTIFF-no-libmng/

-QT-libjpeg/

-QT-zlib/

-QT-libpng/

-QT-FreeType/

-No-OpenSSL/

-Nomake examples-nomake demos-nomake tools/

-Optimized-qmake/

-No-phonon/

-No-NIS/

-No-OpenGL/

-No-cups/

-No-xcursor-no-xfixes-no-xrandroid-no-xrender-no-XKB-no-Sm/

-No-xinerama-no-xshape/

-No-separate-debug-info/

-Xplatform qws/Linux-arm-G ++/

-Embedded ARM/

-Depths 16/

-No-qvfb/

-QT-GFX-linuxfb/

-No-GFX-qvfb-no-KBD-qvfb-no-mouse-qvfb/

-QT-KBD-USB/

-Confirm-license/

-No-armfpa

I didn't implement touch screen calibration here. Due to time issues, the system will be supplemented later. If the touch screen is supported, add-QT-mouse-tslib.

If this process involves many problems, it is generally because your system lacks some libraries. The corresponding libraries of my Ubuntu 8.10 are fully installed and there is no error. If you are a fedroa, you only need to install it completely. This is verified!

(7) then make & make install, which is compiled and installed. If so, it will be in your installation directory, that is
/Home/yoyoili/qt4_port/QT/build has the following directory: Bin include lib mkspecs
Plugins
Translations. Let's take a look at the content. Here we are concerned about a Lib, that is, the library files. These libraries will be required after the programs that are compiled and run on the board. Set
Copy the required Library to the corresponding directory of the Development Board. For example, CP/home/yoyoili/qt4_port/QT/build/lib/libqt *
/Home/yoyoili/source/rootfs/home/QT/build/lib. Of course, you do not need to copy some libraries.

(8) copy the wenquanyi font that displays Chinese characters. For example, CP
/Home/yoyoili/qt4_port/QT/build/lib/fonts/wenquanyi_160_75.qpf
/Home/yoyoili/source/rootfs/home/QT/build/Fonts
(The preceding path is the directory after compilation and installation. The font is under the LIB/fonts directory. Of course, the Directory of the root file system of the Development Board is located later)

(9) test: we use the program that comes with the source code for testing. For example, there are many examples in the source code. You only need to qmake & make, then copy the executable file to the root file system on the Development Board.

(10) set the corresponding environment variable. This environment variable is used for the Development Board, not for your PC! The details are as follows:

Export qtdir =/home/QT/build

Export LD_LIBRARY_PATH = $ qtdir/lib: $ LD_LIBRARY_PATH // (otherwise, the library cannot be found)

Export Path = $ qtdir/bin: $ path

Export qt_qws_fontdir =/home/QT/build/fonts // (otherwise the font cannot be displayed)

Of course, if you use a touch screen with related settings, you also need to add them here!

(11) run our program:

./Test-qws-FN/home/QT/build/fonts/wenquanyi_160_75.qpf

Then there is a display on your screen.

(12) Then you can insert your USB mouse on the Development Board to operate the small QT program.

(13) If you want to play the keyboard:

You can set your console = tty0 to operate on your development board, and then you can play the command. There are two methods to specify the console parameter, one can be through U-boot
For example, setenv bootargs root =/dev/nfs
Nfsroot = 192.168.1.110:/home/yoyoili/source/rootfs IP = 192.168.1.120
Init =/linuxrc console = tty0. The other is through the kernel. You only need to configure the kernel as follows:

Boot
Options ---> (root =/dev/nfs
Nfsroot = 192.168.1.2:/home/yoyoili/source/rootfs IP = 192.168.1.3
Init =/linuxrc console = tty0 )!

(14) The following problems may occur:

1. There will be a collect error when compiling your QT program. It should be because the connected qt4 library is not compiled by the arm cross-compilation tool, and there is a conflict between the two. Remove the connection to the qt4 library from file. Pro and add a line of config-= QT to remove it.

2. If this problem occurs:/lib/libqtcore. So: Undefined reference to 'clock _ gettim

The solution is to add a-LRT after lfags In The makefile.

 
3. Some people use the cross compiler Arm-softfloat-Linux-GNU-GCC, so they always prompt arm-Linux-GCC during make compilation.
Can't find, there are a lot of ways to solve this problem, one way is to re-create your cross compiler, modify the arm-softfloat.dat (as if this) will inside the target Modification
You can modify qmake. config in the mkspecs/qws/Linux-arm-G ++ directory of qt4 source code.
Modify arm-Linux-GCC to arm-softfloat-Linux-GCC, and then make.

4. Of course, you can use many tools to compile your program, such as qtcreator and kdevelop!

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.