summaryrefslogtreecommitdiffstats
path: root/mtools
diff options
context:
space:
mode:
authorH. Peter Anvin <hpa@linux.intel.com>2010-06-25 15:23:42 -0700
committerH. Peter Anvin <hpa@linux.intel.com>2010-06-25 15:23:42 -0700
commit35bce9696160fbed33b6bad15c632cc0b55b0758 (patch)
treea035aa7cca7883e40a8c0e714dc354b1c60467e3 /mtools
parent475fe593d238f6b1c8edd78d2d819be7e79d6305 (diff)
downloadsyslinux-35bce9696160fbed33b6bad15c632cc0b55b0758.tar.gz
syslinux-35bce9696160fbed33b6bad15c632cc0b55b0758.tar.xz
syslinux-35bce9696160fbed33b6bad15c632cc0b55b0758.zip
mtools: include the size of the ADV in the mappable range
We need to include the size of the ADV in the range of data that needs to be mapped. Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
Diffstat (limited to 'mtools')
-rw-r--r--mtools/syslinux.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/mtools/syslinux.c b/mtools/syslinux.c
index ade84402..f5b89c9e 100644
--- a/mtools/syslinux.c
+++ b/mtools/syslinux.c
@@ -261,7 +261,8 @@ int main(int argc, char *argv[])
/*
* Now, use libfat to create a block map
*/
- ldlinux_sectors = (syslinux_ldlinux_len + SECTOR_SIZE - 1) >> SECTOR_SHIFT;
+ ldlinux_sectors = (syslinux_ldlinux_len + 2 * ADV_SIZE
+ + SECTOR_SIZE - 1) >> SECTOR_SHIFT;
sectors = calloc(ldlinux_sectors, sizeof *sectors);
fs = libfat_open(libfat_xpread, dev_fd);
ldlinux_cluster = libfat_searchdir(fs, 0, "LDLINUX SYS", NULL);