aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatt Fleming <matt.fleming@intel.com>2013-01-10 11:47:33 +0000
committerMatt Fleming <matt.fleming@intel.com>2013-01-10 11:47:33 +0000
commit15d85f991bb2609aedce06c0e01d89b31c6dc008 (patch)
tree85331453d08d51e5e5b3184957292d50c4dce4ed
parent39add3bc254a585aeba8dba7c32e4aa462221e24 (diff)
downloadsyslinux-15d85f991bb2609aedce06c0e01d89b31c6dc008.tar.gz
syslinux-15d85f991bb2609aedce06c0e01d89b31c6dc008.tar.xz
syslinux-15d85f991bb2609aedce06c0e01d89b31c6dc008.zip
extlinux: Fix installation subdirectory patching
Commit a126f17f663c ("EXTLINUX: Initial XFS filesystem support") broke the code that inserts the installation subdirectory into the Extended Patch Area (EPA). The EPA entry is used to set the initial working directory on boot. This caused boot failures for users that chose an install directory other than /boot/syslinux (technically, it failed for any path not in 'search_directories' in load_env32()) due to ldlinux.c32 failing to load because the initial working directory was not set correctly. Cc: Paulo Alcantara <pcacjr@zytor.com> Signed-off-by: Matt Fleming <matt.fleming@intel.com>
-rw-r--r--extlinux/main.c10
1 files changed, 3 insertions, 7 deletions
diff --git a/extlinux/main.c b/extlinux/main.c
index fa54152e..01bfc9c4 100644
--- a/extlinux/main.c
+++ b/extlinux/main.c
@@ -440,13 +440,11 @@ int install_bootblock(int fd, const char *device)
return 0;
}
-static int rewrite_boot_image(int devfd, const char *filename)
+static int rewrite_boot_image(int devfd, const char *path, const char *filename)
{
int fd;
int ret;
int modbytes;
- char path[PATH_MAX];
- char slash;
/* Let's create LDLINUX.SYS file again (if it already exists, of course) */
fd = open(filename, O_WRONLY | O_TRUNC | O_CREAT | O_SYNC,
@@ -470,8 +468,6 @@ static int rewrite_boot_image(int devfd, const char *filename)
goto error;
}
- sscanf(filename, "%s%cldlinux.sys", path, &slash);
-
/* Map the file, and patch the initial sector accordingly */
modbytes = patch_file_and_bootblock(fd, path, devfd);
@@ -525,7 +521,7 @@ int ext2_fat_install_file(const char *path, int devfd, struct stat *rst)
}
close(fd);
- fd = rewrite_boot_image(devfd, file);
+ fd = rewrite_boot_image(devfd, path, file);
if (fd < 0)
goto bail;
@@ -673,7 +669,7 @@ static int xfs_install_file(const char *path, int devfd, struct stat *rst)
close(fd);
- fd = rewrite_boot_image(devfd, file);
+ fd = rewrite_boot_image(devfd, path, file);
if (fd < 0)
goto bail;