[v2,3/4] meta-isar: add some empty space at the end of our wic images

Message ID 20221114174053.13258-4-henning.schild@siemens.com
State Superseded, archived
Headers show
Series [v2,1/4] CI: improve cibuilder readability | expand

Commit Message

Henning Schild Nov. 14, 2022, 5:40 p.m. UTC
Add some empty space at the end of our example images. This will enable
better interactive use of our example images since people will have some
space to install some more packages. While the space seems fixed it
really is open end if the mass storage happens to be bigger, because we
installed expand-on-first-boot earlier.

Signed-off-by: Henning Schild <henning.schild@siemens.com>
---
 meta-isar/scripts/lib/wic/canned-wks/sdimage-efi-sd.wks | 2 ++
 meta-isar/scripts/lib/wic/canned-wks/sdimage-efi.wks    | 2 ++
 2 files changed, 4 insertions(+)

Comments

Tobias Schaffner Nov. 19, 2022, 7:51 p.m. UTC | #1
On 14.11.22 18:40, Henning Schild wrote:
> Add some empty space at the end of our example images. This will enable
> better interactive use of our example images since people will have some
> space to install some more packages. While the space seems fixed it
> really is open end if the mass storage happens to be bigger, because we
> installed expand-on-first-boot earlier.
> 
> Signed-off-by: Henning Schild <henning.schild@siemens.com>
> ---
>   meta-isar/scripts/lib/wic/canned-wks/sdimage-efi-sd.wks | 2 ++
>   meta-isar/scripts/lib/wic/canned-wks/sdimage-efi.wks    | 2 ++
>   2 files changed, 4 insertions(+)
> 
> diff --git a/meta-isar/scripts/lib/wic/canned-wks/sdimage-efi-sd.wks b/meta-isar/scripts/lib/wic/canned-wks/sdimage-efi-sd.wks
> index 754fbc46f8e4..e6b7128eb3ae 100644
> --- a/meta-isar/scripts/lib/wic/canned-wks/sdimage-efi-sd.wks
> +++ b/meta-isar/scripts/lib/wic/canned-wks/sdimage-efi-sd.wks
> @@ -6,4 +6,6 @@ part /boot --source bootimg-efi-isar --sourceparams "loader=systemd-boot" --ondi
>   
>   part / --source rootfs --ondisk sda --fstype ext4 --mkfs-extraopts "-T default" --label platform --align 1024 --use-uuid --exclude-path boot/
>   
> +part --source empty --no-table --ondisk sda --size 256M

It might be a good idea to use some odd value here. Wic only allows you 
to go down to Kibibyte with --fixed-size. Still when using something 
that is not dividable by 4 e.g. ext4 filesystems will not fit perfectly 
into the partition.

Imho we should enlarge the image only for the CI and maybe document how 
to use qemu-img resize for users that want to install additional 
packages. I see that its only an example image and therefore rarely used 
but still it will eat up more space when uncompressed and take longer to 
flash.

Greetings!
> +
>   bootloader --ptable gpt --timeout 3 --append "rootwait console=ttyS0,115200 console=tty0"
> diff --git a/meta-isar/scripts/lib/wic/canned-wks/sdimage-efi.wks b/meta-isar/scripts/lib/wic/canned-wks/sdimage-efi.wks
> index f3addbc7515d..5e555b3cc472 100644
> --- a/meta-isar/scripts/lib/wic/canned-wks/sdimage-efi.wks
> +++ b/meta-isar/scripts/lib/wic/canned-wks/sdimage-efi.wks
> @@ -6,4 +6,6 @@ part /boot --source bootimg-efi-isar --sourceparams "loader=grub-efi" --ondisk s
>   
>   part / --source rootfs --ondisk sda --fstype ext4 --mkfs-extraopts "-T default" --label platform --align 1024 --use-uuid --exclude-path boot/
>   
> +part --source empty --no-table --ondisk sda --size 256M
> +
>   bootloader --ptable gpt --timeout 3 --append "rootwait console=ttyS0,115200 console=tty0"
Henning Schild Nov. 21, 2022, 9:37 a.m. UTC | #2
Am Sat, 19 Nov 2022 20:51:21 +0100
schrieb "Schaffner, Tobias (T CED SES-DE)"
<tobias.schaffner@siemens.com>:

> On 14.11.22 18:40, Henning Schild wrote:
> > Add some empty space at the end of our example images. This will
> > enable better interactive use of our example images since people
> > will have some space to install some more packages. While the space
> > seems fixed it really is open end if the mass storage happens to be
> > bigger, because we installed expand-on-first-boot earlier.
> > 
> > Signed-off-by: Henning Schild <henning.schild@siemens.com>
> > ---
> >   meta-isar/scripts/lib/wic/canned-wks/sdimage-efi-sd.wks | 2 ++
> >   meta-isar/scripts/lib/wic/canned-wks/sdimage-efi.wks    | 2 ++
> >   2 files changed, 4 insertions(+)
> > 
> > diff --git
> > a/meta-isar/scripts/lib/wic/canned-wks/sdimage-efi-sd.wks
> > b/meta-isar/scripts/lib/wic/canned-wks/sdimage-efi-sd.wks index
> > 754fbc46f8e4..e6b7128eb3ae 100644 ---
> > a/meta-isar/scripts/lib/wic/canned-wks/sdimage-efi-sd.wks +++
> > b/meta-isar/scripts/lib/wic/canned-wks/sdimage-efi-sd.wks @@ -6,4
> > +6,6 @@ part /boot --source bootimg-efi-isar --sourceparams
> > "loader=systemd-boot" --ondi part / --source rootfs --ondisk sda
> > --fstype ext4 --mkfs-extraopts "-T default" --label platform
> > --align 1024 --use-uuid --exclude-path boot/ +part --source empty
> > --no-table --ondisk sda --size 256M  
> 
> It might be a good idea to use some odd value here. Wic only allows
> you to go down to Kibibyte with --fixed-size. Still when using
> something that is not dividable by 4 e.g. ext4 filesystems will not
> fit perfectly into the partition.

I would hope/assume that the actual filesystem resize application takes
care about making it fit. And we might always have the situation where
the partition starts somewhere and we do not know the size of the
storage medium used, so there simply is no right answer.

> Imho we should enlarge the image only for the CI and maybe document
> how to use qemu-img resize for users that want to install additional 
> packages. I see that its only an example image and therefore rarely
> used but still it will eat up more space when uncompressed and take
> longer to flash.

I already tried with qemu-img resize in CI, that ended up looking
pretty messy. We could use another example wks just for that resize
test case. But that would make the pipeline even slower and the overall
disk consumption much higher.

How about we go down to 128M from the 256M i proposed? My idea behind
that value was to test the expansion and leave a reasonable amount of
space so people can install stuff in qemu and also cater for people
potentially flashing to a real machine.
 
When we assume that people do not flash, which you did ... it does not
take more time. I would further assume (did not check) that the image
does not consume more disk space, because it is empty space in a sparse
file. So adding a variant will only be more stuff to maintain and more
CI jobs.

Henning


> Greetings!
> > +
> >   bootloader --ptable gpt --timeout 3 --append "rootwait
> > console=ttyS0,115200 console=tty0" diff --git
> > a/meta-isar/scripts/lib/wic/canned-wks/sdimage-efi.wks
> > b/meta-isar/scripts/lib/wic/canned-wks/sdimage-efi.wks index
> > f3addbc7515d..5e555b3cc472 100644 ---
> > a/meta-isar/scripts/lib/wic/canned-wks/sdimage-efi.wks +++
> > b/meta-isar/scripts/lib/wic/canned-wks/sdimage-efi.wks @@ -6,4 +6,6
> > @@ part /boot --source bootimg-efi-isar --sourceparams
> > "loader=grub-efi" --ondisk s part / --source rootfs --ondisk sda
> > --fstype ext4 --mkfs-extraopts "-T default" --label platform
> > --align 1024 --use-uuid --exclude-path boot/ +part --source empty
> > --no-table --ondisk sda --size 256M + bootloader --ptable gpt
> > --timeout 3 --append "rootwait console=ttyS0,115200 console=tty0"

Patch

diff --git a/meta-isar/scripts/lib/wic/canned-wks/sdimage-efi-sd.wks b/meta-isar/scripts/lib/wic/canned-wks/sdimage-efi-sd.wks
index 754fbc46f8e4..e6b7128eb3ae 100644
--- a/meta-isar/scripts/lib/wic/canned-wks/sdimage-efi-sd.wks
+++ b/meta-isar/scripts/lib/wic/canned-wks/sdimage-efi-sd.wks
@@ -6,4 +6,6 @@  part /boot --source bootimg-efi-isar --sourceparams "loader=systemd-boot" --ondi
 
 part / --source rootfs --ondisk sda --fstype ext4 --mkfs-extraopts "-T default" --label platform --align 1024 --use-uuid --exclude-path boot/
 
+part --source empty --no-table --ondisk sda --size 256M
+
 bootloader --ptable gpt --timeout 3 --append "rootwait console=ttyS0,115200 console=tty0"
diff --git a/meta-isar/scripts/lib/wic/canned-wks/sdimage-efi.wks b/meta-isar/scripts/lib/wic/canned-wks/sdimage-efi.wks
index f3addbc7515d..5e555b3cc472 100644
--- a/meta-isar/scripts/lib/wic/canned-wks/sdimage-efi.wks
+++ b/meta-isar/scripts/lib/wic/canned-wks/sdimage-efi.wks
@@ -6,4 +6,6 @@  part /boot --source bootimg-efi-isar --sourceparams "loader=grub-efi" --ondisk s
 
 part / --source rootfs --ondisk sda --fstype ext4 --mkfs-extraopts "-T default" --label platform --align 1024 --use-uuid --exclude-path boot/
 
+part --source empty --no-table --ondisk sda --size 256M
+
 bootloader --ptable gpt --timeout 3 --append "rootwait console=ttyS0,115200 console=tty0"