Skip to content

Commit

Permalink
2023.2.0
Browse files Browse the repository at this point in the history
  • Loading branch information
knuton committed Mar 6, 2023
2 parents e010fc0 + a8888d6 commit d66ce55
Show file tree
Hide file tree
Showing 73 changed files with 922 additions and 669 deletions.
15 changes: 15 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
name: "Test"
on:
pull_request:
push:
jobs:
tests:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: cachix/install-nix-action@v18
with:
nix_path: nixpkgs=channel:nixos-unstable
extra_nix_config: |
system-features = nixos-test benchmark big-parallel kvm
- run: testing/run
14 changes: 14 additions & 0 deletions Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,20 @@ See the output of `run-playos-in-vm --help` for more information.

The default user-mode network stack is used to create a virtual Ethernet connection with bridged Internet access for the guest. If you find that the guest has a dysfunctional Internet connection, check your host's firewall settings. If using ConnMan, restart ConnMan service and try again.

## Testing

Subcomponent tests using the [NixOS test framework](https://nixos.org/manual/nixos/stable/index.html#sec-nixos-tests) may be added to `test/integration`.

Run tests with

testing/run

or individual tests with

nix-build testing/integration/EXAMPLE.nix

Tests added to `test/integration` are executed via a GitHub Action when pushing or creating pull requests.

## Deployment

Update bundles are hosted on Amazon S3. The script `bin/deploy-playos-update` will handle signing and uploading of bundle.
Expand Down
10 changes: 4 additions & 6 deletions bootloader/rescue/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
, squashfsTools, closureInfo, makeInitrd, linkFarm
, importFromNixos
, writeScript, dialog
, vim, grub2_efi, rauc, _2048-in-terminal}:
, vim, grub2_efi, rauc}:
with lib;
let
nixos = importFromNixos "";
Expand All @@ -22,7 +22,6 @@ let
"wipe-user-data" "Delete all user data." \
"reboot" "Reboot immediately" \
"shell" "Access shell" \
"2048" "2048" \
2> $tempfile
retval=$?
Expand All @@ -42,9 +41,6 @@ let
reboot -f;;
"reboot")
reboot -f;;
"2048")
2048
reboot -f;;
"shell")
exit;;
esac
Expand Down Expand Up @@ -102,7 +98,6 @@ in
vim
grub2_efi
rauc
_2048-in-terminal
];

# Set up automatic login and start a rescue kiosk
Expand Down Expand Up @@ -157,6 +152,9 @@ in
{ name = "initrd"; path = "${config.system.build.rescueRamdisk}/initrd"; }
];

# There is no persistent state for the rescue system
system.stateVersion = lib.trivial.release;

};
system = "x86_64-linux";
}).config.system.build.rescueSystem
8 changes: 8 additions & 0 deletions build
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,14 @@ elif [ "$TARGET" == "lab-key" ]; then
--arg buildBundle false \
--arg buildDisk false)

elif [ "$TARGET" == "shed-key" ]; then

(set -x; nix-build \
--arg kioskUrl https://shed.dividat.com/ \
--arg buildInstaller false \
--arg buildBundle false \
--arg buildDisk false)

elif [ "$TARGET" == "default" ]; then

(set -x; nix-build)
Expand Down
20 changes: 20 additions & 0 deletions controller/Changelog.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,22 @@
# [2023.2.0] - 2023-03-06

# [2023.2.0-VALIDATION] - 2023-02-27

## Added

- os: Include basic network troubleshooting command-line tools

## Changed

- driver: Upgrade to 2.3.0 for recent versions of Senso Flex
- os: Route audio output to both line-out and attached HDMI/DisplayPort outputs
- os: Update nixpkgs channel to 22.11

## Fixed

- controller: Fix a file descriptor leak that could lead to the controller interface becoming unusable
- os: Add a mechanism to recover from a status file corruption that could prevent systems from updating

# [2022.4.0] - 2022-07-06

# [2022.4.0-VALIDATION.1] - 2022-06-22
Expand All @@ -16,6 +35,7 @@

- os: Update nixpkgs channel to 21.11
- os: Disable virtual terminals that are not used by PlayOS
- controller: Reorganize layout with an aside menu and a header bar
- controller: Split proxy configuration form into multiple inputs for greater ease of use
- controller: Provide a more helpful error message when network connection is failing
- controller: Mark connected network services in service list
Expand Down
46 changes: 23 additions & 23 deletions controller/bindings/connman/connman.ml
Original file line number Diff line number Diff line change
Expand Up @@ -54,10 +54,10 @@ struct
Connman_interfaces.Net_connman_Technology.m_SetProperty proxy (name, value)

let enable t =
set_property t._proxy "Powered" (true |> OBus_value.C.(make_single basic_boolean))
set_property t._proxy ~name:"Powered" ~value:(true |> OBus_value.C.(make_single basic_boolean))

let disable t =
set_property t._proxy "Powered" (false |> OBus_value.C.(make_single basic_boolean))
set_property t._proxy ~name:"Powered" ~value:(false |> OBus_value.C.(make_single basic_boolean))

let scan t =
let%lwt () = Logs_lwt.debug ~src:log_src
Expand Down Expand Up @@ -368,7 +368,7 @@ struct
in
CCOption.(
pure (fun name type' state strength favorite autoconnect ipv4 ipv4_user_config ipv6 ethernet proxy nameservers ->
{ _proxy = OBus_proxy.make (OBus_context.sender context) path
{ _proxy = OBus_proxy.make ~peer:(OBus_context.sender context) ~path:path
; _manager = manager
; id = path |> CCList.last 1 |> CCList.hd
; name ; type'; state; strength; favorite; autoconnect
Expand Down Expand Up @@ -406,7 +406,7 @@ struct
[ ("Method", OBus_value.C.(make_single basic_string) "direct")
]
in
set_property service "Proxy.Configuration" dict
set_property service ~name:"Proxy.Configuration" ~value:dict

let set_manual_proxy service proxy =
let dict =
Expand All @@ -416,7 +416,7 @@ struct
; ("Servers", OBus_value.C.(make_single (array basic_string)) [Proxy.to_uri ~include_userinfo:true proxy |> Uri.to_string])
]
in
set_property service "Proxy.Configuration" dict
set_property service ~name:"Proxy.Configuration" ~value:dict


let set_manual_ipv4 service ~address ~netmask ~gateway =
Expand All @@ -429,22 +429,22 @@ struct
; ("Gateway", OBus_value.C.(make_single basic_string) gateway)
]
in
set_property service "IPv4.Configuration" dict
set_property service ~name:"IPv4.Configuration" ~value:dict

let set_dhcp_ipv4 service =
let dict =
OBus_value.C.make_single
(OBus_value.C.(dict string variant))
[("Method", OBus_value.C.(make_single basic_string) "dhcp")]
in
set_property service "IPv4.Configuration" dict
set_property service ~name:"IPv4.Configuration" ~value:dict

let set_nameservers service nameservers =
let config =
OBus_value.C.make_single
(OBus_value.C.(array basic_string)) nameservers
in
set_property service "Nameservers.Configuration" config
set_property service ~name:"Nameservers.Configuration" ~value:config



Expand All @@ -458,8 +458,8 @@ struct
let on_agent_error msg = Lwt.return (agent_reported_error := Some msg) in

(* Create and register an agent that will pass input to ConnMan *)
let%lwt agent_path, agent = Agent.create input on_agent_error in
let%lwt () = register_agent service._manager agent_path in
let%lwt agent_path, agent = Agent.create ~input on_agent_error in
let%lwt () = register_agent service._manager ~path:agent_path in

(Lwt.catch
(* Connect to service *)
Expand All @@ -477,7 +477,7 @@ struct
))
[%lwt.finally
(* Cleanup and destroy agent *)
let%lwt () = unregister_agent service._manager agent_path in
let%lwt () = unregister_agent service._manager ~path:agent_path in
Agent.destroy agent]

let disconnect service =
Expand All @@ -504,8 +504,8 @@ struct

let connect () =
let%lwt system_bus = OBus_bus.system () in
let peer = OBus_peer.make system_bus "net.connman" in
OBus_proxy.make peer []
let peer = OBus_peer.make ~connection:system_bus ~name:"net.connman" in
OBus_proxy.make ~peer ~path:[]
|> return

let get_technologies proxy =
Expand All @@ -515,7 +515,7 @@ struct
let to_technology (path, properties) : Technology.t option =
CCOption.(pure
(fun name type' powered connected : Technology.t ->
{ _proxy = OBus_proxy.make (OBus_context.sender context) path
{ _proxy = OBus_proxy.make ~peer:(OBus_context.sender context) ~path:path
; name
; type'
; powered
Expand Down Expand Up @@ -597,17 +597,17 @@ struct

let get_technologies proxy =
let%lwt (context, technologies) = OBus_method.call_with_context m_GetTechnologies proxy () in
let technologies = List.map (fun (x1, x2) -> (OBus_proxy.make (OBus_context.sender context) x1, x2)) technologies in
let technologies = List.map (fun (x1, x2) -> (OBus_proxy.make ~peer:(OBus_context.sender context) ~path:x1, x2)) technologies in
return technologies

let get_services proxy =
let%lwt (context, services) = OBus_method.call_with_context m_GetServices proxy () in
let services = List.map (fun (x1, x2) -> (OBus_proxy.make (OBus_context.sender context) x1, x2)) services in
let services = List.map (fun (x1, x2) -> (OBus_proxy.make ~peer:(OBus_context.sender context) ~path:x1, x2)) services in
return services

let get_peers proxy =
let%lwt (context, peers) = OBus_method.call_with_context m_GetPeers proxy () in
let peers = List.map (fun (x1, x2) -> (OBus_proxy.make (OBus_context.sender context) x1, x2)) peers in
let peers = List.map (fun (x1, x2) -> (OBus_proxy.make ~peer:(OBus_context.sender context) ~path:x1, x2)) peers in
return peers

let register_agent proxy ~path =
Expand All @@ -631,7 +631,7 @@ struct
let create_session proxy ~settings ~notifier =
let notifier = OBus_proxy.path notifier in
let%lwt (context, session) = OBus_method.call_with_context m_CreateSession proxy (settings, notifier) in
let session = OBus_proxy.make (OBus_context.sender context) session in
let session = OBus_proxy.make ~peer:(OBus_context.sender context) ~path:session in
return session

let destroy_session proxy ~session =
Expand All @@ -640,7 +640,7 @@ struct

let request_private_network proxy =
let%lwt (context, (path, settings, socket)) = OBus_method.call_with_context m_RequestPrivateNetwork proxy () in
let path = OBus_proxy.make (OBus_context.sender context) path in
let path = OBus_proxy.make ~peer:(OBus_context.sender context) ~path:path in
return (path, settings, socket)

let release_private_network proxy ~path =
Expand All @@ -659,29 +659,29 @@ struct
let technology_added proxy =
OBus_signal.map_with_context
(fun context (path, properties) ->
let path = OBus_proxy.make (OBus_context.sender context) path in
let path = OBus_proxy.make ~peer:(OBus_context.sender context) ~path:path in
(path, properties))
(OBus_signal.make s_TechnologyAdded proxy)

let technology_removed proxy =
OBus_signal.map_with_context
(fun context path ->
let path = OBus_proxy.make (OBus_context.sender context) path in
let path = OBus_proxy.make ~peer:(OBus_context.sender context) ~path:path in
path)
(OBus_signal.make s_TechnologyRemoved proxy)

let services_changed proxy =
OBus_signal.map_with_context
(fun context (changed, removed) ->
let changed = List.map (fun (x1, x2) -> (OBus_proxy.make (OBus_context.sender context) x1, x2)) changed in
let changed = List.map (fun (x1, x2) -> (OBus_proxy.make ~peer:(OBus_context.sender context) ~path:x1, x2)) changed in
let removed = List.map (fun path -> OBus_proxy.make ~peer:(OBus_context.sender context) ~path) removed in
(changed, removed))
(OBus_signal.make s_ServicesChanged proxy)

let peers_changed proxy =
OBus_signal.map_with_context
(fun context (changed, removed) ->
let changed = List.map (fun (x1, x2) -> (OBus_proxy.make (OBus_context.sender context) x1, x2)) changed in
let changed = List.map (fun (x1, x2) -> (OBus_proxy.make ~peer:(OBus_context.sender context) ~path:x1, x2)) changed in
let removed = List.map (fun path -> OBus_proxy.make ~peer:(OBus_context.sender context) ~path) removed in
(changed, removed))
(OBus_signal.make s_PeersChanged proxy)
Expand Down
6 changes: 4 additions & 2 deletions controller/bindings/curl/curl.ml
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@ type result =
| RequestFailure of error

let exec cmd =
let stdout_r, stdout_w = Unix.pipe () in
let stderr_r, stderr_w = Unix.pipe () in
let stdout_r, stdout_w = Unix.pipe ~cloexec:true () in
let stderr_r, stderr_w = Unix.pipe ~cloexec:true () in
let%lwt result =
Lwt_process.exec
~stdout:(`FD_move stdout_w)
Expand All @@ -54,7 +54,9 @@ let exec cmd =
let stdout_input = Lwt_io.of_unix_fd ~mode:Lwt_io.input stdout_r in
let stderr_input = Lwt_io.of_unix_fd ~mode:Lwt_io.input stderr_r in
let%lwt stdout = Lwt_io.read stdout_input in
let%lwt () = Lwt_io.close stdout_input in
let%lwt stderr = Lwt_io.read stderr_input in
let%lwt () = Lwt_io.close stderr_input in
Lwt.return (result, stdout, stderr)

let safe_int_of_string str =
Expand Down
4 changes: 2 additions & 2 deletions controller/bindings/rauc/rauc.ml
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@ type t = OBus_peer.Private.t

let daemon () =
let%lwt system_bus = OBus_bus.system () in
let peer = OBus_peer.make system_bus "de.pengutronix.rauc" in
let peer = OBus_peer.make ~connection:system_bus ~name:"de.pengutronix.rauc" in
return peer

let proxy daemon =
OBus_proxy.make daemon []
OBus_proxy.make ~peer:daemon ~path:[]

module Slot =
struct
Expand Down
Loading

0 comments on commit d66ce55

Please sign in to comment.