A small and lightweight wrapper for dd that strips away the complexity of CLI flashing.
Small and lightweight wrapper written in Java for dd designed to simplify CLI flashing while protecting your hardware from accidental command-line errors. cflash replaces the syntax with a clear, safe interface, providing a reliable workflow for both newcomers and power users.
Java: 21 (Download here)util-linux: 2.41coreutils: 9.10maven: 3.9.15- Operating System: Linux
-
Clone the repository:
git clone https://github.com/cametendo/cflash-git.git cd cflash-git -
Compile the code:
mvn clean package
-
Run cflash:
java -jar target/cflash-<version>.jar (optionally add arguments here, like with dd)
-
Update cflash:
git pull mvn clean package
To install cflash globally so that it can be run from any terminal:
-
Clone the repository (if not done already):
git clone https://github.com/cametendo/cflash-git.git cd cflash-git -
Make the build and install scripts executable:
chmod +x build.sh install.sh
-
Build the project using the provided build script (requires root privileges):
sudo ./build.sh
-
Install globally (requires root privileges):
sudo ./install.sh
-
Run cflash from anywhere:
cflash
-
Update cflash (reguires root privileges):
sudo cflash --update
Notes:
- The
build.shscript compiles all Java source files and creates an executablecflash.jar. - The
install.shscript copiescflash.jarto/usr/local/lib/cflashand installs a wrapper script in/usr/local/binfor easy execution. - If you use Arch Linux:
- You can directly install it with
yayorparuviayay -S cflash/paru -S cflashor - You can clone the repository from the AUR and manually build it:
git clone https://aur.archlinux.org/cflash.git cd cflash makepkg -si - You can update cflash using
yay/paruviayay -S cflash/paru -S cflashor by rebuilding the package:git clone https://aur.archlinux.org/cflash.git cd cflash makepkg -si
- You can directly install it with
- Using the command
cflashin the terminal, will start the flashing process. You will be asked several question before the flashing begins:- You will see a list of every drive your system see's (excluding system drives) and the be asked to enter the device you want to flash the image onto. (F.e. /dev/sda)
- You will be prompted to enter the path of the iso / image you want to flash
- You will be prompted to choose a byte size (default: 4M)
- You will be prompted to enter your oflag (default: direct)
- You will be asked if you are absolutely sure that you want to continue (flashing will wipe all data)
- Alternative: using
cflash [device] [iso-path] [block-size] [oflag]will skip the questions and instantly ask you, if you're absolutely sure you want to continue. - Once confirmed, the flash will start and a small progress bar will appear showing the flashing progress.
- After completion, the program will detect the OS from the iso and wish you a great time with your new OS. (Example: "Done! Have fun with your new Linux installation!)
- IMPORTANT: Since dd needs sudo rights, ensure you have root priviliges.
- Linux
- Clone the repository onto your device and cd into it.
- Run the
build.shfile to build the program. - Run the
ìnstall.shto install the program. - Open a terminal and use the program with
cflash, optionally add all the arguments you need.
Author: Cametendo License: MIT