Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
path: root/archinstall
diff options
context:
space:
mode:
authorAnton Hvornum <anton@hvornum.se>2021-06-03 13:52:29 +0200
committerGitHub <noreply@github.com>2021-06-03 13:52:29 +0200
commit7b4564c0fc5e1ac1ed489faa757507db66d34457 (patch)
treecb7fc6b0026348fdfbbd14efd13802c749f8e9fc /archinstall
parent2731f82d0fd51e87c9c4454a25e1e01f2ae077cf (diff)
parentdcf178c7e8ae733fa46d680dee392fb4815ba2d9 (diff)
Merge pull request #542 from dylanmtaylor/bootloader-directory-creation
Add some safeguards to create directories before writing files
Diffstat (limited to 'archinstall')
-rw-r--r--archinstall/lib/installer.py11
1 files changed, 9 insertions, 2 deletions
diff --git a/archinstall/lib/installer.py b/archinstall/lib/installer.py
index c2db8337..da6f6a9b 100644
--- a/archinstall/lib/installer.py
+++ b/archinstall/lib/installer.py
@@ -2,8 +2,8 @@ from .disk import *
from .hardware import *
from .locale_helpers import verify_keyboard_layout, verify_x11_keyboard_layout
from .mirrors import *
-from .storage import storage
from .plugins import plugins
+from .storage import storage
from .user_interaction import *
# Any package that the Installer() is responsible for (optional and the default ones)
@@ -54,7 +54,6 @@ class Installer:
for kernel in kernels:
self.base_packages.append(kernel)
-
self.post_base_install = []
storage['session'] = self
@@ -442,6 +441,10 @@ class Installer:
# Fallback, try creating the boot loader without touching the EFI variables
SysCommand(f'/usr/bin/arch-chroot {self.target} bootctl --no-variables --path=/boot install')
+ # Ensure that the /boot/loader directory exists before we try to create files in it
+ if not os.path.exists(f'{self.target}/boot/loader'):
+ os.makedirs(f'{self.target}/boot/loader')
+
# Modify or create a loader.conf
if os.path.isfile(f'{self.target}/boot/loader/loader.conf'):
with open(f'{self.target}/boot/loader/loader.conf', 'r') as loader:
@@ -462,6 +465,10 @@ class Installer:
else:
loader.write(f"{line}\n")
+ # Ensure that the /boot/loader/entries directory exists before we try to create files in it
+ if not os.path.exists(f'{self.target}/boot/loader/entries'):
+ os.makedirs(f'{self.target}/boot/loader/entries')
+
for kernel in self.kernels:
# Setup the loader entry
with open(f'{self.target}/boot/loader/entries/{self.init_time}_{kernel}.conf', 'w') as entry: