diff --git a/Dockerfile b/Dockerfile index f863afb..3c5d690 100644 --- a/Dockerfile +++ b/Dockerfile @@ -93,11 +93,14 @@ RUN ./entrypoint.sh grfhss_utils_grmod_install # depends on 'grpdu_utils_grmod_i # Installing gr-fosphor with OpenCL #RUN ./entrypoint.sh grfosphor_grmod_install +# Installing cyberther with OpenCL +RUN ./entrypoint.sh cyberther_soft_install + # Installing softwares RUN ./entrypoint.sh sdrpp_soft_install RUN ./entrypoint.sh sigdigger_soft_install RUN ./entrypoint.sh inspection_decoding_tools -RUN ./entrypoint.sh cyberther_soft_install +#RUN ./entrypoint.sh cyberther_soft_install RUN ./entrypoint.sh qsstv_soft_install RUN ./entrypoint.sh ice9_bluetooth_soft_install @@ -122,4 +125,4 @@ WORKDIR /root/ RUN rm -rf /root/rules/ RUN rm -rf /root/thirdparty RUN apt-fast clean -RUN DEBIAN_FRONTEND=noninteractive rm -rf /var/lib/apt/lists/* \ No newline at end of file +RUN DEBIAN_FRONTEND=noninteractive rm -rf /var/lib/apt/lists/* diff --git a/go/rfswift/cli/rfcli.go b/go/rfswift/cli/rfcli.go index 4e44028..2362890 100644 --- a/go/rfswift/cli/rfcli.go +++ b/go/rfswift/cli/rfcli.go @@ -7,6 +7,7 @@ package cli import ( "fmt" "os" + "runtime" "github.com/spf13/cobra" rfdock "penthertz/rfswift/dock" @@ -37,11 +38,16 @@ var runCmd = &cobra.Command{ Short: "create and run a program", Long: `Create a container and run a program inside the docker container`, Run: func(cmd *cobra.Command, args []string) { - rfutils.XHostEnable() // force xhost to add local connections ALCs, TODO: to optimize later - rfdock.DockerSetShell(ExecCmd) - rfdock.DockerAddBiding(ExtraBind) - rfdock.DockerSetImage(DImage) - rfdock.DockerRun() + os := runtime.GOOS + if os == "windows" { + rfdock.DockerSetx11("/run/desktop/mnt/host/wslg/.X11-unix:/tmp/.X11-unix,/run/desktop/mnt/host/wslg:/mnt/wslg") + } else { + rfutils.XHostEnable() // force xhost to add local connections ALCs, TODO: to optimize later + } + rfdock.DockerSetShell(ExecCmd) + rfdock.DockerAddBiding(ExtraBind) + rfdock.DockerSetImage(DImage) + rfdock.DockerRun() }, } @@ -50,9 +56,14 @@ var execCmd = &cobra.Command{ Short: "exec a command", Long: `Exec a program on a created docker container, even not started`, Run: func(cmd *cobra.Command, args []string) { - rfutils.XHostEnable() // force xhost to add local connections ALCs, TODO: to optimize later - rfdock.DockerSetShell(ExecCmd) - rfdock.DockerExec(ContID, "/root") + os := runtime.GOOS + if os == "windows" { + rfdock.DockerSetx11("/run/desktop/mnt/host/wslg/.X11-unix:/tmp/.X11-unix,/run/desktop/mnt/host/wslg:/mnt/wslg") + } else { + rfutils.XHostEnable() // force xhost to add local connections ALCs, TODO: to optimize later + } + rfdock.DockerSetShell(ExecCmd) + rfdock.DockerExec(ContID, "/root") }, } diff --git a/go/rfswift/dock/rfdock.go b/go/rfswift/dock/rfdock.go index 8b68fbe..22efb48 100644 --- a/go/rfswift/dock/rfdock.go +++ b/go/rfswift/dock/rfdock.go @@ -44,6 +44,15 @@ var dockerObj = DockerInst{ net: "host", shell: "/bin/bash"} // Instance with default values +func DockerSetx11(x11forward string) { + /* Sets the shell to use in the Docker container + in(1): string command shell to use + */ + if (x11forward != "") { + dockerObj.x11forward = x11forward + } +} + func DockerSetShell(shellcmd string) { /* Sets the shell to use in the Docker container in(1): string command shell to use @@ -118,9 +127,13 @@ func DockerRun() { } defer cli.Close() - var bindings = []string{dockerObj.x11forward, dockerObj.usbforward} + x11split := strings.Split(dockerObj.x11forward, ",") + var bindings = x11split + //bindings = append(bindings, dockerObj.x11split...) + bindings = append(bindings, strings.Split(dockerObj.usbforward, ",")...) + if (dockerObj.extrabinding != "") { - bindings = append([]string{dockerObj.x11forward, dockerObj.usbforward}, strings.Split(dockerObj.extrabinding, ",")...) + bindings = append(bindings, strings.Split(dockerObj.extrabinding, ",")...) } resp, err := cli.ContainerCreate(ctx, &container.Config{