User`s manual

Getting Started With Linux on the LPC3250 OEM Board Page 30
Copyright 2009 © Embedded Artists AB Rev A
3. The
update_fs
variable has been setup to update the NAND flash with the root file system.
First the
loadrootfs
variable will be used to load the root file system to SDRAM. Then
the NAND flash will be erased at the offset specified by
nand_rootfs_off
and size
specified by
nand_rootfs_sz
. The last step is to write the file system to the NAND flash.
update_fs=run loadrootfs; nand erase $(nand_rootfs_off)
$(nand_rootfs_sz); nand write.jffs2 $(loadaddr) $(nand_rootfs_off)
$(nand_rootfs_sz)
4. To actually update the NAND flash run the
update_fs
variable.
uboot> run update_fs
5. Use the
mtdboot
variable to boot Linux. This variable will setup the
bootargs
variable in
a way where Linux looks for the root file system in NAND flash. See section 5.8.2 for an
explanation of how the NAND flash is partitioned.
mtdboot=setenv bootargs root=/dev/mtdblock3 rw rootfstype=jffs2
ip=$(ipaddr) ea_ethaddr=$(ethaddr) console=ttyS0,115200n8; run
loadkernel;bootm $(loadaddr)
4.3.6 Root File System on MMC/SD Card
This section describes how you can put the root file system on an MMC/SD card.
1. Insert an MMC/SD card on your development computer. It will most likely be auto mounted
and you now need to discover which device file it has been associated with. First try using the
mount command. In the example below we see a file system mounted on
/media/disk
using device file
/dev/sde1
(this might be different for you). You can try to remove the card
and see if this mount point is removed to be sure this is your memory card.
$ sudo mount
...
/dev/sde1 on /media/disk type vfat
2. You can also use
dmesg
to locate the device file being used. In the log below we see that
sde1
(this might be different for you) is used. We also see that the size of the memory card
is about 500 MB which is correct for our card.
$ sudo dmesg
...
[171217.515649] sd 3:0:0:3: [sde] Write Protect is off
[171217.515654] sd 3:0:0:3: [sde] Mode Sense: 23 00 00 00
[171217.515657] sd 3:0:0:3: [sde] Assuming drive cache: write
through
[171217.521167] sd 3:0:0:3: [sde] 990976 512-byte hardware
sectors: (507 MB/483 MiB)
[171217.528650] sd 3:0:0:3: [sde] Write Protect is off
[171217.528653] sd 3:0:0:3: [sde] Mode Sense: 23 00 00 00
[171217.528655] sd 3:0:0:3: [sde] Assuming drive cache: write
through
[171217.528713] sde: sde1
3. Un-mount the memory card.