Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/lib
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 /lib
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.
Diffstat (limited to 'lib')
-rw-r--r--lib/shlib.sh12
1 files changed, 9 insertions, 3 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