diff options
| author | Xiaofeng Yan <xiaofeng.yan@windriver.com> | 2010-12-10 16:10:23 +0800 |
|---|---|---|
| committer | Saul Wold <Saul.Wold@intel.com> | 2010-12-10 22:01:39 -0800 |
| commit | bc61818ac096fff071540c174b6660ca31b9ba30 (patch) | |
| tree | 2ccd437b474f6d43e3a177537ebb6e4f7da50588 | |
| parent | aac5f5c7883595e55e35474ec08033444e13f710 (diff) | |
| download | poky-bc61818ac096fff071540c174b6660ca31b9ba30.tar.gz | |
lsbsetup: Set up lsb test environment on target platform
This is a script which uses for setting up lsb test environment and install packages of lsb test suite
[sgw@linux.intel.com: moved the recipe to a more logical location]
Signed-off-by: Xiaofeng Yan<xiaofeng.yan@windriver.com>
Signed-off-by: Saul Wold <sgw@linux.intel.com>
| -rw-r--r-- | meta/recipes-extended/lsb/lsb/LSB_Setup.sh | 197 | ||||
| -rw-r--r-- | meta/recipes-extended/lsb/lsbsetup_0.9.bb | 32 |
2 files changed, 229 insertions, 0 deletions
diff --git a/meta/recipes-extended/lsb/lsb/LSB_Setup.sh b/meta/recipes-extended/lsb/lsb/LSB_Setup.sh new file mode 100644 index 0000000000..4bf7686c2e --- /dev/null +++ b/meta/recipes-extended/lsb/lsb/LSB_Setup.sh | |||
| @@ -0,0 +1,197 @@ | |||
| 1 | #!/bin/bash | ||
| 2 | |||
| 3 | # Copyright (c) 2005-2010 Wind River Systems, Inc. | ||
| 4 | # | ||
| 5 | # This program is free software; you can redistribute it and/or modify | ||
| 6 | # it under the terms of the GNU General Public License version 2 as | ||
| 7 | # published by the Free Software Foundation. | ||
| 8 | # | ||
| 9 | # This program is distributed in the hope that it will be useful, | ||
| 10 | # but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 11 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. | ||
| 12 | # See the GNU General Public License for more details. | ||
| 13 | # | ||
| 14 | # You should have received a copy of the GNU General Public License | ||
| 15 | # along with this program; if not, write to the Free Software | ||
| 16 | # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | ||
| 17 | |||
| 18 | ##Prepare Steps | ||
| 19 | #Steps 0; Confirm the installed LSB Packages | ||
| 20 | |||
| 21 | if [ ! -f /opt/lsb/test/manager/bin/dist-checker-start.pl ] | ||
| 22 | then | ||
| 23 | if [ -d /lsb-dist-testkit ];then | ||
| 24 | cd /lsb-dist-testkit && sh install.sh | ||
| 25 | else | ||
| 26 | echo "Please install the realted LSB Packages" | ||
| 27 | exit 1 | ||
| 28 | fi | ||
| 29 | fi | ||
| 30 | |||
| 31 | #Steps 1; Deleted existed user tester | ||
| 32 | id tester | ||
| 33 | if [ $? -eq 0 ] | ||
| 34 | then | ||
| 35 | echo "User tester was existed" | ||
| 36 | echo -n "Deleted tester(yes/no):" | ||
| 37 | read INPUT | ||
| 38 | case $INPUT in | ||
| 39 | yes|y) | ||
| 40 | sleep 1 | ||
| 41 | userdel -rf tester | ||
| 42 | if [ $? -eq 0 ] || [ $? -eq 6 ] | ||
| 43 | then | ||
| 44 | echo "Success to delete user tester" | ||
| 45 | else | ||
| 46 | echo "Fail to delete user tester" | ||
| 47 | fi | ||
| 48 | ;; | ||
| 49 | no|n) | ||
| 50 | sleep 1 | ||
| 51 | echo "There must be deleted User test before ran LSB4 on Target" | ||
| 52 | echo "" | ||
| 53 | exit 1 | ||
| 54 | ;; | ||
| 55 | *) | ||
| 56 | sleep 1 | ||
| 57 | echo "Input ERROR, pls reinput that your expected" | ||
| 58 | echo "" | ||
| 59 | exit 1 | ||
| 60 | esac | ||
| 61 | else | ||
| 62 | echo "There was not User tester" | ||
| 63 | fi | ||
| 64 | |||
| 65 | ##Funs | ||
| 66 | check () | ||
| 67 | { | ||
| 68 | if [ $? -eq 0 ] | ||
| 69 | then | ||
| 70 | echo "PASS" | ||
| 71 | else | ||
| 72 | echo "FAIL" | ||
| 73 | exit 1 | ||
| 74 | fi | ||
| 75 | } | ||
| 76 | |||
| 77 | ###Start | ||
| 78 | #Step 1:Add tester group | ||
| 79 | echo "" | ||
| 80 | echo "---------------------------------" | ||
| 81 | echo "Step 1:Add Group tester" | ||
| 82 | groupadd tester | ||
| 83 | check | ||
| 84 | |||
| 85 | |||
| 86 | #Step 2:Add User tester | ||
| 87 | echo "" | ||
| 88 | echo "---------------------------------" | ||
| 89 | echo "Step 2:Add User tester" | ||
| 90 | useradd -g tester tester | ||
| 91 | check | ||
| 92 | |||
| 93 | echo "Check the tester user" | ||
| 94 | id tester | ||
| 95 | check | ||
| 96 | |||
| 97 | #Step 3;Stop Boa server | ||
| 98 | #echo "" | ||
| 99 | #echo "---------------------------------" | ||
| 100 | #echo "Step 3:Stop BOA server" | ||
| 101 | #/etc/init.d/boa stop | ||
| 102 | #check | ||
| 103 | |||
| 104 | #Step 4:Create Dirnames file for RPM | ||
| 105 | echo "" | ||
| 106 | echo "---------------------------------" | ||
| 107 | echo "Step 4:Create the Dirnames on target" | ||
| 108 | |||
| 109 | mkdir -pv /etc/rpm/sysinfo | ||
| 110 | |||
| 111 | cat > /etc/rpm/sysinfo/Dirnames << EOF | ||
| 112 | /etc/opt/lsb | ||
| 113 | /home/tet/LSB.tools | ||
| 114 | /opt/lsb-tet3-lite/lib/ksh | ||
| 115 | /opt/lsb-tet3-lite/lib/perl | ||
| 116 | /opt/lsb-tet3-lite/lib/posix_sh | ||
| 117 | /opt/lsb-tet3-lite/lib/tet3 | ||
| 118 | /opt/lsb-tet3-lite/lib/xpg3sh | ||
| 119 | /opt/lsb/appbat/lib/python2.4/site-packages/qm | ||
| 120 | /opt/lsb/appbat/lib/python2.4/site-packages/qm/external | ||
| 121 | /opt/lsb/appbat/lib/python2.4/site-packages/qm/external/DocumentTemplate | ||
| 122 | /opt/lsb/appbat/lib/python2.4/site-packages/qm/test | ||
| 123 | /opt/lsb/appbat/lib/python2.4/site-packages/qm/test/classes | ||
| 124 | /opt/lsb/appbat/lib/python2.4/site-packages/qm/test/web | ||
| 125 | /opt/lsb/test/doc | ||
| 126 | /opt/lsb/test/lib | ||
| 127 | /opt/lsb/test/qm/diagnostics | ||
| 128 | /opt/lsb/test/qm/doc | ||
| 129 | /opt/lsb/test/qm/doc/test/html | ||
| 130 | /opt/lsb/test/qm/doc/test/print | ||
| 131 | /opt/lsb/test/qm/dtml | ||
| 132 | /opt/lsb/test/qm/dtml/test | ||
| 133 | /opt/lsb/test/qm/messages/test | ||
| 134 | /opt/lsb/test/qm/tutorial/test/tdb | ||
| 135 | /opt/lsb/test/qm/tutorial/test/tdb/QMTest | ||
| 136 | /opt/lsb/test/qm/web | ||
| 137 | /opt/lsb/test/qm/web/images | ||
| 138 | /opt/lsb/test/qm/web/stylesheets | ||
| 139 | /opt/lsb/test/qm/xml | ||
| 140 | /opt/lsb/test/share | ||
| 141 | /usr/share/doc/lsb-runtime-test | ||
| 142 | /var/opt/lsb | ||
| 143 | /opt/lsb/test/desktop | ||
| 144 | /opt/lsb/test/desktop/fontconfig | ||
| 145 | /opt/lsb/test/desktop/freetype | ||
| 146 | /opt/lsb/test/desktop/gtkvts | ||
| 147 | /opt/lsb/test/desktop/libpng | ||
| 148 | /opt/lsb/test/desktop/qt3 | ||
| 149 | /opt/lsb/test/desktop/xft | ||
| 150 | /opt/lsb/test/desktop/xml | ||
| 151 | /opt/lsb/test/desktop/xrender | ||
| 152 | |||
| 153 | |||
| 154 | EOF | ||
| 155 | |||
| 156 | if [ -f /etc/rpm/sysinfo/Dirnames ] | ||
| 157 | then | ||
| 158 | echo "Success to creat Dirnames file" | ||
| 159 | else | ||
| 160 | echo "Fail to creat Dirnames file" | ||
| 161 | fi | ||
| 162 | |||
| 163 | #Step 5; | ||
| 164 | echo "" | ||
| 165 | echo "---------------------------------" | ||
| 166 | echo "Step 5:" | ||
| 167 | ldconfig -v | ||
| 168 | check; | ||
| 169 | |||
| 170 | #Step 6; | ||
| 171 | echo "" | ||
| 172 | echo "---------------------------------" | ||
| 173 | echo "Step 6:Check with link to ftp.linux-foundation.org" | ||
| 174 | echo "140.211.169.59 ftp.linux-foundation.org ftp.linuxfoundation.org" >> /etc/hosts | ||
| 175 | |||
| 176 | ping -c 5 ftp.linux-foundation.org | ||
| 177 | check | ||
| 178 | |||
| 179 | #Step 7 | ||
| 180 | if [ -f /lib/modules/*-wr-standard/kernel/drivers/block/loop.ko ];then | ||
| 181 | inmod /lib/modules/*-wr-standard/kernel/drivers/block/loop.ko | ||
| 182 | fi | ||
| 183 | |||
| 184 | #Step 8 | ||
| 185 | echo "" | ||
| 186 | if [ -f /opt/lsb/test/manager/bin/dist-checker-start.pl ];then | ||
| 187 | ./opt/lsb/test/manager/bin/dist-checker-start.pl | ||
| 188 | fi | ||
| 189 | |||
| 190 | |||
| 191 | #Step 9 get ip address for target platform | ||
| 192 | addr=`ifconfig eth0 | grep "inet addr" | awk -F: '{print $2}'|sed s/[[:space:]]Bcast//g` | ||
| 193 | echo -e "you should input ${addr}:8888 on your browse" | ||
| 194 | #Step 8 | ||
| 195 | echo "Done!!" | ||
| 196 | |||
| 197 | ###End | ||
diff --git a/meta/recipes-extended/lsb/lsbsetup_0.9.bb b/meta/recipes-extended/lsb/lsbsetup_0.9.bb new file mode 100644 index 0000000000..f5b40acb8b --- /dev/null +++ b/meta/recipes-extended/lsb/lsbsetup_0.9.bb | |||
| @@ -0,0 +1,32 @@ | |||
| 1 | DESCRIPTION = "auto-setup environment for lsb test" | ||
| 2 | SECTION = "console/utils" | ||
| 3 | PRIORITY = "required" | ||
| 4 | LICENSE = "GPLv2" | ||
| 5 | PR = "r0" | ||
| 6 | |||
| 7 | |||
| 8 | LIC_FILES_CHKSUM = "file://LSB_Setup.sh;md5=c7360d77e08a7f4f2fa66acf28012e7e" | ||
| 9 | |||
| 10 | SRC_URI = "file://LSB_Setup.sh" | ||
| 11 | |||
| 12 | LSBFILE=${POKYBASE}/meta/recipes-extended/lsbsetup/lsb/LSB_Setup.sh | ||
| 13 | |||
| 14 | S=${WORKDIR} | ||
| 15 | |||
| 16 | do_unpack(){ | ||
| 17 | cp ${LSBFILE} ${WORKDIR} | ||
| 18 | } | ||
| 19 | |||
| 20 | |||
| 21 | do_patch(){ | ||
| 22 | : | ||
| 23 | } | ||
| 24 | |||
| 25 | do_configure(){ | ||
| 26 | : | ||
| 27 | } | ||
| 28 | |||
| 29 | do_install(){ | ||
| 30 | mkdir -p ${D}/usr/bin | ||
| 31 | cp ${LSBFILE} ${D}/usr/bin | ||
| 32 | } | ||
