Skip to main content

bootable install media creator

Project description

Bootable Disk Creator Build Status codecov

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

Until an actual package has been created, you'll have to download the source. 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

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.

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.0.tar.gz (11.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

bdc-1.0.0-py3-none-any.whl (15.9 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: bdc-1.0.0.tar.gz
  • Upload date:
  • Size: 11.4 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.6

File hashes

Hashes for bdc-1.0.0.tar.gz
Algorithm Hash digest
SHA256 4ad551db4a6144347694e91c90fc7ca4d1146f8dce05f5a16f49d204499679b5
MD5 b52f42fbc2fcc48890f24526b8fad85e
BLAKE2b-256 67e576b552265e80d096c80c1088df12b8452bb9e75fc11b8fdff3794bff63d0

See more details on using hashes here.

File details

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

File metadata

  • Download URL: bdc-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 15.9 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.6

File hashes

Hashes for bdc-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 18ccf67c6febac70fa1f683c7aadf05bb583a8ae0d9f3794f4e97a40b947ba80
MD5 acd03c36b5cce54f01b3a17cb7a9432d
BLAKE2b-256 40bf258620cf61405e00f2f025d9fa6126efabefecb4fb8fbcc952dab922a742

See more details on using hashes here.

Supported by

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