L137从usb设备启动

 

USB pendrive procedure

For the USB pendrive you should create two partitions:

  • a FAT16 that contains the Linux kernel file uImage
  • a ext2 that contains the entire Linux filesystem
sudo /sbin/parted /dev/sda mkpartfs primary fat16 0 30M mkpartfs primary ext2 31M 2048M

If the Linux distribution has an automount feature, after running this command additional icons in your desktop and (maybe) file browser screens should appear in the screen. If it does not have the automount feature, the partition(s) must be mounted manually in a previously created directory (the example below assumes disk and disk-1).

mount -t vfat /dev/sda1 /media/disk
mount -t ext2 /dev/sda2 /media/disk-1

Copy the target filesystem to the ext2 partition.

sudo cp -Rf /home/<useracct>/workdir/filesys /media/disk-1

The <useracct> is your login.

Copy the Linux kernel file uImage to the first partition

  • If using the default Linux kernel provided with the installation:
sudo cp /opt/OMAPL137_arm_1_00_00_07/REL_LSP_02_20_00_05/PSP_02_20_00_05/bin/uImage /media/disk
  • If using a compiled Linux kernel: (sections 4.2 and 5.3 of <LSP_02.20_OMAP-L137_User_Guide.pdf> and the errata at this page)
sudo cp <lsp_install_dir>/montavista/pro/devkit/lsp/ti-davinci/linux-2.6.18_pro500/arch/arm/boot/uImage /media/disk

Similarly to the MMC/SD case, all modules should be properly copied onto the target filesystem.

  • If using the default Linux kernel provided with the installation:
sudo cp -Rf /opt/OMAPL137_arm_1_00_00_07/REL_LSP_02_20_00_05/PSP_02_20_00_05/bin/kernel_modules/* /media/disk-1

Or if using a compiled Linux kernel the modules can be installed directly to the target filesystem (section 5.3 of <LSP_02.20_OMAP-L137_User_Guide.pdf>):

make modules modules_install INSTALL_MOD_PATH=/media/disk-1 ARCH=arm CROSS_COMPILE=arm_v5t_le-
-----------------------------------------------------------------------------------------

The script below works with an USB pendrive that should meet the requirements below. Check the <LSP_02.20_OMAP-L137_User_Guide.pdf> and this topic for additional details.

  • U-boot must be rebuilt with USB support enabled.
  • The 2GB USB pendrive must be connected to USB0 only and contain two partitions:
    • the first partition must be of type FAT16 or FAT32 and contains the uImage (Linux Kernel) file in the root directory
    • the second partition must be of type ext2 or ext3 and contains the target filesystem (the same contents of /home/<useracct>/workdir/filesys)
; Keep the VT window open while executing macro
showtt 1
 
; Set the synchronous mode
setsync 1
 
; needed because of the slower operations usb start and fatload
PromptUboot = 'U-Boot > '
 
; Set the title to make easier identification between boards
settitle 'OMAPL137'
 
; check if USB is alive and which devices are on
sendln 'usb start'
wait PromptUboot
 
; load the kernel image to memory
sendln 'fatload usb 0:1 0xC0700000 uimage'
wait PromptUboot
 
; set kernel command line argument
sendln 'setenv bootargs console=ttyS2,115200n8 noinitrd rw ip=dhcp root=/dev/sda2 rootfstype=ext2 mem=32M' ;USB BOOT
 
; choose kernel image file name 
sendln 'setenv bootfile uImage'
 
; boot the board!
sendln 'bootm'
 
; end of macro file

Note: The command usb start sometimes hangs on the message scanning bus for storage devices.... If this happens to you, stop the macro from executing, reset the board and reload the script file.

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值