<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.alpinelinux.org/w/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Divyekapoor</id>
	<title>Alpine Linux - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.alpinelinux.org/w/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Divyekapoor"/>
	<link rel="alternate" type="text/html" href="https://wiki.alpinelinux.org/wiki/Special:Contributions/Divyekapoor"/>
	<updated>2026-04-26T00:14:07Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.40.0</generator>
	<entry>
		<id>https://wiki.alpinelinux.org/w/index.php?title=How_to_make_a_custom_ISO_image_with_mkimage&amp;diff=25810</id>
		<title>How to make a custom ISO image with mkimage</title>
		<link rel="alternate" type="text/html" href="https://wiki.alpinelinux.org/w/index.php?title=How_to_make_a_custom_ISO_image_with_mkimage&amp;diff=25810"/>
		<updated>2023-11-20T23:11:13Z</updated>

		<summary type="html">&lt;p&gt;Divyekapoor: Add info about freshness of test.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This document explains how to build a custom ISO image using the new mkimage scripts located in [[aports]] directory.&lt;br /&gt;
&lt;br /&gt;
== Prerequisites ==&lt;br /&gt;
&lt;br /&gt;
First make sure we have the needed tools&lt;br /&gt;
{{Cmd|apk add alpine-sdk alpine-conf syslinux xorriso squashfs-tools grub grub-efi doas}}&lt;br /&gt;
For efi you should add the following: &lt;br /&gt;
{{Cmd|apk add mtools dosfstools grub-efi}}&lt;br /&gt;
&lt;br /&gt;
Create a user (e.g. build) and add them to the abuild group:&lt;br /&gt;
{{Cmd|adduser build -G abuild}}&lt;br /&gt;
&lt;br /&gt;
Give the user root-like permissions:&lt;br /&gt;
{{Cmd|vi /etc/doas.d/doas.conf}}&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
permit :abuild&lt;br /&gt;
permit persist :abuild&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Change to the build user: &lt;br /&gt;
{{Cmd|su - build}}&lt;br /&gt;
&lt;br /&gt;
Then create signing keys (-i installs them in /etc/apk/keys which is required for later)&lt;br /&gt;
{{Cmd|abuild-keygen -i -a}}&lt;br /&gt;
&lt;br /&gt;
{{Tip| Make sure your public keys are placed in /etc/apk/keys/ (example: build-xxxxxxxx.rsa.pub)}}&lt;br /&gt;
{{Cmd|ls /etc/apk/keys/}}&lt;br /&gt;
&lt;br /&gt;
Clone (or update) the [https://gitlab.alpinelinux.org/alpine/aports git repository].&lt;br /&gt;
{{Cmd|git clone --depth&amp;amp;#61;1 https://gitlab.alpinelinux.org/alpine/aports.git}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Make sure the apk index is up to date (so apk can find the packages):&lt;br /&gt;
{{Cmd|doas apk update}}&lt;br /&gt;
&lt;br /&gt;
Make sure your /tmp is large enough.  If you have the default 1GB /tmp, then create a local one with:&lt;br /&gt;
&amp;lt;pre&amp;gt;mkdir -pv ~/tmp&lt;br /&gt;
export TMPDIR=~/tmp&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Configuration ==&lt;br /&gt;
&lt;br /&gt;
The mkimg scripts are shipped with pre-configured profiles.&lt;br /&gt;
&lt;br /&gt;
The format is &#039;&#039;&#039;mkimg.$PROFILENAME.sh&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
In order to have a custom ISO, you should create your own &#039;&#039;&#039;mkimg.$PROFILENAME.sh&#039;&#039;&#039; script.&lt;br /&gt;
&lt;br /&gt;
This is an example used to make a ZFS module, overlayfs (which enables r/w mode for /lib/modules), a serial console output and some other useful apks to build a simple NAS:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;export PROFILENAME=nas&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
cat &amp;lt;&amp;lt; EOF &amp;gt; ~/aports/scripts/mkimg.$PROFILENAME.sh&lt;br /&gt;
profile_$PROFILENAME() {&lt;br /&gt;
        profile_standard&lt;br /&gt;
        kernel_cmdline=&amp;quot;unionfs_size=512M console=tty0 console=ttyS0,115200&amp;quot;&lt;br /&gt;
        syslinux_serial=&amp;quot;0 115200&amp;quot;&lt;br /&gt;
        kernel_addons=&amp;quot;zfs&amp;quot;&lt;br /&gt;
        apks=&amp;quot;\$apks iscsi-scst zfs-scripts zfs zfs-utils-py&lt;br /&gt;
                cciss_vol_status lvm2 mdadm mkinitfs mtools nfs-utils&lt;br /&gt;
                parted rsync sfdisk syslinux util-linux xfsprogs&lt;br /&gt;
                dosfstools ntfs-3g&lt;br /&gt;
                &amp;quot;&lt;br /&gt;
        local _k _a&lt;br /&gt;
        for _k in \$kernel_flavors; do&lt;br /&gt;
                apks=&amp;quot;\$apks linux-\$_k&amp;quot;&lt;br /&gt;
                for _a in \$kernel_addons; do&lt;br /&gt;
                        apks=&amp;quot;\$apks \$_a-\$_k&amp;quot;&lt;br /&gt;
                done&lt;br /&gt;
        done&lt;br /&gt;
        apks=&amp;quot;\$apks linux-firmware&amp;quot;&lt;br /&gt;
}&lt;br /&gt;
EOF&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Set the script as executable:&lt;br /&gt;
{{Cmd|chmod +x ~/aports/scripts/mkimg.$PROFILENAME.sh}}&lt;br /&gt;
&lt;br /&gt;
== Making packages available on boot ==&lt;br /&gt;
&lt;br /&gt;
A package may be made available in the live system by defining the generation of an apkovl which contains a corresponding /etc/apk/world file, and adding that overlay definition to the mkimg-profile, e.g. with `apkovl=&amp;quot;genapkovl-mkimgoverlay.sh&amp;quot;`&lt;br /&gt;
&lt;br /&gt;
Note that to *use* your added apks, you have to install them, with {{ic|apk add}}.&lt;br /&gt;
&lt;br /&gt;
The definition may be done as in the [https://github.com/alpinelinux/aports/blob/master/scripts/genapkovl-dhcp.sh genapkovl-dhcp.sh] example.&lt;br /&gt;
Copy the relevant parts (including the rc_add lines) into a `genapkovl-mkimgoverlay.sh` file and add the package(s) that should be installed in the live system on separate lines in the file contents for /etc/apk/world.&lt;br /&gt;
&lt;br /&gt;
{{Cmd|cp ~/aport/scripts/genapkovl-dhcp.sh ~/aport/scripts/genapkovl-mkimgoverlay.sh}}&lt;br /&gt;
&lt;br /&gt;
Edit the file to add:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
...&lt;br /&gt;
mkdir -p &amp;quot;$tmp&amp;quot;/etc/apk&lt;br /&gt;
makefile root:root 0644 &amp;quot;$tmp&amp;quot;/etc/apk/world &amp;lt;&amp;lt;EOF&lt;br /&gt;
alpine-base&lt;br /&gt;
&amp;lt;apk1-service&amp;gt;&lt;br /&gt;
&amp;lt;apk2-service&amp;gt;&lt;br /&gt;
EOF&lt;br /&gt;
&lt;br /&gt;
...&lt;br /&gt;
rc_add &amp;lt;apk1-service&amp;gt; boot&lt;br /&gt;
rc_add &amp;lt;apk2-service&amp;gt; boot&lt;br /&gt;
...&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
in the relevant locations.&lt;br /&gt;
&lt;br /&gt;
Then edit the profile build script above and add:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
apkovl=&amp;quot;aports/scripts/genapkovl-mkimgoverlay.sh&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
immediately after the last apks= line.&lt;br /&gt;
&lt;br /&gt;
== Create the ISO ==&lt;br /&gt;
&lt;br /&gt;
{{Cmd|mkimage.sh	[--tag RELEASE] [--outdir OUTDIR] [--workdir WORKDIR]&lt;br /&gt;
		[--arch ARCH] [--profile PROFILE] [--hostkeys] [--simulate]&lt;br /&gt;
		[--repository REPO] [--extra-repository REPO] [--yaml FILE]&lt;br /&gt;
mkimage.sh	--help&lt;br /&gt;
&lt;br /&gt;
options:&lt;br /&gt;
--arch			Specify which architecture images to build&lt;br /&gt;
			(default: x86_64)&lt;br /&gt;
--hostkeys		Copy system apk signing keys to created images&lt;br /&gt;
--outdir		Specify directory for the created images&lt;br /&gt;
--profile		Specify which profiles to build&lt;br /&gt;
--repository		Package repository to use for the image create&lt;br /&gt;
--extra-repository	Add repository to search packages from&lt;br /&gt;
--simulate		Don&#039;t execute commands&lt;br /&gt;
--tag			Build images for tag RELEASE&lt;br /&gt;
--workdir		Specify temporary working directory (cache)&lt;br /&gt;
--yaml&lt;br /&gt;
&lt;br /&gt;
known profiles: ali rpi uboot base minirootfs standard vanilla extended virt xen}}&lt;br /&gt;
&lt;br /&gt;
{{Tip| You can use the --repository option multiple times, which is very useful when mixing local and official repositories. The --extra-repository option is  there only for backward-compatibility.}}&lt;br /&gt;
&lt;br /&gt;
Create an iso directory in your home dir:&lt;br /&gt;
&lt;br /&gt;
{{Cmd|mkdir -p ~/iso}}&lt;br /&gt;
&lt;br /&gt;
Then create the actual ISO.&lt;br /&gt;
In this example we will use the edge version x86_64:&lt;br /&gt;
{{Cmd|sh aports/scripts/mkimage.sh --tag edge \&lt;br /&gt;
	--outdir ~/iso \&lt;br /&gt;
	--arch x86_64 \&lt;br /&gt;
	--repository &amp;lt;nowiki&amp;gt;https://dl-cdn.alpinelinux.org/alpine/edge/main&amp;lt;/nowiki&amp;gt; \&lt;br /&gt;
	--profile $PROFILENAME&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Notes:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* If you want to make a customized installer, you need to create &amp;lt;code&amp;gt;.default_boot_services&amp;lt;/code&amp;gt; which will cause &amp;lt;code&amp;gt;mkinitfs&amp;lt;/code&amp;gt; to create the defaults for the live image.&lt;br /&gt;
&lt;br /&gt;
* Several parts of this doc can be automated with a script, like the repository/arch/outdir settings.&lt;br /&gt;
Those steps are left to you and your imagination :)&lt;br /&gt;
&lt;br /&gt;
== Testing your ISO image ==&lt;br /&gt;
&lt;br /&gt;
[[QEMU#Live_mode|QEMU]] is useful for a quick test of your newly created ISO image.&lt;br /&gt;
This ISO build process has been tested to work and generate an ISO with auto-installed APKs as of Nov 20, 2023 with Alpine edge. &lt;br /&gt;
&lt;br /&gt;
[[Category:Package Manager]]&lt;br /&gt;
[[Category:ISO]]&lt;/div&gt;</summary>
		<author><name>Divyekapoor</name></author>
	</entry>
	<entry>
		<id>https://wiki.alpinelinux.org/w/index.php?title=How_to_make_a_custom_ISO_image_with_mkimage&amp;diff=25809</id>
		<title>How to make a custom ISO image with mkimage</title>
		<link rel="alternate" type="text/html" href="https://wiki.alpinelinux.org/w/index.php?title=How_to_make_a_custom_ISO_image_with_mkimage&amp;diff=25809"/>
		<updated>2023-11-20T23:09:20Z</updated>

		<summary type="html">&lt;p&gt;Divyekapoor: Add the text to update the world file for an auto-install&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This document explains how to build a custom ISO image using the new mkimage scripts located in [[aports]] directory.&lt;br /&gt;
&lt;br /&gt;
== Prerequisites ==&lt;br /&gt;
&lt;br /&gt;
First make sure we have the needed tools&lt;br /&gt;
{{Cmd|apk add alpine-sdk alpine-conf syslinux xorriso squashfs-tools grub grub-efi doas}}&lt;br /&gt;
For efi you should add the following: &lt;br /&gt;
{{Cmd|apk add mtools dosfstools grub-efi}}&lt;br /&gt;
&lt;br /&gt;
Create a user (e.g. build) and add them to the abuild group:&lt;br /&gt;
{{Cmd|adduser build -G abuild}}&lt;br /&gt;
&lt;br /&gt;
Give the user root-like permissions:&lt;br /&gt;
{{Cmd|vi /etc/doas.d/doas.conf}}&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
permit :abuild&lt;br /&gt;
permit persist :abuild&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Change to the build user: &lt;br /&gt;
{{Cmd|su - build}}&lt;br /&gt;
&lt;br /&gt;
Then create signing keys (-i installs them in /etc/apk/keys which is required for later)&lt;br /&gt;
{{Cmd|abuild-keygen -i -a}}&lt;br /&gt;
&lt;br /&gt;
{{Tip| Make sure your public keys are placed in /etc/apk/keys/ (example: build-xxxxxxxx.rsa.pub)}}&lt;br /&gt;
{{Cmd|ls /etc/apk/keys/}}&lt;br /&gt;
&lt;br /&gt;
Clone (or update) the [https://gitlab.alpinelinux.org/alpine/aports git repository].&lt;br /&gt;
{{Cmd|git clone --depth&amp;amp;#61;1 https://gitlab.alpinelinux.org/alpine/aports.git}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Make sure the apk index is up to date (so apk can find the packages):&lt;br /&gt;
{{Cmd|doas apk update}}&lt;br /&gt;
&lt;br /&gt;
Make sure your /tmp is large enough.  If you have the default 1GB /tmp, then create a local one with:&lt;br /&gt;
&amp;lt;pre&amp;gt;mkdir -pv ~/tmp&lt;br /&gt;
export TMPDIR=~/tmp&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Configuration ==&lt;br /&gt;
&lt;br /&gt;
The mkimg scripts are shipped with pre-configured profiles.&lt;br /&gt;
&lt;br /&gt;
The format is &#039;&#039;&#039;mkimg.$PROFILENAME.sh&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
In order to have a custom ISO, you should create your own &#039;&#039;&#039;mkimg.$PROFILENAME.sh&#039;&#039;&#039; script.&lt;br /&gt;
&lt;br /&gt;
This is an example used to make a ZFS module, overlayfs (which enables r/w mode for /lib/modules), a serial console output and some other useful apks to build a simple NAS:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;export PROFILENAME=nas&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
cat &amp;lt;&amp;lt; EOF &amp;gt; ~/aports/scripts/mkimg.$PROFILENAME.sh&lt;br /&gt;
profile_$PROFILENAME() {&lt;br /&gt;
        profile_standard&lt;br /&gt;
        kernel_cmdline=&amp;quot;unionfs_size=512M console=tty0 console=ttyS0,115200&amp;quot;&lt;br /&gt;
        syslinux_serial=&amp;quot;0 115200&amp;quot;&lt;br /&gt;
        kernel_addons=&amp;quot;zfs&amp;quot;&lt;br /&gt;
        apks=&amp;quot;\$apks iscsi-scst zfs-scripts zfs zfs-utils-py&lt;br /&gt;
                cciss_vol_status lvm2 mdadm mkinitfs mtools nfs-utils&lt;br /&gt;
                parted rsync sfdisk syslinux util-linux xfsprogs&lt;br /&gt;
                dosfstools ntfs-3g&lt;br /&gt;
                &amp;quot;&lt;br /&gt;
        local _k _a&lt;br /&gt;
        for _k in \$kernel_flavors; do&lt;br /&gt;
                apks=&amp;quot;\$apks linux-\$_k&amp;quot;&lt;br /&gt;
                for _a in \$kernel_addons; do&lt;br /&gt;
                        apks=&amp;quot;\$apks \$_a-\$_k&amp;quot;&lt;br /&gt;
                done&lt;br /&gt;
        done&lt;br /&gt;
        apks=&amp;quot;\$apks linux-firmware&amp;quot;&lt;br /&gt;
}&lt;br /&gt;
EOF&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Set the script as executable:&lt;br /&gt;
{{Cmd|chmod +x ~/aports/scripts/mkimg.$PROFILENAME.sh}}&lt;br /&gt;
&lt;br /&gt;
== Making packages available on boot ==&lt;br /&gt;
&lt;br /&gt;
A package may be made available in the live system by defining the generation of an apkovl which contains a corresponding /etc/apk/world file, and adding that overlay definition to the mkimg-profile, e.g. with `apkovl=&amp;quot;genapkovl-mkimgoverlay.sh&amp;quot;`&lt;br /&gt;
&lt;br /&gt;
Note that to *use* your added apks, you have to install them, with {{ic|apk add}}.&lt;br /&gt;
&lt;br /&gt;
The definition may be done as in the [https://github.com/alpinelinux/aports/blob/master/scripts/genapkovl-dhcp.sh genapkovl-dhcp.sh] example.&lt;br /&gt;
Copy the relevant parts (including the rc_add lines) into a `genapkovl-mkimgoverlay.sh` file and add the package(s) that should be installed in the live system on separate lines in the file contents for /etc/apk/world.&lt;br /&gt;
&lt;br /&gt;
{{Cmd|cp ~/aport/scripts/genapkovl-dhcp.sh ~/aport/scripts/genapkovl-mkimgoverlay.sh}}&lt;br /&gt;
&lt;br /&gt;
Edit the file to add:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
...&lt;br /&gt;
mkdir -p &amp;quot;$tmp&amp;quot;/etc/apk&lt;br /&gt;
makefile root:root 0644 &amp;quot;$tmp&amp;quot;/etc/apk/world &amp;lt;&amp;lt;EOF&lt;br /&gt;
alpine-base&lt;br /&gt;
&amp;lt;apk1-service&amp;gt;&lt;br /&gt;
&amp;lt;apk2-service&amp;gt;&lt;br /&gt;
EOF&lt;br /&gt;
&lt;br /&gt;
...&lt;br /&gt;
rc_add &amp;lt;apk1-service&amp;gt; boot&lt;br /&gt;
rc_add &amp;lt;apk2-service&amp;gt; boot&lt;br /&gt;
...&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
in the relevant locations.&lt;br /&gt;
&lt;br /&gt;
Then edit the profile build script above and add:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
apkovl=&amp;quot;aports/scripts/genapkovl-mkimgoverlay.sh&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
immediately after the last apks= line.&lt;br /&gt;
&lt;br /&gt;
== Create the ISO ==&lt;br /&gt;
&lt;br /&gt;
{{Cmd|mkimage.sh	[--tag RELEASE] [--outdir OUTDIR] [--workdir WORKDIR]&lt;br /&gt;
		[--arch ARCH] [--profile PROFILE] [--hostkeys] [--simulate]&lt;br /&gt;
		[--repository REPO] [--extra-repository REPO] [--yaml FILE]&lt;br /&gt;
mkimage.sh	--help&lt;br /&gt;
&lt;br /&gt;
options:&lt;br /&gt;
--arch			Specify which architecture images to build&lt;br /&gt;
			(default: x86_64)&lt;br /&gt;
--hostkeys		Copy system apk signing keys to created images&lt;br /&gt;
--outdir		Specify directory for the created images&lt;br /&gt;
--profile		Specify which profiles to build&lt;br /&gt;
--repository		Package repository to use for the image create&lt;br /&gt;
--extra-repository	Add repository to search packages from&lt;br /&gt;
--simulate		Don&#039;t execute commands&lt;br /&gt;
--tag			Build images for tag RELEASE&lt;br /&gt;
--workdir		Specify temporary working directory (cache)&lt;br /&gt;
--yaml&lt;br /&gt;
&lt;br /&gt;
known profiles: ali rpi uboot base minirootfs standard vanilla extended virt xen}}&lt;br /&gt;
&lt;br /&gt;
{{Tip| You can use the --repository option multiple times, which is very useful when mixing local and official repositories. The --extra-repository option is  there only for backward-compatibility.}}&lt;br /&gt;
&lt;br /&gt;
Create an iso directory in your home dir:&lt;br /&gt;
&lt;br /&gt;
{{Cmd|mkdir -p ~/iso}}&lt;br /&gt;
&lt;br /&gt;
Then create the actual ISO.&lt;br /&gt;
In this example we will use the edge version x86_64:&lt;br /&gt;
{{Cmd|sh aports/scripts/mkimage.sh --tag edge \&lt;br /&gt;
	--outdir ~/iso \&lt;br /&gt;
	--arch x86_64 \&lt;br /&gt;
	--repository &amp;lt;nowiki&amp;gt;https://dl-cdn.alpinelinux.org/alpine/edge/main&amp;lt;/nowiki&amp;gt; \&lt;br /&gt;
	--profile $PROFILENAME&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Notes:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* If you want to make a customized installer, you need to create &amp;lt;code&amp;gt;.default_boot_services&amp;lt;/code&amp;gt; which will cause &amp;lt;code&amp;gt;mkinitfs&amp;lt;/code&amp;gt; to create the defaults for the live image.&lt;br /&gt;
&lt;br /&gt;
* Several parts of this doc can be automated with a script, like the repository/arch/outdir settings.&lt;br /&gt;
Those steps are left to you and your imagination :)&lt;br /&gt;
&lt;br /&gt;
== Testing your ISO image ==&lt;br /&gt;
&lt;br /&gt;
[[QEMU#Live_mode|QEMU]] is useful for a quick test of your newly created ISO image.&lt;br /&gt;
&lt;br /&gt;
[[Category:Package Manager]]&lt;br /&gt;
[[Category:ISO]]&lt;/div&gt;</summary>
		<author><name>Divyekapoor</name></author>
	</entry>
	<entry>
		<id>https://wiki.alpinelinux.org/w/index.php?title=How_to_make_a_custom_ISO_image_with_mkimage&amp;diff=25378</id>
		<title>How to make a custom ISO image with mkimage</title>
		<link rel="alternate" type="text/html" href="https://wiki.alpinelinux.org/w/index.php?title=How_to_make_a_custom_ISO_image_with_mkimage&amp;diff=25378"/>
		<updated>2023-10-20T22:54:56Z</updated>

		<summary type="html">&lt;p&gt;Divyekapoor: Show how to make packages available on boot.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This document explains how to build a custom ISO image using the new mkimage scripts located in [[aports]] directory.&lt;br /&gt;
&lt;br /&gt;
== Prerequisites ==&lt;br /&gt;
&lt;br /&gt;
First make sure we have the needed tools&lt;br /&gt;
{{Cmd|apk add alpine-sdk alpine-conf syslinux xorriso squashfs-tools grub grub-efi doas}}&lt;br /&gt;
For efi you should add the following: &lt;br /&gt;
{{Cmd|apk add mtools dosfstools grub-efi}}&lt;br /&gt;
&lt;br /&gt;
Create a user (e.g. build) and add them to the abuild group:&lt;br /&gt;
{{Cmd|adduser build -G abuild}}&lt;br /&gt;
&lt;br /&gt;
Give the user root-like permissions:&lt;br /&gt;
{{Cmd|vi /etc/doas.d/doas.conf}}&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
permit :abuild&lt;br /&gt;
permit persist :abuild&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Change to the build user: &lt;br /&gt;
{{Cmd|su - build}}&lt;br /&gt;
&lt;br /&gt;
Then create signing keys (-i installs them in /etc/apk/keys which is required for later)&lt;br /&gt;
{{Cmd|abuild-keygen -i -a}}&lt;br /&gt;
&lt;br /&gt;
{{Tip| Make sure your public keys are placed in /etc/apk/keys/ (example: build-xxxxxxxx.rsa.pub)}}&lt;br /&gt;
{{Cmd|ls /etc/apk/keys/}}&lt;br /&gt;
&lt;br /&gt;
Clone (or update) the [https://gitlab.alpinelinux.org/alpine/aports git repository].&lt;br /&gt;
{{Cmd|git clone --depth&amp;amp;#61;1 https://gitlab.alpinelinux.org/alpine/aports.git}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Make sure the apk index is up to date (so apk can find the packages):&lt;br /&gt;
{{Cmd|doas apk update}}&lt;br /&gt;
&lt;br /&gt;
Make sure your /tmp is large enough.  If you have the default 1GB /tmp, then create a local one with:&lt;br /&gt;
&amp;lt;pre&amp;gt;mkdir -pv ~/tmp&lt;br /&gt;
export TMPDIR=~/tmp&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Configuration ==&lt;br /&gt;
&lt;br /&gt;
The mkimg scripts are shipped with pre-configured profiles.&lt;br /&gt;
&lt;br /&gt;
The format is &#039;&#039;&#039;mkimg.$PROFILENAME.sh&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
In order to have a custom ISO, you should create your own &#039;&#039;&#039;mkimg.$PROFILENAME.sh&#039;&#039;&#039; script.&lt;br /&gt;
&lt;br /&gt;
This is an example used to make a ZFS module, overlayfs (which enables r/w mode for /lib/modules), a serial console output and some other useful apks to build a simple NAS:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;export PROFILENAME=nas&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
cat &amp;lt;&amp;lt; EOF &amp;gt; ~/aports/scripts/mkimg.$PROFILENAME.sh&lt;br /&gt;
profile_$PROFILENAME() {&lt;br /&gt;
        profile_standard&lt;br /&gt;
        kernel_cmdline=&amp;quot;unionfs_size=512M console=tty0 console=ttyS0,115200&amp;quot;&lt;br /&gt;
        syslinux_serial=&amp;quot;0 115200&amp;quot;&lt;br /&gt;
        kernel_addons=&amp;quot;zfs&amp;quot;&lt;br /&gt;
        apks=&amp;quot;\$apks iscsi-scst zfs-scripts zfs zfs-utils-py&lt;br /&gt;
                cciss_vol_status lvm2 mdadm mkinitfs mtools nfs-utils&lt;br /&gt;
                parted rsync sfdisk syslinux util-linux xfsprogs&lt;br /&gt;
                dosfstools ntfs-3g&lt;br /&gt;
                &amp;quot;&lt;br /&gt;
        local _k _a&lt;br /&gt;
        for _k in \$kernel_flavors; do&lt;br /&gt;
                apks=&amp;quot;\$apks linux-\$_k&amp;quot;&lt;br /&gt;
                for _a in \$kernel_addons; do&lt;br /&gt;
                        apks=&amp;quot;\$apks \$_a-\$_k&amp;quot;&lt;br /&gt;
                done&lt;br /&gt;
        done&lt;br /&gt;
        apks=&amp;quot;\$apks linux-firmware&amp;quot;&lt;br /&gt;
}&lt;br /&gt;
EOF&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Set the script as executable:&lt;br /&gt;
{{Cmd|chmod +x ~/aports/scripts/mkimg.$PROFILENAME.sh}}&lt;br /&gt;
&lt;br /&gt;
== Making packages available on boot ==&lt;br /&gt;
&lt;br /&gt;
A package may be made available in the live system by defining the generation of an apkovl which contains a corresponding /etc/apk/world file, and adding that overlay definition to the mkimg-profile, e.g. with `apkovl=&amp;quot;genapkovl-mkimgoverlay.sh&amp;quot;`&lt;br /&gt;
&lt;br /&gt;
Note that to *use* your added apks, you have to install them, with &amp;lt;code&amp;gt;apk add&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The definition may be done as in the [https://github.com/alpinelinux/aports/blob/master/scripts/genapkovl-dhcp.sh genapkovl-dhcp.sh] example.&lt;br /&gt;
Copy the relevant parts (including the rc_add lines) into a `genapkovl-mkimgoverlay.sh` file and add the package(s) that should be installed in the live system on separate lines in the file contents for /etc/apk/world.&lt;br /&gt;
&lt;br /&gt;
{{Cmd|cp ~/aport/scripts/genapkovl-dhcp.sh ~/aport/scripts/genapkovl-mkimgoverlay.sh}}&lt;br /&gt;
&lt;br /&gt;
Edit the file to add:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
rc_add &amp;lt;apk1-service&amp;gt; boot&lt;br /&gt;
rc_add &amp;lt;apk2-service&amp;gt; boot&lt;br /&gt;
...&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
in the relevant locations.&lt;br /&gt;
&lt;br /&gt;
Then edit the profile build script above and add:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
apkovl=&amp;quot;genapkovl-mkimgoverlay.sh&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
immediately after the last apks= line.&lt;br /&gt;
&lt;br /&gt;
== Create the ISO ==&lt;br /&gt;
&lt;br /&gt;
{{Cmd|mkimage.sh	[--tag RELEASE] [--outdir OUTDIR] [--workdir WORKDIR]&lt;br /&gt;
		[--arch ARCH] [--profile PROFILE] [--hostkeys] [--simulate]&lt;br /&gt;
		[--repository REPO] [--extra-repository REPO] [--yaml FILE]&lt;br /&gt;
mkimage.sh	--help&lt;br /&gt;
&lt;br /&gt;
options:&lt;br /&gt;
--arch			Specify which architecture images to build&lt;br /&gt;
			(default: x86_64)&lt;br /&gt;
--hostkeys		Copy system apk signing keys to created images&lt;br /&gt;
--outdir		Specify directory for the created images&lt;br /&gt;
--profile		Specify which profiles to build&lt;br /&gt;
--repository		Package repository to use for the image create&lt;br /&gt;
--extra-repository	Add repository to search packages from&lt;br /&gt;
--simulate		Don&#039;t execute commands&lt;br /&gt;
--tag			Build images for tag RELEASE&lt;br /&gt;
--workdir		Specify temporary working directory (cache)&lt;br /&gt;
--yaml&lt;br /&gt;
&lt;br /&gt;
known profiles: ali rpi uboot base minirootfs standard vanilla extended virt xen}}&lt;br /&gt;
&lt;br /&gt;
{{Tip| You can use the --repository option multiple times, which is very useful when mixing local and official repositories. The --extra-repository option is  there only for backward-compatibility.}}&lt;br /&gt;
&lt;br /&gt;
Create an iso directory in your home dir:&lt;br /&gt;
&lt;br /&gt;
{{Cmd|mkdir -p ~/iso}}&lt;br /&gt;
&lt;br /&gt;
Then create the actual ISO.&lt;br /&gt;
In this example we will use the edge version x86_64:&lt;br /&gt;
{{Cmd|sh aports/scripts/mkimage.sh --tag edge \&lt;br /&gt;
	--outdir ~/iso \&lt;br /&gt;
	--arch x86_64 \&lt;br /&gt;
	--repository &amp;lt;nowiki&amp;gt;https://dl-cdn.alpinelinux.org/alpine/edge/main&amp;lt;/nowiki&amp;gt; \&lt;br /&gt;
	--profile $PROFILENAME&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Notes:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* If you want to make a customized installer, you need to create &amp;lt;code&amp;gt;.default_boot_services&amp;lt;/code&amp;gt; which will cause &amp;lt;code&amp;gt;mkinitfs&amp;lt;/code&amp;gt; to create the defaults for the live image.&lt;br /&gt;
&lt;br /&gt;
* Several parts of this doc can be automated with a script, like the repository/arch/outdir settings.&lt;br /&gt;
Those steps are left to you and your imagination :)&lt;br /&gt;
&lt;br /&gt;
== Testing your ISO image ==&lt;br /&gt;
&lt;br /&gt;
[[QEMU#Live_mode|QEMU]] is useful for a quick test of your newly created ISO image.&lt;br /&gt;
&lt;br /&gt;
[[Category:Package Manager]]&lt;br /&gt;
[[Category:ISO]]&lt;/div&gt;</summary>
		<author><name>Divyekapoor</name></author>
	</entry>
	<entry>
		<id>https://wiki.alpinelinux.org/w/index.php?title=How_to_make_a_custom_ISO_image_with_mkimage&amp;diff=25377</id>
		<title>How to make a custom ISO image with mkimage</title>
		<link rel="alternate" type="text/html" href="https://wiki.alpinelinux.org/w/index.php?title=How_to_make_a_custom_ISO_image_with_mkimage&amp;diff=25377"/>
		<updated>2023-10-20T22:42:54Z</updated>

		<summary type="html">&lt;p&gt;Divyekapoor: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This document explains how to build a custom ISO image using the new mkimage scripts located in [[aports]] directory.&lt;br /&gt;
&lt;br /&gt;
== Prerequisites ==&lt;br /&gt;
&lt;br /&gt;
First make sure we have the needed tools&lt;br /&gt;
{{Cmd|apk add alpine-sdk alpine-conf syslinux xorriso squashfs-tools grub grub-efi doas}}&lt;br /&gt;
For efi you should add the following: &lt;br /&gt;
{{Cmd|apk add mtools dosfstools grub-efi}}&lt;br /&gt;
&lt;br /&gt;
Create a user (e.g. build) and add them to the abuild group:&lt;br /&gt;
{{Cmd|adduser build -G abuild}}&lt;br /&gt;
&lt;br /&gt;
Give the user root-like permissions:&lt;br /&gt;
{{Cmd|vi /etc/doas.d/doas.conf}}&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
permit :abuild&lt;br /&gt;
permit persist :abuild&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Change to the build user: &lt;br /&gt;
{{Cmd|su - build}}&lt;br /&gt;
&lt;br /&gt;
Then create signing keys (-i installs them in /etc/apk/keys which is required for later)&lt;br /&gt;
{{Cmd|abuild-keygen -i -a}}&lt;br /&gt;
&lt;br /&gt;
{{Tip| Make sure your public keys are placed in /etc/apk/keys/ (example: build-xxxxxxxx.rsa.pub)}}&lt;br /&gt;
{{Cmd|ls /etc/apk/keys/}}&lt;br /&gt;
&lt;br /&gt;
Clone (or update) the [https://gitlab.alpinelinux.org/alpine/aports git repository].&lt;br /&gt;
{{Cmd|git clone --depth&amp;amp;#61;1 https://gitlab.alpinelinux.org/alpine/aports.git}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Make sure the apk index is up to date (so apk can find the packages):&lt;br /&gt;
{{Cmd|doas apk update}}&lt;br /&gt;
&lt;br /&gt;
Make sure your /tmp is large enough.  If you have the default 1GB /tmp, then create a local one with:&lt;br /&gt;
&amp;lt;pre&amp;gt;mkdir -pv ~/tmp&lt;br /&gt;
export TMPDIR=~/tmp&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Configuration ==&lt;br /&gt;
&lt;br /&gt;
The mkimg scripts are shipped with pre-configured profiles.&lt;br /&gt;
&lt;br /&gt;
The format is &#039;&#039;&#039;mkimg.$PROFILENAME.sh&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
In order to have a custom ISO, you should create your own &#039;&#039;&#039;mkimg.$PROFILENAME.sh&#039;&#039;&#039; script.&lt;br /&gt;
&lt;br /&gt;
This is an example used to make a ZFS module, overlayfs (which enables r/w mode for /lib/modules), a serial console output and some other useful apks to build a simple NAS:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;export PROFILENAME=nas&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
cat &amp;lt;&amp;lt; EOF &amp;gt; ~/aports/scripts/mkimg.$PROFILENAME.sh&lt;br /&gt;
profile_$PROFILENAME() {&lt;br /&gt;
        profile_standard&lt;br /&gt;
        kernel_cmdline=&amp;quot;unionfs_size=512M console=tty0 console=ttyS0,115200&amp;quot;&lt;br /&gt;
        syslinux_serial=&amp;quot;0 115200&amp;quot;&lt;br /&gt;
        kernel_addons=&amp;quot;zfs&amp;quot;&lt;br /&gt;
        apks=&amp;quot;\$apks iscsi-scst zfs-scripts zfs zfs-utils-py&lt;br /&gt;
                cciss_vol_status lvm2 mdadm mkinitfs mtools nfs-utils&lt;br /&gt;
                parted rsync sfdisk syslinux util-linux xfsprogs&lt;br /&gt;
                dosfstools ntfs-3g&lt;br /&gt;
                &amp;quot;&lt;br /&gt;
        local _k _a&lt;br /&gt;
        for _k in \$kernel_flavors; do&lt;br /&gt;
                apks=&amp;quot;\$apks linux-\$_k&amp;quot;&lt;br /&gt;
                for _a in \$kernel_addons; do&lt;br /&gt;
                        apks=&amp;quot;\$apks \$_a-\$_k&amp;quot;&lt;br /&gt;
                done&lt;br /&gt;
        done&lt;br /&gt;
        apks=&amp;quot;\$apks linux-firmware&amp;quot;&lt;br /&gt;
}&lt;br /&gt;
EOF&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Set the script as executable:&lt;br /&gt;
{{Cmd|chmod +x ~/aports/scripts/mkimg.$PROFILENAME.sh}}&lt;br /&gt;
&lt;br /&gt;
== Making packages available on boot ==&lt;br /&gt;
&lt;br /&gt;
A package may be made available in the live system by defining the generation of an apkovl which contains a corresponding /etc/apk/world file, and adding that overlay definition to the mkimg-profile, e.g. with `apkovl=&amp;quot;genapkovl-mkimgoverlay.sh&amp;quot;`&lt;br /&gt;
&lt;br /&gt;
Note that to *use* your added apks, you have to install them, with &amp;lt;code&amp;gt;apk add&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The definition may be done as in the [https://github.com/alpinelinux/aports/blob/master/scripts/genapkovl-dhcp.sh genapkovl-dhcp.sh] example.&lt;br /&gt;
Copy the relevant parts (including the rc_add lines) into a `genapkovl-mkimgoverlay.sh` file and add the package(s) that should be installed in the live system on separate lines in the file contents for /etc/apk/world.&lt;br /&gt;
&lt;br /&gt;
{{Cmd|cp ~/aport/scripts/genapkovl-dhcp.sh ~/aport/scripts/genapkovl-mkimgoverlay.sh}}&lt;br /&gt;
&lt;br /&gt;
Edit the file to add:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
rc_add &amp;lt;apk1-service&amp;gt; boot&lt;br /&gt;
rc_add &amp;lt;apk2-service&amp;gt; boot&lt;br /&gt;
...&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
in the relevant locations.&lt;br /&gt;
&lt;br /&gt;
== Create the ISO ==&lt;br /&gt;
&lt;br /&gt;
{{Cmd|mkimage.sh	[--tag RELEASE] [--outdir OUTDIR] [--workdir WORKDIR]&lt;br /&gt;
		[--arch ARCH] [--profile PROFILE] [--hostkeys] [--simulate]&lt;br /&gt;
		[--repository REPO] [--extra-repository REPO] [--yaml FILE]&lt;br /&gt;
mkimage.sh	--help&lt;br /&gt;
&lt;br /&gt;
options:&lt;br /&gt;
--arch			Specify which architecture images to build&lt;br /&gt;
			(default: x86_64)&lt;br /&gt;
--hostkeys		Copy system apk signing keys to created images&lt;br /&gt;
--outdir		Specify directory for the created images&lt;br /&gt;
--profile		Specify which profiles to build&lt;br /&gt;
--repository		Package repository to use for the image create&lt;br /&gt;
--extra-repository	Add repository to search packages from&lt;br /&gt;
--simulate		Don&#039;t execute commands&lt;br /&gt;
--tag			Build images for tag RELEASE&lt;br /&gt;
--workdir		Specify temporary working directory (cache)&lt;br /&gt;
--yaml&lt;br /&gt;
&lt;br /&gt;
known profiles: ali rpi uboot base minirootfs standard vanilla extended virt xen}}&lt;br /&gt;
&lt;br /&gt;
{{Tip| You can use the --repository option multiple times, which is very useful when mixing local and official repositories. The --extra-repository option is  there only for backward-compatibility.}}&lt;br /&gt;
&lt;br /&gt;
Create an iso directory in your home dir:&lt;br /&gt;
&lt;br /&gt;
{{Cmd|mkdir -p ~/iso}}&lt;br /&gt;
&lt;br /&gt;
Then create the actual ISO.&lt;br /&gt;
In this example we will use the edge version x86_64:&lt;br /&gt;
{{Cmd|sh aports/scripts/mkimage.sh --tag edge \&lt;br /&gt;
	--outdir ~/iso \&lt;br /&gt;
	--arch x86_64 \&lt;br /&gt;
	--repository &amp;lt;nowiki&amp;gt;https://dl-cdn.alpinelinux.org/alpine/edge/main&amp;lt;/nowiki&amp;gt; \&lt;br /&gt;
	--profile $PROFILENAME&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Notes:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* If you want to make a customized installer, you need to create &amp;lt;code&amp;gt;.default_boot_services&amp;lt;/code&amp;gt; which will cause &amp;lt;code&amp;gt;mkinitfs&amp;lt;/code&amp;gt; to create the defaults for the live image.&lt;br /&gt;
&lt;br /&gt;
* Several parts of this doc can be automated with a script, like the repository/arch/outdir settings.&lt;br /&gt;
Those steps are left to you and your imagination :)&lt;br /&gt;
&lt;br /&gt;
== Testing your ISO image ==&lt;br /&gt;
&lt;br /&gt;
[[QEMU#Live_mode|QEMU]] is useful for a quick test of your newly created ISO image.&lt;br /&gt;
&lt;br /&gt;
[[Category:Package Manager]]&lt;br /&gt;
[[Category:ISO]]&lt;/div&gt;</summary>
		<author><name>Divyekapoor</name></author>
	</entry>
	<entry>
		<id>https://wiki.alpinelinux.org/w/index.php?title=How_to_make_a_custom_ISO_image_with_mkimage&amp;diff=25376</id>
		<title>How to make a custom ISO image with mkimage</title>
		<link rel="alternate" type="text/html" href="https://wiki.alpinelinux.org/w/index.php?title=How_to_make_a_custom_ISO_image_with_mkimage&amp;diff=25376"/>
		<updated>2023-10-20T22:37:45Z</updated>

		<summary type="html">&lt;p&gt;Divyekapoor: Grub is required for the build to finish.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This document explains how to build a custom ISO image using the new mkimage scripts located in [[aports]] directory.&lt;br /&gt;
&lt;br /&gt;
== Prerequisites ==&lt;br /&gt;
&lt;br /&gt;
First make sure we have the needed tools&lt;br /&gt;
{{Cmd|apk add alpine-sdk alpine-conf syslinux xorriso squashfs-tools grub doas}}&lt;br /&gt;
For efi you should add the following: &lt;br /&gt;
{{Cmd|apk add mtools dosfstools grub-efi}}&lt;br /&gt;
&lt;br /&gt;
Create a user (e.g. build) and add them to the abuild group:&lt;br /&gt;
{{Cmd|adduser build -G abuild}}&lt;br /&gt;
&lt;br /&gt;
Give the user root-like permissions:&lt;br /&gt;
{{Cmd|vi /etc/doas.d/doas.conf}}&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
permit :abuild&lt;br /&gt;
permit persist :abuild&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Change to the build user: &lt;br /&gt;
{{Cmd|su - build}}&lt;br /&gt;
&lt;br /&gt;
Then create signing keys (-i installs them in /etc/apk/keys which is required for later)&lt;br /&gt;
{{Cmd|abuild-keygen -i -a}}&lt;br /&gt;
&lt;br /&gt;
{{Tip| Make sure your public keys are placed in /etc/apk/keys/ (example: build-xxxxxxxx.rsa.pub)}}&lt;br /&gt;
{{Cmd|ls /etc/apk/keys/}}&lt;br /&gt;
&lt;br /&gt;
Clone (or update) the [https://gitlab.alpinelinux.org/alpine/aports git repository].&lt;br /&gt;
{{Cmd|git clone --depth&amp;amp;#61;1 https://gitlab.alpinelinux.org/alpine/aports.git}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Make sure the apk index is up to date (so apk can find the packages):&lt;br /&gt;
{{Cmd|doas apk update}}&lt;br /&gt;
&lt;br /&gt;
Make sure your /tmp is large enough.  If you have the default 1GB /tmp, then create a local one with:&lt;br /&gt;
&amp;lt;pre&amp;gt;mkdir -pv ~/tmp&lt;br /&gt;
export TMPDIR=~/tmp&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Configuration ==&lt;br /&gt;
&lt;br /&gt;
The mkimg scripts are shipped with pre-configured profiles.&lt;br /&gt;
&lt;br /&gt;
The format is &#039;&#039;&#039;mkimg.$PROFILENAME.sh&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
In order to have a custom ISO, you should create your own &#039;&#039;&#039;mkimg.$PROFILENAME.sh&#039;&#039;&#039; script.&lt;br /&gt;
&lt;br /&gt;
This is an example used to make a ZFS module, overlayfs (which enables r/w mode for /lib/modules), a serial console output and some other useful apks to build a simple NAS:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;export PROFILENAME=nas&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
cat &amp;lt;&amp;lt; EOF &amp;gt; ~/aports/scripts/mkimg.$PROFILENAME.sh&lt;br /&gt;
profile_$PROFILENAME() {&lt;br /&gt;
        profile_standard&lt;br /&gt;
        kernel_cmdline=&amp;quot;unionfs_size=512M console=tty0 console=ttyS0,115200&amp;quot;&lt;br /&gt;
        syslinux_serial=&amp;quot;0 115200&amp;quot;&lt;br /&gt;
        kernel_addons=&amp;quot;zfs&amp;quot;&lt;br /&gt;
        apks=&amp;quot;\$apks iscsi-scst zfs-scripts zfs zfs-utils-py&lt;br /&gt;
                cciss_vol_status lvm2 mdadm mkinitfs mtools nfs-utils&lt;br /&gt;
                parted rsync sfdisk syslinux util-linux xfsprogs&lt;br /&gt;
                dosfstools ntfs-3g&lt;br /&gt;
                &amp;quot;&lt;br /&gt;
        local _k _a&lt;br /&gt;
        for _k in \$kernel_flavors; do&lt;br /&gt;
                apks=&amp;quot;\$apks linux-\$_k&amp;quot;&lt;br /&gt;
                for _a in \$kernel_addons; do&lt;br /&gt;
                        apks=&amp;quot;\$apks \$_a-\$_k&amp;quot;&lt;br /&gt;
                done&lt;br /&gt;
        done&lt;br /&gt;
        apks=&amp;quot;\$apks linux-firmware&amp;quot;&lt;br /&gt;
}&lt;br /&gt;
EOF&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Set the script as executable:&lt;br /&gt;
{{Cmd|chmod +x ~/aports/scripts/mkimg.$PROFILENAME.sh}}&lt;br /&gt;
&lt;br /&gt;
== Making packages available on boot ==&lt;br /&gt;
&lt;br /&gt;
A package may be made available in the live system by defining the generation of an apkovl which contains a corresponding /etc/apk/world file, and adding that overlay definition to the mkimg-profile, e.g. with `apkovl=&amp;quot;genapkovl-mkimgoverlay.sh&amp;quot;`&lt;br /&gt;
&lt;br /&gt;
Note that to *use* your added apks, you have to install them, with &amp;lt;code&amp;gt;apk add&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The definition may be done as in the [https://github.com/alpinelinux/aports/blob/master/scripts/genapkovl-dhcp.sh genapkovl-dhcp.sh] example.&lt;br /&gt;
Copy the relevant parts (including the rc_add lines) into a `genapkovl-mkimgoverlay.sh` file and add the package(s) that should be installed in the live system on separate lines in the file contents for /etc/apk/world.&lt;br /&gt;
&lt;br /&gt;
{{Cmd|cp ~/aport/scripts/genapkovl-dhcp.sh ~/aport/scripts/genapkovl-mkimgoverlay.sh}}&lt;br /&gt;
&lt;br /&gt;
Edit the file to add:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
rc_add &amp;lt;apk1-service&amp;gt; boot&lt;br /&gt;
rc_add &amp;lt;apk2-service&amp;gt; boot&lt;br /&gt;
...&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
in the relevant locations.&lt;br /&gt;
&lt;br /&gt;
== Create the ISO ==&lt;br /&gt;
&lt;br /&gt;
{{Cmd|mkimage.sh	[--tag RELEASE] [--outdir OUTDIR] [--workdir WORKDIR]&lt;br /&gt;
		[--arch ARCH] [--profile PROFILE] [--hostkeys] [--simulate]&lt;br /&gt;
		[--repository REPO] [--extra-repository REPO] [--yaml FILE]&lt;br /&gt;
mkimage.sh	--help&lt;br /&gt;
&lt;br /&gt;
options:&lt;br /&gt;
--arch			Specify which architecture images to build&lt;br /&gt;
			(default: x86_64)&lt;br /&gt;
--hostkeys		Copy system apk signing keys to created images&lt;br /&gt;
--outdir		Specify directory for the created images&lt;br /&gt;
--profile		Specify which profiles to build&lt;br /&gt;
--repository		Package repository to use for the image create&lt;br /&gt;
--extra-repository	Add repository to search packages from&lt;br /&gt;
--simulate		Don&#039;t execute commands&lt;br /&gt;
--tag			Build images for tag RELEASE&lt;br /&gt;
--workdir		Specify temporary working directory (cache)&lt;br /&gt;
--yaml&lt;br /&gt;
&lt;br /&gt;
known profiles: ali rpi uboot base minirootfs standard vanilla extended virt xen}}&lt;br /&gt;
&lt;br /&gt;
{{Tip| You can use the --repository option multiple times, which is very useful when mixing local and official repositories. The --extra-repository option is  there only for backward-compatibility.}}&lt;br /&gt;
&lt;br /&gt;
Create an iso directory in your home dir:&lt;br /&gt;
&lt;br /&gt;
{{Cmd|mkdir -p ~/iso}}&lt;br /&gt;
&lt;br /&gt;
Then create the actual ISO.&lt;br /&gt;
In this example we will use the edge version x86_64:&lt;br /&gt;
{{Cmd|sh aports/scripts/mkimage.sh --tag edge \&lt;br /&gt;
	--outdir ~/iso \&lt;br /&gt;
	--arch x86_64 \&lt;br /&gt;
	--repository &amp;lt;nowiki&amp;gt;https://dl-cdn.alpinelinux.org/alpine/edge/main&amp;lt;/nowiki&amp;gt; \&lt;br /&gt;
	--profile $PROFILENAME&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Notes:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* If you want to make a customized installer, you need to create &amp;lt;code&amp;gt;.default_boot_services&amp;lt;/code&amp;gt; which will cause &amp;lt;code&amp;gt;mkinitfs&amp;lt;/code&amp;gt; to create the defaults for the live image.&lt;br /&gt;
&lt;br /&gt;
* Several parts of this doc can be automated with a script, like the repository/arch/outdir settings.&lt;br /&gt;
Those steps are left to you and your imagination :)&lt;br /&gt;
&lt;br /&gt;
== Testing your ISO image ==&lt;br /&gt;
&lt;br /&gt;
[[QEMU#Live_mode|QEMU]] is useful for a quick test of your newly created ISO image.&lt;br /&gt;
&lt;br /&gt;
[[Category:Package Manager]]&lt;br /&gt;
[[Category:ISO]]&lt;/div&gt;</summary>
		<author><name>Divyekapoor</name></author>
	</entry>
	<entry>
		<id>https://wiki.alpinelinux.org/w/index.php?title=How_to_make_a_custom_ISO_image_with_mkimage&amp;diff=25375</id>
		<title>How to make a custom ISO image with mkimage</title>
		<link rel="alternate" type="text/html" href="https://wiki.alpinelinux.org/w/index.php?title=How_to_make_a_custom_ISO_image_with_mkimage&amp;diff=25375"/>
		<updated>2023-10-20T21:48:23Z</updated>

		<summary type="html">&lt;p&gt;Divyekapoor: Provide an example of updating the file to add packages to start on boot.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This document explains how to build a custom ISO image using the new mkimage scripts located in [[aports]] directory.&lt;br /&gt;
&lt;br /&gt;
== Prerequisites ==&lt;br /&gt;
&lt;br /&gt;
First make sure we have the needed tools&lt;br /&gt;
{{Cmd|apk add alpine-sdk alpine-conf syslinux xorriso squashfs-tools doas}}&lt;br /&gt;
For efi you should add the following: &lt;br /&gt;
{{Cmd|apk add mtools dosfstools grub-efi}}&lt;br /&gt;
&lt;br /&gt;
Create a user (e.g. build) and add them to the abuild group:&lt;br /&gt;
{{Cmd|adduser build -G abuild}}&lt;br /&gt;
&lt;br /&gt;
Give the user root-like permissions:&lt;br /&gt;
{{Cmd|vi /etc/doas.d/doas.conf}}&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
permit :abuild&lt;br /&gt;
permit persist :abuild&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Change to the build user: &lt;br /&gt;
{{Cmd|su - build}}&lt;br /&gt;
&lt;br /&gt;
Then create signing keys (-i installs them in /etc/apk/keys which is required for later)&lt;br /&gt;
{{Cmd|abuild-keygen -i -a}}&lt;br /&gt;
&lt;br /&gt;
{{Tip| Make sure your public keys are placed in /etc/apk/keys/ (example: build-xxxxxxxx.rsa.pub)}}&lt;br /&gt;
{{Cmd|ls /etc/apk/keys/}}&lt;br /&gt;
&lt;br /&gt;
Clone (or update) the [https://gitlab.alpinelinux.org/alpine/aports git repository].&lt;br /&gt;
{{Cmd|git clone --depth&amp;amp;#61;1 https://gitlab.alpinelinux.org/alpine/aports.git}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Make sure the apk index is up to date (so apk can find the packages):&lt;br /&gt;
{{Cmd|doas apk update}}&lt;br /&gt;
&lt;br /&gt;
Make sure your /tmp is large enough.  If you have the default 1GB /tmp, then create a local one with:&lt;br /&gt;
&amp;lt;pre&amp;gt;mkdir -pv ~/tmp&lt;br /&gt;
export TMPDIR=~/tmp&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Configuration ==&lt;br /&gt;
&lt;br /&gt;
The mkimg scripts are shipped with pre-configured profiles.&lt;br /&gt;
&lt;br /&gt;
The format is &#039;&#039;&#039;mkimg.$PROFILENAME.sh&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
In order to have a custom ISO, you should create your own &#039;&#039;&#039;mkimg.$PROFILENAME.sh&#039;&#039;&#039; script.&lt;br /&gt;
&lt;br /&gt;
This is an example used to make a ZFS module, overlayfs (which enables r/w mode for /lib/modules), a serial console output and some other useful apks to build a simple NAS:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;export PROFILENAME=nas&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
cat &amp;lt;&amp;lt; EOF &amp;gt; ~/aports/scripts/mkimg.$PROFILENAME.sh&lt;br /&gt;
profile_$PROFILENAME() {&lt;br /&gt;
        profile_standard&lt;br /&gt;
        kernel_cmdline=&amp;quot;unionfs_size=512M console=tty0 console=ttyS0,115200&amp;quot;&lt;br /&gt;
        syslinux_serial=&amp;quot;0 115200&amp;quot;&lt;br /&gt;
        kernel_addons=&amp;quot;zfs&amp;quot;&lt;br /&gt;
        apks=&amp;quot;\$apks iscsi-scst zfs-scripts zfs zfs-utils-py&lt;br /&gt;
                cciss_vol_status lvm2 mdadm mkinitfs mtools nfs-utils&lt;br /&gt;
                parted rsync sfdisk syslinux util-linux xfsprogs&lt;br /&gt;
                dosfstools ntfs-3g&lt;br /&gt;
                &amp;quot;&lt;br /&gt;
        local _k _a&lt;br /&gt;
        for _k in \$kernel_flavors; do&lt;br /&gt;
                apks=&amp;quot;\$apks linux-\$_k&amp;quot;&lt;br /&gt;
                for _a in \$kernel_addons; do&lt;br /&gt;
                        apks=&amp;quot;\$apks \$_a-\$_k&amp;quot;&lt;br /&gt;
                done&lt;br /&gt;
        done&lt;br /&gt;
        apks=&amp;quot;\$apks linux-firmware&amp;quot;&lt;br /&gt;
}&lt;br /&gt;
EOF&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Set the script as executable:&lt;br /&gt;
{{Cmd|chmod +x ~/aports/scripts/mkimg.$PROFILENAME.sh}}&lt;br /&gt;
&lt;br /&gt;
== Making packages available on boot ==&lt;br /&gt;
&lt;br /&gt;
A package may be made available in the live system by defining the generation of an apkovl which contains a corresponding /etc/apk/world file, and adding that overlay definition to the mkimg-profile, e.g. with `apkovl=&amp;quot;genapkovl-mkimgoverlay.sh&amp;quot;`&lt;br /&gt;
&lt;br /&gt;
Note that to *use* your added apks, you have to install them, with &amp;lt;code&amp;gt;apk add&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The definition may be done as in the [https://github.com/alpinelinux/aports/blob/master/scripts/genapkovl-dhcp.sh genapkovl-dhcp.sh] example.&lt;br /&gt;
Copy the relevant parts (including the rc_add lines) into a `genapkovl-mkimgoverlay.sh` file and add the package(s) that should be installed in the live system on separate lines in the file contents for /etc/apk/world.&lt;br /&gt;
&lt;br /&gt;
{{Cmd|cp ~/aport/scripts/genapkovl-dhcp.sh ~/aport/scripts/genapkovl-mkimgoverlay.sh}}&lt;br /&gt;
&lt;br /&gt;
Edit the file to add:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
rc_add &amp;lt;apk1-service&amp;gt; boot&lt;br /&gt;
rc_add &amp;lt;apk2-service&amp;gt; boot&lt;br /&gt;
...&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
in the relevant locations.&lt;br /&gt;
&lt;br /&gt;
== Create the ISO ==&lt;br /&gt;
&lt;br /&gt;
{{Cmd|mkimage.sh	[--tag RELEASE] [--outdir OUTDIR] [--workdir WORKDIR]&lt;br /&gt;
		[--arch ARCH] [--profile PROFILE] [--hostkeys] [--simulate]&lt;br /&gt;
		[--repository REPO] [--extra-repository REPO] [--yaml FILE]&lt;br /&gt;
mkimage.sh	--help&lt;br /&gt;
&lt;br /&gt;
options:&lt;br /&gt;
--arch			Specify which architecture images to build&lt;br /&gt;
			(default: x86_64)&lt;br /&gt;
--hostkeys		Copy system apk signing keys to created images&lt;br /&gt;
--outdir		Specify directory for the created images&lt;br /&gt;
--profile		Specify which profiles to build&lt;br /&gt;
--repository		Package repository to use for the image create&lt;br /&gt;
--extra-repository	Add repository to search packages from&lt;br /&gt;
--simulate		Don&#039;t execute commands&lt;br /&gt;
--tag			Build images for tag RELEASE&lt;br /&gt;
--workdir		Specify temporary working directory (cache)&lt;br /&gt;
--yaml&lt;br /&gt;
&lt;br /&gt;
known profiles: ali rpi uboot base minirootfs standard vanilla extended virt xen}}&lt;br /&gt;
&lt;br /&gt;
{{Tip| You can use the --repository option multiple times, which is very useful when mixing local and official repositories. The --extra-repository option is  there only for backward-compatibility.}}&lt;br /&gt;
&lt;br /&gt;
Create an iso directory in your home dir:&lt;br /&gt;
&lt;br /&gt;
{{Cmd|mkdir -p ~/iso}}&lt;br /&gt;
&lt;br /&gt;
Then create the actual ISO.&lt;br /&gt;
In this example we will use the edge version x86_64:&lt;br /&gt;
{{Cmd|sh aports/scripts/mkimage.sh --tag edge \&lt;br /&gt;
	--outdir ~/iso \&lt;br /&gt;
	--arch x86_64 \&lt;br /&gt;
	--repository &amp;lt;nowiki&amp;gt;https://dl-cdn.alpinelinux.org/alpine/edge/main&amp;lt;/nowiki&amp;gt; \&lt;br /&gt;
	--profile $PROFILENAME&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Notes:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* If you want to make a customized installer, you need to create &amp;lt;code&amp;gt;.default_boot_services&amp;lt;/code&amp;gt; which will cause &amp;lt;code&amp;gt;mkinitfs&amp;lt;/code&amp;gt; to create the defaults for the live image.&lt;br /&gt;
&lt;br /&gt;
* Several parts of this doc can be automated with a script, like the repository/arch/outdir settings.&lt;br /&gt;
Those steps are left to you and your imagination :)&lt;br /&gt;
&lt;br /&gt;
== Testing your ISO image ==&lt;br /&gt;
&lt;br /&gt;
[[QEMU#Live_mode|QEMU]] is useful for a quick test of your newly created ISO image.&lt;br /&gt;
&lt;br /&gt;
[[Category:Package Manager]]&lt;br /&gt;
[[Category:ISO]]&lt;/div&gt;</summary>
		<author><name>Divyekapoor</name></author>
	</entry>
	<entry>
		<id>https://wiki.alpinelinux.org/w/index.php?title=How_to_make_a_custom_ISO_image_with_mkimage&amp;diff=25374</id>
		<title>How to make a custom ISO image with mkimage</title>
		<link rel="alternate" type="text/html" href="https://wiki.alpinelinux.org/w/index.php?title=How_to_make_a_custom_ISO_image_with_mkimage&amp;diff=25374"/>
		<updated>2023-10-20T21:43:56Z</updated>

		<summary type="html">&lt;p&gt;Divyekapoor: Add a command to replace the text in the above paragraph.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This document explains how to build a custom ISO image using the new mkimage scripts located in [[aports]] directory.&lt;br /&gt;
&lt;br /&gt;
== Prerequisites ==&lt;br /&gt;
&lt;br /&gt;
First make sure we have the needed tools&lt;br /&gt;
{{Cmd|apk add alpine-sdk alpine-conf syslinux xorriso squashfs-tools doas}}&lt;br /&gt;
For efi you should add the following: &lt;br /&gt;
{{Cmd|apk add mtools dosfstools grub-efi}}&lt;br /&gt;
&lt;br /&gt;
Create a user (e.g. build) and add them to the abuild group:&lt;br /&gt;
{{Cmd|adduser build -G abuild}}&lt;br /&gt;
&lt;br /&gt;
Give the user root-like permissions:&lt;br /&gt;
{{Cmd|vi /etc/doas.d/doas.conf}}&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
permit :abuild&lt;br /&gt;
permit persist :abuild&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Change to the build user: &lt;br /&gt;
{{Cmd|su - build}}&lt;br /&gt;
&lt;br /&gt;
Then create signing keys (-i installs them in /etc/apk/keys which is required for later)&lt;br /&gt;
{{Cmd|abuild-keygen -i -a}}&lt;br /&gt;
&lt;br /&gt;
{{Tip| Make sure your public keys are placed in /etc/apk/keys/ (example: build-xxxxxxxx.rsa.pub)}}&lt;br /&gt;
{{Cmd|ls /etc/apk/keys/}}&lt;br /&gt;
&lt;br /&gt;
Clone (or update) the [https://gitlab.alpinelinux.org/alpine/aports git repository].&lt;br /&gt;
{{Cmd|git clone --depth&amp;amp;#61;1 https://gitlab.alpinelinux.org/alpine/aports.git}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Make sure the apk index is up to date (so apk can find the packages):&lt;br /&gt;
{{Cmd|doas apk update}}&lt;br /&gt;
&lt;br /&gt;
Make sure your /tmp is large enough.  If you have the default 1GB /tmp, then create a local one with:&lt;br /&gt;
&amp;lt;pre&amp;gt;mkdir -pv ~/tmp&lt;br /&gt;
export TMPDIR=~/tmp&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Configuration ==&lt;br /&gt;
&lt;br /&gt;
The mkimg scripts are shipped with pre-configured profiles.&lt;br /&gt;
&lt;br /&gt;
The format is &#039;&#039;&#039;mkimg.$PROFILENAME.sh&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
In order to have a custom ISO, you should create your own &#039;&#039;&#039;mkimg.$PROFILENAME.sh&#039;&#039;&#039; script.&lt;br /&gt;
&lt;br /&gt;
This is an example used to make a ZFS module, overlayfs (which enables r/w mode for /lib/modules), a serial console output and some other useful apks to build a simple NAS:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;export PROFILENAME=nas&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
cat &amp;lt;&amp;lt; EOF &amp;gt; ~/aports/scripts/mkimg.$PROFILENAME.sh&lt;br /&gt;
profile_$PROFILENAME() {&lt;br /&gt;
        profile_standard&lt;br /&gt;
        kernel_cmdline=&amp;quot;unionfs_size=512M console=tty0 console=ttyS0,115200&amp;quot;&lt;br /&gt;
        syslinux_serial=&amp;quot;0 115200&amp;quot;&lt;br /&gt;
        kernel_addons=&amp;quot;zfs&amp;quot;&lt;br /&gt;
        apks=&amp;quot;\$apks iscsi-scst zfs-scripts zfs zfs-utils-py&lt;br /&gt;
                cciss_vol_status lvm2 mdadm mkinitfs mtools nfs-utils&lt;br /&gt;
                parted rsync sfdisk syslinux util-linux xfsprogs&lt;br /&gt;
                dosfstools ntfs-3g&lt;br /&gt;
                &amp;quot;&lt;br /&gt;
        local _k _a&lt;br /&gt;
        for _k in \$kernel_flavors; do&lt;br /&gt;
                apks=&amp;quot;\$apks linux-\$_k&amp;quot;&lt;br /&gt;
                for _a in \$kernel_addons; do&lt;br /&gt;
                        apks=&amp;quot;\$apks \$_a-\$_k&amp;quot;&lt;br /&gt;
                done&lt;br /&gt;
        done&lt;br /&gt;
        apks=&amp;quot;\$apks linux-firmware&amp;quot;&lt;br /&gt;
}&lt;br /&gt;
EOF&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Set the script as executable:&lt;br /&gt;
{{Cmd|chmod +x ~/aports/scripts/mkimg.$PROFILENAME.sh}}&lt;br /&gt;
&lt;br /&gt;
== Making packages available on boot ==&lt;br /&gt;
&lt;br /&gt;
A package may be made available in the live system by defining the generation of an apkovl which contains a corresponding /etc/apk/world file, and adding that overlay definition to the mkimg-profile, e.g. with `apkovl=&amp;quot;genapkovl-mkimgoverlay.sh&amp;quot;`&lt;br /&gt;
&lt;br /&gt;
Note that to *use* your added apks, you have to install them, with &amp;lt;code&amp;gt;apk add&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The definition may be done as in the [https://github.com/alpinelinux/aports/blob/master/scripts/genapkovl-dhcp.sh genapkovl-dhcp.sh] example.&lt;br /&gt;
Copy the relevant parts (including the rc_add lines) into a `genapkovl-mkimgoverlay.sh` file and add the package(s) that should be installed in the live system on separate lines in the file contents for /etc/apk/world.&lt;br /&gt;
&lt;br /&gt;
{{Cmd|cp ~/aport/scripts/genapkovl-dhcp.sh ~/aport/scripts/genapkovl-mkimgoverlay.sh}}&lt;br /&gt;
&lt;br /&gt;
== Create the ISO ==&lt;br /&gt;
&lt;br /&gt;
{{Cmd|mkimage.sh	[--tag RELEASE] [--outdir OUTDIR] [--workdir WORKDIR]&lt;br /&gt;
		[--arch ARCH] [--profile PROFILE] [--hostkeys] [--simulate]&lt;br /&gt;
		[--repository REPO] [--extra-repository REPO] [--yaml FILE]&lt;br /&gt;
mkimage.sh	--help&lt;br /&gt;
&lt;br /&gt;
options:&lt;br /&gt;
--arch			Specify which architecture images to build&lt;br /&gt;
			(default: x86_64)&lt;br /&gt;
--hostkeys		Copy system apk signing keys to created images&lt;br /&gt;
--outdir		Specify directory for the created images&lt;br /&gt;
--profile		Specify which profiles to build&lt;br /&gt;
--repository		Package repository to use for the image create&lt;br /&gt;
--extra-repository	Add repository to search packages from&lt;br /&gt;
--simulate		Don&#039;t execute commands&lt;br /&gt;
--tag			Build images for tag RELEASE&lt;br /&gt;
--workdir		Specify temporary working directory (cache)&lt;br /&gt;
--yaml&lt;br /&gt;
&lt;br /&gt;
known profiles: ali rpi uboot base minirootfs standard vanilla extended virt xen}}&lt;br /&gt;
&lt;br /&gt;
{{Tip| You can use the --repository option multiple times, which is very useful when mixing local and official repositories. The --extra-repository option is  there only for backward-compatibility.}}&lt;br /&gt;
&lt;br /&gt;
Create an iso directory in your home dir:&lt;br /&gt;
&lt;br /&gt;
{{Cmd|mkdir -p ~/iso}}&lt;br /&gt;
&lt;br /&gt;
Then create the actual ISO.&lt;br /&gt;
In this example we will use the edge version x86_64:&lt;br /&gt;
{{Cmd|sh aports/scripts/mkimage.sh --tag edge \&lt;br /&gt;
	--outdir ~/iso \&lt;br /&gt;
	--arch x86_64 \&lt;br /&gt;
	--repository &amp;lt;nowiki&amp;gt;https://dl-cdn.alpinelinux.org/alpine/edge/main&amp;lt;/nowiki&amp;gt; \&lt;br /&gt;
	--profile $PROFILENAME&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Notes:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* If you want to make a customized installer, you need to create &amp;lt;code&amp;gt;.default_boot_services&amp;lt;/code&amp;gt; which will cause &amp;lt;code&amp;gt;mkinitfs&amp;lt;/code&amp;gt; to create the defaults for the live image.&lt;br /&gt;
&lt;br /&gt;
* Several parts of this doc can be automated with a script, like the repository/arch/outdir settings.&lt;br /&gt;
Those steps are left to you and your imagination :)&lt;br /&gt;
&lt;br /&gt;
== Testing your ISO image ==&lt;br /&gt;
&lt;br /&gt;
[[QEMU#Live_mode|QEMU]] is useful for a quick test of your newly created ISO image.&lt;br /&gt;
&lt;br /&gt;
[[Category:Package Manager]]&lt;br /&gt;
[[Category:ISO]]&lt;/div&gt;</summary>
		<author><name>Divyekapoor</name></author>
	</entry>
	<entry>
		<id>https://wiki.alpinelinux.org/w/index.php?title=How_to_make_a_custom_ISO_image_with_mkimage&amp;diff=25373</id>
		<title>How to make a custom ISO image with mkimage</title>
		<link rel="alternate" type="text/html" href="https://wiki.alpinelinux.org/w/index.php?title=How_to_make_a_custom_ISO_image_with_mkimage&amp;diff=25373"/>
		<updated>2023-10-20T21:29:16Z</updated>

		<summary type="html">&lt;p&gt;Divyekapoor: Doas apk update&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This document explains how to build a custom ISO image using the new mkimage scripts located in [[aports]] directory.&lt;br /&gt;
&lt;br /&gt;
== Prerequisites ==&lt;br /&gt;
&lt;br /&gt;
First make sure we have the needed tools&lt;br /&gt;
{{Cmd|apk add alpine-sdk alpine-conf syslinux xorriso squashfs-tools doas}}&lt;br /&gt;
For efi you should add the following: &lt;br /&gt;
{{Cmd|apk add mtools dosfstools grub-efi}}&lt;br /&gt;
&lt;br /&gt;
Create a user (e.g. build) and add them to the abuild group:&lt;br /&gt;
{{Cmd|adduser build -G abuild}}&lt;br /&gt;
&lt;br /&gt;
Give the user root-like permissions:&lt;br /&gt;
{{Cmd|vi /etc/doas.d/doas.conf}}&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
permit :abuild&lt;br /&gt;
permit persist :abuild&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Change to the build user: &lt;br /&gt;
{{Cmd|su - build}}&lt;br /&gt;
&lt;br /&gt;
Then create signing keys (-i installs them in /etc/apk/keys which is required for later)&lt;br /&gt;
{{Cmd|abuild-keygen -i -a}}&lt;br /&gt;
&lt;br /&gt;
{{Tip| Make sure your public keys are placed in /etc/apk/keys/ (example: build-xxxxxxxx.rsa.pub)}}&lt;br /&gt;
{{Cmd|ls /etc/apk/keys/}}&lt;br /&gt;
&lt;br /&gt;
Clone (or update) the [https://gitlab.alpinelinux.org/alpine/aports git repository].&lt;br /&gt;
{{Cmd|git clone --depth&amp;amp;#61;1 https://gitlab.alpinelinux.org/alpine/aports.git}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Make sure the apk index is up to date (so apk can find the packages):&lt;br /&gt;
{{Cmd|doas apk update}}&lt;br /&gt;
&lt;br /&gt;
Make sure your /tmp is large enough.  If you have the default 1GB /tmp, then create a local one with:&lt;br /&gt;
&amp;lt;pre&amp;gt;mkdir -pv ~/tmp&lt;br /&gt;
export TMPDIR=~/tmp&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Configuration ==&lt;br /&gt;
&lt;br /&gt;
The mkimg scripts are shipped with pre-configured profiles.&lt;br /&gt;
&lt;br /&gt;
The format is &#039;&#039;&#039;mkimg.$PROFILENAME.sh&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
In order to have a custom ISO, you should create your own &#039;&#039;&#039;mkimg.$PROFILENAME.sh&#039;&#039;&#039; script.&lt;br /&gt;
&lt;br /&gt;
This is an example used to make a ZFS module, overlayfs (which enables r/w mode for /lib/modules), a serial console output and some other useful apks to build a simple NAS:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;export PROFILENAME=nas&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
cat &amp;lt;&amp;lt; EOF &amp;gt; ~/aports/scripts/mkimg.$PROFILENAME.sh&lt;br /&gt;
profile_$PROFILENAME() {&lt;br /&gt;
        profile_standard&lt;br /&gt;
        kernel_cmdline=&amp;quot;unionfs_size=512M console=tty0 console=ttyS0,115200&amp;quot;&lt;br /&gt;
        syslinux_serial=&amp;quot;0 115200&amp;quot;&lt;br /&gt;
        kernel_addons=&amp;quot;zfs&amp;quot;&lt;br /&gt;
        apks=&amp;quot;\$apks iscsi-scst zfs-scripts zfs zfs-utils-py&lt;br /&gt;
                cciss_vol_status lvm2 mdadm mkinitfs mtools nfs-utils&lt;br /&gt;
                parted rsync sfdisk syslinux util-linux xfsprogs&lt;br /&gt;
                dosfstools ntfs-3g&lt;br /&gt;
                &amp;quot;&lt;br /&gt;
        local _k _a&lt;br /&gt;
        for _k in \$kernel_flavors; do&lt;br /&gt;
                apks=&amp;quot;\$apks linux-\$_k&amp;quot;&lt;br /&gt;
                for _a in \$kernel_addons; do&lt;br /&gt;
                        apks=&amp;quot;\$apks \$_a-\$_k&amp;quot;&lt;br /&gt;
                done&lt;br /&gt;
        done&lt;br /&gt;
        apks=&amp;quot;\$apks linux-firmware&amp;quot;&lt;br /&gt;
}&lt;br /&gt;
EOF&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Set the script as executable:&lt;br /&gt;
{{Cmd|chmod +x ~/aports/scripts/mkimg.$PROFILENAME.sh}}&lt;br /&gt;
&lt;br /&gt;
== Making packages available on boot ==&lt;br /&gt;
&lt;br /&gt;
A package may be made available in the live system by defining the generation of an apkovl which contains a corresponding /etc/apk/world file, and adding that overlay definition to the mkimg-profile, e.g. with `apkovl=&amp;quot;genapkovl-mkimgoverlay.sh&amp;quot;`&lt;br /&gt;
&lt;br /&gt;
Note that to *use* your added apks, you have to install them, with &amp;lt;code&amp;gt;apk add&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The definition may be done as in the [https://github.com/alpinelinux/aports/blob/master/scripts/genapkovl-dhcp.sh genapkovl-dhcp.sh] example.&lt;br /&gt;
Copy the relevant parts (including the rc_add lines) into a `genapkovl-mkimgoverlay.sh` file and add the package(s) that should be installed in the live system on separate lines in the file contents for /etc/apk/world.&lt;br /&gt;
&lt;br /&gt;
== Create the ISO ==&lt;br /&gt;
&lt;br /&gt;
{{Cmd|mkimage.sh	[--tag RELEASE] [--outdir OUTDIR] [--workdir WORKDIR]&lt;br /&gt;
		[--arch ARCH] [--profile PROFILE] [--hostkeys] [--simulate]&lt;br /&gt;
		[--repository REPO] [--extra-repository REPO] [--yaml FILE]&lt;br /&gt;
mkimage.sh	--help&lt;br /&gt;
&lt;br /&gt;
options:&lt;br /&gt;
--arch			Specify which architecture images to build&lt;br /&gt;
			(default: x86_64)&lt;br /&gt;
--hostkeys		Copy system apk signing keys to created images&lt;br /&gt;
--outdir		Specify directory for the created images&lt;br /&gt;
--profile		Specify which profiles to build&lt;br /&gt;
--repository		Package repository to use for the image create&lt;br /&gt;
--extra-repository	Add repository to search packages from&lt;br /&gt;
--simulate		Don&#039;t execute commands&lt;br /&gt;
--tag			Build images for tag RELEASE&lt;br /&gt;
--workdir		Specify temporary working directory (cache)&lt;br /&gt;
--yaml&lt;br /&gt;
&lt;br /&gt;
known profiles: ali rpi uboot base minirootfs standard vanilla extended virt xen}}&lt;br /&gt;
&lt;br /&gt;
{{Tip| You can use the --repository option multiple times, which is very useful when mixing local and official repositories. The --extra-repository option is  there only for backward-compatibility.}}&lt;br /&gt;
&lt;br /&gt;
Create an iso directory in your home dir:&lt;br /&gt;
&lt;br /&gt;
{{Cmd|mkdir -p ~/iso}}&lt;br /&gt;
&lt;br /&gt;
Then create the actual ISO.&lt;br /&gt;
In this example we will use the edge version x86_64:&lt;br /&gt;
{{Cmd|sh aports/scripts/mkimage.sh --tag edge \&lt;br /&gt;
	--outdir ~/iso \&lt;br /&gt;
	--arch x86_64 \&lt;br /&gt;
	--repository &amp;lt;nowiki&amp;gt;https://dl-cdn.alpinelinux.org/alpine/edge/main&amp;lt;/nowiki&amp;gt; \&lt;br /&gt;
	--profile $PROFILENAME&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Notes:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* If you want to make a customized installer, you need to create &amp;lt;code&amp;gt;.default_boot_services&amp;lt;/code&amp;gt; which will cause &amp;lt;code&amp;gt;mkinitfs&amp;lt;/code&amp;gt; to create the defaults for the live image.&lt;br /&gt;
&lt;br /&gt;
* Several parts of this doc can be automated with a script, like the repository/arch/outdir settings.&lt;br /&gt;
Those steps are left to you and your imagination :)&lt;br /&gt;
&lt;br /&gt;
== Testing your ISO image ==&lt;br /&gt;
&lt;br /&gt;
[[QEMU#Live_mode|QEMU]] is useful for a quick test of your newly created ISO image.&lt;br /&gt;
&lt;br /&gt;
[[Category:Package Manager]]&lt;br /&gt;
[[Category:ISO]]&lt;/div&gt;</summary>
		<author><name>Divyekapoor</name></author>
	</entry>
	<entry>
		<id>https://wiki.alpinelinux.org/w/index.php?title=How_to_make_a_custom_ISO_image_with_mkimage&amp;diff=25372</id>
		<title>How to make a custom ISO image with mkimage</title>
		<link rel="alternate" type="text/html" href="https://wiki.alpinelinux.org/w/index.php?title=How_to_make_a_custom_ISO_image_with_mkimage&amp;diff=25372"/>
		<updated>2023-10-20T21:28:31Z</updated>

		<summary type="html">&lt;p&gt;Divyekapoor: Update to add doas user and permissions - doas is the standard as of 3.16&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This document explains how to build a custom ISO image using the new mkimage scripts located in [[aports]] directory.&lt;br /&gt;
&lt;br /&gt;
== Prerequisites ==&lt;br /&gt;
&lt;br /&gt;
First make sure we have the needed tools&lt;br /&gt;
{{Cmd|apk add alpine-sdk alpine-conf syslinux xorriso squashfs-tools doas}}&lt;br /&gt;
For efi you should add the following: &lt;br /&gt;
{{Cmd|apk add mtools dosfstools grub-efi}}&lt;br /&gt;
&lt;br /&gt;
Create a user (e.g. build) and add them to the abuild group:&lt;br /&gt;
{{Cmd|adduser build -G abuild}}&lt;br /&gt;
&lt;br /&gt;
Give the user root-like permissions:&lt;br /&gt;
{{Cmd|vi /etc/doas.d/doas.conf}}&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
permit :abuild&lt;br /&gt;
permit persist :abuild&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Change to the build user: &lt;br /&gt;
{{Cmd|su - build}}&lt;br /&gt;
&lt;br /&gt;
Then create signing keys (-i installs them in /etc/apk/keys which is required for later)&lt;br /&gt;
{{Cmd|abuild-keygen -i -a}}&lt;br /&gt;
&lt;br /&gt;
{{Tip| Make sure your public keys are placed in /etc/apk/keys/ (example: build-xxxxxxxx.rsa.pub)}}&lt;br /&gt;
{{Cmd|ls /etc/apk/keys/}}&lt;br /&gt;
&lt;br /&gt;
Clone (or update) the [https://gitlab.alpinelinux.org/alpine/aports git repository].&lt;br /&gt;
{{Cmd|git clone --depth&amp;amp;#61;1 https://gitlab.alpinelinux.org/alpine/aports.git}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Make sure the apk index is up to date (so apk can find the packages):&lt;br /&gt;
{{Cmd|# apk update}}&lt;br /&gt;
&lt;br /&gt;
Make sure your /tmp is large enough.  If you have the default 1GB /tmp, then create a local one with:&lt;br /&gt;
&amp;lt;pre&amp;gt;mkdir -pv ~/tmp&lt;br /&gt;
export TMPDIR=~/tmp&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Configuration ==&lt;br /&gt;
&lt;br /&gt;
The mkimg scripts are shipped with pre-configured profiles.&lt;br /&gt;
&lt;br /&gt;
The format is &#039;&#039;&#039;mkimg.$PROFILENAME.sh&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
In order to have a custom ISO, you should create your own &#039;&#039;&#039;mkimg.$PROFILENAME.sh&#039;&#039;&#039; script.&lt;br /&gt;
&lt;br /&gt;
This is an example used to make a ZFS module, overlayfs (which enables r/w mode for /lib/modules), a serial console output and some other useful apks to build a simple NAS:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;export PROFILENAME=nas&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
cat &amp;lt;&amp;lt; EOF &amp;gt; ~/aports/scripts/mkimg.$PROFILENAME.sh&lt;br /&gt;
profile_$PROFILENAME() {&lt;br /&gt;
        profile_standard&lt;br /&gt;
        kernel_cmdline=&amp;quot;unionfs_size=512M console=tty0 console=ttyS0,115200&amp;quot;&lt;br /&gt;
        syslinux_serial=&amp;quot;0 115200&amp;quot;&lt;br /&gt;
        kernel_addons=&amp;quot;zfs&amp;quot;&lt;br /&gt;
        apks=&amp;quot;\$apks iscsi-scst zfs-scripts zfs zfs-utils-py&lt;br /&gt;
                cciss_vol_status lvm2 mdadm mkinitfs mtools nfs-utils&lt;br /&gt;
                parted rsync sfdisk syslinux util-linux xfsprogs&lt;br /&gt;
                dosfstools ntfs-3g&lt;br /&gt;
                &amp;quot;&lt;br /&gt;
        local _k _a&lt;br /&gt;
        for _k in \$kernel_flavors; do&lt;br /&gt;
                apks=&amp;quot;\$apks linux-\$_k&amp;quot;&lt;br /&gt;
                for _a in \$kernel_addons; do&lt;br /&gt;
                        apks=&amp;quot;\$apks \$_a-\$_k&amp;quot;&lt;br /&gt;
                done&lt;br /&gt;
        done&lt;br /&gt;
        apks=&amp;quot;\$apks linux-firmware&amp;quot;&lt;br /&gt;
}&lt;br /&gt;
EOF&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Set the script as executable:&lt;br /&gt;
{{Cmd|chmod +x ~/aports/scripts/mkimg.$PROFILENAME.sh}}&lt;br /&gt;
&lt;br /&gt;
== Making packages available on boot ==&lt;br /&gt;
&lt;br /&gt;
A package may be made available in the live system by defining the generation of an apkovl which contains a corresponding /etc/apk/world file, and adding that overlay definition to the mkimg-profile, e.g. with `apkovl=&amp;quot;genapkovl-mkimgoverlay.sh&amp;quot;`&lt;br /&gt;
&lt;br /&gt;
Note that to *use* your added apks, you have to install them, with &amp;lt;code&amp;gt;apk add&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The definition may be done as in the [https://github.com/alpinelinux/aports/blob/master/scripts/genapkovl-dhcp.sh genapkovl-dhcp.sh] example.&lt;br /&gt;
Copy the relevant parts (including the rc_add lines) into a `genapkovl-mkimgoverlay.sh` file and add the package(s) that should be installed in the live system on separate lines in the file contents for /etc/apk/world.&lt;br /&gt;
&lt;br /&gt;
== Create the ISO ==&lt;br /&gt;
&lt;br /&gt;
{{Cmd|mkimage.sh	[--tag RELEASE] [--outdir OUTDIR] [--workdir WORKDIR]&lt;br /&gt;
		[--arch ARCH] [--profile PROFILE] [--hostkeys] [--simulate]&lt;br /&gt;
		[--repository REPO] [--extra-repository REPO] [--yaml FILE]&lt;br /&gt;
mkimage.sh	--help&lt;br /&gt;
&lt;br /&gt;
options:&lt;br /&gt;
--arch			Specify which architecture images to build&lt;br /&gt;
			(default: x86_64)&lt;br /&gt;
--hostkeys		Copy system apk signing keys to created images&lt;br /&gt;
--outdir		Specify directory for the created images&lt;br /&gt;
--profile		Specify which profiles to build&lt;br /&gt;
--repository		Package repository to use for the image create&lt;br /&gt;
--extra-repository	Add repository to search packages from&lt;br /&gt;
--simulate		Don&#039;t execute commands&lt;br /&gt;
--tag			Build images for tag RELEASE&lt;br /&gt;
--workdir		Specify temporary working directory (cache)&lt;br /&gt;
--yaml&lt;br /&gt;
&lt;br /&gt;
known profiles: ali rpi uboot base minirootfs standard vanilla extended virt xen}}&lt;br /&gt;
&lt;br /&gt;
{{Tip| You can use the --repository option multiple times, which is very useful when mixing local and official repositories. The --extra-repository option is  there only for backward-compatibility.}}&lt;br /&gt;
&lt;br /&gt;
Create an iso directory in your home dir:&lt;br /&gt;
&lt;br /&gt;
{{Cmd|mkdir -p ~/iso}}&lt;br /&gt;
&lt;br /&gt;
Then create the actual ISO.&lt;br /&gt;
In this example we will use the edge version x86_64:&lt;br /&gt;
{{Cmd|sh aports/scripts/mkimage.sh --tag edge \&lt;br /&gt;
	--outdir ~/iso \&lt;br /&gt;
	--arch x86_64 \&lt;br /&gt;
	--repository &amp;lt;nowiki&amp;gt;https://dl-cdn.alpinelinux.org/alpine/edge/main&amp;lt;/nowiki&amp;gt; \&lt;br /&gt;
	--profile $PROFILENAME&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Notes:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* If you want to make a customized installer, you need to create &amp;lt;code&amp;gt;.default_boot_services&amp;lt;/code&amp;gt; which will cause &amp;lt;code&amp;gt;mkinitfs&amp;lt;/code&amp;gt; to create the defaults for the live image.&lt;br /&gt;
&lt;br /&gt;
* Several parts of this doc can be automated with a script, like the repository/arch/outdir settings.&lt;br /&gt;
Those steps are left to you and your imagination :)&lt;br /&gt;
&lt;br /&gt;
== Testing your ISO image ==&lt;br /&gt;
&lt;br /&gt;
[[QEMU#Live_mode|QEMU]] is useful for a quick test of your newly created ISO image.&lt;br /&gt;
&lt;br /&gt;
[[Category:Package Manager]]&lt;br /&gt;
[[Category:ISO]]&lt;/div&gt;</summary>
		<author><name>Divyekapoor</name></author>
	</entry>
	<entry>
		<id>https://wiki.alpinelinux.org/w/index.php?title=How_to_make_a_custom_ISO_image_with_mkimage&amp;diff=25150</id>
		<title>How to make a custom ISO image with mkimage</title>
		<link rel="alternate" type="text/html" href="https://wiki.alpinelinux.org/w/index.php?title=How_to_make_a_custom_ISO_image_with_mkimage&amp;diff=25150"/>
		<updated>2023-09-19T06:31:15Z</updated>

		<summary type="html">&lt;p&gt;Divyekapoor: Tentatively removing the merge proposal - it&amp;#039;s confusing as the merge target page is less mature than this page.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This document explains how to build a custom ISO image using the new mkimage scripts located in [[aports]] directory.&lt;br /&gt;
&lt;br /&gt;
== Prerequisites ==&lt;br /&gt;
&lt;br /&gt;
First make sure we have the needed tools&lt;br /&gt;
{{Cmd|apk add alpine-sdk alpine-conf syslinux xorriso squashfs-tools}}&lt;br /&gt;
For efi you should add the following: &lt;br /&gt;
{{Cmd|apk add mtools dosfstools grub-efi}}&lt;br /&gt;
&lt;br /&gt;
Create a user (e.g. build) and add them to the abuild group:&lt;br /&gt;
{{Cmd|adduser build -G abuild}}&lt;br /&gt;
Change to the build user: &lt;br /&gt;
{{Cmd|su - build}}&lt;br /&gt;
&lt;br /&gt;
Then create signing keys (-i installs them in /etc/apk/keys which is required for later)&lt;br /&gt;
{{Cmd|abuild-keygen -i -a}}&lt;br /&gt;
&lt;br /&gt;
{{Tip| Make sure your public keys are placed in /etc/apk/keys/ (example: build-xxxxxxxx.rsa.pub)}}&lt;br /&gt;
{{Cmd|ls /etc/apk/keys/}}&lt;br /&gt;
&lt;br /&gt;
Clone (or update) the [https://gitlab.alpinelinux.org/alpine/aports git repository].&lt;br /&gt;
{{Cmd|git clone --depth&amp;amp;#61;1 https://gitlab.alpinelinux.org/alpine/aports.git}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Make sure the apk index is up to date (so apk can find the packages):&lt;br /&gt;
{{Cmd|# apk update}}&lt;br /&gt;
&lt;br /&gt;
Make sure your /tmp is large enough.  If you have the default 1GB /tmp, then create a local one with:&lt;br /&gt;
&amp;lt;pre&amp;gt;mkdir -pv ~/tmp&lt;br /&gt;
export TMPDIR=~/tmp&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Configuration ==&lt;br /&gt;
&lt;br /&gt;
The mkimg scripts are shipped with pre-configured profiles.&lt;br /&gt;
&lt;br /&gt;
The format is &#039;&#039;&#039;mkimg.$PROFILENAME.sh&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
In order to have a custom ISO, you should create your own &#039;&#039;&#039;mkimg.$PROFILENAME.sh&#039;&#039;&#039; script.&lt;br /&gt;
&lt;br /&gt;
This is an example used to make a ZFS module, overlayfs (which enables r/w mode for /lib/modules), a serial console output and some other useful apks to build a simple NAS:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;export PROFILENAME=nas&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
cat &amp;lt;&amp;lt; EOF &amp;gt; ~/aports/scripts/mkimg.$PROFILENAME.sh&lt;br /&gt;
profile_$PROFILENAME() {&lt;br /&gt;
        profile_standard&lt;br /&gt;
        kernel_cmdline=&amp;quot;unionfs_size=512M console=tty0 console=ttyS0,115200&amp;quot;&lt;br /&gt;
        syslinux_serial=&amp;quot;0 115200&amp;quot;&lt;br /&gt;
        kernel_addons=&amp;quot;zfs&amp;quot;&lt;br /&gt;
        apks=&amp;quot;\$apks iscsi-scst zfs-scripts zfs zfs-utils-py&lt;br /&gt;
                cciss_vol_status lvm2 mdadm mkinitfs mtools nfs-utils&lt;br /&gt;
                parted rsync sfdisk syslinux util-linux xfsprogs&lt;br /&gt;
                dosfstools ntfs-3g&lt;br /&gt;
                &amp;quot;&lt;br /&gt;
        local _k _a&lt;br /&gt;
        for _k in \$kernel_flavors; do&lt;br /&gt;
                apks=&amp;quot;\$apks linux-\$_k&amp;quot;&lt;br /&gt;
                for _a in \$kernel_addons; do&lt;br /&gt;
                        apks=&amp;quot;\$apks \$_a-\$_k&amp;quot;&lt;br /&gt;
                done&lt;br /&gt;
        done&lt;br /&gt;
        apks=&amp;quot;\$apks linux-firmware&amp;quot;&lt;br /&gt;
}&lt;br /&gt;
EOF&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Set the script as executable:&lt;br /&gt;
{{Cmd|chmod +x ~/aports/scripts/mkimg.$PROFILENAME.sh}}&lt;br /&gt;
&lt;br /&gt;
== Making packages available on boot ==&lt;br /&gt;
&lt;br /&gt;
A package may be made available in the live system by defining the generation of an apkovl which contains a corresponding /etc/apk/world file, and adding that overlay definition to the mkimg-profile, e.g. with `apkovl=&amp;quot;genapkovl-mkimgoverlay.sh&amp;quot;`&lt;br /&gt;
&lt;br /&gt;
Note that to *use* your added apks, you have to install them, with &amp;lt;code&amp;gt;apk add&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The definition may be done as in the [https://github.com/alpinelinux/aports/blob/master/scripts/genapkovl-dhcp.sh genapkovl-dhcp.sh] example.&lt;br /&gt;
Copy the relevant parts (including the rc_add lines) into a `genapkovl-mkimgoverlay.sh` file and add the package(s) that should be installed in the live system on separate lines in the file contents for /etc/apk/world.&lt;br /&gt;
&lt;br /&gt;
== Create the ISO ==&lt;br /&gt;
&lt;br /&gt;
{{Cmd|mkimage.sh	[--tag RELEASE] [--outdir OUTDIR] [--workdir WORKDIR]&lt;br /&gt;
		[--arch ARCH] [--profile PROFILE] [--hostkeys] [--simulate]&lt;br /&gt;
		[--repository REPO] [--extra-repository REPO] [--yaml FILE]&lt;br /&gt;
mkimage.sh	--help&lt;br /&gt;
&lt;br /&gt;
options:&lt;br /&gt;
--arch			Specify which architecture images to build&lt;br /&gt;
			(default: x86_64)&lt;br /&gt;
--hostkeys		Copy system apk signing keys to created images&lt;br /&gt;
--outdir		Specify directory for the created images&lt;br /&gt;
--profile		Specify which profiles to build&lt;br /&gt;
--repository		Package repository to use for the image create&lt;br /&gt;
--extra-repository	Add repository to search packages from&lt;br /&gt;
--simulate		Don&#039;t execute commands&lt;br /&gt;
--tag			Build images for tag RELEASE&lt;br /&gt;
--workdir		Specify temporary working directory (cache)&lt;br /&gt;
--yaml&lt;br /&gt;
&lt;br /&gt;
known profiles: ali rpi uboot base minirootfs standard vanilla extended virt xen}}&lt;br /&gt;
&lt;br /&gt;
{{Tip| You can use the --repository option multiple times, which is very useful when mixing local and official repositories. The --extra-repository option is  there only for backward-compatibility.}}&lt;br /&gt;
&lt;br /&gt;
Create an iso directory in your home dir:&lt;br /&gt;
&lt;br /&gt;
{{Cmd|mkdir -p ~/iso}}&lt;br /&gt;
&lt;br /&gt;
Then create the actual ISO.&lt;br /&gt;
In this example we will use the edge version x86_64:&lt;br /&gt;
{{Cmd|sh aports/scripts/mkimage.sh --tag edge \&lt;br /&gt;
	--outdir ~/iso \&lt;br /&gt;
	--arch x86_64 \&lt;br /&gt;
	--repository &amp;lt;nowiki&amp;gt;https://dl-cdn.alpinelinux.org/alpine/edge/main&amp;lt;/nowiki&amp;gt; \&lt;br /&gt;
	--profile $PROFILENAME&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Notes:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* If you want to make a customized installer, you need to create &amp;lt;code&amp;gt;.default_boot_services&amp;lt;/code&amp;gt; which will cause &amp;lt;code&amp;gt;mkinitfs&amp;lt;/code&amp;gt; to create the defaults for the live image.&lt;br /&gt;
&lt;br /&gt;
* Several parts of this doc can be automated with a script, like the repository/arch/outdir settings.&lt;br /&gt;
Those steps are left to you and your imagination :)&lt;br /&gt;
&lt;br /&gt;
== Testing your ISO image ==&lt;br /&gt;
&lt;br /&gt;
[[QEMU#Live_mode|QEMU]] is useful for a quick test of your newly created ISO image.&lt;br /&gt;
&lt;br /&gt;
[[Category:Package Manager]]&lt;br /&gt;
[[Category:ISO]]&lt;/div&gt;</summary>
		<author><name>Divyekapoor</name></author>
	</entry>
	<entry>
		<id>https://wiki.alpinelinux.org/w/index.php?title=How_to_make_a_custom_ISO_image&amp;diff=25149</id>
		<title>How to make a custom ISO image</title>
		<link rel="alternate" type="text/html" href="https://wiki.alpinelinux.org/w/index.php?title=How_to_make_a_custom_ISO_image&amp;diff=25149"/>
		<updated>2023-09-19T06:24:55Z</updated>

		<summary type="html">&lt;p&gt;Divyekapoor: Removing the &amp;quot;from dedicated boot media&amp;quot; since the text title says using an ISO&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
== ISO remastering ==&lt;br /&gt;
&lt;br /&gt;
There are third party scripts to re-build completely custom images, like&lt;br /&gt;
* [https://github.com/alpinelinux/alpine-make-vm-image alpine-make-vm-image]&lt;br /&gt;
(works to only make a disk based VM image)&lt;br /&gt;
&lt;br /&gt;
and there is Alpine&#039;s original&lt;br /&gt;
* [[How_to_make_a_custom_ISO_image_with_mkimage|mkimg]]. &lt;br /&gt;
(creates a diskless ISO file - usually what you want for QEMU and Proxmox)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== An alternative ==&lt;br /&gt;
&lt;br /&gt;
It&#039;s also possible to commit and load ISO image customizations to and from a writable partition when booting in [[Installation#Diskless_Mode|Diskless Mode]].&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Booting an ISO image with local customizations ==&lt;br /&gt;
&lt;br /&gt;
* [[Directly_booting_an_ISO_file]]&lt;br /&gt;
&lt;br /&gt;
[[Category:Package Manager]]&lt;br /&gt;
[[Category:ISO]]&lt;/div&gt;</summary>
		<author><name>Divyekapoor</name></author>
	</entry>
	<entry>
		<id>https://wiki.alpinelinux.org/w/index.php?title=How_to_make_a_custom_ISO_image&amp;diff=25148</id>
		<title>How to make a custom ISO image</title>
		<link rel="alternate" type="text/html" href="https://wiki.alpinelinux.org/w/index.php?title=How_to_make_a_custom_ISO_image&amp;diff=25148"/>
		<updated>2023-09-19T06:23:56Z</updated>

		<summary type="html">&lt;p&gt;Divyekapoor: Clarify diskless ISO file is useful for Proxmox and QEMU&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
== ISO remastering ==&lt;br /&gt;
&lt;br /&gt;
There are third party scripts to re-build completely custom images, like&lt;br /&gt;
* [https://github.com/alpinelinux/alpine-make-vm-image alpine-make-vm-image]&lt;br /&gt;
(works to only make a disk based VM image)&lt;br /&gt;
&lt;br /&gt;
and there is Alpine&#039;s original&lt;br /&gt;
* [[How_to_make_a_custom_ISO_image_with_mkimage|mkimg]]. &lt;br /&gt;
(creates a diskless ISO file - usually what you want for QEMU and Proxmox)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== An alternative ==&lt;br /&gt;
&lt;br /&gt;
It&#039;s also possible to commit and load ISO image customizations to and from a writable partition when booting in [[Installation#Diskless_Mode|Diskless Mode]].&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Booting an ISO image with local customizations ==&lt;br /&gt;
&lt;br /&gt;
* From a dedicated boot media, obviously.&lt;br /&gt;
* [[Directly_booting_an_ISO_file]]&lt;br /&gt;
&lt;br /&gt;
[[Category:Package Manager]]&lt;br /&gt;
[[Category:ISO]]&lt;/div&gt;</summary>
		<author><name>Divyekapoor</name></author>
	</entry>
	<entry>
		<id>https://wiki.alpinelinux.org/w/index.php?title=Directly_booting_an_ISO_file&amp;diff=25147</id>
		<title>Directly booting an ISO file</title>
		<link rel="alternate" type="text/html" href="https://wiki.alpinelinux.org/w/index.php?title=Directly_booting_an_ISO_file&amp;diff=25147"/>
		<updated>2023-09-19T06:22:32Z</updated>

		<summary type="html">&lt;p&gt;Divyekapoor: Add link to building a custom ISO with mkimage&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
It is technically possible to boot an &amp;lt;code&amp;gt;.iso&amp;lt;/code&amp;gt; file directly, without flashing it to a disk or device.&lt;br /&gt;
&lt;br /&gt;
== Using a virtual machine ==&lt;br /&gt;
&lt;br /&gt;
The [[QEMU#Live_mode|QEMU]] page shows how an ISO image and .apkovl customizations are booted with a virtual machine. This works very well with Proxmox as well - just attach the ISO and Alpine boots to RAM on startup. You can customize your .iso file by building a custom ISO image by following the instructions on [[How to make a custom ISO image with mkimage]]&lt;br /&gt;
&lt;br /&gt;
== Using an installed Bootloader ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== grub-imageboot ===&lt;br /&gt;
&lt;br /&gt;
In addition to standard partitions or drives, the Debian package grub-imageboot allows booting .iso files placed in the /boot/images directory.&lt;br /&gt;
&lt;br /&gt;
=== Manual Grub menu entry ===&lt;br /&gt;
&lt;br /&gt;
No solution found yet.&lt;br /&gt;
&lt;br /&gt;
=== syslinux ===&lt;br /&gt;
&lt;br /&gt;
No solution found yet.&lt;br /&gt;
&lt;br /&gt;
[[Category:Installation]]&lt;/div&gt;</summary>
		<author><name>Divyekapoor</name></author>
	</entry>
	<entry>
		<id>https://wiki.alpinelinux.org/w/index.php?title=Directly_booting_an_ISO_file&amp;diff=25146</id>
		<title>Directly booting an ISO file</title>
		<link rel="alternate" type="text/html" href="https://wiki.alpinelinux.org/w/index.php?title=Directly_booting_an_ISO_file&amp;diff=25146"/>
		<updated>2023-09-19T06:20:51Z</updated>

		<summary type="html">&lt;p&gt;Divyekapoor: Add text saying how Alpine works well with Proxmox.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
It is technically possible to boot an &amp;lt;code&amp;gt;.iso&amp;lt;/code&amp;gt; file directly, without flashing it to a disk or device.&lt;br /&gt;
&lt;br /&gt;
== Using a virtual machine ==&lt;br /&gt;
&lt;br /&gt;
The [[QEMU#Live_mode|QEMU]] page shows how an ISO image and .apkovl customizations are booted with a virtual machine. This works very well with Proxmox as well - just attach the ISO and Alpine boots to RAM on startup. &lt;br /&gt;
&lt;br /&gt;
== Using an installed Bootloader ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== grub-imageboot ===&lt;br /&gt;
&lt;br /&gt;
In addition to standard partitions or drives, the Debian package grub-imageboot allows booting .iso files placed in the /boot/images directory.&lt;br /&gt;
&lt;br /&gt;
=== Manual Grub menu entry ===&lt;br /&gt;
&lt;br /&gt;
No solution found yet.&lt;br /&gt;
&lt;br /&gt;
=== syslinux ===&lt;br /&gt;
&lt;br /&gt;
No solution found yet.&lt;br /&gt;
&lt;br /&gt;
[[Category:Installation]]&lt;/div&gt;</summary>
		<author><name>Divyekapoor</name></author>
	</entry>
	<entry>
		<id>https://wiki.alpinelinux.org/w/index.php?title=Directly_booting_an_ISO_file&amp;diff=25145</id>
		<title>Directly booting an ISO file</title>
		<link rel="alternate" type="text/html" href="https://wiki.alpinelinux.org/w/index.php?title=Directly_booting_an_ISO_file&amp;diff=25145"/>
		<updated>2023-09-19T06:19:31Z</updated>

		<summary type="html">&lt;p&gt;Divyekapoor: Remove extra newline&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
It is technically possible to boot an &amp;lt;code&amp;gt;.iso&amp;lt;/code&amp;gt; file directly, without flashing it to a disk or device.&lt;br /&gt;
&lt;br /&gt;
== Using a virtual machine ==&lt;br /&gt;
&lt;br /&gt;
The [[QEMU#Live_mode|QEMU]] page shows how an ISO image and .apkovl customizations are booted with a virtual machine.&lt;br /&gt;
&lt;br /&gt;
== Using an installed Bootloader ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== grub-imageboot ===&lt;br /&gt;
&lt;br /&gt;
In addition to standard partitions or drives, the Debian package grub-imageboot allows booting .iso files placed in the /boot/images directory.&lt;br /&gt;
&lt;br /&gt;
=== Manual Grub menu entry ===&lt;br /&gt;
&lt;br /&gt;
No solution found yet.&lt;br /&gt;
&lt;br /&gt;
=== syslinux ===&lt;br /&gt;
&lt;br /&gt;
No solution found yet.&lt;br /&gt;
&lt;br /&gt;
[[Category:Installation]]&lt;/div&gt;</summary>
		<author><name>Divyekapoor</name></author>
	</entry>
	<entry>
		<id>https://wiki.alpinelinux.org/w/index.php?title=Talk:Directly_booting_an_ISO_file&amp;diff=25144</id>
		<title>Talk:Directly booting an ISO file</title>
		<link rel="alternate" type="text/html" href="https://wiki.alpinelinux.org/w/index.php?title=Talk:Directly_booting_an_ISO_file&amp;diff=25144"/>
		<updated>2023-09-19T06:19:12Z</updated>

		<summary type="html">&lt;p&gt;Divyekapoor: Moved from the main text&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;::::: I&#039;ve given up. Couldn&#039;t make the intended setup work with my meager Linux knowledge. I did find a page here at the wiki, under the heading &#039;[[Replacing_non-Alpine_Linux_with_Alpine_remotely|Install Alpine cd-rom image on hard disk]]&#039; where a somewhat related solution is provided, but it involves extracting the distro files from the iso, something that [https://unetbootin.sourceforge.net/ unetbootin] does in a rather more easy and straightforward way -- at least, that&#039;s what I used to get Alpine to boot from a USB pendrive (plenty of recipes for that around). However, I still believe a simple &#039;boot from iso&#039; procedure could do wonders for Alpine, so I&#039;m leaving this here for future reference. Should anyone disagree, do feel free to delete. [[User:Pnin|Pnin]] 05:43, 8 February 2011 (UTC)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Current system is a 2.8 Prescott Pentium IV with 2MB RAM, booting from a 1GB CF plugged into the IDE interface, with an attached 500GB SATA HDD for data. When I tried to install Alpine from the LiveCD to this card, which is listed as a hard drive by the BIOS, it complained of insufficient space. Fair enough. Next I tried to follow [https://www.pendrivelinux.com/boot-multiple-iso-from-usb-via-grub2-using-linux/ this recipe] to boot from Alpine 2.1.4 iso. At the end, you find this tip:&lt;br /&gt;
&lt;br /&gt;
:&#039;&#039;Adding an Unlisted ISO: To try ISO Files that are not yet listed, use the existing menu entry examples in /boot/grub/grub.cfg and append any options normally found in the distribution&#039;s syslinux.cfg file on the &amp;quot;append&amp;quot; line, to the &amp;quot;linux&amp;quot; line of the menu entry.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
So I downloaded the latest Alpine iso via wget and modified the relevant &#039;&#039;grub.cfg&#039;&#039; lines to:&lt;br /&gt;
&lt;br /&gt;
 linux (loop)/boot/grsec initrd=/boot/grsec.gz iso-scan/filename=/alpine214.iso alpine_dev=usbdisk:vfat modules=loop,cramfs,sd-mod,usb-storage quiet&lt;br /&gt;
 initrd (loop)/boot/grsec.gz&lt;br /&gt;
&lt;br /&gt;
All I got when I tried to boot this was the following error:&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;Alpine Init 2.1.2&#039;&#039;&#039;&lt;br /&gt;
 &#039;&#039;&#039;/init: eval: line 1: syntax error: unexpected &amp;quot;(&amp;quot;&#039;&#039;&#039;&lt;br /&gt;
 &#039;&#039;&#039;kernel panic - not syncing: attempted to kill init!&#039;&#039;&#039;&lt;br /&gt;
 &#039;&#039;&#039;Pid: 1, comm: init Not tainted 2.6.35.10-grsec #1-Alpine&#039;&#039;&#039;&lt;br /&gt;
 [...]&lt;br /&gt;
&lt;br /&gt;
I must say all went well with the Linux Mint 10.10 and the TinyCore isos, into which I&#039;m able to boot with no issues. Anyone care to advise?&lt;br /&gt;
&lt;br /&gt;
[[User:Pnin|Pnin]] &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Hi, that &amp;quot;linux (loop)/boot/....&amp;quot; thing looks funny to me.&lt;br /&gt;
&lt;br /&gt;
According to: https://help.ubuntu.com/community/Grub2&lt;br /&gt;
&lt;br /&gt;
Could you try:&lt;br /&gt;
&lt;br /&gt;
 set root=(loop0)&lt;br /&gt;
 linux /boot/grsec initrd=/boot/grsec.gz iso-scan/filename=/alpine214.iso alpine_dev=usbdisk:vfat modules=loop,cramfs,sd-mod,usb-storage quiet&lt;br /&gt;
 initrd /boot/grsec.gz&lt;br /&gt;
&lt;br /&gt;
[[User:Nangel|Nangel]] 13:49, 6 February 2011 (UTC)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Hi &amp;amp; thanks, Nangel.&lt;br /&gt;
&lt;br /&gt;
Tried that and got this error:&lt;br /&gt;
&lt;br /&gt;
 error: no such disk.&lt;br /&gt;
 error: you need to load the kernel first.&lt;br /&gt;
 press any key to continue...&lt;br /&gt;
&lt;br /&gt;
Pressing any key returns to the grub menu. Maybe the full &#039;&#039;grub.cfg&#039;&#039; entry should be reported here:&lt;br /&gt;
&lt;br /&gt;
 menuentry &amp;quot;Alpine Linux&amp;quot; {&lt;br /&gt;
 loopback loop /alpine214.iso&lt;br /&gt;
 linux (loop)/boot/grsec initrd=/boot/grsec.gz iso-scan/filename=/alpine214.iso alpine_dev=usbdisk:vfat modules=loop,cramfs,sd-mod,usb-storage quiet&lt;br /&gt;
 initrd (loop)/boot/grsec.gz&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
It should also be noted that the LiveCD used to perform the [https://www.pendrivelinux.com/boot-multiple-iso-from-usb-via-grub2-using-linux/ recipe] was &amp;quot;Linux Mint 9 LXDE&amp;quot;, which caused Grub 1.98-1ubuntu5-1mint2 to be installed, not Grub2. And that (loop) part is present in every other successful menu entry.&lt;br /&gt;
&lt;br /&gt;
[EDIT: Just to add that IMHO coupled with the [[Alpine_local_backup|Alpine Local Backup Utility]] (lbu), booting from iso would be a killer feature for Alpine, making systems really easy to troubleshoot (delete local backup) and upgrade (replace iso).]&lt;br /&gt;
&lt;br /&gt;
[[User:Pnin|Pnin]] 14:34, 6 February 2011 (UTC)&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
Suppose alpine-extended-3.14.0-x86_64.iso is stored in directory boot in partition 1 on disk.&lt;br /&gt;
GRUB2 can be caused to load kernel and initramfs by entering:&lt;br /&gt;
&lt;br /&gt;
 grub&amp;gt; loopback lb /boot/alpine-extended-3.14.0-x86_64.iso&lt;br /&gt;
 grub&amp;gt; linux  (lb)/boot/vmlinuz-lts&lt;br /&gt;
 grub&amp;gt; initrd (lb)/boot/initramfs-lts&lt;br /&gt;
 grub&amp;gt; boot&lt;br /&gt;
&lt;br /&gt;
A menu entry for GRUB2 can be created with these statements.&lt;br /&gt;
&lt;br /&gt;
Initialising Alpine will then be aborted with messages:&lt;br /&gt;
&lt;br /&gt;
 Mounting boot media: failed&lt;br /&gt;
 initramfs emergency recovery shell launched. Type &#039;exit&#039; to continue boot&lt;br /&gt;
&lt;br /&gt;
To mount the filesystem where alpine-extended-3.14.0-x86_64.iso is stored, enter:&lt;br /&gt;
&lt;br /&gt;
 # mount /dev/sda1 /media/sda1&lt;br /&gt;
&lt;br /&gt;
To mount the ISO image, enter:&lt;br /&gt;
&lt;br /&gt;
 # mount -o loop -t iso9660 /media/sda1/boot/alpine-extended-3.14.0-x86_64.iso /media/cdrom&lt;br /&gt;
&lt;br /&gt;
Continue initialisation with:&lt;br /&gt;
&lt;br /&gt;
 # exit&lt;br /&gt;
&lt;br /&gt;
At last these messages will be displayed:&lt;br /&gt;
&lt;br /&gt;
 /lib/rc/sh/openrc-run.sh: eval: line 1: syntax error: unexpected &amp;quot;(&amp;quot;&lt;br /&gt;
 * ERROR: firstboot failed to start&lt;br /&gt;
&lt;br /&gt;
but login root works and Alpine can be configured using&lt;br /&gt;
&lt;br /&gt;
 # alpine-setup&lt;br /&gt;
&lt;br /&gt;
[[User:HGT|HGT]] 2021-07-08&lt;br /&gt;
&lt;br /&gt;
----&lt;/div&gt;</summary>
		<author><name>Divyekapoor</name></author>
	</entry>
	<entry>
		<id>https://wiki.alpinelinux.org/w/index.php?title=Directly_booting_an_ISO_file&amp;diff=25143</id>
		<title>Directly booting an ISO file</title>
		<link rel="alternate" type="text/html" href="https://wiki.alpinelinux.org/w/index.php?title=Directly_booting_an_ISO_file&amp;diff=25143"/>
		<updated>2023-09-19T06:18:47Z</updated>

		<summary type="html">&lt;p&gt;Divyekapoor: Clean up discussion from the wiki text - move it to the discussions page&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
It is technically possible to boot an &amp;lt;code&amp;gt;.iso&amp;lt;/code&amp;gt; file directly, without flashing it to a disk or device.&lt;br /&gt;
&lt;br /&gt;
== Using a virtual machine ==&lt;br /&gt;
&lt;br /&gt;
The [[QEMU#Live_mode|QEMU]] page shows how an ISO image and .apkovl customizations are booted with a virtual machine.&lt;br /&gt;
&lt;br /&gt;
== Using an installed Bootloader ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== grub-imageboot ===&lt;br /&gt;
&lt;br /&gt;
In addition to standard partitions or drives, the Debian package grub-imageboot allows booting .iso files placed in the /boot/images directory.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Manual Grub menu entry ===&lt;br /&gt;
&lt;br /&gt;
No solution found yet.&lt;br /&gt;
&lt;br /&gt;
=== syslinux ===&lt;br /&gt;
&lt;br /&gt;
No solution found yet.&lt;br /&gt;
&lt;br /&gt;
[[Category:Installation]]&lt;/div&gt;</summary>
		<author><name>Divyekapoor</name></author>
	</entry>
	<entry>
		<id>https://wiki.alpinelinux.org/w/index.php?title=How_to_make_a_custom_ISO_image&amp;diff=23798</id>
		<title>How to make a custom ISO image</title>
		<link rel="alternate" type="text/html" href="https://wiki.alpinelinux.org/w/index.php?title=How_to_make_a_custom_ISO_image&amp;diff=23798"/>
		<updated>2023-07-14T06:52:09Z</updated>

		<summary type="html">&lt;p&gt;Divyekapoor: Clarify the scope of the third party image building script&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
== ISO remastering ==&lt;br /&gt;
&lt;br /&gt;
There are third party scripts to re-build completely custom images, like&lt;br /&gt;
* [https://github.com/alpinelinux/alpine-make-vm-image alpine-make-vm-image]&lt;br /&gt;
(works to only make a disk based VM image)&lt;br /&gt;
&lt;br /&gt;
and there is Alpine&#039;s original&lt;br /&gt;
* [[How_to_make_a_custom_ISO_image_with_mkimage|mkimg]]. &lt;br /&gt;
(creates a diskless ISO file)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== An alternative ==&lt;br /&gt;
&lt;br /&gt;
It&#039;s also possible to commit and load ISO image customizations to and from a writable partition when booting in [[Installation#Diskless_Mode|Diskless Mode]].&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Booting an ISO image with local customizations ==&lt;br /&gt;
&lt;br /&gt;
* From a dedicated boot media, obviously.&lt;br /&gt;
* [[Directly_booting_an_ISO_file]]&lt;br /&gt;
&lt;br /&gt;
[[Category:Package Manager]]&lt;br /&gt;
[[Category:ISO]]&lt;/div&gt;</summary>
		<author><name>Divyekapoor</name></author>
	</entry>
</feed>