[Fedora-livecd-list] List of previous issues with livecd-tools which should be addressed

Richard Shaw hobbes1069 at gmail.com
Thu Aug 19 18:14:21 UTC 2010


On Wed, Aug 18, 2010 at 11:00 PM, Jasper Hartline
<jasper.hartline at gmail.com> wrote:
> On Wed, Aug 18, 2010 at 7:15 PM, Richard Shaw <hobbes1069 at gmail.com> wrote:
>>> Hm.
>>> we divide (x86size + x64size) by block_size -> 2048 to get count for
>>> passing to dd.
>>> The way I understand it, mkisofs pads the ISO up to the last 2048
>>> divisible block.
>>> There shouldn't be a reason why a ISO file made with mkisofs is not
>>> divisible by 2048.
>>
>> Ok, I guess I'm confused here. If mkisofs pads the data, why do we
>> have to calculate the number of 2048k blocks at all? If we do need to
>> know the number of 2048k blocks then we need floating point math since
>> integer math will drop the remainder.
>
> Just so we can pass a block size of 2048 to dd, and have the count we
> need of the number of
> blocks instead of using bs=1 count=sizeof ISO files.
> The file dd creates will need to at least be as large as the two ISO
> files combined.

Ok, I understand what you're doing now, but I still think I'm right.
If you use straight integer math, it does not round up for the last
block. It does not round at all, it just drops the remainder. The
easiest solution probably is to just add 1 to whatever size /
BLOCK_SIZE returns.

> Instead I can dd an image file, loopback it, partition it
> format it at an offset starting on partition 1. losetup with an offset
> , mount ISO files, copy files, write syslinux.cfg and install syslinux to it.
> Close it up and you have the resulting target.

Actually, I think we can partition it first and maybe even create the
file system, then loop mount it to write the files. I've had some
partial success with using pyparted (see below).

---
I used this[1] as a partial guide.

I created a disk image from the shell:
# dd if=/dev/zero of=disk_test.img bs=1 count=1 seek=100M
1+0 records in
1+0 records out
1 byte (1 B) copied, 4.6739e-05 s, 21.4 kB/s

Then brought up python:
# python
Python 2.6.4 (r264:75706, Jun  4 2010, 18:20:31)
[GCC 4.4.4 20100503 (Red Hat 4.4.4-2)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import parted
>>> parted.getDevice(r'/root/disk_test.img')
<parted.device.Device object at 0x2568490>
>>> disk = parted.getDevice(r'/root/disk_test.img')
>>> print disk
parted.Device instance --
  model:   path: /root/disk_test.img  type: 5
  sectorSize: 512  physicalSectorSize:  512
  length: 204800  openCount: 0  readOnly: False
  externalMode: False  dirty: False  bootDirty: False
  host: 0  did: 0  busy: False
  hardwareGeometry: (1600, 4, 32)  biosGeometry: (1600, 4, 32)
  PedDevice: <_ped.Device object at 0x24ad950>
>>> type(disk)
<class 'parted.device.Device'>
>>> disk.getSize()
100.0
>>> disk1 = parted.Disk(disk)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "<string>", line 2, in __init__
  File "/usr/lib64/python2.6/site-packages/parted/decorators.py", line
31, in localeC
    ret = fn(*args, **kwds)
  File "/usr/lib64/python2.6/site-packages/parted/disk.py", line 51, in __init__
    self.__disk = _ped.Disk(device.getPedDevice())
_ped.DiskLabelException: /root/disk_test.img: unrecognised disk label
>>>

Now I haven't found the method to create a disk label. There is a
pyparted mailing list so we may have to go there for help.

Richard

[1] http://www.infohit.net/blog/post/virtual-disk-image-tools.html


More information about the livecd mailing list