Compare commits
2 Commits
75dd8f4a51
...
9b379eded8
Author | SHA1 | Date | |
---|---|---|---|
9b379eded8 | |||
d3a575e5e3 |
2
.github/workflows/e2e.yml
vendored
2
.github/workflows/e2e.yml
vendored
@ -139,7 +139,7 @@ jobs:
|
|||||||
echo 'Type=oneshot' >> test.service
|
echo 'Type=oneshot' >> test.service
|
||||||
echo 'WorkingDirectory=/root/test' >> test.service
|
echo 'WorkingDirectory=/root/test' >> test.service
|
||||||
echo 'TimeoutStopSec=1' >> test.service
|
echo 'TimeoutStopSec=1' >> test.service
|
||||||
echo 'ExecStart=/usr/local/bin/out-of-tree kernel --no-container-cache autogen --threads=8 --max=64 --shuffle' >> test.service
|
echo 'ExecStart=/usr/local/bin/out-of-tree kernel --no-prebuilt-containers autogen --threads=8 --max=64 --shuffle' >> test.service
|
||||||
echo 'ExecStart=/usr/local/bin/out-of-tree pew --qemu-timeout=10m --threads=4 --include-internal-errors' >> test.service
|
echo 'ExecStart=/usr/local/bin/out-of-tree pew --qemu-timeout=10m --threads=4 --include-internal-errors' >> test.service
|
||||||
|
|
||||||
scp test.service root@$IP:/etc/systemd/system/test.service
|
scp test.service root@$IP:/etc/systemd/system/test.service
|
||||||
|
@ -27,18 +27,18 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
type KernelCmd struct {
|
type KernelCmd struct {
|
||||||
NoDownload bool `help:"do not download qemu image while kernel generation"`
|
NoDownload bool `help:"do not download qemu image while kernel generation"`
|
||||||
UseHost bool `help:"also use host kernels"`
|
UseHost bool `help:"also use host kernels"`
|
||||||
Force bool `help:"force reinstall kernel"`
|
Force bool `help:"force reinstall kernel"`
|
||||||
NoHeaders bool `help:"do not install kernel headers"`
|
NoHeaders bool `help:"do not install kernel headers"`
|
||||||
Shuffle bool `help:"randomize kernels installation order"`
|
Shuffle bool `help:"randomize kernels installation order"`
|
||||||
Retries int `help:"amount of tries for each kernel" default:"2"`
|
Retries int `help:"amount of tries for each kernel" default:"2"`
|
||||||
Threads int `help:"threads for parallel installation" default:"1"`
|
Threads int `help:"threads for parallel installation" default:"1"`
|
||||||
Update bool `help:"update container"`
|
Update bool `help:"update container"`
|
||||||
ContainerCache bool `help:"try prebuilt container images first" default:"true" negatable:""`
|
PrebuiltContainers bool `help:"try prebuilt container images first" default:"true" negatable:""`
|
||||||
Max int `help:"maximum kernels to download" default:"100500"`
|
Max int `help:"maximum kernels to download" default:"100500"`
|
||||||
NoPrune bool `help:"do not remove dangling or unused images from local storage after build"`
|
NoPrune bool `help:"do not remove dangling or unused images from local storage after build"`
|
||||||
NoCfgRegen bool `help:"do not update kernels.toml"`
|
NoCfgRegen bool `help:"do not update kernels.toml"`
|
||||||
|
|
||||||
ContainerTimeout time.Duration `help:"container timeout"`
|
ContainerTimeout time.Duration `help:"container timeout"`
|
||||||
|
|
||||||
@ -168,11 +168,11 @@ func (cmd *KernelCmd) GenKernel(km artifact.Target, pkg string) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func (cmd *KernelCmd) fetchContainerCache(c container.Container) {
|
func (cmd *KernelCmd) fetchPrebuiltContainer(c container.Container) {
|
||||||
if !cmd.ContainerCache {
|
if !cmd.PrebuiltContainers {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
if c.Exist() {
|
if c.Exist() && container.UseCache {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -235,7 +235,7 @@ func (cmd *KernelCmd) Generate(g *Globals, km artifact.Target) (err error) {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
cmd.fetchContainerCache(c)
|
cmd.fetchPrebuiltContainer(c)
|
||||||
|
|
||||||
pkgs, err := kernel.MatchPackages(km)
|
pkgs, err := kernel.MatchPackages(km)
|
||||||
if err != nil || cmd.shutdown {
|
if err != nil || cmd.shutdown {
|
||||||
@ -335,7 +335,7 @@ func (cmd *KernelListRemoteCmd) Run(kernelCmd *KernelCmd, g *Globals) (err error
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
kernelCmd.fetchContainerCache(c)
|
kernelCmd.fetchPrebuiltContainer(c)
|
||||||
|
|
||||||
pkgs, err := kernel.MatchPackages(km)
|
pkgs, err := kernel.MatchPackages(km)
|
||||||
// error check skipped on purpose
|
// error check skipped on purpose
|
||||||
|
@ -241,6 +241,10 @@ func (c Container) Exist() (yes bool) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (c Container) Build(image string, envs, runs []string) (err error) {
|
func (c Container) Build(image string, envs, runs []string) (err error) {
|
||||||
|
if c.Exist() && UseCache {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
cdir := dotfiles.Dir("containers", c.name)
|
cdir := dotfiles.Dir("containers", c.name)
|
||||||
cfile := filepath.Join(cdir, "Dockerfile")
|
cfile := filepath.Join(cdir, "Dockerfile")
|
||||||
|
|
||||||
|
@ -37,12 +37,9 @@ func (centos CentOS) Packages() (pkgs []string, err error) {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
if !c.Exist() {
|
err = c.Build("centos:"+centos.release, centos.envs(), centos.runs())
|
||||||
err = c.Build("centos:"+centos.release,
|
if err != nil {
|
||||||
centos.envs(), centos.runs())
|
return
|
||||||
if err != nil {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
cmd := "yum search kernel --showduplicates 2>/dev/null " +
|
cmd := "yum search kernel --showduplicates 2>/dev/null " +
|
||||||
|
@ -54,11 +54,9 @@ func (d Debian) Packages() (packages []string, err error) {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
if !c.Exist() {
|
err = c.Build(d.image(), d.envs(), d.runs())
|
||||||
err = c.Build(d.image(), d.envs(), d.runs())
|
if err != nil {
|
||||||
if err != nil {
|
return
|
||||||
return
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
kernels, err := GetKernels()
|
kernels, err := GetKernels()
|
||||||
|
@ -70,11 +70,9 @@ func (suse OpenSUSE) Packages() (pkgs []string, err error) {
|
|||||||
name = "opensuse/leap:" + suse.release
|
name = "opensuse/leap:" + suse.release
|
||||||
}
|
}
|
||||||
|
|
||||||
if !c.Exist() {
|
err = c.Build(name, suse.envs(), suse.runs())
|
||||||
err = c.Build(name, suse.envs(), suse.runs())
|
if err != nil {
|
||||||
if err != nil {
|
return
|
||||||
return
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
cmd := "zypper search -s --match-exact kernel-default | grep x86_64 " +
|
cmd := "zypper search -s --match-exact kernel-default | grep x86_64 " +
|
||||||
|
@ -38,12 +38,9 @@ func (ol OracleLinux) Packages() (pkgs []string, err error) {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
if !c.Exist() {
|
err = c.Build("oraclelinux:"+ol.release, ol.envs(), ol.runs())
|
||||||
err = c.Build("oraclelinux:"+ol.release,
|
if err != nil {
|
||||||
ol.envs(), ol.runs())
|
return
|
||||||
if err != nil {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if ol.release == "8" {
|
if ol.release == "8" {
|
||||||
|
@ -43,11 +43,9 @@ func (u Ubuntu) Packages() (pkgs []string, err error) {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
if !c.Exist() {
|
err = c.Build("ubuntu:"+u.release, u.envs(), u.runs())
|
||||||
err = c.Build("ubuntu:"+u.release, u.envs(), u.runs())
|
if err != nil {
|
||||||
if err != nil {
|
return
|
||||||
return
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
cmd := "apt-cache search " +
|
cmd := "apt-cache search " +
|
||||||
|
Loading…
Reference in New Issue
Block a user