-
Notifications
You must be signed in to change notification settings - Fork 168
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use supermin in unprivileged environments
This is a rebased rework of #124 with some modifications: - We auto-detect if we have CAP_SYS_ADMIN and if not, fall back to using supermin. My position is that both approaches will be in use in CI contexts and that the privileged case is faster for local dev, where iterating fast on the content will matter. I've also hopefully implemented things in a way that maintains almost the exact same logic build-wise between the two flows so there's not too much divergence. Anyway, totally open to revisiting this if needed! - In the virtualized path, `fetch` now directly populates the qcow2 cache so that the split `fetch`/`build` approach keeps working as expected. - We drop the repo-build/ repo since it's essentially also a cache and duplicates content from the archive repo. This is also needed to ensure that the pkgcache repo and the repo we commit into are both on the same file system. - The supermin appliance is reused if already generated; the `runvm` command just takes the command you want to run verbatim and plops it into a file the appliance is already coded to check from. Some other minor fixes: - We handle symlinked repos. - Split out supermin packages into a separate file. - Capture rc and bubble that up to the `runvm` caller. - Add virtio-rng device. Originally based on a patch by: Dusty Mabe <[email protected]>
- Loading branch information
Showing
10 changed files
with
183 additions
and
32 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,6 @@ | ||
# For privileged ops | ||
supermin | ||
|
||
# We default to builder user, but sudo where necessary | ||
sudo | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
mount -t proc /proc /proc | ||
mount -t sysfs /sys /sys | ||
mount -t devtmpfs devtmpfs /dev | ||
|
||
# load selinux policy | ||
LANG=C /sbin/load_policy -i | ||
|
||
# load kernel module for 9pnet_virtio for 9pfs mount | ||
/sbin/modprobe 9pnet_virtio | ||
|
||
# need fuse module for rofiles-fuse/bwrap during post scripts run | ||
/sbin/modprobe fuse | ||
|
||
# set up networking | ||
/usr/sbin/dhclient eth0 | ||
|
||
# set up workdir | ||
mkdir -p ${workdir} | ||
mount -t 9p -o rw,trans=virtio,version=9p2000.L workdir ${workdir} | ||
if [ -L ${workdir}/src/config ]; then | ||
mkdir -p $(readlink ${workdir}/src/config) | ||
mount -t 9p -o rw,trans=virtio,version=9p2000.L source ${workdir}/src/config | ||
fi | ||
mkdir -p ${workdir}/cache | ||
mount /dev/sdb1 ${workdir}/cache | ||
|
||
cd ${workdir} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
# Base deps for a viable VM environment. | ||
|
||
# bare essentials | ||
bash vim-minimal coreutils util-linux procps-ng kmod kernel-modules | ||
|
||
# for composes | ||
rpm-ostree distribution-gpg-keys jq | ||
|
||
# for clean reboot | ||
systemd | ||
|
||
# networking | ||
dhcp-client bind-export-libs iproute | ||
|
||
# SELinux | ||
selinux-policy selinux-policy-targeted policycoreutils |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
./src/vmdeps.txt |