Fixed default zram conf location and imports

This commit is contained in:
Anton Hvornum 2021-11-05 23:07:04 +01:00 committed by GitHub
parent e29f440c0b
commit 0fed0b3ce5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 5 deletions

View File

@ -471,7 +471,7 @@ class Installer:
# We could use the default example below, but maybe not the best idea: https://github.com/archlinux/archinstall/pull/678#issuecomment-962124813
# zram_example_location = '/usr/share/doc/zram-generator/zram-generator.conf.example'
# shutil.copy2(f"{self.target}{zram_example_location}", f"{self.target}/usr/lib/systemd/zram-generator.conf")
with open(f"{self.target}/usr/lib/systemd/zram-generator.conf", "w") as zram_conf:
with open(f"{self.target}/etc/systemd/zram-generator.conf", "w") as zram_conf:
zram_conf.write("[zram0]\n")
if self.enable_service('systemd-zram-setup@zram0.service'):
@ -666,8 +666,6 @@ class Installer:
# In accordance with https://github.com/archlinux/archinstall/issues/107#issuecomment-841701968
# Setting an empty keymap first, allows the subsequent call to set layout for both console and x11.
from .systemd import Boot
from .systemd import Boot
with Boot(self) as session:
session.SysCommand(["localectl", "set-keymap", '""'])
@ -691,8 +689,6 @@ class Installer:
self.log(f"Invalid x11-keyboard language specified: {language}", fg="red", level=logging.ERROR)
return False
from .systemd import Boot
from .systemd import Boot
with Boot(self) as session:
session.SysCommand(["localectl", "set-x11-keymap", '""'])