Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDaniel Drake <dsd@laptop.org>2012-09-29 15:54:44 (GMT)
committer Daniel Drake <dsd@laptop.org>2012-09-29 15:55:20 (GMT)
commit25385b0409d30688558e31df41f7f902c7bc98c0 (patch)
tree064c135e4ed9aef08c67c3456dd59adf640319b0
parent6ffef43c84f3216b42239fc3b3f72aa8c2bb6914 (diff)
Move laptop_model_number into shared directory
And add API to make this contract stronger. Some chrooted kspost scripts are now interested in knowing the laptop model number.
-rw-r--r--lib/shlib.sh12
-rw-r--r--modules/xo1/prepare.10.model.sh2
-rw-r--r--modules/xo1_5/prepare.10.model.sh2
-rw-r--r--modules/xo1_75/prepare.10.model.sh2
-rw-r--r--modules/xo4/prepare.10.model.sh2
5 files changed, 13 insertions, 7 deletions
diff --git a/lib/shlib.sh b/lib/shlib.sh
index 870eaf6..4b3c476 100644
--- a/lib/shlib.sh
+++ b/lib/shlib.sh
@@ -14,6 +14,8 @@ outputdir=$OOB__outputdir
statedir=$OOB__statedir
fsmount=$OOB__fsmount
+LAPTOP_MODEL_NUMBER=$shareddir/laptop_model_number
+
read_config() {
local vname="CFG_$1__$2"
echo ${!vname}
@@ -42,11 +44,15 @@ read_buildnr() {
fi
}
+set_laptop_model_number()
+{
+ echo $1 > $LAPTOP_MODEL_NUMBER
+}
+
read_laptop_model_number()
{
- local path=$intermediatesdir/laptop_model_number
- if [[ -e $path ]]; then
- echo "$(<$path)"
+ if [[ -e $LAPTOP_MODEL_NUMBER ]]; then
+ echo "$(<$LAPTOP_MODEL_NUMBER)"
else
echo "0"
fi
diff --git a/modules/xo1/prepare.10.model.sh b/modules/xo1/prepare.10.model.sh
index 3451a69..06c12ef 100644
--- a/modules/xo1/prepare.10.model.sh
+++ b/modules/xo1/prepare.10.model.sh
@@ -2,4 +2,4 @@
# Licensed under the terms of the GNU GPL v2 or later; see COPYING for details.
. $OOB__shlib
-echo 0 > $intermediatesdir/laptop_model_number
+set_laptop_model_number 0
diff --git a/modules/xo1_5/prepare.10.model.sh b/modules/xo1_5/prepare.10.model.sh
index 5b3023a..9543cd6 100644
--- a/modules/xo1_5/prepare.10.model.sh
+++ b/modules/xo1_5/prepare.10.model.sh
@@ -2,4 +2,4 @@
# Licensed under the terms of the GNU GPL v2 or later; see COPYING for details.
. $OOB__shlib
-echo 1 > $intermediatesdir/laptop_model_number
+set_laptop_model_number 1
diff --git a/modules/xo1_75/prepare.10.model.sh b/modules/xo1_75/prepare.10.model.sh
index 43544bb..1d21671 100644
--- a/modules/xo1_75/prepare.10.model.sh
+++ b/modules/xo1_75/prepare.10.model.sh
@@ -2,4 +2,4 @@
# Licensed under the terms of the GNU GPL v2 or later; see COPYING for details.
. $OOB__shlib
-echo 2 > $intermediatesdir/laptop_model_number
+set_laptop_model_number 2
diff --git a/modules/xo4/prepare.10.model.sh b/modules/xo4/prepare.10.model.sh
index a96a3ef..2cca919 100644
--- a/modules/xo4/prepare.10.model.sh
+++ b/modules/xo4/prepare.10.model.sh
@@ -2,4 +2,4 @@
# Licensed under the terms of the GNU GPL v2 or later; see COPYING for details.
. $OOB__shlib
-echo 4 > $intermediatesdir/laptop_model_number
+set_laptop_model_number 4