Need a reference to pick required ones for me for rootfs content

Ayyappan Mk
Hi,

Where can I find the instructions to select only the required features and
applications needed by me for rootfs content and then compile and place the
resultant files in appropriate location.Because I want to reduce the size
of rootfs image.

Please reply!

Ayyappan Mk
Sorry forgot to mention the board variant I am using. I am using mini2440
1GB Nand board.

davef
In answer to your other thread ... I think it will be quite unlikely that
the "rootfs developers for the mini2440" will be in a position to help on
an old product.

First, I have to ask ... do you have to develop this application on the
mini2440?  Is this a school project or commercial?

Sure you can build your rootfs from scratch.  When the mini2440 first came
out I did that and boy was it painful.  I would call it a "learning
experience".

Then the Pengutronix guys bought out the mini2440 BSP, which was maintained
up until 2015.  Life became a lot easier.

The next step in reducing the pain is to move to a NanoPi and run Debian
Jessie.  Or learn how to run QtEmbedded on it.

In building your small rootfs I assume you want Qt.

If you want to see if a file is necessary for correct operation maybe
trying renaming it on the target and see if it still works or not.

davef
"Building Embedded Systems"  3rd edition free for download is a good
reference book.

Ayyappan Mk
Hi davef,

I agree with your point on experimenting on my own to find the files
necessary for rootfs.In the other thread I have been asking for the working
Uboot source code as the binary generated from the supplied Uboot Source
code and from the downloads section of mini2440 did not work fine.
While using u-boot-nand16k.bin downloaded from another thread thinks
worked. So I want that corresponding working Uboot source code. Where can I
fetch that correct one?

Please reply!

Ayyappan Mk
Hi davef,

I agree with your point on experimenting on my own to find the files
necessary for rootfs.In the other thread I have been asking for the working
Uboot source code as the binary generated from the supplied Uboot Source
code and from the downloads section of mini2440 did not work fine.
While using u-boot-nand16k.bin downloaded from another thread thing*s
worked. So I want that corresponding working Uboot source code. Where can I
fetch that correct one?

Please reply!

davef
Did I give you a link for uboot on Bill's Forum?  Other then that thread I
don't know anymore about uboot on 1G Nand boards.

If there is any information on that topic it should be somewhere on this
forum.

Ayyappan Mk
Hi davef,

thanks. I got the Uboot source downloaded from Bills Forum through git
clone after reading carefully again.
And regarding the rootfs size reduction, the reason behind that is, jffs2
image sizes upto 105 Mb. While using Uboot and tftp server and loading into
RAM it got stuck after sometime ie) nearly double the time after "32 mb
received" displayed while flashing. I doubted that 64MB is not enough to
hold 105Mb size. If yaffs2 image supplied with board is more than 64mb then
default bootloader supervivi should handle specially for that while Uboot
not having that capability for this board. So only I want to reduce less
than 64 Mb.

So when I saw the doc Mini2440UsersManual060713-012214.pdf downloaded from
downloads section of mini2440, that Qtopia and Qt4 cannot be loaded at the
same time. 
So I chose Qtopia and deleted the contents in /usr/local/Trolltech in the
host system as in that doc it was mentioned that contents are used to load
Qt4.
And I also removed smplayer-bin, smplayer in the bin folder of rootfs
content,in the host as I dont need video feature option.
Also in /usr/lib/ I replaced libpython2.7.a with the symbolic link of the
same file it was also in the location usr/lib/python2.7/config/, with
symbolic file having the same name of that static library. This was also
done in host and then I generated jffs2 rootfs image.

Now the size of rootfs image came to 49.7 Mb. after that i removed
/etc/pointercal_A70 file as in the doc it was said that file can be
removed, to load the calibrate screen in target on bootup. so I did this
also in the host and created another opy of rootfs image.

Now while loading the rootfs image thru tftp it showed the message checksum
bad at the end.

Is this not the right way to reduce the size of rootfs image? I could not
remove files after loading into target, as I could not flash the whole
image to target due to large size.

what is the correct way to remove files /feature?

Please reply!

Ayyappan Mk
"Now the size of rootfs image came to 49.7 Mb. 
after that i removed /etc/pointercal_A70 file as in the doc it was said
that file can be removed, to load the calibrate screen in target on bootup.
so I did this also in the host and created another copy of rootfs image."

For both the images it showed the same "checksum bad" message.

Ayyappan Mk
Hi,

I should have deleted some other required files. When I carefully deleted
the files the resulted to 56.2 mb.
And now I was able to load to RAM completely with tftp and I see 
"done
XX some number XX
transfered " message

And then I wrote to Nand and it showed as success.

And then executed the following commands
MINI2440#setenv bootcmd nboot.e kernel \; bootm
MINI2440#saveenv

And now I rebooted the mini2440 and it finally gave the following message
at end :

Cowardly refusing to erase blocks on filesystem with no valid JFFS2 nodes
empty_blocks 7715, bad_blocks 0, c->nr_blocks 8144
VFS: Cannot open root device "mtdblock3" or unknown-block(31,3)
Please append a correct "root=" boot option; here are the available
partitions:
1f00             256 mtdblock0 (driver?)
1f01             128 mtdblock1 (driver?)
1f02            5120 mtdblock2 (driver?)
1f03         1042432 mtdblock3one_wire_status: 3
 (driver?)
Kernel panic - not syncing: VFS: Unable to mount root fs on
unknown-block(31,3)
Backtrace: 
[<c00341cc>] (dump_backtrace+0x0/0x10c) from [<c034315c>]
(dump_stack+0x18/0x1c)
 r7:c03f9ea0 r6:00008000 r5:c393b000 r4:c04a2290
[<c0343144>] (dump_stack+0x0/0x1c) from [<c03431ac>] (panic+0x4c/0x114)
one_wire_status: 4
[<c0343160>] (panic+0x0/0x114) from [<c0008dbc>]
(mount_block_root+0x174/0x228)
 r3:c384c32c r2:00000000 r1:c3823f60 r0:c03f9e38
[<c0008c48>] (mount_block_root+0x0/0x228) from [<c0008f34>]
(mount_root+0xc4/0xfc)
[<c0008e70>] (mount_root+0x0/0xfc) from [<c0009094>]
(prepare_namespace+0x128/0x180)
one_wire_status: 4
 r5:c002081d r4:c04a1c60
[<c0008f6c>] (prepare_namespace+0x0/0x180) from [<c00084b0>]
(kernel_init+0xe0/0x114)
 r5:c001fb50 r4:c04a1a20
[<c00083d0>] (kernel_init+0x0/0x114) from [<c004bbbc>] (do_exit+0x0/0x620)
one_wire_status: 5
 r5:00000000 r4:00000000


Please reply what could be the problem!

davef
Looks like you have been busy, but ...

With regard to 1G NAND I recall some comments that it took a long time to
erase it, like an hour.  Are you letting things run to completion?

Where did you read that this uboot could not handle a >64M rootfs?  Doesn't
seem correct to me.

> VFS: Cannot open root device "mtdblock3" or unknown-block(31,3)

A common error message.  Maybe, you have to stop the boot process and
modify bootargs, then saveenv.

Tell me which tutorial you are following.  And what JFFS2 rootfs you are
modifying. And what kernel image you are using.

I think this is correct (your two options):

superboot   zImage   YAFFS2
uboot       uImage   JFFS2

I think later versions of uboot can load a zImage, but I never tried that.

Ayyappan Mk
Hi davef,

>With regard to 1G NAND I recall some comments that it took a long time to
>erase it, like an hour.  Are you letting things run to completion?

For erasing nand i waited till completion.

>Where did you read that this uboot could not handle a >64M rootfs? 
>Doesn'tseem correct to me.

I did not mean to say Uboot cant handle >64mb rootfs in general. But for
this mini2440 1GB board the ram is 64MB only and there will not be space to
load 105 MB jffs2 rootfs. But in the bootloader supervivi the procedure
will not be same as uboot.It must have capability to split the image and
write it to Nand or some other technique, as yaffs2 image supplied with
board is about 95 Mb.

> VFS: Cannot open root device "mtdblock3" or unknown-block(31,3)
>A common error message.

When I tried to flash 105 mb jffs2 image with SD card it showed as complete
and then saved bootargs after supplying that and rebooted I got the
following message:

"s3c2410-rtc s3c2410-rtc: hctosys: invalid date/time
s3c-sdi s3c2440-sdi: running at 398kHz (requested: 400kHz).
s3c-sdi s3c2440-sdi: running at 16875kHz (requested: 25000kHz).
s3c-sdi s3c2440-sdi: running at 16875kHz (requested: 25000kHz).
mmc0: new SD card at address 1234
mmcblk0: mmc0:1234 SA01G 942 MiB 
 mmcblk0:
jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x02d5e724:
0x374f instead
jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x02d5e728:
0x3751 instead
.
.
.
Further such events for this erase block will not be printed
Empty flash at 0x02d5f854 ends at 0x02d5f858
Empty flash at 0x02d5f908 ends at 0x02d5f90c
one_wire_status: 4
Empty flash at 0x02d5fdac ends at 0x02d5fdb0
jffs2_scan_inode_node(): CRC failed on node at 0x05737fc8: Read 0x18d7cecf,
calculated 0xbc612618
jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x05738100:
0x9510 instead
.
.
.
jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x05738124:
0x33ae instead
Further such events for this erase block will not be printed
one_wire_status: 2
Empty flash at 0x0649aea4 ends at 0x0649b000
VFS: Mounted root (jffs2 filesystem) on device 31:3.
Freeing init memory: 156K
hwclock: settimeofday() failed: Invalid argument
/etc/rc.d/init.d/netd: line 16: /usr/sbin/inetd: not found
chmod: /usr/local/etc/ssh_*_key: No such file or directory
/etc/init.d/rcS: line 44: /usr/local/sbin/sshd: not found
/etc/rc.d/init.d/httpd: line 16: /usr/sbin/boa: not found
/etc/rc.d/init.d/leds: line 16: /usr/bin/led-player: not found
                        
Try to bring eth0 interface up......eth0: link down
Done

Please press Enter to activate this console. JFFS2 notice: (665)
read_dnode: wrong data CRC in data node at 0x02d5e030: read 0x3316e2e9,
calcul.
JFFS2 warning: (665) jffs2_do_read_inode_internal: no data nodes found for
ino #2598
Returned error for crccheck of ino #2598. Expect badness..."

In this case rootfs was mounted but the complete image should not have been
wrote in the nand so printing messages like not found , no such file or
directory so and so.

> Maybe, you have to stop the boot process and modify bootargs, then 
> saveenv.

How to do this?

>Tell me which tutorial you are following.And what JFFS2 rootfs you are
>modifying.

I created jffs2 roots from the rootfs content
rootfs_qtopia_qt4-20141223.tar.gz downloaded from download section of
mini2440.I removed files as i said in the previous post also videos and
audio files in host machine as i dont need that feature and I didnot remove
smplayer-bin, smplayer in the bin folder of rootfs content second time in
that . This image showed the unable to mount error. For deleting the files
i didnot have any guide. But I see in the guide
Mini2440UsersManual060713-012214.pdf downloaded from downloads section of
mini2440 it was mentioned as Qt4 files will be located in
/usr/local/TrollTech folder. So deleted that one.

> And what kernel image you are using.

i am using uboot       uImage   JFFS2 option

Please reply after looking this

davef
It has been 4-5 years since I was working at this level, but my
understanding is the kernel gets loaded from NAND into RAM on bootup.  

Then the rootfs gets loaded into RAM (and this is the part I am NOT sure
about) either the whole lot or just what is needed get the system up and
running.

If it is the "whole lot" then I could see a reason to reduce rootfs file
size.  When I tried to run Arora (a Qt web browser) on my 64M NAND machine
I had to use swap.  For a 1GB NAND machine I thought it would get what it
needed from NAND and put it into RAM.

I never selectively removed files from a rootfs to make it smaller.

I can only imagine wanting to load everything into RAM to get the highest
speed.  I don't understand why you are wanting to do it.

Could you explain to me (again) why you want to make the rootfs smaller?

Ayyappan Mk
Hi davef,

You are saying the steps that were done after all software were flashed
successfully and in normal boot up.
My issue is, for flashing rootfs in dead board where Uboot and kernel 
arefunctional and no rootfs image was not there in Nand already.
Using Uboot, 

1) I have to connect the board thru minicom,
2)in uboot terminal I have to load rootfs to RAM either using
USB/MMC/tftp/etc.. commands and 
3)then while image residing in RAM I have to issue nand write commands in
uboot terminal to write into Nand.

This is the normal procedure posted in Bills Blog/ Forrest Blog.

So in Step 2) while loading the rootfs into RAM if rootfs size is greater
than 64mb 

a)in case of tftp it got stuck in the middle and 

b) in case of MMC I used 105Mb rootfs image fully and it showed as it was
completely loaded into the RAM but partially loaded the rootfs image and
after writing it to NAND it didnot write all the content as rootfs content
was not fully there in RAM.

So in case b) after writing to NAND and saving boot environment variables'
values and rebooted it showed the messages in Uboot terminal in host as
posted in the date 2016-10-17 05:43:38

So i guess as per the messages ,that rootfs was mounted but some files are
not available.

And when tried case a) it got stuck up while loading into the RAM in
middle.

So I tried to reduce the size to load it into RAM full functional rootfs
image. Now my problem is I think I dont know the proper procedure to reduce
the size of rootfs. So now when arrived at the rootfs image of size 56.2 Mb
by deleting as said before I get the messages in Uboot terminal after
flashing and rebooting as said in the post dated 2016-10-16 17:24:05.

In short I want to reduce the size in order flash the rootfs content image
properly for the dead board to bring it functional.

davef
A very thorough explanation.

Firstly, I was going to suggest that you load the kernel and rootfs in
Bao's tutorial and check that you can get that to work.

My old mini2440 stuff is in another location, which I can access tomorrow,
so I don't recall what size the rootfs was, that he used.

***
I created jffs2 roots from the rootfs content
rootfs_qtopia_qt4-20141223.tar.gz downloaded from download section of
mini2440.
***

Describe how you do that?  And link the thread on Bill's forum and I'll
read that to refresh my memory.

davef
Just so I have a better understanding ... why are you trying to use uboot
instead of superboot?

davef
OK.  I have had a look through the files used in Forrest Bao's article.

I see the gpe.jffs2 file is only 39M and kernel 1.9M.  I believe the uboot
he used would only work on the 64M variant of the mini2440.

So, it looks like that will all fit into 64M. Again, maybe checking that
you can load that with your "1G version of uboot" might be a step in the
right direction.

Ayyappan Mk
Hi davef,

I dont have either gpe.jffs2 and its source or "1Gb version of Uboot".

If you provide access link to 1GB version of Uboot or both it will be
helpful.

Thanks in advance!

Dave Festing
There is a 10M limit on file size.

Send an email to:
   dave underscore festing at hotmail dot com

davef
Followed the link from Bill's forum posting to this:
http://www.friendlyarm.net/forum/topic/1103

Have you tried that version of uboot?

Sounds like the whole process was quite difficult.

Ayyappan Mk
Hi davef,

I have sent my email to you.

Thanks in advance

Ayyappan Mk
Hi davef,

I think I have tried that version of Uboot earlier and it didnot work.
According to Bill's forum he mentioned to use u-boot-nand-16k.bin and not
u-boot-nand-2k.bin

Please provide me the files I have asked in the mail.

Thanks.

davef
Have you got GPE files that I have sent?

davef
https://books.google.co.nz/books?id=1rbM-wJ0s5wC&pg=PA227&lpg=PA...

Ayyappan Mk
Hi davef,

Thanks a lot.I got gpe.jffs2 image, gpe-uImage, u-boot-bin.tbz2 files.

Will gpe-uImage sent by you only support gpe.jffs2 image to be loaded?
Because the kernel image I am having was configured and built to support
jffs2 image by make menuconfig.

And that u-boot-bin.tbz2 seems to be the same I am having.

And if I get source for gpe.jffs2 it would be helpful.

And now I have to test these files in board and get back to you with
result.

One more question this gpe.jffs2 support network browser?

Please reply!Thanks.

davef
***
Will gpe-uImage sent by you only support gpe.jffs2 image to be loaded?
Because the kernel image I am having was configured and built to support
jffs2 image by make menuconfig.
***

I would only suggest loading the kernel and rootfs images I sent you for a
trial with various versions of "1GB uboot".

Kernels and rootfs should be built using the same toolchain or you can have
problems.

Try to answer my questions.

***
I created jffs2 roots from the rootfs content
rootfs_qtopia_qt4-20141223.tar.gz downloaded from download section of
mini2440.
***

Describe how you do that? Which toolchain?

I will check if I have the source for the gpe.jffs2.

Network browser?  Do you mean an internet browser?  I would say that it
does not.

Ayyappan Mk
I created jffs2 rootfs image using the following command:

sudo mkfs.jffs2 --root=/home/ayyappan/rootfs_qtopia_qt4
--output=/home/ayyappan/rootfs.jffs2 --eraseblock=0x20000 --little-endian
--no-cleanmarkers --pad

(I have already installed mtd-utils in my host PC)

For making jffs2 image i did not use tool chain as tar.gz file i mentioned
already has the content of cross compiled libraries and binaries etc,..
that can be straight away built into image using the above command I said.

But for cross compiling kernel and Uboot I used arm-linux-gcc-4.4.3.tar.gz
downloaded from downloads section of mini2440.

Thanks.

davef
If the cross-compiled libraries and binaries were done using the same
toolchain as the kernel then I guess that eliminates that concern.

Hope someone else tries to help.

davef
Sorry, I don't have any source files for the gpe.jffs2 image.