Last active
July 30, 2024 15:59
-
-
Save bryanjhv/88badffad27f8c20086b58ed517a035c to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
set -x | |
DBUS="gdbus call -y" | |
DEST=org.freedesktop.UDisks2 | |
OBJP=/org/freedesktop/UDisks2/block_devices/sdb | |
$DBUS -d $DEST -o $OBJP -m $DEST.Block.Format dos {} | |
$DBUS -d $DEST -o $OBJP -m $DEST.PartitionTable.CreatePartition 4194304 0 0x0e "" {} | |
$DBUS -d $DEST -o ${OBJP}1 -m $DEST.Block.Format vfat {} | |
$DBUS -d $DEST -o ${OBJP}1 -m $DEST.Filesystem.Mount {} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment