1
0

5 Commits

Author SHA1 Message Date
8fa62e9a6e Bump version 2023-04-26 14:36:25 +00:00
e04154b235 Fix stderr log 2023-04-26 14:35:20 +00:00
096cad8701 Cleanup also -core/-modules 2023-04-09 17:13:54 +00:00
70d464f0e2 Fix directory name 2023-04-09 14:38:39 +00:00
d65d683dfc Fix name of ubuntu image generator 2023-04-09 14:16:29 +00:00
12 changed files with 27 additions and 9 deletions

View File

@ -24,7 +24,7 @@ jobs:
sudo apt-get install qemu-system-x86
- name: Bootstrap
run: ./tools/qemu-debian-img/bootstrap.sh
run: ./tools/qemu-ubuntu-img/bootstrap.sh
- name: Unit Testing
run: go test -parallel 1 -v ./...

View File

@ -373,7 +373,10 @@ func generateBaseDockerImage(registry string, commands []config.DockerCommand,
// Cache kernel package dependencies
d += "RUN export PKGNAME=$(yum search kernel-devel --showduplicates | grep '^kernel-devel' | cut -d ' ' -f 1 | head -n 1); " +
"yum -y install $PKGNAME $(echo $PKGNAME | sed 's/-devel//'); " +
fmt.Sprintf("yum -y remove $PKGNAME $(echo $PKGNAME | sed 's/-devel//') %s\n", flags)
fmt.Sprintf("yum -y remove $PKGNAME "+
"$(echo $PKGNAME | sed 's/-devel//') "+
"$(echo $PKGNAME | sed 's/-devel/-modules/') "+
"$(echo $PKGNAME | sed 's/-devel/-core/') %s\n", flags)
default:
err = fmt.Errorf("%s not yet supported", sk.DistroType.String())
return

View File

@ -106,7 +106,7 @@ func main() {
Compact: true,
}),
kong.Vars{
"version": "2.1.1",
"version": "2.1.2",
},
)

View File

@ -30,7 +30,7 @@ Note: qemu on macOS since v2.12 (24 April 2018) supports Hypervisor.framework.
#### Generate image
$ cd $GOPATH/src/code.dumpstack.io/tools/out-of-tree/tools/qemu-debian-img
$ cd $GOPATH/src/code.dumpstack.io/tools/out-of-tree/tools/qemu-ubuntu-img
$ ./bootstrap.sh
### Fill configuration file

View File

@ -378,7 +378,11 @@ func (q System) Command(user, cmd string) (output string, err error) {
if err != nil {
return
}
session.Stderr = session.Stdout
stderr, err := session.StderrPipe()
if err != nil {
return
}
err = session.Start(cmd)
if err != nil {
@ -395,6 +399,17 @@ func (q System) Command(user, cmd string) (output string, err error) {
output = strings.TrimSuffix(output, "\n")
}()
go func() {
scanner := bufio.NewScanner(stderr)
for scanner.Scan() {
m := scanner.Text()
output += m + "\n"
// Note: it prints stderr as stdout
flog.Trace().Str("stdout", m).Msg("")
}
output = strings.TrimSuffix(output, "\n")
}()
err = session.Wait()
return
}

View File

@ -4,7 +4,7 @@
package qemu
const testConfigVmlinuz = "../tools/qemu-debian-img/ubuntu2204.vmlinuz"
const testConfigInitrd = "../tools/qemu-debian-img/ubuntu2204.initrd"
const testConfigRootfs = "../tools/qemu-debian-img/ubuntu2204.img"
const testConfigSampleKo = "../tools/qemu-debian-img/ubuntu2204.ko"
const testConfigVmlinuz = "../tools/qemu-ubuntu-img/ubuntu2204.vmlinuz"
const testConfigInitrd = "../tools/qemu-ubuntu-img/ubuntu2204.initrd"
const testConfigRootfs = "../tools/qemu-ubuntu-img/ubuntu2204.img"
const testConfigSampleKo = "../tools/qemu-ubuntu-img/ubuntu2204.ko"