From cd09962e6d636d9c497f0edce9fbcac1082994c4 Mon Sep 17 00:00:00 2001 From: wchang kim Date: Wed, 23 Dec 2015 20:28:11 +0900 Subject: [PATCH] Description:Changing the filelist of nodejs-npm package and etc. Changing the filelist : nodejs_0.12.7.bb Removing the white space : nodejs.service, nodejs_0.12.7.bb Seperating the common recipe : rpi-hwup-image-tizen-micro.bb, target-image-common.bb Signed-off-by: wchang kim Change-Id: I1dce8c3dd18bd4b15107688a92dac23d73e2218f --- .../recipes-devtools/nodejs/nodejs/nodejs.service | 2 +- .../recipes-devtools/nodejs/nodejs_0.12.7.bb | 28 ++++++++++------------ .../raspberrypi2/rpi-hwup-image-tizen-micro.bb | 21 +--------------- .../recipes-image/target-image-common.bb | 19 +++++++++++++++ 4 files changed, 34 insertions(+), 36 deletions(-) create mode 100755 meta-tizen-micro/recipes-image/target-image-common.bb diff --git a/meta-tizen-micro/recipes-devtools/nodejs/nodejs/nodejs.service b/meta-tizen-micro/recipes-devtools/nodejs/nodejs/nodejs.service index 2b8d667..5b4217f 100755 --- a/meta-tizen-micro/recipes-devtools/nodejs/nodejs/nodejs.service +++ b/meta-tizen-micro/recipes-devtools/nodejs/nodejs/nodejs.service @@ -1,5 +1,5 @@ [Unit] -Description=nodejs service +Description=nodejs service [Service] diff --git a/meta-tizen-micro/recipes-devtools/nodejs/nodejs_0.12.7.bb b/meta-tizen-micro/recipes-devtools/nodejs/nodejs_0.12.7.bb index 10b134c..d856f24 100755 --- a/meta-tizen-micro/recipes-devtools/nodejs/nodejs_0.12.7.bb +++ b/meta-tizen-micro/recipes-devtools/nodejs/nodejs_0.12.7.bb @@ -56,20 +56,20 @@ do_install () { oe_runmake install DESTDIR=${D} cd ${D}/usr/lib - oe_runnpm config set registry=http://registry.npmjs.org/ + oe_runnpm config set registry=http://registry.npmjs.org/ oe_runnpm ${NPM_INSTALL_FLAGS} install ${NPM_INSTALL} - for i in ${NPM_INSTALL}; - do - rm -rf ${D}/usr/lib/node_modules/$i/doc - rm -rf ${D}/usr/lib/node_modules/$i/example* - rm -rf ${D}/usr/lib/node_modules/$i/test + for i in ${NPM_INSTALL}; + do + rm -rf ${D}/usr/lib/node_modules/$i/doc + rm -rf ${D}/usr/lib/node_modules/$i/example* + rm -rf ${D}/usr/lib/node_modules/$i/test done install -d ${D}${sysconfdir}/init.d - install -m 0755 ${WORKDIR}/nodejs.sh ${D}${sysconfdir}/init.d - update-rc.d -r ${D} nodejs.sh start 92 5 . - + install -m 0755 ${WORKDIR}/nodejs.sh ${D}${sysconfdir}/init.d + update-rc.d -r ${D} nodejs.sh start 92 5 . + if ${@bb.utils.contains('DISTRO_FEATURES','systemd','true','false',d)};then install -d ${D}${systemd_unitdir}/system install -m 0644 ${WORKDIR}/nodejs.service ${D}${systemd_unitdir}/system/ @@ -78,8 +78,6 @@ do_install () { cd ${D}${systemd_unitdir}/system/multi-user.target.wants/ ln -sf ../nodejs.service ${D}${systemd_unitdir}/system/multi-user.target.wants/nodejs.service fi - - rm -rf ${D}/usr/lib/node_modules/npm } do_install_append_class-native() { @@ -94,15 +92,15 @@ do_install_append_class-native() { # /usr/bin/npm is symlink to /usr/lib/node_modules/npm/bin/npm-cli.js # use sed on npm-cli.js because otherwise symlink is replaced with normal file and # npm-cli.js continues to use old shebang -# sed "1s^.*^#\!/usr/bin/env node^g" -i ${D}${exec_prefix}/lib/node_modules/npm/bin/npm-cli.js + sed "1s^.*^#\!/usr/bin/env node^g" -i ${D}${exec_prefix}/lib/node_modules/npm/bin/npm-cli.js } do_install_append_class-target() { -# sed "1s^.*^#\!${bindir}/env node^g" -i ${D}${exec_prefix}/lib/node_modules/npm/bin/npm-cli.js + sed "1s^.*^#\!${bindir}/env node^g" -i ${D}${exec_prefix}/lib/node_modules/npm/bin/npm-cli.js } PACKAGES =+ "${PN}-npm" -FILES_${PN}-npm = "${bindir}/npm" +FILES_${PN}-npm = "${exec_prefix}/lib/node_modules/npm ${bindir}/npm" RDEPENDS_${PN}-npm = "bash python-shell python-datetime python-subprocess python-textutils" PACKAGES =+ "${PN}-systemtap" @@ -110,7 +108,7 @@ FILES_${PN}-systemtap = "${datadir}/systemtap" FILES_${PN} += "${systemd_unitdir}/system/nodejs.service \ ${systemd_unitdir}/system/multi-user.target.wants/nodejs.service \ - ${exec_prefix}/lib/node_modules \ + ${exec_prefix}/lib/node_modules \ " BBCLASSEXTEND = "native" diff --git a/meta-tizen-micro/recipes-image/raspberrypi2/rpi-hwup-image-tizen-micro.bb b/meta-tizen-micro/recipes-image/raspberrypi2/rpi-hwup-image-tizen-micro.bb index 004ec78..8a9221e 100755 --- a/meta-tizen-micro/recipes-image/raspberrypi2/rpi-hwup-image-tizen-micro.bb +++ b/meta-tizen-micro/recipes-image/raspberrypi2/rpi-hwup-image-tizen-micro.bb @@ -1,5 +1,6 @@ # Base this image on rpi-hwup-image include recipes-core/images/rpi-hwup-image.bb +include recipes-image/target-image-common.bb CORE_IMAGE_EXTRA_INSTALL += "nodejs" CORE_IMAGE_EXTRA_INSTALL += "nginx" @@ -7,23 +8,3 @@ CORE_IMAGE_EXTRA_INSTALL += "wpa-supplicant wpa-supplicant-cli" CORE_IMAGE_EXTRA_INSTALL += "openssh" CORE_IMAGE_EXTRA_INSTALL += "systemd-serialgetty util-linux-agetty procps" CORE_IMAGE_EXTRA_INSTALL += "v4l2grab" - -# Set root password to "root" -ROOTFS_POSTPROCESS_COMMAND += "set_root_passwd;" -set_root_passwd() { - sed 's%^root:[^:]*:%root:wYNffsf6sozwE:%' \ - < ${IMAGE_ROOTFS}/etc/shadow \ - > ${IMAGE_ROOTFS}/etc/shadow.new; - mv ${IMAGE_ROOTFS}/etc/shadow.new ${IMAGE_ROOTFS}/etc/shadow ; -} - -def get_kernelversion_file(p): - fn = p + '/kernel-abiversion' - - try: - with open(fn, 'r') as f: - return f.readlines()[0].strip() - except IOError: - return None - -STAGING_KERNEL_BUILDDIR = "${TMPDIR}/work-shared/${MACHINE}/kernel-build-artifacts" diff --git a/meta-tizen-micro/recipes-image/target-image-common.bb b/meta-tizen-micro/recipes-image/target-image-common.bb new file mode 100755 index 0000000..e4668f7 --- /dev/null +++ b/meta-tizen-micro/recipes-image/target-image-common.bb @@ -0,0 +1,19 @@ +# Set root password to "root" +ROOTFS_POSTPROCESS_COMMAND += "set_root_passwd;" +set_root_passwd() { + sed 's%^root:[^:]*:%root:wYNffsf6sozwE:%' \ + < ${IMAGE_ROOTFS}/etc/shadow \ + > ${IMAGE_ROOTFS}/etc/shadow.new; + mv ${IMAGE_ROOTFS}/etc/shadow.new ${IMAGE_ROOTFS}/etc/shadow ; +} + +def get_kernelversion_file(p): + fn = p + '/kernel-abiversion' + + try: + with open(fn, 'r') as f: + return f.readlines()[0].strip() + except IOError: + return None + +STAGING_KERNEL_BUILDDIR = "${TMPDIR}/work-shared/${MACHINE}/kernel-build-artifacts" -- 2.7.4