Quantcast
Channel: I'M FROSTY
Viewing all articles
Browse latest Browse all 120

Write A Program In Python/C++ To Make USB Device Bootable by Installing Required System Files.

$
0
0

============ Python Program ============

import commands

print "\nCREATING A BOOTABLE USB\n";

print "\nSTEP 1: UNMOUNTING THE DEVICE\n"

print commands.getoutput("umount /dev/sdb*")

print commands.getoutput("echo y | mkfs /dev/sdb")

print "\nSTEP 3: MODIFY 1st SECTOR OF DEVICE\n"

print commands.getoutput("dd if=boot_sect.bin of=/dev/sdb bs=512 count=1")

print "\nSTEP 4: CREATING THE FILE SYSTEM\n"

print commands.getoutput("echo n p \"\n\n\n\n\n\" w | fdisk /dev/sdb")

print "\nDONE\n"

Read more »

Viewing all articles
Browse latest Browse all 120

Trending Articles