Commit Graph

23 Commits

Author SHA1 Message Date
Michael Marineau
0c1198c3bb feat(disk_util): Switch from SYSLINUX's gptmbr.bin to mbr.bin
cgpt now supports generating hybrid MBRs and the classic style mbr.bin
from any version of SYSLINUX should work the same with the hybrid MBR.
The other code, gptmbr.bin, changes after SYSLINUX 3. Switching lets me
play with different versions of SYSLINUX without breaking everything.

With this change all images feature a hybrid MBR so the special case for
some VM platforms has been removed.
2014-03-12 15:38:34 -07:00
Michael Marineau
87c0814006 fix(disk_util): Fix undefined variable introduce in 4dbdb391 2014-03-06 12:41:07 -08:00
Michael Marineau
4dbdb391a4 feat(disk_util): Switch to btrfs for root filesystem in /usr images
This is all that is required to swap out ext4 for btrfs.
No btrfs user space tools or auto-resize support yet.
2014-03-05 18:52:23 -08:00
Michael Marineau
a022642e54 rename(disk_layout): Remove the legacy use of "legacy" 2014-03-05 15:57:22 -08:00
Michael Marineau
453c784779 fix(build_image): Only clear UUID on rootfs/usr filesystems.
The funky UUID and other special settings should only be applied to
coreos-rootfs and coreos-usr partitions which will never be fscked. When
STATE becomes ROOT in -usr images it gets fsked while mounted read-only
and fsck updates the filesystem's UUID if it is blank. Turns out this
causes disagreement between the kernel and the disk leading to bad
things. A related issue was fixed in a newer version of tune2fs but
unless I missed it the same bugfix didn't make it into e2fsck so
updating wouldn't resolve the issue.

http://e2fsprogs.sourceforge.net/e2fsprogs-release.html#1.42.9
2014-01-17 21:41:18 -08:00
Michael Marineau
19ecd4572f fix(disk_util): Sort mount order instead of special casing /
Now that /usr is a mount point we need to make sure it gets mounted
before /usr/share/oem. Simply sorting by path length works well enough.
2014-01-05 18:39:47 -08:00
Michael Marineau
ba532952b1 fix(disk_util): Fix layout inheritance in config verification. 2014-01-05 13:55:52 -08:00
Michael Marineau
e066f91ca3 feat(disk_util): Add tune command, controlling fs read-only hack.
Now disk_util is aware of the weird ext2 read-only hack, both by
providing a command to manipulate it and support in the mount command to
automatically set the 'ro' mount option for filesystems with it.

Making mount aware of the hack makes it much easier to mount prod
images with a mix read-only and read-write filesystems.
2014-01-04 21:00:45 -08:00
Michael Marineau
89b61ac7b0 fix(disk_util): Rework how code handles existing images.
Read partition size and offset into the normal partition config with the
prefix 'image_' for each key.
2014-01-04 21:00:45 -08:00
Michael Marineau
1ee1840a89 fix(disk_util): Fix mount --read_only option. 2014-01-04 16:55:03 -08:00
Michael Marineau
c992d45dd3 feat(disk_util): Add resize command.
Based on the new gpt update code add the ability to resize filesystems
in existing images. Usually just the last (STATE) partition is resized.
2014-01-03 18:14:12 -08:00
Michael Marineau
ebc83599b3 fix(disk_util): Move loop device setup code to generic function 2014-01-03 17:59:15 -08:00
Michael Marineau
805cc65ffd fix(disk_util): Add option to safely rewrite partition table.
write_gpt --update <img> will read an existing image and make sure all
existing partitions will not get moved or truncated in the new layout.
This is mostly useful for resizing the final partition or just rewriting
metadata like partition types and labels.
2014-01-03 16:40:54 -08:00
Michael Marineau
5afd720956 fix(disk_util): Move existing image reading code to new function.
This will allow the code to be shared, making it possible to safely
resize existing images with disk_util.
2014-01-03 16:40:21 -08:00
Michael Marineau
359505490d fix(disk_util): Install syslinux as part of filesystem formatting.
This means scripts later don't need to deal with the ESP block device
directly, they can just copy the config files into place.
2013-12-30 16:12:43 -08:00
Michael Marineau
8ca62121d9 feat(disk_util): Add mount and unmount commands.
This will replace the assorted mix of mount/umount scripts.
2013-12-30 16:12:04 -08:00
Michael Marineau
ba45152b4b feat(disk_util): Add 'format' command to create filesystems in an image.
This will replace the less flexible code in base_image_util.sh
2013-12-30 16:12:04 -08:00
Michael Marineau
ab23353448 fix(disk_util): Rework config parsing.
Merge GetPartitionTable and partition alignment from WritePartitionTable
into LoadPartitionConfig so that all this config manipulation code is in
one place and inheritance from the 'base' layout is more predictable.
2013-12-30 16:12:04 -08:00
Michael Marineau
0f4b52134a fix(disk_util): Convert partition list to an object.
Hey, 'num' is a primary key! Lets use it and avoid pointless looping.
2013-12-30 16:12:04 -08:00
Michael Marineau
576c8996f4 fix(disk_util): Remove support for --adjust_part
This isn't a feature we've been using as far as I know and if someone
needs a custom partition layout it's probably better to just add it to
the json file. Removing this avoids some complexity.
2013-12-30 16:12:02 -08:00
Michael Marineau
cc341f856b fix(disk_util): Merge write_mbr into write_gpt
No need for this to be a different command.
2013-12-30 16:10:46 -08:00
Michael Marineau
de9ff4fc8e fix(disk_util): Rework how argument parsing/passing works.
Move from optparse to argparse. Move layout file and layout type to
global options with reasonable default values so every command doesn't
need to them. Adjust calling scripts to match.

For now layout type is being passed via an environment variable
DISK_LAYOUT_TYPE but this is a temporary situation.
2013-12-30 16:10:46 -08:00
Michael Marineau
fdefbf704c add(disk_util): Rename cgpt.py to disk_util.
Use a more generic name so cgpt.py and disk_layout_util.sh can be merged
into one tool. Wrappers around wrappers around wrappers are tedious.
2013-12-30 16:10:46 -08:00