summaryrefslogtreecommitdiffstats
path: root/scripts/creat-lsb-image
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/creat-lsb-image')
-rwxr-xr-xscripts/creat-lsb-image34
1 files changed, 17 insertions, 17 deletions
diff --git a/scripts/creat-lsb-image b/scripts/creat-lsb-image
index 1dc48dd54c..657784cba4 100755
--- a/scripts/creat-lsb-image
+++ b/scripts/creat-lsb-image
@@ -60,14 +60,14 @@ ECHO "Enter directory $IMAGE_PATH"
60cd $IMAGE_PATH 60cd $IMAGE_PATH
61 61
62#get architecture 62#get architecture
63PN=`find . -name poky-image-lsb-${MACHINE_ARCH}\*.rootfs.tar.bz2 -type f | awk -F- 'BEGIN{ max=0;} {if( NR!=0 && $5>max ) max=$5 }END{ printf "%d" ,max ;}'` 63PN=`find . -name core-image-lsb-${MACHINE_ARCH}\*.rootfs.tar.bz2 -type f | awk -F- 'BEGIN{ max=0;} {if( NR!=0 && $5>max ) max=$5 }END{ printf "%d" ,max ;}'`
64if [ "XPN" == "X" ];then 64if [ "XPN" == "X" ];then
65 ECHO "${red}Don't find lsb image on platform, Please run \"poky-image-lsb\" to generate lsb image" 65 ECHO "${red}Don't find lsb image on platform, Please run \"core-image-lsb\" to generate lsb image"
66 exit 1 66 exit 1
67fi 67fi
68 68
69if [ $PN -eq 0 ];then 69if [ $PN -eq 0 ];then
70 ECHO "${red}Can't ${MACHINE_ARCH} rootfs.tar.gz,Please run poky-image-lsb to get lsb image" 70 ECHO "${red}Can't ${MACHINE_ARCH} rootfs.tar.gz,Please run core-image-lsb to get lsb image"
71 exit 1 71 exit 1
72fi 72fi
73#set varible ARCH 73#set varible ARCH
@@ -125,25 +125,25 @@ else
125 ECHO "Can't find lsb test suite for ${MACHINE_ARCH}" 125 ECHO "Can't find lsb test suite for ${MACHINE_ARCH}"
126fi 126fi
127cd .. 127cd ..
128if [ -L poky-image-lsb-${MACHINE_ARCH}.ext3 ];then 128if [ -L core-image-lsb-${MACHINE_ARCH}.ext3 ];then
129 /bin/rm poky-image-lsb-${MACHINE_ARCH}.ext3 129 /bin/rm core-image-lsb-${MACHINE_ARCH}.ext3
130 exit_check 130 exit_check
131fi 131fi
132 132
133#creat lsb image 133#creat lsb image
134if [ -f poky-image-lsb-${MACHINE_ARCH}-test.ext3 ];then 134if [ -f core-image-lsb-${MACHINE_ARCH}-test.ext3 ];then
135 if [ -d lsbtmp ];then 135 if [ -d lsbtmp ];then
136 sudo umount lsbtmp 136 sudo umount lsbtmp
137 fi 137 fi
138 ECHO "Remove old lsb image..." 138 ECHO "Remove old lsb image..."
139 /bin/rm poky-image-lsb-${MACHINE_ARCH}-test.ext3 139 /bin/rm core-image-lsb-${MACHINE_ARCH}-test.ext3
140fi 140fi
141ECHO "creat a big ext3 file for lsb image with 5G..." 141ECHO "creat a big ext3 file for lsb image with 5G..."
142dd if=/dev/zero of=poky-image-lsb-${MACHINE_ARCH}-test.ext3 bs=1M count=5000 142dd if=/dev/zero of=core-image-lsb-${MACHINE_ARCH}-test.ext3 bs=1M count=5000
143exit_check 143exit_check
144ECHO "Format ext3 image,please input \"y\"" 144ECHO "Format ext3 image,please input \"y\""
145mkfs.ext3 poky-image-lsb-${MACHINE_ARCH}-test.ext3 145mkfs.ext3 core-image-lsb-${MACHINE_ARCH}-test.ext3
146tune2fs -j poky-image-lsb-${MACHINE_ARCH}-test.ext3 146tune2fs -j core-image-lsb-${MACHINE_ARCH}-test.ext3
147 147
148 148
149ECHO "get a lsb image with lsb test suite" 149ECHO "get a lsb image with lsb test suite"
@@ -153,11 +153,11 @@ fi
153 153
154 154
155#install file system and lsb test suite to lsb image 155#install file system and lsb test suite to lsb image
156sudo mount -o loop poky-image-lsb-${MACHINE_ARCH}-test.ext3 lsbtmp 156sudo mount -o loop core-image-lsb-${MACHINE_ARCH}-test.ext3 lsbtmp
157exit_check 157exit_check
158 158
159ECHO " ->Install file system..." 159ECHO " ->Install file system..."
160sudo tar jxf poky-image-lsb-${MACHINE_ARCH}-${PN}.rootfs.tar.bz2 -C lsbtmp 160sudo tar jxf core-image-lsb-${MACHINE_ARCH}-${PN}.rootfs.tar.bz2 -C lsbtmp
161exit_check 161exit_check
162 162
163ECHO " ->Install lsb test suite..." 163ECHO " ->Install lsb test suite..."
@@ -181,18 +181,18 @@ exit_check
181sudo rm -rf lsbtmp 181sudo rm -rf lsbtmp
182 182
183#change file attribute 183#change file attribute
184sudo chown ${USER}:${USER} poky-image-lsb-${MACHINE_ARCH}-test.ext3 184sudo chown ${USER}:${USER} core-image-lsb-${MACHINE_ARCH}-test.ext3
185exit_check 185exit_check
186sudo chmod 755 poky-image-lsb-${MACHINE_ARCH}-test.ext3 186sudo chmod 755 core-image-lsb-${MACHINE_ARCH}-test.ext3
187exit_check 187exit_check
188 188
189#set up link 189#set up link
190if [ -L poky-image-lsb-${MACHINE_ARCH}.ext3 ];then 190if [ -L core-image-lsb-${MACHINE_ARCH}.ext3 ];then
191ECHO "Set up link" 191ECHO "Set up link"
192 /bin/rm poky-image-lsb-${MACHINE_ARCH}.ext3 192 /bin/rm core-image-lsb-${MACHINE_ARCH}.ext3
193 exit_check 193 exit_check
194fi 194fi
195ln -s poky-image-lsb-${MACHINE_ARCH}-test.ext3 poky-image-lsb-${MACHINE_ARCH}.ext3 195ln -s core-image-lsb-${MACHINE_ARCH}-test.ext3 core-image-lsb-${MACHINE_ARCH}.ext3
196 196
197ECHO "LSB test environment is set successfully, Please run this image on platform ${MACHINE_ARCH}" 197ECHO "LSB test environment is set successfully, Please run this image on platform ${MACHINE_ARCH}"
198 198