Skip to content

Commit

Permalink
FMO-81: Merge fmo-os images into fmo-os-x86_64
Browse files Browse the repository at this point in the history
- Create device-info folder containing pci device map and rugged-devices.nix for pci info of rugged devices
- Create systemd service to write pci device paths into config file for microvm
- Map touch device in sway via a script
- Clean up tablet and laptop config file
- Build targets are:
  + fmo-os-rugged-devices-debug / fmo-os-rugged-devices-release
  + fmo-os-rugged-devices-public-debug / fmo-os-rugged-devices-public-release
  + fmo-os-installer-debug / fmo-os-installer-release
  + fmo-os-installer-public-debug / fmo-os-installer-public-release

Signed-off-by: Anh Huy Bui <[email protected]>
  • Loading branch information
buianhhuy96 committed Dec 12, 2024
1 parent 85aa13e commit 1930efc
Show file tree
Hide file tree
Showing 16 changed files with 155 additions and 424 deletions.
3 changes: 2 additions & 1 deletion config-processor-hardware.nix
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
}: sysconf:
let
inherit (import ./utils {inherit lib self ghafOS;})
updateAttrs updateHostConfig addCustomLaunchers addSystemPackages importvm generateFMOToolConfig;
updateAttrs updateHostConfig addHardwareInfo addCustomLaunchers addSystemPackages importvm generateFMOToolConfig;

targetconf = sysconf;
name = targetconf.name;
Expand Down Expand Up @@ -48,6 +48,7 @@ let
++ (importvm targetconf.vms)
++ (updateHostConfig targetconf)
++ (generateFMOToolConfig targetconf)
++ (if lib.hasAttr "device-info" targetconf then addHardwareInfo (import targetconf.device-info) else [])
++ (if lib.hasAttr "extraModules" targetconf then targetconf.extraModules else []);
};
in {
Expand Down
6 changes: 2 additions & 4 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,8 @@
});

hwConfigs = [
(import ./hardware/fmo-os-rugged-laptop-7330.nix)
(import ./hardware/fmo-os-rugged-laptop-7330-public.nix)
(import ./hardware/fmo-os-rugged-tablet-7230.nix)
(import ./hardware/fmo-os-rugged-tablet-7230-public.nix)
(import ./hardware/fmo-os-rugged-devices.nix)
(import ./hardware/fmo-os-rugged-devices-public.nix)
];
instConfigs = [
(import ./installers/fmo-os-installer.nix)
Expand Down
35 changes: 35 additions & 0 deletions hardware/device-info/rugged-devices.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# Copyright 2022-2024 TII (SSRC) and the Ghaf contributors
# SPDX-License-Identifier: Apache-2.0
#
# FMO PCI-device maps for rugged devices
{
# Device information of Dell Rugged Tablet 7230
"0BB7 Latitude 7230 Rugged Extreme Tablet" = {
touchDevices = [
"3823:49156:EETI8082:00_0EEF:C004"
];
pciDevices = {
netvm = [
"0000:00:14.3"
];
dockervm = [];
};
};
# Device information of Dell Rugged Laptop 7330
"0A9E Latitude 7330 Rugged Extreme" = {
touchDevices = [
"3823:49155:CUST0000:00_0EEF:C003"
];
pciDevices = {
netvm = [
"0000:72:00.0"
"0000:00:1f.0"
"0000:00:1f.3"
"0000:00:1f.4"
"0000:00:1f.5"
"0000:00:1f.6"
];
dockervm = [];
};
};
}
4 changes: 4 additions & 0 deletions hardware/example.nix
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@
"tcpdump"
]; # systemPackages

# Optional
# File containing information about VMs and pci-devices passed through
# device-info = ./device-info/rugged-devices.nix;

# VMs description
vms = {
# NetVM -- the network VM
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
# fmo-os-disabled-for-public -target
{
sysconf = {
extend = "./fmo-os-rugged-tablet-7230.nix";
name = "fmo-os-rugged-tablet-7230-public";
extend = "./fmo-os-rugged-devices.nix";
name = "fmo-os-rugged-devices-public";
extraModules = [
{
services = {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
# Copyright 2022-2024 TII (SSRC) and the Ghaf contributors
# SPDX-License-Identifier: Apache-2.0
#
# fmo-os-rugged-tablet-7230 computer -target
# fmo-os-rugged-devices computer -target
{
sysconf = {
name = "fmo-os-rugged-tablet-7230";
name = "fmo-os-rugged-devices";
ipaddr = "192.168.101.2";
defaultgw = "192.168.101.1";
release = "v1.1.0a";
Expand All @@ -13,6 +13,8 @@
RAversion = "v0.8.4";
};

device-info = ./device-info/rugged-devices.nix;

systemPackages = [
"vim"
"tcpdump"
Expand Down Expand Up @@ -65,10 +67,6 @@
'';
}; # services.udev
}; # services
ghaf.graphics.sway.extraConfig = ''
# Map touch screen input to internal display
input "3823:49156:EETI8082:00_0EEF:C004" map_to_output "eDP-1"
''; # graphics.sway
}
]; # extraModules;

Expand All @@ -82,11 +80,6 @@
"vim"
"tcpdump"
]; # systemPackages
pciDevices = [
{
path = "0000:00:14.3";
}
]; # pciDevices
extraModules = [
{
users.users."ghaf".extraGroups = ["networkmanager"];
Expand Down Expand Up @@ -240,7 +233,6 @@
"tcpdump"
"gpsd"
]; # systemPackages
pciDevices = [];
extraModules = [
{
users.users."ghaf".extraGroups = ["docker" "dialout"];
Expand Down
30 changes: 0 additions & 30 deletions hardware/fmo-os-rugged-laptop-7330-public.nix

This file was deleted.

Loading

0 comments on commit 1930efc

Please sign in to comment.