Compare commits

...

85 Commits

Author SHA1 Message Date
Les De Ridder acd19b3df7 Change image name 2016-04-28 21:29:30 +02:00
Les De Ridder a65f137eb6 Update Makefile 2016-04-28 21:00:27 +02:00
Les De Ridder 8c30f40e0b Disable unused locales 2016-04-28 20:34:49 +02:00
Les De Ridder 7bca128200 Update README.md 2016-04-28 20:32:50 +02:00
Les De Ridder 50a96f0a1c Add quotes 2016-04-28 20:23:03 +02:00
Les De Ridder c354ddb1af Change the default locale to en_GB.UTF-8 2016-04-28 20:15:22 +02:00
Les De Ridder 2a88f2bc4a Use an updated base image 2016-04-28 20:12:18 +02:00
Les De Ridder 87cbffb98f Update maintainer 2016-04-28 20:11:17 +02:00
Les De Ridder 2b0ffcf98c Update README.md 2016-04-28 18:50:42 +02:00
Les De Ridder 8402b06c2f Update cleanup step 2016-04-28 18:28:40 +02:00
Les De Ridder 854a0e29bb Don't explicitly install packages that are in base 2016-04-28 17:56:55 +02:00
Les De Ridder 2d09abb977 Update the keyring before installing anything 2016-04-28 17:53:15 +02:00
Les De Ridder 1c8648b890 Update scaleway service names 2016-04-28 17:52:21 +02:00
Les De Ridder f78465d118 Remove localepurge
localepurge is not in the official Arch Linux repositories
2016-04-28 17:51:50 +02:00
Les De Ridder 721c7f0d56 Use x86-64 image instead of ARM image 2016-04-28 17:51:00 +02:00
Manfred Touron b9b3aa2f57 Update Makefile 2016-04-13 11:06:04 +02:00
Manfred Touron cb108cf4ed Merge pull request #26 from mikkeloscar/systemd-228-fix
Enable required DHCP option in systemd-networkd
2015-12-07 20:17:39 +01:00
Mikkel Oscar Lyderik 122793eeba Enable required DHCP option in systemd-networkd
Under systemd 228 the DHCP option (or another similar) seems to be
needed for systemd-networkd to startup and not halt the rest of the
startup as reported in #25
2015-12-07 17:49:57 +01:00
Manfred Touron e8dd2b6cc7 Merge pull request #23 from scaleway/moul-patch-1
Update README.md
2015-10-05 11:33:33 -04:00
Manfred Touron 5d41da94c0 Merge pull request #22 from scaleway/small-fixes
Update metadata
2015-10-05 11:32:54 -04:00
Manfred Touron 6e7d7e138c Update README.md 2015-10-02 19:15:52 +02:00
Manfred Touron a16def9eac Update metadata 2015-10-02 16:59:12 +00:00
Manfred Touron 1544da8a63 Merge pull request #19 from scaleway/moul-patch-1
Fix #18
2015-09-24 09:47:17 -04:00
Manfred Touron d52bbeb534 Fix #18 2015-09-12 01:12:35 +02:00
Manfred Touron 70aa5855f9 Merge pull request #17 from scaleway/moul-patch-1
Added image metadatas 📝
2015-09-10 16:02:21 +02:00
Manfred Touron 226376e15e Added image metadatas 📝 2015-09-10 12:37:56 +02:00
Sebastien Rannou 3e23c375a3 Removed shunit2 (upstream is dead). 2015-09-01 16:12:37 +00:00
Sebastien Rannou 70552c5dbd Removed DNS and hostname hooks (handled by the initrd). 2015-09-01 15:38:24 +00:00
Sebastien Rannou 1ffa6757fd Removed oc-add-extra-volumes service (now handled by the initrd). 2015-09-01 15:33:48 +00:00
Sebastien Rannou 10d364c568 Now regenerating machine-id on first boot. 2015-06-19 14:43:08 +00:00
Sebastien Rannou 904e177799 Gettind rid of NetworkManager. 2015-05-06 12:32:37 +00:00
Sebastien Rannou 6e64443f27 Now depending on systemd's flavor. 2015-04-17 14:45:25 +00:00
Manfred Touron edd132d2a3 s/scw-image-tools/scw-builder/g 2015-04-16 10:59:56 +02:00
Manfred Touron dadfad4dd0 Do not resolve connecting ip addresses 2015-04-08 18:35:11 +02:00
Manfred Touron fe57be2d86 Fixed build 2015-04-07 08:46:20 +00:00
Manfred Touron a12c6136c4 s/onlinelabs/scaleway/g 2015-04-07 08:17:01 +00:00
Manfred Touron 49609bce15 Merge pull request #10 from lukas2511/sbin-fix
moving custom stuff from /usr/sbin to /usr/local/sbin
2015-03-22 00:00:04 +01:00
Manfred Touron 9ae32d1579
Using oc-metadata --cached 2015-03-21 23:57:52 +01:00
Manfred Touron d36a1b0ed8
sed -i 's@/usr/sbin@/usr/local/sbin@g' patches/etc/systemd/system/*.service (Fixes #11) 2015-03-21 23:57:19 +01:00
Lukas Schauer 83aa4c93af moving custom stuff from /usr/sbin to /usr/local/sbin (/usr/sbin on archlinux is just a symlink) 2015-03-21 16:46:52 +01:00
Manfred Touron 598506016d Revert "Relabel the whole filesystem on first boot"
This reverts commit 15282c2e6d.
2015-03-16 18:22:56 +00:00
Manfred Touron 15282c2e6d Relabel the whole filesystem on first boot 2015-03-16 12:25:06 +00:00
Manfred Touron 17cb401832 Update README.md 2015-03-10 11:41:52 +01:00
Manfred Touron 8fe9a1b3d0 Using cached metadata if available 2015-03-05 17:21:07 +01:00
Manfred Touron c889456ef8 Added travis badge 2015-02-11 17:59:49 +01:00
Manfred Touron 3d6172bb91 Added bc and shunit2 dependencies (online-labs/image-tools#9) 2015-02-11 13:45:03 +00:00
Manfred Touron 71d1ba427f Removing root password (online-labs/image-tools#10) 2015-02-11 10:38:54 +00:00
Sebastien Rannou 9f4613804f Added configuration for online's DNS server for resolved. 2015-01-30 17:46:56 +01:00
Manfred Touron 0b5ef27c4e Added dnsutils package (nslookup) (#1) 2015-01-30 16:39:46 +00:00
Manfred Touron 1e1e0988c6 Regenerating pacman database finally (#1) 2015-01-30 16:39:42 +00:00
Manfred Touron b62f0599e4 Fixed cleanup and install order 2015-01-30 15:29:08 +00:00
Sebastien Rannou 1011c3daf5 Moved systemd custom units to etc so it's not overwritten by pacman -Syu. #1 2015-01-30 16:19:34 +01:00
Sebastien Rannou 121a239439 Added NetworkManager hook to use systemd's DNS service. #1 2015-01-30 16:01:37 +01:00
Manfred Touron f94c1eec25 Moved cleanup after the final package upgrade 2015-01-30 14:57:30 +00:00
Manfred Touron 5dfb1c118b Added Added packages: bash-completion, file, htop, lsb-release, openbsd-netcat, rsync, rsyslog, screen, socat, sudo (#1) 2015-01-30 14:51:03 +00:00
Sebastien Rannou 6328f98aad Ensure resolved service is called after NetworkManager-wait-online. #1 2015-01-30 15:07:42 +01:00
Sebastien Rannou f759c205ce Added default resolv.conf for the first boot. #1 2015-01-30 15:04:56 +01:00
Manfred Touron 7aa288b7df Free up ~70MB space again (#1) 2015-01-30 14:02:54 +00:00
Manfred Touron c8c2055ffa Free up ~80MB space again (#1) 2015-01-30 13:50:07 +00:00
Manfred Touron 21db560f3c Improved Docker cache by switching RUN order (#1) 2015-01-30 13:50:03 +00:00
Manfred Touron 671e2b6126 Added tmux package (#1) 2015-01-30 13:40:13 +00:00
Manfred Touron c210053c8d Free up >100MB space again (#1) 2015-01-30 13:36:28 +00:00
Manfred Touron 9c4dce36ca Free up >100MB space (#1) 2015-01-30 13:32:36 +00:00
Manfred Touron e820f8f441
Added .travis.yml 2015-01-14 17:31:41 +01:00
Manfred Touron 5dd8f50d05 Removed debug access (hardcoded password + ssh keys) 2015-01-13 17:05:42 +00:00
Manfred Touron c2e638b605 Update README.md 2015-01-05 12:53:24 +01:00
Manfred Touron 4f4d2e3c51 Update LICENSE 2015-01-01 14:32:24 +01:00
Manfred Touron 22588c52d9 Added dispatcher.d hostname hook (#1) 2014-12-29 18:58:02 +00:00
Manfred Touron 4c2e0d963c Added dhcp hook (#1) 2014-12-29 18:38:47 +00:00
Manfred Touron 13aaf46f7d
Disable ssh password login and env customization (#1) 2014-12-29 16:23:55 +01:00
Manfred Touron 5c43757900
Added default sshd_config file 2014-12-29 16:22:22 +01:00
Sebastien Rannou 1756e6c545 Now calling the ochostname script right after eth0 is ready, not in the pre-up hook. #1 2014-12-26 11:39:56 +01:00
Manfred Touron e8c228e255 Added @online_en twitter usertag 2014-12-21 10:23:46 +01:00
Sebastien Rannou 946b35c26c Fixed build of the image (don't ask for confirmation in pacman). #1 2014-12-19 11:58:01 +01:00
Sébastien Rannou 35bc5bab72 Fixed typo on the README. 2014-12-19 11:25:44 +01:00
Sebastien Rannou 5ead98b92f Fix getty to use 9600 bauds. #1 2014-12-19 11:10:59 +01:00
Sebastien Rannou 8439ad3c13 Now enabling ocs services. #1 2014-12-19 11:03:16 +01:00
Sebastien Rannou 0f6d8ebc25 Added ocs' services to add/remove extra volumes. disconnect root fs. #1 2014-12-19 10:05:36 +01:00
Sebastien Rannou d6e1e0c65f Added NetworkManaget to set hostname and properly configure network at startup. #1 2014-12-19 09:39:40 +01:00
Sebastien Rannou 3f7eef085d Added post init script for dhclient. #1 2014-12-18 19:19:08 +01:00
Sebastien Rannou 6a04a73c4f Added compilation of xnbd-client since there's no such package on archlinux. #1 2014-12-18 19:17:21 +01:00
Sebastien Rannou deb9a1aad1 Import systemd's script from Fedora's image and install NetworkManager. 2014-12-18 18:59:04 +01:00
Manfred Touron 21b5ddacfd Added locales, systemd, upgrade (#1) 2014-12-18 10:50:02 +00:00
Manfred Touron dadeaac518 Using latest as the default version 2014-12-18 10:30:58 +00:00
Manfred Touron 0ce6fd7f3c Ported scripts to the docker-based builder (Fixes #2) 2014-12-18 10:03:15 +00:00
20 changed files with 508 additions and 219 deletions

4
.gitignore vendored
View File

@ -7,4 +7,6 @@ source.tar.xz
sd*.raw*
rootfs*
*/*.tar
*/*.built
*/*.built
.docker-container.built
docker-rules.mk

4
.travis.yml Normal file
View File

@ -0,0 +1,4 @@
language: bash
script:
- make travis

79
Dockerfile Normal file
View File

@ -0,0 +1,79 @@
FROM derjudge/archlinux
MAINTAINER lesderid <les@lesderid.net>
# Environment
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
RUN pacman -Sy --noconfirm \
bash-completion \
bc \
binutils \
cronie \
curl \
dnsutils \
fakeroot \
htop \
iptables \
lsb-release \
mg \
nbd \
ntp \
openbsd-netcat \
openssh \
rsync \
rsyslog \
screen \
socat \
sudo \
tmux \
vim \
wget
# Locales
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
# 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
RUN systemctl enable \
scw-fetch-ssh-keys \
scw-sync-kernel-modules \
scw-generate-ssh-keys \
scw-gen-machine-id.service \
ntpdate.service \
sshd.service \
serial-getty@ttyS0.service \
&& systemctl mask \
getty@tty1.service
# packages upgrade
RUN pacman --noconfirm -Suy
# Remove root password
RUN passwd -d root
# Cleanup
RUN pacman-db-upgrade \
&& pacman -Sc --noconfirm \
&& rm -rf /var/cache/pacman/pkg \
&& pacman-db-upgrade

View File

@ -1,6 +1,6 @@
The MIT License (MIT)
Copyright (c) 2014 Online Labs
Copyright (c) 2014-2015 Scaleway
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
@ -19,4 +19,3 @@ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

18
Makefile Normal file
View File

@ -0,0 +1,18 @@
NAME = archlinux
VERSION = latest
VERSION_ALIASES = 2014-12-02
TITLE = Arch Linux
DESCRIPTION = A simple, lightweight distribution
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/scaleway/image-tools)
all: docker-rules.mk
docker-rules.mk:
wget -qO - https://j.mp/scw-builder | bash
-include docker-rules.mk

View File

@ -1,21 +1,44 @@
Official Archlinux image on Online Labs
=======================================
# Arch Linux image on Scaleway
**Warning: this is 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/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)
---
Related projects
----------------
**This image is meant to be used on a VC1 server.**
- https://github.com/online-labs/image-tools (Main project for building images on Online Labs)
- https://github.com/online-labs/image-builder (Old repository with full history)
- https://github.com/online-labs/ocs-scripts (Common scripts for distributions)
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.
links
-----
[More info](https://github.com/scaleway/image-tools#docker-based-builder)
---
## Building
Build and add the image to [your account](https://cloud.scaleway.com/#/images):
$ make image_on_local
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
- [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)
---
A project by [![Scaleway](https://avatars1.githubusercontent.com/u/5185491?v=3&s=42)](https://www.scaleway.com/) and lesderid

85
build
View File

@ -1,85 +0,0 @@
#!/bin/bash
. ./lib.sh # Include library
# Image
DISTRIB="archlinux"
ARCH=${ARCH:-"armhf"}
TARGET=${TARGET:-"rootfs-target"}
CLEAN_PATHS="/root/.bash_history /root/.history /etc/resolv.conf /etc/ssh/*_key*"
PKGS_INCLUDE=${PKGS_INCLUDE:-"cronie,curl,iptables,dhcpcd,less,man,nano,nbd,ntp,openssh,wget,vim"}
# MIRROR=${MIRROR:-"http://mirror.cloud.online.net/ubuntu-ports/"}
VERSION=${VERSION:-"latest"}
LOCALES="en_US.UTF-8,fr_FR.UTF-8"
S3_URL=s3://test-images/archlinux/
# Required
NAME=${NAME:-"rootfs-$ARCH-$DISTRIB"}
build_image() {
# TODO Mirror
sudo wget -O source.tar.gz \
http://os.archlinuxarm.org/os/ArchLinuxARM-armv7-$VERSION.tar.gz
sudo mkdir -p "$TARGET"
sudo tar -C "$TARGET" -xzf source.tar.gz
}
patch_image() {
# prepare chroot
sudo umount $TARGET/{sys,dev,proc} || true
sudo mount -t proc proc $TARGET/proc
sudo mount -t sysfs sys $TARGET/sys
sudo mount -o bind /dev $TARGET/dev
do_in_target 'sed s/root:[^:]\+:/root:x:/ -i /etc/shadow'
sudo mkdir -p $TARGET/run/systemd/resolve
sudo cp /etc/resolv.conf $TARGET/run/systemd/resolve/resolv.conf
do_in_target 'curl https://raw.githubusercontent.com/online-labs/ocs-scripts/master/upgrade_root.bash | bash'
patch_target archlinux/patches
# TODO Get ssh keys from config
sudo mkdir -p $TARGET/root/.ssh
sudo cp -va /root/.ssh/authorized_keys $TARGET/root/.ssh
echo $LOCALES | sed 's/,/\n/' | while read loc; do
do_in_target "sed -e s/^\#${loc}/${loc}/ -i /etc/locale.gen"
done
do_in_target locale-gen
pkgs_pacman=`echo $PKGS_INCLUDE | tr ',' ' '`
do_in_target "pacman -Sy --noconfirm $pkgs_pacman"
do_in_target "systemctl enable sshd.service"
# tty settings
do_in_target "systemctl disable getty@tty1.service"
do_in_target "systemctl enable serial-getty@ttyS0.service"
# clean chroot
sudo rm -f $TARGET/run/systemd/resolve/resolv.conf
sudo umount $TARGET/{sys,dev,proc} || true
}
upgrade_image() {
sudo umount $TARGET/{sys,dev,proc} || true
sudo mount -t proc proc $TARGET/proc
sudo mount -t sysfs sys $TARGET/sys
sudo mount -o bind /dev $TARGET/dev
sudo cp /etc/resolv.conf $TARGET/run/systemd/resolve/resolv.conf
do_in_target "pacman --noconfirm -Suy"
sudo rm -f $TARGET/run/systemd/resolve/resolv.conf
sudo umount $TARGET/{sys,dev,proc} || true
}
clean_image() {
# FIXME: clean package achives
clean_target $CLEAN_PATHS
# FIXME: reload package index
}
if [ "${1}" != "--source-only" ]; then
cli $@
fi

118
lib.sh
View File

@ -1,118 +0,0 @@
# Declares helpers for image building
set -e
[ "$DEBUG" = "1" ] && set -x
prepare_nbd_volume() {
device=$1
if ! `mountpoint -q "$TARGET"`; then
sudo mkfs.ext4 "$device"
sudo mkdir -p "$TARGET.device"
sudo mount "$device" "$TARGET.device"
rsync -aHAX "$TARGET/" "$TARGET.device"
fi
}
require_debootstrap() {
type -P debootstrap >/dev/null && return
sudo apt-get update
sudo apt-get -y install debootstrap
}
clean_workspace() {
sudo rm -rf $TARGET/* $TARGET/.??*
}
debootstrap() {
if [ ! -d "$TARGET.debootstrap" ]; then
sudo debootstrap \
--arch="$ARCH" \
--variant="$VARIANT" \
--components="$COMPONENTS" \
--include="$PKGS_INCLUDE" \
"$VERSION" \
"$TARGET.debootstrap" \
"$MIRROR" \
"$SCRIPT"
fi
rsync -aHAX "$TARGET.debootstrap/" "$TARGET/"
}
upgrade_debs() {
do_in_target "apt-get update"
do_in_target "apt-get -y upgrade"
}
secondstage() {
# This step could be done directly by removing
# do_in_target /debootstrap/debootstrap --second-stage
echo "Not needed anymore (removed the --foreign option)"
}
patch_target() {
patches_dir=../$1
for file in $(find "$patches_dir" -type f | sed -n "s|^$patches_dir/||p"); do
sudo mkdir -p "$TARGET/$(dirname $file)"
sudo cp "$patches_dir/$file" "$TARGET/$file"
done
}
clean_target() {
clean_paths="$@"
for path in $clean_paths; do
if [ -e "$TARGET/$path" ]; then
sudo rm -rf "$TARGET/$path"
fi
done
for file in $(find "$TARGET/var/log" -type f); do
echo | sudo tee $file
done
find "$TARGET" \( -name "*~" -or -name ".??*~" -or -name "#*#" -or -name ".#*" \) -delete
}
archive_target() {
sudo tar -C "$TARGET" -czf "$NAME.tar.gz" .
}
do_in_target() {
sudo chroot "$TARGET" su - root -c "$@"
}
push_to_s3() {
edit_date=$(stat -c %Y "$TARGET")
s3cmd put --acl-public "$NAME.tar.gz" "$S3_URL/$NAME-${edit_date}.tar.gz"
s3cmd put --acl-public "$NAME.tar.gz" "$S3_URL/$NAME-latest.tar.gz"
s3cmd ls "s3://rescue-images/rescue/"
# s3cmd cp --acl-public "s3://rescue-images/rescue/$NAME-${edit_date}.tar.gz" "s3://rescue-images/rescue/$NAME-latest.tar.gz"
}
cli() {
case $1 in
"tarball")
build_image
patch_image
upgrade_image
clean_image
archive_target
push_to_s3
exit 0
;;
"image")
NBD_DEVICE=${2:-"/dev/nbd1"}
build_image
patch_image
upgrade_image
clean_image
prepare_nbd_volume $NBD_DEVICE
sync
exit 0
;;
"build_image"|"patch_image"|"archive_target"|"prepare_nbd_volume"|"upgrade_image"|"clean_image"|"push_to_s3")
eval $@
exit 0
;;
esac
echo >&2 "usage: [DEBUG=1] $0 (tarball|image)"
exit 1
}

View File

@ -0,0 +1,53 @@
####################################################
# This is the configuration file for localepurge(8).
####################################################
# Comment this to enable localepurge.
# NO COMMENT IT IF YOU ARE NOT SURE WHAT ARE YOU DOING
# THIS APP DO NOT ASK FOR CONFIRMATION
#NEEDSCONFIGFIRST
####################################################
# Uncommenting this string enables removal of localized
# man pages based on the configuration information for
# locale files defined below:
MANDELETE
####################################################
# Uncommenting this string causes localepurge to simply delete
# locales which have newly appeared on the system without
# bothering you about it:
#DONTBOTHERNEWLOCALE
#####################################################
# Commenting out this string enables faster but less
# accurate calculation of freed disk space:
#QUICKNDIRTYCALC
####################################################
# Uncommenting this string enables display of freed disk
# space if localepurge has purged any superfluous data:
SHOWFREEDSPACE
#####################################################
# Commenting out this string disables verbose output:
#VERBOSE
#####################################################
# You like Colors?
#NOCOLOR
#####################################################
# You can use the -v -d -nc options in command line.
#####################################################
# Following locales won't be deleted from this system
# for example:
en_US
en_US.UTF-8

View File

@ -3,7 +3,7 @@
# - http://support.ntp.org/bin/view/Support/GettingStarted
# - 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/
server 0.arch.pool.ntp.org

2
patches/etc/resolv.conf Normal file
View File

@ -0,0 +1,2 @@
# default nameserver
nameserver 8.8.8.8

133
patches/etc/ssh/sshd_config Normal file
View File

@ -0,0 +1,133 @@
# $OpenBSD: sshd_config,v 1.93 2014/01/10 05:59:19 djm Exp $
# This is the sshd server system-wide configuration file. See
# sshd_config(5) for more information.
# This sshd was compiled with PATH=/usr/bin:/bin:/usr/sbin:/sbin
# The strategy used for options in the default sshd_config shipped with
# OpenSSH is to specify options with their default value where
# possible, but leave them commented. Uncommented options override the
# default value.
#Port 22
#AddressFamily any
#ListenAddress 0.0.0.0
#ListenAddress ::
# The default requires explicit activation of protocol 1
#Protocol 2
# HostKey for protocol version 1
#HostKey /etc/ssh/ssh_host_key
# HostKeys for protocol version 2
#HostKey /etc/ssh/ssh_host_rsa_key
#HostKey /etc/ssh/ssh_host_dsa_key
#HostKey /etc/ssh/ssh_host_ecdsa_key
#HostKey /etc/ssh/ssh_host_ed25519_key
# Lifetime and size of ephemeral version 1 server key
#KeyRegenerationInterval 1h
#ServerKeyBits 1024
# Ciphers and keying
#RekeyLimit default none
# Logging
# obsoletes QuietMode and FascistLogging
#SyslogFacility AUTH
#LogLevel INFO
# Authentication:
#LoginGraceTime 2m
PermitRootLogin without-password
#StrictModes yes
#MaxAuthTries 6
#MaxSessions 10
#RSAAuthentication yes
#PubkeyAuthentication yes
# The default is to check both .ssh/authorized_keys and .ssh/authorized_keys2
# but this is overridden so installations will only check .ssh/authorized_keys
AuthorizedKeysFile .ssh/authorized_keys
#AuthorizedPrincipalsFile none
#AuthorizedKeysCommand none
#AuthorizedKeysCommandUser nobody
# For this to work you will also need host keys in /etc/ssh/ssh_known_hosts
#RhostsRSAAuthentication no
# similar for protocol version 2
#HostbasedAuthentication no
# Change to yes if you don't trust ~/.ssh/known_hosts for
# RhostsRSAAuthentication and HostbasedAuthentication
#IgnoreUserKnownHosts no
# Don't read the user's ~/.rhosts and ~/.shosts files
#IgnoreRhosts yes
# To disable tunneled clear text passwords, change to no here!
#PasswordAuthentication yes
#PermitEmptyPasswords no
# Change to no to disable s/key passwords
ChallengeResponseAuthentication no
# Kerberos options
#KerberosAuthentication no
#KerberosOrLocalPasswd yes
#KerberosTicketCleanup yes
#KerberosGetAFSToken no
# GSSAPI options
#GSSAPIAuthentication no
#GSSAPICleanupCredentials yes
# Set this to 'yes' to enable PAM authentication, account processing,
# and session processing. If this is enabled, PAM authentication will
# be allowed through the ChallengeResponseAuthentication and
# PasswordAuthentication. Depending on your PAM configuration,
# PAM authentication via ChallengeResponseAuthentication may bypass
# the setting of "PermitRootLogin without-password".
# If you just want the PAM account and session checks to run without
# PAM authentication, then enable this but set PasswordAuthentication
# and ChallengeResponseAuthentication to 'no'.
UsePAM yes
#AllowAgentForwarding yes
#AllowTcpForwarding yes
#GatewayPorts no
#X11Forwarding no
#X11DisplayOffset 10
#X11UseLocalhost yes
#PermitTTY yes
PrintMotd no # pam does that
#PrintLastLog yes
#TCPKeepAlive yes
#UseLogin no
UsePrivilegeSeparation sandbox # Default for new installations.
PermitUserEnvironment no
#Compression delayed
#ClientAliveInterval 0
#ClientAliveCountMax 3
UseDNS no
#PidFile /run/sshd.pid
#MaxStartups 10:30:100
#PermitTunnel no
#ChrootDirectory none
#VersionAddendum none
# no default banner path
#Banner none
# override default of no subsystems
Subsystem sftp /usr/lib/ssh/sftp-server
# Example of overriding settings on a per-user basis
#Match User anoncvs
# X11Forwarding no
# AllowTcpForwarding no
# PermitTTY no
# ForceCommand cvs server

View File

@ -2,6 +2,7 @@
Name=eth0
[Network]
DHCP=yes
DNS=10.1.31.38
DNS=10.1.31.39
Domains=cloud.online.net
Domains=scaleway.com

View File

@ -0,0 +1,6 @@
# Scaleway's DNS
[Resolve]
DNS=10.1.31.38
FallbackDNS=8.8.8.8 8.8.4.4
LLMNR=no

View File

@ -0,0 +1,35 @@
# This file is part of systemd.
#
# systemd is free software; you can redistribute it and/or modify it
# under the terms of the GNU Lesser General Public License as published by
# the Free Software Foundation; either version 2.1 of the License, or
# (at your option) any later version.
[Unit]
Description=Serial Getty on %I
Documentation=man:agetty(8) man:systemd-getty-generator(8)
Documentation=http://0pointer.de/blog/projects/serial-console.html
BindsTo=dev-%i.device
After=dev-%i.device systemd-user-sessions.service plymouth-quit-wait.service
After=rc-local.service
# If additional gettys are spawned during boot then we should make
# sure that this is synchronized before getty.target, even though
# getty.target didn't actually pull it in.
Before=getty.target
IgnoreOnIsolate=yes
[Service]
ExecStart=-/sbin/agetty --keep-baud %I 9600 vt102
Type=idle
Restart=always
UtmpIdentifier=%I
TTYPath=/dev/%I
TTYReset=yes
TTYVHangup=yes
KillMode=process
IgnoreSIGPIPE=no
SendSIGHUP=yes
[Install]
WantedBy=getty.target

View File

@ -0,0 +1,23 @@
# This file is part of systemd.
#
# systemd is free software; you can redistribute it and/or modify it
# under the terms of the GNU Lesser General Public License as published by
# the Free Software Foundation; either version 2.1 of the License, or
# (at your option) any later version.
[Unit]
Description=Network Name Resolution
Documentation=man:systemd-resolved.service(8)
After=NetworkManager-wait-online.service
[Service]
Type=notify
Restart=always
RestartSec=0
ExecStart=/usr/lib/systemd/systemd-resolved
CapabilityBoundingSet=CAP_SETUID CAP_SETGID CAP_SETPCAP CAP_CHOWN CAP_DAC_OVERRIDE CAP_FOWNER
ProtectSystem=full
ProtectHome=yes
[Install]
WantedBy=multi-user.target

View File

@ -0,0 +1,18 @@
# Fetch Scaleway metadata
fetch_scw_metadata()
{
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
export new_host_name="${metadata_host_name}"
hostname $metadata_host_name
echo dhclient-exit-hooks.d/hostname: Dynamic Hostname = ${metadata_host_name}
fi
}
if $if_up; then
fetch_scw_metadata
fi

View File

@ -0,0 +1,36 @@
#!/bin/bash
METADATA_CACHE=`mktemp -u`
get_metadata() {
if [ ! -f $METADATA_CACHE ]; then
/usr/local/bin/oc-metadata --cached > $METADATA_CACHE
fi
}
get_value() {
# Get value from metadata
key="$1"
grep "^$key=" "$METADATA_CACHE" | cut -d= -f2 | sed "s/^['\"]//;s/['\"]$//"
}
add_volumes() {
keys=$(get_value VOLUMES)
for key in $keys
do
test $key -eq 0 && continue
host=$(get_value VOLUMES_${key}_EXPORT_URI | sed 's|nbd://\(.*\):.*|\1|')
port=$(get_value VOLUMES_${key}_EXPORT_URI | sed 's|nbd://.*:\(.*\)|\1|')
device=/dev/nbd$key
xnbd-client -c $device && continue
for i in {1..3}
do
xnbd-client --connect $device $host $port --blocksize 4096 && break
sleep 5
done
done
}
get_metadata
add_volumes
rm $METADATA_CACHE

View File

@ -0,0 +1,15 @@
#!/bin/sh
# Thanks to the LTSP project
# If the root /dev/nbd0 device is unmounted on reboot then nbd read
# errors occur, and if it isn't, then # the nbd-server process on the server
# doesn't terminate.
# Called by init scripts on reboot.
NBD_CLIENT=/usr/local/sbin/xnbd-client
disconnect() {
$NBD_CLIENT -d "/dev/nbd0"
echo b > /proc/sysrq-trigger
}
disconnect

View File

@ -0,0 +1,45 @@
#!/bin/bash
ROOT_DEVICE="/dev/nbd0"
umount_nbd_devices() {
for device in $(mount | cut -d " " -f 1 | grep /dev/nbd)
do
test $device = $ROOT_DEVICE && continue
umount $device 2>/dev/null
if [ $? -eq 1 ]
then
echo -n "umount of $device failed! Data loss may occur! will continue in 10 seconds..."
sleep 1
for i in 9 8 7 6 5 4 3 2 1
do
echo -n $i" "
sleep 1
done
echo "ok, going on..."
fi
done
}
swapoff_nbd_devices() {
for device in $(grep '^/dev/nb' /proc/swaps | cut -d ' ' -f1)
do
swapoff $device 2> /dev/null
done
}
disconnect_devices() {
for device in $(ls /dev/nbd*)
do
test $device = $ROOT_DEVICE && continue
if xnbd-client -c $device 2> /dev/null
then
xnbd-client -d $device
fi
done
}
umount_nbd_devices
swapoff_nbd_devices
disconnect_devices