Compare commits
5 Commits
Author | SHA1 | Date | |
---|---|---|---|
8fa62e9a6e
|
|||
e04154b235
|
|||
096cad8701
|
|||
70d464f0e2
|
|||
d65d683dfc
|
2
.github/workflows/ubuntu.yml
vendored
2
.github/workflows/ubuntu.yml
vendored
@ -24,7 +24,7 @@ jobs:
|
|||||||
sudo apt-get install qemu-system-x86
|
sudo apt-get install qemu-system-x86
|
||||||
|
|
||||||
- name: Bootstrap
|
- name: Bootstrap
|
||||||
run: ./tools/qemu-debian-img/bootstrap.sh
|
run: ./tools/qemu-ubuntu-img/bootstrap.sh
|
||||||
|
|
||||||
- name: Unit Testing
|
- name: Unit Testing
|
||||||
run: go test -parallel 1 -v ./...
|
run: go test -parallel 1 -v ./...
|
||||||
|
@ -373,7 +373,10 @@ func generateBaseDockerImage(registry string, commands []config.DockerCommand,
|
|||||||
// Cache kernel package dependencies
|
// Cache kernel package dependencies
|
||||||
d += "RUN export PKGNAME=$(yum search kernel-devel --showduplicates | grep '^kernel-devel' | cut -d ' ' -f 1 | head -n 1); " +
|
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//'); " +
|
"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:
|
default:
|
||||||
err = fmt.Errorf("%s not yet supported", sk.DistroType.String())
|
err = fmt.Errorf("%s not yet supported", sk.DistroType.String())
|
||||||
return
|
return
|
||||||
|
2
main.go
2
main.go
@ -106,7 +106,7 @@ func main() {
|
|||||||
Compact: true,
|
Compact: true,
|
||||||
}),
|
}),
|
||||||
kong.Vars{
|
kong.Vars{
|
||||||
"version": "2.1.1",
|
"version": "2.1.2",
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -30,7 +30,7 @@ Note: qemu on macOS since v2.12 (24 April 2018) supports Hypervisor.framework.
|
|||||||
|
|
||||||
#### Generate image
|
#### 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
|
$ ./bootstrap.sh
|
||||||
|
|
||||||
### Fill configuration file
|
### Fill configuration file
|
||||||
|
@ -378,7 +378,11 @@ func (q System) Command(user, cmd string) (output string, err error) {
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
session.Stderr = session.Stdout
|
|
||||||
|
stderr, err := session.StderrPipe()
|
||||||
|
if err != nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
err = session.Start(cmd)
|
err = session.Start(cmd)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@ -395,6 +399,17 @@ func (q System) Command(user, cmd string) (output string, err error) {
|
|||||||
output = strings.TrimSuffix(output, "\n")
|
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()
|
err = session.Wait()
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
|
|
||||||
package qemu
|
package qemu
|
||||||
|
|
||||||
const testConfigVmlinuz = "../tools/qemu-debian-img/ubuntu2204.vmlinuz"
|
const testConfigVmlinuz = "../tools/qemu-ubuntu-img/ubuntu2204.vmlinuz"
|
||||||
const testConfigInitrd = "../tools/qemu-debian-img/ubuntu2204.initrd"
|
const testConfigInitrd = "../tools/qemu-ubuntu-img/ubuntu2204.initrd"
|
||||||
const testConfigRootfs = "../tools/qemu-debian-img/ubuntu2204.img"
|
const testConfigRootfs = "../tools/qemu-ubuntu-img/ubuntu2204.img"
|
||||||
const testConfigSampleKo = "../tools/qemu-debian-img/ubuntu2204.ko"
|
const testConfigSampleKo = "../tools/qemu-ubuntu-img/ubuntu2204.ko"
|
||||||
|
Reference in New Issue
Block a user