From 59bf6d52283c1f655c15e30dbb744350a33a1041 Mon Sep 17 00:00:00 2001 From: P. J. McDermott Date: Tue, 27 Oct 2015 18:07:10 -0400 Subject: src/action/update.sh: New file --- 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 . + +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' -- cgit v0.9.1