瀏覽代碼

Change nodejs installation within image

Bob Mottram 8 年之前
父節點
當前提交
eaa53b3bed
共有 2 個檔案被更改,包括 6 行新增21 行删除
  1. 2
    10
      src/freedombone-image-customise
  2. 4
    11
      src/freedombone-utils-nodejs

+ 2
- 10
src/freedombone-image-customise 查看文件

@@ -1218,16 +1218,8 @@ function image_setup_utils {
1218 1218
 }
1219 1219
 
1220 1220
 function image_install_nodejs {
1221
-    if [ $INSTALLING_MESH ]; then
1222
-        return
1223
-    fi
1224
-
1225
-    chroot "$rootdir" apt-get -yq install nodejs curl
1226
-
1227
-    if [ ! -f $rootdir/usr/bin/nodejs ]; then
1228
-        echo $'nodejs was not installed'
1229
-        exit 63962
1230
-    fi
1221
+    mesh_install_nodejs
1222
+    echo 'install_nodejs' >> ${rootdir}/root/${PROJECT_NAME}-completed.txt
1231 1223
 }
1232 1224
 
1233 1225
 function image_preinstall_repos {

+ 4
- 11
src/freedombone-utils-nodejs 查看文件

@@ -45,11 +45,8 @@ NODEJS_INSTALLED_APPS_FILE=$HOME/.nodejs-apps
45 45
 
46 46
 function mesh_install_nodejs {
47 47
     # Note: this has to be jessie for now
48
-    if [ ! -d ${rootdir}/$INSTALL_DIR ]; then
49
-        mkdir ${rootdir}/$INSTALL_DIR
50
-    fi
51
-    chroot "${rootdir}" wget -qO- https://deb.nodesource.com/gpgkey/nodesource.gpg.key > $INSTALL_DIR/node.gpg.key
52
-    chroot "${rootdir}" apt-key add $INSTALL_DIR/node.gpg.key
48
+    wget -qO- https://deb.nodesource.com/gpgkey/nodesource.gpg.key > ${rootdir}/root/node.gpg.key
49
+    chroot "${rootdir}" apt-key add /root/node.gpg.key
53 50
     echo "deb https://deb.nodesource.com/node_7.x jessie main" > ${rootdir}/etc/apt/sources.list.d/nodesource.list
54 51
     echo "deb-src https://deb.nodesource.com/node_7.x jessie main" >> ${rootdir}/etc/apt/sources.list.d/nodesource.list
55 52
     chroot "${rootdir}" apt-get update
@@ -151,12 +148,8 @@ function install_nodejs {
151 148
     fi
152 149
 
153 150
     # Note: this has to be jessie for now
154
-    if [ ! -d $INSTALL_DIR ]; then
155
-        mkdir $INSTALL_DIR
156
-    fi
157
-    cd $INSTALL_DIR
158
-    wget -qO- https://deb.nodesource.com/gpgkey/nodesource.gpg.key > $INSTALL_DIR/node.gpg.key
159
-    apt-key add $INSTALL_DIR/node.gpg.key
151
+    wget -qO- https://deb.nodesource.com/gpgkey/nodesource.gpg.key > /root/node.gpg.key
152
+    apt-key add /root/node.gpg.key
160 153
     echo "deb https://deb.nodesource.com/node_7.x jessie main" > /etc/apt/sources.list.d/nodesource.list
161 154
     echo "deb-src https://deb.nodesource.com/node_7.x jessie main" >> /etc/apt/sources.list.d/nodesource.list
162 155