Show
Ignore:
Timestamp:
09/07/11 07:19:05 (9 months ago)
Author:
Paulo Alcantara <pcacjr@…>
Children:
045bc5cd1118fee51b19d89dc316038c8a93e5bf
Parents:
67954e370003d9bbfd8b58042669f2e9d532636f
git-author:
Paulo Alcantara <pcacjr@gmail.com> / 2011-07-05T21:32:51Z+0000
git-committer:
Paulo Alcantara <pcacjr@gmail.com> / 2011-09-07T07:19:05Z+0000
Message:

Add NTFS filesystem support to Linux and Windows installers

Signed-off-by: Paulo Alcantara <pcacjr@…>

Location:
linux
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • linux/Makefile

    r261317 rb0ac90  
    1212 
    1313## 
    14 ## Linux FAT installer 
     14## Linux FAT/NTFS installer 
    1515## 
    1616 
     
    2929           ../libinstaller/setadv.c \ 
    3030           ../libinstaller/advio.c \ 
    31            ../libinstaller/fat.c \ 
     31           ../libinstaller/fs.c \ 
    3232           ../libinstaller/syslxmod.c \ 
    3333           ../libinstaller/bootsect_bin.c \ 
  • linux/syslinux.c

    rfa6d94 rb0ac90  
    7070#include <sysexits.h> 
    7171#include "syslxcom.h" 
     72#include "syslxfs.h" 
    7273#include "setadv.h" 
    7374#include "syslxopt.h" /* unified options */ 
     
    295296    } 
    296297 
    297     fs_type = VFAT; 
    298298    xpread(dev_fd, sectbuf, SECTOR_SIZE, opt.offset); 
    299299    fsync(dev_fd); 
    300300 
    301301    /* 
    302      * Check to see that what we got was indeed an MS-DOS boot sector/superblock 
    303      */ 
    304     if ((errmsg = syslinux_check_bootsect(sectbuf))) { 
     302     * Check to see that what we got was indeed an FAT/NTFS 
     303     * boot sector/superblock 
     304     */ 
     305    if ((errmsg = syslinux_check_bootsect(sectbuf, &fs_type))) { 
    305306        fprintf(stderr, "%s: %s\n", opt.device, errmsg); 
    306307        exit(1); 
     
    358359    } 
    359360 
    360     if (do_mount(dev_fd, &mnt_cookie, mntpath, "vfat") && 
    361         do_mount(dev_fd, &mnt_cookie, mntpath, "msdos")) { 
    362         rmdir(mntpath); 
    363         die("mount failed"); 
     361    if (fs_type == VFAT) { 
     362        if (do_mount(dev_fd, &mnt_cookie, mntpath, "vfat") && 
     363            do_mount(dev_fd, &mnt_cookie, mntpath, "msdos")) { 
     364            rmdir(mntpath); 
     365            die("failed on mounting fat volume"); 
     366        } 
     367    } else if (fs_type == NTFS) { 
     368        if (do_mount(dev_fd, &mnt_cookie, mntpath, "ntfs-3g")) { 
     369            rmdir(mntpath); 
     370            die("failed on mounting ntfs volume"); 
     371        } 
    364372    } 
    365373 
     
    475483 
    476484    /* Copy the syslinux code into the boot sector */ 
    477     syslinux_make_bootsect(sectbuf); 
     485    syslinux_make_bootsect(sectbuf, fs_type); 
    478486 
    479487    /* Write new boot sector */