TIVI-979:Add postscript to create root dir
[profile/ivi/image-configurations.git] / custom / scripts / ivi-2.0-symlinks.post
1 # to make udev happy
2 ln -sf /bin/busybox /sbin/blkid
3
4 # where in the world is xinitrc?
5 ln -sf /etc/X11/xinitrc /usr/etc/X11/xinitrc
6
7 # inittab hack to fix console - UI switching
8 sed -ri 's/--noclear tty1/tty3/' /etc/inittab
9 sed -ri 's/tty2/tty4/' /etc/inittab
10
11 # modprobe fuse for sqlfs-mount
12 /bin/sed -i "3i /sbin/modprobe fuse || :" /etc/rc.d/init.d/sqlfs-mount 
13
14 if [ -d /etc/init.d ]; then
15     cp /etc/init.d/* /etc/rc.d/init.d/ -rdf
16 fi
17 rm -rf /etc/init.d*
18 ln -sf /etc/rc.d/init.d /etc/init.d
19
20 rm -rf /etc/localtime  
21 ln -sf /opt/etc/localtime /etc/localtime  
22
23 # Without this line the rpm doesn't get the architecture right.
24 # echo -n 'armv7l-tizen-linux' > /etc/rpm/platform
25 > /etc/rpm/platform
26
27 ssh-keygen -t rsa1 -f /etc/ssh/ssh_host_key -N ""
28 ssh-keygen -t dsa -f /etc/ssh/ssh_host_dsa_key -N ""
29 ssh-keygen -t rsa -f /etc/ssh/ssh_host_rsa_key -N ""
30
31 pkg_initdb
32
33 rm -fr /opt/dbspace/.app_info.*
34 INITDB=1 ail_initdb
35
36 # ims-service domain setting
37 RESULT=`grep "192.168.0.163 config.45001.rcse" /etc/hosts`  
38 if [ -z "$RESULT" ]; then  
39     echo "Set domain for auto configuration"  
40     echo "192.168.0.163 config.45001.rcse" >> /etc/hosts  
41 else  
42     echo "Already setted domain for test auto configuration"  
43 fi  
44 # ims-service domain setting
45
46 cat > /usr/bin/press << EOF
47 #!/bin/sh
48
49 JUNK="SLP"
50
51 [ "\$1" ] && TIMEOUT="\$1" || TIMEOUT="1"
52
53 echo "Press return key to stop scripts"
54 read -t \$TIMEOUT JUNK
55 exit \$?
56 EOF
57 chmod +x /usr/bin/press
58
59 ln -s /opt/etc/X11/xkb /usr/share/X11
60 ln -s /home/app /opt/home/app
61 ln -s /home/developer /opt/home/developer
62
63 echo "UDEV_PERSISTENT_STORAGE=no" >> /etc/sysconfig/udev
64
65 rm -rf /usr/share/man
66 rm -rf /usr/share/doc
67
68 ldconfig
69
70 mkdir -p /opt/var/lib/dbus
71
72 rm -f /var/lib/rpm/__db*
73 mv -f /var/lib/rpm /opt/var/lib/ 
74 ln -sf /opt/var/lib/rpm /var/lib/rpm
75 rpmdb --rebuilddb
76
77 if [ -e /usr/bin/build-backup-data.sh ]; then
78            /usr/bin/build-backup-data.sh
79 fi