--image_size is broken

Bug #778426 reported by Zygmunt Krynicki
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Linaro Image Tools
Fix Released
Low
Loïc Minier

Bug Description

After trying --image_size=4GB and failing I used --image_size=$(expr 1000 \* 1000 \* 1000 \* 4). This failed again in a rather amusing way, instructing me to use 4G instead.

zyga@W510:~/Pobrane$ linaro-media-create --image_file nano-daily.img --dev beagle --rootfs ext4 --hwpack hwpack_linaro-omap3_20110426-0_armel_supported.tar.gz --hwpack-force-yes --image_size=$(expr 4 \* 1000 \* 1000 \* 1000) --binary linaro-natty-nano-tar-20110426-0.tar.gz
------------------------------------------------------------
Installing (linaro-hwpack-install) hwpack_linaro-omap3_20110426-0_armel_supported.tar.gz in target rootfs.
Unpacking hardware pack ...Done
Updating apt package lists ...
Ign file: ./ InRelease
Ign file: ./ Release.gpg
Ign file: ./ Release
Ign file: ./ Translation-en
Ign http://ppa.launchpad.net natty InRelease
Get:1 http://ppa.launchpad.net natty Release.gpg [316 B]
Ign http://ports.ubuntu.com natty InRelease
Ign http://ports.ubuntu.com natty-security InRelease
Ign http://ports.ubuntu.com natty-updates InRelease
Get:2 http://ppa.launchpad.net natty Release [9753 B]
Get:3 http://ports.ubuntu.com natty Release.gpg [198 B]
Get:4 http://ports.ubuntu.com natty-security Release.gpg [198 B]
Get:5 http://ports.ubuntu.com natty-updates Release.gpg [198 B]
Get:6 http://ppa.launchpad.net natty/main armel Packages [10.4 kB]
Ign http://ppa.launchpad.net natty/main TranslationIndex
Ign http://ppa.launchpad.net natty/main Translation-en
Get:7 http://ports.ubuntu.com natty Release [39.8 kB]
Get:8 http://ports.ubuntu.com natty-security Release [23.2 kB]
Get:9 http://ports.ubuntu.com natty-updates Release [27.2 kB]
Get:10 http://ports.ubuntu.com natty/main armel Packages [1528 kB]
Get:11 http://ports.ubuntu.com natty/universe armel Packages [5867 kB]
Ign http://ports.ubuntu.com natty/main TranslationIndex
Ign http://ports.ubuntu.com natty/universe TranslationIndex
Get:12 http://ports.ubuntu.com natty-security/main armel Packages [17.1 kB]
Get:13 http://ports.ubuntu.com natty-security/universe armel Packages [7027 B]
Ign http://ports.ubuntu.com natty-security/main TranslationIndex
Ign http://ports.ubuntu.com natty-security/universe TranslationIndex
Get:14 http://ports.ubuntu.com natty-updates/main armel Packages [73.3 kB]
Get:15 http://ports.ubuntu.com natty-updates/universe armel Packages [24.1 kB]
Ign http://ports.ubuntu.com natty-updates/main TranslationIndex
Ign http://ports.ubuntu.com natty-updates/universe TranslationIndex
Ign http://ports.ubuntu.com natty/main Translation-en
Ign http://ports.ubuntu.com natty/universe Translation-en
Ign http://ports.ubuntu.com natty-security/main Translation-en
Ign http://ports.ubuntu.com natty-security/universe Translation-en
Ign http://ports.ubuntu.com natty-updates/main Translation-en
Ign http://ports.ubuntu.com natty-updates/universe Translation-en
Fetched 7628 kB in 56s (136 kB/s)
Reading package lists...
W: Duplicate sources.list entry http://ports.ubuntu.com/ubuntu-ports/ natty/main armel Packages (/var/lib/apt/lists/ports.ubuntu.com_ubuntu-ports_dists_natty_main_binary-armel_Packages)
W: Duplicate sources.list entry http://ports.ubuntu.com/ubuntu-ports/ natty/universe armel Packages (/var/lib/apt/lists/ports.ubuntu.com_ubuntu-ports_dists_natty_universe_binary-armel_Packages)
W: Duplicate sources.list entry http://ports.ubuntu.com/ubuntu-ports/ natty-security/main armel Packages (/var/lib/apt/lists/ports.ubuntu.com_ubuntu-ports_dists_natty-security_main_binary-armel_Packages)
W: Duplicate sources.list entry http://ports.ubuntu.com/ubuntu-ports/ natty-security/universe armel Packages (/var/lib/apt/lists/ports.ubuntu.com_ubuntu-ports_dists_natty-security_universe_binary-armel_Packages)
W: Duplicate sources.list entry http://ports.ubuntu.com/ubuntu-ports/ natty-updates/main armel Packages (/var/lib/apt/lists/ports.ubuntu.com_ubuntu-ports_dists_natty-updates_main_binary-armel_Packages)
W: Duplicate sources.list entry http://ports.ubuntu.com/ubuntu-ports/ natty-updates/universe armel Packages (/var/lib/apt/lists/ports.ubuntu.com_ubuntu-ports_dists_natty-updates_universe_binary-armel_Packages)
W: You may want to run apt-get update to correct these problems
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following NEW packages will be installed:
  devio flash-kernel linux-firmware linux-image-2.6.38-1002-linaro-omap linux-image-linaro-omap
  u-boot-linaro-omap3-beagle u-boot-tools uboot-mkimage wireless-crda x-loader-omap3-beagle
0 upgraded, 10 newly installed, 0 to remove and 6 not upgraded.
Need to get 0 B/35.7 MB of archives.
After this operation, 0 B of additional disk space will be used.
WARNING: The following packages cannot be authenticated!
  wireless-crda linux-image-2.6.38-1002-linaro-omap devio flash-kernel linux-firmware linux-image-linaro-omap
  u-boot-linaro-omap3-beagle u-boot-tools uboot-mkimage x-loader-omap3-beagle
debconf: delaying package configuration, since apt-utils is not installed
Can not write log, openpty() failed (/dev/pts not mounted?)
Selecting previously deselected package wireless-crda.
(Reading database ... 9665 files and directories currently installed.)
Unpacking wireless-crda (from .../wireless-crda_1.13_armel.deb) ...
Selecting previously deselected package linux-image-2.6.38-1002-linaro-omap.
Unpacking linux-image-2.6.38-1002-linaro-omap (from .../linux-image-2.6.38-1002-linaro-omap_2.6.38-1002.3_armel.deb) ...
Done.
Selecting previously deselected package devio.
Unpacking devio (from .../devio_1.2-1build1_armel.deb) ...
Selecting previously deselected package flash-kernel.
Unpacking flash-kernel (from .../flash-kernel_2.28ubuntu19_armel.deb) ...
Selecting previously deselected package linux-firmware.
Unpacking linux-firmware (from .../linux-firmware_1.52_all.deb) ...
Selecting previously deselected package linux-image-linaro-omap.
Unpacking linux-image-linaro-omap (from .../linux-image-linaro-omap_2.6.38.1002.3_armel.deb) ...
Selecting previously deselected package u-boot-linaro-omap3-beagle.
Unpacking u-boot-linaro-omap3-beagle (from .../u-boot-linaro-omap3-beagle_2011.04.2-0ubuntu1_armel.deb) ...
Selecting previously deselected package u-boot-tools.
Unpacking u-boot-tools (from .../u-boot-tools_2010.12-2_armel.deb) ...
Selecting previously deselected package uboot-mkimage.
Unpacking uboot-mkimage (from .../uboot-mkimage_2010.12-2_all.deb) ...
Selecting previously deselected package x-loader-omap3-beagle.
Unpacking x-loader-omap3-beagle (from .../x-loader-omap3-beagle_1.5.0+git20110325+b6bbfe7-1ubuntu1_armel.deb) ...
Can not write log, openpty() failed (/dev/pts not mounted?)
Setting up wireless-crda (1.13) ...
Setting up linux-image-2.6.38-1002-linaro-omap (2.6.38-1002.3) ...
Running depmod.
update-initramfs: Generating /boot/initrd.img-2.6.38-1002-linaro-omap
/bin/df: Warning: cannot read table of mounted file systems: No such file or directory
Examining /etc/kernel/postinst.d.
run-parts: executing /etc/kernel/postinst.d/initramfs-tools 2.6.38-1002-linaro-omap /boot/vmlinuz-2.6.38-1002-linaro-omap
Setting up devio (1.2-1build1) ...
Setting up flash-kernel (2.28ubuntu19) ...
Setting up linux-firmware (1.52) ...
Setting up linux-image-linaro-omap (2.6.38.1002.3) ...
Setting up u-boot-linaro-omap3-beagle (2011.04.2-0ubuntu1) ...
Setting up u-boot-tools (2010.12-2) ...
Setting up uboot-mkimage (2010.12-2) ...
Setting up x-loader-omap3-beagle (1.5.0+git20110325+b6bbfe7-1ubuntu1) ...
Done
Cleaning up ...W: Duplicate sources.list entry http://ports.ubuntu.com/ubuntu-ports/ natty/main armel Packages (/var/lib/apt/lists/ports.ubuntu.com_ubuntu-ports_dists_natty_main_binary-armel_Packages)
W: Duplicate sources.list entry http://ports.ubuntu.com/ubuntu-ports/ natty/universe armel Packages (/var/lib/apt/lists/ports.ubuntu.com_ubuntu-ports_dists_natty_universe_binary-armel_Packages)
W: Duplicate sources.list entry http://ports.ubuntu.com/ubuntu-ports/ natty-security/main armel Packages (/var/lib/apt/lists/ports.ubuntu.com_ubuntu-ports_dists_natty-security_main_binary-armel_Packages)
W: Duplicate sources.list entry http://ports.ubuntu.com/ubuntu-ports/ natty-security/universe armel Packages (/var/lib/apt/lists/ports.ubuntu.com_ubuntu-ports_dists_natty-security_universe_binary-armel_Packages)
W: Duplicate sources.list entry http://ports.ubuntu.com/ubuntu-ports/ natty-updates/main armel Packages (/var/lib/apt/lists/ports.ubuntu.com_ubuntu-ports_dists_natty-updates_main_binary-armel_Packages)
W: Duplicate sources.list entry http://ports.ubuntu.com/ubuntu-ports/ natty-updates/universe armel Packages (/var/lib/apt/lists/ports.ubuntu.com_ubuntu-ports_dists_natty-updates_universe_binary-armel_Packages)
W: You may want to run apt-get update to correct these problems
Done
------------------------------------------------------------
proc umounted
Traceback (most recent call last):
  File "/usr/bin/linaro-media-create", line 146, in <module>
    args.should_format_rootfs, args.should_align_boot_part)
  File "/usr/lib/pymodules/python2.7/linaro_image_tools/media_create/partitions.py", line 111, in setup_partitions
    image_size_in_bytes = convert_size_to_bytes(image_size)
  File "/usr/lib/pymodules/python2.7/linaro_image_tools/media_create/partitions.py", line 342, in convert_size_to_bytes
    "or G[bytes]" % size)
ValueError: Unknown size format: 4000000000. Use K[bytes], M[bytes] or G[bytes]

Related branches

Revision history for this message
Loïc Minier (lool) wrote :

NB: you might want to use $((4 * 1024)) rather than $(expr 4 \* 1024); also consider using multiples of 1024 rather than 1000 for SD/MMC sizes and QEMU image sizes.

Changed in linaro-image-tools:
assignee: nobody → Loïc Minier (lool)
importance: Undecided → Low
status: New → In Progress
Revision history for this message
Mattias Backman (mabac) wrote :

This was fixed by the code that has been merged, right?

Changed in linaro-image-tools:
milestone: none → 0.4.6
status: In Progress → Fix Committed
Mattias Backman (mabac)
Changed in linaro-image-tools:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.