|
|
(40 intermediate revisions by 10 users not shown) |
Line 1: |
Line 1: |
| This document explains how to build a custom ISO image using the alpine-iso scripts.
| |
|
| |
|
| First make sure we have the needed tools
| | == ISO remastering == |
| {{Cmd|apk add alpine-sdk}}
| |
|
| |
|
| Then we clone (or update) the [http://git.alpinelinux.org/cgit/alpine-iso.git/ alpine-iso git repository].
| | There are third party scripts to re-build completely custom images, like |
| {{Cmd|git clone git://git.alpinelinux.org/alpine-iso}}
| | * [https://github.com/alpinelinux/alpine-make-vm-image alpine-make-vm-image] |
| | (works to only make a disk based VM image) |
|
| |
|
| The alpine-iso scripts is a simple makefile which you need to feed with a ''<name>.conf.mk'' file and a ''<name>.packages''.
| | and there is Alpine's original |
| | * [[How_to_make_a_custom_ISO_image_with_mkimage|mkimg]]. |
| | (creates a diskless ISO file - usually what you want for QEMU and Proxmox) |
|
| |
|
| In the ''<name>.conf.mk'' we specify
| |
|
| |
|
| ;ALPINE_NAME
| |
| :name of iso image
| |
|
| |
|
| ;ALPINE_VERSION
| | == An alternative == |
| :(optional) version string. Will default to todays date.
| |
|
| |
|
| ;KERNEL_FLAVOR
| | It's also possible to commit and load ISO image customizations to and from a writable partition when booting in [[Installation#Diskless_Mode|Diskless Mode]]. |
| :(optional) either ''grsec'', ''vserver'' or ''pae''. Will default to grsec.
| |
|
| |
|
| ;MODLOOP_EXTRA
| |
| :(optional) Extra kernel module packages for the modloop image. For example: ''dahdi-linux-vserver''
| |
|
| |
|
| ;APK_REPOS
| |
| :(optional) Path to addidtional apk repository.
| |
|
| |
|
| The ''<name>.packages'' is just a plaintext list of packages that should be included in the ISO image. You should always add ''alpine-base'' in there or the CD might not be able to boot. The dependencies for the packages will automatically be pulled in.
| | == Booting an ISO image with local customizations == |
|
| |
|
| == A rescue CD example ==
| | * [[Directly booting an ISO file]] |
| As an example, let us make a rescue ISO image with packages needed for rescue operations. We call it ''alpine-rescue''
| |
| | |
| We create the ''alpine-rescue.conf.mk'' as follows:
| |
| ALPINE_NAME := alpine-rescue
| |
| KERNEL_FLAVOR := grsec
| |
| MODLOOP_EXTRA :=
| |
| | |
| If you are going to use a custom kernel, don't forget to specify KERNEL_FLAVOR_DEFAULT which will set the default kernel to boot.
| |
| | |
| And then the ''alpine-rescue.packages'' as:
| |
| alpine-base
| |
| bkeymaps
| |
| openssh
| |
| e2fsprogs
| |
| mdadm
| |
| lvm2
| |
| parted
| |
| debootstrap
| |
| ntfs-3g
| |
| | |
| {{Tip| Make sure your public keys are placed in /etc/apk/keys/ (example: root-xxxxxxxx.rsa.pub):
| |
| {{Cmd|ls /etc/apk/keys/}}
| |
| | |
| Learn apk-tools to find your home-built apk's:
| |
| {{Cmd|echo "~/.cache/abuild/" >> /etc/apk/repositories}}
| |
| }}
| |
| | |
| Make sure the apk index is up to date (so apk finds the packages):
| |
| {{Cmd|apk update}}
| |
| | |
| We create the ISO image by telling the makefile the profile name. The makefile target is ''iso''.
| |
| {{Cmd|<nowiki>make PROFILE=alpine-rescue iso</nowiki>}}
| |
| | |
| {{Tip| If you are building inside an LXC guest, use fakeroot:
| |
| {{Cmd|<nowiki>fakeroot make PROFILE=alpine-rescue iso</nowiki>}}
| |
| }}
| |
| | |
| To generate the sha1 sum we use the ''sha1'' make target.
| |
| {{Cmd|<nowiki>make PROFILE=alpine-rescue sha1</nowiki>}}
| |
| | |
| == Package lists ==
| |
| | |
| Beside the plaintext package lists in the git repository, there are more documented package lists contributed by Alpine users. Those lists can be transformed into a plaintext to use with <tt>alpine-iso</tt> list with the simple python-based <tt>[http://git.alpinelinux.org/cgit/fab/alpine-iso/tree/config-builder.py config-builder]</tt> script.
| |
| | |
| So far the lists below are available (check [[:Category:ISO|here]] for more.)
| |
| | |
| * [[Alpine_mini|Alpine Mini]]
| |
| * [[Alpine_rescue|Alpine Rescue]]
| |
| * [[Alpine_security|Alpine Security]]
| |
| * [[Alpine SCST]] | |
| | |
| == Live Disk ==
| |
| | |
| Once you have customized your custom ISO, you can now setup the live environment to operate outside of the standard installer.
| |
| By default, mkinitfs will generate a "live" environment that will allow a user to run [[Alpine_local_backup|lbu]] as well as install an Alpine Linux system.
| |
| | |
| Using <code>lbu</code> you can customize your live iso to operate as a full live system, or as a modified installer.
| |
| * Alpine ISO Requires the OVL Volume to be hosted on a web server. If you don't have one you can run busybox's httpd temporarily - <code>busybox -p 127.0.0.1:80</code>
| |
| * Uncomment the <code>APKOVL</code> line in the alpine flavor of your choice and set it to the address of your ovl volume.
| |
| * In general, <code>lbu</lbu> will only handle files in <code>/etc</code>, to customize this further, you need to add additional files.
| |
| * 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.
| |
| * Any packages you add to /etc/apk/world of your lbu will automatically be installed onto the live system image.
| |
| | |
| == Testing your ISO image ==
| |
| | |
| [[Qemu#Live_mode| Qemu]] is useful for a quick test of your created ISO image.
| |
|
| |
|
| [[Category:Package Manager]] | | [[Category:Package Manager]] |
| [[Category:ISO]] | | [[Category:ISO]] |