移植Python3到TQ2440(二)
平台
正文
一、移植mtd-utils工具
- zlib-1.2.11
#!/bin/bash export CC=arm-linux-gcc ../configure --prefix=`pwd` \
--shared
然后编译make && make install
- lzo-2.10
#!/bin/bash ../configure --host=arm-linux \
CC="arm-linux-gcc" \
--prefix=`pwd`
然后编译make && make install
- e2fsprogs-1.43.4
#!/bin/bash ../configure --host=arm-linux \
CC="arm-linux-gcc" \
--prefix=`pwd`
编译 make && make install
- mtd-utils
( pengdl@ubuntu | ~/Study/tq2440/MTD_UTILS/mtd-utils-v2 | Remote:True )
$./autogen.sh ( pengdl@ubuntu | ~/Study/tq2440/MTD_UTILS/mtd-utils-v2 | Remote:True Ret: @ :: )
$cd build_tq2440/ ( pengdl@ubuntu | ~/Study/tq2440/MTD_UTILS/mtd-utils-v2/build_tq2440 | Remote:True )
$./mk.sh
编译脚本:
#!/bin/bash export CC=arm-linux-gcc
export PKG_CONFIG_PATH=$PKG_CONFIG_PATH:/home/pengdl/Study/tq2440/MTD_UTILS/e2fsprogs-1.43./build_tq2440/lib/uuid ../configure --host=arm-linux \
--prefix=`pwd` \
LDFLAGS="-L/home/pengdl/Study/tq2440/MTD_UTILS/zlib-1.2.11/build_tq2440/lib \
-L/home/pengdl/Study/tq2440/MTD_UTILS/lzo-2.10/build_tq2440/lib \
-L/home/pengdl/Study/tq2440/MTD_UTILS/e2fsprogs-1.43./build_tq2440/lib" \
CPPFLAGS="-I/home/pengdl/Study/tq2440/MTD_UTILS/zlib-1.2.11/build_tq2440/include \
-I/home/pengdl/Study/tq2440/MTD_UTILS/lzo-2.10/build_tq2440/include \
-I/home/pengdl/Study/tq2440/MTD_UTILS/e2fsprogs-1.43./build_tq2440/include" make -j4
make install
在sbin下面会生成我们需要的工具, 这里我们只要flash_eraseall和flash_erase两个工具, 将这两个工具拷贝到根文件系统的/bin下面。
二、固化根文件系统到NandFlash
sudo tar -czf rootfs.tar.gz rootfs
然后将rootfs.tar.gz拷贝到根文件系统下面,然后启动系统,烧写系统:
flash_eraseall /dev/mtd5
mount -t jffs2 /dev/mtdblock5 /mnt
tar -xf rootfs.tar.gz /mnt
cd /mnt
mv rootfs/* .
rm -r rootfs
然后修改uboot的bootargs参数:
noinitrd root=/dev/mtdblock5 rw rootfstype=jffs2 console=ttySAC0,115200n init=/linuxrc
三、支持telnet
四、开机log
U-Boot 2015.04-g5095150 (Dec - ::) CPUID:
FCLK: MHz
HCLK: MHz
PCLK: MHz
I2C: ready
DRAM: MiB
WARNING: Caches not enabled
Flash: Bytes
NAND: MiB
In: serial
Out: serial
Err: serial
Net: dm9000
Hit any key to stop autoboot: NAND read: device offset 0x300000, size 0x500000
bytes read: OK NAND read: device offset 0x800000, size 0x100000
bytes read: OK
## Booting kernel from Legacy Image at ...
Image Name: Linux-4.9.+
Created: -- :: UTC
Image Type: ARM Linux Kernel Image (uncompressed)
Data Size: Bytes = 3.3 MiB
Load Address:
Entry Point:
Verifying Checksum ... OK
## Flattened Device Tree blob at
Booting using the fdt blob at 0x32000000
Loading Kernel Image ... OK
Loading Device Tree to 33aa6000, end 33aaa62c ... OK Starting kernel ... Uncompressing Linux... done, booting the kernel.
[ 0.000000] Booting Linux on physical CPU 0x0
[ 0.000000] Linux version 4.9.+ (pengdl@ubuntu) (gcc version 4.8. (prerelease) (Sourcery CodeBench Lite 2014.05-) ) # Wed Apr :: PDT
[ 0.000000] CPU: ARM920T [] revision (ARMv4T), cr=c000717f
[ 0.000000] CPU: VIVT data cache, VIVT instruction cache
[ 0.000000] OF: fdt:Machine model: TQ2440
[ 0.000000] Memory policy: Data cache writeback
[ 0.000000] DT missing boot CPU MPIDR[:], fall back to default cpu_logical_map
[ 0.000000] Built zonelists in Zone order, mobility grouping on. Total pages:
[ 0.000000] Kernel command line: noinitrd root=/dev/mtdblock5 rw rootfstype=jffs2 console=ttySAC0,115200n init=/linuxrc
[ 0.000000] PID hash table entries: (order: -, bytes)
[ 0.000000] Dentry cache hash table entries: (order: , bytes)
[ 0.000000] Inode-cache hash table entries: (order: , bytes)
[ 0.000000] Memory: 57900K/65536K available (4729K kernel code, 234K rwdata, 1376K rodata, 204K init, 262K bss, 7636K reserved, 0K cma-reserved)
[ 0.000000] Virtual kernel memory layout:
[ 0.000000] vector : 0xffff0000 - 0xffff1000 ( kB)
[ 0.000000] fixmap : 0xffc00000 - 0xfff00000 ( kB)
[ 0.000000] vmalloc : 0xc4800000 - 0xff800000 ( MB)
[ 0.000000] lowmem : 0xc0000000 - 0xc4000000 ( MB)
[ 0.000000] modules : 0xbf000000 - 0xc0000000 ( MB)
[ 0.000000] .text : 0xc0008000 - 0xc04a67f0 ( kB)
[ 0.000000] .init : 0xc0627000 - 0xc065a000 ( kB)
[ 0.000000] .data : 0xc065a000 - 0xc0694840 ( kB)
[ 0.000000] .bss : 0xc0694840 - 0xc06d60a8 ( kB)
[ 0.000000] SLUB: HWalign=, Order=-, MinObjects=, CPUs=, Nodes=
[ 0.000000] NR_IRQS:
[ 0.000000] irq: clearing pending status
[ 0.000000] _get_rate: could not find clock xti
[ 0.000128] sched_clock: bits at 1000kHz, resolution 1000ns, wraps every 32767500ns
[ 0.000262] clocksource: samsung_clocksource_timer: mask: 0xffff max_cycles: 0xffff, max_idle_ns: ns
[ 0.001283] Console: colour dummy device 80x30
[ 0.001485] Calibrating delay loop... 199.47 BogoMIPS (lpj=)
[ 0.035125] pid_max: default: minimum:
[ 0.035715] Mount-cache hash table entries: (order: , bytes)
[ 0.035803] Mountpoint-cache hash table entries: (order: , bytes)
[ 0.039125] CPU: Testing write buffer coherency: ok
[ 0.041713] Setting up static identity map for 0x30008200 - 0x30008258
[ 0.067192] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: ns
[ 0.067812] pinctrl core: initialized pinctrl subsystem
[ 0.071047] NET: Registered protocol family
[ 0.074165] DMA: preallocated KiB pool for atomic coherent allocations
[ 0.096405] cpuidle: using governor ladder
[ 0.097029] No ATAGs?
[ 0.355694] SCSI subsystem initialized
[ 0.357161] usbcore: registered new interface driver usbfs
[ 0.357830] usbcore: registered new interface driver hub
[ 0.358518] usbcore: registered new device driver usb
[ 0.362268] Advanced Linux Sound Architecture Driver Initialized.
[ 0.393373] clocksource: Switched to clocksource samsung_clocksource_timer
[ 0.460629] NET: Registered protocol family
[ 0.464553] TCP established hash table entries: (order: , bytes)
[ 0.464669] TCP bind hash table entries: (order: , bytes)
[ 0.464723] TCP: Hash tables configured (established bind )
[ 0.465667] UDP hash table entries: (order: , bytes)
[ 0.465778] UDP-Lite hash table entries: (order: , bytes)
[ 0.466911] NET: Registered protocol family
[ 0.545633] RPC: Registered named UNIX socket transport module.
[ 0.545741] RPC: Registered udp transport module.
[ 0.545757] RPC: Registered tcp transport module.
[ 0.545773] RPC: Registered tcp NFSv4. backchannel transport module.
[ 0.553953] futex hash table entries: (order: -, bytes)
[ 0.562980] workingset: timestamp_bits= max_order= bucket_order=
[ 0.697643] NFS: Registering the id_resolver key type
[ 0.697875] Key type id_resolver registered
[ 0.697912] Key type id_legacy registered
[ 0.697998] nfs4filelayout_init: NFSv4 File Layout Driver Registering...
[ 0.698281] jffs2: version 2.2. (NAND) © - Red Hat, Inc.
[ 0.707965] romfs: ROMFS MTD (C) Red Hat, Inc.
[ 0.728928] io scheduler noop registered
[ 0.729037] io scheduler deadline registered
[ 0.731029] io scheduler cfq registered (default)
[ 0.945571] .serial: ttySAC0 at MMIO 0x50000000 (irq = , base_baud = ) is a S3C2440
[ 1.303277] random: fast init done
[ 1.537741] console [ttySAC0] enabled
[ 1.693858] brd: module loaded
[ 1.698712] s3c24xx-nand 4e000000.nand: Tacls=, 10ns Twrph0= 30ns, Twrph1= 10ns
[ 1.701109] s3c24xx-nand 4e000000.nand: NAND ECC disabled
[ 1.706441] nand: device found, Manufacturer ID: 0xec, Chip ID: 0xda
[ 1.712658] nand: Samsung NAND 256MiB ,3V -bit
[ 1.717150] nand: MiB, SLC, erase size: KiB, page size: , OOB size:
[ 1.724707] nand: NAND_ECC_NONE selected by board driver. This is not recommended!
[ 1.732301] Scanning device for bad blocks
[ 1.761552] Bad eraseblock at 0x000002d80000
[ 1.761944] Bad eraseblock at 0x000002e20000
[ 1.774618] Bad eraseblock at 0x0000045c0000
[ 1.810576] Bad eraseblock at 0x00000a160000
[ 1.835265] Bad eraseblock at 0x00000e000000
[ 1.835424] Bad eraseblock at 0x00000e020000
[ 1.851744] Creating MTD partitions on "tq2440-0":
[ 1.851909] 0x000000000000-0x000000100000 : "SPL"
[ 1.860632] ftl_cs: FTL header not found.
[ 1.867840] 0x000000100000-0x000000200000 : "U-BOOT"
[ 1.876060] ftl_cs: FTL header not found.
[ 1.881673] 0x000000200000-0x000000300000 : "PARAMS"
[ 1.887146] ftl_cs: FTL header not found.
[ 1.895758] 0x000000300000-0x000000800000 : "KERNEL"
[ 1.904875] ftl_cs: FTL header not found.
[ 1.910723] 0x000000800000-0x000000900000 : "DTB"
[ 1.916009] ftl_cs: FTL header not found.
[ 1.925445] 0x000000900000-0x000010000000 : "ROOTFS"
[ 1.937184] ftl_cs: FTL header not found.
[ 1.949791] eth0: dm9000e at c4932000,c4934004 IRQ MAC: ::de:ad:be:ef (platform data)
[ 1.953206] ohci_hcd: USB 1.1 'Open' Host Controller (OHCI) Driver
[ 1.959146] ohci-s3c2410: OHCI S3C2410 driver
[ 1.966554] s3c2410-ohci .usb_ohci: OHCI Host Controller
[ 1.969213] s3c2410-ohci .usb_ohci: new USB bus registered, assigned bus number
[ 1.978389] s3c2410-ohci .usb_ohci: irq , io mem 0x49000000
[ 2.049314] hub -:1.0: USB hub found
[ 2.051489] hub -:1.0: ports detected
[ 2.057806] usbcore: registered new interface driver usb-storage
[ 2.060801] mousedev: PS/ mouse device common for all mice
[ 2.066162] s3c-rtc .rtc: rtc disabled, re-enabling
[ 2.070382] rtc rtc0: alarm rollover not handled
[ 2.073906] rtc rtc0: invalid alarm value: -- ::
[ 2.080535] s3c-rtc .rtc: rtc core: registered s3c as rtc0
[ 2.086568] i2c /dev entries driver
[ 2.093037] s3c2410-wdt .watchdog: watchdog inactive, reset disabled, irq disabled
[ 2.099750] sdhci: Secure Digital Host Controller Interface driver
[ 2.103179] sdhci: Copyright(c) Pierre Ossman
[ 2.110337] hidraw: raw HID events driver (C) Jiri Kosina
[ 2.122224] usbcore: registered new interface driver usbhid
[ 2.122350] usbhid: USB HID core driver
[ 2.131286] NET: Registered protocol family
[ 2.132068] Key type dns_resolver registered
[ 2.197106] s3c-rtc .rtc: setting system clock to -- :: UTC ()
[ 2.201017] ALSA device list:
[ 2.203000] No soundcards found.
[ 8.385039] VFS: Mounted root (jffs2 filesystem) on device :.
[ 8.386953] Freeing unused kernel memory: 204K (c0627000 - c065a000)
[ 8.392017] This architecture does not have kernel memory protection.
[ 11.614549] dm9000 .ethernet eth0: link up, 100Mbps, full-duplex, lpa 0xCDE1 Please press Enter to activate this console.
[root@tq2440 ]#
[root@tq2440 ]# mount
/dev/root on / type jffs2 (rw,relatime)
proc on /proc type proc (rw,relatime)
tmpfs on /tmp type tmpfs (rw,relatime)
sysfs on /sys type sysfs (rw,relatime)
tmpfs on /dev type tmpfs (rw,relatime)
debugfs on /sys/kernel/debug type debugfs (rw,relatime)
devpts on /dev/pts type devpts (rw,relatime,mode=,ptmxmode=)
[root@tq2440 ]# cat /proc/mtd
dev: size erasesize name
mtd0: "SPL"
mtd1: "U-BOOT"
mtd2: "PARAMS"
mtd3: "KERNEL"
mtd4: "DTB"
mtd5: 0f700000 "ROOTFS"
[root@tq2440 ]#
移植Python3到TQ2440(二)的更多相关文章
- 移植Python3到TQ2440(一)
平台 硬件:TQ2440 64MB内存 256MB NandFlash bootloader:U-Boot 2015.04 kernel:linux-4.9 Python: Python-3.6.0 ...
- 移植Python2到TQ2440
环境 Python:2.7.13 开发板: TQ2440 工具链: arm-none-linux-gnueabi-gcc 4.8.3 概述 前面已经把Python3移植到TQ2440上面的,现在我们移 ...
- windows使用python3.4生成二维码
1.首先下载qrcode库 使用pip命令: pip install qrcode python3.x以上的版本默认是安装好pip的,如果出现无法找到pip指令的信息的话,则需要首先安装pip. 2. ...
- UCOS2_STM32F1移植详细过程(二)
Ⅰ.概述 打开上一篇文章新建的工程,是提取的ST标准库里面源代码文件和UCOS工程包源代码文件.下载过的朋友可能会知道,直接编译那个工程会有大片的错误和警告,原因在于那个工程是没有经过修改源代码的工程 ...
- python3 基础语法(二)
一.python3的基本数据类型: 和其他语言一样都包含了以下数据类型: 类型 含义 实例 INT 整型(integer) 1 FLOAT 浮点型 1.1 BOOL 布尔值 TRUE/FALSE ST ...
- Python3安装(二)
因为Python是跨平台的,它可以运行在Windows.Mac和各种Linux/Unix系统上.在Windows上写Python程序,放到Linux上也是能够运行的. 要开始学习Python编程,首先 ...
- 【Mac + Appium + Python3.6学习(二)】之Android自动化测试,appium-desktop配置和简易自动化测试脚本
上一篇文章介绍安装appium测试环境,这一片研究介绍如何测试Android自动化. 上一篇地址:<[Mac + Appium学习(一)]之安装Appium环境> 这一篇参考:<Ma ...
- python3编程技巧二——如何在列表、字典、集合 中根据条件筛选数据
一.列表筛选数据 # coding=utf-8 from random import randint # 创建随机列表 l = [randint(-10, 10) for i in range(10) ...
- 从零开始之uboot、移植uboot2017.01(二、从入口分析流程)
原创: To_run_away 从零开始学linux 本节的开始之前,先看一下uboot的链接脚本. 一.链接脚本 /* * Copyright (c) 2004-2008 Texas Instrum ...
随机推荐
- poj2709
模拟题,在合成灰色的时候,每次取当前剩余最多的三种颜色,各取1mL合成.然后重新看剩余最多的是哪三个. #include <cstdio> #include <cstdlib> ...
- 【hadoop】har://
来源:http://hadoop.apache.org/docs/r1.0.4/cn/hadoop_archives.html 在hadoop代码中发现了一个很奇怪的路径,由har://开头.经查询, ...
- Java编程的逻辑 (2) - 赋值
本系列文章经补充和完善,已修订整理成书<Java编程的逻辑>,由机械工业出版社华章分社出版,于2018年1月上市热销,读者好评如潮!各大网店和书店有售,欢迎购买,京东自营链接:http:/ ...
- Java第三阶段学习(六、多线程)
一.进程和线程的区别: 进程:指正在运行的程序,当一个程序进入内存运行,就变成一个进程. 线程:线程是进程的一个执行单元. 总结:一个程序运行后至少会有一个进程,一个进程可以有多个线程. 多线程:多线 ...
- Storm程序的并发机制(重点掌握)
概念 Workers (JVMs): 在一个物理节点上可以运行一个或多个独立的JVM 进程.一个Topology可以包含一个或多个worker(并行的跑在不同的物理机上), 所以worker proc ...
- nginx 添加https 配置
#user nobody;worker_processes 1; #error_log logs/error.log;#error_log logs/error.log notice;#error_l ...
- 002.NTP服务端搭建
一 安装及准备 1.1 安装NTP [root@server ~]# yum -y install ntp #也可下载之后rpm安装,或者源码安装 1.2 NTP服务地址 http://www.ntp ...
- Linux云服务器下Redis安装与部署以及设置redis后台运行
Redis下载: http://redis.io/download 我下载的4.0.11 上传到服务器 注: 官方的建议是直接在linux下载并解压编译 这里不建议先解压再上传到服务器,之前我这样做, ...
- 立FLAG-书单
立FLAG-书单 ### 懒散的文字懒散的我 总是自以为是个爱读书的人,但是总是懒懒散散,书读一点就放下了,导致了两个月前就已经说是要计划看望的<林徽因传>到现在还剩着一小半没看完.想着, ...
- View初探
View初探 学习自 <Android开发艺术探索> View漫谈 Activity构成了我们的界面但是知识一个空壳子,Activity与View相结合才构成了我们丰富多彩的界面,并且为了 ...