summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/action/local.mk2
-rw-r--r--src/action/update.sh25
-rw-r--r--src/local.mk1
-rw-r--r--src/main.sh2
4 files changed, 29 insertions, 1 deletions
diff --git a/src/action/local.mk b/src/action/local.mk
new file mode 100644
index 0000000..a5cd6cd
--- /dev/null
+++ b/src/action/local.mk
@@ -0,0 +1,2 @@
+firman_SOURCES += \
+ src/action/update.sh
diff --git a/src/action/update.sh b/src/action/update.sh
new file mode 100644
index 0000000..d18c029
--- /dev/null
+++ b/src/action/update.sh
@@ -0,0 +1,25 @@
+# Firmware update action
+#
+# Copyright (C) 2015 Patrick "P. J." McDermott
+#
+# 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/>.
+
+do_update()
+{
+ info 'Updating firmware'
+
+ if ! flashrom_probe; then
+ return 1
+ fi
+}
diff --git a/src/local.mk b/src/local.mk
index 75bbd68..e6679af 100644
--- a/src/local.mk
+++ b/src/local.mk
@@ -5,6 +5,7 @@ firman_SOURCES += \
src/main.sh \
src/ui.sh
+include $(top_srcdir)/src/action/local.mk
include $(top_srcdir)/src/board/local.mk
include $(top_srcdir)/src/dist/local.mk
include $(top_srcdir)/src/ui/local.mk
diff --git a/src/main.sh b/src/main.sh
index 4596b1a..5a37d4f 100644
--- a/src/main.sh
+++ b/src/main.sh
@@ -82,7 +82,7 @@ main()
case "$(show_menu 'Firmware Manager' 'Update firmware' \
'Exit')" in
0)
- info 'Hello, world!'
+ do_update
;;
1)
info 'Exiting'