summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xsystem-version-manager/system-version-manager15
1 files changed, 13 insertions, 2 deletions
diff --git a/system-version-manager/system-version-manager b/system-version-manager/system-version-manager
index 2f46dfc..554e459 100755
--- a/system-version-manager/system-version-manager
+++ b/system-version-manager/system-version-manager
@@ -100,11 +100,22 @@ class SystemVersionManager(object):
if os.path.isdir(os.path.join(systems, filename))
and not os.path.islink(os.path.join(systems, filename))]
+ # U-boot expects extlinux.conf to be in an extlinux subfolder, so also
+ # check for this if /extlinux.conf isn't found
+ def _get_extlinux_path(self):
+ file_paths = ['extlinux.conf','extlinux/extlinux.conf']
+ for path in file_paths:
+ extlinux_path = os.path.join(self.boot_dir, path)
+ if os.path.isfile(extlinux_path):
+ return extlinux_path
+ raise AppException(
+ "No extlinux.conf file found")
+
# To check which system is the default one, it checks the 'ontimeout'
# value in the extlinux.conf file. If it's not present, then pick
# the first of the present systems.
def _get_default(self):
- extlinux = os.path.join(self.boot_dir, 'extlinux.conf')
+ extlinux = os.path.join(self.boot_dir, self._get_extlinux_path())
with open(extlinux, 'r') as f:
for line in f:
line = line.rstrip('\n')
@@ -146,7 +157,7 @@ class SystemVersionManager(object):
# Logic copied from morphlib.SaveFile to not create
# a morphlib dependency.
fd, temp_config = tempfile.mkstemp(dir=self.boot_dir)
- config = os.path.join(self.boot_dir, 'extlinux.conf')
+ config = os.path.join(self.boot_dir, self._get_extlinux_path())
with os.fdopen(fd, 'w') as f:
# If theres no menu.c32 file, add a menu to the extlinux.conf file
if self._check_system_syslinux():