~smoser/cloud-initramfs-tools:rooturl-fsimage

Last commit made on 2020-05-12
Get this branch:
git clone -b rooturl-fsimage https://git.launchpad.net/~smoser/cloud-initramfs-tools
Only Scott Moser can upload to this branch. If you are Scott Moser please log in for upload directions.

Branch merges

Branch information

Name:
rooturl-fsimage
Repository:
lp:~smoser/cloud-initramfs-tools

Recent commits

c64be4d... by Scott Moser

rooturl support for "nested" mounts.

This adds support for "nested" mounts to rooturl.

A nested mount is in simplist for something like:

 root=LABEL=my-images:file=my-squashfs.img

Which instructs the initramfs to mount a filesystem with the
label 'my-images' and then loop mount a 'my-squashfs.img' inside it.
A live cd basically contains an image on a cdrom.

The goal of this code is to mimic that sort of behavior but more
generically.

 # Example:

  qemu-img create -f raw 10G disk.img
  mkfs.ext2 -L images disk.img
  mount -o loop disk.img /mnt
  wget -O /mnt/bionic.img \
    http://images.maas.io/ephemeral-v3/daily/bionic/amd64/20200507/squashfs
  umount /mnt

Then boot that with a kernel command line like:

   root=img:LABEL=images:bionic.img

This actually does work right now, booting with something like:

  cmdline="console=ttyS0 root=img:LABEL=images:file=squashfs overlayroot=tmpfs"
  qemu-system-x86_64 -enable-kvm \
    -device virtio-scsi-pci,id=virtio-scsi-xkvm \
    -object rng-random,filename=/dev/urandom,id=objrng0 \
    -device virtio-rng-pci,rng=objrng0,id=rng0 \
    -device virtio-net-pci,netdev=net00 \
    -netdev type=user,id=net00 \
    -drive file=disk.img,id=disk00,if=none,format=raw,index=0 \
    -device virtio-blk,drive=disk00,serial=disk.img \
    -m 768 -serial mon:stdio \
    -kernel boot-kernel \
    -initrd boot-initrd.new \
    -append "$cmdline"

 # TODO
 ## handle ROOT_FLAGS in the final mount

 ## copy to tmpfs and unmount
I'd like to have some syntax which says copy the file to a tmpfs, and
unmount under it.

So that something like:
   LABEL=images:tmpfile=my-squash.img

would do:
   mount images by label
   copy my-squash to /initramfs/tmp-images/my-squash.img
   mount /initramfs/tmp-images/my-squash.img
   umount /dev/disk/by-label/images

Then we'd be all in memory and a cdrom could be ejected.

 ## add support for 'fsimage-layered' support in curtin
I'd like to be able to use the un-modified squashfs images from
lxd (or maas) and overlay some changes on top, such as to
/etc/passwd or maybe /etc/cloud/ or something.

That would greatly ease the creation of derivative live-cds.
So that I could script something that would
 - pull kernel and initramfs
 - pull disk image / squashfs
 - use mkisofs (and grub) It would ease creation of live-cds

'fsimage-layered' as described at
https://curtin.readthedocs.io/en/latest/topics/config.html
is a mechanism that curtin uses.

c792d0f... by Scott Moser

update changelog

adb0d6c... by Scott Moser

Add dependency on flock for growroot's use of growpart.

growpart was modified to use flock, so we have to make sure that
that gets put into the initramfs or growroot module won't work.

LP: #1834875

f6e65ed... by Scott Moser

releasing package cloud-initramfs-tools version 0.44ubuntu1

This is what was uploaded to ubuntu for 0.44ubuntu1.

5be1889... by Scott Moser

update changelog

f6e57ad... by dann frazier

copymods: Fix typo parsing copymods= parameters in /proc/cmdline.

Normally, copymods will exit and do nothing if the target root
already contains /lib/modules/<version>. It intended intended to allow
overriding that behavior with kernel command line argument of
string 'copymods=force'.

The parsing of that command line was simply broken.
The result was simply that it would always exit in the case that
a modules directory already existed.

cd133bb... by Scott Moser

update changelog

b977fa1... by dann frazier

copymods: Fix usage of modules in initramfs after copymods script.

The way we were symlinking, modules were being exposed under
/lib/modules/$kver/$kver instead of /lib/modules/$kver, placing them
out of reach of modprobe.

This only affected the use of the initramfs after copymods 'init-bottom'
script ran. It would not affect initramfs prior to that point or
the "real root".

LP: #1766723

f59b35d... by Scott Moser

releasing package cloud-initramfs-tools version 0.43ubuntu1

9f4f6ca... by Scott Moser

update changelog