<?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=Forth</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=Forth"/>
	<link rel="alternate" type="text/html" href="https://wiki.alpinelinux.org/wiki/Special:Contributions/Forth"/>
	<updated>2026-04-30T18:14:30Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.40.0</generator>
	<entry>
		<id>https://wiki.alpinelinux.org/w/index.php?title=Xen_Dom0&amp;diff=15516</id>
		<title>Xen Dom0</title>
		<link rel="alternate" type="text/html" href="https://wiki.alpinelinux.org/w/index.php?title=Xen_Dom0&amp;diff=15516"/>
		<updated>2018-11-29T19:04:52Z</updated>

		<summary type="html">&lt;p&gt;Forth: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This guide will show you how to perform a Xen Dom0 install on a HDD, so you can have your Dom0. The first step is to perform a normal HDD install of Alpine Linux, which can be accomplished following the guide [[Install to disk]]. Once the install is finished, and you have rebooted into your new system, it&#039;s time to install the Xen packages:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# apk add xen xen-hypervisor seabios ovmf&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
seabios and ovmf provide bios and uefi firmwares.&lt;br /&gt;
&lt;br /&gt;
This will install Xen Hypervisor, xl cli command and all the required packages. The next step is to modify your extlinux.cfg and add an entry to boot Xen:&lt;br /&gt;
&lt;br /&gt;
Normal boot:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
LABEL xen&lt;br /&gt;
  KERNEL /boot/mboot.c32&lt;br /&gt;
  APPEND /boot/xen.gz --- /boot/grsec root=UUID=&amp;lt;YOUR-DISK-UUID&amp;gt; modules=ext4 --- /boot/grsec.gz&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Serial console boot:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
LABEL xen&lt;br /&gt;
  KERNEL /boot/mboot.c32&lt;br /&gt;
  APPEND /boot/xen.gz com1=115200,8n1 console=com1 --- /boot/grsec root=UUID=&amp;lt;YOUR-DISK-UUID&amp;gt; modules=ext4  --- /boot/grsec.gz&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{Note|&amp;lt;nowiki&amp;gt;remember to change &amp;lt;YOUR-DISK-UUID&amp;gt; with the UUID of your boot disk (you can copy it from the normal Alpine Linux boot entry)&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
&lt;br /&gt;
com1=115200,8n1 console=com1 redirect xen and dom0 to a physical serial port, handy if you want to use a serial null modem cable instead of a keyboard+monitor combo or if your server has an kvm over ip.&lt;br /&gt;
&lt;br /&gt;
It&#039;s also a good idea to check [http://wiki.xen.org/wiki/Xen_Hypervisor_Boot_Options Xen Boot options] and set dom0_mem, dom0_vcpus_pin and dom0_max_vcpus at least.&lt;br /&gt;
&lt;br /&gt;
The next step is to load the necessary kernel modules for Xen, we will add them to /etc/modules, so they will be loaded automatically on boot:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# echo &amp;quot;xen_netback&amp;quot; &amp;gt;&amp;gt; /etc/modules&lt;br /&gt;
# echo &amp;quot;xen_blkback&amp;quot; &amp;gt;&amp;gt; /etc/modules&lt;br /&gt;
# echo &amp;quot;tun&amp;quot; &amp;gt;&amp;gt; /etc/modules&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The last step is to configure startup services, we will need udev and xencommons at least to be started on boot:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
rc-update add xenconsoled&lt;br /&gt;
rc-update add xendomains&lt;br /&gt;
rc-update add xenqemu&lt;br /&gt;
rc-update add xenstored&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Ok, now you have a fully functional Xen install, it&#039;s time to boot into it.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# reboot&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Also remember to configure at least one network bridge following the [[Bridge]] guide.&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
* [[Xen Dom0 on USB or SD]]&lt;br /&gt;
&lt;br /&gt;
[[Category:Virtualization]]&lt;/div&gt;</summary>
		<author><name>Forth</name></author>
	</entry>
	<entry>
		<id>https://wiki.alpinelinux.org/w/index.php?title=Xen_Dom0&amp;diff=15515</id>
		<title>Xen Dom0</title>
		<link rel="alternate" type="text/html" href="https://wiki.alpinelinux.org/w/index.php?title=Xen_Dom0&amp;diff=15515"/>
		<updated>2018-11-29T18:59:27Z</updated>

		<summary type="html">&lt;p&gt;Forth: add seabios and ovmf packages&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This guide will show you how to perform a Xen Dom0 install on a HDD, so you can have your Dom0. The first step is to perform a normal HDD install of Alpine Linux, which can be accomplished following the guide [[Install to disk]]. Once the install is finished, and you have rebooted into your new system, it&#039;s time to install the Xen packages:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# apk add xen xen-hypervisor seabios ovmf&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
seabios and ovmf provide bios and uefi firmwares.&lt;br /&gt;
&lt;br /&gt;
This will install Xen Hypervisor and Tools (both xl and xend) and all the required packages. The next step is to modify your extlinux.cfg and add an entry to boot Xen:&lt;br /&gt;
&lt;br /&gt;
Normal boot:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
LABEL xen&lt;br /&gt;
  KERNEL /boot/mboot.c32&lt;br /&gt;
  APPEND /boot/xen.gz --- /boot/grsec root=UUID=&amp;lt;YOUR-DISK-UUID&amp;gt; modules=ext4 --- /boot/grsec.gz&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Serial console boot:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
LABEL xen&lt;br /&gt;
  KERNEL /boot/mboot.c32&lt;br /&gt;
  APPEND /boot/xen.gz com1=115200,8n1 console=com1 --- /boot/grsec root=UUID=&amp;lt;YOUR-DISK-UUID&amp;gt; modules=ext4  --- /boot/grsec.gz&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{Note|&amp;lt;nowiki&amp;gt;remember to change &amp;lt;YOUR-DISK-UUID&amp;gt; with the UUID of your boot disk (you can copy it from the normal Alpine Linux boot entry)&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
&lt;br /&gt;
It&#039;s also a good idea to check [http://wiki.xen.org/wiki/Xen_Hypervisor_Boot_Options Xen Boot options] and set dom0_mem, dom0_vcpus_pin and dom0_max_vcpus at least.&lt;br /&gt;
&lt;br /&gt;
The next step is to load the necessary kernel modules for Xen, we will add them to /etc/modules, so they will be loaded automatically on boot:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# echo &amp;quot;xen_netback&amp;quot; &amp;gt;&amp;gt; /etc/modules&lt;br /&gt;
# echo &amp;quot;xen_blkback&amp;quot; &amp;gt;&amp;gt; /etc/modules&lt;br /&gt;
# echo &amp;quot;tun&amp;quot; &amp;gt;&amp;gt; /etc/modules&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The last step is to configure startup services, we will need udev and xencommons at least to be started on boot:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
rc-update add xenconsoled&lt;br /&gt;
rc-update add xendomains&lt;br /&gt;
rc-update add xenqemu&lt;br /&gt;
rc-update add xenstored&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Ok, now you have a fully functional Xen install, it&#039;s time to boot into it.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# reboot&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Also remember to configure at least one network bridge following the [[Bridge]] guide.&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
* [[Xen Dom0 on USB or SD]]&lt;br /&gt;
&lt;br /&gt;
[[Category:Virtualization]]&lt;/div&gt;</summary>
		<author><name>Forth</name></author>
	</entry>
	<entry>
		<id>https://wiki.alpinelinux.org/w/index.php?title=Setting_up_a_software_RAID_array&amp;diff=15339</id>
		<title>Setting up a software RAID array</title>
		<link rel="alternate" type="text/html" href="https://wiki.alpinelinux.org/w/index.php?title=Setting_up_a_software_RAID_array&amp;diff=15339"/>
		<updated>2018-07-11T12:00:10Z</updated>

		<summary type="html">&lt;p&gt;Forth: /* Saving config */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:Storage]]&lt;br /&gt;
&lt;br /&gt;
There are various forms of RAID: via a hardware RAID controller, via &amp;quot;fake RAID&amp;quot;, and &amp;quot;software RAID&amp;quot; using &amp;lt;code&amp;gt;mdadm&amp;lt;/code&amp;gt;, which is Linux-only. These instructions only discuss the last form of RAID. Also, it only discusses how to setup a RAID array for arbitrary storage. It is possible to have one&#039;s system root {{Path|/}}, or {{Path|/var}}, or swap, or even one&#039;s {{Path|/boot}}, on a RAID array. See [[Setting up disks manually]] for more details about doing any of that.&lt;br /&gt;
&lt;br /&gt;
== RAID Levels ==&lt;br /&gt;
&lt;br /&gt;
There are several &amp;quot;levels&amp;quot; of RAID to choose between:&lt;br /&gt;
&lt;br /&gt;
* RAID0 essentially just glues two devices together, making a larger virtual drive. Reads and writes are &amp;quot;striped&amp;quot; between the drives for speed improvements. (That is, your hardware may read from, or write different data to, multiple devices in parallel.) A &amp;quot;device&amp;quot; here is usually a partition of a hard drive.&lt;br /&gt;
* RAID1 &amp;quot;mirrors&amp;quot; writes to two devices, for improved safety. Then if one of the devices fails, the data will still be available on the other.&lt;br /&gt;
* RAID5 is similar to RAID1, but it uses three devices and provides the space of two of them. The data will be preserved as long as any two of the three devices continue to work.&lt;br /&gt;
&lt;br /&gt;
There are other RAID levels as well. [http://www.acnc.com/raidedu/0 Here is more explanation of their differences.]&lt;br /&gt;
&lt;br /&gt;
== Advice ==&lt;br /&gt;
&lt;br /&gt;
* Your {{Path|/boot}} partition should either not be on RAID, or else be on a RAID1 array, with no further layers of encryption or LVM. (Alpine&#039;s default bootloader extlinux can&#039;t handle either. Grub2 can handle {{Path|/boot}} being on LVM.) The usual practice is to create a small (32--100 MB) partition for {{Path|/boot}}. That can be a mirrored (RAID1) volume, however this is just for post-init access. That way, when you write a new kernel or bootloader config file to {{Path|/boot}}, it gets written to multiple physical partitions. During the pre-init, bootloader phase, only one of those partitions will be used (and it will be mounted read-only).&lt;br /&gt;
* You can put swap on a RAID0 volume, but there doesn&#039;t seem to be any good reason to do so. The Linux kernel already knows how to stripe several swap partitions. So you can just devote multiple ordinary (not-residing-on-RAID) partitions to swap, and get the same effect. The downside from doing either of these things is that when one of your disk fails, the system will go down. For better reliability, you can create a mirrored (RAID1) volume and put swap there. This will let your system keep running even when one of the disks fails.&lt;br /&gt;
* All partitions in a RAID array should be the same size.&lt;br /&gt;
* Don&#039;t ever mount just one of the devices in a RAID1 array, even though it &amp;quot;has the same data&amp;quot; as the other. If you mount it r/w, then---even if you don&#039;t explicitly write anything to the device---it may get out of sync with the unmounted device, for example because the journal on its filesystem has been updated. If you ever subsequently mount the other device, or the two of them together, your data will likely become corrupted. If you have to do this, make sure you mount your device r/o. Better yet, abandon the device you didn&#039;t mount. &#039;&#039;&#039;Zero out its RAID headers&#039;&#039;&#039;, and tell &amp;lt;code&amp;gt;mdadm&amp;lt;/code&amp;gt; that that device has failed. Then you can if you like treat it as a new disk, which you can add as a replacement to your (now degraded) original RAID array.&lt;br /&gt;
* A mirrored RAID array (level 1 or 5) protects you against hardware failure. It doesn&#039;t protect against &amp;lt;code&amp;gt;rm -rf /&amp;lt;/code&amp;gt;, software errors, exploits, earthquakes, fire. Don&#039;t rely on RAID as a backup strategy.&lt;br /&gt;
* Running a mirrored RAID only provides one line of defense against drive failures. It doesn&#039;t license you to stop thinking about them. If a device in a RAID 1 starts failing and you aren&#039;t aware of it, your data will end up just as silently corrupted as it would be if you were running one drive. You have to watch your logs.&lt;br /&gt;
&lt;br /&gt;
This document was updated for Alpine 2.4.6.&lt;br /&gt;
&lt;br /&gt;
== Loading needed modules ==&lt;br /&gt;
Start with loading the raid1 kernel module:&lt;br /&gt;
&lt;br /&gt;
{{Cmd|modprobe raid1}}&lt;br /&gt;
&lt;br /&gt;
Add it to {{Path|/etc/modules}} so it gets loaded during next reboot:&lt;br /&gt;
&lt;br /&gt;
{{Cmd|echo raid1 &amp;gt;&amp;gt; /etc/modules}}&lt;br /&gt;
&lt;br /&gt;
== Creating the partitions ==&lt;br /&gt;
&lt;br /&gt;
Please read up on [https://raid.wiki.kernel.org/index.php/Partition_Types partition types], and why you should consider using 0xda instead of 0xfd.&lt;br /&gt;
&lt;br /&gt;
I will use {{Path|/dev/sda}} and {{Path|/dev/sdb}} in this document but your devices may be different. To find what disks you have available, look in {{Path|/proc/partitions}}.&lt;br /&gt;
&lt;br /&gt;
Create the partitions using fdisk.&lt;br /&gt;
&lt;br /&gt;
{{Cmd|fdisk /dev/sda}}&lt;br /&gt;
&lt;br /&gt;
I will create one single partition of type Linux raid autodetect. Use &#039;&#039;&#039;n&#039;&#039;&#039; in fdisk to create the partition and &#039;&#039;&#039;t&#039;&#039;&#039; to set type. Logical volumes will be created later. My partition table looks like this (&#039;p&#039; to print partition table):&lt;br /&gt;
&lt;br /&gt;
    Device Boot      Start         End      Blocks  Id System&lt;br /&gt;
 /dev/sda1               1       17753     8388261  fd Linux raid autodetect&lt;br /&gt;
&lt;br /&gt;
Use &#039;&#039;&#039;w&#039;&#039;&#039; to &#039;&#039;&#039;w&#039;&#039;&#039;rite and quit.&lt;br /&gt;
Do the same with your second disk.&lt;br /&gt;
&lt;br /&gt;
{{Cmd|fdisk /dev/sdb}}&lt;br /&gt;
&lt;br /&gt;
Mine looks like this:&lt;br /&gt;
    Device Boot      Start         End      Blocks  Id System&lt;br /&gt;
 /dev/sdb1               1       17753     8388261  fd Linux raid autodetect&lt;br /&gt;
&lt;br /&gt;
Alternately, if your disks are the same size (as they should be, see [[#Advice|above]]) you can copy the partition table from one to the other like this:&lt;br /&gt;
&lt;br /&gt;
{{Cmd|1=apk add sfdisk&lt;br /&gt;
sfdisk -d /dev/sda {{!}} sfdisk /dev/sdb}}&lt;br /&gt;
&lt;br /&gt;
== Setting up the RAID array ==&lt;br /&gt;
Install mdadm to set up the arrays.&lt;br /&gt;
&lt;br /&gt;
{{Cmd|apk add mdadm}}&lt;br /&gt;
&lt;br /&gt;
Create the array.&lt;br /&gt;
&lt;br /&gt;
{{Cmd|1=mdadm --create --level=1 --raid-devices=2 /dev/md0 /dev/sda1 /dev/sdb1}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Monitoring sync status ==&lt;br /&gt;
You should now be able to see the array syncronize by looking at the contents of {{Path|/proc/mdstat}}.&lt;br /&gt;
&lt;br /&gt;
 ~ # cat /proc/mdstat &lt;br /&gt;
 Personalities : [raid1] &lt;br /&gt;
 md0 : active raid1 sdb1[1] sda1[0]&lt;br /&gt;
       8388160 blocks [2/2] [UU]&lt;br /&gt;
       [=========&amp;gt;...........]  resync = 45.3% (3800064/8388160) finish=0.3min  speed=200003K/sec&lt;br /&gt;
 &lt;br /&gt;
 unused devices: &amp;lt;none&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You don&#039;t need to wait til it is fully syncronized to continue.&lt;br /&gt;
&lt;br /&gt;
== Saving config ==&lt;br /&gt;
Create the /etc/mdadm.conf file so mdadm knows how your raid setup is:&lt;br /&gt;
&lt;br /&gt;
{{Cmd|mdadm --detail --scan &amp;gt; /etc/mdadm.conf}}&lt;br /&gt;
&lt;br /&gt;
To make sure the raid devices start during the next reboot run:&lt;br /&gt;
{{Cmd|rc-update add mdadm-raid}}&lt;br /&gt;
&lt;br /&gt;
To use the raid array in {{Path|/etc/fstab}} at boot, mdadm service must be started at boot level:&lt;br /&gt;
{{Cmd|rc-update add mdadm boot}}&lt;br /&gt;
{{Cmd|rc-update add mdadm-raid boot}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If you&#039;re not running Alpine from a hard disk install, use {{Cmd|lbu commit}} as usual to save your configuration changes to your removable media.&lt;br /&gt;
&lt;br /&gt;
The raid device {{Path|/dev/md0}} is now ready to be used with [[Setting up Logical Volumes with LVM|LVM]] or mkfs.&lt;br /&gt;
&lt;br /&gt;
== Adding a RAID after the installation ==&lt;br /&gt;
To add a softRAID on an already installed Alpine, you have to start with these 3 steps :  &lt;br /&gt;
&lt;br /&gt;
3. [[Setting_up_a_software_RAID_array#Loading_needed_modules|Loading needed modules]]&lt;br /&gt;
&lt;br /&gt;
4. [[Setting_up_a_software_RAID_array#Creating_the_partitions|Creating the partitions]]&lt;br /&gt;
&lt;br /&gt;
5. [[Setting_up_a_software_RAID_array#Setting_up_the_RAID_array|Setting up the RAID array]]&lt;br /&gt;
&lt;br /&gt;
Then you have to update your initfs with the command mkinitfs.&lt;br /&gt;
&lt;br /&gt;
1. Be sure {{Path|/etc/mkinitfs/mkinitfs.conf}} contain &#039;&#039;&#039;raid&#039;&#039;&#039; which should looks like this :&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;features=&amp;quot;ata base ide scsi usb virtio ext4 lvm raid&amp;quot;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2. Update the initfs by this command&lt;br /&gt;
&lt;br /&gt;
{{Cmd|mkinitfs -c /etc/mkinitfs/mkinitfs.conf -b /}}&lt;br /&gt;
&lt;br /&gt;
== More Info on RAID ==&lt;br /&gt;
These resources may be helpful:&lt;br /&gt;
&lt;br /&gt;
* [https://wiki.archlinux.org/index.php/RAID Arch wiki page on RAID]&lt;br /&gt;
* [https://wiki.archlinux.org/index.php/Software_RAID_and_LVM Arch wiki page on RAID and LVM]&lt;br /&gt;
* [https://wiki.archlinux.org/index.php/Convert_a_single_drive_system_to_RAID Arch wiki page on Converting an existing system to RAID] [http://en.gentoo-wiki.com/wiki/Migrate_to_RAID Gentoo wiki page on the same]&lt;br /&gt;
* http://en.gentoo-wiki.com/wiki/RAID/Software&lt;br /&gt;
* http://en.gentoo-wiki.com/wiki/Software_RAID_Install&lt;br /&gt;
* http://www.gentoo.org/doc/en/gentoo-x86-tipsntricks.xml#software-raid&lt;br /&gt;
* http://www.gentoo.org/doc/en/gentoo-x86+raid+lvm2-quickinstall.xml&lt;br /&gt;
&lt;br /&gt;
* http://yannickloth.be/blog/2010/08/01/installing-archlinux-with-software-raid1-encrypted-filesystem-and-lvm2/&lt;br /&gt;
* http://anonscm.debian.org/gitweb/?p=pkg-mdadm/mdadm.git;a=blob_plain;f=debian/FAQ;hb=HEAD  Debian MDADM FAQ&lt;br /&gt;
* http://tldp.org/FAQ/Linux-RAID-FAQ/x37.html Linux RAID FAQ&lt;br /&gt;
* https://access.redhat.com/knowledge/docs/en-US/Red_Hat_Enterprise_Linux/6/html/Storage_Administration_Guide/ch-raid.html&lt;br /&gt;
* http://linux-101.org/howto/arch-linux-software-raid-installation-guide&lt;br /&gt;
* https://raid.wiki.kernel.org/index.php/Linux_Raid&lt;/div&gt;</summary>
		<author><name>Forth</name></author>
	</entry>
	<entry>
		<id>https://wiki.alpinelinux.org/w/index.php?title=KVM&amp;diff=14108</id>
		<title>KVM</title>
		<link rel="alternate" type="text/html" href="https://wiki.alpinelinux.org/w/index.php?title=KVM&amp;diff=14108"/>
		<updated>2017-10-30T19:48:49Z</updated>

		<summary type="html">&lt;p&gt;Forth: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[https://www.linux-kvm.org/page/Main_Page KVM] is an open source virtualization solution in a kernel module. KVM can virtualize x86, PowerPC, and S390 guests.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Installing KVM =&lt;br /&gt;
It is possible to install just qemu and libvirt for local management &lt;br /&gt;
{{Cmd|sudo apk add qemu-system-x86_64 libvirt}}&lt;br /&gt;
but most users will probably want libvirt-deamon and/or virt-manager for a GUI.&lt;br /&gt;
{{Cmd|sudo apk add libvirt-daemon dbus polkit}}&lt;br /&gt;
If you want to use other disk image formats than raw, you need qemu-img&lt;br /&gt;
{{Cmd|sudo apk add qemu-img}}&lt;br /&gt;
&lt;br /&gt;
Enable the KVM kernel module&lt;br /&gt;
{{Cmd|sudo modprobe kvm-intel}}&lt;br /&gt;
or&lt;br /&gt;
{{Cmd|sudo modprobe kvm-amd}}&lt;br /&gt;
by defaults kvm use bridge to nat vm, if you want network with the default configuration, you need to load the tun module&lt;br /&gt;
{{Cmd|sudo modprobe tun}}&lt;br /&gt;
&lt;br /&gt;
Add your user to the follwing groups so you can mange the vms&lt;br /&gt;
{{Cmd|sudo addgroup user kvm&lt;br /&gt;
sudo addgroup user qemu&lt;br /&gt;
sudo addgroup user libvirt}}&lt;br /&gt;
&lt;br /&gt;
Set libvirtd and dbus to start on startup&lt;br /&gt;
{{Cmd|sudo rc-update add libvirtd&lt;br /&gt;
sudo rc-update add dbus}}&lt;br /&gt;
&lt;br /&gt;
== Configure PolicyKit ==&lt;br /&gt;
In order to use libvirtd to remotely control KVM over ssh PolicyKit needs a .pkla informing it that this is allowed.&lt;br /&gt;
Write the following file to /etc/polkit-1/localauthority/50-local.d/50-libvirt-ssh-remote-access-policy.pkla&lt;br /&gt;
{{Cmd|&amp;lt;nowiki&amp;gt;[Remote libvirt SSH access]&lt;br /&gt;
 Identity=unix-group:libvirt&lt;br /&gt;
 Action=org.libvirt.unix.manage&lt;br /&gt;
 ResultAny=yes&lt;br /&gt;
 ResultInactive=yes&lt;br /&gt;
 ResultActive=yes&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
[[Category:Virtualization]]&lt;/div&gt;</summary>
		<author><name>Forth</name></author>
	</entry>
	<entry>
		<id>https://wiki.alpinelinux.org/w/index.php?title=Xen_Dom0&amp;diff=5685</id>
		<title>Xen Dom0</title>
		<link rel="alternate" type="text/html" href="https://wiki.alpinelinux.org/w/index.php?title=Xen_Dom0&amp;diff=5685"/>
		<updated>2011-09-02T12:22:18Z</updated>

		<summary type="html">&lt;p&gt;Forth: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;So before anything else verify that you can &#039;&#039;&#039;reliably&#039;&#039;&#039; log into your Alpine box through [[Setting_up_a_ssh-server|SSH]], because with some video chipset (intel in my case) xen will blank your screen so you will have to use SSH.&lt;br /&gt;
&lt;br /&gt;
Then upgrade your setup to [[Upgrading_to_Edge|Edge/testing]] (as of the date of writing, Xen is only available in Edge). Install Xen:&lt;br /&gt;
&lt;br /&gt;
{{Cmd|apk add xen}}&lt;br /&gt;
&lt;br /&gt;
Modify your extlinux.cfg (credits: http://lists.alpinelinux.org/alpine-devel/1406.html)&lt;br /&gt;
since video card is not working for now, we will use a serial console:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
SERIAL 0 115200 &lt;br /&gt;
DEFAULT menu.c32&lt;br /&gt;
PROMPT 0&lt;br /&gt;
MENU TITLE Alpine/Linux Boot Menu&lt;br /&gt;
MENU HIDDEN&lt;br /&gt;
MENU AUTOBOOT Alpine will be booted automatically in # seconds.&lt;br /&gt;
TIMEOUT 50&lt;br /&gt;
&lt;br /&gt;
LABEL 0&lt;br /&gt;
  MENU LABEL XEN&lt;br /&gt;
  KERNEL mboot.c32&lt;br /&gt;
  APPEND /boot/xen-4.gz iommu=1 dom0_mem=1024M dom0_max_vcpus=2 dom0_vcpus_pin  loglvl=all guest_loglvl=all com1=115200,8n1 console=com1  --- /boot/grsec root=UUID=f40e340b-ea49-445b-81c0-4d7104b56662 modules=ext4 console=hvc0 earlyprintk=xen nomodeset --- /boot/grsec.gz&lt;br /&gt;
&lt;br /&gt;
LABEL 1&lt;br /&gt;
  MENU LABEL Linux&lt;br /&gt;
  KERNEL grsec&lt;br /&gt;
  APPEND initrd=grsec.gz root=UUID=f40e340b-ea49-445b-81c0-4d7104b56662 modules=ext4&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Of course adapt this accordingly to your setup (UUID, modules, etc).&lt;br /&gt;
&lt;br /&gt;
Let&#039;s start Xen services:&lt;br /&gt;
{{Cmd|&lt;br /&gt;
apk add xen&lt;br /&gt;
apk add udev&lt;br /&gt;
rc-service udev start ; rc-service udev-postmount start&lt;br /&gt;
rc-service xencommons start&lt;br /&gt;
}}&lt;br /&gt;
xl should work. If you want &amp;quot;xm&amp;quot; command&lt;br /&gt;
{{Cmd|rc-service xend start}}&lt;br /&gt;
&lt;br /&gt;
So let&#039;s install services at boot time :&lt;br /&gt;
{{Cmd|&lt;br /&gt;
rc-update add udev sysinit&lt;br /&gt;
rc-update add udev-postmount default&lt;br /&gt;
rc-update add xencommons&lt;br /&gt;
rc-update add xend&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
since we use a serial line, let&#039;a add a serial console prompt, modify your /etc/inittab accordinly:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# Put a getty on the serial port&lt;br /&gt;
#ttyS0::respawn:/sbin/getty -L ttyS0 115200 vt100&lt;br /&gt;
hvc0::respawn:/sbin/getty -L hvc0 115200 vt100&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
hvc0 is Xen console output, where we have already redirected the kernel messages.&lt;br /&gt;
To switch to Xen console, type three time &amp;quot;Ctrl+a&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Now you can configure your guest, but before don&#039;t forget to load Xen kernel module:&lt;br /&gt;
{{Cmd|modprobe xen-gntdev&lt;br /&gt;
modprobe xen-gntalloc&lt;br /&gt;
modprobe tun&lt;br /&gt;
echo &amp;quot;xen-gntdev&amp;quot; &amp;gt;&amp;gt; /etc/modules&lt;br /&gt;
echo &amp;quot;xen-gntalloc&amp;quot; &amp;gt;&amp;gt; /etc/modules&lt;br /&gt;
echo &amp;quot;tun&amp;quot; &amp;gt;&amp;gt; /etc/modules&lt;br /&gt;
}}&lt;br /&gt;
Yes, tun is not a Xen module but is needed to create tap interface in Dom0.&lt;br /&gt;
Before creating your VM don&#039;t forget to create xenbr0 bridge, otherwise Xen will change eth0 into peth0 and eth0 will become a bridge (!):&lt;br /&gt;
{{Cmd|&lt;br /&gt;
brctl addbr xenbr0&lt;br /&gt;
ifconfig xenbr0 up&lt;br /&gt;
}}&lt;br /&gt;
So now if you want to plug your &amp;quot;real&amp;quot; network card in your bridge: (192.168.1.10 is eth0 ip)&lt;br /&gt;
{{Cmd|&lt;br /&gt;
ifconfig eth0 0.0.0.0&lt;br /&gt;
brctl addif xenbr0 eth0&lt;br /&gt;
ifconfig xenbr0 192.168.1.10&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
on going debug:&lt;br /&gt;
vi /etc/rc.conf&lt;br /&gt;
rc_sys=&amp;quot;xen0&amp;quot;&lt;br /&gt;
why ?&lt;/div&gt;</summary>
		<author><name>Forth</name></author>
	</entry>
	<entry>
		<id>https://wiki.alpinelinux.org/w/index.php?title=Xen_Dom0&amp;diff=5684</id>
		<title>Xen Dom0</title>
		<link rel="alternate" type="text/html" href="https://wiki.alpinelinux.org/w/index.php?title=Xen_Dom0&amp;diff=5684"/>
		<updated>2011-09-02T12:19:30Z</updated>

		<summary type="html">&lt;p&gt;Forth: cosmetic&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;So before anything else verify that you can &#039;&#039;&#039;reliably&#039;&#039;&#039; log into your Alpine box through [[Setting_up_a_ssh-server|SSH]], because with some video chipset (intel in my case) xen will blank your screen so you will have to use SSH.&lt;br /&gt;
&lt;br /&gt;
Then upgrade your setup to [[Upgrading_to_Edge|Edge/testing]] (as of the date of writing, Xen is only available in Edge). Install Xen:&lt;br /&gt;
&lt;br /&gt;
{{Cmd|apk add xen}}&lt;br /&gt;
&lt;br /&gt;
Modify your extlinux.cfg (credits: http://lists.alpinelinux.org/alpine-devel/1406.html)&lt;br /&gt;
since video card is not working for now, we will use a serial console:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
SERIAL 0 115200 &lt;br /&gt;
DEFAULT menu.c32&lt;br /&gt;
PROMPT 0&lt;br /&gt;
MENU TITLE Alpine/Linux Boot Menu&lt;br /&gt;
MENU HIDDEN&lt;br /&gt;
MENU AUTOBOOT Alpine will be booted automatically in # seconds.&lt;br /&gt;
TIMEOUT 50&lt;br /&gt;
&lt;br /&gt;
LABEL 0&lt;br /&gt;
  MENU LABEL XEN&lt;br /&gt;
  KERNEL mboot.c32&lt;br /&gt;
  APPEND /boot/xen-4.gz iommu=1 dom0_mem=1024M dom0_max_vcpus=2 dom0_vcpus_pin  loglvl=all guest_loglvl=all com1=115200,8n1 console=com1  --- /boot/grsec root=UUID=f40e340b-ea49-445b-81c0-4d7104b56662 modules=ext4 console=hvc0 earlyprintk=xen nomodeset --- /boot/grsec.gz&lt;br /&gt;
&lt;br /&gt;
LABEL 1&lt;br /&gt;
  MENU LABEL Linux&lt;br /&gt;
  KERNEL grsec&lt;br /&gt;
  APPEND initrd=grsec.gz root=UUID=f40e340b-ea49-445b-81c0-4d7104b56662 modules=ext4&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Of course adapt this accordingly to your setup (UUID, modules, etc).&lt;br /&gt;
&lt;br /&gt;
Let&#039;s start Xen services:&lt;br /&gt;
{{Cmd|&lt;br /&gt;
apk add xen&lt;br /&gt;
apk add udev&lt;br /&gt;
rc-service udev start ; rc-service udev-postmount start&lt;br /&gt;
rc-service xencommons start&lt;br /&gt;
}}&lt;br /&gt;
xl should work. If you want &amp;quot;xm&amp;quot; command&lt;br /&gt;
{{Cmd|rc-service xend start}}&lt;br /&gt;
&lt;br /&gt;
So let&#039;s install services at boot time :&lt;br /&gt;
{{Cmd|&lt;br /&gt;
rc-update add udev sysinit&lt;br /&gt;
rc-update add udev-postmount default&lt;br /&gt;
rc-update add xencommons&lt;br /&gt;
rc-update add xend&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
since we use a serial line, let&#039;a add a serial console prompt, modify your /etc/inittab accordinly:&lt;br /&gt;
{{Cmd|&lt;br /&gt;
# Put a getty on the serial port&lt;br /&gt;
#ttyS0::respawn:/sbin/getty -L ttyS0 115200 vt100&lt;br /&gt;
hvc0::respawn:/sbin/getty -L hvc0 115200 vt100&lt;br /&gt;
}}&lt;br /&gt;
hvc0 is Xen console output, where we have already redirected the kernel messages.&lt;br /&gt;
To switch to Xen console, type three time &amp;quot;Ctrl+a&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Now you can configure your guest, but before don&#039;t forget to load Xen kernel module:&lt;br /&gt;
{{Cmd|modprobe xen-gntdev&lt;br /&gt;
modprobe xen-gntalloc&lt;br /&gt;
modprobe tun&lt;br /&gt;
echo &amp;quot;xen-gntdev&amp;quot; &amp;gt;&amp;gt; /etc/modules&lt;br /&gt;
echo &amp;quot;xen-gntalloc&amp;quot; &amp;gt;&amp;gt; /etc/modules&lt;br /&gt;
echo &amp;quot;tun&amp;quot; &amp;gt;&amp;gt; /etc/modules&lt;br /&gt;
}}&lt;br /&gt;
Yes, tun is not a Xen module but is needed to create tap interface in Dom0.&lt;br /&gt;
Before creating your VM don&#039;t forget to create xenbr0 bridge, otherwise Xen will change eth0 into peth0 and eth0 will become a bridge (!):&lt;br /&gt;
{{Cmd|&lt;br /&gt;
brctl addbr xenbr0&lt;br /&gt;
ifconfig xenbr0 up&lt;br /&gt;
}}&lt;br /&gt;
So now if you want to plug your &amp;quot;real&amp;quot; network card in your bridge: (192.168.1.10 is eth0 ip)&lt;br /&gt;
{{Cmd|&lt;br /&gt;
ifconfig eth0 0.0.0.0&lt;br /&gt;
brctl addif xenbr0 eth0&lt;br /&gt;
ifconfig xenbr0 192.168.1.10&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
on going debug:&lt;br /&gt;
vi /etc/rc.conf&lt;br /&gt;
rc_sys=&amp;quot;xen0&amp;quot;&lt;br /&gt;
why ?&lt;/div&gt;</summary>
		<author><name>Forth</name></author>
	</entry>
	<entry>
		<id>https://wiki.alpinelinux.org/w/index.php?title=Xen_Dom0&amp;diff=5683</id>
		<title>Xen Dom0</title>
		<link rel="alternate" type="text/html" href="https://wiki.alpinelinux.org/w/index.php?title=Xen_Dom0&amp;diff=5683"/>
		<updated>2011-09-02T11:50:35Z</updated>

		<summary type="html">&lt;p&gt;Forth: clean up&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;So before anything else verify that you can &#039;&#039;&#039;reliably&#039;&#039;&#039; log into your Alpine box through [[Setting_up_a_ssh-server|SSH]], because with some video chipset (intel in my case) xen will blank your screen so you will have to use SSH.&lt;br /&gt;
&lt;br /&gt;
Then upgrade your setup to [[Upgrading_to_Edge|Edge/testing]] (as of the date of writing, Xen is only available in Edge). Install Xen:&lt;br /&gt;
&lt;br /&gt;
{{Cmd|apk add xen}}&lt;br /&gt;
&lt;br /&gt;
Modify your extlinux.cfg (credits: http://lists.alpinelinux.org/alpine-devel/1406.html)&lt;br /&gt;
since video card is not working for now, we will use a serial console:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
SERIAL 0 115200 &lt;br /&gt;
DEFAULT menu.c32&lt;br /&gt;
PROMPT 0&lt;br /&gt;
MENU TITLE Alpine/Linux Boot Menu&lt;br /&gt;
MENU HIDDEN&lt;br /&gt;
MENU AUTOBOOT Alpine will be booted automatically in # seconds.&lt;br /&gt;
TIMEOUT 50&lt;br /&gt;
&lt;br /&gt;
LABEL 0&lt;br /&gt;
  MENU LABEL XEN&lt;br /&gt;
  KERNEL mboot.c32&lt;br /&gt;
  APPEND /boot/xen-4.gz iommu=1 dom0_mem=1024M dom0_max_vcpus=2 dom0_vcpus_pin  loglvl=all guest_loglvl=all com1=115200,8n1 console=com1  --- /boot/grsec root=UUID=f40e340b-ea49-445b-81c0-4d7104b56662 modules=ext4 console=hvc0 earlyprintk=xen nomodeset --- /boot/grsec.gz&lt;br /&gt;
&lt;br /&gt;
LABEL 1&lt;br /&gt;
  MENU LABEL Linux&lt;br /&gt;
  KERNEL grsec&lt;br /&gt;
  APPEND initrd=grsec.gz root=UUID=f40e340b-ea49-445b-81c0-4d7104b56662 modules=ext4&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Of course adapt this accordingly to your setup (UUID, modules, etc).&lt;br /&gt;
&lt;br /&gt;
Let&#039;s start Xen services:&lt;br /&gt;
{{Cmd|&lt;br /&gt;
apk add xen&lt;br /&gt;
apk add udev&lt;br /&gt;
rc-service udev start ; rc-service udev-postmount start&lt;br /&gt;
rc-service xencommons start&lt;br /&gt;
}}&lt;br /&gt;
xl should work. If you want &amp;quot;xm&amp;quot; command&lt;br /&gt;
{{Cmd|rc-service xend start}}&lt;br /&gt;
&lt;br /&gt;
So let&#039;s install services at boot time :&lt;br /&gt;
{{Cmd|&lt;br /&gt;
rc-update add udev sysinit&lt;br /&gt;
rc-update add udev-postmount default&lt;br /&gt;
rc-update add xencommons&lt;br /&gt;
rc-update add xend&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
since we use a serial line, let&#039;a add a serial console prompt, modify your /etc/inittab accordinly:&lt;br /&gt;
&lt;br /&gt;
# Put a getty on the serial port&lt;br /&gt;
#ttyS0::respawn:/sbin/getty -L ttyS0 115200 vt100&lt;br /&gt;
hvc0::respawn:/sbin/getty -L hvc0 115200 vt100&lt;br /&gt;
&lt;br /&gt;
hvc0 is Xen console output, where we have already redirected the kernel messages.&lt;br /&gt;
To switch to Xen console, type three time &amp;quot;Ctrl+a&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Now you can configure your guest, but before don&#039;t forget to load Xen kernel module:&lt;br /&gt;
{{Cmd|modprobe xen-gntdev&lt;br /&gt;
modprobe xen-gntalloc&lt;br /&gt;
modprobe tun&lt;br /&gt;
echo &amp;quot;xen-gntdev&amp;quot; &amp;gt;&amp;gt; /etc/modules&lt;br /&gt;
echo &amp;quot;xen-gntalloc&amp;quot; &amp;gt;&amp;gt; /etc/modules&lt;br /&gt;
echo &amp;quot;tun&amp;quot; &amp;gt;&amp;gt; /etc/modules&lt;br /&gt;
}}&lt;br /&gt;
Yes, tun is not a Xen module but is needed to create tap interface in Dom0.&lt;br /&gt;
Before creating your VM don&#039;t forget to create xenbr0 bridge, otherwise Xen will change eth0 into peth0 and eth0 will become a bridge (!):&lt;br /&gt;
{{Cmd|&lt;br /&gt;
brctl addbr xenbr0&lt;br /&gt;
ifconfig xenbr0 up&lt;br /&gt;
}}&lt;br /&gt;
So now if you want to plug your &amp;quot;real&amp;quot; network card in your bridge: (192.168.1.10 is eth0 ip)&lt;br /&gt;
{{Cmd|&lt;br /&gt;
ifconfig eth0 0.0.0.0&lt;br /&gt;
brctl addif xenbr0 eth0&lt;br /&gt;
ifconfig xenbr0 192.168.1.10&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
on going debug:&lt;br /&gt;
vi /etc/rc.conf&lt;br /&gt;
rc_sys=&amp;quot;xen0&amp;quot;&lt;br /&gt;
why ?&lt;/div&gt;</summary>
		<author><name>Forth</name></author>
	</entry>
	<entry>
		<id>https://wiki.alpinelinux.org/w/index.php?title=Xen_Dom0&amp;diff=5682</id>
		<title>Xen Dom0</title>
		<link rel="alternate" type="text/html" href="https://wiki.alpinelinux.org/w/index.php?title=Xen_Dom0&amp;diff=5682"/>
		<updated>2011-09-02T05:46:04Z</updated>

		<summary type="html">&lt;p&gt;Forth: network tips&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;So before anything else verify that you can &#039;&#039;&#039;reliably&#039;&#039;&#039; log into your Alpine box through [[Setting_up_a_ssh-server|SSH]], because with some video chipset (intel in my case) xen will blank your screen so you will have to use SSH.&lt;br /&gt;
&lt;br /&gt;
Then upgrade your setup to [[Upgrading_to_Edge|Edge/testing]] (as of the date of writing, Xen is only available in Edge). Install Xen:&lt;br /&gt;
&lt;br /&gt;
{{Cmd|apk add xen}}&lt;br /&gt;
&lt;br /&gt;
Modify your extlinux.cfg (credits: http://lists.alpinelinux.org/alpine-devel/1406.html)&lt;br /&gt;
since video card is not working for now, we will use a serial console:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
SERIAL 0 115200 &lt;br /&gt;
DEFAULT menu.c32&lt;br /&gt;
PROMPT 0&lt;br /&gt;
MENU TITLE Alpine/Linux Boot Menu&lt;br /&gt;
MENU HIDDEN&lt;br /&gt;
MENU AUTOBOOT Alpine will be booted automatically in # seconds.&lt;br /&gt;
TIMEOUT 50&lt;br /&gt;
LABEL 0&lt;br /&gt;
  MENU DEFAULT&lt;br /&gt;
  MENU LABEL Linux 2.6.38.8-vs2.3.0.37-rc17&lt;br /&gt;
  KERNEL vmlinuz-2.6.38.8-vs2.3.0.37-rc17&lt;br /&gt;
  APPEND initrd=initramfs-2.6.38.8-vs2.3.0.37-rc17 root=UUID=f40e340b-ea49-445b-81c0-4d7104b56662 modules=sd-mod,usb-storage,ext4 quiet&lt;br /&gt;
&lt;br /&gt;
LABEL 1&lt;br /&gt;
  MENU LABEL Linux 2.6.36.3-scst&lt;br /&gt;
  KERNEL vmlinuz-2.6.36.3-scst&lt;br /&gt;
  APPEND initrd=initramfs-2.6.36.3-scst root=UUID=f40e340b-ea49-445b-81c0-4d7104b56662 modules=sd-mod,usb-storage,ext4 quiet&lt;br /&gt;
&lt;br /&gt;
LABEL 2&lt;br /&gt;
  MENU LABEL Linux 2.6.38.8-grsec&lt;br /&gt;
  KERNEL vmlinuz-2.6.38.8-grsec&lt;br /&gt;
  APPEND initrd=initramfs-2.6.38.8-grsec root=UUID=f40e340b-ea49-445b-81c0-4d7104b56662 modules=sd-mod,usb-storage,ext4 quiet&lt;br /&gt;
&lt;br /&gt;
LABEL 3&lt;br /&gt;
  MENU LABEL XEN&lt;br /&gt;
  KERNEL mboot.c32&lt;br /&gt;
  APPEND /boot/xen-4.gz loglvl=all guest_loglvl=all com1=115200,8n1 console=com1 dom0_mem=256M --- /boot/vmlinuz-grsec root=UUID=f40e340b-ea49-445b-81c0-4d7104b56662 modules=sd-mod,usb-storage,ext4 console=hvc0 earlyprintk=xen nomodeset --- /boot/initramfs-grsec&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Of course replace root=UUID= with &#039;&#039;&#039;your&#039;&#039;&#039; UUID in yours.&lt;br /&gt;
&lt;br /&gt;
xl info won&#039;t work&lt;br /&gt;
&lt;br /&gt;
Start xecommons:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
alpine:/boot# /etc/init.d/xencommons start&lt;br /&gt;
Starting xenstored...FATAL: Failed to open evtchn device: No such file or directory&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
well this will fail but xl info will work anyway&lt;br /&gt;
&lt;br /&gt;
Oh but wait, evtchn device is built in the kernel, so why is there no /dev/xen/evtch file ?&lt;br /&gt;
let&#039;s start udev ! ;)&lt;br /&gt;
{{Cmd|rc-service udev start}}&lt;br /&gt;
&lt;br /&gt;
That&#039;s all folks !&lt;br /&gt;
&lt;br /&gt;
on going debug:&lt;br /&gt;
vi /etc/rc.conf&lt;br /&gt;
rc_sys=&amp;quot;xen0&amp;quot;&lt;br /&gt;
why ?&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Commands recap:&lt;br /&gt;
{{Cmd|&lt;br /&gt;
apk add xen&lt;br /&gt;
apk add udev&lt;br /&gt;
rc-service udev start ; rc-service udev-postmount start&lt;br /&gt;
rc-service xencommons start&lt;br /&gt;
}}&lt;br /&gt;
If you want &amp;quot;xm&amp;quot; command&lt;br /&gt;
{{Cmd|rc-service xend start}}&lt;br /&gt;
&lt;br /&gt;
So let&#039;s install services at boot time :&lt;br /&gt;
{{Cmd|&lt;br /&gt;
rc-update add udev sysinit&lt;br /&gt;
rc-update add udev-postmount default&lt;br /&gt;
rc-update add xencommons&lt;br /&gt;
rc-update add xend&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
since we use a serial line, let&#039;a add a serial console prompt, modify your /etc/inittab accordinly:&lt;br /&gt;
&lt;br /&gt;
# Put a getty on the serial port&lt;br /&gt;
#ttyS0::respawn:/sbin/getty -L ttyS0 115200 vt100&lt;br /&gt;
hvc0::respawn:/sbin/getty -L hvc0 115200 vt100&lt;br /&gt;
&lt;br /&gt;
hvc0 is Xen console output, where we have already redirected the kernel messages.&lt;br /&gt;
To switch to Xen console, type three time &amp;quot;Ctrl+a&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Now you can configure your guest, but before don&#039;t forget to load Xen kernel module:&lt;br /&gt;
{{Cmd|modprobe xen-gntdev&lt;br /&gt;
modprobe xen-gntalloc&lt;br /&gt;
modprobe tun&lt;br /&gt;
echo &amp;quot;xen-gntdev&amp;quot; &amp;gt;&amp;gt; /etc/modules&lt;br /&gt;
echo &amp;quot;xen-gntalloc&amp;quot; &amp;gt;&amp;gt; /etc/modules&lt;br /&gt;
echo &amp;quot;tun&amp;quot; &amp;gt;&amp;gt; /etc/modules&lt;br /&gt;
}}&lt;br /&gt;
Yes, tun is not a Xen module but is needed to create tap interface in Dom0.&lt;br /&gt;
Before creating your VM don&#039;t forget to create xenbr0 bridge, otherwise Xen will change eth0 into peth0 and eth0 will become a bridge (!):&lt;br /&gt;
{{Cmd|&lt;br /&gt;
brctl addbr xenbr0&lt;br /&gt;
ifconfig xenbr0 up&lt;br /&gt;
}}&lt;br /&gt;
So now if you want to plug your &amp;quot;real&amp;quot; network card in your bridge: (192.168.1.10 is eth0 ip)&lt;br /&gt;
{{Cmd|&lt;br /&gt;
ifconfig eth0 0.0.0.0&lt;br /&gt;
brctl addif xenbr0 eth0&lt;br /&gt;
ifconfig xenbr0 192.168.1.10&lt;br /&gt;
}}&lt;/div&gt;</summary>
		<author><name>Forth</name></author>
	</entry>
	<entry>
		<id>https://wiki.alpinelinux.org/w/index.php?title=Install_to_disk&amp;diff=5674</id>
		<title>Install to disk</title>
		<link rel="alternate" type="text/html" href="https://wiki.alpinelinux.org/w/index.php?title=Install_to_disk&amp;diff=5674"/>
		<updated>2011-08-30T19:24:04Z</updated>

		<summary type="html">&lt;p&gt;Forth: setup-alpine configures apk repositories&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Note|This document covers 2.x.x release.}}&lt;br /&gt;
For 1.8.x and older please see [[Native Harddisk Install 1.6]]&lt;br /&gt;
&lt;br /&gt;
== Installation ==&lt;br /&gt;
Run &#039;&#039;setup-alpine&#039;&#039; to configure the keyboard, hostname and networking.&lt;br /&gt;
&lt;br /&gt;
{{Cmd|setup-alpine}}&lt;br /&gt;
&lt;br /&gt;
Create partitions with fdisk. &lt;br /&gt;
&lt;br /&gt;
{{Cmd|fdisk /dev/sda}}&lt;br /&gt;
&lt;br /&gt;
You should have 2 partitions: /dev/sda1 as &amp;quot;Linux&amp;quot; (type 83) and /dev/sda2 as &amp;quot;linux swap&amp;quot; (type 82). The /dev/sda1 must be bootable (command &amp;quot;a&amp;quot; within fdisk).&lt;br /&gt;
&lt;br /&gt;
Install needed programs for the setup &lt;br /&gt;
&lt;br /&gt;
{{Cmd|apk add e2fsprogs syslinux mkinitfs}}&lt;br /&gt;
&lt;br /&gt;
Create filesystem and swap &lt;br /&gt;
&lt;br /&gt;
{{Cmd|mkfs.ext4 /dev/sda1&lt;br /&gt;
mkswap /dev/sda2}}&lt;br /&gt;
&lt;br /&gt;
Mount file-system &lt;br /&gt;
&lt;br /&gt;
{{Cmd|mount -t ext4 /dev/sda1 /mnt}}&lt;br /&gt;
&lt;br /&gt;
Clone the current running config created by setup-alpine (hostname, networking root password)&lt;br /&gt;
&lt;br /&gt;
{{Cmd|&amp;lt;nowiki&amp;gt;lbu package - | tar -C /mnt -zx&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
&lt;br /&gt;
Install base packages on harddisk&lt;br /&gt;
&lt;br /&gt;
{{Cmd|&amp;lt;nowiki&amp;gt;apk add --root=/mnt --initdb $(cat /etc/apk/world)&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
&lt;br /&gt;
Append the / and swap to fstab:&lt;br /&gt;
{{Cmd|echo -e &amp;quot;/dev/sda1 /    ext4  defaults 1 1&amp;quot; &amp;amp;gt;&amp;amp;gt; /mnt/etc/fstab&lt;br /&gt;
echo -e &amp;quot;/dev/sda2 none swap  sw       0 0&amp;quot; &amp;amp;gt;&amp;amp;gt; /mnt/etc/fstab}}&lt;br /&gt;
&lt;br /&gt;
Configure the boot loader, extlinux. We use the provided syslinux as base.&lt;br /&gt;
&lt;br /&gt;
{{Cmd|cp /media/cdrom/syslinux.cf /mnt/boot/extlinux.conf&lt;br /&gt;
vi /mnt/boot/extlinux.conf}}&lt;br /&gt;
&lt;br /&gt;
It should contain something like: &lt;br /&gt;
 timeout 20&lt;br /&gt;
 prompt 1&lt;br /&gt;
 default grsec&lt;br /&gt;
 label grsec&lt;br /&gt;
     kernel /boot/grsec&lt;br /&gt;
     append initrd=/boot/grsec.gz root=/dev/sda1 modules=ext4 quiet&lt;br /&gt;
&lt;br /&gt;
Install the bootloader:&lt;br /&gt;
{{Cmd|extlinux -i /mnt/boot}}&lt;br /&gt;
&lt;br /&gt;
Install syslinux bootloader at the beginning of the MBR so its bootable (note that its sda and not sda1)&lt;br /&gt;
&lt;br /&gt;
{{Cmd|&amp;lt;nowiki&amp;gt;dd if=/usr/share/syslinux/mbr.bin of=/dev/sda&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
&lt;br /&gt;
Unmount, remove cdrom, and reboot. (If you can&#039;t eject, just remove it manually as the machine reboots) &lt;br /&gt;
&lt;br /&gt;
{{Cmd|umount /mnt&lt;br /&gt;
umount /.modloop&lt;br /&gt;
eject &lt;br /&gt;
reboot}}&lt;br /&gt;
&lt;br /&gt;
After reboot, you should be able to log in as root with the password you created in &amp;lt;tt&amp;gt;setup-alpine&amp;lt;/tt&amp;gt;.&lt;/div&gt;</summary>
		<author><name>Forth</name></author>
	</entry>
	<entry>
		<id>https://wiki.alpinelinux.org/w/index.php?title=Install_to_disk&amp;diff=5673</id>
		<title>Install to disk</title>
		<link rel="alternate" type="text/html" href="https://wiki.alpinelinux.org/w/index.php?title=Install_to_disk&amp;diff=5673"/>
		<updated>2011-08-30T19:22:56Z</updated>

		<summary type="html">&lt;p&gt;Forth: /* Installation */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Note|This document covers 2.x.x release.}}&lt;br /&gt;
For 1.8.x and older please see [[Native Harddisk Install 1.6]]&lt;br /&gt;
&lt;br /&gt;
== Installation ==&lt;br /&gt;
Run &#039;&#039;setup-alpine&#039;&#039; to configure the keyboard, hostname and networking.&lt;br /&gt;
&lt;br /&gt;
{{Cmd|setup-alpine}}&lt;br /&gt;
&lt;br /&gt;
Create partitions with fdisk. &lt;br /&gt;
&lt;br /&gt;
{{Cmd|fdisk /dev/sda}}&lt;br /&gt;
&lt;br /&gt;
You should have 2 partitions: /dev/sda1 as &amp;quot;Linux&amp;quot; (type 83) and /dev/sda2 as &amp;quot;linux swap&amp;quot; (type 82). The /dev/sda1 must be bootable (command &amp;quot;a&amp;quot; within fdisk).&lt;br /&gt;
&lt;br /&gt;
Install needed programs for the setup &lt;br /&gt;
&lt;br /&gt;
{{Cmd|apk add e2fsprogs syslinux mkinitfs}}&lt;br /&gt;
&lt;br /&gt;
Create filesystem and swap &lt;br /&gt;
&lt;br /&gt;
{{Cmd|mkfs.ext4 /dev/sda1&lt;br /&gt;
mkswap /dev/sda2}}&lt;br /&gt;
&lt;br /&gt;
Mount file-system &lt;br /&gt;
&lt;br /&gt;
{{Cmd|mount -t ext4 /dev/sda1 /mnt}}&lt;br /&gt;
&lt;br /&gt;
Clone the current running config created by setup-alpine (hostname, networking root password)&lt;br /&gt;
&lt;br /&gt;
{{Cmd|&amp;lt;nowiki&amp;gt;lbu package - | tar -C /mnt -zx&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
&lt;br /&gt;
Install base packages on harddisk&lt;br /&gt;
&lt;br /&gt;
{{Cmd|&amp;lt;nowiki&amp;gt;apk add --root=/mnt --initdb $(cat /etc/apk/world)&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
&lt;br /&gt;
Create the repositories list. In this example we use the cdrom as repository:&lt;br /&gt;
&lt;br /&gt;
{{Cmd|mkdir -p /mnt/etc/apk&lt;br /&gt;
echo &amp;quot;/media/cdrom/packages/core&amp;quot; &amp;gt;&amp;gt; /mnt/etc/apk/repositories&lt;br /&gt;
echo &amp;quot;/media/cdrom/packages/extra&amp;quot; &amp;gt;&amp;gt; /mnt/etc/apk/repositories}}&lt;br /&gt;
&lt;br /&gt;
Append the / and swap to fstab:&lt;br /&gt;
{{Cmd|echo -e &amp;quot;/dev/sda1 /    ext4  defaults 1 1&amp;quot; &amp;amp;gt;&amp;amp;gt; /mnt/etc/fstab&lt;br /&gt;
echo -e &amp;quot;/dev/sda2 none swap  sw       0 0&amp;quot; &amp;amp;gt;&amp;amp;gt; /mnt/etc/fstab}}&lt;br /&gt;
&lt;br /&gt;
Configure the boot loader, extlinux. We use the provided syslinux as base.&lt;br /&gt;
&lt;br /&gt;
{{Cmd|cp /media/cdrom/syslinux.cf /mnt/boot/extlinux.conf&lt;br /&gt;
vi /mnt/boot/extlinux.conf}}&lt;br /&gt;
&lt;br /&gt;
It should contain something like: &lt;br /&gt;
 timeout 20&lt;br /&gt;
 prompt 1&lt;br /&gt;
 default grsec&lt;br /&gt;
 label grsec&lt;br /&gt;
     kernel /boot/grsec&lt;br /&gt;
     append initrd=/boot/grsec.gz root=/dev/sda1 modules=ext4 quiet&lt;br /&gt;
&lt;br /&gt;
Install the bootloader:&lt;br /&gt;
{{Cmd|extlinux -i /mnt/boot}}&lt;br /&gt;
&lt;br /&gt;
Install syslinux bootloader at the beginning of the MBR so its bootable (note that its sda and not sda1)&lt;br /&gt;
&lt;br /&gt;
{{Cmd|&amp;lt;nowiki&amp;gt;dd if=/usr/share/syslinux/mbr.bin of=/dev/sda&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
&lt;br /&gt;
Unmount, remove cdrom, and reboot. (If you can&#039;t eject, just remove it manually as the machine reboots) &lt;br /&gt;
&lt;br /&gt;
{{Cmd|umount /mnt&lt;br /&gt;
umount /.modloop&lt;br /&gt;
eject &lt;br /&gt;
reboot}}&lt;br /&gt;
&lt;br /&gt;
After reboot, you should be able to log in as root with the password you created in &amp;lt;tt&amp;gt;setup-alpine&amp;lt;/tt&amp;gt;.&lt;/div&gt;</summary>
		<author><name>Forth</name></author>
	</entry>
	<entry>
		<id>https://wiki.alpinelinux.org/w/index.php?title=Installation&amp;diff=5672</id>
		<title>Installation</title>
		<link rel="alternate" type="text/html" href="https://wiki.alpinelinux.org/w/index.php?title=Installation&amp;diff=5672"/>
		<updated>2011-08-30T19:14:46Z</updated>

		<summary type="html">&lt;p&gt;Forth: /* Installation Handbook */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The following information will assist you with the installation of Alpine Linux.&lt;br /&gt;
[[Image:hdd_mount.png|left|link=]]&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Installation Quick-Start in 3 Easy Steps =&lt;br /&gt;
&amp;lt;div style=&amp;quot;float:left; font-size:30px; font-weight:bold;&amp;quot;&amp;gt;&lt;br /&gt;
1st&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;margin-left:65px; background-color:#EDF2F2; border-style:solid; border-color:#6F7C91; border-width:0px; border-left-width:5px; min-height:55px; padding:5px;&amp;quot;&amp;gt;&lt;br /&gt;
[http://alpinelinux.org/downloads Download] the latest stable-release ISO.&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;float:left; font-size:30px; font-weight:bold;&amp;quot;&amp;gt;&lt;br /&gt;
2nd&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;margin-left:65px; background-color:#E0E9E9; border-style:solid; border-color:#606A82; border-width:0px; border-left-width:5px; min-height:55px; padding:5px;&amp;quot;&amp;gt;&lt;br /&gt;
Burn the ISO onto a blank CD using your favorite CD burning software.&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;float:left; font-size:30px; font-weight:bold;&amp;quot;&amp;gt;&lt;br /&gt;
3rd&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;margin-left:65px; background-color:#9faecc; border-style:solid; border-color:#324065; border-width:0px; border-left-width:5px; min-height:55px; padding:5px;&amp;quot;&amp;gt;&lt;br /&gt;
Boot from the CD, login as root with no password, and voilà! Enjoy Alpine Linux!&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
{{Tip|One of the first commands you might want to use is `setup-alpine`}}&lt;br /&gt;
{{Tip|For RAM-based installs, continue by reading about [[Alpine local backup|Alpine Local Backup]]. Otherwise, for HDD-based installs, etc., continue reading one of the documents below.}}&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Installation Handbook =&lt;br /&gt;
&lt;br /&gt;
* [[Installing Alpine on HDD overwriting everything ]] &#039;&#039;(Quick and dirty install on a new machine)&#039;&#039;&lt;br /&gt;
* [[Installing Alpine on HDD dualbooting]]&lt;br /&gt;
* [[Install to disk]]&lt;br /&gt;
* [[Installing Alpine on USB]]&lt;br /&gt;
* [[Installing Alpine on Compact Flash]]&lt;br /&gt;
* [[Installing Alpine on a virtual machine]]&lt;br /&gt;
* [[Installing Alpine Linux in a chroot]]&lt;br /&gt;
* [[Upgrading Alpine]]&lt;/div&gt;</summary>
		<author><name>Forth</name></author>
	</entry>
	<entry>
		<id>https://wiki.alpinelinux.org/w/index.php?title=Install_to_disk&amp;diff=5671</id>
		<title>Install to disk</title>
		<link rel="alternate" type="text/html" href="https://wiki.alpinelinux.org/w/index.php?title=Install_to_disk&amp;diff=5671"/>
		<updated>2011-08-30T19:10:45Z</updated>

		<summary type="html">&lt;p&gt;Forth: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Note|This document covers 2.x.x release.}}&lt;br /&gt;
For 1.8.x and older please see [[Native Harddisk Install 1.6]]&lt;br /&gt;
&lt;br /&gt;
== Installation ==&lt;br /&gt;
Run &#039;&#039;setup-alpine&#039;&#039; to configure the keyboard, hostname and networking.&lt;br /&gt;
&lt;br /&gt;
{{Cmd|setup-alpine}}&lt;br /&gt;
&lt;br /&gt;
Create partitions with fdisk. &lt;br /&gt;
&lt;br /&gt;
{{Cmd|fdisk /dev/sda}}&lt;br /&gt;
&lt;br /&gt;
You should have 2 partitions: /dev/sda1 as &amp;quot;Linux&amp;quot; (type 83) and /dev/sda2 as &amp;quot;linux swap&amp;quot; (type 82). The /dev/sda1 must be bootable (command &amp;quot;a&amp;quot; within fdisk).&lt;br /&gt;
&lt;br /&gt;
Install needed programs for the setup &lt;br /&gt;
&lt;br /&gt;
{{Cmd|apk add e2fsprogs syslinux mkinitfs}}&lt;br /&gt;
&lt;br /&gt;
Create filesystem and swap &lt;br /&gt;
&lt;br /&gt;
{{Cmd|mkfs.ext4 /dev/sda1&lt;br /&gt;
mkswap /dev/sda2}}&lt;br /&gt;
&lt;br /&gt;
Mount file-system &lt;br /&gt;
&lt;br /&gt;
{{Cmd|mount -t ext4 /dev/sda1 /mnt}}&lt;br /&gt;
&lt;br /&gt;
Clone the current running config created by setup-alpine (hostname, networking root password)&lt;br /&gt;
&lt;br /&gt;
{{Cmd|&amp;lt;nowiki&amp;gt;lbu package - | tar -C /mnt -zx&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
&lt;br /&gt;
Install base packages on harddisk&lt;br /&gt;
&lt;br /&gt;
{{Cmd|&amp;lt;nowiki&amp;gt;apk add --root=/mnt --initdb apk-tools alpine-baselayout alpine-conf linux-grsec busybox-initscripts acct&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
&lt;br /&gt;
Create the repositories list. In this example we use the cdrom as repository:&lt;br /&gt;
&lt;br /&gt;
{{Cmd|mkdir -p /mnt/etc/apk&lt;br /&gt;
echo &amp;quot;/media/cdrom/packages/core&amp;quot; &amp;gt;&amp;gt; /mnt/etc/apk/repositories&lt;br /&gt;
echo &amp;quot;/media/cdrom/packages/extra&amp;quot; &amp;gt;&amp;gt; /mnt/etc/apk/repositories}}&lt;br /&gt;
&lt;br /&gt;
Append the / and swap to fstab:&lt;br /&gt;
{{Cmd|echo -e &amp;quot;/dev/sda1 /    ext4  defaults 1 1&amp;quot; &amp;amp;gt;&amp;amp;gt; /mnt/etc/fstab&lt;br /&gt;
echo -e &amp;quot;/dev/sda2 none swap  sw       0 0&amp;quot; &amp;amp;gt;&amp;amp;gt; /mnt/etc/fstab}}&lt;br /&gt;
&lt;br /&gt;
Configure the boot loader, extlinux. We use the provided syslinux as base.&lt;br /&gt;
&lt;br /&gt;
{{Cmd|cp /media/cdrom/syslinux.cf /mnt/boot/extlinux.conf&lt;br /&gt;
vi /mnt/boot/extlinux.conf}}&lt;br /&gt;
&lt;br /&gt;
It should contain something like: &lt;br /&gt;
 timeout 20&lt;br /&gt;
 prompt 1&lt;br /&gt;
 default grsec&lt;br /&gt;
 label grsec&lt;br /&gt;
     kernel /boot/grsec&lt;br /&gt;
     append initrd=/boot/grsec.gz root=/dev/sda1 modules=ext4 quiet&lt;br /&gt;
&lt;br /&gt;
Install the bootloader:&lt;br /&gt;
{{Cmd|extlinux -i /mnt/boot}}&lt;br /&gt;
&lt;br /&gt;
Install syslinux bootloader at the beginning of the MBR so its bootable (note that its sda and not sda1)&lt;br /&gt;
&lt;br /&gt;
{{Cmd|&amp;lt;nowiki&amp;gt;dd if=/usr/share/syslinux/mbr.bin of=/dev/sda&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
&lt;br /&gt;
Unmount, remove cdrom, and reboot. (If you can&#039;t eject, just remove it manually as the machine reboots) &lt;br /&gt;
&lt;br /&gt;
{{Cmd|umount /mnt&lt;br /&gt;
umount /.modloop&lt;br /&gt;
eject &lt;br /&gt;
reboot}}&lt;br /&gt;
&lt;br /&gt;
After reboot, you should be able to log in as root with the password you created in &amp;lt;tt&amp;gt;setup-alpine&amp;lt;/tt&amp;gt;.&lt;/div&gt;</summary>
		<author><name>Forth</name></author>
	</entry>
	<entry>
		<id>https://wiki.alpinelinux.org/w/index.php?title=Install_to_disk&amp;diff=5670</id>
		<title>Install to disk</title>
		<link rel="alternate" type="text/html" href="https://wiki.alpinelinux.org/w/index.php?title=Install_to_disk&amp;diff=5670"/>
		<updated>2011-08-30T12:25:17Z</updated>

		<summary type="html">&lt;p&gt;Forth: update to ext4 and various misc from real life&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Note|This document covers 1.9.x release.}}&lt;br /&gt;
For 1.8.x and older please see [[Native Harddisk Install 1.6]]&lt;br /&gt;
&lt;br /&gt;
== Installation ==&lt;br /&gt;
Run &#039;&#039;setup-alpine&#039;&#039; to configure the keyboard, hostname and networking.&lt;br /&gt;
&lt;br /&gt;
{{Cmd|setup-alpine}}&lt;br /&gt;
&lt;br /&gt;
Create partitions with fdisk. &lt;br /&gt;
&lt;br /&gt;
{{Cmd|fdisk /dev/sda}}&lt;br /&gt;
&lt;br /&gt;
You should have 2 partitions: /dev/sda1 as &amp;quot;Linux&amp;quot; (type 83) and /dev/sda2 as &amp;quot;linux swap&amp;quot; (type 82). The /dev/sda1 should be bootable.&lt;br /&gt;
&lt;br /&gt;
Install needed programs for the setup &lt;br /&gt;
&lt;br /&gt;
{{Cmd|apk add e2fsprogs syslinux mkinitfs}}&lt;br /&gt;
&lt;br /&gt;
Create filesystem and swap &lt;br /&gt;
&lt;br /&gt;
{{Cmd|mkfs.ext4 /dev/sda1&lt;br /&gt;
mkswap /dev/sda2}}&lt;br /&gt;
&lt;br /&gt;
Mount file-system &lt;br /&gt;
&lt;br /&gt;
{{Cmd|mount -t ext4 /dev/sda1 /mnt}}&lt;br /&gt;
&lt;br /&gt;
Clone the current running config created by setup-alpine (hostname, networking root password)&lt;br /&gt;
&lt;br /&gt;
{{Cmd|&amp;lt;nowiki&amp;gt;lbu package - | tar -C /mnt -zx&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
&lt;br /&gt;
Install base packages on harddisk&lt;br /&gt;
&lt;br /&gt;
{{Cmd|&amp;lt;nowiki&amp;gt;apk add --root=/mnt --initdb apk-tools alpine-baselayout alpine-conf linux-grsec busybox-initscripts acct&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
&lt;br /&gt;
Create the repositories list. In this example we use the cdrom as repository:&lt;br /&gt;
&lt;br /&gt;
{{Cmd|mkdir -p /mnt/etc/apk&lt;br /&gt;
echo &amp;quot;/media/cdrom/packages/core&amp;quot; &amp;gt;&amp;gt; /mnt/etc/apk/repositories&lt;br /&gt;
echo &amp;quot;/media/cdrom/packages/extra&amp;quot; &amp;gt;&amp;gt; /mnt/etc/apk/repositories}}&lt;br /&gt;
&lt;br /&gt;
Append the / and swap to fstab:&lt;br /&gt;
{{Cmd|echo -e &amp;quot;/dev/sda1 /    ext4  defaults 1 1&amp;quot; &amp;amp;gt;&amp;amp;gt; /mnt/etc/fstab&lt;br /&gt;
echo -e &amp;quot;/dev/sda2 none swap  sw       0 0&amp;quot; &amp;amp;gt;&amp;amp;gt; /mnt/etc/fstab}}&lt;br /&gt;
&lt;br /&gt;
Configure the boot loader, extlinux. We use sthe provided syslinux as base.&lt;br /&gt;
&lt;br /&gt;
{{Cmd|cp /media/cdrom/syslinux.cf /mnt/boot/extlinux.conf&lt;br /&gt;
vi /mnt/boot/extlinux.conf}}&lt;br /&gt;
&lt;br /&gt;
It should contain something like: &lt;br /&gt;
 timeout 20&lt;br /&gt;
 prompt 1&lt;br /&gt;
 default grsec&lt;br /&gt;
 label grsec&lt;br /&gt;
     kernel /boot/grsec&lt;br /&gt;
     append initrd=/boot/grsec.gz root=/dev/sda1 modules=ext4 quiet&lt;br /&gt;
&lt;br /&gt;
Install the bootloader:&lt;br /&gt;
{{Cmd|extlinux -i /mnt/boot}}&lt;br /&gt;
&lt;br /&gt;
Fix the MBR so its bootable (note that its sda and not sda1)&lt;br /&gt;
&lt;br /&gt;
{{Cmd|&amp;lt;nowiki&amp;gt;dd if=/usr/share/syslinux/mbr.bin of=/dev/sda&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
&lt;br /&gt;
Unmount, remove cdrom, and reboot. (If you can&#039;t eject, just remove it manually as the machine reboots) &lt;br /&gt;
&lt;br /&gt;
{{Cmd|umount /mnt&lt;br /&gt;
umount /.modloop&lt;br /&gt;
eject &lt;br /&gt;
reboot}}&lt;br /&gt;
&lt;br /&gt;
After reboot, you should be able to log in as root with the password you created in &amp;lt;tt&amp;gt;setup-alpine&amp;lt;/tt&amp;gt;.&lt;/div&gt;</summary>
		<author><name>Forth</name></author>
	</entry>
	<entry>
		<id>https://wiki.alpinelinux.org/w/index.php?title=Xen_Dom0&amp;diff=5655</id>
		<title>Xen Dom0</title>
		<link rel="alternate" type="text/html" href="https://wiki.alpinelinux.org/w/index.php?title=Xen_Dom0&amp;diff=5655"/>
		<updated>2011-08-23T14:48:17Z</updated>

		<summary type="html">&lt;p&gt;Forth: load xen-gntdev module&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;So before anything else verify that you can &#039;&#039;&#039;reliably&#039;&#039;&#039; log into your Alpine box through [[Setting_up_a_ssh-server|SSH]], because with some video chipset (intel in my case) xen will blank your screen so you will have to use SSH.&lt;br /&gt;
&lt;br /&gt;
Then upgrade your setup to [[Upgrading_to_Edge|Edge/testing]] (as of the date of writing, Xen is only available in Edge). Install Xen:&lt;br /&gt;
&lt;br /&gt;
{{Cmd|apk add xen}}&lt;br /&gt;
&lt;br /&gt;
Modify your extlinux.cfg (credits: http://lists.alpinelinux.org/alpine-devel/1406.html)&lt;br /&gt;
since video card is not working for now, we will use a serial console:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
SERIAL 0 115200 &lt;br /&gt;
DEFAULT menu.c32&lt;br /&gt;
PROMPT 0&lt;br /&gt;
MENU TITLE Alpine/Linux Boot Menu&lt;br /&gt;
MENU HIDDEN&lt;br /&gt;
MENU AUTOBOOT Alpine will be booted automatically in # seconds.&lt;br /&gt;
TIMEOUT 50&lt;br /&gt;
LABEL 0&lt;br /&gt;
  MENU DEFAULT&lt;br /&gt;
  MENU LABEL Linux 2.6.38.8-vs2.3.0.37-rc17&lt;br /&gt;
  KERNEL vmlinuz-2.6.38.8-vs2.3.0.37-rc17&lt;br /&gt;
  APPEND initrd=initramfs-2.6.38.8-vs2.3.0.37-rc17 root=UUID=f40e340b-ea49-445b-81c0-4d7104b56662 modules=sd-mod,usb-storage,ext4 quiet&lt;br /&gt;
&lt;br /&gt;
LABEL 1&lt;br /&gt;
  MENU LABEL Linux 2.6.36.3-scst&lt;br /&gt;
  KERNEL vmlinuz-2.6.36.3-scst&lt;br /&gt;
  APPEND initrd=initramfs-2.6.36.3-scst root=UUID=f40e340b-ea49-445b-81c0-4d7104b56662 modules=sd-mod,usb-storage,ext4 quiet&lt;br /&gt;
&lt;br /&gt;
LABEL 2&lt;br /&gt;
  MENU LABEL Linux 2.6.38.8-grsec&lt;br /&gt;
  KERNEL vmlinuz-2.6.38.8-grsec&lt;br /&gt;
  APPEND initrd=initramfs-2.6.38.8-grsec root=UUID=f40e340b-ea49-445b-81c0-4d7104b56662 modules=sd-mod,usb-storage,ext4 quiet&lt;br /&gt;
&lt;br /&gt;
LABEL 3&lt;br /&gt;
  MENU LABEL XEN&lt;br /&gt;
  KERNEL mboot.c32&lt;br /&gt;
  APPEND /boot/xen-4.gz loglvl=all guest_loglvl=all com1=115200,8n1 console=com1 dom0_mem=256M --- /boot/vmlinuz-grsec root=UUID=f40e340b-ea49-445b-81c0-4d7104b56662 modules=sd-mod,usb-storage,ext4 console=hvc0 earlyprintk=xen nomodeset --- /boot/initramfs-grsec&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Of course replace root=UUID= with &#039;&#039;&#039;your&#039;&#039;&#039; UUID in yours.&lt;br /&gt;
&lt;br /&gt;
xl info won&#039;t work&lt;br /&gt;
&lt;br /&gt;
Start xecommons:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
alpine:/boot# /etc/init.d/xencommons start&lt;br /&gt;
Starting xenstored...FATAL: Failed to open evtchn device: No such file or directory&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
well this will fail but xl info will work anyway&lt;br /&gt;
&lt;br /&gt;
Oh but wait, evtchn device is built in the kernel, so why is there no /dev/xen/evtch file ?&lt;br /&gt;
let&#039;s start udev ! ;)&lt;br /&gt;
{{Cmd|rc-service udev start}}&lt;br /&gt;
&lt;br /&gt;
That&#039;s all folks !&lt;br /&gt;
&lt;br /&gt;
on going debug:&lt;br /&gt;
vi /etc/rc.conf&lt;br /&gt;
rc_sys=&amp;quot;xen0&amp;quot;&lt;br /&gt;
why ?&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Commands recap:&lt;br /&gt;
{{Cmd|&lt;br /&gt;
apk add xen&lt;br /&gt;
apk add udev&lt;br /&gt;
rc-service udev start ; rc-service udev-postmount start&lt;br /&gt;
rc-service xencommons start&lt;br /&gt;
}}&lt;br /&gt;
If you want &amp;quot;xm&amp;quot; command&lt;br /&gt;
{{Cmd|rc-service xend start}}&lt;br /&gt;
&lt;br /&gt;
So let&#039;s install services at boot time :&lt;br /&gt;
{{Cmd|&lt;br /&gt;
rc-update add udev sysinit&lt;br /&gt;
rc-update add udev-postmount default&lt;br /&gt;
rc-update add xencommons&lt;br /&gt;
rc-update add xend&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
since we use a serial line, let&#039;a add a serial console prompt, modify your /etc/inittab accordinly:&lt;br /&gt;
&lt;br /&gt;
# Put a getty on the serial port&lt;br /&gt;
#ttyS0::respawn:/sbin/getty -L ttyS0 115200 vt100&lt;br /&gt;
hvc0::respawn:/sbin/getty -L hvc0 115200 vt100&lt;br /&gt;
&lt;br /&gt;
hvc0 is Xen console output, where we have already redirected the kernel messages.&lt;br /&gt;
To switch to Xen console, type three time &amp;quot;Ctrl+a&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Now you can configure your guest, but before don&#039;t forget to load xen-gntdev kernel module:&lt;br /&gt;
modprobe xen-gntdev&lt;br /&gt;
echo &amp;quot;xen-gntdev&amp;quot; &amp;gt;&amp;gt; /etc/modules&lt;/div&gt;</summary>
		<author><name>Forth</name></author>
	</entry>
	<entry>
		<id>https://wiki.alpinelinux.org/w/index.php?title=Xen_Dom0&amp;diff=5654</id>
		<title>Xen Dom0</title>
		<link rel="alternate" type="text/html" href="https://wiki.alpinelinux.org/w/index.php?title=Xen_Dom0&amp;diff=5654"/>
		<updated>2011-08-22T17:05:02Z</updated>

		<summary type="html">&lt;p&gt;Forth: serial tty&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;So before anything else verify that you can &#039;&#039;&#039;reliably&#039;&#039;&#039; log into your Alpine box through [[Setting_up_a_ssh-server|SSH]], because with some video chipset (intel in my case) xen will blank your screen so you will have to use SSH.&lt;br /&gt;
&lt;br /&gt;
Then upgrade your setup to [[Upgrading_to_Edge|Edge/testing]] (as of the date of writing, Xen is only available in Edge). Install Xen:&lt;br /&gt;
&lt;br /&gt;
{{Cmd|apk add xen}}&lt;br /&gt;
&lt;br /&gt;
Modify your extlinux.cfg (credits: http://lists.alpinelinux.org/alpine-devel/1406.html)&lt;br /&gt;
since video card is not working for now, we will use a serial console:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
SERIAL 0 115200 &lt;br /&gt;
DEFAULT menu.c32&lt;br /&gt;
PROMPT 0&lt;br /&gt;
MENU TITLE Alpine/Linux Boot Menu&lt;br /&gt;
MENU HIDDEN&lt;br /&gt;
MENU AUTOBOOT Alpine will be booted automatically in # seconds.&lt;br /&gt;
TIMEOUT 50&lt;br /&gt;
LABEL 0&lt;br /&gt;
  MENU DEFAULT&lt;br /&gt;
  MENU LABEL Linux 2.6.38.8-vs2.3.0.37-rc17&lt;br /&gt;
  KERNEL vmlinuz-2.6.38.8-vs2.3.0.37-rc17&lt;br /&gt;
  APPEND initrd=initramfs-2.6.38.8-vs2.3.0.37-rc17 root=UUID=f40e340b-ea49-445b-81c0-4d7104b56662 modules=sd-mod,usb-storage,ext4 quiet&lt;br /&gt;
&lt;br /&gt;
LABEL 1&lt;br /&gt;
  MENU LABEL Linux 2.6.36.3-scst&lt;br /&gt;
  KERNEL vmlinuz-2.6.36.3-scst&lt;br /&gt;
  APPEND initrd=initramfs-2.6.36.3-scst root=UUID=f40e340b-ea49-445b-81c0-4d7104b56662 modules=sd-mod,usb-storage,ext4 quiet&lt;br /&gt;
&lt;br /&gt;
LABEL 2&lt;br /&gt;
  MENU LABEL Linux 2.6.38.8-grsec&lt;br /&gt;
  KERNEL vmlinuz-2.6.38.8-grsec&lt;br /&gt;
  APPEND initrd=initramfs-2.6.38.8-grsec root=UUID=f40e340b-ea49-445b-81c0-4d7104b56662 modules=sd-mod,usb-storage,ext4 quiet&lt;br /&gt;
&lt;br /&gt;
LABEL 3&lt;br /&gt;
  MENU LABEL XEN&lt;br /&gt;
  KERNEL mboot.c32&lt;br /&gt;
  APPEND /boot/xen-4.gz loglvl=all guest_loglvl=all com1=115200,8n1 console=com1 dom0_mem=256M --- /boot/vmlinuz-grsec root=UUID=f40e340b-ea49-445b-81c0-4d7104b56662 modules=sd-mod,usb-storage,ext4 console=hvc0 earlyprintk=xen nomodeset --- /boot/initramfs-grsec&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Of course replace root=UUID= with &#039;&#039;&#039;your&#039;&#039;&#039; UUID in yours.&lt;br /&gt;
&lt;br /&gt;
xl info won&#039;t work&lt;br /&gt;
&lt;br /&gt;
Start xecommons:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
alpine:/boot# /etc/init.d/xencommons start&lt;br /&gt;
Starting xenstored...FATAL: Failed to open evtchn device: No such file or directory&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
well this will fail but xl info will work anyway&lt;br /&gt;
&lt;br /&gt;
Oh but wait, evtchn device is built in the kernel, so why is there no /dev/xen/evtch file ?&lt;br /&gt;
let&#039;s start udev ! ;)&lt;br /&gt;
{{Cmd|rc-service udev start}}&lt;br /&gt;
&lt;br /&gt;
That&#039;s all folks !&lt;br /&gt;
&lt;br /&gt;
on going debug:&lt;br /&gt;
vi /etc/rc.conf&lt;br /&gt;
rc_sys=&amp;quot;xen0&amp;quot;&lt;br /&gt;
why ?&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Commands recap:&lt;br /&gt;
{{Cmd|&lt;br /&gt;
apk add xen&lt;br /&gt;
apk add udev&lt;br /&gt;
rc-service udev start ; rc-service udev-postmount start&lt;br /&gt;
rc-service xencommons start&lt;br /&gt;
}}&lt;br /&gt;
If you want &amp;quot;xm&amp;quot; command&lt;br /&gt;
{{Cmd|rc-service xend start}}&lt;br /&gt;
&lt;br /&gt;
So let&#039;s install services at boot time :&lt;br /&gt;
{{Cmd|&lt;br /&gt;
rc-update add udev sysinit&lt;br /&gt;
rc-update add udev-postmount default&lt;br /&gt;
rc-update add xencommons&lt;br /&gt;
rc-update add xend&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
since we use a serial line, let&#039;a add a serial console prompt, modify your /etc/inittab accordinly:&lt;br /&gt;
&lt;br /&gt;
# Put a getty on the serial port&lt;br /&gt;
#ttyS0::respawn:/sbin/getty -L ttyS0 115200 vt100&lt;br /&gt;
hvc0::respawn:/sbin/getty -L hvc0 115200 vt100&lt;br /&gt;
&lt;br /&gt;
hvc0 is Xen console output, where we have already redirected the kernel messages.&lt;br /&gt;
To switch to Xen console, type three time &amp;quot;Ctrl+a&amp;quot;&lt;/div&gt;</summary>
		<author><name>Forth</name></author>
	</entry>
	<entry>
		<id>https://wiki.alpinelinux.org/w/index.php?title=Xen_Dom0&amp;diff=5653</id>
		<title>Xen Dom0</title>
		<link rel="alternate" type="text/html" href="https://wiki.alpinelinux.org/w/index.php?title=Xen_Dom0&amp;diff=5653"/>
		<updated>2011-08-22T15:41:50Z</updated>

		<summary type="html">&lt;p&gt;Forth: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;So before anything else verify that you can &#039;&#039;&#039;reliably&#039;&#039;&#039; log into your Alpine box through [[Setting_up_a_ssh-server|SSH]], because with some video chipset (intel in my case) xen will blank your screen so you will have to use SSH.&lt;br /&gt;
&lt;br /&gt;
Then upgrade your setup to [[Upgrading_to_Edge|Edge/testing]] (as of the date of writing, Xen is only available in Edge). Install Xen:&lt;br /&gt;
&lt;br /&gt;
{{Cmd|apk add xen}}&lt;br /&gt;
&lt;br /&gt;
Modify your extlinux.cfg (credits: http://lists.alpinelinux.org/alpine-devel/1406.html)&lt;br /&gt;
since video card is not working for now, we will use a serial console:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
SERIAL 0 115200 &lt;br /&gt;
DEFAULT menu.c32&lt;br /&gt;
PROMPT 0&lt;br /&gt;
MENU TITLE Alpine/Linux Boot Menu&lt;br /&gt;
MENU HIDDEN&lt;br /&gt;
MENU AUTOBOOT Alpine will be booted automatically in # seconds.&lt;br /&gt;
TIMEOUT 50&lt;br /&gt;
LABEL 0&lt;br /&gt;
  MENU DEFAULT&lt;br /&gt;
  MENU LABEL Linux 2.6.38.8-vs2.3.0.37-rc17&lt;br /&gt;
  KERNEL vmlinuz-2.6.38.8-vs2.3.0.37-rc17&lt;br /&gt;
  APPEND initrd=initramfs-2.6.38.8-vs2.3.0.37-rc17 root=UUID=f40e340b-ea49-445b-81c0-4d7104b56662 modules=sd-mod,usb-storage,ext4 quiet&lt;br /&gt;
&lt;br /&gt;
LABEL 1&lt;br /&gt;
  MENU LABEL Linux 2.6.36.3-scst&lt;br /&gt;
  KERNEL vmlinuz-2.6.36.3-scst&lt;br /&gt;
  APPEND initrd=initramfs-2.6.36.3-scst root=UUID=f40e340b-ea49-445b-81c0-4d7104b56662 modules=sd-mod,usb-storage,ext4 quiet&lt;br /&gt;
&lt;br /&gt;
LABEL 2&lt;br /&gt;
  MENU LABEL Linux 2.6.38.8-grsec&lt;br /&gt;
  KERNEL vmlinuz-2.6.38.8-grsec&lt;br /&gt;
  APPEND initrd=initramfs-2.6.38.8-grsec root=UUID=f40e340b-ea49-445b-81c0-4d7104b56662 modules=sd-mod,usb-storage,ext4 quiet&lt;br /&gt;
&lt;br /&gt;
LABEL 3&lt;br /&gt;
  MENU LABEL XEN&lt;br /&gt;
  KERNEL mboot.c32&lt;br /&gt;
  APPEND /boot/xen-4.gz loglvl=all guest_loglvl=all com1=115200,8n1 console=com1 dom0_mem=256M --- /boot/vmlinuz-grsec root=UUID=f40e340b-ea49-445b-81c0-4d7104b56662 modules=sd-mod,usb-storage,ext4 console=hvc0 earlyprintk=xen nomodeset --- /boot/initramfs-grsec&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Of course replace root=UUID= with &#039;&#039;&#039;your&#039;&#039;&#039; UUID in yours.&lt;br /&gt;
&lt;br /&gt;
xl info won&#039;t work&lt;br /&gt;
&lt;br /&gt;
Start xecommons:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
alpine:/boot# /etc/init.d/xencommons start&lt;br /&gt;
Starting xenstored...FATAL: Failed to open evtchn device: No such file or directory&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
well this will fail but xl info will work anyway&lt;br /&gt;
&lt;br /&gt;
Oh but wait, evtchn device is built in the kernel, so why is there no /dev/xen/evtch file ?&lt;br /&gt;
let&#039;s start udev ! ;)&lt;br /&gt;
{{Cmd|rc-service udev start}}&lt;br /&gt;
&lt;br /&gt;
That&#039;s all folks !&lt;br /&gt;
&lt;br /&gt;
on going debug:&lt;br /&gt;
vi /etc/rc.conf&lt;br /&gt;
rc_sys=&amp;quot;xen0&amp;quot;&lt;br /&gt;
why ?&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Commands recap:&lt;br /&gt;
{{Cmd|&lt;br /&gt;
apk add xen&lt;br /&gt;
apk add udev&lt;br /&gt;
rc-service udev start ; rc-service udev-postmount start&lt;br /&gt;
rc-service xencommons start&lt;br /&gt;
}}&lt;br /&gt;
If you want &amp;quot;xm&amp;quot; command&lt;br /&gt;
{{Cmd|rc-service xend start}}&lt;br /&gt;
&lt;br /&gt;
So let&#039;s install services at boot time :&lt;br /&gt;
{{Cmd|&lt;br /&gt;
rc-update add udev sysinit&lt;br /&gt;
rc-update add udev-postmount default&lt;br /&gt;
rc-update add xencommons&lt;br /&gt;
rc-update add xend&lt;br /&gt;
}}&lt;/div&gt;</summary>
		<author><name>Forth</name></author>
	</entry>
	<entry>
		<id>https://wiki.alpinelinux.org/w/index.php?title=Xen_Dom0&amp;diff=5652</id>
		<title>Xen Dom0</title>
		<link rel="alternate" type="text/html" href="https://wiki.alpinelinux.org/w/index.php?title=Xen_Dom0&amp;diff=5652"/>
		<updated>2011-08-22T15:40:55Z</updated>

		<summary type="html">&lt;p&gt;Forth: xencommons working after Xen bumped to 4.1.1&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;So before anything else verify that you can &#039;&#039;&#039;reliably&#039;&#039;&#039; log into your Alpine box through [[Setting_up_a_ssh-server|SSH]], because with some video chipset (intel in my case) xen will blank your screen so you will have to use SSH.&lt;br /&gt;
&lt;br /&gt;
Then upgrade your setup to [[Upgrading_to_Edge|Edge/testing]] (as of the date of writing, Xen is only available in Edge). Install Xen:&lt;br /&gt;
&lt;br /&gt;
{{Cmd|apk add xen}}&lt;br /&gt;
&lt;br /&gt;
Modify your extlinux.cfg (credits: http://lists.alpinelinux.org/alpine-devel/1406.html)&lt;br /&gt;
since video card is not working for now, we will use a serial console:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
SERIAL 0 115200 &lt;br /&gt;
DEFAULT menu.c32&lt;br /&gt;
PROMPT 0&lt;br /&gt;
MENU TITLE Alpine/Linux Boot Menu&lt;br /&gt;
MENU HIDDEN&lt;br /&gt;
MENU AUTOBOOT Alpine will be booted automatically in # seconds.&lt;br /&gt;
TIMEOUT 50&lt;br /&gt;
LABEL 0&lt;br /&gt;
  MENU DEFAULT&lt;br /&gt;
  MENU LABEL Linux 2.6.38.8-vs2.3.0.37-rc17&lt;br /&gt;
  KERNEL vmlinuz-2.6.38.8-vs2.3.0.37-rc17&lt;br /&gt;
  APPEND initrd=initramfs-2.6.38.8-vs2.3.0.37-rc17 root=UUID=f40e340b-ea49-445b-81c0-4d7104b56662 modules=sd-mod,usb-storage,ext4 quiet&lt;br /&gt;
&lt;br /&gt;
LABEL 1&lt;br /&gt;
  MENU LABEL Linux 2.6.36.3-scst&lt;br /&gt;
  KERNEL vmlinuz-2.6.36.3-scst&lt;br /&gt;
  APPEND initrd=initramfs-2.6.36.3-scst root=UUID=f40e340b-ea49-445b-81c0-4d7104b56662 modules=sd-mod,usb-storage,ext4 quiet&lt;br /&gt;
&lt;br /&gt;
LABEL 2&lt;br /&gt;
  MENU LABEL Linux 2.6.38.8-grsec&lt;br /&gt;
  KERNEL vmlinuz-2.6.38.8-grsec&lt;br /&gt;
  APPEND initrd=initramfs-2.6.38.8-grsec root=UUID=f40e340b-ea49-445b-81c0-4d7104b56662 modules=sd-mod,usb-storage,ext4 quiet&lt;br /&gt;
&lt;br /&gt;
LABEL 3&lt;br /&gt;
  MENU LABEL XEN&lt;br /&gt;
  KERNEL mboot.c32&lt;br /&gt;
  APPEND /boot/xen-4.gz loglvl=all guest_loglvl=all com1=115200,8n1 console=com1 dom0_mem=256M --- /boot/vmlinuz-grsec root=UUID=f40e340b-ea49-445b-81c0-4d7104b56662 modules=sd-mod,usb-storage,ext4 console=hvc0 earlyprintk=xen nomodeset --- /boot/initramfs-grsec&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Of course replace root=UUID= with &#039;&#039;&#039;your&#039;&#039;&#039; UUID in yours.&lt;br /&gt;
&lt;br /&gt;
xl info won&#039;t work&lt;br /&gt;
&lt;br /&gt;
Start xecommons:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
alpine:/boot# /etc/init.d/xencommons start&lt;br /&gt;
Starting xenstored...FATAL: Failed to open evtchn device: No such file or directory&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
well this will fail but xl info will work anyway&lt;br /&gt;
&lt;br /&gt;
Oh but wait, evtchn device is built in the kernel, so why is there no /dev/xen/evtch file ?&lt;br /&gt;
let&#039;s start udev ! ;)&lt;br /&gt;
{{Cmd|rc-service udev start}}&lt;br /&gt;
&lt;br /&gt;
That&#039;s all folks !&lt;br /&gt;
&lt;br /&gt;
on going debug:&lt;br /&gt;
vi /etc/rc.conf&lt;br /&gt;
rc_sys=&amp;quot;xen0&amp;quot;&lt;br /&gt;
why ?&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Commands recap:&lt;br /&gt;
{{Cmd|&lt;br /&gt;
apk add xen&lt;br /&gt;
apk add udev&lt;br /&gt;
rc-service udev start ; rc-service udev-postmount start&lt;br /&gt;
}}&lt;br /&gt;
If you want &amp;quot;xm&amp;quot; command&lt;br /&gt;
{{Cmd|rc-service xend start}}&lt;br /&gt;
&lt;br /&gt;
So let&#039;s install services at boot time :&lt;br /&gt;
{{Cmd|&lt;br /&gt;
rc-update add udev sysinit&lt;br /&gt;
rc-update add udev-postmount default&lt;br /&gt;
rc-update add xencommons&lt;br /&gt;
rc-update add xend&lt;br /&gt;
}}&lt;/div&gt;</summary>
		<author><name>Forth</name></author>
	</entry>
	<entry>
		<id>https://wiki.alpinelinux.org/w/index.php?title=Xen_Dom0&amp;diff=5651</id>
		<title>Xen Dom0</title>
		<link rel="alternate" type="text/html" href="https://wiki.alpinelinux.org/w/index.php?title=Xen_Dom0&amp;diff=5651"/>
		<updated>2011-08-22T15:19:47Z</updated>

		<summary type="html">&lt;p&gt;Forth: update / serial console / more accurate infos / almost working&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;So before anything else verify that you can &#039;&#039;&#039;reliably&#039;&#039;&#039; log into your Alpine box through [[Setting_up_a_ssh-server|SSH]], because with some video chipset (intel in my case) xen will blank your screen so you will have to use SSH.&lt;br /&gt;
&lt;br /&gt;
Then upgrade your setup to [[Upgrading_to_Edge|Edge/testing]] (as of the date of writing, Xen is only available in Edge). Install Xen:&lt;br /&gt;
&lt;br /&gt;
{{Cmd|apk add xen}}&lt;br /&gt;
&lt;br /&gt;
Modify your extlinux.cfg (credits: http://lists.alpinelinux.org/alpine-devel/1406.html)&lt;br /&gt;
since video card is not working for now, we will use a serial console:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
SERIAL 0 115200 &lt;br /&gt;
DEFAULT menu.c32&lt;br /&gt;
PROMPT 0&lt;br /&gt;
MENU TITLE Alpine/Linux Boot Menu&lt;br /&gt;
MENU HIDDEN&lt;br /&gt;
MENU AUTOBOOT Alpine will be booted automatically in # seconds.&lt;br /&gt;
TIMEOUT 50&lt;br /&gt;
LABEL 0&lt;br /&gt;
  MENU DEFAULT&lt;br /&gt;
  MENU LABEL Linux 2.6.38.8-vs2.3.0.37-rc17&lt;br /&gt;
  KERNEL vmlinuz-2.6.38.8-vs2.3.0.37-rc17&lt;br /&gt;
  APPEND initrd=initramfs-2.6.38.8-vs2.3.0.37-rc17 root=UUID=f40e340b-ea49-445b-81c0-4d7104b56662 modules=sd-mod,usb-storage,ext4 quiet&lt;br /&gt;
&lt;br /&gt;
LABEL 1&lt;br /&gt;
  MENU LABEL Linux 2.6.36.3-scst&lt;br /&gt;
  KERNEL vmlinuz-2.6.36.3-scst&lt;br /&gt;
  APPEND initrd=initramfs-2.6.36.3-scst root=UUID=f40e340b-ea49-445b-81c0-4d7104b56662 modules=sd-mod,usb-storage,ext4 quiet&lt;br /&gt;
&lt;br /&gt;
LABEL 2&lt;br /&gt;
  MENU LABEL Linux 2.6.38.8-grsec&lt;br /&gt;
  KERNEL vmlinuz-2.6.38.8-grsec&lt;br /&gt;
  APPEND initrd=initramfs-2.6.38.8-grsec root=UUID=f40e340b-ea49-445b-81c0-4d7104b56662 modules=sd-mod,usb-storage,ext4 quiet&lt;br /&gt;
&lt;br /&gt;
LABEL 3&lt;br /&gt;
  MENU LABEL XEN&lt;br /&gt;
  KERNEL mboot.c32&lt;br /&gt;
  APPEND /boot/xen-4.gz loglvl=all guest_loglvl=all com1=115200,8n1 console=com1 dom0_mem=256M --- /boot/vmlinuz-grsec root=UUID=f40e340b-ea49-445b-81c0-4d7104b56662 modules=sd-mod,usb-storage,ext4 console=hvc0 earlyprintk=xen nomodeset --- /boot/initramfs-grsec&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Of course replace root=UUID= with &#039;&#039;&#039;your&#039;&#039;&#039; UUID in yours.&lt;br /&gt;
&lt;br /&gt;
xl info won&#039;t work&lt;br /&gt;
&lt;br /&gt;
Start xecommons:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
alpine:/boot# /etc/init.d/xencommons start&lt;br /&gt;
Starting xenstored...FATAL: Failed to open evtchn device: No such file or directory&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
well this will fail but xl info will work anyway&lt;br /&gt;
&lt;br /&gt;
Oh but wait, evtchn device is built in the kernel, so why is there no /dev/xen/evtch file ?&lt;br /&gt;
let&#039;s start udev ! ;)&lt;br /&gt;
{{Cmd|rc-service udev start}}&lt;br /&gt;
&lt;br /&gt;
That&#039;s all folks !&lt;br /&gt;
&lt;br /&gt;
on going debug:&lt;br /&gt;
vi /etc/rc.conf&lt;br /&gt;
rc_sys=&amp;quot;xen0&amp;quot;&lt;br /&gt;
&lt;br /&gt;
and xencommons not launching at boot&lt;/div&gt;</summary>
		<author><name>Forth</name></author>
	</entry>
	<entry>
		<id>https://wiki.alpinelinux.org/w/index.php?title=Xen_Dom0&amp;diff=5649</id>
		<title>Xen Dom0</title>
		<link rel="alternate" type="text/html" href="https://wiki.alpinelinux.org/w/index.php?title=Xen_Dom0&amp;diff=5649"/>
		<updated>2011-08-21T15:18:23Z</updated>

		<summary type="html">&lt;p&gt;Forth: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;So before anything else verify that you can &#039;&#039;&#039;reliably&#039;&#039;&#039; log into your Alpine box through [[Setting_up_a_ssh-server|SSH]], because with some video chipset (intel in my case) xen will blank your screen so you will have to use SSH.&lt;br /&gt;
&lt;br /&gt;
Then upgrade your setup to [[Upgrading_to_Edge|Edge/testing]] (as of the date of writing, Xen is only available in Edge). Install Xen:&lt;br /&gt;
&lt;br /&gt;
{{Cmd|apk add xen}}&lt;br /&gt;
&lt;br /&gt;
Modify your extlinux.cfg: http://lists.alpinelinux.org/alpine-devel/1406.html&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
timeout 20&lt;br /&gt;
prompt 1&lt;br /&gt;
default grsec&lt;br /&gt;
label grsec&lt;br /&gt;
 kernel /boot/vmlinuz-grsec&lt;br /&gt;
 append initrd=/boot/initramfs-grsec root=UUID=f40e340b-ea49-445b-81c0-4d7104b56662 modules=sd-mod,usb-storage,ext4&lt;br /&gt;
label xen&lt;br /&gt;
 kernel mboot.c32&lt;br /&gt;
 append /boot/xen-4.gz console=/dev/null dom0_mem=256M vga=mode-0x0311 --- /boot/vmlinuz-grsec root=UUID=f40e340b-ea49-445b-81c0-4d7104b56662 modules=sd-mod,usb-storage,ext4 vga=785 --- /boot/initramfs-grsec&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Of course replace root=UUID= with &#039;&#039;&#039;your&#039;&#039;&#039; UUID in yours.&lt;br /&gt;
Default menu.c32 can mangle with Xen, further investigation needed, so don&#039;t use for now.&lt;br /&gt;
&lt;br /&gt;
Use the script found here: http://lists.xensource.com/archives/html/xen-devel/2010-03/msg01605.html&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#!/bin/sh&lt;br /&gt;
&lt;br /&gt;
test -d /proc/xen       || exit 0&lt;br /&gt;
test -f /proc/xen/capabilities  || mount -t xenfs xen /proc/xen&lt;br /&gt;
test -f /proc/xen/capabilities  || exit 0&lt;br /&gt;
grep -q &amp;quot;control_d&amp;quot; /proc/xen/capabilities      || exit 0&lt;br /&gt;
&lt;br /&gt;
for module in xen-evtchn evtchn blkbk netbk; do&lt;br /&gt;
         modprobe ${module}&amp;gt;/dev/null 2&amp;gt;&amp;amp;1&lt;br /&gt;
         done&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
xl info won&#039;t work&lt;br /&gt;
&lt;br /&gt;
Start xecommons:&lt;br /&gt;
xencommons  use bash, so install it.&lt;br /&gt;
&lt;br /&gt;
{{Cmd|apk add bash}} (should try sh instead)&lt;br /&gt;
&lt;br /&gt;
alpine:/boot# /etc/init.d/xencommons start&lt;br /&gt;
Starting xenstored...FATAL: Failed to open evtchn device: No such file or directory&lt;br /&gt;
&lt;br /&gt;
well this will fail but xl info will work anyway&lt;br /&gt;
&lt;br /&gt;
Oh but wait, evtchn device is built in the kernel, so why is there no /dev/xen/evtch file ?&lt;br /&gt;
let&#039;s start udev ! ;)&lt;br /&gt;
&lt;br /&gt;
That&#039;s all folks !&lt;br /&gt;
&lt;br /&gt;
vi /etc/rc.conf&lt;br /&gt;
rc_sys=&amp;quot;xen0&amp;quot;&lt;/div&gt;</summary>
		<author><name>Forth</name></author>
	</entry>
	<entry>
		<id>https://wiki.alpinelinux.org/w/index.php?title=Creating_an_Alpine_package&amp;diff=5639</id>
		<title>Creating an Alpine package</title>
		<link rel="alternate" type="text/html" href="https://wiki.alpinelinux.org/w/index.php?title=Creating_an_Alpine_package&amp;diff=5639"/>
		<updated>2011-08-15T06:21:07Z</updated>

		<summary type="html">&lt;p&gt;Forth: /* Installing and configuring the alpine-sdk - developpement with Git added in the reading workflow */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== General ==&lt;br /&gt;
&lt;br /&gt;
This document assumes that you have a working [[Setting up the build environment|build environment]], or use a diskbased alpine installation. &lt;br /&gt;
&lt;br /&gt;
=== The APKBUILDs  ===&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;[http://git.alpinelinux.org/cgit/abuild/ abuild]&#039;&#039; script reads the &#039;&#039;[http://git.alpinelinux.org/cgit/abuild/tree/sample.APKBUILD APKBUILD]&#039;&#039; and executes the steps needed to create a package. &lt;br /&gt;
&lt;br /&gt;
=== The aports tree  ===&lt;br /&gt;
&lt;br /&gt;
The [http://git.alpinelinux.org/cgit/aports aports] tree is a [http://git.alpinelinux.org/cgit/aports/tree directory tree] with many APKBUILDs. Those files are used when building alpine from source. &lt;br /&gt;
&lt;br /&gt;
== Installing and configuring the alpine-sdk  ==&lt;br /&gt;
&lt;br /&gt;
The alpine-sdk is a metapackage that pulls in the most essential packages used to build new packages.&amp;lt;BR&amp;gt;&lt;br /&gt;
Install those packages now: &lt;br /&gt;
&lt;br /&gt;
{{Cmd|apk add alpine-sdk}}&lt;br /&gt;
&lt;br /&gt;
This would be a good time to create a normal user account for you to work in. (You weren&#039;t going to develop as root now, were you!) To create the user:&lt;br /&gt;
&lt;br /&gt;
{{Cmd|adduser &amp;lt;yourusername&amp;gt;}}&lt;br /&gt;
&lt;br /&gt;
To make life easier later, it&#039;s a good idea to add this user to /etc/sudoers. Append the line&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;yourusername&amp;gt;    ALL=(ALL) ALL&lt;br /&gt;
&lt;br /&gt;
using the command:&lt;br /&gt;
&lt;br /&gt;
{{Cmd|visudo}}&lt;br /&gt;
&lt;br /&gt;
Now logout of the root account, and login as &amp;lt;yourusername&amp;gt;. From here on everything can be done in a normal user account, and operations that require superuser privileges can be done with sudo.&lt;br /&gt;
&lt;br /&gt;
The aports tree is in git so before we clone the aports tree we should configure git.&lt;br /&gt;
&lt;br /&gt;
{{Cmd|git config --global user.name &amp;quot;Your Full Name&amp;quot;&lt;br /&gt;
git config --global user.email &amp;quot;your@email.address&amp;quot;}}&lt;br /&gt;
&lt;br /&gt;
Read carefully [[Development using git]] to grasp basic Git operations and configure email patches sending.&lt;br /&gt;
&lt;br /&gt;
Now we can clone the aports tree. &lt;br /&gt;
&lt;br /&gt;
{{Cmd|git clone git://dev.alpinelinux.org/aports}}&lt;br /&gt;
&lt;br /&gt;
Before we start creating or modifying APKBUILD files we need to setup abuild to our system/user. Edit the file abuild.conf to your requirements. Most of the defaults can be left alone, unless you are developing for a custom platform, in which case the comments in the file should guide you. The one field to edit is PACKAGER, so that you can get credit (or blame) for packages you create.&lt;br /&gt;
&lt;br /&gt;
{{Cmd|sudo vi /etc/abuild.conf}}&lt;br /&gt;
&lt;br /&gt;
We also need to prepare the location that the build process caches files when they are downloaded. By default this is /var/cache/distfiles. To create this directory and ensure that it is writeable, enter the following commands:&lt;br /&gt;
&lt;br /&gt;
{{Cmd|sudo mkdir -p /var/cache/distfiles}}&lt;br /&gt;
{{Cmd|sudo chmod a+w /var/cache/distfiles}}&lt;br /&gt;
&lt;br /&gt;
Or add yourself to the abuild group&lt;br /&gt;
&lt;br /&gt;
{{Cmd|sudo groupadd &amp;lt;yourusername&amp;gt; abuild}}&lt;br /&gt;
&lt;br /&gt;
The last step in preparation is to configure the security keys for abuild with the command:&lt;br /&gt;
&lt;br /&gt;
{{Cmd|abuild-keygen -a -i}}&lt;br /&gt;
&lt;br /&gt;
== Getting some help ==&lt;br /&gt;
&lt;br /&gt;
It might be wise to start by checking what the abuild program can/cannot do.&lt;br /&gt;
&lt;br /&gt;
{{Cmd|abuild -h}}&lt;br /&gt;
&lt;br /&gt;
== Creating an APKBUILD file  ==&lt;br /&gt;
&lt;br /&gt;
=== Use a template APKBUILD ===&lt;br /&gt;
&lt;br /&gt;
To create the actual APKBUILD file &amp;lt;tt&amp;gt;newapkbuild&amp;lt;/tt&amp;gt; can serve you a template to start with. It will create a directory with the given package name, place an example/template APKBUILD file to the given directory, and fill some variables if those are provided. Please check the [[Package_policies| package policies]] page about naming details.&lt;br /&gt;
&lt;br /&gt;
If you doubt to which repository your package belongs to you can safely use &#039;&#039;&#039;testing&#039;&#039;&#039;. Building package in your aports/testing directory is not mandatory but this way the package is already at the right place.&lt;br /&gt;
&lt;br /&gt;
{{Cmd|newapkbuild &#039;&#039;packagename&#039;&#039;}}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;newapkbuild options&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;-a&#039;&#039;&#039;  Create autotools (use ./configure ...)&lt;br /&gt;
* &#039;&#039;&#039;-c&#039;&#039;&#039;  Copy a sample init.d, conf.d and install script to new directory&lt;br /&gt;
* &#039;&#039;&#039;-d&#039;&#039;&#039;  Set package description (pkgdesc) to DESC&lt;br /&gt;
* &#039;&#039;&#039;-f&#039;&#039;&#039;  Force even if directory already exist&lt;br /&gt;
* &#039;&#039;&#039;-h&#039;&#039;&#039;  Show this help&lt;br /&gt;
* &#039;&#039;&#039;-l&#039;&#039;&#039;  Set package license to LICENSE&lt;br /&gt;
* &#039;&#039;&#039;-p&#039;&#039;&#039;  Create perl package (Assume Makefile.PL is there)&lt;br /&gt;
* &#039;&#039;&#039;-u&#039;&#039;&#039;  Set package URL&lt;br /&gt;
* &#039;&#039;&#039;-s&#039;&#039;&#039;  Use sourceforge source url&lt;br /&gt;
&lt;br /&gt;
{{Note|On older Alpine systems, abuild -c -n &#039;&#039;packagename&#039;&#039; was the way to create APKBUILD files. The &#039;packagename&#039; was a parameter to the -n option so order of -c and -n matters. }}&lt;br /&gt;
&lt;br /&gt;
If you are create a daemon package which needs initd scripts you can add the -c making it: &lt;br /&gt;
&lt;br /&gt;
{{Cmd|newapkbuild -c &#039;&#039;packagename&#039;&#039;}}&lt;br /&gt;
&lt;br /&gt;
This will copy the sample initd and confd files to the build directory.&amp;lt;BR&amp;gt;&lt;br /&gt;
A third file sample.install file will be copied as well (we will discuss this later on).&lt;br /&gt;
&lt;br /&gt;
=== Modify your APKBUILD ===&lt;br /&gt;
Edit APKBUILD and fill in the needed info (especially pkgname, pkgver, pkgdesc, url, license, depends and source). &lt;br /&gt;
&lt;br /&gt;
If you are going to use any of the variables for directories like $pkgdir, always make sure they are double quoted like: &lt;br /&gt;
&lt;br /&gt;
 &amp;quot;$pkgdir&amp;quot;/somedir&lt;br /&gt;
&lt;br /&gt;
This will prevent issues with spaces/special characters in the future. &lt;br /&gt;
&lt;br /&gt;
{{Note|If you like syntax highlighting we suggest you to install vim. We have setup vim to recognize the APKBUILD file as a bash scripts so its easier to read them.}}&lt;br /&gt;
&lt;br /&gt;
=== APKBUILD variables/functions  ===&lt;br /&gt;
&lt;br /&gt;
==== source  ====&lt;br /&gt;
&lt;br /&gt;
The source variable is not only used to list the remote source files to fetch, it is also used to list the local files that abuild will need in order to build the apk. Examples of such local files include: init.d files, conf.d files, install files (see [[Creating an Alpine package#install|install variable]]), patches, and all other necessary files.&lt;br /&gt;
&lt;br /&gt;
Here are few things to note:&lt;br /&gt;
&lt;br /&gt;
* When you are finished adding local and/or remote files to &#039;&#039;source&#039;&#039;, you can execute the following command to add their checksums to the APKBUILD file:&lt;br /&gt;
: {{cmd|abuild checksum}}&lt;br /&gt;
: {{Note|When later updating the content of &#039;&#039;source&#039;&#039;, or updating a file that is listed in &#039;&#039;source&#039;&#039;, you must also update their checksums again with the same command.}}&lt;br /&gt;
&lt;br /&gt;
* When the remote file is hosted at SourceForge, it&#039;s best to specify the special mirrors link used by SourceForge:&lt;br /&gt;
: &amp;lt;pre&amp;gt;http://downloads.sourceforge.net/$pkgname/$pkgname-$pkgver.tar.gz&amp;lt;/pre&amp;gt;&lt;br /&gt;
: (or similar depending on the package).&lt;br /&gt;
&lt;br /&gt;
* When the remote filename is not specified in the URI (ie, does not end in &#039;/software-1.0.tar.gz&#039;), such as:&lt;br /&gt;
: &amp;lt;pre&amp;gt;http://oss.example.org/?get=software&amp;amp;ver=1.0&amp;lt;/pre&amp;gt;&lt;br /&gt;
: You must prepend &#039;saveas-&#039; to the protocol and append &#039;/software-1.0.tar.gz&#039; (for instance) to the end of the URI, like so:&lt;br /&gt;
: &amp;lt;pre&amp;gt;saveas-http://oss.example.org/?get=software&amp;amp;ver=1.0/software-1.0.tar.gz&amp;lt;/pre&amp;gt;&lt;br /&gt;
: This causes the file to be saved as &#039;&#039;software-1.0.tar.gz&#039;&#039; where abuild can use it, instead of &#039;&#039;?get=software&amp;amp;ver=1.0&#039;&#039;, where abuild cannot use it.&lt;br /&gt;
&lt;br /&gt;
* abuild currently supports the following protocols for remote file retrieval:&lt;br /&gt;
** http&lt;br /&gt;
** https&lt;br /&gt;
** ftp&lt;br /&gt;
&lt;br /&gt;
: {{Note|If the you want to download from https, you need GNU wget installed on your system.}}&lt;br /&gt;
 &lt;br /&gt;
* abuild currently supports the following archive types/archive file extensions:&lt;br /&gt;
** .tar.gz / .tgz&lt;br /&gt;
** .tar.bz2&lt;br /&gt;
** .tar.lzma&lt;br /&gt;
** .tar.xz&lt;br /&gt;
** .zip&lt;br /&gt;
&lt;br /&gt;
==== depends &amp;amp;amp; makedepends  ====&lt;br /&gt;
&lt;br /&gt;
Depends are the actual running dependencies that a package would need when it is running. Makedepends are only needed when you are building a package. If you set a package, in depends you do not need to add it to makedepends as well. The best way to find out what the depends and makedepends of a package are is to [http://en.wikipedia.org/wiki/Rtfm RTFM]. &lt;br /&gt;
&lt;br /&gt;
No kidding, lots of important information can be found it the package INSTALL and README file (or the likes). Another good way is the run ./configure --help from the source directory to see which options are needed for configure to finish without errors. If you do not yet have a src directory you can create one with the command: &lt;br /&gt;
&lt;br /&gt;
{{Cmd|abuild unpack}}&lt;br /&gt;
&lt;br /&gt;
Running configure will also show you how you can disable a specific option for this package. A good example is for instance &amp;quot;--disable-nls&amp;quot; which will disable native language support and thus does not depend on gettext(libiconv,glib..). &lt;br /&gt;
&lt;br /&gt;
Alpine likes to keep things small, so we try to disable as much as possible without losing too many features. The exact disable/enable options are decided the package builder but please try to follow Alpine&#039;s design concept as much as possible. &lt;br /&gt;
&lt;br /&gt;
An easy way of quickly finding out the build info for a package is to check Arch Linux (Alpine package management and build scripts are similar) or Gentoo linux ebuilds (previous versions of Alpine were based on Gentoo). &lt;br /&gt;
&lt;br /&gt;
* [http://www.gentoo-portage.com Search ebuilds] &lt;br /&gt;
* [http://sources.gentoo.org/viewcvs.py/gentoo-x86/ Gentoo CVS] &lt;br /&gt;
* [http://www.archlinux.org/packages/search/ Arch Linux packages] &lt;br /&gt;
&lt;br /&gt;
After the package is successfully compiled and created we should make sure it didn&#039;t link to any package that is not present in the $depends variable. We do this by using scanelf. If scanelf is not yet installed on your system you can do that by installing pax-utils. &lt;br /&gt;
&lt;br /&gt;
{{Cmd|scanelf -nR pkg}}&lt;br /&gt;
&lt;br /&gt;
An example output of libcurl would be: &lt;br /&gt;
&lt;br /&gt;
 ET_DYN libssl.so.0.9.8,libcrypto.so.0.9.8,libz.so.1,libc.so.0,ld-uClibc.so.0 pkg/usr/lib/libcurl.so.4.1.1&lt;br /&gt;
&lt;br /&gt;
You can see the needed files and should be able to find out which file belongs to which package.&lt;br /&gt;
&lt;br /&gt;
==== license  ====&lt;br /&gt;
&lt;br /&gt;
If a package has a special/custom license we need to provide it with the release. Because we want to save space and don&#039;t like to have licenses all over our system we have decided to include the license in the doc subpackage. Please follow the following guidelines to add a proper license. Locate the license file inside the source package. Add the doc subpackage to the $subpackages variable as follows: &lt;br /&gt;
&lt;br /&gt;
 subpackages=&amp;quot;$pkgname-doc&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Add a similar line to the following to your package() function, depending on the license description file: &lt;br /&gt;
&lt;br /&gt;
 install -Dm644 COPYING &amp;quot;$pkgdir&amp;quot;/usr/share/licenses/$pkgname/COPYING&lt;br /&gt;
&lt;br /&gt;
If you follow these steps then abuild will automatically add the license to the package-doc apk for you.&lt;br /&gt;
&lt;br /&gt;
==== arch ====&lt;br /&gt;
&lt;br /&gt;
The package architecture(s) to build for.  This can be one of: &#039;&#039;x86, x86_64, all,&#039;&#039; or &#039;&#039;noarch&#039;&#039;, where &#039;&#039;all&#039;&#039; means all architectures, and &#039;&#039;noarch&#039;&#039; means it&#039;s architecture-independent (ie, a pure-python package).&lt;br /&gt;
{{Tip|To determine if your APKBUILD can use &#039;&#039;noarch&#039;&#039;, build the package for your architecture and then run &amp;quot;scanelf -R pkg&amp;quot; from the directory that the APKBUILD resides in, in order to scan for ELF files in the &#039;&#039;./pkg&#039;&#039; directory.  If you do NOT get output from this, then &#039;&#039;noarch&#039;&#039; can be used.}}&lt;br /&gt;
&lt;br /&gt;
==== url  ====&lt;br /&gt;
&lt;br /&gt;
Website address for the program. This is usefully later on when either finding documentation or other information about the package.&lt;br /&gt;
&lt;br /&gt;
==== pkgdesc  ====&lt;br /&gt;
&lt;br /&gt;
A brief, one line, description of what the package does. Useful for the package management system.&lt;br /&gt;
&lt;br /&gt;
Here is an example from apk_info for the OpenSSH client package&lt;br /&gt;
&lt;br /&gt;
 pkgdesc=&amp;quot;Port of OpenBSD&#039;s free SSH release - client&amp;quot;&lt;br /&gt;
&lt;br /&gt;
==== pkgver  ====&lt;br /&gt;
&lt;br /&gt;
Provide the release number of the package you are building.&lt;br /&gt;
&lt;br /&gt;
==== pkgrel  ====&lt;br /&gt;
&lt;br /&gt;
The $pkgrel versioning is made so if you change something to your APKBUILD file without changing the actual $pkgver you can higer pkgrel so apk tools will detect it as an update. For instance if you forget to add a dependency you can add it afterward and you can +1 pkgver so apk finds this update and add the missing dependency. &lt;br /&gt;
&lt;br /&gt;
==== pkgname  ====&lt;br /&gt;
&lt;br /&gt;
The base name of the package you are creating.  For Freeswitch 1.0.6, you would use &amp;quot;freeswitch&amp;quot;&lt;br /&gt;
&lt;br /&gt;
==== install  ====&lt;br /&gt;
&lt;br /&gt;
There are 6 different kinds of install scripts. Each script is called with the $pkgname.&#039;&#039;&amp;lt;action&amp;gt;&#039;&#039; where &#039;&#039;&amp;lt;action&amp;gt;&#039;&#039; is one of the following:&lt;br /&gt;
&lt;br /&gt;
===== $pkgname.pre-install =====&lt;br /&gt;
This script is executed before package is installed. Typical use is when package needs a user/group to be created. For example:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#!/bin/sh&lt;br /&gt;
adduser -H -s /bin/false -D clamav 2&amp;gt;/dev/null&lt;br /&gt;
exit 0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Note the &#039;&#039;exit 0&#039;&#039; at the end. If the script exits with failure (if the user already exist), the package will not be installed and apk add will exit with failure.&lt;br /&gt;
&lt;br /&gt;
===== $pkgname.post-install =====&lt;br /&gt;
This script is executed after package is installed. Can be used to generate font cache and similar.&lt;br /&gt;
&lt;br /&gt;
===== $pkgname.pre-upgrade =====&lt;br /&gt;
Same as pre-install but is executed before upgrading an already installed package.&lt;br /&gt;
&lt;br /&gt;
===== $pkgname.post-upgrade =====&lt;br /&gt;
Same as post-install but is executed after upgrading an already installed package. &lt;br /&gt;
&lt;br /&gt;
===== $pkgname.pre-deinstall =====&lt;br /&gt;
This script is executed before uninstalling a package. If script exits with failure apk will not uninstall the package.&lt;br /&gt;
&lt;br /&gt;
===== $pkgname.post-deinstall =====&lt;br /&gt;
This script is executed after a package have been uninstalled. Can be used to update font caches and restore busybox links. For example:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#!/bin/sh&lt;br /&gt;
busybox --install -s&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If the package have an pre-install and post-install script the APKBUILD should have the &#039;&#039;install&#039;&#039; variable defined and the scripts should also be added to the source variable:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
...&lt;br /&gt;
install=&amp;quot;$pkgname.pre-install $pkgname.post-install&amp;quot;&lt;br /&gt;
source=&amp;quot;http://....&lt;br /&gt;
       $install&amp;quot;&lt;br /&gt;
...&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== subpackages  ====&lt;br /&gt;
&lt;br /&gt;
$subpackages are made to split up the normal &amp;quot;make install&amp;quot; into separate packages. The most common subpackages we use are doc and dev. Because we like to keep our target system small we move documentation and development files (only needed when building packages) into separate packages. To use the specific program a user only need to install the base apk without package-doc or package-dev, but if he wants to read the manual he will need to install package-doc. &lt;br /&gt;
&lt;br /&gt;
The easiest way to find out if you need to use -dev and -doc is to first build the package without these options set and wait until the build finishes. When its finished you should have a pkg directory which is the fake root directory. Inside this directory you will see the structure as how it would be installed in / on the target system. &lt;br /&gt;
&lt;br /&gt;
To see if you need the -dev package you can run the following cmd: &lt;br /&gt;
&lt;br /&gt;
{{Cmd|find pkg/usr/ -name &#039;*.[acho]&#039; -o -name &#039;*.la&#039;}}&lt;br /&gt;
&lt;br /&gt;
If this returns any files you need to include the -dev package. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt; To see if you need the -doc package you can run the following cmd: &lt;br /&gt;
&lt;br /&gt;
{{Cmd|find pkg/usr/share -name doc -o -name man -o -name info -o -name html -o -name sgml -o -name licenses}}&lt;br /&gt;
&lt;br /&gt;
If this returns any directories you need to include the -doc package. &lt;br /&gt;
&lt;br /&gt;
===== Custom subpackages  =====&lt;br /&gt;
&lt;br /&gt;
Some applications will have except doc and dev files other non needed at run time files which we want to separate away from the base package. Some packages include large test suites which are only needed in specific circumstances or binaries which have depends which we prefer not to install. To handle those we create our own package/function. In the APKBUILD below the build() function we create another function: &lt;br /&gt;
&lt;br /&gt;
 test() {&lt;br /&gt;
        mkdir -p &amp;quot;$subpkgdir&amp;quot;/usr&lt;br /&gt;
        mv &amp;quot;$pkgdir&amp;quot;/usr/package-test &amp;quot;$subpkgdir&amp;quot;/usr/&lt;br /&gt;
 }&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
We also need to add the package info to $subpackages variable: &lt;br /&gt;
&lt;br /&gt;
 subpackages=&amp;quot;$pkgname-doc $pkgname-dev $pkgname-test&amp;quot;&lt;br /&gt;
&lt;br /&gt;
After we finish building the package you should see another apk called packagename-test.apk which includes the files which we moved to the $subpkgdir dir. &lt;br /&gt;
&lt;br /&gt;
The above mentioned variables can also be used in our custom function. If we want for instance to build the test() function with perl support we would add: &lt;br /&gt;
&lt;br /&gt;
 depends=&amp;quot;perl&amp;quot;&lt;br /&gt;
 makedepends=&amp;quot;perl-dev&amp;quot;&lt;br /&gt;
&lt;br /&gt;
If we would install the base package it would not install perl, but if we install the package-test package it would.&lt;br /&gt;
&lt;br /&gt;
==== Patches  ====&lt;br /&gt;
&lt;br /&gt;
Please make sure you always submit human readable patches. Way&#039;s to create them are: &lt;br /&gt;
&lt;br /&gt;
directory compare: &lt;br /&gt;
&lt;br /&gt;
{{Cmd|diff -urp original_directory new_directory &amp;amp;gt; filename.patch}}&lt;br /&gt;
&lt;br /&gt;
file compare: &lt;br /&gt;
&lt;br /&gt;
{{Cmd|diff -up original.file new.file &amp;amp;gt; filename.patch}}&lt;br /&gt;
&lt;br /&gt;
If you are going to use multiple patches for a single package, the preferred way to handle those is a loop and numbering the patches. &lt;br /&gt;
&lt;br /&gt;
 for i in &amp;quot;$srcdir&amp;quot;/*.patch; do&lt;br /&gt;
        msg &amp;quot;Applying ${i}&amp;quot;&lt;br /&gt;
        patch -p0 -i $i || return 1&lt;br /&gt;
 done&lt;br /&gt;
&lt;br /&gt;
Because multiple patches can patch the same file, we could create offset for the next patch. To make sure we always patch in a specified way we should number the patches as followed: &lt;br /&gt;
&lt;br /&gt;
 10-patch1.patch 20-patch2.patch 30-patch3.patch&lt;br /&gt;
&lt;br /&gt;
This way we are always sure patch 1 is first and if we want to add additional patches between them we can use 11,12,21,22... &lt;br /&gt;
&lt;br /&gt;
==== Configure options  ====&lt;br /&gt;
&lt;br /&gt;
Alpine has some default configure options we set by default. We use /usr for prefix to make sure everything is installed with /usr in front of it. If you notice that anything is installed in the wrong directory please run {{Cmd|./configure --help}} and see if you can set the correct location. &lt;br /&gt;
&lt;br /&gt;
We are not covering the depend switches here we have discussed this already in the depend section.&lt;br /&gt;
&lt;br /&gt;
{{Tip|Common steps for building package contain &#039;&#039;./configure&#039;&#039;, &#039;&#039;make&#039;&#039; and &#039;&#039;make install&#039;&#039;. Everyone of them should be enclosed by &#039;&#039;&amp;amp;#124;&amp;amp;#124; return 1&#039;&#039; to check exit status. Otherwise even if previous step fails e.g. &#039;&#039;./configure&#039;&#039;, next will be launched e.g. &#039;&#039;make&#039;&#039;. This complicates tracing the point, where package brakes. The same applies to installing additional files.}}&lt;br /&gt;
&lt;br /&gt;
==== Make options  ====&lt;br /&gt;
&lt;br /&gt;
If you notice weird problems when compiling or installing the package with make/make install you could try to disable [http://www.gnu.org/software/make/manual/make.html#Parallel parallel] building/installing. A normal make line would be: &lt;br /&gt;
&lt;br /&gt;
 make || return 1&lt;br /&gt;
&lt;br /&gt;
To disable parallel we use: &lt;br /&gt;
&lt;br /&gt;
 make -j1 || return 1&lt;br /&gt;
&lt;br /&gt;
We can use the same for make install. &lt;br /&gt;
&lt;br /&gt;
Because we do not want to install the package in our build environment but we want to install it in a fake root directory we need to tell &#039;make install&#039; to use another destination directory instead of &#039;/&#039;. We do this by setting a variable when we execute make install as followed: &lt;br /&gt;
&lt;br /&gt;
 make DESTDIR=&amp;quot;$pkgdir&amp;quot; install&lt;br /&gt;
&lt;br /&gt;
Please note that some Makefiles do not support this variable and will always install software in &#039;/&#039;. To make sure you do not mess up your build system NEVER run your build system as root but always use a custom user and sudo when needed. If by accident the Makefile does not support DESTDIR variable it will fail to install in our build system system directories.&lt;br /&gt;
&lt;br /&gt;
==== _builddir ====&lt;br /&gt;
If you used &amp;lt;tt&amp;gt;newapkbuild&amp;lt;/tt&amp;gt; to create your APKBUILD file, you must specify the path to your unpacked sources. Inside the sections during the prepare/build/install process &#039;&#039;_builddir&#039;&#039; is used. Most of the time a combination of &#039;&#039;$srcdir&#039;&#039; and &#039;&#039;$pkgname-$pkgver&#039;&#039; will work. When not, check the /src directory or the source tarball for the right string. Especially when you are working with automatically generated tarballs (like from github and gitorious), this needs to be adjusted.&lt;br /&gt;
&lt;br /&gt;
 _builddir=&amp;quot;$srcdir&amp;quot;/$pkgname-$pkgver&lt;br /&gt;
&lt;br /&gt;
==== Additional files  ====&lt;br /&gt;
&lt;br /&gt;
If you want/need to install additional files not mentioned above you can use the following cmd (this is an example of a conf file): &lt;br /&gt;
&lt;br /&gt;
 install -Dm644 doc/$pkgname.conf &amp;quot;$pkgdir&amp;quot;/etc/$pkgname.conf&lt;br /&gt;
&lt;br /&gt;
== Build the package  ==&lt;br /&gt;
&lt;br /&gt;
If you did not already create the checksums as mentioned above you can do so now: &lt;br /&gt;
&lt;br /&gt;
{{Cmd|cd $pkgname&lt;br /&gt;
abuild checksum}}&lt;br /&gt;
&lt;br /&gt;
It&#039;s about time we build our package. Because a build system should never have all the package installed to prevent linking to packages we don&#039;t want it to link we use a abuild recursively with the &#039;&#039;&#039;-r&#039;&#039;&#039; switch. It will install all dependency&#039;s from your repository and builds it, afterwards it will uninstall all those depending packages again. You could also use the &#039;&#039;&#039;-R&#039;&#039;&#039; switch which would build your package including the dependency packages. &lt;br /&gt;
&lt;br /&gt;
{{Cmd|abuild -r}}&lt;br /&gt;
&lt;br /&gt;
== Commit your work  ==&lt;br /&gt;
&lt;br /&gt;
After you successfully build your package you can submit your APKBUILD to alpine git repository. &lt;br /&gt;
&lt;br /&gt;
Update your git repo, before adding new files: &lt;br /&gt;
&lt;br /&gt;
{{Cmd|cd $aportsdir&lt;br /&gt;
git pull}}&lt;br /&gt;
&lt;br /&gt;
This should pull all the changes made by others into you local git repo. When you think you are ready you can add your files to git: &lt;br /&gt;
&lt;br /&gt;
{{Cmd|cd $apkbuilddir&lt;br /&gt;
git add APKBUILD (include any other files needed for the build; $pkgname.install...)&lt;br /&gt;
git commit}}&lt;br /&gt;
&lt;br /&gt;
Now your changes are only available locally in your repository. Because you do not have push rights to the Alpine aports repository you need to create diff (patch) of the changes you made and send this patch to the [http://lists.alpinelinux.org/alpine-devel/ alpine-devel mailinglist].&lt;br /&gt;
&lt;br /&gt;
== Send a patch ==&lt;br /&gt;
&lt;br /&gt;
[[Creating_patches#Only_the_last_commit_with_.27git_send-email.27|git send-email]] will do that for you.&lt;br /&gt;
&lt;br /&gt;
== See Also ==&lt;br /&gt;
* [[APKBUILD Reference]]&lt;br /&gt;
* [[Development using git]]&lt;/div&gt;</summary>
		<author><name>Forth</name></author>
	</entry>
	<entry>
		<id>https://wiki.alpinelinux.org/w/index.php?title=Creating_patches&amp;diff=5638</id>
		<title>Creating patches</title>
		<link rel="alternate" type="text/html" href="https://wiki.alpinelinux.org/w/index.php?title=Creating_patches&amp;diff=5638"/>
		<updated>2011-08-15T06:17:09Z</updated>

		<summary type="html">&lt;p&gt;Forth: /* Only the last commit with &amp;#039;git send-email&amp;#039; */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;There are several possible ways to send patches. Below the most common are described. &lt;br /&gt;
&lt;br /&gt;
== Only the last commit with &#039;git send-email&#039; ==&lt;br /&gt;
&lt;br /&gt;
To submit the last commit as a patch to alpine-devel mailing list:&lt;br /&gt;
&lt;br /&gt;
{{Cmd|git send-email --to alpine-devel@lists.alpinelinux.org HEAD^}}&lt;br /&gt;
&lt;br /&gt;
The first line in commit message will be &#039;&#039;subject&#039;&#039; and the long description (separated with empty line) will be the body in the email. The example below shows &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Initial APKBUILD file of packagename  &amp;lt;- Subject line&lt;br /&gt;
&lt;br /&gt;
Enter some details about your package &amp;lt;- Mail body&lt;br /&gt;
here if you like. &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{Note|The git send-email command is provided by the &#039;&#039;&#039;git-perl&#039;&#039;&#039; package. }}&lt;br /&gt;
&lt;br /&gt;
Read [[Development using git]] to send patch with SMTP Auth.&lt;br /&gt;
&lt;br /&gt;
== Multiple commits with &#039;git send-email&#039; ==&lt;br /&gt;
&lt;br /&gt;
If you have many commits you can create a directory with patches and send them with &amp;lt;tt&amp;gt;git send-email&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
{{Cmd|&amp;lt;nowiki&amp;gt;rm -Rf patches&lt;br /&gt;
mkdir patches&lt;br /&gt;
git format-patch -o patches origin&lt;br /&gt;
git send-email --compose --no-chain-reply-to --to alpine-devel@lists.alpinelinux.or&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
&lt;br /&gt;
This will produce the patches for each local commit in the directory &amp;quot;patches&amp;quot; and send them.&lt;br /&gt;
Use --no-chain-reply-to make sure it doesn&#039;t reply.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- what does the following mean? --&amp;gt;&lt;br /&gt;
Don&#039;t do:&lt;br /&gt;
* [PATCH 0/m]&lt;br /&gt;
** [PATCH 1/m]&lt;br /&gt;
*** [PATCH 2/m]&lt;br /&gt;
**** ...&lt;br /&gt;
But do:&lt;br /&gt;
* [PATCH 0/m]&lt;br /&gt;
** [PATCH 1/m]&lt;br /&gt;
** [PATCH 2/m]&lt;br /&gt;
** ..&lt;br /&gt;
&lt;br /&gt;
== Multiple patches with &#039;email&#039; ==&lt;br /&gt;
&lt;br /&gt;
{{Cmd|git format-patch -1}}&lt;br /&gt;
&lt;br /&gt;
Where -1 sets how many commits you want to go back (mostly this is 1). This should create a patch called 0001......patch. &lt;br /&gt;
&lt;br /&gt;
An easy way to send this patch to the list is with an program called &#039;email&#039;. &lt;br /&gt;
&lt;br /&gt;
{{Cmd|apk add email}}&lt;br /&gt;
&lt;br /&gt;
to send to the mailing list you would do: &lt;br /&gt;
&lt;br /&gt;
{{Cmd|email -a 0001...patch alpine-devel@lists.alpinelinux.org}}&lt;br /&gt;
&lt;br /&gt;
And provide a subject and body after you execute the above cmd.&lt;/div&gt;</summary>
		<author><name>Forth</name></author>
	</entry>
	<entry>
		<id>https://wiki.alpinelinux.org/w/index.php?title=Creating_patches&amp;diff=5637</id>
		<title>Creating patches</title>
		<link rel="alternate" type="text/html" href="https://wiki.alpinelinux.org/w/index.php?title=Creating_patches&amp;diff=5637"/>
		<updated>2011-08-15T06:14:23Z</updated>

		<summary type="html">&lt;p&gt;Forth: /* Only the last commit with &amp;#039;git send-email&amp;#039; */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;There are several possible ways to send patches. Below the most common are described. &lt;br /&gt;
&lt;br /&gt;
== Only the last commit with &#039;git send-email&#039; ==&lt;br /&gt;
&lt;br /&gt;
To submit the last commit as a patch to alpine-devel mailing list:&lt;br /&gt;
&lt;br /&gt;
{{Cmd|git send-email --to alpine-devel@lists.alpinelinux.org HEAD^}}&lt;br /&gt;
&lt;br /&gt;
The first line in commit message will be &#039;&#039;subject&#039;&#039; and the long description (separated with empty line) will be the body in the email. The example below shows &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Initial APKBUILD file of packagename  &amp;lt;- Subject line&lt;br /&gt;
&lt;br /&gt;
Enter some details about your package &amp;lt;- Mail body&lt;br /&gt;
here if you like. &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{Note|The git send-email command is provided by the &#039;&#039;&#039;git-perl&#039;&#039;&#039; package. }}&lt;br /&gt;
&lt;br /&gt;
Read http://wiki.alpinelinux.org/wiki/Development_using_git&lt;br /&gt;
to send patch with SMTP Auth.&lt;br /&gt;
&lt;br /&gt;
== Multiple commits with &#039;git send-email&#039; ==&lt;br /&gt;
&lt;br /&gt;
If you have many commits you can create a directory with patches and send them with &amp;lt;tt&amp;gt;git send-email&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
{{Cmd|&amp;lt;nowiki&amp;gt;rm -Rf patches&lt;br /&gt;
mkdir patches&lt;br /&gt;
git format-patch -o patches origin&lt;br /&gt;
git send-email --compose --no-chain-reply-to --to alpine-devel@lists.alpinelinux.or&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
&lt;br /&gt;
This will produce the patches for each local commit in the directory &amp;quot;patches&amp;quot; and send them.&lt;br /&gt;
Use --no-chain-reply-to make sure it doesn&#039;t reply.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- what does the following mean? --&amp;gt;&lt;br /&gt;
Don&#039;t do:&lt;br /&gt;
* [PATCH 0/m]&lt;br /&gt;
** [PATCH 1/m]&lt;br /&gt;
*** [PATCH 2/m]&lt;br /&gt;
**** ...&lt;br /&gt;
But do:&lt;br /&gt;
* [PATCH 0/m]&lt;br /&gt;
** [PATCH 1/m]&lt;br /&gt;
** [PATCH 2/m]&lt;br /&gt;
** ..&lt;br /&gt;
&lt;br /&gt;
== Multiple patches with &#039;email&#039; ==&lt;br /&gt;
&lt;br /&gt;
{{Cmd|git format-patch -1}}&lt;br /&gt;
&lt;br /&gt;
Where -1 sets how many commits you want to go back (mostly this is 1). This should create a patch called 0001......patch. &lt;br /&gt;
&lt;br /&gt;
An easy way to send this patch to the list is with an program called &#039;email&#039;. &lt;br /&gt;
&lt;br /&gt;
{{Cmd|apk add email}}&lt;br /&gt;
&lt;br /&gt;
to send to the mailing list you would do: &lt;br /&gt;
&lt;br /&gt;
{{Cmd|email -a 0001...patch alpine-devel@lists.alpinelinux.org}}&lt;br /&gt;
&lt;br /&gt;
And provide a subject and body after you execute the above cmd.&lt;/div&gt;</summary>
		<author><name>Forth</name></author>
	</entry>
	<entry>
		<id>https://wiki.alpinelinux.org/w/index.php?title=Creating_patches&amp;diff=5634</id>
		<title>Creating patches</title>
		<link rel="alternate" type="text/html" href="https://wiki.alpinelinux.org/w/index.php?title=Creating_patches&amp;diff=5634"/>
		<updated>2011-08-14T22:49:42Z</updated>

		<summary type="html">&lt;p&gt;Forth: /* Only the last commit with &amp;#039;git send-email&amp;#039; */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;There are several possible ways to send patches. Below the most common are described. &lt;br /&gt;
&lt;br /&gt;
== Only the last commit with &#039;git send-email&#039; ==&lt;br /&gt;
&lt;br /&gt;
To submit the last commit as a patch to alpine-devel mailing list:&lt;br /&gt;
&lt;br /&gt;
{{Cmd|git send-email --to alpine-devel@lists.alpinelinux.org HEAD^}}&lt;br /&gt;
&lt;br /&gt;
The first line in commit message will be &#039;&#039;subject&#039;&#039; and the long description (separated with empty line) will be the body in the email. The example below shows &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Initial APKBUILD file of packagename  &amp;lt;- Subject line&lt;br /&gt;
&lt;br /&gt;
Enter some details about your package &amp;lt;- Mail body&lt;br /&gt;
here if you like. &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{Note|The git send-email command is provided by the &#039;&#039;&#039;git-perl&#039;&#039;&#039; package. }}&lt;br /&gt;
&lt;br /&gt;
How to send your patches through smtp-auth : https://git.wiki.kernel.org/index.php/GitTips#Using_msmtp_to_send_your_patches&lt;br /&gt;
&lt;br /&gt;
== Multiple commits with &#039;git send-email&#039; ==&lt;br /&gt;
&lt;br /&gt;
If you have many commits you can create a directory with patches and send them with &amp;lt;tt&amp;gt;git send-email&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
{{Cmd|&amp;lt;nowiki&amp;gt;rm -Rf patches&lt;br /&gt;
mkdir patches&lt;br /&gt;
git format-patch -o patches origin&lt;br /&gt;
git send-email --compose --no-chain-reply-to --to alpine-devel@lists.alpinelinux.or&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
&lt;br /&gt;
This will produce the patches for each local commit in the directory &amp;quot;patches&amp;quot; and send them.&lt;br /&gt;
Use --no-chain-reply-to make sure it doesn&#039;t reply.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- what does the following mean? --&amp;gt;&lt;br /&gt;
Don&#039;t do:&lt;br /&gt;
* [PATCH 0/m]&lt;br /&gt;
** [PATCH 1/m]&lt;br /&gt;
*** [PATCH 2/m]&lt;br /&gt;
**** ...&lt;br /&gt;
But do:&lt;br /&gt;
* [PATCH 0/m]&lt;br /&gt;
** [PATCH 1/m]&lt;br /&gt;
** [PATCH 2/m]&lt;br /&gt;
** ..&lt;br /&gt;
&lt;br /&gt;
== Multiple patches with &#039;email&#039; ==&lt;br /&gt;
&lt;br /&gt;
{{Cmd|git format-patch -1}}&lt;br /&gt;
&lt;br /&gt;
Where -1 sets how many commits you want to go back (mostly this is 1). This should create a patch called 0001......patch. &lt;br /&gt;
&lt;br /&gt;
An easy way to send this patch to the list is with an program called &#039;email&#039;. &lt;br /&gt;
&lt;br /&gt;
{{Cmd|apk add email}}&lt;br /&gt;
&lt;br /&gt;
to send to the mailing list you would do: &lt;br /&gt;
&lt;br /&gt;
{{Cmd|email -a 0001...patch alpine-devel@lists.alpinelinux.org}}&lt;br /&gt;
&lt;br /&gt;
And provide a subject and body after you execute the above cmd.&lt;/div&gt;</summary>
		<author><name>Forth</name></author>
	</entry>
	<entry>
		<id>https://wiki.alpinelinux.org/w/index.php?title=Template:Copying_Alpine_to_Flash&amp;diff=5633</id>
		<title>Template:Copying Alpine to Flash</title>
		<link rel="alternate" type="text/html" href="https://wiki.alpinelinux.org/w/index.php?title=Template:Copying_Alpine_to_Flash&amp;diff=5633"/>
		<updated>2011-08-14T22:19:36Z</updated>

		<summary type="html">&lt;p&gt;Forth: /* Format {{{1|Flash Medium}}} */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Copy Alpine to a {{{1|Flash Medium}}} ==&lt;br /&gt;
&lt;br /&gt;
# Insert the removable {{{1|flash medium (CF or USB stick)}}} into the computer.&lt;br /&gt;
# Determine the name your computer uses for your {{{1|flash medium}}}. The following step is one way to do this.&lt;br /&gt;
#* After inserting the {{{1|flash medium}}}, run the command:&lt;br /&gt;
#* {{Cmd|dmesg}}&lt;br /&gt;
#* At the end of this command you should see the name of your {{{1|flash medium}}}, likely starting with &amp;quot;sd&amp;quot;. (For example: &amp;quot;sda&amp;quot;).&lt;br /&gt;
#* The remainder of this document will assume that your {{{1|flash medium}}} is called /dev/sda&lt;br /&gt;
&lt;br /&gt;
{{Warning|Be very careful about this. You do not want to mistakenly wipe your hard drive if it&#039;s on /dev/sda}}&lt;br /&gt;
&lt;br /&gt;
=== Format {{{1|Flash Medium}}} ===&lt;br /&gt;
{{Cmd|fdisk /dev/sda}}&lt;br /&gt;
* &#039;&#039;&#039;p&#039;&#039;&#039; Print list of partitions&lt;br /&gt;
* &#039;&#039;&#039;d&#039;&#039;&#039; Delete all partitions (this may take a few steps)&lt;br /&gt;
* &#039;&#039;&#039;n&#039;&#039;&#039; Create a new partition&lt;br /&gt;
* &#039;&#039;&#039;p&#039;&#039;&#039; A primary partition&lt;br /&gt;
* &#039;&#039;&#039;1&#039;&#039;&#039; Partition number 1&lt;br /&gt;
** Use defaults for first and last cylinder (just press [Enter] twice).&lt;br /&gt;
* &#039;&#039;&#039;t&#039;&#039;&#039; Change partition type&lt;br /&gt;
* &#039;&#039;&#039;c&#039;&#039;&#039; Type: Win95 FAT32 (LBA)&lt;br /&gt;
* &#039;&#039;&#039;a&#039;&#039;&#039; &amp;lt;big&amp;gt;Make the partition bootable (set boot flag)&amp;lt;/big&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;1&#039;&#039;&#039; Partition number 1&lt;br /&gt;
* &#039;&#039;&#039;w&#039;&#039;&#039; Write your changes to the device&lt;br /&gt;
&lt;br /&gt;
=== Install Syslinux ===&lt;br /&gt;
{{Note|If the following commands fail due to &#039;No such file or directory&#039;, you may have to remove and reinsert the CF card, or even reboot, to get /dev/sda1 to appear}}&lt;br /&gt;
# Install syslinux and dosfstools. If you have booted from an Alpine CD-ROM, use these commands:&lt;br /&gt;
#* {{Cmd|apk add syslinux dosfstools}}&lt;br /&gt;
#* {{Cmd|{{{|dd if=/usr/share/syslinux/mbr.bin of=/dev/sda}}}}}&lt;br /&gt;
# Format the {{{1|flash medium}}} with a VFAT filesystem:&lt;br /&gt;
#* {{Cmd|mkdosfs -F32 /dev/sda1}}&lt;br /&gt;
#* {{Cmd|syslinux /dev/sda1}}&lt;br /&gt;
#* {{Cmd|mkdir -p /media/sda1}}&lt;br /&gt;
#* {{Cmd|mount -t vfat /dev/sda1 /media/sda1}}&lt;br /&gt;
# Mount the Alpine Linux CD-ROM, and copy the files to the {{{1|flash medium}}}&lt;br /&gt;
#* {{Cmd|mount /media/cdrom}}&lt;br /&gt;
#* {{Cmd|cd /media/cdrom}}&lt;br /&gt;
#* {{Cmd|cp -a .alpine-release * /media/sda1/ }}&lt;br /&gt;
&lt;br /&gt;
== Troubleshooting ==&lt;br /&gt;
When your USB device is formatted to other filesystem than fat32, you might have to specify the necessary filesystem modules in boot parameters.&lt;br /&gt;
&lt;br /&gt;
To do so, mount the device, and alter the syslinux.cfg file line from &lt;br /&gt;
 append initrd=/boot/grsec.gz alpine_dev=usbdisk:vfat modules=loop,cramfs,sd-mod,usb-storage quiet&lt;br /&gt;
to&lt;br /&gt;
 append initrd=/boot/grsec.gz alpine_dev=usbdisk:vfat modules=loop,cramfs,sd-mod,usb-storage,ext3 quiet&lt;br /&gt;
&lt;br /&gt;
in case of using ext3 formatted partition. Similar procedure might apply to other filesystems (if they are supported by syslinux or other bootloader of your choice and alpine kernel).&lt;br /&gt;
&lt;br /&gt;
Also, specifying waitusb=X option might help with certain usb devices that take a bit longer to register. X stands for the amount of seconds kernel will wait before looking for the installation media.&lt;/div&gt;</summary>
		<author><name>Forth</name></author>
	</entry>
	<entry>
		<id>https://wiki.alpinelinux.org/w/index.php?title=Creating_patches&amp;diff=5632</id>
		<title>Creating patches</title>
		<link rel="alternate" type="text/html" href="https://wiki.alpinelinux.org/w/index.php?title=Creating_patches&amp;diff=5632"/>
		<updated>2011-08-14T22:13:58Z</updated>

		<summary type="html">&lt;p&gt;Forth: /* Multiple commits with &amp;#039;git send-email&amp;#039; */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;There are several possible ways to send patches. Below the most common are described. &lt;br /&gt;
&lt;br /&gt;
== Only the last commit with &#039;git send-email&#039; ==&lt;br /&gt;
&lt;br /&gt;
To submit the last commit as a patch to alpine-devel mailing list:&lt;br /&gt;
&lt;br /&gt;
{{Cmd|git send-email --to alpine-devel@lists.alpinelinux.org HEAD^}}&lt;br /&gt;
&lt;br /&gt;
The first line in commit message will be &#039;&#039;subject&#039;&#039; and the long description (separated with empty line) will be the body in the email. The example below shows &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Initial APKBUILD file of packagename  &amp;lt;- Subject line&lt;br /&gt;
&lt;br /&gt;
Enter some details about your package &amp;lt;- Mail body&lt;br /&gt;
here if you like. &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{Note|The git send-email command is provided by the &#039;&#039;&#039;git-perl&#039;&#039;&#039; package. }}&lt;br /&gt;
&lt;br /&gt;
if it fails, try to install postfix to have a sendmail binary (default shipped is busybox&#039;s).&lt;br /&gt;
&lt;br /&gt;
== Multiple commits with &#039;git send-email&#039; ==&lt;br /&gt;
&lt;br /&gt;
If you have many commits you can create a directory with patches and send them with &amp;lt;tt&amp;gt;git send-email&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
{{Cmd|&amp;lt;nowiki&amp;gt;rm -Rf patches&lt;br /&gt;
mkdir patches&lt;br /&gt;
git format-patch -o patches origin&lt;br /&gt;
git send-email --compose --no-chain-reply-to --to alpine-devel@lists.alpinelinux.or&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
&lt;br /&gt;
This will produce the patches for each local commit in the directory &amp;quot;patches&amp;quot; and send them.&lt;br /&gt;
Use --no-chain-reply-to make sure it doesn&#039;t reply.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- what does the following mean? --&amp;gt;&lt;br /&gt;
Don&#039;t do:&lt;br /&gt;
* [PATCH 0/m]&lt;br /&gt;
** [PATCH 1/m]&lt;br /&gt;
*** [PATCH 2/m]&lt;br /&gt;
**** ...&lt;br /&gt;
But do:&lt;br /&gt;
* [PATCH 0/m]&lt;br /&gt;
** [PATCH 1/m]&lt;br /&gt;
** [PATCH 2/m]&lt;br /&gt;
** ..&lt;br /&gt;
&lt;br /&gt;
== Multiple patches with &#039;email&#039; ==&lt;br /&gt;
&lt;br /&gt;
{{Cmd|git format-patch -1}}&lt;br /&gt;
&lt;br /&gt;
Where -1 sets how many commits you want to go back (mostly this is 1). This should create a patch called 0001......patch. &lt;br /&gt;
&lt;br /&gt;
An easy way to send this patch to the list is with an program called &#039;email&#039;. &lt;br /&gt;
&lt;br /&gt;
{{Cmd|apk add email}}&lt;br /&gt;
&lt;br /&gt;
to send to the mailing list you would do: &lt;br /&gt;
&lt;br /&gt;
{{Cmd|email -a 0001...patch alpine-devel@lists.alpinelinux.org}}&lt;br /&gt;
&lt;br /&gt;
And provide a subject and body after you execute the above cmd.&lt;/div&gt;</summary>
		<author><name>Forth</name></author>
	</entry>
	<entry>
		<id>https://wiki.alpinelinux.org/w/index.php?title=Creating_patches&amp;diff=5631</id>
		<title>Creating patches</title>
		<link rel="alternate" type="text/html" href="https://wiki.alpinelinux.org/w/index.php?title=Creating_patches&amp;diff=5631"/>
		<updated>2011-08-14T22:03:46Z</updated>

		<summary type="html">&lt;p&gt;Forth: /* Only the last commit with &amp;#039;git send-email&amp;#039; */  troublesome&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;There are several possible ways to send patches. Below the most common are described. &lt;br /&gt;
&lt;br /&gt;
== Only the last commit with &#039;git send-email&#039; ==&lt;br /&gt;
&lt;br /&gt;
To submit the last commit as a patch to alpine-devel mailing list:&lt;br /&gt;
&lt;br /&gt;
{{Cmd|git send-email --to alpine-devel@lists.alpinelinux.org HEAD^}}&lt;br /&gt;
&lt;br /&gt;
The first line in commit message will be &#039;&#039;subject&#039;&#039; and the long description (separated with empty line) will be the body in the email. The example below shows &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Initial APKBUILD file of packagename  &amp;lt;- Subject line&lt;br /&gt;
&lt;br /&gt;
Enter some details about your package &amp;lt;- Mail body&lt;br /&gt;
here if you like. &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{Note|The git send-email command is provided by the &#039;&#039;&#039;git-perl&#039;&#039;&#039; package. }}&lt;br /&gt;
&lt;br /&gt;
if it fails, try to install postfix to have a sendmail binary (default shipped is busybox&#039;s).&lt;br /&gt;
&lt;br /&gt;
== Multiple commits with &#039;git send-email&#039; ==&lt;br /&gt;
&lt;br /&gt;
If you have many commits you can create a directory with patches and send them with &amp;lt;tt&amp;gt;git send-email&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
{{Cmd|&amp;lt;nowiki&amp;gt;rm -Rf patches&lt;br /&gt;
mkdir patches&lt;br /&gt;
git format-patch -o patches origin&lt;br /&gt;
git send-email --to alpine-devel@lists.alpinelinux.org patches&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
&lt;br /&gt;
If you have multiple patch consider using:&lt;br /&gt;
{{Cmd|git send-email --compose --no-chain-reply-to --to alpine-devel@lists.alpinelinux.org patches}}&lt;br /&gt;
This will produce the patches for each local commit in the directory &amp;quot;patches&amp;quot; and send them.&lt;br /&gt;
Use --no-chain-reply-to make sure it doesn&#039;t reply.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- what does the following mean? --&amp;gt;&lt;br /&gt;
Don&#039;t do:&lt;br /&gt;
* [PATCH 0/m]&lt;br /&gt;
** [PATCH 1/m]&lt;br /&gt;
*** [PATCH 2/m]&lt;br /&gt;
**** ...&lt;br /&gt;
But do:&lt;br /&gt;
* [PATCH 0/m]&lt;br /&gt;
** [PATCH 1/m]&lt;br /&gt;
** [PATCH 2/m]&lt;br /&gt;
** ..&lt;br /&gt;
&lt;br /&gt;
== Multiple patches with &#039;email&#039; ==&lt;br /&gt;
&lt;br /&gt;
{{Cmd|git format-patch -1}}&lt;br /&gt;
&lt;br /&gt;
Where -1 sets how many commits you want to go back (mostly this is 1). This should create a patch called 0001......patch. &lt;br /&gt;
&lt;br /&gt;
An easy way to send this patch to the list is with an program called &#039;email&#039;. &lt;br /&gt;
&lt;br /&gt;
{{Cmd|apk add email}}&lt;br /&gt;
&lt;br /&gt;
to send to the mailing list you would do: &lt;br /&gt;
&lt;br /&gt;
{{Cmd|email -a 0001...patch alpine-devel@lists.alpinelinux.org}}&lt;br /&gt;
&lt;br /&gt;
And provide a subject and body after you execute the above cmd.&lt;/div&gt;</summary>
		<author><name>Forth</name></author>
	</entry>
	<entry>
		<id>https://wiki.alpinelinux.org/w/index.php?title=Creating_an_Alpine_package&amp;diff=5630</id>
		<title>Creating an Alpine package</title>
		<link rel="alternate" type="text/html" href="https://wiki.alpinelinux.org/w/index.php?title=Creating_an_Alpine_package&amp;diff=5630"/>
		<updated>2011-08-14T20:03:46Z</updated>

		<summary type="html">&lt;p&gt;Forth: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== General ==&lt;br /&gt;
&lt;br /&gt;
This document assumes that you have a working [[Setting up the build environment|build environment]], or use a diskbased alpine installation. &lt;br /&gt;
&lt;br /&gt;
=== The APKBUILDs  ===&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;[http://git.alpinelinux.org/cgit/abuild/ abuild]&#039;&#039; script reads the &#039;&#039;[http://git.alpinelinux.org/cgit/abuild/tree/sample.APKBUILD APKBUILD]&#039;&#039; and executes the steps needed to create a package. &lt;br /&gt;
&lt;br /&gt;
=== The aports tree  ===&lt;br /&gt;
&lt;br /&gt;
The [http://git.alpinelinux.org/cgit/aports aports] tree is a [http://git.alpinelinux.org/cgit/aports/tree directory tree] with many APKBUILDs. Those files are used when building alpine from source. &lt;br /&gt;
&lt;br /&gt;
== Installing and configuring the alpine-sdk  ==&lt;br /&gt;
&lt;br /&gt;
The alpine-sdk is a metapackage that pulls in the most essential packages used to build new packages.&amp;lt;BR&amp;gt;&lt;br /&gt;
Install those packages now: &lt;br /&gt;
&lt;br /&gt;
{{Cmd|apk add alpine-sdk}}&lt;br /&gt;
&lt;br /&gt;
This would be a good time to create a normal user account for you to work in. (You weren&#039;t going to develop as root now, were you!) To create the user:&lt;br /&gt;
&lt;br /&gt;
{{Cmd|adduser &amp;lt;yourusername&amp;gt;}}&lt;br /&gt;
&lt;br /&gt;
To make life easier later, it&#039;s a good idea to add this user to /etc/sudoers. Append the line&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;yourusername&amp;gt;    ALL=(ALL) ALL&lt;br /&gt;
&lt;br /&gt;
using the command:&lt;br /&gt;
&lt;br /&gt;
{{Cmd|visudo}}&lt;br /&gt;
&lt;br /&gt;
Now logout of the root account, and login as &amp;lt;yourusername&amp;gt;. From here on everything can be done in a normal user account, and operations that require superuser privileges can be done with sudo.&lt;br /&gt;
&lt;br /&gt;
The aports tree is in git so before we clone the aports tree we should configure git.&lt;br /&gt;
&lt;br /&gt;
{{Cmd|git config --global user.name &amp;quot;Your Full Name&amp;quot;&lt;br /&gt;
git config --global user.email &amp;quot;your@email.address&amp;quot;}}&lt;br /&gt;
&lt;br /&gt;
Now we can clone the aports tree. &lt;br /&gt;
&lt;br /&gt;
{{Cmd|git clone git://dev.alpinelinux.org/aports}}&lt;br /&gt;
&lt;br /&gt;
Before we start creating or modifying APKBUILD files we need to setup abuild to our system/user. Edit the file abuild.conf to your requirements. Most of the defaults can be left alone, unless you are developing for a custom platform, in which case the comments in the file should guide you. The one field to edit is PACKAGER, so that you can get credit (or blame) for packages you create.&lt;br /&gt;
&lt;br /&gt;
{{Cmd|sudo vi /etc/abuild.conf}}&lt;br /&gt;
&lt;br /&gt;
We also need to prepare the location that the build process caches files when they are downloaded. By default this is /var/cache/distfiles. To create this directory and ensure that it is writeable, enter the following commands:&lt;br /&gt;
&lt;br /&gt;
{{Cmd|sudo mkdir -p /var/cache/distfiles}}&lt;br /&gt;
{{Cmd|sudo chmod a+w /var/cache/distfiles}}&lt;br /&gt;
&lt;br /&gt;
Or add yourself to the abuild group&lt;br /&gt;
&lt;br /&gt;
{{Cmd|sudo groupadd &amp;lt;yourusername&amp;gt; abuild}}&lt;br /&gt;
&lt;br /&gt;
The last step in preparation is to configure the security keys for abuild with the command:&lt;br /&gt;
&lt;br /&gt;
{{Cmd|abuild-keygen -a -i}}&lt;br /&gt;
&lt;br /&gt;
== Getting some help ==&lt;br /&gt;
&lt;br /&gt;
It might be wise to start by checking what the abuild program can/cannot do.&lt;br /&gt;
&lt;br /&gt;
{{Cmd|abuild -h}}&lt;br /&gt;
&lt;br /&gt;
== Creating an APKBUILD file  ==&lt;br /&gt;
&lt;br /&gt;
=== Use a template APKBUILD ===&lt;br /&gt;
&lt;br /&gt;
To create the actual APKBUILD file &amp;lt;tt&amp;gt;newapkbuild&amp;lt;/tt&amp;gt; can serve you a template to start with. It will create a directory with the given package name, place an example/template APKBUILD file to the given directory, and fill some variables if those are provided. Please check the [[Package_policies| package policies]] page about naming details.&lt;br /&gt;
&lt;br /&gt;
If you doubt to which repository your package belongs to you can safely use &#039;&#039;&#039;testing&#039;&#039;&#039;. Building package in your aports/testing directory is not mandatory but this way the package is already at the right place.&lt;br /&gt;
&lt;br /&gt;
{{Cmd|newapkbuild &#039;&#039;packagename&#039;&#039;}}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;newapkbuild options&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;-a&#039;&#039;&#039;  Create autotools (use ./configure ...)&lt;br /&gt;
* &#039;&#039;&#039;-c&#039;&#039;&#039;  Copy a sample init.d, conf.d and install script to new directory&lt;br /&gt;
* &#039;&#039;&#039;-d&#039;&#039;&#039;  Set package description (pkgdesc) to DESC&lt;br /&gt;
* &#039;&#039;&#039;-f&#039;&#039;&#039;  Force even if directory already exist&lt;br /&gt;
* &#039;&#039;&#039;-h&#039;&#039;&#039;  Show this help&lt;br /&gt;
* &#039;&#039;&#039;-l&#039;&#039;&#039;  Set package license to LICENSE&lt;br /&gt;
* &#039;&#039;&#039;-p&#039;&#039;&#039;  Create perl package (Assume Makefile.PL is there)&lt;br /&gt;
* &#039;&#039;&#039;-u&#039;&#039;&#039;  Set package URL&lt;br /&gt;
* &#039;&#039;&#039;-s&#039;&#039;&#039;  Use sourceforge source url&lt;br /&gt;
&lt;br /&gt;
{{Note|On older Alpine systems, abuild -c -n &#039;&#039;packagename&#039;&#039; was the way to create APKBUILD files. The &#039;packagename&#039; was a parameter to the -n option so order of -c and -n matters. }}&lt;br /&gt;
&lt;br /&gt;
If you are create a daemon package which needs initd scripts you can add the -c making it: &lt;br /&gt;
&lt;br /&gt;
{{Cmd|newapkbuild -c &#039;&#039;packagename&#039;&#039;}}&lt;br /&gt;
&lt;br /&gt;
This will copy the sample initd and confd files to the build directory.&amp;lt;BR&amp;gt;&lt;br /&gt;
A third file sample.install file will be copied as well (we will discuss this later on).&lt;br /&gt;
&lt;br /&gt;
=== Modify your APKBUILD ===&lt;br /&gt;
Edit APKBUILD and fill in the needed info (especially pkgname, pkgver, pkgdesc, url, license, depends and source). &lt;br /&gt;
&lt;br /&gt;
If you are going to use any of the variables for directories like $pkgdir, always make sure they are double quoted like: &lt;br /&gt;
&lt;br /&gt;
 &amp;quot;$pkgdir&amp;quot;/somedir&lt;br /&gt;
&lt;br /&gt;
This will prevent issues with spaces/special characters in the future. &lt;br /&gt;
&lt;br /&gt;
{{Note|If you like syntax highlighting we suggest you to install vim. We have setup vim to recognize the APKBUILD file as a bash scripts so its easier to read them.}}&lt;br /&gt;
&lt;br /&gt;
=== APKBUILD variables/functions  ===&lt;br /&gt;
&lt;br /&gt;
==== source  ====&lt;br /&gt;
&lt;br /&gt;
The source variable is not only used to list the remote source files to fetch, it is also used to list the local files that abuild will need in order to build the apk. Examples of such local files include: init.d files, conf.d files, install files (see [[Creating an Alpine package#install|install variable]]), patches, and all other necessary files.&lt;br /&gt;
&lt;br /&gt;
Here are few things to note:&lt;br /&gt;
&lt;br /&gt;
* When you are finished adding local and/or remote files to &#039;&#039;source&#039;&#039;, you can execute the following command to add their checksums to the APKBUILD file:&lt;br /&gt;
: {{cmd|abuild checksum}}&lt;br /&gt;
: {{Note|When later updating the content of &#039;&#039;source&#039;&#039;, or updating a file that is listed in &#039;&#039;source&#039;&#039;, you must also update their checksums again with the same command.}}&lt;br /&gt;
&lt;br /&gt;
* When the remote file is hosted at SourceForge, it&#039;s best to specify the special mirrors link used by SourceForge:&lt;br /&gt;
: &amp;lt;pre&amp;gt;http://downloads.sourceforge.net/$pkgname/$pkgname-$pkgver.tar.gz&amp;lt;/pre&amp;gt;&lt;br /&gt;
: (or similar depending on the package).&lt;br /&gt;
&lt;br /&gt;
* When the remote filename is not specified in the URI (ie, does not end in &#039;/software-1.0.tar.gz&#039;), such as:&lt;br /&gt;
: &amp;lt;pre&amp;gt;http://oss.example.org/?get=software&amp;amp;ver=1.0&amp;lt;/pre&amp;gt;&lt;br /&gt;
: You must prepend &#039;saveas-&#039; to the protocol and append &#039;/software-1.0.tar.gz&#039; (for instance) to the end of the URI, like so:&lt;br /&gt;
: &amp;lt;pre&amp;gt;saveas-http://oss.example.org/?get=software&amp;amp;ver=1.0/software-1.0.tar.gz&amp;lt;/pre&amp;gt;&lt;br /&gt;
: This causes the file to be saved as &#039;&#039;software-1.0.tar.gz&#039;&#039; where abuild can use it, instead of &#039;&#039;?get=software&amp;amp;ver=1.0&#039;&#039;, where abuild cannot use it.&lt;br /&gt;
&lt;br /&gt;
* abuild currently supports the following protocols for remote file retrieval:&lt;br /&gt;
** http&lt;br /&gt;
** https&lt;br /&gt;
** ftp&lt;br /&gt;
&lt;br /&gt;
: {{Note|If the you want to download from https, you need GNU wget installed on your system.}}&lt;br /&gt;
 &lt;br /&gt;
* abuild currently supports the following archive types/archive file extensions:&lt;br /&gt;
** .tar.gz / .tgz&lt;br /&gt;
** .tar.bz2&lt;br /&gt;
** .tar.lzma&lt;br /&gt;
** .tar.xz&lt;br /&gt;
** .zip&lt;br /&gt;
&lt;br /&gt;
==== depends &amp;amp;amp; makedepends  ====&lt;br /&gt;
&lt;br /&gt;
Depends are the actual running dependencies that a package would need when it is running. Makedepends are only needed when you are building a package. If you set a package, in depends you do not need to add it to makedepends as well. The best way to find out what the depends and makedepends of a package are is to [http://en.wikipedia.org/wiki/Rtfm RTFM]. &lt;br /&gt;
&lt;br /&gt;
No kidding, lots of important information can be found it the package INSTALL and README file (or the likes). Another good way is the run ./configure --help from the source directory to see which options are needed for configure to finish without errors. If you do not yet have a src directory you can create one with the command: &lt;br /&gt;
&lt;br /&gt;
{{Cmd|abuild unpack}}&lt;br /&gt;
&lt;br /&gt;
Running configure will also show you how you can disable a specific option for this package. A good example is for instance &amp;quot;--disable-nls&amp;quot; which will disable native language support and thus does not depend on gettext(libiconv,glib..). &lt;br /&gt;
&lt;br /&gt;
Alpine likes to keep things small, so we try to disable as much as possible without losing too many features. The exact disable/enable options are decided the package builder but please try to follow Alpine&#039;s design concept as much as possible. &lt;br /&gt;
&lt;br /&gt;
An easy way of quickly finding out the build info for a package is to check Arch Linux (Alpine package management and build scripts are similar) or Gentoo linux ebuilds (previous versions of Alpine were based on Gentoo). &lt;br /&gt;
&lt;br /&gt;
* [http://www.gentoo-portage.com Search ebuilds] &lt;br /&gt;
* [http://sources.gentoo.org/viewcvs.py/gentoo-x86/ Gentoo CVS] &lt;br /&gt;
* [http://www.archlinux.org/packages/search/ Arch Linux packages] &lt;br /&gt;
&lt;br /&gt;
After the package is successfully compiled and created we should make sure it didn&#039;t link to any package that is not present in the $depends variable. We do this by using scanelf. If scanelf is not yet installed on your system you can do that by installing pax-utils. &lt;br /&gt;
&lt;br /&gt;
{{Cmd|scanelf -nR pkg}}&lt;br /&gt;
&lt;br /&gt;
An example output of libcurl would be: &lt;br /&gt;
&lt;br /&gt;
 ET_DYN libssl.so.0.9.8,libcrypto.so.0.9.8,libz.so.1,libc.so.0,ld-uClibc.so.0 pkg/usr/lib/libcurl.so.4.1.1&lt;br /&gt;
&lt;br /&gt;
You can see the needed files and should be able to find out which file belongs to which package.&lt;br /&gt;
&lt;br /&gt;
==== license  ====&lt;br /&gt;
&lt;br /&gt;
If a package has a special/custom license we need to provide it with the release. Because we want to save space and don&#039;t like to have licenses all over our system we have decided to include the license in the doc subpackage. Please follow the following guidelines to add a proper license. Locate the license file inside the source package. Add the doc subpackage to the $subpackages variable as follows: &lt;br /&gt;
&lt;br /&gt;
 subpackages=&amp;quot;$pkgname-doc&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Add a similar line to the following to your package() function, depending on the license description file: &lt;br /&gt;
&lt;br /&gt;
 install -Dm644 COPYING &amp;quot;$pkgdir&amp;quot;/usr/share/licenses/$pkgname/COPYING&lt;br /&gt;
&lt;br /&gt;
If you follow these steps then abuild will automatically add the license to the package-doc apk for you.&lt;br /&gt;
&lt;br /&gt;
==== arch ====&lt;br /&gt;
&lt;br /&gt;
The package architecture(s) to build for.  This can be one of: &#039;&#039;x86, x86_64, all,&#039;&#039; or &#039;&#039;noarch&#039;&#039;, where &#039;&#039;all&#039;&#039; means all architectures, and &#039;&#039;noarch&#039;&#039; means it&#039;s architecture-independent (ie, a pure-python package).&lt;br /&gt;
{{Tip|To determine if your APKBUILD can use &#039;&#039;noarch&#039;&#039;, build the package for your architecture and then run &amp;quot;scanelf -R pkg&amp;quot; from the directory that the APKBUILD resides in, in order to scan for ELF files in the &#039;&#039;./pkg&#039;&#039; directory.  If you do NOT get output from this, then &#039;&#039;noarch&#039;&#039; can be used.}}&lt;br /&gt;
&lt;br /&gt;
==== url  ====&lt;br /&gt;
&lt;br /&gt;
Website address for the program. This is usefully later on when either finding documentation or other information about the package.&lt;br /&gt;
&lt;br /&gt;
==== pkgdesc  ====&lt;br /&gt;
&lt;br /&gt;
A brief, one line, description of what the package does. Useful for the package management system.&lt;br /&gt;
&lt;br /&gt;
Here is an example from apk_info for the OpenSSH client package&lt;br /&gt;
&lt;br /&gt;
 pkgdesc=&amp;quot;Port of OpenBSD&#039;s free SSH release - client&amp;quot;&lt;br /&gt;
&lt;br /&gt;
==== pkgver  ====&lt;br /&gt;
&lt;br /&gt;
Provide the release number of the package you are building.&lt;br /&gt;
&lt;br /&gt;
==== pkgrel  ====&lt;br /&gt;
&lt;br /&gt;
The $pkgrel versioning is made so if you change something to your APKBUILD file without changing the actual $pkgver you can higer pkgrel so apk tools will detect it as an update. For instance if you forget to add a dependency you can add it afterward and you can +1 pkgver so apk finds this update and add the missing dependency. &lt;br /&gt;
&lt;br /&gt;
==== pkgname  ====&lt;br /&gt;
&lt;br /&gt;
The base name of the package you are creating.  For Freeswitch 1.0.6, you would use &amp;quot;freeswitch&amp;quot;&lt;br /&gt;
&lt;br /&gt;
==== install  ====&lt;br /&gt;
&lt;br /&gt;
There are 6 different kinds of install scripts. Each script is called with the $pkgname.&#039;&#039;&amp;lt;action&amp;gt;&#039;&#039; where &#039;&#039;&amp;lt;action&amp;gt;&#039;&#039; is one of the following:&lt;br /&gt;
&lt;br /&gt;
===== $pkgname.pre-install =====&lt;br /&gt;
This script is executed before package is installed. Typical use is when package needs a user/group to be created. For example:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#!/bin/sh&lt;br /&gt;
adduser -H -s /bin/false -D clamav 2&amp;gt;/dev/null&lt;br /&gt;
exit 0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Note the &#039;&#039;exit 0&#039;&#039; at the end. If the script exits with failure (if the user already exist), the package will not be installed and apk add will exit with failure.&lt;br /&gt;
&lt;br /&gt;
===== $pkgname.post-install =====&lt;br /&gt;
This script is executed after package is installed. Can be used to generate font cache and similar.&lt;br /&gt;
&lt;br /&gt;
===== $pkgname.pre-upgrade =====&lt;br /&gt;
Same as pre-install but is executed before upgrading an already installed package.&lt;br /&gt;
&lt;br /&gt;
===== $pkgname.post-upgrade =====&lt;br /&gt;
Same as post-install but is executed after upgrading an already installed package. &lt;br /&gt;
&lt;br /&gt;
===== $pkgname.pre-deinstall =====&lt;br /&gt;
This script is executed before uninstalling a package. If script exits with failure apk will not uninstall the package.&lt;br /&gt;
&lt;br /&gt;
===== $pkgname.post-deinstall =====&lt;br /&gt;
This script is executed after a package have been uninstalled. Can be used to update font caches and restore busybox links. For example:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#!/bin/sh&lt;br /&gt;
busybox --install -s&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If the package have an pre-install and post-install script the APKBUILD should have the &#039;&#039;install&#039;&#039; variable defined and the scripts should also be added to the source variable:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
...&lt;br /&gt;
install=&amp;quot;$pkgname.pre-install $pkgname.post-install&amp;quot;&lt;br /&gt;
source=&amp;quot;http://....&lt;br /&gt;
       $install&amp;quot;&lt;br /&gt;
...&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== subpackages  ====&lt;br /&gt;
&lt;br /&gt;
$subpackages are made to split up the normal &amp;quot;make install&amp;quot; into separate packages. The most common subpackages we use are doc and dev. Because we like to keep our target system small we move documentation and development files (only needed when building packages) into separate packages. To use the specific program a user only need to install the base apk without package-doc or package-dev, but if he wants to read the manual he will need to install package-doc. &lt;br /&gt;
&lt;br /&gt;
The easiest way to find out if you need to use -dev and -doc is to first build the package without these options set and wait until the build finishes. When its finished you should have a pkg directory which is the fake root directory. Inside this directory you will see the structure as how it would be installed in / on the target system. &lt;br /&gt;
&lt;br /&gt;
To see if you need the -dev package you can run the following cmd: &lt;br /&gt;
&lt;br /&gt;
{{Cmd|find pkg/usr/ -name &#039;*.[acho]&#039; -o -name &#039;*.la&#039;}}&lt;br /&gt;
&lt;br /&gt;
If this returns any files you need to include the -dev package. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt; To see if you need the -doc package you can run the following cmd: &lt;br /&gt;
&lt;br /&gt;
{{Cmd|find pkg/usr/share -name doc -o -name man -o -name info -o -name html -o -name sgml -o -name licenses}}&lt;br /&gt;
&lt;br /&gt;
If this returns any directories you need to include the -doc package. &lt;br /&gt;
&lt;br /&gt;
===== Custom subpackages  =====&lt;br /&gt;
&lt;br /&gt;
Some applications will have except doc and dev files other non needed at run time files which we want to separate away from the base package. Some packages include large test suites which are only needed in specific circumstances or binaries which have depends which we prefer not to install. To handle those we create our own package/function. In the APKBUILD below the build() function we create another function: &lt;br /&gt;
&lt;br /&gt;
 test() {&lt;br /&gt;
        mkdir -p &amp;quot;$subpkgdir&amp;quot;/usr&lt;br /&gt;
        mv &amp;quot;$pkgdir&amp;quot;/usr/package-test &amp;quot;$subpkgdir&amp;quot;/usr/&lt;br /&gt;
 }&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
We also need to add the package info to $subpackages variable: &lt;br /&gt;
&lt;br /&gt;
 subpackages=&amp;quot;$pkgname-doc $pkgname-dev $pkgname-test&amp;quot;&lt;br /&gt;
&lt;br /&gt;
After we finish building the package you should see another apk called packagename-test.apk which includes the files which we moved to the $subpkgdir dir. &lt;br /&gt;
&lt;br /&gt;
The above mentioned variables can also be used in our custom function. If we want for instance to build the test() function with perl support we would add: &lt;br /&gt;
&lt;br /&gt;
 depends=&amp;quot;perl&amp;quot;&lt;br /&gt;
 makedepends=&amp;quot;perl-dev&amp;quot;&lt;br /&gt;
&lt;br /&gt;
If we would install the base package it would not install perl, but if we install the package-test package it would.&lt;br /&gt;
&lt;br /&gt;
==== Patches  ====&lt;br /&gt;
&lt;br /&gt;
Please make sure you always submit human readable patches. Way&#039;s to create them are: &lt;br /&gt;
&lt;br /&gt;
directory compare: &lt;br /&gt;
&lt;br /&gt;
{{Cmd|diff -urp original_directory new_directory &amp;amp;gt; filename.patch}}&lt;br /&gt;
&lt;br /&gt;
file compare: &lt;br /&gt;
&lt;br /&gt;
{{Cmd|diff -up original.file new.file &amp;amp;gt; filename.patch}}&lt;br /&gt;
&lt;br /&gt;
If you are going to use multiple patches for a single package, the preferred way to handle those is a loop and numbering the patches. &lt;br /&gt;
&lt;br /&gt;
 for i in &amp;quot;$srcdir&amp;quot;/*.patch; do&lt;br /&gt;
        msg &amp;quot;Applying ${i}&amp;quot;&lt;br /&gt;
        patch -p0 -i $i || return 1&lt;br /&gt;
 done&lt;br /&gt;
&lt;br /&gt;
Because multiple patches can patch the same file, we could create offset for the next patch. To make sure we always patch in a specified way we should number the patches as followed: &lt;br /&gt;
&lt;br /&gt;
 10-patch1.patch 20-patch2.patch 30-patch3.patch&lt;br /&gt;
&lt;br /&gt;
This way we are always sure patch 1 is first and if we want to add additional patches between them we can use 11,12,21,22... &lt;br /&gt;
&lt;br /&gt;
==== Configure options  ====&lt;br /&gt;
&lt;br /&gt;
Alpine has some default configure options we set by default. We use /usr for prefix to make sure everything is installed with /usr in front of it. If you notice that anything is installed in the wrong directory please run {{Cmd|./configure --help}} and see if you can set the correct location. &lt;br /&gt;
&lt;br /&gt;
We are not covering the depend switches here we have discussed this already in the depend section.&lt;br /&gt;
&lt;br /&gt;
{{Tip|Common steps for building package contain &#039;&#039;./configure&#039;&#039;, &#039;&#039;make&#039;&#039; and &#039;&#039;make install&#039;&#039;. Everyone of them should be enclosed by &#039;&#039;&amp;amp;#124;&amp;amp;#124; return 1&#039;&#039; to check exit status. Otherwise even if previous step fails e.g. &#039;&#039;./configure&#039;&#039;, next will be launched e.g. &#039;&#039;make&#039;&#039;. This complicates tracing the point, where package brakes. The same applies to installing additional files.}}&lt;br /&gt;
&lt;br /&gt;
==== Make options  ====&lt;br /&gt;
&lt;br /&gt;
If you notice weird problems when compiling or installing the package with make/make install you could try to disable [http://www.gnu.org/software/make/manual/make.html#Parallel parallel] building/installing. A normal make line would be: &lt;br /&gt;
&lt;br /&gt;
 make || return 1&lt;br /&gt;
&lt;br /&gt;
To disable parallel we use: &lt;br /&gt;
&lt;br /&gt;
 make -j1 || return 1&lt;br /&gt;
&lt;br /&gt;
We can use the same for make install. &lt;br /&gt;
&lt;br /&gt;
Because we do not want to install the package in our build environment but we want to install it in a fake root directory we need to tell &#039;make install&#039; to use another destination directory instead of &#039;/&#039;. We do this by setting a variable when we execute make install as followed: &lt;br /&gt;
&lt;br /&gt;
 make DESTDIR=&amp;quot;$pkgdir&amp;quot; install&lt;br /&gt;
&lt;br /&gt;
Please note that some Makefiles do not support this variable and will always install software in &#039;/&#039;. To make sure you do not mess up your build system NEVER run your build system as root but always use a custom user and sudo when needed. If by accident the Makefile does not support DESTDIR variable it will fail to install in our build system system directories.&lt;br /&gt;
&lt;br /&gt;
==== _builddir ====&lt;br /&gt;
If you used &amp;lt;tt&amp;gt;newapkbuild&amp;lt;/tt&amp;gt; to create your APKBUILD file, you must specify the path to your unpacked sources. Inside the sections during the prepare/build/install process &#039;&#039;_builddir&#039;&#039; is used. Most of the time a combination of &#039;&#039;$srcdir&#039;&#039; and &#039;&#039;$pkgname-$pkgver&#039;&#039; will work. When not, check the /src directory or the source tarball for the right string. Especially when you are working with automatically generated tarballs (like from github and gitorious), this needs to be adjusted.&lt;br /&gt;
&lt;br /&gt;
 _builddir=&amp;quot;$srcdir&amp;quot;/$pkgname-$pkgver&lt;br /&gt;
&lt;br /&gt;
==== Additional files  ====&lt;br /&gt;
&lt;br /&gt;
If you want/need to install additional files not mentioned above you can use the following cmd (this is an example of a conf file): &lt;br /&gt;
&lt;br /&gt;
 install -Dm644 doc/$pkgname.conf &amp;quot;$pkgdir&amp;quot;/etc/$pkgname.conf&lt;br /&gt;
&lt;br /&gt;
== Build the package  ==&lt;br /&gt;
&lt;br /&gt;
If you did not already create the checksums as mentioned above you can do so now: &lt;br /&gt;
&lt;br /&gt;
{{Cmd|cd $pkgname&lt;br /&gt;
abuild checksum}}&lt;br /&gt;
&lt;br /&gt;
It&#039;s about time we build our package. Because a build system should never have all the package installed to prevent linking to packages we don&#039;t want it to link we use a abuild recursively with the &#039;&#039;&#039;-r&#039;&#039;&#039; switch. It will install all dependency&#039;s from your repository and builds it, afterwards it will uninstall all those depending packages again. You could also use the &#039;&#039;&#039;-R&#039;&#039;&#039; switch which would build your package including the dependency packages. &lt;br /&gt;
&lt;br /&gt;
{{Cmd|abuild -r}}&lt;br /&gt;
&lt;br /&gt;
== Commit your work  ==&lt;br /&gt;
&lt;br /&gt;
After you successfully build your package you can submit your APKBUILD to alpine git repository. &lt;br /&gt;
&lt;br /&gt;
Update your git repo, before adding new files: &lt;br /&gt;
&lt;br /&gt;
{{Cmd|cd $aportsdir&lt;br /&gt;
git pull}}&lt;br /&gt;
&lt;br /&gt;
This should pull all the changes made by others into you local git repo. When you think you are ready you can add your files to git: &lt;br /&gt;
&lt;br /&gt;
{{Cmd|cd $apkbuilddir&lt;br /&gt;
git add APKBUILD (include any other files needed for the build; $pkgname.install...)&lt;br /&gt;
git commit}}&lt;br /&gt;
&lt;br /&gt;
Now your changes are only available locally in your repository. Because you do not have push rights to the Alpine aports repository you need to create diff (patch) of the changes you made and send this patch to the [http://lists.alpinelinux.org/alpine-devel/ alpine-devel mailinglist].&lt;br /&gt;
&lt;br /&gt;
== Send a patch ==&lt;br /&gt;
&lt;br /&gt;
[[Creating_patches#Only_the_last_commit_with_.27git_send-email.27|git send-email]] will do that for you.&lt;br /&gt;
&lt;br /&gt;
== See Also ==&lt;br /&gt;
* [[APKBUILD Reference]]&lt;br /&gt;
* [[Development using git]]&lt;/div&gt;</summary>
		<author><name>Forth</name></author>
	</entry>
	<entry>
		<id>https://wiki.alpinelinux.org/w/index.php?title=Creating_an_Alpine_package&amp;diff=5629</id>
		<title>Creating an Alpine package</title>
		<link rel="alternate" type="text/html" href="https://wiki.alpinelinux.org/w/index.php?title=Creating_an_Alpine_package&amp;diff=5629"/>
		<updated>2011-08-14T19:58:47Z</updated>

		<summary type="html">&lt;p&gt;Forth: /* Installing and configuring the alpine-sdk */  add your user to abuild group&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== General ==&lt;br /&gt;
&lt;br /&gt;
This document assumes that you have a working [[Setting up the build environment|build environment]], or use a diskbased alpine installation. &lt;br /&gt;
&lt;br /&gt;
=== The APKBUILDs  ===&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;[http://git.alpinelinux.org/cgit/abuild/ abuild]&#039;&#039; script reads the &#039;&#039;[http://git.alpinelinux.org/cgit/abuild/tree/sample.APKBUILD APKBUILD]&#039;&#039; and executes the steps needed to create a package. &lt;br /&gt;
&lt;br /&gt;
=== The aports tree  ===&lt;br /&gt;
&lt;br /&gt;
The [http://git.alpinelinux.org/cgit/aports aports] tree is a [http://git.alpinelinux.org/cgit/aports/tree directory tree] with many APKBUILDs. Those files are used when building alpine from source. &lt;br /&gt;
&lt;br /&gt;
== Installing and configuring the alpine-sdk  ==&lt;br /&gt;
&lt;br /&gt;
The alpine-sdk is a metapackage that pulls in the most essential packages used to build new packages.&amp;lt;BR&amp;gt;&lt;br /&gt;
Install those packages now: &lt;br /&gt;
&lt;br /&gt;
{{Cmd|apk add alpine-sdk}}&lt;br /&gt;
&lt;br /&gt;
This would be a good time to create a normal user account for you to work in. (You weren&#039;t going to develop as root now, were you!) To create the user:&lt;br /&gt;
&lt;br /&gt;
{{Cmd|adduser &amp;lt;yourusername&amp;gt;}}&lt;br /&gt;
&lt;br /&gt;
To make life easier later, it&#039;s a good idea to add this user to /etc/sudoers. Append the line&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;yourusername&amp;gt;    ALL=(ALL) ALL&lt;br /&gt;
&lt;br /&gt;
using the command:&lt;br /&gt;
&lt;br /&gt;
{{Cmd|visudo}}&lt;br /&gt;
&lt;br /&gt;
add yourself to the abuild group (otherwise you won&#039;t be able to download packages into  /var/cache/distfiles/ )&lt;br /&gt;
&lt;br /&gt;
{{Cmd|sudo groupadd &amp;lt;yourusername&amp;gt; abuild}}&lt;br /&gt;
&lt;br /&gt;
Now logout of the root account, and login as &amp;lt;yourusername&amp;gt;. From here on everything can be done in a normal user account, and operations that require superuser privileges can be done with sudo.&lt;br /&gt;
&lt;br /&gt;
The aports tree is in git so before we clone the aports tree we should configure git.&lt;br /&gt;
&lt;br /&gt;
{{Cmd|git config --global user.name &amp;quot;Your Full Name&amp;quot;&lt;br /&gt;
git config --global user.email &amp;quot;your@email.address&amp;quot;}}&lt;br /&gt;
&lt;br /&gt;
Now we can clone the aports tree. &lt;br /&gt;
&lt;br /&gt;
{{Cmd|git clone git://dev.alpinelinux.org/aports}}&lt;br /&gt;
&lt;br /&gt;
Before we start creating or modifying APKBUILD files we need to setup abuild to our system/user. Edit the file abuild.conf to your requirements. Most of the defaults can be left alone, unless you are developing for a custom platform, in which case the comments in the file should guide you. The one field to edit is PACKAGER, so that you can get credit (or blame) for packages you create.&lt;br /&gt;
&lt;br /&gt;
{{Cmd|sudo vi /etc/abuild.conf}}&lt;br /&gt;
&lt;br /&gt;
We also need to prepare the location that the build process caches files when they are downloaded. By default this is /var/cache/distfiles. To create this directory and ensure that it is writeable, enter the following commands:&lt;br /&gt;
&lt;br /&gt;
{{Cmd|sudo mkdir -p /var/cache/distfiles}}&lt;br /&gt;
{{Cmd|sudo chmod a+w /var/cache/distfiles}}&lt;br /&gt;
&lt;br /&gt;
The last step in preparation is to configure the security keys for abuild with the command:&lt;br /&gt;
&lt;br /&gt;
{{Cmd|abuild-keygen -a -i}}&lt;br /&gt;
&lt;br /&gt;
== Getting some help ==&lt;br /&gt;
&lt;br /&gt;
It might be wise to start by checking what the abuild program can/cannot do.&lt;br /&gt;
&lt;br /&gt;
{{Cmd|abuild -h}}&lt;br /&gt;
&lt;br /&gt;
== Creating an APKBUILD file  ==&lt;br /&gt;
&lt;br /&gt;
=== Use a template APKBUILD ===&lt;br /&gt;
&lt;br /&gt;
To create the actual APKBUILD file &amp;lt;tt&amp;gt;newapkbuild&amp;lt;/tt&amp;gt; can serve you a template to start with. It will create a directory with the given package name, place an example/template APKBUILD file to the given directory, and fill some variables if those are provided. Please check the [[Package_policies| package policies]] page about naming details.&lt;br /&gt;
&lt;br /&gt;
If you doubt to which repository your package belongs to you can safely use &#039;&#039;&#039;testing&#039;&#039;&#039;. Building package in your aports/testing directory is not mandatory but this way the package is already at the right place.&lt;br /&gt;
&lt;br /&gt;
{{Cmd|newapkbuild &#039;&#039;packagename&#039;&#039;}}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;newapkbuild options&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;-a&#039;&#039;&#039;  Create autotools (use ./configure ...)&lt;br /&gt;
* &#039;&#039;&#039;-c&#039;&#039;&#039;  Copy a sample init.d, conf.d and install script to new directory&lt;br /&gt;
* &#039;&#039;&#039;-d&#039;&#039;&#039;  Set package description (pkgdesc) to DESC&lt;br /&gt;
* &#039;&#039;&#039;-f&#039;&#039;&#039;  Force even if directory already exist&lt;br /&gt;
* &#039;&#039;&#039;-h&#039;&#039;&#039;  Show this help&lt;br /&gt;
* &#039;&#039;&#039;-l&#039;&#039;&#039;  Set package license to LICENSE&lt;br /&gt;
* &#039;&#039;&#039;-p&#039;&#039;&#039;  Create perl package (Assume Makefile.PL is there)&lt;br /&gt;
* &#039;&#039;&#039;-u&#039;&#039;&#039;  Set package URL&lt;br /&gt;
* &#039;&#039;&#039;-s&#039;&#039;&#039;  Use sourceforge source url&lt;br /&gt;
&lt;br /&gt;
{{Note|On older Alpine systems, abuild -c -n &#039;&#039;packagename&#039;&#039; was the way to create APKBUILD files. The &#039;packagename&#039; was a parameter to the -n option so order of -c and -n matters. }}&lt;br /&gt;
&lt;br /&gt;
If you are create a daemon package which needs initd scripts you can add the -c making it: &lt;br /&gt;
&lt;br /&gt;
{{Cmd|newapkbuild -c &#039;&#039;packagename&#039;&#039;}}&lt;br /&gt;
&lt;br /&gt;
This will copy the sample initd and confd files to the build directory.&amp;lt;BR&amp;gt;&lt;br /&gt;
A third file sample.install file will be copied as well (we will discuss this later on).&lt;br /&gt;
&lt;br /&gt;
=== Modify your APKBUILD ===&lt;br /&gt;
Edit APKBUILD and fill in the needed info (especially pkgname, pkgver, pkgdesc, url, license, depends and source). &lt;br /&gt;
&lt;br /&gt;
If you are going to use any of the variables for directories like $pkgdir, always make sure they are double quoted like: &lt;br /&gt;
&lt;br /&gt;
 &amp;quot;$pkgdir&amp;quot;/somedir&lt;br /&gt;
&lt;br /&gt;
This will prevent issues with spaces/special characters in the future. &lt;br /&gt;
&lt;br /&gt;
{{Note|If you like syntax highlighting we suggest you to install vim. We have setup vim to recognize the APKBUILD file as a bash scripts so its easier to read them.}}&lt;br /&gt;
&lt;br /&gt;
=== APKBUILD variables/functions  ===&lt;br /&gt;
&lt;br /&gt;
==== source  ====&lt;br /&gt;
&lt;br /&gt;
The source variable is not only used to list the remote source files to fetch, it is also used to list the local files that abuild will need in order to build the apk. Examples of such local files include: init.d files, conf.d files, install files (see [[Creating an Alpine package#install|install variable]]), patches, and all other necessary files.&lt;br /&gt;
&lt;br /&gt;
Here are few things to note:&lt;br /&gt;
&lt;br /&gt;
* When you are finished adding local and/or remote files to &#039;&#039;source&#039;&#039;, you can execute the following command to add their checksums to the APKBUILD file:&lt;br /&gt;
: {{cmd|abuild checksum}}&lt;br /&gt;
: {{Note|When later updating the content of &#039;&#039;source&#039;&#039;, or updating a file that is listed in &#039;&#039;source&#039;&#039;, you must also update their checksums again with the same command.}}&lt;br /&gt;
&lt;br /&gt;
* When the remote file is hosted at SourceForge, it&#039;s best to specify the special mirrors link used by SourceForge:&lt;br /&gt;
: &amp;lt;pre&amp;gt;http://downloads.sourceforge.net/$pkgname/$pkgname-$pkgver.tar.gz&amp;lt;/pre&amp;gt;&lt;br /&gt;
: (or similar depending on the package).&lt;br /&gt;
&lt;br /&gt;
* When the remote filename is not specified in the URI (ie, does not end in &#039;/software-1.0.tar.gz&#039;), such as:&lt;br /&gt;
: &amp;lt;pre&amp;gt;http://oss.example.org/?get=software&amp;amp;ver=1.0&amp;lt;/pre&amp;gt;&lt;br /&gt;
: You must prepend &#039;saveas-&#039; to the protocol and append &#039;/software-1.0.tar.gz&#039; (for instance) to the end of the URI, like so:&lt;br /&gt;
: &amp;lt;pre&amp;gt;saveas-http://oss.example.org/?get=software&amp;amp;ver=1.0/software-1.0.tar.gz&amp;lt;/pre&amp;gt;&lt;br /&gt;
: This causes the file to be saved as &#039;&#039;software-1.0.tar.gz&#039;&#039; where abuild can use it, instead of &#039;&#039;?get=software&amp;amp;ver=1.0&#039;&#039;, where abuild cannot use it.&lt;br /&gt;
&lt;br /&gt;
* abuild currently supports the following protocols for remote file retrieval:&lt;br /&gt;
** http&lt;br /&gt;
** https&lt;br /&gt;
** ftp&lt;br /&gt;
&lt;br /&gt;
: {{Note|If the you want to download from https, you need GNU wget installed on your system.}}&lt;br /&gt;
 &lt;br /&gt;
* abuild currently supports the following archive types/archive file extensions:&lt;br /&gt;
** .tar.gz / .tgz&lt;br /&gt;
** .tar.bz2&lt;br /&gt;
** .tar.lzma&lt;br /&gt;
** .tar.xz&lt;br /&gt;
** .zip&lt;br /&gt;
&lt;br /&gt;
==== depends &amp;amp;amp; makedepends  ====&lt;br /&gt;
&lt;br /&gt;
Depends are the actual running dependencies that a package would need when it is running. Makedepends are only needed when you are building a package. If you set a package, in depends you do not need to add it to makedepends as well. The best way to find out what the depends and makedepends of a package are is to [http://en.wikipedia.org/wiki/Rtfm RTFM]. &lt;br /&gt;
&lt;br /&gt;
No kidding, lots of important information can be found it the package INSTALL and README file (or the likes). Another good way is the run ./configure --help from the source directory to see which options are needed for configure to finish without errors. If you do not yet have a src directory you can create one with the command: &lt;br /&gt;
&lt;br /&gt;
{{Cmd|abuild unpack}}&lt;br /&gt;
&lt;br /&gt;
Running configure will also show you how you can disable a specific option for this package. A good example is for instance &amp;quot;--disable-nls&amp;quot; which will disable native language support and thus does not depend on gettext(libiconv,glib..). &lt;br /&gt;
&lt;br /&gt;
Alpine likes to keep things small, so we try to disable as much as possible without losing too many features. The exact disable/enable options are decided the package builder but please try to follow Alpine&#039;s design concept as much as possible. &lt;br /&gt;
&lt;br /&gt;
An easy way of quickly finding out the build info for a package is to check Arch Linux (Alpine package management and build scripts are similar) or Gentoo linux ebuilds (previous versions of Alpine were based on Gentoo). &lt;br /&gt;
&lt;br /&gt;
* [http://www.gentoo-portage.com Search ebuilds] &lt;br /&gt;
* [http://sources.gentoo.org/viewcvs.py/gentoo-x86/ Gentoo CVS] &lt;br /&gt;
* [http://www.archlinux.org/packages/search/ Arch Linux packages] &lt;br /&gt;
&lt;br /&gt;
After the package is successfully compiled and created we should make sure it didn&#039;t link to any package that is not present in the $depends variable. We do this by using scanelf. If scanelf is not yet installed on your system you can do that by installing pax-utils. &lt;br /&gt;
&lt;br /&gt;
{{Cmd|scanelf -nR pkg}}&lt;br /&gt;
&lt;br /&gt;
An example output of libcurl would be: &lt;br /&gt;
&lt;br /&gt;
 ET_DYN libssl.so.0.9.8,libcrypto.so.0.9.8,libz.so.1,libc.so.0,ld-uClibc.so.0 pkg/usr/lib/libcurl.so.4.1.1&lt;br /&gt;
&lt;br /&gt;
You can see the needed files and should be able to find out which file belongs to which package.&lt;br /&gt;
&lt;br /&gt;
==== license  ====&lt;br /&gt;
&lt;br /&gt;
If a package has a special/custom license we need to provide it with the release. Because we want to save space and don&#039;t like to have licenses all over our system we have decided to include the license in the doc subpackage. Please follow the following guidelines to add a proper license. Locate the license file inside the source package. Add the doc subpackage to the $subpackages variable as follows: &lt;br /&gt;
&lt;br /&gt;
 subpackages=&amp;quot;$pkgname-doc&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Add a similar line to the following to your package() function, depending on the license description file: &lt;br /&gt;
&lt;br /&gt;
 install -Dm644 COPYING &amp;quot;$pkgdir&amp;quot;/usr/share/licenses/$pkgname/COPYING&lt;br /&gt;
&lt;br /&gt;
If you follow these steps then abuild will automatically add the license to the package-doc apk for you.&lt;br /&gt;
&lt;br /&gt;
==== arch ====&lt;br /&gt;
&lt;br /&gt;
The package architecture(s) to build for.  This can be one of: &#039;&#039;x86, x86_64, all,&#039;&#039; or &#039;&#039;noarch&#039;&#039;, where &#039;&#039;all&#039;&#039; means all architectures, and &#039;&#039;noarch&#039;&#039; means it&#039;s architecture-independent (ie, a pure-python package).&lt;br /&gt;
{{Tip|To determine if your APKBUILD can use &#039;&#039;noarch&#039;&#039;, build the package for your architecture and then run &amp;quot;scanelf -R pkg&amp;quot; from the directory that the APKBUILD resides in, in order to scan for ELF files in the &#039;&#039;./pkg&#039;&#039; directory.  If you do NOT get output from this, then &#039;&#039;noarch&#039;&#039; can be used.}}&lt;br /&gt;
&lt;br /&gt;
==== url  ====&lt;br /&gt;
&lt;br /&gt;
Website address for the program. This is usefully later on when either finding documentation or other information about the package.&lt;br /&gt;
&lt;br /&gt;
==== pkgdesc  ====&lt;br /&gt;
&lt;br /&gt;
A brief, one line, description of what the package does. Useful for the package management system.&lt;br /&gt;
&lt;br /&gt;
Here is an example from apk_info for the OpenSSH client package&lt;br /&gt;
&lt;br /&gt;
 pkgdesc=&amp;quot;Port of OpenBSD&#039;s free SSH release - client&amp;quot;&lt;br /&gt;
&lt;br /&gt;
==== pkgver  ====&lt;br /&gt;
&lt;br /&gt;
Provide the release number of the package you are building.&lt;br /&gt;
&lt;br /&gt;
==== pkgrel  ====&lt;br /&gt;
&lt;br /&gt;
The $pkgrel versioning is made so if you change something to your APKBUILD file without changing the actual $pkgver you can higer pkgrel so apk tools will detect it as an update. For instance if you forget to add a dependency you can add it afterward and you can +1 pkgver so apk finds this update and add the missing dependency. &lt;br /&gt;
&lt;br /&gt;
==== pkgname  ====&lt;br /&gt;
&lt;br /&gt;
The base name of the package you are creating.  For Freeswitch 1.0.6, you would use &amp;quot;freeswitch&amp;quot;&lt;br /&gt;
&lt;br /&gt;
==== install  ====&lt;br /&gt;
&lt;br /&gt;
There are 6 different kinds of install scripts. Each script is called with the $pkgname.&#039;&#039;&amp;lt;action&amp;gt;&#039;&#039; where &#039;&#039;&amp;lt;action&amp;gt;&#039;&#039; is one of the following:&lt;br /&gt;
&lt;br /&gt;
===== $pkgname.pre-install =====&lt;br /&gt;
This script is executed before package is installed. Typical use is when package needs a user/group to be created. For example:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#!/bin/sh&lt;br /&gt;
adduser -H -s /bin/false -D clamav 2&amp;gt;/dev/null&lt;br /&gt;
exit 0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Note the &#039;&#039;exit 0&#039;&#039; at the end. If the script exits with failure (if the user already exist), the package will not be installed and apk add will exit with failure.&lt;br /&gt;
&lt;br /&gt;
===== $pkgname.post-install =====&lt;br /&gt;
This script is executed after package is installed. Can be used to generate font cache and similar.&lt;br /&gt;
&lt;br /&gt;
===== $pkgname.pre-upgrade =====&lt;br /&gt;
Same as pre-install but is executed before upgrading an already installed package.&lt;br /&gt;
&lt;br /&gt;
===== $pkgname.post-upgrade =====&lt;br /&gt;
Same as post-install but is executed after upgrading an already installed package. &lt;br /&gt;
&lt;br /&gt;
===== $pkgname.pre-deinstall =====&lt;br /&gt;
This script is executed before uninstalling a package. If script exits with failure apk will not uninstall the package.&lt;br /&gt;
&lt;br /&gt;
===== $pkgname.post-deinstall =====&lt;br /&gt;
This script is executed after a package have been uninstalled. Can be used to update font caches and restore busybox links. For example:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#!/bin/sh&lt;br /&gt;
busybox --install -s&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If the package have an pre-install and post-install script the APKBUILD should have the &#039;&#039;install&#039;&#039; variable defined and the scripts should also be added to the source variable:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
...&lt;br /&gt;
install=&amp;quot;$pkgname.pre-install $pkgname.post-install&amp;quot;&lt;br /&gt;
source=&amp;quot;http://....&lt;br /&gt;
       $install&amp;quot;&lt;br /&gt;
...&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== subpackages  ====&lt;br /&gt;
&lt;br /&gt;
$subpackages are made to split up the normal &amp;quot;make install&amp;quot; into separate packages. The most common subpackages we use are doc and dev. Because we like to keep our target system small we move documentation and development files (only needed when building packages) into separate packages. To use the specific program a user only need to install the base apk without package-doc or package-dev, but if he wants to read the manual he will need to install package-doc. &lt;br /&gt;
&lt;br /&gt;
The easiest way to find out if you need to use -dev and -doc is to first build the package without these options set and wait until the build finishes. When its finished you should have a pkg directory which is the fake root directory. Inside this directory you will see the structure as how it would be installed in / on the target system. &lt;br /&gt;
&lt;br /&gt;
To see if you need the -dev package you can run the following cmd: &lt;br /&gt;
&lt;br /&gt;
{{Cmd|find pkg/usr/ -name &#039;*.[acho]&#039; -o -name &#039;*.la&#039;}}&lt;br /&gt;
&lt;br /&gt;
If this returns any files you need to include the -dev package. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt; To see if you need the -doc package you can run the following cmd: &lt;br /&gt;
&lt;br /&gt;
{{Cmd|find pkg/usr/share -name doc -o -name man -o -name info -o -name html -o -name sgml -o -name licenses}}&lt;br /&gt;
&lt;br /&gt;
If this returns any directories you need to include the -doc package. &lt;br /&gt;
&lt;br /&gt;
===== Custom subpackages  =====&lt;br /&gt;
&lt;br /&gt;
Some applications will have except doc and dev files other non needed at run time files which we want to separate away from the base package. Some packages include large test suites which are only needed in specific circumstances or binaries which have depends which we prefer not to install. To handle those we create our own package/function. In the APKBUILD below the build() function we create another function: &lt;br /&gt;
&lt;br /&gt;
 test() {&lt;br /&gt;
        mkdir -p &amp;quot;$subpkgdir&amp;quot;/usr&lt;br /&gt;
        mv &amp;quot;$pkgdir&amp;quot;/usr/package-test &amp;quot;$subpkgdir&amp;quot;/usr/&lt;br /&gt;
 }&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
We also need to add the package info to $subpackages variable: &lt;br /&gt;
&lt;br /&gt;
 subpackages=&amp;quot;$pkgname-doc $pkgname-dev $pkgname-test&amp;quot;&lt;br /&gt;
&lt;br /&gt;
After we finish building the package you should see another apk called packagename-test.apk which includes the files which we moved to the $subpkgdir dir. &lt;br /&gt;
&lt;br /&gt;
The above mentioned variables can also be used in our custom function. If we want for instance to build the test() function with perl support we would add: &lt;br /&gt;
&lt;br /&gt;
 depends=&amp;quot;perl&amp;quot;&lt;br /&gt;
 makedepends=&amp;quot;perl-dev&amp;quot;&lt;br /&gt;
&lt;br /&gt;
If we would install the base package it would not install perl, but if we install the package-test package it would.&lt;br /&gt;
&lt;br /&gt;
==== Patches  ====&lt;br /&gt;
&lt;br /&gt;
Please make sure you always submit human readable patches. Way&#039;s to create them are: &lt;br /&gt;
&lt;br /&gt;
directory compare: &lt;br /&gt;
&lt;br /&gt;
{{Cmd|diff -urp original_directory new_directory &amp;amp;gt; filename.patch}}&lt;br /&gt;
&lt;br /&gt;
file compare: &lt;br /&gt;
&lt;br /&gt;
{{Cmd|diff -up original.file new.file &amp;amp;gt; filename.patch}}&lt;br /&gt;
&lt;br /&gt;
If you are going to use multiple patches for a single package, the preferred way to handle those is a loop and numbering the patches. &lt;br /&gt;
&lt;br /&gt;
 for i in &amp;quot;$srcdir&amp;quot;/*.patch; do&lt;br /&gt;
        msg &amp;quot;Applying ${i}&amp;quot;&lt;br /&gt;
        patch -p0 -i $i || return 1&lt;br /&gt;
 done&lt;br /&gt;
&lt;br /&gt;
Because multiple patches can patch the same file, we could create offset for the next patch. To make sure we always patch in a specified way we should number the patches as followed: &lt;br /&gt;
&lt;br /&gt;
 10-patch1.patch 20-patch2.patch 30-patch3.patch&lt;br /&gt;
&lt;br /&gt;
This way we are always sure patch 1 is first and if we want to add additional patches between them we can use 11,12,21,22... &lt;br /&gt;
&lt;br /&gt;
==== Configure options  ====&lt;br /&gt;
&lt;br /&gt;
Alpine has some default configure options we set by default. We use /usr for prefix to make sure everything is installed with /usr in front of it. If you notice that anything is installed in the wrong directory please run {{Cmd|./configure --help}} and see if you can set the correct location. &lt;br /&gt;
&lt;br /&gt;
We are not covering the depend switches here we have discussed this already in the depend section.&lt;br /&gt;
&lt;br /&gt;
{{Tip|Common steps for building package contain &#039;&#039;./configure&#039;&#039;, &#039;&#039;make&#039;&#039; and &#039;&#039;make install&#039;&#039;. Everyone of them should be enclosed by &#039;&#039;&amp;amp;#124;&amp;amp;#124; return 1&#039;&#039; to check exit status. Otherwise even if previous step fails e.g. &#039;&#039;./configure&#039;&#039;, next will be launched e.g. &#039;&#039;make&#039;&#039;. This complicates tracing the point, where package brakes. The same applies to installing additional files.}}&lt;br /&gt;
&lt;br /&gt;
==== Make options  ====&lt;br /&gt;
&lt;br /&gt;
If you notice weird problems when compiling or installing the package with make/make install you could try to disable [http://www.gnu.org/software/make/manual/make.html#Parallel parallel] building/installing. A normal make line would be: &lt;br /&gt;
&lt;br /&gt;
 make || return 1&lt;br /&gt;
&lt;br /&gt;
To disable parallel we use: &lt;br /&gt;
&lt;br /&gt;
 make -j1 || return 1&lt;br /&gt;
&lt;br /&gt;
We can use the same for make install. &lt;br /&gt;
&lt;br /&gt;
Because we do not want to install the package in our build environment but we want to install it in a fake root directory we need to tell &#039;make install&#039; to use another destination directory instead of &#039;/&#039;. We do this by setting a variable when we execute make install as followed: &lt;br /&gt;
&lt;br /&gt;
 make DESTDIR=&amp;quot;$pkgdir&amp;quot; install&lt;br /&gt;
&lt;br /&gt;
Please note that some Makefiles do not support this variable and will always install software in &#039;/&#039;. To make sure you do not mess up your build system NEVER run your build system as root but always use a custom user and sudo when needed. If by accident the Makefile does not support DESTDIR variable it will fail to install in our build system system directories.&lt;br /&gt;
&lt;br /&gt;
==== _builddir ====&lt;br /&gt;
If you used &amp;lt;tt&amp;gt;newapkbuild&amp;lt;/tt&amp;gt; to create your APKBUILD file, you must specify the path to your unpacked sources. Inside the sections during the prepare/build/install process &#039;&#039;_builddir&#039;&#039; is used. Most of the time a combination of &#039;&#039;$srcdir&#039;&#039; and &#039;&#039;$pkgname-$pkgver&#039;&#039; will work. When not, check the /src directory or the source tarball for the right string. Especially when you are working with automatically generated tarballs (like from github and gitorious), this needs to be adjusted.&lt;br /&gt;
&lt;br /&gt;
 _builddir=&amp;quot;$srcdir&amp;quot;/$pkgname-$pkgver&lt;br /&gt;
&lt;br /&gt;
==== Additional files  ====&lt;br /&gt;
&lt;br /&gt;
If you want/need to install additional files not mentioned above you can use the following cmd (this is an example of a conf file): &lt;br /&gt;
&lt;br /&gt;
 install -Dm644 doc/$pkgname.conf &amp;quot;$pkgdir&amp;quot;/etc/$pkgname.conf&lt;br /&gt;
&lt;br /&gt;
== Build the package  ==&lt;br /&gt;
&lt;br /&gt;
If you did not already create the checksums as mentioned above you can do so now: &lt;br /&gt;
&lt;br /&gt;
{{Cmd|cd $pkgname&lt;br /&gt;
abuild checksum}}&lt;br /&gt;
&lt;br /&gt;
It&#039;s about time we build our package. Because a build system should never have all the package installed to prevent linking to packages we don&#039;t want it to link we use a abuild recursively with the &#039;&#039;&#039;-r&#039;&#039;&#039; switch. It will install all dependency&#039;s from your repository and builds it, afterwards it will uninstall all those depending packages again. You could also use the &#039;&#039;&#039;-R&#039;&#039;&#039; switch which would build your package including the dependency packages. &lt;br /&gt;
&lt;br /&gt;
{{Cmd|abuild -r}}&lt;br /&gt;
&lt;br /&gt;
== Commit your work  ==&lt;br /&gt;
&lt;br /&gt;
After you successfully build your package you can submit your APKBUILD to alpine git repository. &lt;br /&gt;
&lt;br /&gt;
Update your git repo, before adding new files: &lt;br /&gt;
&lt;br /&gt;
{{Cmd|cd $aportsdir&lt;br /&gt;
git pull}}&lt;br /&gt;
&lt;br /&gt;
This should pull all the changes made by others into you local git repo. When you think you are ready you can add your files to git: &lt;br /&gt;
&lt;br /&gt;
{{Cmd|cd $apkbuilddir&lt;br /&gt;
git add APKBUILD (include any other files needed for the build; $pkgname.install...)&lt;br /&gt;
git commit}}&lt;br /&gt;
&lt;br /&gt;
Now your changes are only available locally in your repository. Because you do not have push rights to the Alpine aports repository you need to create diff (patch) of the changes you made and send this patch to the [http://lists.alpinelinux.org/alpine-devel/ alpine-devel mailinglist].&lt;br /&gt;
&lt;br /&gt;
== Send a patch ==&lt;br /&gt;
&lt;br /&gt;
[[Creating_patches#Only_the_last_commit_with_.27git_send-email.27|git send-email]] will do that for you.&lt;br /&gt;
&lt;br /&gt;
== See Also ==&lt;br /&gt;
* [[APKBUILD Reference]]&lt;br /&gt;
* [[Development using git]]&lt;/div&gt;</summary>
		<author><name>Forth</name></author>
	</entry>
	<entry>
		<id>https://wiki.alpinelinux.org/w/index.php?title=Xen_Dom0&amp;diff=5628</id>
		<title>Xen Dom0</title>
		<link rel="alternate" type="text/html" href="https://wiki.alpinelinux.org/w/index.php?title=Xen_Dom0&amp;diff=5628"/>
		<updated>2011-08-14T18:20:28Z</updated>

		<summary type="html">&lt;p&gt;Forth: fully working now&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;So before anything else verify that you car &#039;&#039;&#039;reliably&#039;&#039;&#039; log into your Alpine box through ssh, because with some video chipset (intel in my case) xen will blank your screen so you will have to use ssh.&lt;br /&gt;
&lt;br /&gt;
Then upgrade you setup to Edge / testing (as of the date of writing, Xen is only avaible in Edge).&lt;br /&gt;
Install Xen:&lt;br /&gt;
apk add xen&lt;br /&gt;
&lt;br /&gt;
Modify your extlinux.cfg: http://lists.alpinelinux.org/alpine-devel/1406.html&lt;br /&gt;
&lt;br /&gt;
timeout 20&lt;br /&gt;
prompt 1&lt;br /&gt;
default grsec&lt;br /&gt;
label grsec&lt;br /&gt;
 kernel /boot/vmlinuz-grsec&lt;br /&gt;
 append initrd=/boot/initramfs-grsec root=UUID=f40e340b-ea49-445b-81c0-4d7104b56662 modules=sd-mod,usb-storage,ext4&lt;br /&gt;
label xen&lt;br /&gt;
 kernel mboot.c32&lt;br /&gt;
 append /boot/xen-4.gz console=/dev/null dom0_mem=256M vga=mode-0x0311 --- /boot/vmlinuz-grsec root=UUID=f40e340b-ea49-445b-81c0-4d7104b56662 modules=sd-mod,usb-storage,ext4 vga=785 --- /boot/initramfs-grsec&lt;br /&gt;
&lt;br /&gt;
Of course replace root=UUID= with &#039;&#039;&#039;your&#039;&#039;&#039; UUID in yours.&lt;br /&gt;
Default menu.c32 can mangle with Xen, further investigation needed, so don&#039;t use for now.&lt;br /&gt;
&lt;br /&gt;
Use the script found here: http://lists.xensource.com/archives/html/xen-devel/2010-03/msg01605.html&lt;br /&gt;
&lt;br /&gt;
#!/bin/sh&lt;br /&gt;
&lt;br /&gt;
test -d /proc/xen       || exit 0&lt;br /&gt;
test -f /proc/xen/capabilities  || mount -t xenfs xen /proc/xen&lt;br /&gt;
test -f /proc/xen/capabilities  || exit 0&lt;br /&gt;
grep -q &amp;quot;control_d&amp;quot; /proc/xen/capabilities      || exit 0&lt;br /&gt;
&lt;br /&gt;
for module in xen-evtchn evtchn blkbk netbk; do&lt;br /&gt;
         modprobe ${module}&amp;gt;/dev/null 2&amp;gt;&amp;amp;1&lt;br /&gt;
         done&lt;br /&gt;
&lt;br /&gt;
xl info won&#039;t work&lt;br /&gt;
&lt;br /&gt;
Start xecommons:&lt;br /&gt;
xencommons  use bash, so install it: apk add bash (should try sh instead)&lt;br /&gt;
alpine:/boot# /etc/init.d/xencommons start&lt;br /&gt;
Starting xenstored...FATAL: Failed to open evtchn device: No such file or directory&lt;br /&gt;
&lt;br /&gt;
well this will fail but xl info will work anyway&lt;br /&gt;
&lt;br /&gt;
Oh but wait, evtchn device is built in the kernel, so why is there no /dev/xen/evtch file ?&lt;br /&gt;
let&#039;s start udev ! ;)&lt;br /&gt;
&lt;br /&gt;
That&#039;s all folks !&lt;/div&gt;</summary>
		<author><name>Forth</name></author>
	</entry>
	<entry>
		<id>https://wiki.alpinelinux.org/w/index.php?title=Xen_Dom0&amp;diff=5627</id>
		<title>Xen Dom0</title>
		<link rel="alternate" type="text/html" href="https://wiki.alpinelinux.org/w/index.php?title=Xen_Dom0&amp;diff=5627"/>
		<updated>2011-08-14T17:47:58Z</updated>

		<summary type="html">&lt;p&gt;Forth: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;So before anything else verify that you car &#039;&#039;&#039;reliably&#039;&#039;&#039; log into your Alpine box through ssh, because with some video chipset (intel in my case) xen will blank your screen so you will have to use ssh.&lt;br /&gt;
&lt;br /&gt;
Then upgrade you setup to Edge / testing (as of the date of writing, Xen is only avaible in Edge).&lt;br /&gt;
Install Xen:&lt;br /&gt;
apk add xen&lt;br /&gt;
&lt;br /&gt;
Modify your extlinux.cfg: http://lists.alpinelinux.org/alpine-devel/1406.html&lt;br /&gt;
&lt;br /&gt;
timeout 20&lt;br /&gt;
prompt 1&lt;br /&gt;
default grsec&lt;br /&gt;
label grsec&lt;br /&gt;
 kernel /boot/vmlinuz-grsec&lt;br /&gt;
 append initrd=/boot/initramfs-grsec root=UUID=f40e340b-ea49-445b-81c0-4d7104b56662 modules=sd-mod,usb-storage,ext4&lt;br /&gt;
label xen&lt;br /&gt;
 kernel mboot.c32&lt;br /&gt;
 append /boot/xen-4.gz console=/dev/null dom0_mem=256M vga=mode-0x0311 --- /boot/vmlinuz-grsec root=UUID=f40e340b-ea49-445b-81c0-4d7104b56662 modules=sd-mod,usb-storage,ext4 vga=785 --- /boot/initramfs-grsec&lt;br /&gt;
&lt;br /&gt;
Of course replace root=UUID= with &#039;&#039;&#039;your&#039;&#039;&#039; UUID in yours.&lt;br /&gt;
Default menu.c32 can mangle with Xen, further investigation needed, so don&#039;t use for now.&lt;br /&gt;
&lt;br /&gt;
Use the script found here: http://lists.xensource.com/archives/html/xen-devel/2010-03/msg01605.html&lt;br /&gt;
&lt;br /&gt;
#!/bin/sh&lt;br /&gt;
&lt;br /&gt;
test -d /proc/xen       || exit 0&lt;br /&gt;
test -f /proc/xen/capabilities  || mount -t xenfs xen /proc/xen&lt;br /&gt;
test -f /proc/xen/capabilities  || exit 0&lt;br /&gt;
grep -q &amp;quot;control_d&amp;quot; /proc/xen/capabilities      || exit 0&lt;br /&gt;
&lt;br /&gt;
for module in xen-evtchn evtchn blkbk netbk; do&lt;br /&gt;
         modprobe ${module}&amp;gt;/dev/null 2&amp;gt;&amp;amp;1&lt;br /&gt;
         done&lt;br /&gt;
&lt;br /&gt;
xl info won&#039;t work&lt;br /&gt;
&lt;br /&gt;
Start xecommons:&lt;br /&gt;
xencommons  use bash, so install it: apk add bash (should try sh instead)&lt;br /&gt;
alpine:/boot# /etc/init.d/xencommons start&lt;br /&gt;
Starting xenstored...FATAL: Failed to open evtchn device: No such file or directory&lt;br /&gt;
&lt;br /&gt;
well this will fail but xl info will work anyway&lt;br /&gt;
&lt;br /&gt;
That&#039;s all folks !&lt;/div&gt;</summary>
		<author><name>Forth</name></author>
	</entry>
	<entry>
		<id>https://wiki.alpinelinux.org/w/index.php?title=Xen_Dom0&amp;diff=5625</id>
		<title>Xen Dom0</title>
		<link rel="alternate" type="text/html" href="https://wiki.alpinelinux.org/w/index.php?title=Xen_Dom0&amp;diff=5625"/>
		<updated>2011-08-14T17:32:24Z</updated>

		<summary type="html">&lt;p&gt;Forth: first draft&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;So before anything else verify that you car &#039;&#039;&#039;reliably&#039;&#039;&#039; log into your Alpine box through ssh, because with some video chipset (intel in my case) xen will blank your screen so you will have to use ssh.&lt;br /&gt;
&lt;br /&gt;
Then upgrade you setup to Edge / testing (as of the date of writing, Xen is only avaible in Edge).&lt;br /&gt;
Install Xen:&lt;br /&gt;
apk add xen&lt;br /&gt;
&lt;br /&gt;
Modify your extlinux.cfg: http://lists.alpinelinux.org/alpine-devel/1406.html&lt;br /&gt;
&lt;br /&gt;
timeout 20&lt;br /&gt;
prompt 1&lt;br /&gt;
default grsec&lt;br /&gt;
label grsec&lt;br /&gt;
 kernel /boot/vmlinuz-grsec&lt;br /&gt;
 append initrd=/boot/initramfs-grsec root=UUID=f40e340b-ea49-445b-81c0-4d7104b56662 modules=sd-mod,usb-storage,ext4&lt;br /&gt;
label xen&lt;br /&gt;
 kernel mboot.c32&lt;br /&gt;
 append /boot/xen-4.gz console=/dev/null dom0_mem=256M vga=mode-0x0311 --- /boot/vmlinuz-grsec root=UUID=f40e340b-ea49-445b-81c0-4d7104b56662 modules=sd-mod,usb-storage,ext4 vga=785 --- /boot/initramfs-grsec&lt;br /&gt;
&lt;br /&gt;
Of course replace root=UUID= with &#039;&#039;&#039;your&#039;&#039;&#039; UUID in yours.&lt;br /&gt;
Default menu.c32 can mangle with Xen, further investigation needed, so don&#039;t use for now.&lt;br /&gt;
&lt;br /&gt;
Use the script found here: http://lists.xensource.com/archives/html/xen-devel/2010-03/msg01605.html&lt;br /&gt;
&lt;br /&gt;
#!/bin/sh&lt;br /&gt;
&lt;br /&gt;
test -d /proc/xen       || exit 0&lt;br /&gt;
test -f /proc/xen/capabilities  || mount -t xenfs xen /proc/xen&lt;br /&gt;
test -f /proc/xen/capabilities  || exit 0&lt;br /&gt;
grep -q &amp;quot;control_d&amp;quot; /proc/xen/capabilities      || exit 0&lt;br /&gt;
&lt;br /&gt;
for module in xen-evtchn evtchn blkbk netbk; do&lt;br /&gt;
         modprobe ${module}&amp;gt;/dev/null 2&amp;gt;&amp;amp;1&lt;br /&gt;
         done&lt;br /&gt;
&lt;br /&gt;
xl info won&#039;t work&lt;br /&gt;
&lt;br /&gt;
Start xecommons:&lt;br /&gt;
&lt;br /&gt;
alpine:/boot# /etc/init.d/xencommons start&lt;br /&gt;
Starting xenstored...FATAL: Failed to open evtchn device: No such file or directory&lt;br /&gt;
&lt;br /&gt;
well this will fail but xl info will work anyway&lt;br /&gt;
&lt;br /&gt;
That&#039;s all folks !&lt;/div&gt;</summary>
		<author><name>Forth</name></author>
	</entry>
	<entry>
		<id>https://wiki.alpinelinux.org/w/index.php?title=Tutorials_and_Howtos&amp;diff=5624</id>
		<title>Tutorials and Howtos</title>
		<link rel="alternate" type="text/html" href="https://wiki.alpinelinux.org/w/index.php?title=Tutorials_and_Howtos&amp;diff=5624"/>
		<updated>2011-08-14T17:21:48Z</updated>

		<summary type="html">&lt;p&gt;Forth: /* Drafts */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Image:package_edutainment.svg|left|link=]]&lt;br /&gt;
{{TOC right}}&#039;&#039;&#039;Welcome to Tutorials and Howtos, a place of basic and advanced configuration tasks for your Alpine Linux.&#039;&#039;&#039;&lt;br /&gt;
The tutorials are hands-on and the reader is expected to try and achieve the goals described in each step, possibly with the help of a good examples. The output in one step is the starting point for the following step.&amp;lt;br/&amp;gt;&lt;br /&gt;
Howtos are smaller articles explaining how to perform a particular task with Alpine Linux. We encourage people to send in both complete articles as well as requesting topics to be covered. If you think you have the skills and knowledge to write an Alpine Linux related article please do so on this Wiki. If you want to request a topic, please add your request in this page [[Talk:Tutorials_and_Howtos|Discussion]]. 	&lt;br /&gt;
&lt;br /&gt;
== Installation ==&lt;br /&gt;
&lt;br /&gt;
* [[Setting up a basic vserver]]&lt;br /&gt;
* [[Setting up Logical Volumes with LVM]]&lt;br /&gt;
* [[Replacing non-Alpine Linux with Alpine remotely]]&lt;br /&gt;
* [[XFCE Setup]]&lt;br /&gt;
* [[Gnome Setup]]&lt;br /&gt;
* [[Enable Serial Console on Boot]]&lt;br /&gt;
* [[Alpine Linux package management#Local_Cache | How to enable APK caching]]&lt;br /&gt;
* [[Installing Alpine on a virtual machine| Installation of Alpine Linux in a virtual machine]]&lt;br /&gt;
* [[Setting up Alpine in a chroot]]&lt;br /&gt;
* [[Upgrading to Edge]]&lt;br /&gt;
* [[Setting up a software raid1 array]]&lt;br /&gt;
* [[Manually editing a existing apkovl]]&lt;br /&gt;
&lt;br /&gt;
== Networking ==&lt;br /&gt;
* [[Configure Networking]]&lt;br /&gt;
* [[Howto Configure a Network Bridge]]&lt;br /&gt;
* [[Howto Configure static routes]]&lt;br /&gt;
* [[Using serial modem]]&lt;br /&gt;
* [[Using HSDPA modem]]&lt;br /&gt;
* [[Using Alpine on Windows domain with IPSEC isolation]]&lt;br /&gt;
* [[Setting up Satellite Internet Connection]]&lt;br /&gt;
* [[Connecting to a wireless accesspoint]]&lt;br /&gt;
* [[Fault Tolerant Routing with Alpine Linux]]&lt;br /&gt;
&lt;br /&gt;
== iSCSI ==&lt;br /&gt;
* [[iSCSI Target and Initiator Configuration]]&lt;br /&gt;
* [[iSCSI Raid and Clustered File Systems]]&lt;br /&gt;
* [[High performance SCST iSCSI Target on Linux software Raid]]&lt;br /&gt;
&lt;br /&gt;
== Network Services ==&lt;br /&gt;
* [[Setting Up Lighttpd With FastCGI]]&lt;br /&gt;
* [[Setting up a OpenVPN-server with Alpine]]&lt;br /&gt;
* [[Setting up Zaptel/Asterisk on Alpine]]&lt;br /&gt;
* [[Setting up Transmission (bittorrent) with Clutch WebUI]]&lt;br /&gt;
* [[Hosting services on Alpine]] &#039;&#039;(This applies to hosting mail, webservices and other services)&#039;&#039;&lt;br /&gt;
** [[Setting up postfix with virtual domains]]&lt;br /&gt;
** [[Protecting your email server with Alpine]]&lt;br /&gt;
** [[Hosting Web/Email services on Alpine]]&lt;br /&gt;
* [[Setting up a ssh-server]]&lt;br /&gt;
* [[Multiple Instances of Services]]&lt;br /&gt;
* [[ISP Mail Server HowTo]] &#039;&#039;(Postfix+PostfixAdmin+DoveCot+Roundcube+ClamAV+Spamd - A full-serivce ISP mail server)&#039;&#039;&lt;br /&gt;
** [[ISP Mail Server Upgrade 2.x]]&lt;br /&gt;
** [[ISP Mail Server 2.x HowTo]] &#039;&#039;(Beta, please test)&#039;&#039;&lt;br /&gt;
* [[Freepbx on Alpine Linux]]&lt;br /&gt;
* [[Apache authentication: NTLM Single Signon]]&lt;br /&gt;
* [[Generating SSL certs with ACF]]&lt;br /&gt;
* [[Changing passwords for ACF]]&lt;br /&gt;
* [[Freeradius Active Directory Integration]]&lt;br /&gt;
* [[High Availability High Performance Web Cache]] &#039;&#039;uCarp + HAProxy for High Availability Services such as Squid web proxy&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== Web Applications ==&lt;br /&gt;
* [[2600hz]] &#039;&#039;FreeSWITCH, Asterisk GUI web acces tool.&#039;&#039;&lt;br /&gt;
* [[Awstats]] &#039;&#039;Free log file analyzer.&#039;&#039;&lt;br /&gt;
* [[Drupal]] &#039;&#039;Content Management System (CMS) written in PHP.&#039;&#039;&lt;br /&gt;
* [[EyeOS]] &#039;&#039;Cloud Computing Desktop.&#039;&#039;&lt;br /&gt;
* [[FreePBX_V3]] &#039;&#039;FreeSWITCH, Asterisk GUI web acces tool.&#039;&#039;&lt;br /&gt;
* [[Glpi]] &#039;&#039;Information Resource-Manager.&#039;&#039;&lt;br /&gt;
* [[MediaWiki]] &#039;&#039;Free web-based wiki software application&#039;&#039;&lt;br /&gt;
* [[Pastebin]] &#039;&#039;Pastebin software application&#039;&#039;&lt;br /&gt;
* [[Phpizabi]] &#039;&#039;Social Networking Platform.&#039;&#039;&lt;br /&gt;
* [[PhpPgAdmin]] &#039;&#039;Web-based administration tool for PostgreSQL.&#039;&#039;&lt;br /&gt;
* [[Phpmyadmin]] &#039;&#039;Web-based administration tool for MYSQL.&#039;&#039;&lt;br /&gt;
* [[Redmine]] &#039;&#039;Project management system &#039;&#039;&lt;br /&gt;
* [[Request-Tracker]] &#039;&#039;Ticket system&#039;&#039;&lt;br /&gt;
* [[Roundcube]] &#039;&#039;Webmail system&#039;&#039;&lt;br /&gt;
* [[Statusnet]] &#039;&#039;Microblogging Platform.&#039;&#039;&lt;br /&gt;
* [[Sqstat]] &#039;&#039;Script to look active squid users connections.&#039;&#039;&lt;br /&gt;
* [[Webmin]] &#039;&#039;A web-based interface for Linux system.&#039;&#039;&lt;br /&gt;
* [[WordPress]] &#039;&#039;Web software to create website or blog. &#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== Monitoring ==&lt;br /&gt;
* [[Traffic monitoring]] &#039;&#039;(For Alpine Linux firewalls)&#039;&#039;&lt;br /&gt;
* [[Setting up traffic monitoring using rrdtool (and snmp)]]&lt;br /&gt;
* [[Setting up Smokeping]] &#039;&#039;(Smokeping network latency monitoring)&#039;&#039;&lt;br /&gt;
* [[Setting up Cacti]]&lt;br /&gt;
* [[Setting up NRPE daemon]] &#039;&#039;(Performs remote Nagios checks)&#039;&#039;&lt;br /&gt;
* [[Setting up Zabbix]]&lt;br /&gt;
* [[Setting Up Fprobe And Ntop]] &#039;&#039;NetFlow collection and analysis&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== Misc ==&lt;br /&gt;
* [[Setting up lm_sensors]]&lt;br /&gt;
* [[Formatting HD/Floppy/Other]]&lt;br /&gt;
* [[Screen on console]]&lt;br /&gt;
* [[Using espeak on Alpine Linux]]&lt;br /&gt;
* [[IPTV How To]]&lt;br /&gt;
* [[Pllua]]&lt;br /&gt;
* [[Error message on boot: Address space collision: host bridge window conflicts with Adaptor ROM]]&lt;br /&gt;
&lt;br /&gt;
== Drafts ==&lt;br /&gt;
Those are not finished yet.&lt;br /&gt;
* [[Install Alpine on coLinux]]&lt;br /&gt;
* [[Using Racoon for Remote Sites]]&lt;br /&gt;
* [[Setting up Transparent Squid Proxy]] &#039;&#039;(Covers Squid proxy and URL Filtering system)&#039;&#039;&lt;br /&gt;
** [[Obtaining user information via SNMP]] &#039;&#039;(Using the Squark Squid authentication helper)&#039;&#039;&lt;br /&gt;
* [[Setting up Streaming an Asterisk Channel]]&lt;br /&gt;
* [[Setting up A Network Monitoring and Inventory System]] &#039;&#039;((Nagios + OpenAudit and related components)&#039;&#039;&lt;br /&gt;
* [[Intrusion Detection using Snort]] &#039;&#039;Installing and configuring Snort and related applications on Alpine 2.0.x&#039;&#039;&lt;br /&gt;
* [[IP Accounting]] &#039;&#039;Installing and configuring pmacct for IP Accounting, Netflow/sFlow collector&#039;&#039;&lt;br /&gt;
* [[Howto Setup a Wireless Access Point]] &#039;&#039;Setting up Secure Wireless AP w/ WPA encryption with bridge to wired network&#039;&#039;&lt;br /&gt;
* [[Xen Dom0]] &#039;&#039;Setting up Alpine as a dom0 for Xen hypervisor&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== Obsolete Docs ==&lt;br /&gt;
Those are candidates for rewriting/removal.&lt;br /&gt;
* [[Bootstrapping Alpine on Soekris net4xxx]]&lt;br /&gt;
* [[Bootstrapping Alpine on PC Engines ALIX.3]]&lt;br /&gt;
* [[Setting up a /var partition on software IDE raid1]]&lt;br /&gt;
* [[Native Harddisk Install]]&lt;br /&gt;
* [[Installing XUbuntu using Alpine boot floppy]]&lt;br /&gt;
* [[Setting up trac wiki]]&lt;/div&gt;</summary>
		<author><name>Forth</name></author>
	</entry>
</feed>