diskimage-builder/diskimage_builder/lib
Ian Wienand 6c394f5746 Pass all blockdevices to bootloader
Currently we only export "image-block-device" which is the loopback
device (/dev/loopX) for the underlying image.  This is the device we
install grub to (from inside the chroot ...)

This is ok for x86, but is insufficient for some platforms like PPC
which have a separate boot partition.  They do not want to install to
the loop device, but do things like dd special ELF files into special
boot partitions.

The first problem seems to be that in level1/partitioning.py we have a
whole bunch of different paths that either call partprobe on the loop
device, or kpartx.  We have _all_part_devices_exist() that gates the
kpartx for unknown reasons.  We have detach_loopback() that does not
seem to remove losetup created devices.  I don't think this does
cleanup if it uses kpartx correctly.  It is extremley unclear what's
going to be mapped where.

This moves to us *only* using kpartx to map the partitions of the loop
device.  We will *not* call partprobe and create the /dev/loopXpN
devices and will only have the devicemapper nodes kpartx creates.
This seems to be best.  Cleanup happens inside partitioning.py.
practice.  Deeper thinking about this, and more cleanup of the
variables will be welcome.

This adds "image-block-devices" (note the extra "s") which exports all
the block devices with name and path.  This is in a string format that
can be eval'd to an array (you can't export arrays).

This is then used in a follow-on
(I0918e8df8797d6dbabf7af618989ab7f79ee9580) to pick the right
partition on PPC.

Change-Id: If8e33106b4104da2d56d7941ce96ffcb014907bc
2017-06-08 17:14:22 +10:00
..
common-defaults Adding aarch64 support for CentOS7 2017-03-22 10:46:54 -04:00
common-functions Pass all blockdevices to bootloader 2017-06-08 17:14:22 +10:00
dib-run-parts Don't provide dib-run-parts 2017-04-05 13:11:20 +10:00
die Move elements & lib relative to diskimage_builder package 2016-11-01 17:27:41 -07:00
disk-image-create Pass all blockdevices to bootloader 2017-06-08 17:14:22 +10:00
img-defaults Move elements & lib relative to diskimage_builder package 2016-11-01 17:27:41 -07:00
img-functions Move to subparsers 2017-05-11 21:03:33 +10:00
ramdisk-defaults Move elements & lib relative to diskimage_builder package 2016-11-01 17:27:41 -07:00
ramdisk-functions Move elements & lib relative to diskimage_builder package 2016-11-01 17:27:41 -07:00
ramdisk-image-create Move diskimage-image-create to an entry point 2016-11-02 05:12:11 +00:00