Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
freedombone
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Context Sensitive Group
freedombone
Commits
b199fb98
Commit
b199fb98
authored
9 years ago
by
Bob Mottram
Browse files
Options
Downloads
Patches
Plain Diff
Command to format drives as LUKS
parent
decee24c
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
Makefile
+4
-0
4 additions, 0 deletions
Makefile
man/freedombone-format.1.gz
+0
-0
0 additions, 0 deletions
man/freedombone-format.1.gz
src/freedombone-format
+60
-0
60 additions, 0 deletions
src/freedombone-format
src/freedombone-keydrive
+1
-15
1 addition, 15 deletions
src/freedombone-keydrive
with
65 additions
and
15 deletions
Makefile
+
4
−
0
View file @
b199fb98
...
...
@@ -44,6 +44,7 @@ install:
install
-m
755 src/
${
APP
}
-addsipuser
${
DESTDIR
}${
PREFIX
}
/bin
install
-m
755 src/
${
APP
}
-rmsipuser
${
DESTDIR
}${
PREFIX
}
/bin
install
-m
755 src/
${
APP
}
-sipfreeext
${
DESTDIR
}${
PREFIX
}
/bin
install
-m
755 src/
${
APP
}
-format
${
DESTDIR
}${
PREFIX
}
/bin
mkdir
-m
755
-p
${
DESTDIR
}${
PREFIX
}
/share/man/man1
install
-m
644 man/
${
APP
}
.1.gz
${
DESTDIR
}${
PREFIX
}
/share/man/man1
install
-m
644 man/
${
APP
}
-keydrive
.1.gz
${
DESTDIR
}${
PREFIX
}
/share/man/man1
...
...
@@ -73,6 +74,7 @@ install:
install
-m
644 man/
${
APP
}
-logging
.1.gz
${
DESTDIR
}${
PREFIX
}
/share/man/man1
install
-m
644 man/
${
APP
}
-addsipuser
.1.gz
${
DESTDIR
}${
PREFIX
}
/share/man/man1
install
-m
644 man/
${
APP
}
-rmsipuser
.1.gz
${
DESTDIR
}${
PREFIX
}
/share/man/man1
install
-m
644 man/
${
APP
}
-format
.1.gz
${
DESTDIR
}${
PREFIX
}
/share/man/man1
uninstall
:
rm
-f
${
PREFIX
}
/share/man/man1/
${
APP
}
.1.gz
rm
-f
${
PREFIX
}
/share/man/man1/
${
APP
}
-keydrive
.1.gz
...
...
@@ -102,6 +104,7 @@ uninstall:
rm
-f
${
PREFIX
}
/share/man/man1/
${
APP
}
-logging
.1.gz
rm
-f
${
PREFIX
}
/share/man/man1/
${
APP
}
-addsipuser
.1.gz
rm
-f
${
PREFIX
}
/share/man/man1/
${
APP
}
-rmsipuser
.1.gz
rm
-f
${
PREFIX
}
/share/man/man1/
${
APP
}
-format
.1.gz
rm
-rf
${
PREFIX
}
/share/
${
APP
}
rm
-f
${
PREFIX
}
/bin/
${
APP
}
rm
-f
${
PREFIX
}
/bin/zeronetavahi
...
...
@@ -135,6 +138,7 @@ uninstall:
rm
-f
${
PREFIX
}
/bin/
${
APP
}
-addsipuser
rm
-f
${
PREFIX
}
/bin/
${
APP
}
-rmsipuser
rm
-f
${
PREFIX
}
/bin/
${
APP
}
-sipfreeext
rm
-f
${
PREFIX
}
/bin/
${
APP
}
-format
clean
:
rm
-f
\#
*
\.
#* debian/*.substvars debian/*.log
rm
-fr
deb.
*
debian/
${
APP
}
...
...
This diff is collapsed.
Click to expand it.
man/freedombone-format.1.gz
0 → 100644
+
0
−
0
View file @
b199fb98
File added
This diff is collapsed.
Click to expand it.
src/freedombone-format
0 → 100755
+
60
−
0
View file @
b199fb98
#!/bin/bash
#
# .---. . .
# | | |
# |--- .--. .-. .-. .-.| .-. .--.--. |.-. .-. .--. .-.
# | | (.-' (.-' ( | ( )| | | | )( )| | (.-'
# ' ' --' --' -' - -' ' ' -' -' -' ' - --'
#
# Freedom in the Cloud
#
# Makes a USB drive containing a gpg key fragment
#
# License
# =======
#
# Copyright (C) 2015 Bob Mottram <bob@robotics.uk.to>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
if
[
!
$1
]
;
then
echo
'Specify a drive, such as sdb, sdc, etc'
exit
1
fi
USB_DRIVE
=
/dev/
$1
echo
"Formatting
$USB_DRIVE
as LUKS"
cryptsetup
-y
-v
luksFormat
$USB_DRIVE
if
[
!
"
$?
"
=
"0"
]
;
then
echo
"Failed to format
$USB_DRIVE
as LUKS"
exit
36823
fi
cryptsetup luksOpen
$USB_DRIVE
encrypted_usb
if
[
!
"
$?
"
=
"0"
]
;
then
echo
"Failed to open LUKS formatted drive
$USB_DRIVE
"
exit
37232
fi
mkfs.ext4 /dev/mapper/encrypted_usb
if
[
!
"
$?
"
=
"0"
]
;
then
echo
'Format of drive $USB_DRIVE failed'
exit
73218
fi
cryptsetup luksClose encrypted_usb
if
[
-f
/dev/mapper/encrypted_usb
]
;
then
rm
-rf
/dev/mapper/encrypted_usb
fi
echo
'Format completed'
exit
0
This diff is collapsed.
Click to expand it.
src/freedombone-keydrive
+
1
−
15
View file @
b199fb98
...
...
@@ -105,24 +105,10 @@ cryptsetup luksClose encrypted_usb
# optionally format the drive
if
[[
$FORMAT
==
"yes"
]]
;
then
echo
"Formatting
${
USB_DRIVE
::-1
}
as LUKS"
cryptsetup
-y
-v
luksFormat
${
USB_DRIVE
::-1
}
freedombone-format
${
USB_DRIVE
::-1
}
if
[
!
"
$?
"
=
"0"
]
;
then
exit
36823
fi
cryptsetup luksOpen
${
USB_DRIVE
::-1
}
encrypted_usb
if
[
!
"
$?
"
=
"0"
]
;
then
exit
37232
fi
mkfs.ext4 /dev/mapper/encrypted_usb
if
[
!
"
$?
"
=
"0"
]
;
then
exit
73218
fi
cryptsetup luksClose encrypted_usb
if
[
-f
/dev/mapper/encrypted_usb
]
;
then
rm
-rf
/dev/mapper/encrypted_usb
fi
echo
'Format completed'
fi
cryptsetup luksOpen
$USB_DRIVE
encrypted_usb
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment