• Home
  • Help
  • Search
  • Login
  • Register
Pages: [1]
Author Topic: Modifying the Ubuntu jffs2 Image  (Read 11198 times)
mteel
Newbie
*

Karma: 0
Posts: 10


View Profile
« on: April 09, 2009, 12:17:06 PM »

I would like to convert the ubuntu jffs2 disk image to a regular rootfs tree which I can use to add custom applications and configure to my liking, all the while booting from it via NFS.

Ultimately I would like to convert my rootfs tree back to a jffs2 image file suitable for flashing back to the nand flash on the sheevaPlug.

Is there any documentation about how to extract the root filesystem from the jffs2 image file and ultimately recreate the image file from my custom rootfs tree?

Thanks,
Mark
Logged

moshiach
Guest
« Reply #1 on: April 09, 2009, 01:31:28 PM »

It's easier to go from the other direction since you can't mount a jffs2 image on anything but a MTD.  But once you have the jffs2 written to the nand, you can

mkdir /mnt/flashsystem
mkdir /mnt/usb
mount -t jffs2 /dev/mtdblock2 /mnt/flashsystem
mount /dev/sda1 /mnt/usb
cp -dpr /mnt/flashsystem/* /mnt/usb/

Make your changes then run the following command (and go get some coffee and maybe a newpaper, or catch up on your DVR shows.)

mkfs.jffs2 -l -e 0x20000 --pad -r/mnt/usb/ -o my-fs.jffs2

From there you can nandwrite it to /dev/mtd2 or whatever.
Logged

mteel
Newbie
*

Karma: 0
Posts: 10


View Profile
« Reply #2 on: April 11, 2009, 06:47:59 AM »

Thanks! Good info...

My initial goal was to mount the ubuntu rootfs via NFS and do all apt upgrades and custom development that way. The problem is that udev and a few other packages that need to be upgraded don't like the NFS mount rootfs very much, so I have had to revert to setting up my rootfs image while it is running from nand flash.
Logged

kilowatt
Global Moderator
Full Member
*****

Karma: 3
Posts: 106


View Profile
« Reply #3 on: April 11, 2009, 08:03:48 AM »

I found the same thing trying to upgrade all the packages.  It didn't work out well if the root was mounted via nfs.  I did the upgrade with the root in the flash.  My system seems to run fine but I'm getting a fail message while it is booting.  I can't figure out why.  Do any of you who have done a full upgrade get the same message?

Quote
* Checking file systems...                                                     
fsck 1.41.4 (27-Jan-2009)                                                 [ OK ]
 * Mounting local filesystems...                                         [fail]
 * Activating swapfile swap...                                           [ OK ]
Logged

alexbez
Newbie
*

Karma: 0
Posts: 7


View Profile
« Reply #4 on: April 14, 2009, 01:51:17 AM »

I would like to convert the ubuntu jffs2 disk image to a regular rootfs tree which I can use to add custom applications and configure to my liking, all the while booting from it via NFS.

Mark,

Have a look at http://openplug.org/plugforum/index.php?topic=59.0 - there is an explanation how to mount, copy and update your JFFS2 image on a Linux host without NAND flash. Hope it helps.

Regards,
Alexander

Logged

----------------------------------
"Everybody is entitled to be stupid,
but some people just abuse the privilege"

porkupan
Newbie
*

Karma: 0
Posts: 6



View Profile
« Reply #5 on: April 15, 2009, 08:07:27 PM »

I would like to convert the ubuntu jffs2 disk image to a regular rootfs tree which I can use to add custom applications and configure to my liking, all the while booting from it via NFS.

Actually, you don't need to copy the filesystem out of flash (although it's great to know how to do it).  The image provided by Marvell seems rather close to the ubuntu rootfs that comes with the system.

Now, what I would like to see is an actual SDK, or a development environment like what we used to get with AXIS ETRAX processors.  I mean the way to build the Ubuntu rootfs image from sources, and add applications to it.  I am not sure I can do it with the set of tools and absolutely inadequate instructions provided by Marvell...  The include files are nowhere to be found (well, there are some in the "NFS rootfs", but that is not the Ubuntu distribution), the compiler doesn't seem to like the shared object libraries (i.e. cannot link with libcrypto.so from the Ubuntu image), and where am I going to get the sources for the basic packages?

When the box comes with a Linux system, shouldn't there be a way to recreate the same system from sources? Or are we expected to either enjoy the given distribution, or re-create the entire environment and all the packages from scratch?
« Last Edit: April 15, 2009, 08:09:04 PM by porkupan » Logged

moshiach
Guest
« Reply #6 on: April 15, 2009, 10:21:51 PM »

Remember that Sheevaplug is a development product right now, not a fully fledged consumer product.  Right now  WE the people who bout it early are figuring out the tools and sources needed to build it.

About the only thing I'm missing right now is a way to build and burn uboot.   Other than that, we've figured out most of the other stuff right here on these boards.  I'm sure once it becomes a consumer product there will be much more detailed documentation and SDK sources.

That AXIS looks nice, but they are discontinued now and the device they are replacing it with seems to have about half the processing power, 64M of ram and 256M of flash.  No price yet, but I'm sure it's more than the $99 I paid for the plug.

But I will echo your thought:  a true SDK would be nice.
Logged

alexbez
Newbie
*

Karma: 0
Posts: 7


View Profile
« Reply #7 on: April 15, 2009, 10:34:36 PM »

Now, what I would like to see is an actual SDK, or a development environment like what we used to get with AXIS ETRAX processors.  I mean the way to build the Ubuntu rootfs image from sources, and add applications to it.

I guess, that after some tweaking Scratchbox toolkit (http://www.scratchbox.org/) can be tuned to support Sheeva.

For example, for Maemo platform (http://maemo.org), which is a Debian derivative for TI OMAP 2420 (ARM) processor, it works quite nicely. Indeed, the toolkit as such does not make a SDK yet, but Scratchbox community might be interested in helping to add Sheeva support. If I only had time, I probably would be able to put some efforts into this, but...

Logged

----------------------------------
"Everybody is entitled to be stupid,
but some people just abuse the privilege"

porkupan
Newbie
*

Karma: 0
Posts: 6



View Profile
« Reply #8 on: April 16, 2009, 11:18:41 AM »

Remember that Sheevaplug is a development product right now, not a fully fledged consumer product.  Right now  WE the people who bout it early are figuring out the tools and sources needed to build it.
Well, I do not entirely agree.  There is a Ubuntu build environment, which was used to build the rootfs image currently on the Plug.  This environment should be put out there for people to download and customize.

Actually, for me this is not a personal hacking interest, but a business interest.  My company is looking to develop a board based on the Marvell Kirkwood SoC, as a replacement for the AXIS ETRAX FS, which is being phased out.  If there is no development environment that we can use to build upon, we will probably select a different CPU, with better support.  So far I don't even see any way to contact Marvell engineering support.  I am glad there is at least a community board and a Wiki at openplug.org, as Marvell's own instructions and documentation is totally inadequate.  The Extranet does have Orion SDK 2.0, but there is no word of supporting Kirkwood CPUs and boards, and the SDK seems quite obsolete.

Quote from: moshiach
About the only thing I'm missing right now is a way to build and burn uboot.   Other than that, we've figured out most of the other stuff right here on these boards.  I'm sure once it becomes a consumer product there will be much more detailed documentation and SDK sources.
I just tried to follow the instructions from ReleaseNotes.txt that comes with the U-Boot package:
1. Install GCC
2. Untar'ed U-Boot 1.1.4 and unzipped patch 3.4.16 over it (to overwrite files).  Not sure why Marvell wouldn't just put out a ready to build U-Boot.
3. export PATH=<GCC Install Dir>/bin:$PATH
4. make mrproper
5. make rd88f6281Sheevaplug_config NBOOT=1 LE=1
6. make -s

You get a u-boot-rd88f6281Sheevaplug_400db_nand.bin as a result.  I haven't tried to actually burn this image for fear of bricking the device with no instructions on how to unbrick it, but there are instructions in ReleaseNotes.txt on how to do it.

Quote from: moshiach
That AXIS looks nice, but they are discontinued now and the device they are replacing it with seems to have about half the processing power, 64M of ram and 256M of flash.  No price yet, but I'm sure it's more than the $99 I paid for the plug.
AXIS is getting out of business of selling general purpose processors, which is a shame, as far as I am concerned.  Their SoCs are a little out of date on technology, but they were quite adequate for out applications.  And the support was/is just unbelievable.

When AXIS announced the EoL of ETRAX processor line, we started looking for a replacement with dual Ethernet capability, and Kirkwood 88F6281 is one of the candidates.  But waiting for a month for Extranet registration, and then finding out that there is almost no company provided support to the development community is quite a turn-off...
« Last Edit: April 16, 2009, 05:41:15 PM by porkupan » Logged

Pandemonium
Newbie
*

Karma: 0
Posts: 37


View Profile
« Reply #9 on: April 24, 2009, 03:02:39 PM »

mkfs.jffs2 -l -e 0x20000 --pad -r/mnt/usb/ -o my-fs.jffs2

This command needs to include the -n switch, which tells it not to write cleanmarker nodes to the beginning of eraseblocks.  NAND memory doesn't want to see them, and will generate warnings at each and every eraseblock when you flash the image back to NAND and mount it as the root FS.  It will work, it just generates a ton of warnings and a huge delay as it spits them all out.

The command should read something like:

mkfs.jffs2 -l -n -e 0x20000 --pad -r /mnt/usb/ -o my-fs.jffs2
« Last Edit: April 24, 2009, 03:14:22 PM by Pandemonium » Logged

Pages: [1]
Print
Jump to: