日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 运维知识 > linux >内容正文

linux

am3352 linux 内核 编译,am335x uboot, kernel 编译

發布時間:2025/3/11 linux 23 豆豆
生活随笔 收集整理的這篇文章主要介紹了 am3352 linux 内核 编译,am335x uboot, kernel 编译 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

一、設置環境變量

// 寫在家目錄下面的 .bashrc 里面

export KERNEL_PATH=~/aplex/kernel3.2.0 // kernel 路徑

export UBOOT_PATH=~/aplex/uboot2011.09 // u-boot 路勁

export ROOTFS_PATH=~/aplex/filesystem

export TOOLFS_PATH=~/aplex/tools

export ARCH=arm // 設置平臺類型

export CROSS_COMPILE=arm-linux-gnueabihf- // 設置交叉編譯器前綴

export PATH=$PATH:~/aplex/gcc-linaro-arm-linux-gnueabihf-4.7-2013.03-20130313_linux/bin // 配置交叉編譯器加入環境變量

export APLEX_PATH=~/image

二、 u-boot 編譯

cd $UBOOT_PATH

make O=out ok335x

// 編譯完成之后你會在 out 目錄下找到 MLO 以及 u-boot.img, 將這兩個文件放在 等下制作好的 SD 卡boot 分區下

三、 kernel 編譯

cd $KERNEL_PATH

make aplex_defconfig

make uImage -j4

// 編譯完成之后會在 arch/arm/boot/ 下面生成 uImage 文件, 等下也將這個文件放在 SD 卡 boot 分區下

四、文件系統生成

cd $ROOTFS_PATH

mkubiimg.sh

// mkubiimg.sh 是生成 ubi 文件系統的腳本

// 工具的安裝請參考 : http://www.cnblogs.com/chenfulin5/p/7975633.html

// ubi 文件系統的制作請參考: http://www.cnblogs.com/chenfulin5/p/8024016.html

mkubiimg.sh 腳本如下:

sudo mkfs.ubifs -q -r rootfs_v2 -m 2048 -e 126976 -c 4040 -o ubifs.img -F #制做 rootfs_v2 目錄下面的文件系統為 ubifs.img

echo mkfs.ubifs over!

sudo ubinize -o ubi.img -m 2048 -p 128KiB ubinize.cfg # 壓縮 ubifs.img 為 ubi.img

echo ubinize over!

sync

cp ubi.img $APLEX_PATH -rf # 將ubi.img 拷貝到 ~/image 下面

echo make file system ok !

五、SD 的制作

將 SD 卡插入電腦, 如下操作

![](http://images2017.cnblogs.com/blog/991711/201801/991711-20180115174107084-7846262.png)

sudo fdisk /dev/sdc # sdc 是 SD卡的節點

Command (m for help): d # 刪除分區

Selected partition 1 # 刪除第一個分區

Command (m for help): n # 添加分區

Partition type:

p primary (0 primary, 0 extended, 4 free)

e extended

Select (default p): p # 主分區

Partition number (1-4, default 1): 1 # 第一個分區

First sector (2048-15126527, default 2048):

Using default value 2048

Last sector, +sectors or +size{K,M,G} (2048-15126527, default 15126527):

Using default value 15126527

Command (m for help): t # 改變分區格式

Selected partition 1

Hex code (type L to list codes): e # 選擇FAT16格式

Changed system type of partition 1 to e (W95 FAT16 (LBA))

Command (m for help): a # 設置為 boot 分區

Partition number (1-4): 1

Command (m for help): p # 顯示

Disk /dev/sdc: 7744 MB, 7744782336 bytes

32 heads, 12 sectors/track, 39392 cylinders, total 15126528 sectors

Units = sectors of 1 * 512 = 512 bytes

Sector size (logical/physical): 512 bytes / 512 bytes

I/O size (minimum/optimal): 512 bytes / 512 bytes

Disk identifier: 0x5fb59036

Device Boot Start End Blocks Id System

/dev/sdc1 * 2048 15126527 7562240 e W95 FAT16 (LBA)

Command (m for help): w # 保存

mkfs.vfat -n "boot" -F 16 /dev/sdc1

六、最后將上述文件放到 /dev/sdc1

sudo mount /dev/sdc1 /mnt

cp u-boot.img MLO uImage ubi.img /mnt -rf

sync

sudo umount /mnt

總結

以上是生活随笔為你收集整理的am3352 linux 内核 编译,am335x uboot, kernel 编译的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。