Setting up the build environment on HDD: Difference between revisions

From Alpine Linux
(→‎Introduction: Clarification on HDD-installation)
(updated wikilinks)
 
(26 intermediate revisions by 6 users not shown)
Line 1: Line 1:
= Setting up a 'edge' build environment on HDD =
An existing Alpine Linux installation running in [[System Disk Mode|System Disk]] mode i.e traditional or classic harddisk installation can be used as build environment. Alternates are to setup a clean [[Installing Alpine Linux in a chroot|Alpine Linux build environment in a chroot]] inside another system, or some form of [[Developer Documentation#Configuring your development system|virtualization]]. The host system may also be Alpine Linux, or may be something else.


== Introduction  ==
{{Note|For a build environment, it is recommended to [[Repositories#Upgrading_to_edge|Upgrade and use '''edge''']] version.}}
We will host this build environment on a HDD installed Alpine.


== Boot you build environment  ==
== Setup your system and account ==
Boot [http://dl-3.alpinelinux.org/alpine/v1.9/iso/alpine-1.9.0-i386.iso alpine-1.9.0] on a box with a HDD.<BR>
{{:Include:Setup your system and account for building packages}}


== Basic setup ==
== Contribute ==
Set basic environment settings.
setup-alpine


== Change repository ==
Proceed to [[Creating_an_Alpine_package|create new package]] or [[Development using git:Creating patches|create and submit patches]] for Alpine Linux.
Change repository to use 'edge'
vi /etc/apk/repositories
The file should look like this
<PRE>
http://dl-4.alpinelinux.org/alpine/edge/packages/main/
http://dl-4.alpinelinux.org/alpine/edge/packages/testing/
http://dl-4.alpinelinux.org/alpine/edge/packages/x11/
</PRE>
'''''Note:''' You can replace 'dl-4' with some other available [[Downloads|mirror]].''


Update/upgrade your system
[[Category:Development]]
apk update
apk upgrade
 
== Prepare HDD ==
Install your system on HDD
setup-disk
Reboot your system
 
== Update repository ==
Refresh the repository
apk update
 
== Start building packages ==
Now you can move on to [[Creating_an_Alpine_package|creating packages for Alpine.]]

Latest revision as of 15:44, 31 October 2025

An existing Alpine Linux installation running in System Disk mode i.e traditional or classic harddisk installation can be used as build environment. Alternates are to setup a clean Alpine Linux build environment in a chroot inside another system, or some form of virtualization. The host system may also be Alpine Linux, or may be something else.

Note: For a build environment, it is recommended to Upgrade and use edge version.

Setup your system and account

The alpine-sdk is a metapackage that pulls in the most essential packages used to build new packages. Also install and configure a way to elevate privileges, such as sudo or doas, and an editor, such as vi, nano, micro.

# apk add alpine-sdk

This would be a good time to create a normal user account for you to work in. To make life easier later, it's a good idea to add this user to the wheel group; operations that require superuser privileges can now be done with sudo or doas.

The aports tree is in git so before we clone it, let's configure git. Refer Development using git page for a quick reference.

Configure your global git config

Configure your name and email address in git. This name and email address will show up in all your commits:

$ git config --global user.name "Your Name" $ git config --global user.email "your@email.address"

Using git config without --global let you configure other details for a specific git repository.

For aports, configure git to use rebase instead of merge when you execute git pull:

$ git config pull.rebase true

Configure abuild

Abuild needs to be configured for both the system and user.

Edit the file /etc/abuild.conf as per 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.

In order to use abuild command The user executing abuild must be a member of the abuild group:

# addgroup <yourusername> abuild

Note: Remember to logout and login again for the group change to have effect.

For abuild a public/private rsa key pair is needed. The abuild-keygen command from abuild package generates and configures the security keys.

$ abuild-keygen -a -i

Contribute

Proceed to create new package or create and submit patches for Alpine Linux.