slitaz-arm view rootfs/etc/init.d/post-install.sh @ rev 128
Fix LD_LIBRARY_PATH for /opt/vc (video core) tools and small typos
author | Christophe Lincoln <pankso@slitaz.org> |
---|---|
date | Tue Apr 22 00:05:15 2014 +0200 (2014-04-22) |
parents | 73088f03f824 |
children | 45bca87a4ab8 |
line source
1 #!/bin/sh
2 #
3 # /etc/init.d/post-install.sh: SliTaz ARM post installation script
4 #
5 # Copyright (C) 2014 SliTaz ARM - BSD License
6 #
7 . /lib/libtaz.sh
9 # Be sure fbs is not running
10 if [ -f "/fbs.fifo" ]; then
11 echo "exit" > /fbs.fifo && rm -f /fbs.fifo
12 usleep 500000
13 fi
15 # Welcome/About
16 slitaz-config about_post_install
18 [ -s /etc/keymap.conf ] || tazkeymap
19 #[ -s /etc/locale.conf ] || tazlocale
21 slitaz-config root_passwd
22 slitaz-config add_user
23 #dialog --yesno "$user account was created. Do you want X autologin ?"
25 # Wireless ?
26 if ifconfig -a | grep "wlan[0-9]"; then
27 dialog --title "{ Network config }" \
28 --yesno "\nDo you wish to setup a Wi-Fi network connection ?" 10 72
29 [ "$?" == "0" ] && slitaz-config wifi_setup
30 fi
32 # No post install on next boot.
33 mkdir -p /var/lib/slitaz
34 echo "$ARCH" > /var/lib/slitaz/post-install
36 # Run packages post_install since when we generate a distro from
37 # an i486 machine we can't chroot and run ARM binaries. If we don't
38 # run some post_install we will miss gtk icon, pango modules, etc...
39 # Keep it here since reconf can be run from cmdline and advanced users.
40 # Anyway, after this post install is finished everything will be handled
41 # by spk or tazpkg.
42 #
43 {
44 echo "XXX" && echo 0
45 echo -e "\nPreparing packages config...\n"
46 echo "XXX" && sleep 1
47 db=/var/lib/tazpkg/installed
48 installed=$(ls $db | wc -l)
50 # Get the % allocated for each pkgs and split % left. We use 4% to
51 # start so 96% is for packages.
52 echo "XXX" && echo 5
53 echo -e "\nInstalled packages to check: \Zb\Z2$installed"
54 echo "XXX"
55 total=$(grep "^post_install" ${db}/*/receipt | wc -l)
56 pkgpct=$((100 / ${total}))
57 left=$((100 - (${pkgpct} * ${total})))
58 split=$((${left} / 2))
59 [ "$pkgpct" == 0 ] && pkgpct=1 # If too much installed pkgs
60 sleep 2
62 # Show pkgs to configure a few secs
63 echo "XXX" && echo ${split}
64 echo -e "\nPackages to configure: \Zb\Z2$total"
65 echo "XXX" && sleep 3
67 # Run all these post_install
68 pct="$split"
69 for pkg in ${db}/*
70 do
71 receipt="$pkg/receipt"
72 [ ! -f "$receipt" ] && continue
73 if grep -q ^post_install ${receipt}; then
74 # If we run on a system with <1000 packages...
75 [ "$pct" == 100 ] && pct=0
76 pct=$(($pct + $pkgpct))
77 echo "XXX" && echo ${pct}
78 echo -e "\nConfiguring: $(basename $pkg)"
79 echo "XXX"
80 . ${receipt}
81 post_install >/dev/null 2>&1
82 #usleep 250000
83 fi
84 done
86 echo "XXX" && echo 100
87 echo -e "\nAll packages are configured..."
88 echo "XXX" && sleep 2
89 } | dialog --title "{ Packages Post Install }" --colors --gauge "" 8 72 0
91 exit 0