From 3f1b4593aad9067de053256ad98251eea80cd81d Mon Sep 17 00:00:00 2001 From: Stefan `Sec` Zehl Date: Sun, 25 Dec 2011 18:52:19 +0100 Subject: [PATCH] Mini makefile and small doku --- tools/smartflash/Makefile | 18 ++++++++++++++++++ tools/smartflash/README | 23 +++++++++++++++++++++++ 2 files changed, 41 insertions(+) create mode 100644 tools/smartflash/Makefile create mode 100644 tools/smartflash/README diff --git a/tools/smartflash/Makefile b/tools/smartflash/Makefile new file mode 100644 index 0000000..47a2162 --- /dev/null +++ b/tools/smartflash/Makefile @@ -0,0 +1,18 @@ +setup: + cd ../../firmware && make clean && make && make l0dables + cp ../../firmware/firmware.bin . + -mkdir files 1files + cp ../../firmware/l0dable/*c0d 1files + cp ../../firmware/l0dable/*nik files + cp ../../firmware/l0dable/*int files + cp ../../firmware/l0dable/files/* files + cd ../crypto && make clean && make generate-keys + cp ../crypto/generate-keys . + @echo + @echo Now run ./smartflash + +clean: + rm firmware.bin generate-keys + rm -rf files 1files + + diff --git a/tools/smartflash/README b/tools/smartflash/README new file mode 100644 index 0000000..8140912 --- /dev/null +++ b/tools/smartflash/README @@ -0,0 +1,23 @@ +smarflash recognizes r0kets in firmware flash or mass storage flash mode and flashes them to factory defaults with a new generated random crypto key. + +Runs only under linux (sorry, but requires /sys/... stuff) + +You NEED to disable your automounter and run it as root. + +Disabling automounter on ubuntu 10.4: + run gconf-editor + apps > nautilus > preferences + + media_automount = OFF + media_automount_open = OFF + media_autorun_never = ON + +run "make setup" to generate/gathe the necessary files +then run "./smarflash" and flash away. + + +TODO ideas: +- keep cryptokey if already there. +- ability to format if not? Or somehow force formatting? +- fix broken FS: save config/keys // reformat // copy back +