知识点
相关文章
更多最近更新
更多Create a Bootable MicroSD Card
2019-03-02 23:55|来源: 网路
http://gumstix.org/create-a-bootable-microsd-card.html
Create a Bootable MicroSD Card
Beginners
Note: The following instructions are intended for experienced Gumstix users. Beginners are recommended to use Linaro or Sakoman's daily GNOME builds.
Supported MMC/SD Cards
Gumstix DuoVero COMs and Overo COMs "support MMC/SD cards compliant with the Multimedia Card System Specification v4.2 from the MMCA Technical Committee and the SD I/O Card Specification v2.0 from the SD Association. Includes high-capacity (size >2GB) cards: HC-SD and HC MMC", as per the Texas Instruments OMAP specification. (added Feb 6 2012)
Setup
First, insert your microSd card into the development machine's flash card slot. You may need to use a microSD to SD card adapter or a USB card reader. Use the mount or df commands to determine the device name of SD card. Names such as /dev/mmcblk0p1 or /dev/sde1 are typical; /dev/sda is usually your computer's hard drive so be sure not to use this. A 2GB SD available at /dev/mmcblk0 is used as an example for this procedure; you'll need to adjust the commands to match your card. Unmount any mounted partitions of the attached device e.g.
$ sudo umount /dev/mmcblk0p1
Partitions versus Drives
In Linux, a physical block device such as a hard drive or an SD card appears in the '/dev' directory e.g. /dev/hda, /dev/sr0, or /dev/mmcblk1. This device file refers to the **whole** physical device. A single physical device can contain multiple individual partitions each with their own file system. These partitions also appear in the '/dev' directory under the same name but include a suffix e.g. /dev/mmcblk1p0 (partition #0 of physical device 'mmcblk1), /dev/sdf1 (partition #1 of physical device 'sdf'). Linux makes the file systems on these partitions available by 'mounting' them to a directory in the existing file system. For removable devices, such 'mount points' are traditionally found in the '/mnt' or '/media' directories.
Calculate Card Size
A special geometry is required to make best use of the underlying SD card memory and for data to be accessible by the DuoVero or Overo boot ROM. Calculate the required number of 'cylinders' for your particular card. Find the card size in first line of the response to this command:
$ sudo fdisk -l /dev/mmcblk0 Disk /dev/mmcblk0: 2016 MB, 2016411648 bytes
Divide the card size in bytes by 255 heads, 63 sectors and 512 bytes per sector and round down to the nearest integer. E.g. 2016411648/255/63/512 = 245.15 --> 245 cylinders.
Partition the Card
Gumstix COMs require at least two partitions: a FAT partition containing files needed to boot and a Linux partition on which the root file system for the operating system is stored. To start, we clean up any existing partition data e.g.
$ sudo dd if=/dev/zero of=/dev/mmcblk0 bs=1024 count=1024
The sfdisk tools can perform the required partitioning e.g.
$ sudo sfdisk --force -D -uS -H 255 -S 63 -C 245 /dev/mmcblk0
where the value of the -C parameter is the number of cylinders calculated in previous step. At the sfdisk, type 128,130944,0x0C,* and then press to set up a 64MB bootable FAT partition. Next, type 131072,,,- and press three more times to create the Linux partition and complete the partition table. When prompted to write this new partition table, type y to accept. An example session looks like this:
Checking that no-one is using this disk right now ... OK [snip] Input in the following format; absent fields get a default value. Usually you only need to specify and (and perhaps ). /dev/mmcblk0p1 :128,130944,0x0C,* /dev/mmcblk0p1 * 128 131071 130944 c W95 FAT32 (LBA) /dev/mmcblk0p2 :131072,,,- /dev/mmcblk0p2 131072 3938303 3807232 83 Linux /dev/mmcblk0p3 : /dev/mmcblk0p3 0 - 0 0 Empty /dev/mmcblk0p4 : /dev/mmcblk0p4 0 - 0 0 Empty New situation: Units = sectors of 512 bytes, counting from 0 Device Boot Start End #sectors Id System /dev/mmcblk0p1 * 128 131071 130944 c W95 FAT32 (LBA) /dev/mmcblk0p2 131072 3938303 3807232 83 Linux /dev/mmcblk0p3 0 - 0 0 Empty /dev/mmcblk0p4 0 - 0 0 Empty Warning: partition 1 does not end at a cylinder boundary Do you want to write this to disk? [ynq] y Successfully wrote the new partition table [snip]
Formatting the New Partitions
Format the first partition as a FAT file system (the -n parameter gives it a label of boot).
$ sudo mkfs.vfat -F 32 /dev/mmcblk0p1 -n boot
Note: If your computer is missing the mkfs.vfat program, try installing the dosfsutils package and try again. E.g.
$ sudo apt-get install dosfsutils
Format the second partition for Linux (the -L parameter gives it a label of rootfs):
$ sudo mke2fs -j -L rootfs /dev/mmcblk0p2
Now, mount these partitions.
$ sudo mkdir /media/{boot,rootfs} $ sudo mount -t vfat /dev/mmcblk0p1 /media/boot $ sudo mount -t ext3 /dev/mmcblk0p2 /media/rootfs
Installing the Boot Files
The final step is to copy over the software that will run on your Gumstix COM. A matched set of the following files is required:
- a root file system e.g. rootfs.tar.bz2
- a kernel binary image e.g. uImage
- a u-boot bootloader binary image e.g. u-boot.bin
- a x-loader binary image e.g. MLO (Overo only) Use mlo-updated if using a STORM COM
Prebuilt image can be downloaded or found in the tmp/deploy directory of the OpenEmbedded build system.
Copy the binary files directly to the first partition: Note: Overo only. The x-loader binary must be copied first.
$ sudo cp MLO /media/boot/MLO overo only
For both Overo and verdex pro.
$ sudo cp u-boot.bin /media/boot/u-boot.bin $ sudo cp uImage /media/boot/uImage
Expand the root file system archive on to the second partition:
$ sudo tar xaf roofs.tar.bz2 -C /media/rootfs $ sync
Now, unmount these partitions and your card is ready to use:
$ sudo umount /media/boot $ sudo umount /media/rootfs
U-boot Environment Refresh
Tip for Systems Using Nautilus
When a microSD card is inserted into computers using the Nautilus file manager such as Ubuntu, a window typically pops-up showing the contents of the partitions or offering to do some action. This can be a little annoying but can be easily disabled. While browsing a folder in Nautilus, click Edit-->Preferences-->Media, select Never prompt or start programs on media insertion, and ensure Browse media when inserted is de-selected.
转自:http://www.cnblogs.com/androidme/p/3259088
相关问答
更多-
TCP/IP模型是一个________。[2023-05-19]
a -
下列中不属于面向对象的编程语言的是?[2022-05-30]
a -
我怀疑Acronis OS Selector和Disk Director使用他们自己的Windows 7版本。 是的,你可以制作一个拥有自己操作系统的程序。 你可以使用可启动的Linux发行版。 选择一个例子, Knoppix是一个可引导的Linux发行版。 The story behind a comprehensive GUI + bootable program is somewhat like this: Develop the program in a linux GUI toolkit On b ...
-
看到日志后:我认为我的问题是缺少文件夹。 我只是创建新的'/ var / lib / mysql-files' MySQL已启动。 After see logs: I think my problem is missing folder. I just create new '/var/lib/mysql-files' MySQL is started.
-
我发现这对我来说是最简单,最安全的方式。 我使用MicroSD到SD适配器,Windows处理其余的。 这样我可以肯定我正在格式化正确的卡。 我的Android设备分别将“sdcard0”和“extSDCard”作为内置SD卡和滑出式SD卡的名称。 以这种方式格式化错误的一个很容易。 I have found that to be the easiest and safest way for me. I use a MicroSD to SD adapter, and Windows handles the ...
-
所以我的答案很简单。 最好获得UART调试连接器,请参见此处 。 这样你知道当你打开BBB电源时,当你串行连接(putty)时,你的终端上会显示U-boot的输出。 如果找不到图像,U-boot将向终端发送消息,通知您没有内核映像。 获取UART调试连接器并通过串口连接不同于实际BBB的ssh 。 BBB的输出(当您使用ssh时)只是通知何时所有内容都加载并且终端上显示BBB的登录信息。 如果您的主板无法找到内核,则不会输出任何内容,您也不会知道出了什么问题。 但是,如果您通过UART调试进行串行连接,则不 ...
-
我的DriveSpeed基准测量大小文件写入和读取的速度,以及随机写入和读取的速度。 SD和USB驱动器的RPi 2结果在这里。 http://www.roylongbottom.org.uk/Raspberry%20Pi%20Benchmarks.htm#anchor21 对于引导,您需要确定哪个性能功能更重要,而不仅仅是大文件数据传输速度。 无论如何,这主要取决于驱动器的硬件性能特点。 我的系统SD卡可以通过USB读卡器中的SD卡执行。 My DriveSpeed benchmark measures ...
-
如何在ubuntu中创建启动盘(Bootable Pendrive)[关闭](How to create startup disk in ubuntu (Bootable Pendrive) [closed])[2022-05-14]
这将对您有所帮助,尝试安装LTS,12.04是Ubuntu提供的最新LTS http://www.ubuntu.com/download/desktop/install-ubuntu-with-windows This will help you, Try installing the LTS , 12.04 is the Recent LTS Provided by Ubuntu http://www.ubuntu.com/download/desktop/install-ubuntu-with-wind ... -
它是一种使代码更加模块化的方法。 使用Bootable,您可以在不同的scala类中使用不同的独立actor系统,所有引导系统都独立引导,而不是将它们全部放在一个主类中。 Its a way to make your code more modular. Using Bootable you can have different independent actor systems in different scala classes all bootstrapping independently, inst ...
-
如果您的Fire OS所基于的Android是Android 4.4+,您可以在任何Context (例如Activity )上尝试getExternalFilesDirs() )。 请注意复数形式 - 如果此方法返回2个以上的项目,则第二个和后续的项目位于可移动存储上 。 这些位置将特定于您的应用程序,您可以在没有权限的情况下读取和写入这些位置。 但请注意,Fire OS并不完全符合Play生态系统的兼容性要求,因此YMMV也是如此。 If the Android that your Fire OS is ...