diff --git a/docs/create-image-file.md b/docs/create-image-file.md index 5e016b3..7737269 100644 --- a/docs/create-image-file.md +++ b/docs/create-image-file.md @@ -1,15 +1,35 @@ -1. download image -1. extract image -1. enlarge image with 'truncate' -1. mount as loopback device -1. modify image - 1. modify partition table with fdisk - 1. resize partition for rfs - 1. resize filesystem - 1. mount boot partition - 1. make file 'ssh' - 1. make user config - 1. remove image resize from config file ~'cmdline.txt' - 1. mount rootfs partition - 1. do stuff \ No newline at end of file +## get/create image file +download and extract an image file **or** create one using `dd if=/dev/zero of= bs= count=`. + +## set image size +set image size with `truncate --size= `. this is usually used to increase image size in order to increase the file system size (i.e. make more space for rootfs) + +## mount image +to mount an image file use +```bash +mount -o loop +``` +if the image contains multiple partitions one needs to setup a loop device first: +```bash +losetup --find --show -P +``` +afterwards the partitions of the image should be shown as loopXpY and can be mounted like any other device. + +## modify partition table with fdisk + +### resize partition for rootfs + +## resize filesystem + +## mount boot partition + +### make file 'ssh' + +### make user config + +### remove image resize from config file ~'cmdline.txt' + +## mount rootfs partition + +### do stuff