Bug 523550 - livecd-iso-to-disk.sh "space needed to be free to fit" calc wrong
Summary: livecd-iso-to-disk.sh "space needed to be free to fit" calc wrong
Keywords:
Status: CLOSED NEXTRELEASE
Alias: None
Product: Fedora
Classification: Fedora
Component: livecd-tools
Version: rawhide
Hardware: All
OS: Linux
low
medium
Target Milestone: ---
Assignee: Jeremy Katz
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2009-09-15 22:16 UTC by Jason Farrell
Modified: 2009-09-16 21:55 UTC (History)
1 user (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2009-09-16 21:55:13 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)

Description Jason Farrell 2009-09-15 22:16:41 UTC
livecd-iso-to-disk.sh in livecd-tools-027 needs a small fix (for my previous patch) to show the correct amount of space needed to be freed before it can fit a new liveusb image + overlays. This is only noticed when you're replacing an existing an usblive with another, and not --format'ing or initially empty.

patch summary:
-  echo "= To fit, free or decrease requested size total by:  $(($tba - $free + $tbd))"
+  echo "= To fit, free or decrease requested size total by:  $(($tba - $free - $tbd))"



Example reproduced below:


[root@nano tmp]# qemu-img create usb.img 2G
Formatting 'usb.img', fmt=raw, size=2097152 kB
[root@nano tmp]# losetup /dev/loop0 usb.img
[root@nano tmp]# mkfs.vfat /dev/loop0
mkfs.vfat 3.0.1 (23 Nov 2008)
Loop device does not match a floppy size, using default hd params
[root@nano tmp]# ./tools_livecd-iso-to-disk.sh.orig --noverify --overlay-size-mb 2047 /0safe/iso-images/F12-Snap2-i686-Live/F12-Snap2-i686-Live.iso /dev/loop0
Unable to fit live image + overlay on available space on USB stick
+ Size of live image:  634
+ Overlay size:  2047
---------------------------
= Requested:  2681
- Available:  2044
---------------------------
= To fit, free or decrease requested size total by:  637
Cleaning up to exit...
[root@nano tmp]# ./tools_livecd-iso-to-disk.sh.orig --noverify --overlay-size-mb 1024 /0safe/iso-images/F12-Snap2-i686-Live/F12-Snap2-i686-Live.iso /dev/loop0
Copying live image to USB stick
Updating boot config file
Initializing persistent overlay file
1024+0 records in
1024+0 records out
1073741824 bytes (1.1 GB) copied, 5.04073 s, 213 MB/s
Installing boot loader
USB stick set up as live image!
[root@nano tmp]# ./tools_livecd-iso-to-disk.sh.orig --noverify --overlay-size-mb 2047 /0safe/iso-images/F12-Snap2-i686-Live/F12-Snap2-i686-Live.iso /dev/loop0
Unable to fit live image + overlay on available space on USB stick
+ Size of live image:  634
+ Overlay size:  2047
---------------------------
= Requested:  2681
- Available:  2030
---------------------------
= To fit, free or decrease requested size total by:  3967
Cleaning up to exit...

###### wrong ----------------------------------------^^^^
###### compared with the fix:

[root@nano tmp]# ./tools_livecd-iso-to-disk.sh --noverify --overlay-size-mb 2047 /0safe/iso-images/F12-Snap2-i686-Live/F12-Snap2-i686-Live.iso /dev/loop0
Unable to fit live image + overlay on available space on USB stick
+ Size of live image:  634
+ Overlay size:  2047
---------------------------
= Requested:  2681
- Available:  2030
---------------------------
= To fit, free or decrease requested size total by:  651

###### right ----------------------------------------^^^

Comment 1 Jason Farrell 2009-09-16 21:55:13 UTC
i see the fix in git. thanks.


Note You need to log in before you can comment on or make changes to this bug.