diff --git a/software/rootfs.README b/software/rootfs.README new file mode 100644 index 0000000000000000000000000000000000000000..5fb1e82593340e2a0a04f664de23a18b68b6bfcd --- /dev/null +++ b/software/rootfs.README @@ -0,0 +1,56 @@ +This file explain how to easily generate a rootfs for slapcontainer, +explaining how to generate a debian rootfs. + +This can be used in order to generate any rootfs. + +Requirements: +============= + + Any Linux distro with the following programs installed : + + * LXC userland tools (for generating the rootfs) + * debootstrap (in order to use lxc-debian script) + * dpkg (a dependency of debootstrap) + * Qemu tools (providing qemu-img) + +Step by step instructions explained: +==================================== + + First we need to generate a raw image. + + 1. Run :: + $ qemu-img create -f raw image-name.raw SIZE + + 2. Now format it (in this example we will format in in ext4) :: + $ mkfs.ext4 image-name.raw + + We will used lxc-debian script provided in lxc tools in order to + generate the rootfs. + + lxc-debian is run this way :: + lxc-debian -p /path/ + + lxc-debian will create a subdirectory in /path/ named “rootfsâ€, + and a configuration file in /path/. + + So in order to generate the rootfs on the raw image, create rootfs + directory and mount the raw img in it. + + 3. :: + $ mkdir -p /path/rootfs/ + $ mount image-name.raw /path/rootfs + + 4. Next, run the lxc-debian script :: + $ lxc-debian -p /path/ + + Dont forget to change the default password, before unmount it. + + 5. :: + $ sudo chroot /path/rootfs/ /bin/passwd + + 6. :: + $ umount /path/rootfs + + Next, you can archive it using sparse tar, and compress it. + 7. :: + $ tar -Sc image-name.raw | pxz -T8 > image-name.tar.gz