Compare commits
47 Commits
archlinux-
...
master
Author | SHA1 | Date |
---|---|---|
Les De Ridder | acd19b3df7 | |
Les De Ridder | a65f137eb6 | |
Les De Ridder | 8c30f40e0b | |
Les De Ridder | 7bca128200 | |
Les De Ridder | 50a96f0a1c | |
Les De Ridder | c354ddb1af | |
Les De Ridder | 2a88f2bc4a | |
Les De Ridder | 87cbffb98f | |
Les De Ridder | 2b0ffcf98c | |
Les De Ridder | 8402b06c2f | |
Les De Ridder | 854a0e29bb | |
Les De Ridder | 2d09abb977 | |
Les De Ridder | 1c8648b890 | |
Les De Ridder | f78465d118 | |
Les De Ridder | 721c7f0d56 | |
Manfred Touron | b9b3aa2f57 | |
Manfred Touron | cb108cf4ed | |
Mikkel Oscar Lyderik | 122793eeba | |
Manfred Touron | e8dd2b6cc7 | |
Manfred Touron | 5d41da94c0 | |
Manfred Touron | 6e7d7e138c | |
Manfred Touron | a16def9eac | |
Manfred Touron | 1544da8a63 | |
Manfred Touron | d52bbeb534 | |
Manfred Touron | 70aa5855f9 | |
Manfred Touron | 226376e15e | |
Sebastien Rannou | 3e23c375a3 | |
Sebastien Rannou | 70552c5dbd | |
Sebastien Rannou | 1ffa6757fd | |
Sebastien Rannou | 10d364c568 | |
Sebastien Rannou | 904e177799 | |
Sebastien Rannou | 6e64443f27 | |
Manfred Touron | edd132d2a3 | |
Manfred Touron | dadfad4dd0 | |
Manfred Touron | fe57be2d86 | |
Manfred Touron | a12c6136c4 | |
Manfred Touron | 49609bce15 | |
Manfred Touron | 9ae32d1579 | |
Manfred Touron | d36a1b0ed8 | |
Lukas Schauer | 83aa4c93af | |
Manfred Touron | 598506016d | |
Manfred Touron | 15282c2e6d | |
Manfred Touron | 17cb401832 | |
Manfred Touron | 8fe9a1b3d0 | |
Manfred Touron | c889456ef8 | |
Manfred Touron | 3d6172bb91 | |
Manfred Touron | 71d1ba427f |
81
Dockerfile
81
Dockerfile
|
@ -1,30 +1,30 @@
|
||||||
## -*- docker-image-name: "armbuild/ocs-distrib-archlinux:latest" -*-
|
FROM derjudge/archlinux
|
||||||
FROM armbuild/archlinux-disk:2014-12-02
|
MAINTAINER lesderid <les@lesderid.net>
|
||||||
MAINTAINER Online Labs <opensource@ocs.online.net> (@online_en)
|
|
||||||
|
|
||||||
|
|
||||||
# Environment
|
# Environment
|
||||||
ENV OCS_BASE_IMAGE armbuild/ocs-archlinux:2014-12-02
|
ENV SCW_BASE_IMAGE armbuild/scw-archlinux:2014-12-02
|
||||||
|
|
||||||
|
# Update the keyring
|
||||||
|
RUN pacman -Sy --noconfirm archlinux-keyring
|
||||||
|
|
||||||
|
# Force openssl upgrade first (bad symbol issue)
|
||||||
|
RUN pacman -Sy --noconfirm --force openssl
|
||||||
|
|
||||||
|
|
||||||
# Install packages
|
# Install packages
|
||||||
RUN pacman -Sy --noconfirm \
|
RUN pacman -Sy --noconfirm \
|
||||||
bash-completion \
|
bash-completion \
|
||||||
|
bc \
|
||||||
|
binutils \
|
||||||
cronie \
|
cronie \
|
||||||
curl \
|
curl \
|
||||||
dhcpcd \
|
|
||||||
dnsutils \
|
dnsutils \
|
||||||
file \
|
fakeroot \
|
||||||
htop \
|
htop \
|
||||||
iptables \
|
iptables \
|
||||||
less \
|
|
||||||
localepurge \
|
|
||||||
lsb-release \
|
lsb-release \
|
||||||
man \
|
|
||||||
mg \
|
mg \
|
||||||
nano \
|
|
||||||
nbd \
|
nbd \
|
||||||
networkmanager \
|
|
||||||
ntp \
|
ntp \
|
||||||
openbsd-netcat \
|
openbsd-netcat \
|
||||||
openssh \
|
openssh \
|
||||||
|
@ -38,57 +38,42 @@ RUN pacman -Sy --noconfirm \
|
||||||
wget
|
wget
|
||||||
|
|
||||||
|
|
||||||
# xnbd-client
|
|
||||||
RUN mkdir /tmp/build-xnbd \
|
|
||||||
&& cd /tmp/build-xnbd \
|
|
||||||
&& wget https://bitbucket.org/hirofuchi/xnbd/downloads/xnbd-0.3.0.tar.bz2 -O xnbd.tar.bz2 \
|
|
||||||
&& tar -xf xnbd.tar.bz2 \
|
|
||||||
&& cd xnbd-* \
|
|
||||||
&& pacman -Sy --noconfirm gcc automake pkg-config make \
|
|
||||||
&& cd /tmp/build-xnbd/xnbd-* \
|
|
||||||
&& ./configure --prefix=/usr/local \
|
|
||||||
&& make -j4 \
|
|
||||||
&& make install \
|
|
||||||
&& pacman -R --noconfirm gcc automake pkg-config make \
|
|
||||||
&& cd / \
|
|
||||||
&& rm -rf /tmp/build-xnbd /tmp/xnbd.tar.bz2
|
|
||||||
|
|
||||||
|
|
||||||
# Locales
|
# Locales
|
||||||
RUN sed -e s/^\#en_US.UTF-8/en_US.UTF-8/ -i /etc/locale.gen \
|
RUN sed 's/^\([^#]\)/#\1/' -i /etc/locale.gen \
|
||||||
|
&& sed 's/^#en_US.UTF-8/en_US.UTF-8/;s/^#en_GB.UTF-8/en_GB.UTF-8/' -i /etc/locale.gen \
|
||||||
|
&& echo LANG=en_GB.UTF-8 > /etc/locale.conf \
|
||||||
&& locale-gen
|
&& locale-gen
|
||||||
|
|
||||||
|
|
||||||
|
# Patch rootfs
|
||||||
|
RUN curl -Lkq http://j.mp/scw-skeleton | FLAVORS=common,docker-based,systemd bash -e
|
||||||
|
ADD ./patches/etc/ /etc/
|
||||||
|
ADD ./patches/usr/ /usr/
|
||||||
|
|
||||||
|
|
||||||
# Systemd
|
# Systemd
|
||||||
RUN systemctl disable getty@tty1.service \
|
RUN systemctl enable \
|
||||||
&& systemctl disable systemd-networkd.service \
|
scw-fetch-ssh-keys \
|
||||||
&& systemctl enable NetworkManager-wait-online.service \
|
scw-sync-kernel-modules \
|
||||||
&& systemctl enable serial-getty@ttyS0.service \
|
scw-generate-ssh-keys \
|
||||||
&& systemctl enable sshd.service \
|
scw-gen-machine-id.service \
|
||||||
&& systemctl enable NetworkManager \
|
ntpdate.service \
|
||||||
&& systemctl enable ntpdate
|
sshd.service \
|
||||||
|
serial-getty@ttyS0.service \
|
||||||
|
&& systemctl mask \
|
||||||
|
getty@tty1.service
|
||||||
|
|
||||||
|
|
||||||
# packages upgrade
|
# packages upgrade
|
||||||
RUN pacman --noconfirm -Suy
|
RUN pacman --noconfirm -Suy
|
||||||
|
|
||||||
|
|
||||||
# Patch rootfs
|
# Remove root password
|
||||||
RUN wget -qO - http://j.mp/ocs-scripts | bash
|
RUN passwd -d root
|
||||||
ADD ./patches/etc/ /etc/
|
|
||||||
ADD ./patches/usr/ /usr/
|
|
||||||
|
|
||||||
|
|
||||||
# Enable Online-Labs services
|
|
||||||
RUN systemctl enable oc-ssh-keys \
|
|
||||||
&& systemctl enable oc-add-extra-volumes \
|
|
||||||
&& systemctl enable oc-sync-kernel-modules
|
|
||||||
|
|
||||||
|
|
||||||
# Cleanup
|
# Cleanup
|
||||||
RUN pacman-db-upgrade \
|
RUN pacman-db-upgrade \
|
||||||
&& pacman -Rns linux-armv7 --noconfirm \
|
|
||||||
&& pacman -Sc --noconfirm \
|
&& pacman -Sc --noconfirm \
|
||||||
&& rm -rf /var/cache/pacman/pkg \
|
&& rm -rf /var/cache/pacman/pkg \
|
||||||
&& localepurge-config && localepurge \
|
|
||||||
&& pacman-db-upgrade
|
&& pacman-db-upgrade
|
||||||
|
|
2
LICENSE
2
LICENSE
|
@ -1,6 +1,6 @@
|
||||||
The MIT License (MIT)
|
The MIT License (MIT)
|
||||||
|
|
||||||
Copyright (c) 2014-2015 Online Labs
|
Copyright (c) 2014-2015 Scaleway
|
||||||
|
|
||||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
of this software and associated documentation files (the "Software"), to deal
|
of this software and associated documentation files (the "Software"), to deal
|
||||||
|
|
21
Makefile
21
Makefile
|
@ -1,15 +1,18 @@
|
||||||
DOCKER_NAMESPACE = armbuild/
|
NAME = archlinux
|
||||||
NAME = ocs-distrib-archlinux
|
|
||||||
VERSION = latest
|
VERSION = latest
|
||||||
VERSION_ALIASES = 2014-12-02
|
VERSION_ALIASES = 2014-12-02
|
||||||
TITLE = Archlinux
|
TITLE = Arch Linux
|
||||||
DESCRIPTION = Archlinux latest
|
DESCRIPTION = A simple, lightweight distribution
|
||||||
SOURCE_URL = https://github.com/online-labs/image-archlinux
|
SOURCE_URL = https://github.com/lesderid/image-archlinux
|
||||||
|
VENDOR_URL = https://www.archlinux.org/
|
||||||
|
|
||||||
|
IMAGE_VOLUME_SIZE = 50G
|
||||||
|
IMAGE_BOOTSCRIPT = latest
|
||||||
|
IMAGE_NAME = ArchLinux
|
||||||
|
|
||||||
|
|
||||||
## Image tools (https://github.com/online-labs/image-tools)
|
## Image tools (https://github.com/scaleway/image-tools)
|
||||||
all: docker-rules.mk
|
all: docker-rules.mk
|
||||||
docker-rules.mk:
|
docker-rules.mk:
|
||||||
wget -qO - http://j.mp/image-tools | bash
|
wget -qO - https://j.mp/scw-builder | bash
|
||||||
-include docker-rules.mk
|
-include docker-rules.mk
|
||||||
## Below you can add custom makefile commands and overrides
|
|
||||||
|
|
37
README.md
37
README.md
|
@ -1,35 +1,44 @@
|
||||||
Official Archlinux image on Online Labs
|
# Arch Linux image on Scaleway
|
||||||
=======================================
|
|
||||||
|
|
||||||
**Warning: this image is not yet working**
|
[![Build Status](https://travis-ci.org/lesderid/image-archlinux.svg?branch=master)](https://travis-ci.org/lesderid/image-archlinux)
|
||||||
|
|
||||||
Scripts to build the official Archlinux image on Online Labs
|
Scripts to build an Arch Linux (x86_64) image on Scaleway
|
||||||
|
|
||||||
This image is built using [Image Tools](https://github.com/online-labs/image-tools) and is based on the official [Ubuntu](https://github.com/online-labs/image-ubuntu) image.
|
This image is built using [Image Tools](https://github.com/scaleway/image-tools) and is based on the official [Ubuntu](https://github.com/scaleway/image-ubuntu) image.
|
||||||
|
|
||||||
|
![](https://d11xdyzr0div58.cloudfront.net/static/logos/archlinux-logo-dark-scalable.518881f04ca9.svg)
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
**This image is meant to be used on a C1 server.**
|
**This image is meant to be used on a VC1 server.**
|
||||||
|
|
||||||
We use the Docker's building system and convert it at the end to a disk image that will boot on real servers without Docker. Note that the image is still runnable as a Docker container for debug or for inheritance.
|
We use the Docker's building system and convert it at the end to a disk image that will boot on real servers without Docker. Note that the image is still runnable as a Docker container for debug or for inheritance.
|
||||||
|
|
||||||
[More info](https://github.com/online-labs/image-tools#docker-based-builder)
|
[More info](https://github.com/scaleway/image-tools#docker-based-builder)
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
Install
|
## Building
|
||||||
-------
|
|
||||||
|
|
||||||
Build and write the image to /dev/nbd1 (see [documentation](https://doc.cloud.online.net/howto/create_image.html))
|
Build and add the image to [your account](https://cloud.scaleway.com/#/images):
|
||||||
|
|
||||||
$ make install
|
$ make image_on_local
|
||||||
|
|
||||||
Full list of commands available at: [online-labs/image-tools](https://github.com/online-labs/image-tools/tree/master#commands)
|
Full list of commands available at: [scaleway/image-tools](https://github.com/scaleway/image-tools/#commands)
|
||||||
|
|
||||||
|
## Testing
|
||||||
|
|
||||||
|
To test your image, run:
|
||||||
|
|
||||||
|
$ scw run --tmp-ssh-key --name="archlinux" <IMAGE_ID>
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
links
|
## Links
|
||||||
-----
|
|
||||||
|
|
||||||
- [Community: Add Archlinux ARM image](https://community.cloud.online.net/t/need-feedback-add-arch-linux-arm-image/243?u=manfred)
|
- [Community: Add Archlinux ARM image](https://community.cloud.online.net/t/need-feedback-add-arch-linux-arm-image/243?u=manfred)
|
||||||
- [Community: New linux distributions (Debian, CoreOS, CentOS, Fedora, Arch Linux, ...)](https://community.cloud.online.net/t/official-new-linux-distributions-debian-coreos-centos-fedora-arch-linux/229?u=manfred)
|
- [Community: New linux distributions (Debian, CoreOS, CentOS, Fedora, Arch Linux, ...)](https://community.cloud.online.net/t/official-new-linux-distributions-debian-coreos-centos-fedora-arch-linux/229?u=manfred)
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
A project by [![Scaleway](https://avatars1.githubusercontent.com/u/5185491?v=3&s=42)](https://www.scaleway.com/) and lesderid
|
||||||
|
|
|
@ -1,10 +0,0 @@
|
||||||
#!/usr/bin/env bash
|
|
||||||
|
|
||||||
interface=$1
|
|
||||||
action=$2
|
|
||||||
|
|
||||||
if [ "$interface" = "eth0" -a "$action" = "up" ]
|
|
||||||
then
|
|
||||||
rm -f /etc/resolv.conf
|
|
||||||
ln -sf /run/systemd/resolve/resolv.conf /etc/resolv.conf
|
|
||||||
fi
|
|
|
@ -1,16 +0,0 @@
|
||||||
#!/usr/bin/env bash
|
|
||||||
|
|
||||||
interface=$1
|
|
||||||
action=$2
|
|
||||||
|
|
||||||
if [ "$interface" = "eth0" -a "$action" = "up" ]
|
|
||||||
then
|
|
||||||
metadata_host_name=$(/usr/local/bin/oc-metadata --cached HOSTNAME)
|
|
||||||
if [ "x$metadata_host_name" != "x" ]
|
|
||||||
then
|
|
||||||
echo $metadata_host_name > /etc/hostname
|
|
||||||
sed "/^127.0.1.1[ \t].*$/ s/.*$/127.0.1.1\t$metadata_host_name/" -i /etc/hosts
|
|
||||||
sed "/^127.0.0.1[ \t]localhost/ s/localhost.*$/localhost $metadata_host_name/" -i /etc/hosts
|
|
||||||
hostnamectl set-hostname $metadata_host_name
|
|
||||||
fi
|
|
||||||
fi
|
|
|
@ -3,7 +3,7 @@
|
||||||
# - http://support.ntp.org/bin/view/Support/GettingStarted
|
# - http://support.ntp.org/bin/view/Support/GettingStarted
|
||||||
# - https://wiki.archlinux.org/index.php/Network_Time_Protocol_daemon
|
# - https://wiki.archlinux.org/index.php/Network_Time_Protocol_daemon
|
||||||
|
|
||||||
server ntp.int.cloud.online.net
|
server ntp.int.scaleway.com
|
||||||
|
|
||||||
# Associate to public NTP pool servers; see http://www.pool.ntp.org/
|
# Associate to public NTP pool servers; see http://www.pool.ntp.org/
|
||||||
server 0.arch.pool.ntp.org
|
server 0.arch.pool.ntp.org
|
||||||
|
|
|
@ -112,7 +112,7 @@ PermitUserEnvironment no
|
||||||
#Compression delayed
|
#Compression delayed
|
||||||
#ClientAliveInterval 0
|
#ClientAliveInterval 0
|
||||||
#ClientAliveCountMax 3
|
#ClientAliveCountMax 3
|
||||||
#UseDNS yes
|
UseDNS no
|
||||||
#PidFile /run/sshd.pid
|
#PidFile /run/sshd.pid
|
||||||
#MaxStartups 10:30:100
|
#MaxStartups 10:30:100
|
||||||
#PermitTunnel no
|
#PermitTunnel no
|
||||||
|
|
|
@ -2,6 +2,7 @@
|
||||||
Name=eth0
|
Name=eth0
|
||||||
|
|
||||||
[Network]
|
[Network]
|
||||||
|
DHCP=yes
|
||||||
DNS=10.1.31.38
|
DNS=10.1.31.38
|
||||||
DNS=10.1.31.39
|
DNS=10.1.31.39
|
||||||
Domains=cloud.online.net
|
Domains=scaleway.com
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
# online cloud's DNS
|
# Scaleway's DNS
|
||||||
|
|
||||||
[Resolve]
|
[Resolve]
|
||||||
DNS=10.1.31.38
|
DNS=10.1.31.38
|
||||||
|
|
|
@ -1,10 +0,0 @@
|
||||||
[Unit]
|
|
||||||
Description=OCS additional volumes mounter
|
|
||||||
|
|
||||||
[Service]
|
|
||||||
ExecStart=/usr/sbin/oc-add-extra-volumes
|
|
||||||
ExecStop=/usr/sbin/oc-remove-extra-volumes
|
|
||||||
Type=forking
|
|
||||||
|
|
||||||
[Install]
|
|
||||||
WantedBy=basic.target
|
|
|
@ -1,10 +0,0 @@
|
||||||
[Unit]
|
|
||||||
Description=OCS fetch ssh keys from metadata
|
|
||||||
After=NetworkManager-wait-online.service
|
|
||||||
|
|
||||||
[Service]
|
|
||||||
ExecStart=/bin/bash -c "mkdir -p /root/.ssh/ ; chmod 700 /root/.ssh ; /usr/local/bin/oc-metadata | grep SSH_PUBLIC_KEYS_.*_KEY | cut -d'=' -f 2- | tr -d \\' > /root/.ssh/authorized_keys"
|
|
||||||
Type=oneshot
|
|
||||||
|
|
||||||
[Install]
|
|
||||||
WantedBy=multi-user.target
|
|
|
@ -1,10 +0,0 @@
|
||||||
[Unit]
|
|
||||||
Description=OCS fetch kernel modules from OCS mirror
|
|
||||||
After=NetworkManager-wait-online.service
|
|
||||||
|
|
||||||
[Service]
|
|
||||||
ExecStart=/usr/sbin/oc-sync-kernel-modules
|
|
||||||
Type=oneshot
|
|
||||||
|
|
||||||
[Install]
|
|
||||||
WantedBy=multi-user.target
|
|
|
@ -1,10 +0,0 @@
|
||||||
[Unit]
|
|
||||||
Description=Reboot
|
|
||||||
Documentation=man:systemd-halt.service(8)
|
|
||||||
DefaultDependencies=no
|
|
||||||
Requires=shutdown.target umount.target final.target
|
|
||||||
After=shutdown.target umount.target final.target
|
|
||||||
|
|
||||||
[Service]
|
|
||||||
Type=oneshot
|
|
||||||
ExecStart=/usr/sbin/oc-nbd-disconnect-root
|
|
|
@ -1,6 +1,6 @@
|
||||||
# Fetch OCS metadata
|
# Fetch Scaleway metadata
|
||||||
|
|
||||||
fetch_ocs_metadata()
|
fetch_scw_metadata()
|
||||||
{
|
{
|
||||||
metadata_host_name=$(/usr/local/bin/oc-metadata --cached HOSTNAME)
|
metadata_host_name=$(/usr/local/bin/oc-metadata --cached HOSTNAME)
|
||||||
if [ "x$metadata_host_name" != "x" ]; then
|
if [ "x$metadata_host_name" != "x" ]; then
|
||||||
|
@ -14,5 +14,5 @@ fetch_ocs_metadata()
|
||||||
}
|
}
|
||||||
|
|
||||||
if $if_up; then
|
if $if_up; then
|
||||||
fetch_ocs_metadata
|
fetch_scw_metadata
|
||||||
fi
|
fi
|
||||||
|
|
|
@ -4,7 +4,7 @@ METADATA_CACHE=`mktemp -u`
|
||||||
|
|
||||||
get_metadata() {
|
get_metadata() {
|
||||||
if [ ! -f $METADATA_CACHE ]; then
|
if [ ! -f $METADATA_CACHE ]; then
|
||||||
/usr/local/bin/oc-metadata > $METADATA_CACHE
|
/usr/local/bin/oc-metadata --cached > $METADATA_CACHE
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue