Bug 1205

Summary: [blacksand/emenlow/crownbay] Format swap partition failed when install
Product: [Build System, Metadata & Runtime] OE-Core Reporter: wenhua.fan <wenhuax.fan>
Component: coreAssignee: Dexuan Cui <dexuan.cui>
Status: VERIFIED FIXED QA Contact:
Severity: major    
Priority: High CC: dexuan.cui, jiajun.xu, meta.mr.watcher, meta.watcher, sgw, wenhuax.fan
Version: unspecified   
Target Milestone: 1.1 M2   
Hardware: x86   
OS: Multiple   
Whiteboard:
OS type for building Yocto: --- Type of Regression: ---
Verified: Documentation change: ---

Description wenhua.fan 2011-06-29 01:09:04 UTC
Tree/Branch: Poky/master
Poky Commit: a1f79a7896b6411669b3ccada6204d2695e80fc5
Meta Branch: master
Meta Commit: 50661bf038a34702f3aa139c3ea0d67fbb0ce5db

Image location:

Emenlow:

http://autobuilder02.pokylinux.org/emenlow-master/nightly/20110627-1/machines/emenlow/x86_32/core-image-sato-sdk-live-emenlow-20110627234406.hddimg.bz2

Blacksand:

http://autobuilder02.pokylinux.org/n450-master/nightly/20110627-1/machines/n450/x86_32/core-image-sato-sdk-live-n450-20110628021720.hddimg.bz2

Crownbay:

http://autobuilder02.pokylinux.org/crownbay-noemgd-master/nightly/20110627-1/machines/crownbay/x86_32/core-image-sato-sdk-live-crownbay-noemgd-20110627213608.hddimg.bz2

With Yocto 1.1 20110624 build, BSP images install failed on target platform when format swap partition.
But there is no such issue on sugarbay and jasperforest. And there is no such issue in Yocto 1.1 M1 testing.

The error message is as below:
######
………
This filesystem will be automatically checked every 38 mounts or 180 days, whichever comes firse.
Use trne2fs –c or –i to override.
Formatting swap partition…(/dev/sda3)
Mkswap: lseek: Value too large for defined data type
Installation image failed

Sh: can’t access tty; jab control turned off
/# 

######
Comment 1 Dexuan Cui 2011-06-29 08:11:20 UTC
> Mkswap: lseek: Value too large for defined data type
http://www.gnu.org/software/coreutils/faq/coreutils-faq.html#Value-too-large-for-defined-data-type says mkswap (coming from util-linux) was not built with big file support.

Something must be broken recently (after May 21, I think).
Comment 2 Dexuan Cui 2011-06-29 17:46:23 UTC
(In reply to comment #1)
> > Mkswap: lseek: Value too large for defined data type
> http://www.gnu.org/software/coreutils/faq/coreutils-faq.html#Value-too-large-for-defined-data-type
> says mkswap (coming from util-linux) was not built with big file support.
> Something must be broken recently (after May 21, I think).

This bug should be of high priority because I suppose it blocks QA's tesing BSP.
Comment 3 Saul Wold 2011-06-30 19:26:23 UTC
I do not have a hardware device hand right now to test this, so I need some additional information about when the is occuring and which mkswap is being used.

If this occurs during installation, then it might be in busybox, if its during first boot then maybe util-linux.

Please try to determine this by ls -l on mkswap and give me the results.

Additional details are helpful.

Thanks
Comment 4 Dexuan Cui 2011-06-30 20:14:44 UTC
(In reply to comment #3)
> I do not have a hardware device hand right now to test this, so I need some
I have the device and I'll try to look into this.

> additional information about when the is occuring and which mkswap is being
> used.
> If this occurs during installation, then it might be in busybox, if its during
> first boot then maybe util-linux.
> Please try to determine this by ls -l on mkswap and give me the results.
> Additional details are helpful.
I'll find out which one we're using.
Comment 5 wenhua.fan 2011-06-30 20:16:24 UTC
This error occurs during installation.

The result of ls -l on mkswap as below:
lrwxrwxrwx 1 root root 14 Jun 27 17:37 /sbin/mkswap -> ../bin/busybox

The size of mkswap command is 580.0KB

The image size are below:
Emenlow: 907M
BlackSand: 938M
Crownbay: 935M
Comment 6 Dexuan Cui 2011-06-30 20:27:04 UTC
(In reply to comment #5)
> This error occurs during installation.
> The result of ls -l on mkswap as below:
> lrwxrwxrwx 1 root root 14 Jun 27 17:37 /sbin/mkswap -> ../bin/busybox
Thanks Wenhua for the info!

So I suppost the commit, which updtes busybox.inc, is the culprit:
http://git.pokylinux.org/cgit/cgit.cgi/poky/commit/?id=ab1171b512dc4a450324f6f0ea08a57489009c5f

Will further look into this.
Comment 7 wenhua.fan 2011-06-30 22:14:45 UTC
There are 8G swap disk space on Crownbay.
Comment 8 Saul Wold 2011-06-30 23:06:10 UTC
Thanks for confirming that it's busybox.  Based on the commit, I would suggest, if someone can rebuild busybox with DISTRO_FEATURES =+ "largefile" and see if that fixes it. This can be done in a local.conf file.

8G is also a very large swap space, is that how much memory is on the system?  How is it generating that large a swap space? I can dig into this further next week, but in the short term is someone (Wenhau or Dexuan) can rebuild that would be a great test.

Thanks
Comment 9 Dexuan Cui 2011-07-01 02:57:40 UTC
(In reply to comment #8)
> Thanks for confirming that it's busybox.  Based on the commit, I would suggest,
> if someone can rebuild busybox with DISTRO_FEATURES =+ "largefile" and see if
> that fixes it. This can be done in a local.conf file.
I've sent out the patches.

> 8G is also a very large swap space, is that how much memory is on the system? 
> How is it generating that large a swap space? I can dig into this further next
> week, but in the short term is someone (Wenhau or Dexuan) can rebuild that
> would be a great test.
> Thanks
Comment 10 Dexuan Cui 2011-07-03 21:33:57 UTC
(In reply to comment #7)
> There are 8G swap disk space on Crownbay.

(In reply to comment #8)
> Thanks for confirming that it's busybox.  Based on the commit, I would suggest,
> if someone can rebuild busybox with DISTRO_FEATURES =+ "largefile" and see if
> that fixes it. This can be done in a local.conf file.
> 8G is also a very large swap space, is that how much memory is on the system? 
> How is it generating that large a swap space? I can dig into this further next
> week, but in the short term is someone (Wenhau or Dexuan) can rebuild that
> would be a great test.
> Thanks

The current algorithm for swap partition's size is:
swap_size=$((disk_size*5/100))
So we can deduce Wenhua's Crownbay has a disk of 160G.

Looks the algorithm wastes too much disk space...
I'll mail the oe-core mailing list about this.
Comment 11 Dexuan Cui 2011-07-05 15:24:44 UTC
(In reply to comment #9)
> (In reply to comment #8)
> > Thanks for confirming that it's busybox.  Based on the commit, I would suggest,
> > if someone can rebuild busybox with DISTRO_FEATURES =+ "largefile" and see if
> > that fixes it. This can be done in a local.conf file.
> I've sent out the patches.
Fixed by 
http://git.pokylinux.org/cgit/cgit.cgi/poky/commit/?id=101098bfb47bfe1096124c3ce6dd73d58b8c9e0e