image image image

This commit is contained in:
scbj
2024-10-24 18:41:02 +02:00
parent 9ccdb271d7
commit bfbd4dc1e5

View File

@@ -1,15 +1,35 @@
1. download image ## get/create image file
1. extract image download and extract an image file **or** create one using `dd if=/dev/zero of=<image-file> bs=<block-size> count=<count>`.
1. enlarge image with 'truncate'
1. mount as loopback device ## set image size
1. modify image set image size with `truncate --size=<size> <image-file>`. this is usually used to increase image size in order to increase the file system size (i.e. make more space for rootfs)
1. modify partition table with fdisk
1. resize partition for rfs ## mount image
1. resize filesystem to mount an image file use
1. mount boot partition ```bash
1. make file 'ssh' mount -o loop <path/to/image-file> <mount-point>
1. make user config ```
1. remove image resize from config file ~'cmdline.txt' if the image contains multiple partitions one needs to setup a loop device first:
1. mount rootfs partition ```bash
1. do stuff losetup --find --show <path/to/image-file> -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