]> git.sev.monster Git - abchr.git/blame - abchr-newchroot
update readme
[abchr.git] / abchr-newchroot
CommitLineData
9efefcc4 1#!/bin/sh
2set -e
3[ "$(id | awk '{print $1}')" != 'uid=0(root)' ] &&
4 exec sudo "$0" "$(id -u $(whoami))" "$@"
5[ "z$1" = z ] && return 1
6mirror=https://dl-cdn.alpinelinux.org/alpine/edge
7arch="${ABCHR_ARCH:-x86_64}"
8apk="apk-tools-static-$(apk info apk-tools-static |
9 awk '{if (NR==1) {print substr($1,18)}}').apk"
10dir="$(dirname "$0")/../alpine"
11tmp="$(dirname "$0")/../tmp"
12mkdir -p "$tmp"
13wget -P "$tmp" "$mirror/main/$arch/$apk"
14tar -xvzf "$tmp/$apk" -C "$tmp"
15"$tmp/sbin/apk.static" -UX "$mirror/main" -X "$mirror/community" \
16 --allow-untrusted -p "$dir" --initdb \
17 add busybox busybox-suid libc-utils sudo \
18 alpine-baselayout alpine-conf alpine-release apk-tools \
19 alpine-sdk alpine-repo-tools atools lua-aports
20rm -rf "$tmp"
21cp -Ln /etc/apk/keys/* "$dir/etc/apk/keys"
22cp -f /etc/apk/repositories "$dir/etc/apk/repositories"
23printf -- > "$dir/etc/sudoers.d/abuild" 'abuild ALL=(ALL) NOPASSWD: ALL'
24printf -- >> "$dir/etc/apk/repositories" \
25 '/home/abuild/packages/%s\n' main community testing
26chroot "$dir" /bin/sh -c "adduser -DGabuild -u$1 abuild"
This page took 0.039238 seconds and 4 git commands to generate.