From 1387b5f1aea5cd54839ef719c2be75988508892a Mon Sep 17 00:00:00 2001 From: mwiegand Date: Thu, 7 Jul 2022 20:17:38 +0200 Subject: [PATCH] nomodeset on nvidia gpu --- bundles/grub/files/grub | 5 +++++ bundles/grub/items.py | 20 ++++++++++++++++++++ bundles/grub/metadata.py | 6 ++++++ nodes/home.backups.py | 1 + nodes/home.server.py | 4 ++++ 5 files changed, 36 insertions(+) create mode 100644 bundles/grub/files/grub create mode 100644 bundles/grub/items.py create mode 100644 bundles/grub/metadata.py diff --git a/bundles/grub/files/grub b/bundles/grub/files/grub new file mode 100644 index 0000000..a327cc8 --- /dev/null +++ b/bundles/grub/files/grub @@ -0,0 +1,5 @@ +GRUB_DEFAULT=0 +GRUB_TIMEOUT=1 +GRUB_DISTRIBUTOR=`lsb_release -i -s 2> /dev/null || echo Debian` +GRUB_CMDLINE_LINUX_DEFAULT="${' '.join(kernel_params)}" +GRUB_CMDLINE_LINUX="" diff --git a/bundles/grub/items.py b/bundles/grub/items.py new file mode 100644 index 0000000..3777d73 --- /dev/null +++ b/bundles/grub/items.py @@ -0,0 +1,20 @@ +files = { + '/etc/default/grub': { + 'content_type': 'mako', + 'context': { + 'timeout': node.metadata.get('grub/timeout'), + 'kernel_params': node.metadata.get('grub/kernel_params'), + }, + 'mode': '0644', + 'triggers': { + 'action:update-grub', + }, + } +} + +actions = { + 'update-grub': { + 'command': 'update-grub', + 'triggered': True, + }, +} \ No newline at end of file diff --git a/bundles/grub/metadata.py b/bundles/grub/metadata.py new file mode 100644 index 0000000..f2062fe --- /dev/null +++ b/bundles/grub/metadata.py @@ -0,0 +1,6 @@ +defaults = { + 'grub': { + 'timeout': 1, + 'kernel_params': set(), + }, +} \ No newline at end of file diff --git a/nodes/home.backups.py b/nodes/home.backups.py index 36ca582..5efa257 100644 --- a/nodes/home.backups.py +++ b/nodes/home.backups.py @@ -8,6 +8,7 @@ 'monitored', ], 'bundles': [ + 'grub', 'smartctl', 'wol-sleeper', 'zfs', diff --git a/nodes/home.server.py b/nodes/home.server.py index ef3d3f9..8e404bc 100644 --- a/nodes/home.server.py +++ b/nodes/home.server.py @@ -18,6 +18,7 @@ 'gitea', # 'gollum', 'grafana', + 'grub', 'influxdb2', 'mirror', 'postgresql', @@ -69,6 +70,9 @@ 'hostname': 'grafana.sublimity.de', 'influxdb_node': 'home.server', }, + 'grub': { + 'kernel_params': {'nomodeset'}, # nvidia GT1030 freeze fix + }, 'influxdb': { 'hostname': 'influxdb.sublimity.de', 'admin_token': '!decrypt:encrypt$gAAAAABg3z5PcaLYmUpcElJ07s_G-iYwnS8d532TcR8xUYbZfttT-B736zgR6J726mzKAFNYlIfJ7amNLIzi2ETDH5TAXWsOiAKpX8WC_dPBAvG3uXGtcPYENjdeuvllSagZzPt0hCIZQZXg--Z_YvzaX9VzNrVAgGD-sXQnghN5_Vhf9gVxxwP---VB_6iNlsf61Nc4axoS',