diff options
author | Tom Barrett <spalf0@gmail.com> | 2019-12-04 06:47:28 -0600 |
---|---|---|
committer | Tom Barrett <spalf0@gmail.com> | 2019-12-04 06:47:28 -0600 |
commit | 2b91a602223757d52400d7a03533867479f5363f (patch) | |
tree | 6b9bdd74fb092b82e31d792749c780fff22784a3 | |
parent | 851fc8abf99b35ba2704f45e9604aaf69d7a51b2 (diff) |
full arch strap
-rwxr-xr-x | lxc/roll | 18 | ||||
-rwxr-xr-x | lxc/setup | 10 | ||||
-rwxr-xr-x | lxc_setup | 17 |
3 files changed, 28 insertions, 17 deletions
diff --git a/lxc/roll b/lxc/roll new file mode 100755 index 0000000..ecd1878 --- /dev/null +++ b/lxc/roll @@ -0,0 +1,18 @@ +#!/bin/bash +#set -e + +NAME=$1 +lxc-create -n $NAME -t download -- --dist archlinux --release current --arch amd64 +lxc-start -n $NAME +sleep 10 +lxc-attach -n $NAME -- pacman -Syu --noconfirm +lxc-attach -n $NAME -- pacman -Sy --noconfirm go git sudo fakeroot binutils make gcc patch +lxc-attach -n $NAME -- useradd tom +lxc-attach -n $NAME -- mkdir /home/tom +lxc-attach -n $NAME -- mkdir /home/tom/yay +lxc-attach -n $NAME -- git clone https://aur.archlinux.org/yay.git /home/tom/yay +lxc-attach -n $NAME -- chown tom:tom -R /home/tom +lxc-attach -n $NAME -- bash -c 'echo "tom ALL=(ALL) ALL" >> /etc/sudoers' +lxc-attach -n $NAME -- bash -c 'echo -e "tom\ntom" | passwd tom' +lxc-attach -n $NAME -- bash -c 'cd /home/tom/yay && sudo -u tom makepkg -si --noconfirm' +lxc-attach -n $NAME -- bash -c 'sudo -u tom yay -Syu --noconfirm' diff --git a/lxc/setup b/lxc/setup new file mode 100755 index 0000000..5fdf825 --- /dev/null +++ b/lxc/setup @@ -0,0 +1,10 @@ +#!/bin/bash +set -e + +virsh net-start default +virsh net-autostart default + +echo "kernel.unprivileged_userns_clone=1" > /etc/sysctl.d/80-lxc-userns.conf +echo "tom veth virbr0 2" > /etc/lxc/lxc-usernet +echo "you should reboot now." + diff --git a/lxc_setup b/lxc_setup deleted file mode 100755 index 8f96b01..0000000 --- a/lxc_setup +++ /dev/null @@ -1,17 +0,0 @@ -#!/bin/bash - -virsh net-start default -virsh net-autostart default - -echo "kernel.unprivileged_userns_clone=1" > /etc/sysctl.d/80-lxc-userns.conf -echo "tom veth virbr0 2" > /etc/lxc/lxc-usernet -echo "you should reboot now." - -# to auto build arch with yay -# lxc-create -n name -t download -- --dist archlinux --release current --arch amd64 -# lxc-attach -n name pacman -Sy go git sudo fakeroot binutils make gcc patch -# lxc-attach -n name useradd tom -# lxc-attach -n name mkdir /home/tom -# lxc-attach -n name git clone https://aur.archlinux.org/yay.git /home/tom -# lxc-attach -n name chown tom:tom -R /home/tom -# lxc-attach -n name echo "tom ALL=(ALL) ALL" > /etc/sudoers |