Package org.jnode.fs.fat

Examples of org.jnode.fs.fat.GrubFatFormatter


        }
    }

    public static void createFloppy(File f) throws Exception {

        GrubFatFormatter ff = new GrubFatFormatter(0, null, null);
        FileDevice newFd = new FileDevice(f, "rw");
        newFd.setLength(1440 * 1024);
        ff.format(newFd);

        // newFd.start();
        final FileSystemService fSS = InitialNaming.lookup(FileSystemService.NAME);
        FatFileSystemType type = fSS.getFileSystemType(FatFileSystemType.ID);
        FatFileSystem fs = new FatFileSystem(newFd, false, type);
View Full Code Here


     *
     * @param dev
     * @throws IOException
     */
    protected void formatDevice(Device dev) throws IOException {
        GrubFatFormatter ff = createFormatter();
        try {
            ff.format(dev.getAPI(BlockDeviceAPI.class));
        } catch (ApiNotFoundException ex) {
            final IOException ioe = new IOException("BlockDeviceAPI not found on device");
            ioe.initCause(ex);
            throw ioe;
        }
View Full Code Here

    public void setDestFile(File destFile) {
        this.destFile = destFile;
    }

    protected GrubFatFormatter createFormatter() throws IOException {
        return new GrubFatFormatter(0, stage1ResourceName, stage2ResourceName);
    }
View Full Code Here

         */

        /* Format partition 0 */
        part0 = new MappedFSBlockDeviceSupport(device, pte.getStartLba()
            * bytesPerSector, pte.getNrSectors() * bytesPerSector);
        GrubFatFormatter ff = createFormatter();
        ff.setInstallPartition(0x0000FFFF);
        ff.format(part0);
        GrubBootSector part0bs = (GrubBootSector) ff.getBootSector();

        /* Fixup stage2 sector in MBR */
        mbr.setStage2Sector(pte.getStartLba() + part0bs.getStage2Sector());
        try {
            mbr.write(device.getAPI(BlockDeviceAPI.class));
View Full Code Here

     * @return The formatter
     * @throws IOException
     * @see org.jnode.build.BootFloppyBuilder#createFormatter()
     */
    protected GrubFatFormatter createFormatter() throws IOException {
        return new GrubFatFormatter(bytesPerSector, spc, geom, FatType.FAT16, 1,
            getStage1ResourceName(), getStage2ResourceName());
    }
View Full Code Here

TOP

Related Classes of org.jnode.fs.fat.GrubFatFormatter

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.