2e7281c737701cb9ecff52dd1fbe761efef949b4
[scm/bb/meta-tizen.git] / meta-tizen-common-base / recipes-image / config-image / config-image.bb
1 SUMMARY = "Config image"
2 DESCRIPTION = "This Config image"
3 SECTION = "config"
4 PR = "r1"
5 LICENSE = "MIT"
6 LIC_FILES_CHKSUM ??= "file://${COMMON_LICENSE_DIR}/MIT;md5=0835ade698e0bcf8506ecda2f7b4f302"
7
8 RDEPENDS_${PN} += "weston"
9 RDEPENDS_${PN} += "media-server"
10 RDEPENDS_${PN} += "wrt-widgets"
11 RDEPENDS_${PN} += "avsystem"
12 RDEPENDS_${PN} += "download-provider"
13 RDEPENDS_${PN} += "run-postinsts"
14
15 do_install() {
16   mkdir -p ${D}${sysconfdir}
17   echo "Tizen on Yocto" > ${D}${sysconfdir}/tizen
18   
19   touch ${D}${sysconfdir}/environment
20   chmod 0644 ${D}${sysconfdir}/environment
21   
22   mkdir -p ${D}${sysconfdir}/profile.d
23 cat >${D}${sysconfdir}/profile.d/bash_prompt_custom.sh <<'EOF'
24     # set a fancy prompt (overwrite the one in /etc/profile)
25     default="\[\e[0m\]"
26     usercol='\[\e[1;34m\]' # blue
27     hostcol='\[\e[1;32m\]' # green
28     pathcol='\[\e[1;33m\]' # yellow
29     gitcol='\[\e[1;31m\]' # light red
30     termcmd=''
31     _p="$";
32
33     if [ "`id -u`" -eq 0 ]; then
34         usercol='\[\e[1;31m\]'
35         _p="#"
36     fi
37
38     PS1="${usercol}\u${default}@${hostcol}\h${default}:${pathcol}\w${default}${gitcol}${default}${_p} ${termcmd}"
39
40     alias ll="ls -lZ"
41     alias lr="ls -ltrZ"
42     alias la="ls -alZ"
43
44 EOF
45   
46 }
47
48 pkg_preinst_${PN}() {
49
50     # fix TIVI-2291
51     sed -ri "s/(^blacklist i8042.*$)/#fix from base-general.post \1/" $D/etc/modprobe.d/blacklist.conf
52
53 }
54
55 pkg_postinst_${PN} () {
56   chsmack -t $D${sysconfdir}
57   chsmack -a 'System::Shared' $D${sysconfdir}
58   
59   mkdir -p $D${localstatedir}/volatile/log
60   mkdir -p $D${localstatedir}/volatile/tmp
61   
62   chsmack -t $D${localstatedir}/volatile/log
63   chsmack -a 'System::Log'  $D${localstatedir}/volatile/log
64
65   touch $D${localstatedir}/volatile/log/lastlog
66   touch $D${localstatedir}/volatile/log/faillog
67   touch $D${localstatedir}/volatile/log/wtmp
68   touch $D${localstatedir}/volatile/log/btmp
69   
70   mkdir -p $D${sysconfdir}/profile.d
71   
72   if [ "x$D" != "x" ]; then  
73     cp -fra $D${localstatedir}/log $D${localstatedir}/volatile
74     #cp -fra $D/sbin $D/usr
75     #cp -fra $D/bin  $D/usr
76   
77     #rm -fr $D/lib
78     #rm -fr $D/sbin
79     #rm -fr $D/bin
80     rm -fr $D${localstatedir}/log
81     
82     #ln -s usr/lib  $D/lib
83     #ln -s usr/sbin $D/sbin
84     #ln -s usr/bin  $D/bin
85     ln -s volatile/log  $D${localstatedir}/log
86     
87  fi
88  
89   [ "x$D" != "x" ] && exit 1
90    mkdir -p $D/etc/profile.d
91    chsmack -a System $D/var/lib/buxton/*.db
92    chown -R buxton:buxton $D/var/lib/buxton
93    buxtonctl set-label base vconf User
94    vconftool set -t string db/ail/ail_info "0" -f -s User
95    vconftool set -t string db/menuscreen/desktop "0" -f -s User
96    vconftool set -t string db/menu_widget/language "en_US.utf8" -f -s User
97    chown -R alice:users $D/home/alice
98    chown -R bob:users $D/home/bob
99    chown -R carol:users $D/home/carol
100    chown -R guest:users $D/home/guest
101    source $D/etc/tizen-platform.conf
102    chsmack -a '*' $D/var/lib/buxton || true
103    chsmack -a '*' /var/lib/buxton/* || true
104    chmod 0777 $D/var/lib/buxton || true
105    chmod 0666 $D/var/lib/buxton/* || true
106    ail_initdb
107    pkg_initdb
108    chmod 0600 $D/var/lib/buxton/* || true
109    chmod 0700 $D/var/lib/buxton || true
110    chsmack -a System $D/var/lib/buxton/* || true
111    chsmack -a System $D/var/lib/buxton || true
112    chsmack -a User $D/home/*/.applications/*/*
113    chsmack -a User $D/home/*/.applications/*/.*
114 }
115
116 FILES_${PN} = "${sysconfdir}/tizen \
117                ${sysconfdir}/environment \
118                ${sysconfdir}/profile.d/bash_prompt_custom.sh \
119                "