Skip to content

Instantly share code, notes, and snippets.

@tailhook
Last active May 1, 2017 10:07
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tailhook/8d8137946958b36931bf to your computer and use it in GitHub Desktop.
Save tailhook/8d8137946958b36931bf to your computer and use it in GitHub Desktop.
Arch vagga
#!/bin/sh -ex
CONTRIBUTOR="Roman Rader <antigluk@gmail.com>"
OVERLAYFS_PATCH="http:\\/\\/people.canonical.com\\/~apw\\/lp1377025-utopic\\/0001-UBUNTU-SAUCE-Overlayfs-allow-unprivileged-mounts.patch"
sed -i.bak "s/# CONFIG_USER_NS is not set/CONFIG_USER_NS=y/" config
sed -i.bak "s/# CONFIG_USER_NS is not set/CONFIG_USER_NS=y/" config.x86_64
sed -i.bak "/source=/,/)/s/)$/\n$OVERLAYFS_PATCH)/" PKGBUILD
sed -i "s/\# add upstream patch/\# add upstream patch\n patch \-p1 \-i \"\$\{srcdir\}\/`basename $OVERLAYFS_PATCH`\"/" PKGBUILD
sed -i 's/^pkgbase=linux.*$/pkgbase=linux-user-ns-enabled/' PKGBUILD
sed -i "2i# Contributor: ${CONTRIBUTOR}" PKGBUILD
sed -i '/pkgdesc=/{s/"$/ with CONFIG_USER_NS enabled"/}' PKGBUILD
# Everything is owned by root
sed -i '/chown/{s/^/#/}' PKGBUILD
sed -i 's/cp -a /cp -a --no-preserve=ownership /' PKGBUILD
sed -i 's/cp -al /cp -al --no-preserve=ownership /' PKGBUILD
updpkgsums
makepkg --source --skippgpcheck
containers:
arch:
setup:
- !Tar
url: http://mirrors.nix.org.ua/linux/archlinux/iso/2015.12.01/archlinux-bootstrap-2015.12.01-x86_64.tar.gz
subdir: root.x86_64
- !CacheDirs { /var/cache/pacman: arch-packages }
- !Text
/etc/pacman.d/mirrorlist: |
Server = http://mirrors.nix.org.ua/linux/archlinux/$repo/os/$arch
# unfortunately Tar above overwrites resolv.conf, hopefull this is enough
/etc/resolv.conf: |
nameserver 8.8.8.8
nameserver 8.8.4.4
- !Sh |
pacman-key --init
pacman-key --populate archlinux
pacman -Syu --noconfirm
# build tools
- !Sh "pacman -S --noconfirm base-devel git"
# for kernel
- !Sh "pacman -S --noconfirm xmlto docbook-xsl inetutils bc"
- !Sh |
echo 'MAKEFLAGS="-j4"' >> /etc/makepkg.conf
- !EnsureDir /build # hack, but useful
- !EnsureDir /work/build # hack, but useful
auto-clean: true
commands:
build-package: !Command
container: arch
user-id: 1
external-user-id: 0
work-dir: packages/linux/repos/core-x86_64
accepts-arguments: true
run: |
[ -d /work/dist ] || mkdir /work/dist
rm dist/*.tar.xz
PKGDEST=/work/dist makepkg --skippgpcheck --log "$@"
prepare-package: !Command
container: arch
user-id: 1
external-user-id: 0
work-dir: packages/linux/repos/core-x86_64
run: [/work/patch_package.sh]
make-repo: !Command
container: arch
user-id: 1
external-user-id: 0
run: |
repo-add dist/repo.db.tar.xz dist/*
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment