Looking through the documentation at:
https://docs.vyos.io/en/latest/installation/install.html?highlight=vmlinuz#step-2-tftp
It turns out that the vmlinuz (currently: vmlinuz-6.1.53-amd64-vyos) and initrd.img (currently: initrd.img-6.1.53-amd64-vyos) in the /live path of the iso is the same as within the filesystems.squshfs file.
This made me wonder if it shouldnt be possible to do this during build (example for VyOS 1.5-rolling-202309170024)?
- Copy config-6.1.53-amd64-vyos and System.map-6.1.53-amd64-vyos from chroot and place them also in the /live path of the iso (or some other way during creation of the iso have them included in the /live path).
- Delete /boot directory from within filesystem.squashfs (for example through rootfs/excludes-file) except for the symlinks regarding /boot/vmlinuz and /boot/initrd.img (they are used by vyatta-grub-setup to create grub.cfg during install).
- Adjust the install scripts so they will copy /live/vmlinuz-6.1.53-amd64-vyos, /live/initrd.img-6.1.53-amd64-vyos, /live/System.map-6.1.53-amd64-vyos and /live/config-6.1.53-amd64-vyos to the persistence storage on the drive (/usr/lib/live/mount/persistence/boot/1.5-rolling-202309170024 ?).
The above would in this example shrink the filesystem.squashfs (and the iso who includes the filesystem.squashfs) by approx:
vyos@vyos:~$ ls -la /boot total 383440 drwxr-xr-x 5 root root 4096 Sep 17 20:43 . drwxr-xr-x 1 root root 4096 Sep 17 22:07 .. -r--r--r-- 1 root root 352301056 Sep 17 03:48 1.5-rolling-202309170024.squashfs -rw-r--r-- 1 root root 155147 Sep 14 08:07 config-6.1.53-amd64-vyos drwxr-xr-x 5 root root 4096 Sep 17 22:08 grub lrwxrwxrwx 1 root root 28 Sep 17 03:48 initrd.img -> initrd.img-6.1.53-amd64-vyos -rw-r--r-- 1 root root 30434498 Sep 17 03:48 initrd.img-6.1.53-amd64-vyos drwxr-xr-x 9 root root 4096 Sep 17 22:07 rw -rw-r--r-- 1 root root 3439751 Sep 14 08:07 System.map-6.1.53-amd64-vyos lrwxrwxrwx 1 root root 25 Sep 17 03:48 vmlinuz -> vmlinuz-6.1.53-amd64-vyos -rw-r--r-- 1 root root 6282176 Sep 14 08:07 vmlinuz-6.1.53-amd64-vyos drwxr-xr-x 3 root root 4096 Sep 17 22:07 work
30434498+6282176 = 36716674 bytes (approx 35MB).
Due to compression the actual saving for the iso file will be less than 35MB.
But still going from todays 390MB to give or take 355MB.
A saving by approx (up to) 9%.