Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed Clean, Added Icon, Updated tested-on list #53

Open
wants to merge 11 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 19 additions & 11 deletions create-image.sh
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
#!/bin/bash

if [ "$1" == "clean" ]; then
find data -not -path data -not -path data/BOOTX64.efi -not path data/.gitignore -delete
find data -not -path data -not -path data/BOOTX64.efi -not -path data/.gitignore -not -path data/TAILS.icns -delete
echo "Cleaned up the data/ directory!"
echo "You can now re-run the script with:"
echo "$0"

exit 0
fi

set -x
TAILS_ISO_URL="http://dl.amnesia.boum.org/tails/stable/tails-i386-1.2.1/tails-i386-1.2.1.iso"
TAILS_SIG_URL="https://tails.boum.org/torrents/files/tails-i386-1.2.1.iso.sig"
#set -x

TAILS_KEY_URL="https://tails.boum.org/tails-signing.key"
USB_PART_NAME="TAILSLIVE"

if [ ! -d "data" ]; then
echo "[+] Creating data/ directory..."
Expand All @@ -25,7 +25,7 @@ create_disk () {
# This erases the TARGET disk and creates 1 FAT32 partition that is of the
# size of the drive.
if [ "$( uname -s )" == "Darwin" ];then
diskutil eraseDisk FAT32 TAILSLIVECD $TARGET_DISK
diskutil eraseDisk FAT32 $USB_PART_NAME $TARGET_DISK
else
echo "Currently don't support building image on this platform"
fi
Expand All @@ -35,8 +35,8 @@ mount_disk () {
# This mounts the USB disk and returns the mount_point of the USB disk
local __resultvar=$1
if [ "$( uname -s )" == "Darwin" ];then
local mount_point="/Volumes/TAILSLIVECD"
diskutil mount -mountpoint $mount_point TAILSLIVECD
local mount_point="/Volumes/$USB_PART_NAME"
diskutil mount -mountpoint $mount_point $USB_PART_NAME
else
echo "Currently don't support building image on this platform"
exit 1
Expand All @@ -58,9 +58,6 @@ mount_iso () {
}

verify_tails () {
curl -o data/tails-signing.key $TAILS_KEY_URL
curl -o data/tails.iso.sig $TAILS_SIG_URL

rm -f data/tmp_keyring.pgp
gpg --no-default-keyring --keyring data/tmp_keyring.pgp --import data/tails-signing.key

Expand All @@ -80,8 +77,13 @@ verify_tails () {
}

download_tails () {
curl -k -o data/tails-tmp.iso $TAILS_ISO_URL
# This parses the Tails website downloads section to find the latest version
# then downloads it along with the signature and key
TAILS_VERSION=$(curl -s http://dl.amnesia.boum.org/tails/stable/ | sed -n "s/^.*\(tails-i386-[0-9.]*\).*$/\1/p")
curl -o data/tails-tmp.iso http://dl.amnesia.boum.org/tails/stable/$TAILS_VERSION/$TAILS_VERSION.iso
mv data/tails-tmp.iso data/tails.iso
curl -o data/tails.iso.sig https://tails.boum.org/torrents/files/$TAILS_VERSION.iso.sig
curl -o data/tails-signing.key $TAILS_KEY_URL
}

list_disks () {
Expand Down Expand Up @@ -129,6 +131,10 @@ create_image () {

mkdir -p $DISK_PATH/efi/boot/

echo "[+] Setting Volume Icon"
cp data/TAILS.icns $DISK_PATH/.VolumeIcon.icns
SetFile -a C $DISK_PATH

echo "[+] Copying BOOTX64.efi"
cp data/BOOTX64.efi $DISK_PATH/efi/boot/

Expand All @@ -138,6 +144,8 @@ create_image () {
echo "[+] Copying live directory"
rsync -ah --progress $ISO_PATH/live $DISK_PATH

hdiutil detach $ISO_PATH

echo "All done"
}

Expand Down
1 change: 1 addition & 0 deletions data/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@
# Except this file
!.gitignore
!BOOTX64.efi
!TAILS.icns
Binary file added data/TAILS.icns
Binary file not shown.
4 changes: 2 additions & 2 deletions tested-on.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,9 +74,9 @@ Notes:

* **boots** yes

* **wifi** unknown
* **wifi** yes

* **trackpad** unknown
* **trackpad** yes

Notes:

Expand Down