-
Notifications
You must be signed in to change notification settings - Fork 12
Expand file tree
/
Copy pathinstall.sh
More file actions
27 lines (27 loc) · 952 Bytes
/
install.sh
File metadata and controls
27 lines (27 loc) · 952 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#!/bin/sh
set -e
wget -O /tmp/undocker.py https://github.com/larsks/undocker/raw/c951f021e701b4ce61de03eb668a440e69646889/undocker.py
sudo mkdir -p /rootfs
docker pull zaoqi/github-actions-archlinux
docker save zaoqi/github-actions-archlinux | sudo python3 /tmp/undocker.py -o /rootfs zaoqi/github-actions-archlinux
docker rmi zaoqi/github-actions-archlinux
rm -fr /tmp/undocker.py
sudo sh -c "
systemctl stop docker
mkdir /rootfs/old.rootfs
mount --bind / /rootfs/old.rootfs
mkdir -p /rootfs/usr/lib/modules/
cp -Lfr /lib/modules/* /rootfs/usr/lib/modules/
chroot /rootfs /bin/sh -c '
cd /old.rootfs/etc/ &&
cp -Pfr passwd group shadow hosts resolv.conf hostname sudoers sudoers.d /etc/ &&
cd /old.rootfs &&
rm -fr etc sbin bin lib usr lib64 var/mail var/spool/mail &&
cd / &&
cp -Pfr home mnt opt root run srv var /old.rootfs &&
mv etc bin lib lib64 sbin usr /old.rootfs
' &&
umount /rootfs/old.rootfs &&
rm -fr /rootfs/ &&
systemctl daemon-reexec
"