How to make a custom ISO image: Difference between revisions

From Alpine Linux
mNo edit summary
m (reorder)
Line 1: Line 1:


One way to completely re-build images is to use a script like [https://github.com/alpinelinux/alpine-make-vm-image alpine-make-vm-image].
One way to completely re-build custom images is to use a script like [https://github.com/alpinelinux/alpine-make-vm-image alpine-make-vm-image].
 
* If you want to make a customized installer, you need to create <code>.default_boot_services</code> which will cause <code>mkinitfs</code> to create the defaults for the live image.


But there is also an alternative:
But there is also an alternative:


== Live Disk customizations with APKOVL configurations ==
== Live Disk customization with APKOVL configurations ==


The "diskless" Alpine ISO images seem to look for an .apkovl volume in system partitions, and offer to save local backups and package cache to mountpoints below /media/. (Besides supporting a boot parameter that points to a web server.)
The "diskless" Alpine ISO images seem to look for an .apkovl volume in system partitions, and offer to save local backups and package cache to mountpoints below /media/. (Besides supporting a boot parameter that points to a web server.)
Line 19: Line 21:
Notes:
Notes:


* Any packages you add to /etc/apk/world of your lbu will automatically be installed in the live system.
* See [[Alpine_Linux_package_management#Local_Cache]] about managing included packages.
* See [[Alpine_Linux_package_management#Local_Cache]] about managing included packages.
* See [[Alpine_local_backup|lbu]] about how to customize it to cover files outside of <code>/etc</code>.
* Any packages you add to /etc/apk/world of your lbu will also automatically be installed in the live system.
* If you don't have a web server you can run busybox's httpd temporarily - <code>busybox httpd -p 127.0.0.1:80</code>
* If you don't have a web server you can run busybox's httpd temporarily - <code>busybox httpd -p 127.0.0.1:80</code>
* See [[Alpine_local_backup|lbu]] about how to customize it to cover files outside of <code>/etc</code>.
* If you want to make a customized installer, you need to create <code>.default_boot_services</code> which will cause <code>mkinitfs</code> to create the defaults for the live image.


== Booting an ISO image with local customizations ==
== Booting an ISO image with local customizations ==

Revision as of 15:26, 9 May 2020

One way to completely re-build custom images is to use a script like alpine-make-vm-image.

  • If you want to make a customized installer, you need to create .default_boot_services which will cause mkinitfs to create the defaults for the live image.

But there is also an alternative:

Live Disk customization with APKOVL configurations

The "diskless" Alpine ISO images seem to look for an .apkovl volume in system partitions, and offer to save local backups and package cache to mountpoints below /media/. (Besides supporting a boot parameter that points to a web server.)

So

  • Boot the diskless system from ISO, and if necessary create and format a partition.
  • Edit /etc/fstab and mount the writable partition below /media/.
  • Run alpine-setup and choose to save the state to the mounted partition.
  • Customize the system.
  • Generate an APKOVL file with lbu by executing lbu commit

(If instead you put the APKOVL file on a webserver, you would need to supply a custom url with the APKOVL kernel boot parameter.)

Notes:

  • See Alpine_Linux_package_management#Local_Cache about managing included packages.
  • See lbu about how to customize it to cover files outside of /etc.
  • Any packages you add to /etc/apk/world of your lbu will also automatically be installed in the live system.
  • If you don't have a web server you can run busybox's httpd temporarily - busybox httpd -p 127.0.0.1:80

Booting an ISO image with local customizations

Example: Booting and customizing an ISO image with an .apkovl in a Qemu virtual machine.

Debian's grub-imageboot package is a way to boot .iso files directly.