Skip to content

Commit a776059

Browse files
eriknordmarkmilan-zededa
authored andcommitted
Remove hardwaremodel -f
This hardware figerprint was using github.com/rackn/gohai which has been archived and which is also using some godmi packages with unspecified license. The hardware fingerprint is not used any more so it makes sense to remove these dependencies. The update of the vendoring seems to require pulling in a new version of github.com/digitalocean packages, which in turn means a new qmp monitor version with an additional argument. Signed-off-by: eriknordmark <[email protected]>
1 parent 288e66e commit a776059

File tree

184 files changed

+11438
-10515
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

184 files changed

+11438
-10515
lines changed

LICENSE

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,3 @@ under the BSD-style license. For details, see the netclone/README
205205

206206
This product bundles portions of the go httpproxy package, which is
207207
available under the BSD-style license. For details, see the zedcloud/proxy.go
208-
209-
This product bundles portions of the github.com/rackn/gohai, which is
210-
available under the Apache License 2.0. For details, see the
211-
pkg/pillar/cmd/hardwaremodel

pkg/pillar/cmd/hardwaremodel/hardwaremodel.go

Lines changed: 0 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -4,20 +4,14 @@
44
package hardwaremodel
55

66
import (
7-
"encoding/json"
87
"flag"
98
"fmt"
109
"io/ioutil"
11-
"os"
1210

1311
"github.com/lf-edge/eve/pkg/pillar/agentbase"
1412
"github.com/lf-edge/eve/pkg/pillar/base"
1513
"github.com/lf-edge/eve/pkg/pillar/hardware"
1614
"github.com/lf-edge/eve/pkg/pillar/pubsub"
17-
"github.com/rackn/gohai/plugins/dmi"
18-
"github.com/rackn/gohai/plugins/net"
19-
"github.com/rackn/gohai/plugins/storage"
20-
"github.com/rackn/gohai/plugins/system"
2115
"github.com/sirupsen/logrus"
2216
)
2317

@@ -34,54 +28,16 @@ type hardwareModelAgentState struct {
3428
// cli options
3529
versionPtr *bool
3630
cPtr *bool
37-
hwPtr *bool
3831
outputFilePtr *string
3932
}
4033

4134
// AddAgentSpecificCLIFlags adds CLI options
4235
func (state *hardwareModelAgentState) AddAgentSpecificCLIFlags(flagSet *flag.FlagSet) {
4336
state.versionPtr = flagSet.Bool("v", false, "Version")
4437
state.cPtr = flagSet.Bool("c", false, "No CRLF")
45-
state.hwPtr = flagSet.Bool("f", false, "Fingerprint hardware")
4638
state.outputFilePtr = flagSet.String("o", "/dev/tty", "file or device for output")
4739
}
4840

49-
type info interface {
50-
Class() string
51-
}
52-
53-
func hwFp(log *base.LogObject, outputFile string) {
54-
infos := map[string]info{}
55-
dmiInfo, err := dmi.Gather()
56-
if err != nil {
57-
log.Fatalf("Failed to gather DMI information: %v", err)
58-
}
59-
infos[dmiInfo.Class()] = dmiInfo
60-
netInfo, err := net.Gather()
61-
if err != nil {
62-
log.Fatalf("Failed to gather network info: %v", err)
63-
}
64-
infos[netInfo.Class()] = netInfo
65-
sysInfo, err := system.Gather()
66-
if err != nil {
67-
log.Fatalf("Failed to gather basic OS info: %v", err)
68-
}
69-
infos[sysInfo.Class()] = sysInfo
70-
storInfo, err := storage.Gather()
71-
if err != nil {
72-
log.Fatalf("Failed to gather storage info: %v", err)
73-
}
74-
var outfile *os.File
75-
infos[storInfo.Class()] = storInfo
76-
outfile, err = os.OpenFile(outputFile, os.O_APPEND|os.O_CREATE|os.O_WRONLY, 0644)
77-
if err != nil {
78-
log.Fatalf("hwFp error: %s", err)
79-
}
80-
enc := json.NewEncoder(outfile)
81-
enc.SetIndent("", " ")
82-
enc.Encode(infos)
83-
}
84-
8541
var logger *logrus.Logger
8642
var log *base.LogObject
8743

@@ -98,10 +54,6 @@ func Run(_ *pubsub.PubSub, loggerArg *logrus.Logger, logArg *base.LogObject, arg
9854
fmt.Printf("%s: %s\n", agentName, Version)
9955
return 0
10056
}
101-
if *state.hwPtr {
102-
hwFp(log, outputFile)
103-
return 0
104-
}
10557
model := hardware.GetHardwareModelNoOverride(log)
10658
if *state.cPtr {
10759
b := []byte(fmt.Sprintf("%s", model))

pkg/pillar/go.mod

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,8 @@ require (
1111
github.com/containerd/containerd v1.6.6
1212
github.com/containerd/typeurl v1.0.2
1313
github.com/cshari-zededa/eve-tpm2-tools v0.0.4
14-
github.com/digitalocean/go-qemu v0.0.0-20181112162955-dd7bb9c771b8
14+
github.com/digitalocean/go-libvirt v0.0.0-20221020193630-0d0212f5ead2 // indirect
15+
github.com/digitalocean/go-qemu v0.0.0-20220826173844-d5f5e3ceed89
1516
github.com/docker/docker v20.10.17+incompatible
1617
github.com/eriknordmark/ipinfo v0.0.0-20190220084921-7ee0839158f9
1718
github.com/fsnotify/fsnotify v1.5.1
@@ -38,16 +39,16 @@ require (
3839
github.com/opencontainers/runtime-spec v1.0.3-0.20210326190908-1c3f411f0417
3940
github.com/packetcap/go-pcap v0.0.0-20221020071412-2b2e94010282
4041
github.com/prometheus/procfs v0.7.3
41-
github.com/rackn/gohai v0.0.0-20190321191141-5053e7f1fa36
42+
github.com/robertkrimen/otto v0.0.0-20221011175642-09fc211e5ab1 // indirect
4243
github.com/satori/go.uuid v1.2.1-0.20180404165556-75cca531ea76
4344
github.com/shirou/gopsutil v0.0.0-20190901111213-e4ec7b275ada
4445
github.com/sirupsen/logrus v1.8.1
45-
github.com/stretchr/testify v1.7.2
46+
github.com/stretchr/testify v1.8.0
4647
github.com/tatsushid/go-fastping v0.0.0-20160109021039-d7bb493dee3e
4748
github.com/vishvananda/netlink v1.1.1-0.20210924202909-187053b97868
4849
golang.org/x/crypto v0.0.0-20220525230936-793ad666bf5e
49-
golang.org/x/net v0.0.0-20220225172249-27dd8689420f
50-
golang.org/x/sys v0.0.0-20220704084225-05e143d24a9e
50+
golang.org/x/net v0.0.0-20220722155237-a158d28d115b
51+
golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f
5152
google.golang.org/genproto v0.0.0-20220317150908-0efb43f6373e // indirect
5253
google.golang.org/grpc v1.45.0
5354
google.golang.org/protobuf v1.27.1

pkg/pillar/go.sum

Lines changed: 20 additions & 120 deletions
Large diffs are not rendered by default.

pkg/pillar/hypervisor/qmp.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
package hypervisor
22

33
import (
4+
"context"
45
"encoding/json"
56
"fmt"
67
"github.com/digitalocean/go-qemu/qmp"
@@ -95,7 +96,7 @@ func qmpEventHandler(listenerSocket, executorSocket string) {
9596
}
9697
defer monitor.Disconnect()
9798

98-
eventChan, err := monitor.Events()
99+
eventChan, err := monitor.Events(context.Background())
99100
if err != nil {
100101
logrus.Errorf("qmpEventHandler: Exception while getting event channel from listenerSocket: %s. %s", listenerSocket, err.Error())
101102
return

pkg/pillar/scripts/device-steps.sh

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -300,7 +300,6 @@ access_usb() {
300300
[ ! -f $CONFIGDIR/v2tlsbaseroot-certificates.pem ] || cp -p $CONFIGDIR/v2tlsbaseroot-certificates.pem "$IDENTITYDIR"
301301
[ ! -f $CONFIGDIR/soft_serial ] || cp -p $CONFIGDIR/soft_serial "$IDENTITYDIR"
302302
$BINDIR/hardwaremodel -c -o "$IDENTITYDIR/hardwaremodel.dmi"
303-
$BINDIR/hardwaremodel -f -o "$IDENTITYDIR/hardwaremodel.txt"
304303
sync
305304
fi
306305
if [ -d /mnt/dump ]; then

pkg/pillar/vendor/github.com/VictorLowther/godmi/README.md

Lines changed: 0 additions & 7 deletions
This file was deleted.

0 commit comments

Comments
 (0)