adding linux application to rootfs using LTIB

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

adding linux application to rootfs using LTIB

1,567 次查看
garimella
Contributor I

I am able to run a linux application on a custom MPC83x board using TFTP. I need to boot this application at start up which means storing in flash.

a)How should I add the application (say ./hello) in rootfile system using LTIB?

b) What is the method to invoke this application to run at startup?.

Searched many forums, but without pointed answers. A definitive guide would be helpful.

0 项奖励
回复
2 回复数

1,379 次查看
Pavel
NXP Employee
NXP Employee

Use the following command sequence for adding file to RAM disk image.

  1. rename your RAM disk image to rootfs.ext2.gz.uboot
  2. sudo apt-get install u-boot-tools

Following are the steps for adding files into rootfilesystem:

 

  1. dd if=rootfs.ext2.gz.uboot of=rootfs.ext2.gz bs=64 skip=1

 

  1. gunzip rootfs.ext2.gz

 

  1. mkdir /mnt/iso_1

 

  1. sudo mount -oloop rootfs.ext2 /mnt/iso_1

 

  1. Now, one can copy files into appropriate location under “./mnt/iso_1” directory.

 

  1. sudo umount /mnt/iso_1

 

  1. gzip -9 rootfs.ext2

 

  1. mkimage -A ppc -O linux -T ramdisk -C gzip -n 'rootfs.ext2.gz.uboot' -d rootfs.ext2.gz rootfs.ext2.gz.uboot

 

See also the following pages:

http://www.tldp.org/HOWTO/HighQuality-Apps-HOWTO/boot.html

 

and

 

https://stackoverflow.com/questions/7221757/run-automatically-program-on-startup-under-linux-ubuntu


Have a great day,
Pavel Chubakov

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 项奖励
回复

1,379 次查看
garimella
Contributor I

Hi Pavel,

I was asking the same process through LTIB. I just saw hello listed is LTIB-c. Just want to similarly add my custom application such that it appears in LTIB -c to generate rootfs.

For auto start up, I went through the link sent by you. It says to add our applications at init.d. But during run time, this init.d resides in RAM. How do we store this in flash in the first place?. It is a novice question.

0 项奖励
回复