distro recipes 2013 : introduction to arch linux: a simple, rolling-release distribution

43
Tom Gundersen [email protected] a simple, rolling-release distribution

Upload: anne-nicolas

Post on 15-Jan-2015

818 views

Category:

Technology


0 download

DESCRIPTION

 

TRANSCRIPT

Page 1: Distro Recipes 2013 : Introduction to Arch Linux: a simple, rolling-release distribution

Tom [email protected]

a simple, rolling-release distribution

Page 2: Distro Recipes 2013 : Introduction to Arch Linux: a simple, rolling-release distribution

Overview

● Arch Linux

● Packaging

● The community

● Future plans

Page 3: Distro Recipes 2013 : Introduction to Arch Linux: a simple, rolling-release distribution

Arch Linux - Simplicity

● Creating and building packages is easy

● Divergence from upstream is minimal

● Choice for its own sake is avoided

● The workings of the system is not hidden from the user

Page 4: Distro Recipes 2013 : Introduction to Arch Linux: a simple, rolling-release distribution

Arch Linux – Rolling Release

● Ship the latest stable release of our packages (there are exceptions)

● Don't necessarily be the very first to switch to new or experimental technologies or introduce new packages to our repositories

Page 5: Distro Recipes 2013 : Introduction to Arch Linux: a simple, rolling-release distribution

Arch Linux – Target Audience

● People wanting to learn about Linux

● Advanced users

● Developers

Page 6: Distro Recipes 2013 : Introduction to Arch Linux: a simple, rolling-release distribution

Arch Linux - Background

● Started in 2001 by Judd Vinet

● Inspired by Slackware, Polish Linux Distribution and CRUX

Page 7: Distro Recipes 2013 : Introduction to Arch Linux: a simple, rolling-release distribution

Arch Linux – History: stats

0

200

400

600

800

1000

1200

0

2000

4000

6000

8000

10000

12000

14000

16000

18000

20000

Random Arch Website Stats

Forum Posts (Right Y-axis)Forum Users Registered

Flyspray Bugs OpenedFlyspray Bugs Closed

Flyspray Users RegisteredWiki Page Revisions (Right Y-axis)

Page 8: Distro Recipes 2013 : Introduction to Arch Linux: a simple, rolling-release distribution

Arch Linux – History: descendants

Page 9: Distro Recipes 2013 : Introduction to Arch Linux: a simple, rolling-release distribution

Arch Linux – Current Status

● ~3000 Official Packages

● ~3000 Semi-Official Packages

● ~40000 Unsupported PKGBUILDs

● One kernel

● i686 and x86_64 architectures

● Proprietary software available

● All major desktop environment, etc.

Page 10: Distro Recipes 2013 : Introduction to Arch Linux: a simple, rolling-release distribution

Packaging - Repositories

[core]● needed for building, booting and installing● ~200 packages● updates must go through the [testing] repository

[extra]● commonly used packages (>5% of users)

[community]● less commonly used packages (>1% of users)

Page 11: Distro Recipes 2013 : Introduction to Arch Linux: a simple, rolling-release distribution

Arch Linux Package Manager

● Uses the “pacman” package manager

● Combines a simple binary package format with easy to use build system

● Fast! - according to Linux Format it beats the competition by a wide margin

● Does everything you expect from a package manager (update system, resolve dependencies, ...)

Page 12: Distro Recipes 2013 : Introduction to Arch Linux: a simple, rolling-release distribution

Package Creation

● Very simple scripts required to create a package

● If you can build the software manually, then you can create a package for it

● Tool provided to build packages called “makepkg”

● Build script is placed in a file called a PKGBUILD

Page 13: Distro Recipes 2013 : Introduction to Arch Linux: a simple, rolling-release distribution

Package Creation

● Start with how you would normally install a program:

$ tar -xf <pkgname>-<pkgver>$ cd <pkgname>-<pkgver>$ ./configure$ make$ sudo make install

Page 14: Distro Recipes 2013 : Introduction to Arch Linux: a simple, rolling-release distribution

Package Creation

● Separate out the parts run as a user and root into separate functions:

$ tar -xf <pkgname>-<pkgver>$ cd <pkgname>-<pkgver>

build() { ./configure make}

package() { make install}

Page 15: Distro Recipes 2013 : Introduction to Arch Linux: a simple, rolling-release distribution

Package Creation

● makepkg will automatically handle source extraction into “$srcdir”

build() { cd $srcdir/<pkgname>-<pkgver> ./configure make}

package() { cd $srcdir/<pkgname>-<pkgver> make install}

Page 16: Distro Recipes 2013 : Introduction to Arch Linux: a simple, rolling-release distribution

Package Creation

● Files need to be installed in “$pkgdir”, which is compressed to make the package:

build() { cd $srcdir-<pkgname>-<pkgver> ./configure –prefix=/usr make}

package() { cd $srcdir-<pkgname>-<pkgver> make DESTDIR=$pkgdir install}

Page 17: Distro Recipes 2013 : Introduction to Arch Linux: a simple, rolling-release distribution

Package Creation

● Add some information about the package at the top of the file:

pkgname=foopkgver=3.0pkgrel=1pkgdesc="Example software"arch=('i686' 'x86_64')url="http://foo.example.com"license=('GPL')depends=('glibc')source=(http://$pkgname-$pkgver.tar.gz)md5sums=('d41d8cd98f00b204e9800f8427e')

Page 18: Distro Recipes 2013 : Introduction to Arch Linux: a simple, rolling-release distribution

Package Creation

● makepkg automates many common packaging tasks:

● Stripping debugging symbols from binaries

● Compressing man and info pages● Setting compiler/linker options

(CFLAGS, LDFLAGS, MAKEFLAGS) ● Removing common unwanted files

(libtool, infodir, …)

Page 19: Distro Recipes 2013 : Introduction to Arch Linux: a simple, rolling-release distribution

Package Creation

● Two files are placed in the $pkgdir directory with all package meta data

● Then a (compressed) tar archive of the $pkgdir directory is created

● DONE!

Page 20: Distro Recipes 2013 : Introduction to Arch Linux: a simple, rolling-release distribution

Package Creation - Example

● See terminal ->

Page 21: Distro Recipes 2013 : Introduction to Arch Linux: a simple, rolling-release distribution

Community - Developers

● 1 Project Leader

● Deals with legal matters (exclusively)

● 33 Developers / Junior Developers

● Runs infrastructure

● Packages the packages in the official [core] and [extra] repositories

Page 22: Distro Recipes 2013 : Introduction to Arch Linux: a simple, rolling-release distribution

Community – Developers

● No formal rules of governance

● Consensus-based decision making

● Developers may in principle do whatever they want, as long as they inform the other developers of their intentions beforehand and there is no serious, technical oposition

● New developers added by invitation only

Page 23: Distro Recipes 2013 : Introduction to Arch Linux: a simple, rolling-release distribution

Community – Trusted Users

● 37 Trusted Users (Tus)

● Disjont form the Developers

● Runs the Arch User Repository (AUR)

● Packages the semi-official packages in the [community] repository

● Ran as a democracy, governed by formal by-laws

● New TUs may apply to join

Page 24: Distro Recipes 2013 : Introduction to Arch Linux: a simple, rolling-release distribution

Community – AUR

● Repository of PKGBUILDs

● Anyone may sign-up and upload PKGBUILDs

● Absolutely no quality-control of the resulting packages, but some style guidelines on the PKGBUILDs themselves

● Popular, high-quality PKGBUILDS are often picked up by TU's and added to the [community] repository

Page 25: Distro Recipes 2013 : Introduction to Arch Linux: a simple, rolling-release distribution

Community – others...

● Forum, wiki, bug tracker, mailing-lists, irc channels are ran by separate teams

● Disjoint from each other (and the developers)

Page 26: Distro Recipes 2013 : Introduction to Arch Linux: a simple, rolling-release distribution

Getting involved

● Actively contribute to the community● Provide PKGBUILDs for unpackaged software

● Help on the bug tracker● Contributing code to our projects● Update the wiki

● Apply to become a Trusted User● Sponsoring and voting process...

● Be invited onto the Developer team

Page 27: Distro Recipes 2013 : Introduction to Arch Linux: a simple, rolling-release distribution

Evolution of an example package

systemd: a Linux init system

Page 28: Distro Recipes 2013 : Introduction to Arch Linux: a simple, rolling-release distribution

Example - systemd

● First packages for systemd were placed in AUR in 2010

● Lots of work was required to make it work with Arch

“I'm highly dubious that Arch's kernel will ever natively support systemd, but I'm willing to give that a try as well once 2.6.36 hits.”

Page 29: Distro Recipes 2013 : Introduction to Arch Linux: a simple, rolling-release distribution

Example - systemd

Over the next two years...

● Unified the legacy Arch init system and systemd

● systemd moved from the AUR to [community]

● The systemd packager was invited to join the dev team and moved systemd to [extra]

● systemd moved to [core]● The legacy init system was deprecated and systemd is now our only supported init system

Page 30: Distro Recipes 2013 : Introduction to Arch Linux: a simple, rolling-release distribution

Why does it work at all?

● Software developers write code that is supposed to work...

● Only suport the most recent version of our packages

● Don't support more options than strictly necessary at the lower levels

● Accept occasional user intervention

Page 31: Distro Recipes 2013 : Introduction to Arch Linux: a simple, rolling-release distribution

Vanilla Packages

● Means packaging the software as the upstream developers intended

● Minimise patching – preferably only to fix build issues

● Result in any bug we find is (probably) not distribution specific

● Allows us to work more closely with software developers to fix bugs

Page 32: Distro Recipes 2013 : Introduction to Arch Linux: a simple, rolling-release distribution

Working With Software Developers

● All bug fix patches in Arch must be approved by the upstream developers

● That means that the Arch developers and community have become regular code contributors

● Many Arch developers also have commit access to upstream projects

Page 33: Distro Recipes 2013 : Introduction to Arch Linux: a simple, rolling-release distribution

Future Directions for Arch Linux

● Majority response...

“Keep updating packages”

● Add more focus on a particular areas

● Add more architectures

● Simplify the system further

Page 34: Distro Recipes 2013 : Introduction to Arch Linux: a simple, rolling-release distribution

Keeping Packages Updated

● One of Arch Linux's greatest contributions to the Linux community

● Arch gets packages in their stable repositories before some major distributions get it in their developmental versions

● The Arch community will identify bugs early and report the issue to the software developers

● Fixes benefit all Linux distributions

Page 35: Distro Recipes 2013 : Introduction to Arch Linux: a simple, rolling-release distribution

Add More Architectures

● Currently we support x86 in 32bit (i686) and 64bit (x86-64) varieties

● There are community projects supporting other architectures

● ARM (v5, v6, v7)● PPC● ...

● Would be good to provide a way for these ports to become official (like x86-64 did)

Page 36: Distro Recipes 2013 : Introduction to Arch Linux: a simple, rolling-release distribution

Arch Linux ARM

● Non-official spin-off for the ARM architecture

● One of the distros recommended for the Raspberry Pi

Page 37: Distro Recipes 2013 : Introduction to Arch Linux: a simple, rolling-release distribution

Simplifying the Filesystem

● Usual filesystem layout has a lot of redundancies

/boot/bin/etc/home/lib/sbin/usr /bin /lib /sbin

Page 38: Distro Recipes 2013 : Introduction to Arch Linux: a simple, rolling-release distribution

Simplifying the Filesystem

● Libraries

/boot/bin/etc/home/lib (essential libraries)/sbin/usr /bin /lib (rest of libraries) /sbin

Page 39: Distro Recipes 2013 : Introduction to Arch Linux: a simple, rolling-release distribution

Simplifying the Filesystem

● Keep all libraries in one place

/boot/bin/etc/home/lib -> /usr/lib/sbin/usr /bin /lib /sbin

Page 40: Distro Recipes 2013 : Introduction to Arch Linux: a simple, rolling-release distribution

Simplifying the Filesystem

● Executables – distinction between directories is vague...

/boot/bin (essential user commands)/etc/home/lib -> /usr/lib/sbin (system commands)/usr /bin (most commands) /lib /sbin (non-essential system)

Page 41: Distro Recipes 2013 : Introduction to Arch Linux: a simple, rolling-release distribution

Simplifying the Filesystem

● Keep all libraries in one place

/boot/bin -> /usr/bin/etc/home/lib -> /usr/lib/sbin -> /usr/bin/usr /bin /lib /sbin -> bin

Page 42: Distro Recipes 2013 : Introduction to Arch Linux: a simple, rolling-release distribution

Simplifying the Filesystem

● /etc directory holds all configuration files

● Beginning to have these placed in /usr/lib/<pkgname> with files in /etc overriding the default settings

● Would be very helpful for a rolling release system

● Requires substantial work with upstream projects to achieve...

Page 43: Distro Recipes 2013 : Introduction to Arch Linux: a simple, rolling-release distribution

Automating More Packaging

● Task like rebuilds for library soname changes are typically trivial

● Would save a lot of time if we could automate (most of) this

● Most packages do not require architecture specific changes – build for one and automate the rest

● Would allow us to focus more on improving other areas of the distribution