change repo data to NanJing local
[tools/itest-cases-mic.git] / fixtures / ks_files / qcow_image.ks
1 # -*-mic2-options-*- -f qcow  --copy-kernel -*-mic2-options-*-
2
3
4 # Do not Edit! Generated by:
5 # kickstarter.py
6
7
8 lang en_US.UTF-8
9 keyboard us
10 timezone --utc America/Los_Angeles
11 part / --fstype="ext4" --size=3584 --ondisk=sda --active --label emulimg-3.0 --fsoptions=defaults,noatime
12
13 rootpw tizen 
14 xconfig --startxonboot
15 bootloader  --timeout=3  --append="rw vga=current splash rootwait rootfstype=ext4 plymouth.enable=0"   --ptable=gpt --menus="install:Wipe and Install:systemd.unit=system-installer.service:test"
16
17 desktop --autologinuser=guest
18 user --name guest  --groups audio,video --password 'tizen'
19
20
21 repo --name=common-emulator-wayland_i586 --baseurl=http://109.123.123.185/repo/download.tizen.org/releases/daily/tizen/common/latest/repos/emulator32-wayland/packages/ --ssl_verify=no
22
23 %packages
24
25 @Generic Base
26 @Common Base
27 @Generic Console Tools
28 @Generic Packaging
29 @Common Packaging
30 @Generic Adaptation
31 @Generic Wayland
32 @Common Wayland
33 @Generic Middleware
34 @Common Middleware
35 @Generic Applications
36 @Generic Bluetooth
37 @Generic Multimedia
38 @Generic Desktop Applications
39 @Common Desktop Applications
40 @Generic Crosswalk
41 @Common Crosswalk
42 @Generic Qt5
43 @Common Qt5
44 @Generic Multimedia Intel
45
46 kernel-profile-common
47
48 sdbd
49 system-plugin-emulator
50 %end
51
52
53
54 %post
55 #!/bin/sh
56 echo "#################### generic-base.post ####################"
57
58 # setup systemd default target for user session
59 cat <<'EOF' >>/lib/systemd/user/default.target
60 [Unit]
61 Description=User session default target
62 EOF
63 mkdir -p /lib/systemd/user/default.target.wants
64
65 # start dbus session
66 ln -s ../dbus.service /lib/systemd/user/default.target.wants/
67
68 # Run prelink to speed up dynamic binary/library loading
69 /usr/sbin/prelink --all
70
71 ln -sf /proc/self/mounts /etc/mtab
72
73 # sdx: fix smack labels on /var/log
74 chsmack -a '*' /var/log
75
76 # workaround for bug PTREL-763
77 patch -b -p1 -d/ <<'EOF'
78 --- bad/etc/pam.d/systemd-user 2014-03-20 10:01:36.657843073 +0100
79 +++ good/etc/pam.d/systemd-user 2014-03-20 10:06:51.586121696 +0100
80 @@ -4,5 +4,6 @@
81  
82  account include system-auth
83  session include system-auth
84 +session required pam_systemd.so
85  auth required pam_deny.so
86  password required pam_deny.so
87 EOF
88
89 # create appfw dirs inside homes
90 function generic_base_user_exists() {
91         user=$1
92         getent passwd | grep -q ^${user}:
93 }
94
95 function generic_base_user_home() {
96         user=$1
97         getent passwd | grep ^${user}: | cut -f6 -d':'
98 }
99
100 function generic_base_fix_user_homedir() {
101         user=$1
102         generic_base_user_exists $user || return 1
103
104         homedir=$(generic_base_user_home $user)
105         mkdir -p $homedir/app_rw
106         for appdir in desktop manifest dbspace; do
107                 mkdir -p $homedir/.applications/$appdir
108         done
109         find $homedir -type d -exec chsmack -a User {} \;
110         chown -R $user:users $homedir
111         return 0
112 }
113
114 #!/bin/sh
115 echo "############### common-base.post ################"
116
117 ######### multiuser mode: create additional users and fix their homedirs
118 tizen_crypted_pass=$(perl -e 'print crypt("tizen", "aa")')
119 uid=5001
120
121 for user in alice bob carol guest; do
122         if ! generic_base_user_exists $user; then
123                 useradd -u $uid -d /home/$user -g users -G audio,video,users,display -m --password "$tizen_crypted_pass" $user
124                 uid=$(( $uid + 1 ))
125         fi
126
127         generic_base_fix_user_homedir $user
128 done
129
130
131
132
133 #!/bin/sh
134 echo "#################### generic-console-tools.post ####################"
135
136 # customize bash prompt
137 cat >/etc/profile.d/bash_prompt_custom.sh <<'EOF'
138 if [ "$PS1" ]; then
139
140         function proml {
141                 # set a fancy prompt (overwrite the one in /etc/profile)
142                 local default="\[\e[0m\]"
143                 local usercol='\[\e[1;34m\]' # blue
144                 local hostcol='\[\e[1;32m\]' # green
145                 local pathcol='\[\e[1;33m\]' # yellow
146                 local gitcol='\[\e[1;31m\]' # light red
147                 local termcmd=''
148                 local _p="$";
149
150                 if [ "`id -u`" -eq 0 ]; then
151                         usercol='\[\e[1;31m\]'
152                         _p="#"
153                 fi
154
155                 PS1="${usercol}\u${default}@${hostcol}\h${default}:${pathcol}\w${default}${gitcol}${default}${_p} ${termcmd}"
156         }
157
158         proml
159
160         function rcd () {
161       [ "${1:0:1}" == "/" ] && { cd $1; } || { cd $(pwd -P)/$1; }
162    }
163
164         alias ll="ls -lZ"
165         alias lr="ls -ltrZ"
166         alias la="ls -alZ"
167
168         function get_manifest () {
169                 rpm -qa --queryformat="%{name} %{Version} %{Release} %{VCS}\n" | sort
170         }
171 fi
172 EOF
173
174
175 #!/bin/sh
176 echo "#################### generic-packaging.post ####################"
177
178 rm -rf /root/.zypp
179
180 # was: rpm.post
181 rm -f /var/lib/rpm/__db*
182 rpmdb --rebuilddb
183
184
185 #!/bin/sh
186 echo "############### common-packaging.post ################"
187
188 # generate repo files for zypper
189 function genrepo() {
190         local url=$1
191         local reponame=$2
192         local filename=${3:-$2}
193         local enabled=${4:-0}
194
195         local prefix=${TZ_BUILD_VENDOR}-${TZ_BUILD_PROFILE}-${TZ_BUILD_REPO}
196
197         # remove double slashes if any
198         url=$(sed -e  's|/\+|/|g' -e 's|:/|://|' <<<$url)
199
200         cat >> /etc/zypp/repos.d/$prefix-${filename}.repo << EOF
201 [$prefix-${reponame}]
202 name=$prefix-${reponame}
203 enabled=$enabled
204 autorefresh=0
205 baseurl=${url}?ssl_verify=no
206 type=rpm-md
207 gpgcheck=0
208  
209 EOF
210 }
211
212 # source /etc/tizen-build.conf to get more infos about project, repos etc.
213 . /etc/tizen-build.conf 
214
215 # adjust build_id if this scripts executes before the replacement in /etc/tizen-build.conf
216 TZ_BUILD_ID=$(echo $TZ_BUILD_ID | sed 's|@BUILD_ID[@]|tizen-common_20141118.1|')
217
218 # snapshot repo
219 genrepo ${TZ_BUILD_SNAPSHOT_URL}/${TZ_BUILD_ID}/repos/${TZ_BUILD_REPO}/packages snapshot snapshot 1
220 genrepo ${TZ_BUILD_SNAPSHOT_URL}/${TZ_BUILD_ID}/repos/${TZ_BUILD_REPO}/debug snapshot-debug snapshot 1
221
222 # latest repo
223 genrepo ${TZ_BUILD_SNAPSHOT_URL}/latest/repos/${TZ_BUILD_REPO}/packages update update 0
224 genrepo ${TZ_BUILD_SNAPSHOT_URL}/latest/repos/${TZ_BUILD_REPO}/debug update-debug update 0
225
226 # daily repo
227 genrepo ${TZ_BUILD_DAILY_URL}/latest/repos/${TZ_BUILD_REPO}/packages daily daily 0
228 genrepo ${TZ_BUILD_DAILY_URL}/latest/repos/${TZ_BUILD_REPO}/debug daily-debug daily 0
229
230 # weekly repo
231 genrepo ${TZ_BUILD_WEEKLY_URL}/latest/repos/${TZ_BUILD_REPO}/packages weekly weekly 0
232 genrepo ${TZ_BUILD_WEEKLY_URL}/latest/repos/${TZ_BUILD_REPO}/debug weekly-debug weekly 0
233
234
235 #!/bin/sh
236 echo "#################### generic-adaptation.post ####################"
237
238 # fix TIVI-2291
239 sed -ri "s/(^blacklist i8042.*$)/#fix from base-general.post \1/" /etc/modprobe.d/blacklist.conf
240
241
242 #!/bin/sh
243 echo "#################### generic-wayland.post ####################"
244
245
246 #!/bin/sh
247 echo "#################### common-wayland.post ##################"
248
249 # add users to display group
250 for user in alice bob carol guest; do
251         if generic_base_user_exists $user; then
252                 /usr/sbin/groupmod -A $user display
253         fi
254 done
255
256 # Enable a logind session for users on seat0 (the default seat for
257 # graphical sessions)
258 unitdir=/usr/lib/systemd/system
259 mkdir -p $unitdir/graphical.target.wants
260 for user in alice bob carol guest; do
261         generic_base_user_exists $user || continue
262         uid=$(getent passwd $user|cut -f3 -d':')
263         ln -s ../user-session-launch@.service $unitdir/graphical.target.wants/user-session-launch@seat0-$uid.service
264 done
265
266 # user sessions must start after graphical target
267 patch -b -p1 -d/ <<'EOF'
268 --- /lib/systemd/system/user-session-launch@.service.orig       2014-03-17 17:50:18.000000000 -0700
269 +++ /lib/systemd/system/user-session-launch@.service    2014-04-15 06:03:45.555682575 -0700
270 @@ -1,7 +1,7 @@
271  [Unit]
272  Description=User Session Launcher
273 -After=systemd-user-sessions.service systemd-logind.service
274 -Requires=systemd-logind.service
275 +After=systemd-user-sessions.service systemd-logind.service display-manager.path
276 +Requires=systemd-logind.service display-manager.path
277  
278  [Service]
279  ExecStart=/usr/bin/user-session-launch %i
280 EOF
281
282 # clean weston target inside user session (installed by weston)
283 rm -f /usr/lib/systemd/user/weston.target
284
285
286 #{ Add installed apps for tizen to launcher if not present
287 dst="/usr/share/applications/tizen/launcher.conf"
288
289 if [ -w "$dst" ] ; then
290    ls /usr/share/applications/tizen/*.desktop \
291    | while read src; do
292         grep "$src" "$dst" \
293             || { [ ! -r "$src" ] || echo "$src" >> "$dst" ; }
294
295     done
296 fi
297
298 #}
299
300 # tag the background image with the current snapshot id
301 arch=$(rpm -qa | grep kernel-common | awk -F- '{printf("%s %s",$3,$4);}')
302 /usr/bin/mark_image.py /usr/share/backgrounds/tizen/current "Tizen Common: tizen-common_20141118.1 $arch" ffffff 50 90 95 95
303
304
305 #!/bin/sh
306 echo "#################### generic-middleware.post ####################"
307
308
309 #!/bin/sh
310 echo "############### common-middleware.post ################"
311
312
313 #!/bin/sh
314 echo "#################### generic-applications.post ####################"
315
316
317 #!/bin/sh
318 echo "#################### generic-bluetooth.post ####################"
319
320
321 #!/bin/sh
322 echo "#################### generic-multimedia.post ####################"
323
324
325 #!/bin/sh
326 echo "#################### generic-desktop-applications.post ####################"
327
328 # temp workaround to fill each user app_info database with global db infos
329 . /etc/tizen-platform.conf
330 ail_initdb
331 pkg_initdb
332
333 # depends on generic-base functions
334 function generic_desktop_applications_fix_userhome() {
335         user=$1
336
337         generic_base_user_exists $user || return 1
338         homedir=$(generic_base_user_home $user)
339         
340         echo "Fix app_info.db of $user"
341         chown -R $user:users $homedir/.applications/dbspace/
342 }
343
344
345
346 #!/bin/sh
347 echo "############### common-desktop-applications.post ################"
348
349 # call function defined in meta-generic
350 for user in alice bob carol guest; do
351         generic_desktop_applications_fix_userhome $user
352 done
353
354
355
356 #!/bin/sh
357 echo "#################### generic-crosswalk.post ####################"
358
359 # make crosswak start in user session (default target)
360 mkdir -p /lib/systemd/user/default.target.wants/
361 ln -s ../xwalk.service /lib/systemd/user/default.target.wants/
362
363
364
365 #!/bin/sh
366 echo "############### common-crosswalk.post ################"
367
368 # start wrt widgets preinstall
369 prepare_widgets.sh
370
371
372 #!/bin/sh
373 echo "#################### generic-qt5.post ####################"
374
375
376 #!/bin/sh
377 echo "############### common-qt5.post ################"
378
379 list='
380 qt5-qtdeclarative-examples
381 qt5-cinematic-experience
382 '
383
384 dst="/usr/share/applications/tizen/launcher.conf"
385
386 if [ -w "$dst" ] ; then
387     for app in $list ; do
388         src="/usr/share/applications/$app.desktop"
389
390         grep "$src" "$dst" \
391             || { [ ! -r "$src" ] || echo "$src" >> "$dst" ; }
392
393     done
394 fi
395
396 #!/bin/sh
397 echo "#################### generic-multimedia-intel.post ####################"
398
399
400
401 %end
402
403 %post --nochroot
404 ####################### buildname.nochroot #######################
405 if [ -n "$IMG_NAME" ]; then
406         echo "BUILD_ID=$IMG_NAME" >> $INSTALL_ROOT/etc/tizen-release
407         echo "BUILD_ID=$IMG_NAME" >> $INSTALL_ROOT/etc/os-release
408         echo "$IMG_NAME tizen-common_20141118.1" >>$INSTALL_ROOT/etc/tizen-snapshot
409
410         sed -ri \
411                 -e 's|@BUILD_ID[@]|tizen-common_20141118.1|g' \
412                 -e "s|@BUILD_DATE[@]|$(date +%Y%m%d_%H%M%S)|g" \
413                 $INSTALL_ROOT/etc/tizen-build.conf
414 fi
415
416
417 %end