Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
bin
62 changes: 52 additions & 10 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,21 +1,63 @@
# Go parameters
GOCMD=go
GOMOD=$(GOCMD) mod
GOBUILD=$(GOCMD) build
GOINSTALL=$(GOCMD) install
GOCLEAN=$(GOCMD) clean
GOTEST=$(GOCMD) test
GOGET=$(GOCMD) get
STATIC_FLAGS=-a -ldflags '-s -w -extldflags "-static"'
GOVET=$(GOCMD) vet

all: build-all-static
current_dir := $(dir $(abspath $(firstword $(MAKEFILE_LIST))))
GOBIN ?= $(current_dir)/bin

prefix = /usr
exec_prefix = $(prefix)
bindir = $(exec_prefix)/bin

PKGBASE := github.com/openxt/openxt-go
PKGS := argo db ioctl
CMDS := argo-nc dbdcmd dbus-send
VERSION := 0.1.0

# FIPS is not available until Go 1.24
#FIPS = GOFIPS140=v1.0.0

ifeq (1,${STATIC})
ENV = CGO_ENABLED=0 GOOS=linux ${FIPS}
FLAGS = -a -ldflags '-s -w -extldflags "-static"'
else
ENV = ${FIPS}
FLAGS = -ldflags="-s -w"
endif

all: ${CMDS}

clean:
$(GOCLEAN)
rm -f argo-nc
@$(GOCLEAN)
rm -rf $(GOBIN)

install: all
@- $(foreach CMD, $(CMDS), \
install -Dpm 0755 $(GOBIN)/$(CMD) $(DESTDIR)$(bindir)/$(CMD); \
)

dep:
$(GOMOD) download

vet:
@- $(foreach PKG, $(PKGS), \
$(GOVET) $(PKGBASE)/$(PKG); \
)
@- $(foreach CMD, $(CMDS), \
$(GOVET) $(PKGBASE)/cmd/$(CMD); \
)

gobin:
[ -e "$(GOBIN)" ] || mkdir $(GOBIN)

build-all-static: build-argo-nc-static
pkgsite: gobin
GOBIN=$(GOBIN) $(GOINSTALL) golang.org/x/pkgsite/cmd/pkgsite@latest

build-argo-nc-static:
CGO_ENABLED=0 GOOS=linux $(GOBUILD) $(STATIC_FLAGS) github.com/openxt/openxt-go/cmd/argo-nc

build-dbus-send-static:
CGO_ENABLED=0 GOOS=linux $(GOBUILD) $(STATIC_FLAGS) github.com/openxt/openxt-go/cmd/dbus-send
${CMDS}: gobin dep
$(ENV) $(GOBUILD) -o $(GOBIN)/$@ $(FLAGS) $(PKGBASE)/cmd/$@
6 changes: 2 additions & 4 deletions pkg/argo/argo-libargo.go → argo/argo-libargo.go
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
// +build libargo

// SPDX-License-Identifier: BSD-3-Clause
//
// Copyright 2020 Apertus Soutions, LLC
//
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file
// Copyright 2026 Apertus Soutions, LLC
//

package argo
Expand Down
32 changes: 16 additions & 16 deletions pkg/argo/argo-native.go → argo/argo-native.go
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
// +build !libargo

// SPDX-License-Identifier: BSD-3-Clause
//
// Copyright 2020 Apertus Soutions, LLC
//
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file
// Copyright 2026 Apertus Soutions, LLC
//

package argo
Expand All @@ -17,6 +15,8 @@ import (
"os"
"syscall"
"unsafe"

"github.com/openxt/openxt-go/ioctl"
)

const (
Expand All @@ -33,18 +33,18 @@ const (
)

var (
argoIocSetRingSize = iow(typArgo, 1, u32Size)
argoIocBind = iow(typArgo, 2, argoRingIdSize)
argoIocGetSockName = iow(typArgo, 3, argoRingIdSize)
argoIocGetPeerName = iow(typArgo, 4, xenArgoAddrSize)
argoIocConnect = iow(typArgo, 5, xenArgoAddrSize)
argoIocGetConnectErr = iow(typArgo, 6, intSize)
argoIocListen = iow(typArgo, 7, u32Size)
argoIocAccept = iow(typArgo, 8, xenArgoAddrSize)
argoIocGetSockType = iow(typArgo, 11, intSize)
argoIocViptablesAdd = iow(typArgo, 12, vIpTablesRulePos)
argoIocViptablesDel = iow(typArgo, 13, vIpTablesRulePos)
argoIocViptablesList = iow(typArgo, 14, u32Size)
argoIocSetRingSize = ioctl.Iow(typArgo, 1, u32Size)
argoIocBind = ioctl.Iow(typArgo, 2, argoRingIdSize)
argoIocGetSockName = ioctl.Iow(typArgo, 3, argoRingIdSize)
argoIocGetPeerName = ioctl.Iow(typArgo, 4, xenArgoAddrSize)
argoIocConnect = ioctl.Iow(typArgo, 5, xenArgoAddrSize)
argoIocGetConnectErr = ioctl.Iow(typArgo, 6, intSize)
argoIocListen = ioctl.Iow(typArgo, 7, u32Size)
argoIocAccept = ioctl.Iow(typArgo, 8, xenArgoAddrSize)
argoIocGetSockType = ioctl.Iow(typArgo, 11, intSize)
argoIocViptablesAdd = ioctl.Iow(typArgo, 12, vIpTablesRulePos)
argoIocViptablesDel = ioctl.Iow(typArgo, 13, vIpTablesRulePos)
argoIocViptablesList = ioctl.Iow(typArgo, 14, u32Size)
)

func addrFromC(r io.Reader, a *Addr) error {
Expand Down
6 changes: 2 additions & 4 deletions pkg/argo/argo.go → argo/argo.go
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
// SPDX-License-Identifier: BSD-3-Clause
//
// Copyright 2020 Apertus Soutions, LLC
//
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file
// Copyright 2026 Apertus Soutions, LLC
//

// Package argo provides a Go interface for interacting with the Argo character
Expand Down
8 changes: 3 additions & 5 deletions pkg/argo/dbus/argo.go → argo/dbus/argo.go
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
// SPDX-License-Identifier: BSD-3-Clause
//
// Copyright 2020 Apertus Soutions, LLC
//
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file
// Copyright 2026 Apertus Soutions, LLC
//

package dbus
Expand All @@ -14,7 +12,7 @@ import (
"strings"
"syscall"

"github.com/openxt/openxt-go/pkg/argo"
"github.com/openxt/openxt-go/argo"
godbus "github.com/godbus/dbus/v5"
)

Expand Down
6 changes: 2 additions & 4 deletions pkg/argo/structures.go → argo/structures.go
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
// SPDX-License-Identifier: BSD-3-Clause
//
// Copyright 2020 Apertus Soutions, LLC
//
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file
// Copyright 2026 Apertus Soutions, LLC
//

package argo
Expand Down
5 changes: 3 additions & 2 deletions cmd/argo-nc/main.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
// SPDX-License-Identifier: BSD-3-Clause
//
// Copyright 2020 Apertus Soutions, LLC
// Copyright 2026 Apertus Soutions, LLC
//
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file
Expand All @@ -14,7 +15,7 @@ import (
"syscall"

flag "github.com/spf13/pflag"
"github.com/openxt/openxt-go/pkg/argo"
"github.com/openxt/openxt-go/argo"
)

var (
Expand Down
8 changes: 3 additions & 5 deletions cmd/dbdcmd/main.go
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
// SPDX-License-Identifier: BSD-3-Clause
//
// Copyright 2015 Apertus Soutions, LLC
//
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file
// Copyright 2026 Apertus Soutions, LLC
//

package main
Expand All @@ -11,7 +9,7 @@ import (
"fmt"
"os"

"github.com/openxt/openxt-go/pkg/dbd"
"github.com/openxt/openxt-go/db"
)

func die(format string, a ...interface{}) {
Expand Down
8 changes: 3 additions & 5 deletions cmd/dbus-send/main.go
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
// SPDX-License-Identifier: BSD-3-Clause
//
// Copyright 2020 Apertus Soutions, LLC
//
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file
// Copyright 2026 Apertus Soutions, LLC
//

package main
Expand All @@ -16,7 +14,7 @@ import (
"strings"

flag "github.com/spf13/pflag"
"github.com/openxt/openxt-go/pkg/argo/dbus"
"github.com/openxt/openxt-go/argo/dbus"
godbus "github.com/godbus/dbus/v5"
)

Expand Down
135 changes: 0 additions & 135 deletions cmd/xenstore/main.go

This file was deleted.

6 changes: 2 additions & 4 deletions pkg/dbd/dbd.go → db/dbd.go
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
// SPDX-License-Identifier: BSD-3-Clause
//
// Copyright 2015 Apertus Soutions, LLC
//
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file
// Copyright 2026 Apertus Soutions, LLC
//


Expand Down
Loading