明远智睿技术论坛

 找回密码
 立即注册
搜索
查看: 2265|回复: 6

用buildroot编译文件系统 (MYZR-IMX6-EK200)

[复制链接]

22

主题

677

帖子

2175

积分

管理员

Rank: 9Rank: 9Rank: 9

积分
2175
发表于 2018-5-16 15:53:57 | 显示全部楼层 |阅读模式
主机平台: UBUNTU14.04
硬件平台:明远智睿MY-IMX6-EK200
编译器:      gcc-linaro-arm-linux-gnueabihf-4.9-2014.09_linux.tar.xz
buildroot版本:buildroot-2017.02.5.tar.bz2

1.解压
$ mkdir ~/IMX6/
$ tar xvf ~/IMX6/gcc-linaro-arm-linux-gnueabihf-4.9-2014.09_linux.tar.xz

$ mkdir ~/buildroot
$ cd ~/buildroot
$ tar jxvf  buildroot-2017.02.5.tar.bz2
$ cd buildroot-2017.02.5/

2.配置
$ make imx6q-sabresd_defconfig
$ make menuconfig

采用外部编译器gcc-linaro-arm-linux-gnueabihf-4.9-2014.09_linux.tar.xz
Toolchain--->
设置Toolchain type为External toolchain
Toolchain为Custom toolchain
Toolchain path为/home/linyn/IMX6/gcc-linaro-arm-linux-gnueabihf-4.9-2014.09_linux/
选择【*】Toolchain has C++ support?

主要注意External toolchain kernel headers series (3.1.x)这个选项的设置,选择编译工具的内核版本号,文件
   ~/IMX6/gcc-linaro-arm-linux-gnueabihf-4.9-2014.09_linux/arm-linux-gnueabihf/libc/usr/include/linux/version.h
    保存有版本号(每个编译工具都有这个文件的),是十进制的,把它转换成16进制就可以看出来版本号是多少,如我的version.h是这样
   #define LINUX_VERSION_CODE 196865
    #define KERNEL_VERSION(a,b,c) (((a) << 16) + ((b) << 8) + (c))
    196609版本的16进制是0x30101,那版本号就是3.01.01,就是3.0.1了,所以这里选3.1.x
看图片“配置1”

System configuration--->
(myzr) System hostname  设置主机名
/dev management (Dynamic using devtmpfs + mdev)   kernel配置支持medv,系统也配置mdev
Run a getty (login prompt) after boot --->
(ttymxc0) TTY port               设置登陆串口
         Baudrate (115200)  --->       波特率

不编译kernel
Kernel--->
[] Linux Kernel  不选

不编译U-BOOT
Bootloaders --->
[] U-Boot          不选

$ make -j4              //用4个线程编译
结果看产生output/images/rootfs.tar
看图片“结果1”和“结果2”(结果2是没编译kernel报的错误不管)

最后修改一下rootfs里面的

vim etc/issue
Welcome to MY-IMX6-EK200

vim etc/profile

if [ "$PS1" ]; then
        if [ "`id -u`" -eq 0 ]; then
         export PS1='\u@\h:\w\# '
        else
         export PS1='\u@\h:\w\$ '
        fi
fi

最后压缩烧写进去,用root登陆,默认没密码
VFS: Mounted root (ext3 filesystem) on device 179:2.
devtmpfs: mounted
Freeing unused kernel memory: 396K (809c6000 - 80a29000)
Starting logging: OK
Starting mdev...
Initializing random number generator... random: dd urandom read with 47 bits of entropy available
done.
Starting network: OK
Welcome to MY-IMX6-EK200
myzr login: root
root@myzr:~#
root@myzr:~#
root@myzr:~# ls
root@myzr:~# ls /
bin         lib         lost+found  opt         run         tmp
dev         lib32       media       proc        sbin        usr
etc         linuxrc     mnt         root        sys         var
看图片“登陆”




本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有帐号?立即注册

x
回复

使用道具 举报

0

主题

2

帖子

22

积分

新手上路

Rank: 1

积分
22
发表于 2018-5-29 17:31:51 | 显示全部楼层
您好,我没有找到buildroot这个文件夹
回复 支持 反对

使用道具 举报

0

主题

2

帖子

22

积分

新手上路

Rank: 1

积分
22
发表于 2018-5-30 10:52:36 | 显示全部楼层
utp_poll: pass returned.
UTP: received command '$ sh /mnt/myzr_rtfs_cfg.sh /mnt/mmcblkxp2 myimx6ek200 distro-core-image-base.tar.bz2 normal'
UTP: executing "sh /mnt/myzr_rtfs_cfg.sh /mnt/mmcblkxp2 myimx6ek200 distro-core-image-base.tar.bz2 normal"
distro-core-image-base.tar.bz2
normal
cp: cannot create regular file '/mnt/mmcblkxp2/etc/rc2.d/': Not a directory
cp: cannot create regular file '/mnt/mmcblkxp2/etc/rc3.d/': Not a directory
cp: cannot create regular file '/mnt/mmcblkxp2/etc/rc4.d/': Not a directory
cp: cannot create regular file '/mnt/mmcblkxp2/etc/rc5.d/': Not a directory
UTP: sending Success to kernel for command $ sh /mnt/myzr_rtfs_cfg.sh /mnt/mmcblkxp2 myimx6ek200 distro-core-image-base.tar.bz2 normal.
utp_poll: pass returned.
UTP: received command 'frf'
UTP: sending Success to kernel for command frf.
utp_poll: pass returned.
UTP: received command 'pipe tar -jxv -C /mnt/mmcblkxp2'
pid is 131, UTP: executing "tar -jxv -C /mnt/mmcblkxp2"
UTP: sending Success to kernel for command pipe tar -jxv -C /mnt/mmcblkxp2.
UTP: received command 'frf'
etc/
etc/pointercal_myimx6ek140
etc/init.d/
etc/init.d/myzr
etc/myzr.d/
etc/myzr.d/myzr_welcome
etc/myzr.d/myimx6ek140_qt4_init
lib/
lib/firmware/
lib/firmware/iwlwifi-4965-2.ucode
UTP: closing the file
UTP: sending Success to kernel for command frf.
utp_poll: pass returned.
UTP: received command 'pipe tar -jxv -C /mnt/mmcblkxp2/home/root'
pid is 133, UTP: executing "tar -jxv -C /mnt/mmcblkxp2/home/root"
UTP: sending Success to kernel for command pipe tar -jxv -C /mnt/mmcblkxp2/home/root.
tar: can't change directory to '/mnt/mmcblkxp2/home/root': No such file or directory
Kernel panic - not syncing: Attempted to kill init! exitcode=0x00008d00

CPU2: stopping
CPU: 2 PID: 0 Comm: swapper/2 Not tainted 3.14.52 #8
[<80014adc>] (unwind_backtrace) from [<800117fc>] (show_stack+0x10/0x14)
[<800117fc>] (show_stack) from [<80655c18>] (dump_stack+0x7c/0xbc)
[<80655c18>] (dump_stack) from [<80013a80>] (handle_IPI+0x144/0x158)
[<80013a80>] (handle_IPI) from [<800085a0>] (gic_handle_irq+0x58/0x5c)
[<800085a0>] (gic_handle_irq) from [<800122c0>] (__irq_svc+0x40/0x70)
Exception stack(0xa80abf50 to 0xa80abf98)
bf40:                                     a80abf98 3b9aca00 d375b030 0000001c
bf60: d3106a68 0000001c ab7340d0 00000001 00000001 ab7340d4 a80aa000 00000000
bf80: 0000007b a80abf98 fffffff7 8046a44c 000c0013 ffffffff
[<800122c0>] (__irq_svc) from [<8046a44c>] (cpuidle_enter_state+0x58/0xec)
[<8046a44c>] (cpuidle_enter_state) from [<8046a5e4>] (cpuidle_idle_call+0x104/0x158)
[<8046a5e4>] (cpuidle_idle_call) from [<8000f0fc>] (arch_cpu_idle+0x8/0x44)
[<8000f0fc>] (arch_cpu_idle) from [<8006c968>] (cpu_startup_entry+0x100/0x14c)
[<8006c968>] (cpu_startup_entry) from [<10008644>] (0x10008644)
CPU3: stopping
CPU: 3 PID: 0 Comm: swapper/3 Not tainted 3.14.52 #8
[<80014adc>] (unwind_backtrace) from [<800117fc>] (show_stack+0x10/0x14)
[<800117fc>] (show_stack) from [<80655c18>] (dump_stack+0x7c/0xbc)
[<80655c18>] (dump_stack) from [<80013a80>] (handle_IPI+0x144/0x158)
[<80013a80>] (handle_IPI) from [<800085a0>] (gic_handle_irq+0x58/0x5c)
[<800085a0>] (gic_handle_irq) from [<800122c0>] (__irq_svc+0x40/0x70)
Exception stack(0xa80adf50 to 0xa80adf98)
df40:                                     a80adf98 3b9aca00 d375aee3 0000001c
df60: d30feeb5 0000001c ab73c0d0 00000001 00000001 ab73c0d4 a80ac000 00000000
df80: 0000007b a80adf98 fffffff7 8046a44c 000c0013 ffffffff
[<800122c0>] (__irq_svc) from [<8046a44c>] (cpuidle_enter_state+0x58/0xec)
[<8046a44c>] (cpuidle_enter_state) from [<8046a5e4>] (cpuidle_idle_call+0x104/0x158)
[<8046a5e4>] (cpuidle_idle_call) from [<8000f0fc>] (arch_cpu_idle+0x8/0x44)
[<8000f0fc>] (arch_cpu_idle) from [<8006c968>] (cpu_startup_entry+0x100/0x14c)
[<8006c968>] (cpu_startup_entry) from [<10008644>] (0x10008644)
CPU1: stopping
CPU: 1 PID: 0 Comm: swapper/1 Not tainted 3.14.52 #8
[<80014adc>] (unwind_backtrace) from [<800117fc>] (show_stack+0x10/0x14)
[<800117fc>] (show_stack) from [<80655c18>] (dump_stack+0x7c/0xbc)
[<80655c18>] (dump_stack) from [<80013a80>] (handle_IPI+0x144/0x158)
[<80013a80>] (handle_IPI) from [<800085a0>] (gic_handle_irq+0x58/0x5c)
[<800085a0>] (gic_handle_irq) from [<800122c0>] (__irq_svc+0x40/0x70)
Exception stack(0xa80a9f50 to 0xa80a9f98)
9f40:                                     a80a9f98 3b9aca00 d375b030 0000001c
9f60: d30f7ad3 0000001c ab72c0d0 00000001 00000001 ab72c0d4 a80a8000 00000000
9f80: 0000007b a80a9f98 fffffff7 8046a44c 00080013 ffffffff
[<800122c0>] (__irq_svc) from [<8046a44c>] (cpuidle_enter_state+0x58/0xec)
[<8046a44c>] (cpuidle_enter_state) from [<8046a5e4>] (cpuidle_idle_call+0x104/0x158)
[<8046a5e4>] (cpuidle_idle_call) from [<8000f0fc>] (arch_cpu_idle+0x8/0x44)
[<8000f0fc>] (arch_cpu_idle) from [<8006c968>] (cpu_startup_entry+0x100/0x14c)
[<8006c968>] (cpu_startup_entry) from [<10008644>] (0x10008644)
------------[ cut here ]------------
WARNING: CPU: 0 PID: 1 at kernel/time/tick-broadcast.c:604 tick_handle_oneshot_broadcast+0x1ac/0x1c8()
Modules linked in:
CPU: 0 PID: 1 Comm: linuxrc Not tainted 3.14.52 #8
[<80014adc>] (unwind_backtrace) from [<800117fc>] (show_stack+0x10/0x14)
[<800117fc>] (show_stack) from [<80655c18>] (dump_stack+0x7c/0xbc)
[<80655c18>] (dump_stack) from [<80032518>] (warn_slowpath_common+0x6c/0x88)
[<80032518>] (warn_slowpath_common) from [<800325d0>] (warn_slowpath_null+0x1c/0x24)
[<800325d0>] (warn_slowpath_null) from [<8007fdb0>] (tick_handle_oneshot_broadcast+0x1ac/0x1c8)
[<8007fdb0>] (tick_handle_oneshot_broadcast) from [<8001dbfc>] (mxc_timer_interrupt+0x2c/0x34)
[<8001dbfc>] (mxc_timer_interrupt) from [<8006d26c>] (handle_irq_event_percpu+0x50/0x180)
[<8006d26c>] (handle_irq_event_percpu) from [<8006d3d8>] (handle_irq_event+0x3c/0x5c)
[<8006d3d8>] (handle_irq_event) from [<8007021c>] (handle_fasteoi_irq+0x84/0x14c)
[<8007021c>] (handle_fasteoi_irq) from [<8006c9f0>] (generic_handle_irq+0x2c/0x3c)
[<8006c9f0>] (generic_handle_irq) from [<8000edcc>] (handle_IRQ+0x40/0x90)
[<8000edcc>] (handle_IRQ) from [<80008574>] (gic_handle_irq+0x2c/0x5c)
[<80008574>] (gic_handle_irq) from [<800122c0>] (__irq_svc+0x40/0x70)
Exception stack(0xa8065df8 to 0xa8065e40)
5de0:                                                       00000000 00404104
5e00: 80977e80 00000000 00000282 00009458 0000e818 f4a00100 a8064000 809779f0
5e20: a8796038 00000000 800141ac a8065e40 8003652c 8003653c 200c0113 ffffffff
[<800122c0>] (__irq_svc) from [<8003653c>] (__do_softirq+0xc0/0x23c)
[<8003653c>] (__do_softirq) from [<80036978>] (irq_exit+0xb8/0xf4)
[<80036978>] (irq_exit) from [<8000edd0>] (handle_IRQ+0x44/0x90)
[<8000edd0>] (handle_IRQ) from [<80008574>] (gic_handle_irq+0x2c/0x5c)
[<80008574>] (gic_handle_irq) from [<800122c0>] (__irq_svc+0x40/0x70)
Exception stack(0xa8065ec8 to 0xa8065f10)
5ec0:                   00000001 00000000 00000001 00000000 809779f0 a8080000
5ee0: a8064000 00000000 00000000 809779f0 a8796038 00000000 00000000 a8065f10
5f00: 8006abcc 80653bc8 600c0013 ffffffff
[<800122c0>] (__irq_svc) from [<80653bc8>] (panic+0x160/0x1b8)
[<80653bc8>] (panic) from [<80033eb4>] (do_exit+0x8f8/0x92c)
[<80033eb4>] (do_exit) from [<80034bb0>] (do_group_exit+0x4c/0xb8)
[<80034bb0>] (do_group_exit) from [<80034c2c>] (__wake_up_parent+0x0/0x18)
---[ end trace 2b490100d0ea914d ]---
回复 支持 反对

使用道具 举报

22

主题

677

帖子

2175

积分

管理员

Rank: 9Rank: 9Rank: 9

积分
2175
 楼主| 发表于 2018-5-31 14:43:29 | 显示全部楼层
Cupid天空 发表于 2018-5-30 10:52
utp_poll: pass returned.
UTP: received command '$ sh /mnt/myzr_rtfs_cfg.sh /mnt/mmcblkxp2 myimx6ek20 ...

你好,只烧写我们编译的文件系统,其他的可以不烧写,应该是有一些目录没有
可以修改一下ucl2.xml文件只烧写文件系统,把其他的暂时屏蔽
        <!-- burn rootfs -->
        <CMD state="Updater" type="push" body="pipe tar -jxv -C /mnt/mmcblkxp2" file="image-linux-31452/%rootfs_l31452_file%">pipe: rootfs</CMD>
        <CMD state="Updater" type="push" body="frf">frf: rootfs</CMD>
        <CMD state="Updater" type="push" body="pipe tar -jxv -C /mnt/mmcblkxp2" file="image-linux-31452/kernel-modules-myimx6.tar.bz2" ifdev="MX6Q MX6D">pipe: kernel modules</CMD>
        <CMD state="Updater" type="push" body="pipe tar -jxv -C /mnt/mmcblkxp2" file="image-linux-31452/kernel-modules-myimx6g.tar.bz2" ifdev="MX6UL">pipe: kernel modules</CMD>
        <CMD state="Updater" type="push" body="frf">frf: kernel modules</CMD>
<!--        <CMD state="Updater" type="push" body="pipe tar -jxv -C /mnt" file="firmware-31452/myzr_rtfs_cfg.tar.bz2">pipe: rootfs config</CMD>
        <CMD state="Updater" type="push" body="frf">frf: rootfs config</CMD>
        <CMD state="Updater" type="push" body="$ sh /mnt/myzr_rtfs_cfg.sh /mnt/mmcblkxp2 %ek_name% %rootfs_l31452_file% normal">exec: rootfs config</CMD>
        <CMD state="Updater" type="push" body="frf">frf: rootfs config</CMD>
        <CMD state="Updater" type="push" body="pipe tar -jxv -C /mnt/mmcblkxp2" file="image-linux-31452/l31452_rtfs_update.tar.bz2">pipe: rootfs update</CMD>
        <CMD state="Updater" type="push" body="frf">frf: rootfs update</CMD>
        <CMD state="Updater" type="push" body="pipe tar -jxv -C /mnt/mmcblkxp2/home/root" file="image-linux-31452/my-demo.tar.bz2">pipe: myzr demo</CMD>
        <CMD state="Updater" type="push" body="frf">frf: myzr demo</CMD>
        <CMD state="Updater" type="push" body="pipe tar -jxv -C /mnt/mmcblkxp2/usr/local" file="image-linux-31452/Trolltech.tar.bz2" ifdev="MX6UL">pipe: QT package</CMD>
        <CMD state="Updater" type="push" body="$ mv /mnt/mmcblkxp2/usr/local/Trolltech/QtEmbedded-4.8.5-arm/lib/* /mnt/mmcblkxp2/lib/" ifdev="MX6UL">mv: QT lib</CMD>
        <CMD state="Updater" type="push" body="frf" ifdev="MX6UL">frf: QT package</CMD> -->
        <CMD state="Updater" type="push" body="$ umount /mnt/mmcblkxp2">exec: umount mmcblk</CMD>
       
        <CMD state="Updater" type="push" body="$ echo Update Complete!">Done</CMD>
回复 支持 反对

使用道具 举报

22

主题

677

帖子

2175

积分

管理员

Rank: 9Rank: 9Rank: 9

积分
2175
 楼主| 发表于 2018-5-31 14:44:50 | 显示全部楼层
Cupid天空 发表于 2018-5-29 17:31
您好,我没有找到buildroot这个文件夹

自己新建的
回复 支持 反对

使用道具 举报

1

主题

2

帖子

21

积分

新手上路

Rank: 1

积分
21
发表于 2019-5-6 14:05:45 | 显示全部楼层
采用buildroot方式构建文件系统,但是运行Qt程序时,需要登录才能运行。那怎么不登录,开机后就可以运行Qt?
回复 支持 反对

使用道具 举报

3

主题

14

帖子

58

积分

注册会员

Rank: 2

积分
58
发表于 2019-6-13 18:38:49 | 显示全部楼层
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

Archiver|手机版|小黑屋|明远智睿  

GMT+8, 2019-10-14 13:37 , Processed in 0.155156 second(s), 25 queries .

Powered by Discuz! X3.2

© 2001-2013 Comsenz Inc.

快速回复 返回顶部 返回列表