Made sure, installation and uninstallation work seemlessly

This commit is contained in:
Cametendo
2026-05-04 09:47:42 +02:00
parent c65fd63fd9
commit 0b7a8b4d41
11 changed files with 41 additions and 6 deletions

3
.gitignore vendored
View File

@@ -37,3 +37,6 @@ hs_err_pid*
.settings/ .settings/
.vscode/ .vscode/
.claude/ .claude/
cflash/*
pkg/*

View File

@@ -4,12 +4,13 @@ pkgver=1.0.1
pkgrel=1 pkgrel=1
pkgdesc="A small and lightweight wrapper for dd that strips away the complexity of CLI flashing." pkgdesc="A small and lightweight wrapper for dd that strips away the complexity of CLI flashing."
arch=('any') arch=('any')
url="https://github.com/cametendo/cflash-git" url="https://gitea.cametendo.org/cametendo/cflash-emvs"
license=('MIT') license=('MIT')
depends=('java-runtime>=21') depends=('java-runtime>=21')
makedepends=('java-environment>=21' 'maven' 'git') makedepends=('java-environment>=21' 'maven' 'git')
source=("cflash::git+https://github.com/cametendo/cflash-git.git") source=("cflash::git+https://gitea.cametendo.org/cametendo/cflash-emvs.git")
sha256sums=('SKIP') sha256sums=('SKIP')
install=cflash.install
build() { build() {
cd "$pkgname" cd "$pkgname"

Binary file not shown.

9
cflash.install Normal file
View File

@@ -0,0 +1,9 @@
pre_install() {
echo "Cleaning up legacy /usr/local files..."
rm -f /usr/local/bin/cflash
rm -rf /usr/local/lib/cflash
}
pre_upgrade() {
pre_install
}

View File

@@ -9,7 +9,10 @@ fi
# Create installation directories # Create installation directories
mkdir -p /usr/local/lib/cflash mkdir -p /usr/local/lib/cflash
cp cflash.jar /usr/local/lib/cflash/ echo "clean building cflash..."
mvn clean package
mv target/cflash-*-jar-with-dependencies.jar target/cflash.jar
cp target/cflash.jar /usr/local/lib/cflash/
cp cflash.sh /usr/local/bin/cflash cp cflash.sh /usr/local/bin/cflash
chmod +x /usr/local/bin/cflash chmod +x /usr/local/bin/cflash

View File

@@ -6,7 +6,7 @@
<groupId>org.cametendo</groupId> <groupId>org.cametendo</groupId>
<artifactId>cflash</artifactId> <artifactId>cflash</artifactId>
<version>1.0.1</version> <version>1.0.2</version>
<properties> <properties>
<maven.compiler.source>21</maven.compiler.source> <maven.compiler.source>21</maven.compiler.source>

View File

@@ -0,0 +1,15 @@
cflash is finally ready for distribution!! Here's what it can do:
TUI:
1. It will ask you to enter a device, f.e. sdd (no need for /dev/)
2. It will ask you to enter the FULL path of your ISO or image file (Tab-completion supported)
3. It will ask you to enter your preferred blocksize (Supported are: 512K (1), 1M (2), 2M (3), 4M (4), 8M (5) and 16M (6), can be entered as a digit
4. It will ask you to enter your preferred oflag (Supported are: direct (1), dsync (2), sync (3) and nocache (4), can also be entered as a digit)
5. Once completed, it will list your configuration for the flash (device, iso, blocksize and oflag) and ask, if that's all correct and you want to continue. If yes, it will continue and prompt you with a sudo (unless you started the program with sudo) and then start to flash.
6. After the flash is completed, you will get a message telling you it's done and to have fun with your new installation (depending on the OS).
CLI:
1. Enter all details for flashing (device (without /dev/), iso, blocksize and oflag), then press enter
2. You will be asked if the entered details are correct, confirm if they are all correct.
3. A sudo prompt (unless started with sudo) will appear, after confirming you have sudo-rights, the flash will start.
4. Once the flash is completed, you will get a message telling you it's done and to have fun with your new installation (depending on the OS).

View File

@@ -0,0 +1,4 @@
Changes made:
- Added path validation for "~".
- Added flashing available to nly non-mounted partitions
- now using 'lsblk -no' instead of normal 'lsblk'. for simplicity.

View File

@@ -1 +0,0 @@

View File

@@ -99,7 +99,7 @@ public class StorageDeviceLister {
System.out.println("Enter the name of your device (e.g., sdb or nvme1n1):"); System.out.println("Enter the name of your device (e.g., sdb or nvme1n1):");
} catch (IOException | InterruptedException e) { } catch (IOException | InterruptedException e) {
System.out.println("Failed to run lsblk. Do you have it installed."); System.out.println("Failed to run lsblk. Do you have it installed?");
} }
} }

View File

@@ -6,6 +6,7 @@ if [[ $EUID -ne 0 ]]; then
exit 1 exit 1
fi fi
echo "Uninstalling cflash..."
rm -f /usr/local/bin/cflash rm -f /usr/local/bin/cflash
rm -rf /usr/local/lib/cflash rm -rf /usr/local/lib/cflash