Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
path: root/archinstall
diff options
context:
space:
mode:
authorDylan Taylor <dylan@dylanmtaylor.com>2021-06-03 07:20:16 -0400
committerDylan Taylor <dylan@dylanmtaylor.com>2021-06-03 07:20:16 -0400
commitdcf178c7e8ae733fa46d680dee392fb4815ba2d9 (patch)
tree3c59f5c79fe798807954cffbc2672bb2eddbad3f /archinstall
parentbedc5cd13277e23141fbd1b491e14ffde106d9f5 (diff)
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: