From ae3c328511e32d6e49e23d7ad46fe6319e501fb1 Mon Sep 17 00:00:00 2001 From: Robert Nelson <robertcnelson@gmail.com> Date: Thu, 21 Nov 2013 14:38:28 -0600 Subject: [PATCH] pkg: cloud9 wip Signed-off-by: Robert Nelson <robertcnelson@gmail.com> --- build_image.sh | 3 +++ scripts/chroot.sh | 33 +++++++++++++++++++++++++++++++++ 2 files changed, 36 insertions(+) diff --git a/build_image.sh b/build_image.sh index 086dec592..86c08b0f4 100755 --- a/build_image.sh +++ b/build_image.sh @@ -97,6 +97,8 @@ minimal_armel () { chroot_ENABLE_DEB_SRC="${chroot_ENABLE_DEB_SRC}" chroot_KERNEL_HTTP_DIR="${chroot_KERNEL_HTTP_DIR}" + chroot_cloud9_ide="${chroot_cloud9_ide}" + chroot_COPY_SETUP_SDCARD="${chroot_COPY_SETUP_SDCARD}" chroot_hook="${chroot_hook}" @@ -308,6 +310,7 @@ chroot_COPY_SETUP_SDCARD="enable" #FIXME: things to add to .config: include_firmware="enable" chroot_rcnee_startup_scripts="enable" +#chroot_cloud9_ide="enable" #no_pkgs="enable" dpkg_arch="armhf" diff --git a/scripts/chroot.sh b/scripts/chroot.sh index 67b9e6bd8..68475f217 100755 --- a/scripts/chroot.sh +++ b/scripts/chroot.sh @@ -616,6 +616,35 @@ cat > ${DIR}/chroot_script.sh <<-__EOF__ fi } + install_cloud9 () { + pkg="git-core" + dpkg_check + + if [ "x\${pkg_is_not_installed}" = "x" ] ; then + + if [ "x${release}" = "xwheezy" ] ; then + apt-get -y -t wheezy-backports install nodejs + else + apt-get -y install nodejs + fi + + if [ ! -f /usr/bin/node ] ; then + sudo ln -s /usr/bin/nodejs /usr/bin/node + fi + if [ ! -d /usr/lib/node ] ; then + sudo mkdir -p /usr/lib/node + fi + + curl https://npmjs.org/install.sh | sh + + mkdir -p /opt/cloud9/ || true + clone git clone https://github.com/ajaxorg/cloud9.git /opt/cloud9/ || true + chown -R ${user_name}:${user_name} /opt/cloud9/ + else + dpkg_package_missing + fi + } + cleanup () { mkdir -p /boot/uboot/ @@ -654,6 +683,10 @@ cat > ${DIR}/chroot_script.sh <<-__EOF__ add_user startup_script + if [ "x${chroot_cloud9_ide}" = "xenable" ] ; then + install_cloud9 + fi + if [ "x${chroot_ENABLE_DEB_SRC}" = "xenable" ] ; then dl_pkg_src fi -- GitLab