Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] Need help with genimage
@ 2017-01-08 11:58 Jörg Krause
  2017-01-08 17:45 ` Baruch Siach
  0 siblings, 1 reply; 5+ messages in thread
From: Jörg Krause @ 2017-01-08 11:58 UTC (permalink / raw)
  To: buildroot

Hi,

I am trying to add support for the Banana Pro board to Buildroot. The
Banana is similiar to the Orange Pi, so I am using a genimage.cfg based
on the Pi for creating the sd card image:

    image boot.vfat {
    	    vfat {
    	    	    files = {
    	    	    	    "zImage",
    	    	    	    "sun7i-a20-bananapro.dtb",
    	    	    	    "boot.scr"
    	    	    }
    	    }
    	    size = 10M
    }

    image sdcard.img {
    	    hdimage {
    	    }

    	    partition u-boot {
    	    	    in-partition-table = "no"
    	    	    image = "u-boot-sunxi-with-spl.bin"
    	    	    offset = 8192
    	    	    size = 1040384 # 1MB - 8192
    	    }

    	    partition boot {
    	    	    partition-type = 0xC
    	    	    bootable = "true"
    	    	    image = "boot.vfat"
    	    }

    	    partition rootfs {
    	    	    partition-type = 0x83
    	    	    image = "rootfs.ext4"
    	    	    size = 512M
    	    }
    }

I am able to generate the sd card image and copy it to the sd card
using Suses imagewriter. The board boots fine. However, the rootfs size
is not 512MB as expected:

# df -hT
Filesystem???????????Type????????????Size??????Used Available Use%
Mounted on
/dev/root????????????ext4???????????38.7M?????37.9M?????????0 100% /
devtmpfs?????????????devtmpfs??????501.9M?????????0????501.9M???0% /dev
tmpfs????????????????tmpfs?????????502.4M?????????0????502.4M???0%
/dev/shm
tmpfs????????????????tmpfs?????????502.4M??????3.9M????498.4M???1% /tmp
tmpfs????????????????tmpfs?????????502.4M?????24.0K????502.4M???0% /run

I am not able to create any file larger file on the filesystem nor
start some programs.

What am I missing here? Can somebody enlighten me please :-)

Best regards,
J?rg Krause

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Buildroot] Need help with genimage
  2017-01-08 11:58 [Buildroot] Need help with genimage Jörg Krause
@ 2017-01-08 17:45 ` Baruch Siach
  2017-01-08 18:32   ` Jörg Krause
  0 siblings, 1 reply; 5+ messages in thread
From: Baruch Siach @ 2017-01-08 17:45 UTC (permalink / raw)
  To: buildroot

Hi J?rg,

On Sun, Jan 08, 2017 at 12:58:51PM +0100, J?rg Krause wrote:
> I am able to generate the sd card image and copy it to the sd card
> using Suses imagewriter. The board boots fine. However, the rootfs size
> is not 512MB as expected:
> 
> # df -hT
> Filesystem???????????Type????????????Size??????Used Available Use%
> Mounted on
> /dev/root????????????ext4???????????38.7M?????37.9M?????????0 100% /
> devtmpfs?????????????devtmpfs??????501.9M?????????0????501.9M???0% /dev
> tmpfs????????????????tmpfs?????????502.4M?????????0????502.4M???0%
> /dev/shm
> tmpfs????????????????tmpfs?????????502.4M??????3.9M????498.4M???1% /tmp
> tmpfs????????????????tmpfs?????????502.4M?????24.0K????502.4M???0% /run
> 
> I am not able to create any file larger file on the filesystem nor
> start some programs.
> 
> What am I missing here? Can somebody enlighten me please :-)

Unless you set BR2_TARGET_ROOTFS_EXT2_BLOCKS and BR2_TARGET_ROOTFS_EXT2_INODES 
you'll get a minimal ext2/3/4 filesystem with no free space. Alternatively, 
you may run on target the resize2fs tool from the e2fsprogs package on the 
root filesystem to expand the filesystem to the size of the partition.

Hope this helps,
baruch

-- 
     http://baruch.siach.name/blog/                  ~. .~   Tk Open Systems
=}------------------------------------------------ooO--U--Ooo------------{=
   - baruch at tkos.co.il - tel: +972.52.368.4656, http://www.tkos.co.il -

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Buildroot] Need help with genimage
  2017-01-08 17:45 ` Baruch Siach
@ 2017-01-08 18:32   ` Jörg Krause
  2017-01-08 19:02     ` Baruch Siach
  0 siblings, 1 reply; 5+ messages in thread
From: Jörg Krause @ 2017-01-08 18:32 UTC (permalink / raw)
  To: buildroot

Hi Baruch,

On Sun, 2017-01-08 at 19:45 +0200, Baruch Siach wrote:
> Hi J?rg,
> 
> On Sun, Jan 08, 2017 at 12:58:51PM +0100, J?rg Krause wrote:
> > I am able to generate the sd card image and copy it to the sd card
> > using Suses imagewriter. The board boots fine. However, the rootfs
> > size
> > is not 512MB as expected:
> > 
> > # df -hT
> > Filesystem???????????Type????????????Size??????Used Available Use%
> > Mounted on
> > /dev/root????????????ext4???????????38.7M?????37.9M?????????0 100%
> > /
> > devtmpfs?????????????devtmpfs??????501.9M?????????0????501.9M???0%
> > /dev
> > tmpfs????????????????tmpfs?????????502.4M?????????0????502.4M???0%
> > /dev/shm
> > tmpfs????????????????tmpfs?????????502.4M??????3.9M????498.4M???1%
> > /tmp
> > tmpfs????????????????tmpfs?????????502.4M?????24.0K????502.4M???0%
> > /run
> > 
> > I am not able to create any file larger file on the filesystem nor
> > start some programs.
> > 
> > What am I missing here? Can somebody enlighten me please :-)
> 
> Unless you set BR2_TARGET_ROOTFS_EXT2_BLOCKS and
> BR2_TARGET_ROOTFS_EXT2_INODES?
> you'll get a minimal ext2/3/4 filesystem with no free space.
> Alternatively,?
> you may run on target the resize2fs tool from the e2fsprogs package
> on the?
> root filesystem to expand the filesystem to the size of the
> partition.

Which values should I use for blocks and inodes if I set the rootfs
size to 512M in genimage.cfg? Any suggestions?

J?rg

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Buildroot] Need help with genimage
  2017-01-08 18:32   ` Jörg Krause
@ 2017-01-08 19:02     ` Baruch Siach
  2017-01-08 19:07       ` Jörg Krause
  0 siblings, 1 reply; 5+ messages in thread
From: Baruch Siach @ 2017-01-08 19:02 UTC (permalink / raw)
  To: buildroot

Hi J?rg,

On Sun, Jan 08, 2017 at 07:32:37PM +0100, J?rg Krause wrote:
> On Sun, 2017-01-08 at 19:45 +0200, Baruch Siach wrote:
> > On Sun, Jan 08, 2017 at 12:58:51PM +0100, J?rg Krause wrote:
> > > I am able to generate the sd card image and copy it to the sd card
> > > using Suses imagewriter. The board boots fine. However, the rootfs
> > > size
> > > is not 512MB as expected:
> > > 
> > > # df -hT
> > > Filesystem???????????Type????????????Size??????Used Available Use%
> > > Mounted on
> > > /dev/root????????????ext4???????????38.7M?????37.9M?????????0 100%
> > > /
> > > devtmpfs?????????????devtmpfs??????501.9M?????????0????501.9M???0%
> > > /dev
> > > tmpfs????????????????tmpfs?????????502.4M?????????0????502.4M???0%
> > > /dev/shm
> > > tmpfs????????????????tmpfs?????????502.4M??????3.9M????498.4M???1%
> > > /tmp
> > > tmpfs????????????????tmpfs?????????502.4M?????24.0K????502.4M???0%
> > > /run
> > > 
> > > I am not able to create any file larger file on the filesystem nor
> > > start some programs.
> > > 
> > > What am I missing here? Can somebody enlighten me please :-)
> > 
> > Unless you set BR2_TARGET_ROOTFS_EXT2_BLOCKS and
> > BR2_TARGET_ROOTFS_EXT2_INODES?
> > you'll get a minimal ext2/3/4 filesystem with no free space.
> > Alternatively,?
> > you may run on target the resize2fs tool from the e2fsprogs package
> > on the?
> > root filesystem to expand the filesystem to the size of the
> > partition.
> 
> Which values should I use for blocks and inodes if I set the rootfs
> size to 512M in genimage.cfg? Any suggestions?

The Buildroot package/mke2img/mke2img script assumes a 1KB block size, so you 
need 512K blocks.

The number of inodes determines the number of file entries in the filesystem. 
A safe "inode ratio" default is one inode per 16384 bytes. That is the native 
e2fsprogs package mke2fs tool default, but YMMV.

baruch

-- 
     http://baruch.siach.name/blog/                  ~. .~   Tk Open Systems
=}------------------------------------------------ooO--U--Ooo------------{=
   - baruch at tkos.co.il - tel: +972.52.368.4656, http://www.tkos.co.il -

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Buildroot] Need help with genimage
  2017-01-08 19:02     ` Baruch Siach
@ 2017-01-08 19:07       ` Jörg Krause
  0 siblings, 0 replies; 5+ messages in thread
From: Jörg Krause @ 2017-01-08 19:07 UTC (permalink / raw)
  To: buildroot

On Sun, 2017-01-08 at 21:02 +0200, Baruch Siach wrote:
> Hi J?rg,
> 
> On Sun, Jan 08, 2017 at 07:32:37PM +0100, J?rg Krause wrote:
> > On Sun, 2017-01-08 at 19:45 +0200, Baruch Siach wrote:
> > > On Sun, Jan 08, 2017 at 12:58:51PM +0100, J?rg Krause wrote:
> > > > I am able to generate the sd card image and copy it to the sd
> > > > card
> > > > using Suses imagewriter. The board boots fine. However, the
> > > > rootfs
> > > > size
> > > > is not 512MB as expected:
> > > > 
> > > > # df -hT
> > > > Filesystem???????????Type????????????Size??????Used Available
> > > > Use%
> > > > Mounted on
> > > > /dev/root????????????ext4???????????38.7M?????37.9M?????????0
> > > > 100%
> > > > /
> > > > devtmpfs?????????????devtmpfs??????501.9M?????????0????501.9M??
> > > > ?0%
> > > > /dev
> > > > tmpfs????????????????tmpfs?????????502.4M?????????0????502.4M??
> > > > ?0%
> > > > /dev/shm
> > > > tmpfs????????????????tmpfs?????????502.4M??????3.9M????498.4M??
> > > > ?1%
> > > > /tmp
> > > > tmpfs????????????????tmpfs?????????502.4M?????24.0K????502.4M??
> > > > ?0%
> > > > /run
> > > > 
> > > > I am not able to create any file larger file on the filesystem
> > > > nor
> > > > start some programs.
> > > > 
> > > > What am I missing here? Can somebody enlighten me please :-)
> > > 
> > > Unless you set BR2_TARGET_ROOTFS_EXT2_BLOCKS and
> > > BR2_TARGET_ROOTFS_EXT2_INODES?
> > > you'll get a minimal ext2/3/4 filesystem with no free space.
> > > Alternatively,?
> > > you may run on target the resize2fs tool from the e2fsprogs
> > > package
> > > on the?
> > > root filesystem to expand the filesystem to the size of the
> > > partition.
> > 
> > Which values should I use for blocks and inodes if I set the rootfs
> > size to 512M in genimage.cfg? Any suggestions?
> 
> The Buildroot package/mke2img/mke2img script assumes a 1KB block
> size, so you?
> need 512K blocks.
> 
> The number of inodes determines the number of file entries in the
> filesystem.?
> A safe "inode ratio" default is one inode per 16384 bytes. That is
> the native?
> e2fsprogs package mke2fs tool default, but YMMV.

I see! Many thanks!

I wonder why only one defconfig (nanopi_neo) is setting the blocks and
inodes. However, maybe it's best to enable the resize2fs package by
default in the defconfig and add a comment in the readme of the board.

J?rg

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2017-01-08 19:07 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-01-08 11:58 [Buildroot] Need help with genimage Jörg Krause
2017-01-08 17:45 ` Baruch Siach
2017-01-08 18:32   ` Jörg Krause
2017-01-08 19:02     ` Baruch Siach
2017-01-08 19:07       ` Jörg Krause

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox