Skip to main content

bootable install media creator

Project description

Bootable Disk Creator Build Status codecov PyPI version pyversions

This project consists of a multithreaded GUI and CLI to automate the process of creating bootable install media in Linux.

Installation

Pip

Installing the bdc package is pretty straightforward using pip.

sudo pip3 install bdc

Git

To install this package directly from the repository:

git clone https://github.com/adamjenkins1/BootableDiskCreator.git
cd BootableDiskCreator
sudo make install
make test

Once the package has been installed, make sure that /usr/local/bin/ is in your PATH, as that is where pip installs the necessary executables.

Usage

This project requires root privileges (can't format or mount anything otherwise) so make sure to execute either script with sudo or as root. This is how the CLI is meant to be used:

usage: bdc [-h] [--image-mount IMAGE_MOUNT] [--device-mount DEVICE_MOUNT] [--silent] image device

script to automate process of creating bootable install media

positional arguments:
  image                 path to ISO image
  device                partition on device to be written

optional arguments:
  -h, --help            show this help message and exit
  --image-mount IMAGE_MOUNT
                        mount point for ISO image
  --device-mount DEVICE_MOUNT
                        mount point for block device
  --silent              suppress log output

An example call would be:

bdc </path/to/image.iso> </dev/partition1>

The GUI doesn't take any command line arguments so you can run it like so:

bdc-gui

Dependencies

  • Python >= 3.5
  • PyQt5 == 5.11.3
  • awk
  • mkfs.fat
  • lsblk
  • mount

How it works

A lot of Python. This project uses Python for all of the heavy lifting and bash when Python isn't the right tool. Bash commands are executed from Python using subprocess.Popen(). This project will do the following to create the bootable drive:

  1. get a list of available partitions
  2. mount the provided image as a loop device
  3. format the provided partition as FAT32
  4. mount the partition
  5. copy all the data onto that partition (excluding symlinks. not supported by FAT32)

The drive is then unmounted and you're left with your very own bootable drive. There is a catch, however. This project will not install a boot loader or set any flags to support legacy boot. The drive created is UEFI bootable only. This is subject to change, so don't get your hopes up if you have a machine that doesn't support UEFI or have an image that doesn't have a boot loader already installed. A lot of images come with boot loaders installed, so if you're unsure whether or not your image has a boot loader, it probably does (unless it's DBAN). You can always mount the image and look at it yourself if you want to be doubly sure.

Why build this?

I came up with the idea while I was preparing my craptop for DEF CON 26, and I was having trouble creating the bootable media to install Linux. I was using a Macbook at the time (not by choice -- if I had my way, we'd all be using Linux) and the tools for creating bootable install media on Mac are not great, and there isn't anything reliable accross multiple Linux distributions. What makes this project different than other tools out there is that this one does not use dd to write the image onto the drive. This preserves the file system on the drive and allows it to be read from other operating systems. A lot of tools will use dd to manually write the bytes because it's quick and easy. The problem with this is that it makes your drive look like an ISO file system, which other operating systems can't read. Essentially, with this method, a bootable drive is created, but that's all you can do with it, which didn't seem ideal to me.

Bug Reports

If you've found a bug or want to suggest an enhancement, be sure to open an issue on Github with the appropriate tags.

Contributing

If you're interested in contributing, great! The best way to do so is to submit a pull request. If you have an idea for a new feature you want to implement, I would prefer you run it by me before writing any code so we can make sure it's in the scope of the project.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

bdc-1.0.6.tar.gz (11.9 kB view details)

Uploaded Source

Built Distribution

bdc-1.0.6-py3-none-any.whl (16.4 kB view details)

Uploaded Python 3

File details

Details for the file bdc-1.0.6.tar.gz.

File metadata

  • Download URL: bdc-1.0.6.tar.gz
  • Upload date:
  • Size: 11.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.18.4 setuptools/40.5.0 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.6.7

File hashes

Hashes for bdc-1.0.6.tar.gz
Algorithm Hash digest
SHA256 ffe18d4f39ebfee936f57a31b427e5d8a4a83ceeea5c5a81f578d6f8a3451ba8
MD5 dd24d1fd351f97c040bac1b3f366b8ac
BLAKE2b-256 0bbe78fed8b28ce2145710af5022c3d3c0dcd853fbf02be2749029707c2783fd

See more details on using hashes here.

File details

Details for the file bdc-1.0.6-py3-none-any.whl.

File metadata

  • Download URL: bdc-1.0.6-py3-none-any.whl
  • Upload date:
  • Size: 16.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.18.4 setuptools/40.5.0 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.6.7

File hashes

Hashes for bdc-1.0.6-py3-none-any.whl
Algorithm Hash digest
SHA256 2841ac1458dbe0fc0fc698588c06476e9e62c4af4c0e9328715a025bd0f2f67c
MD5 0b44faf96b9b7d054a1db60cf6b6a2bd
BLAKE2b-256 e10fadfa447eefb0faa2f4812a726d48c33e6d6f2267e9b5cb7b7b4c467b3387

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page