slitaz-arm rev 117
Fish ARM post-install.sh! Everything id configured a nice dialog boxed now (missing language.. it will come in time)
author | Christophe Lincoln <pankso@slitaz.org> |
---|---|
date | Mon Apr 21 02:56:48 2014 +0200 (2014-04-21) |
parents | 3bffab5ac240 |
children | aa159e25968d |
files | rootfs/etc/init.d/post-install.sh |
line diff
1.1 --- a/rootfs/etc/init.d/post-install.sh Mon Apr 21 02:09:15 2014 +0200 1.2 +++ b/rootfs/etc/init.d/post-install.sh Mon Apr 21 02:56:48 2014 +0200 1.3 @@ -6,33 +6,34 @@ 1.4 # 1.5 . /lib/libtaz.sh 1.6 1.7 -# Exit fbs 1.8 +# Be sure fbs is not running 1.9 if [ -f "/fbs.fifo" ]; then 1.10 echo "exit" > /fbs.fifo && rm -f /fbs.fifo 1.11 usleep 500000 1.12 fi 1.13 1.14 # Welcome/About 1.15 -#slitaz-config about_post_install 1.16 +slitaz-config about_post_install 1.17 1.18 -#[ -s /etc/keymap.conf ] || tazkeymap 1.19 +[ -s /etc/keymap.conf ] || tazkeymap 1.20 #[ -s /etc/locale.conf ] || tazlocale 1.21 1.22 -#slitaz-config root_passwd 1.23 -#slitaz-config add_user 1.24 +slitaz-config root_passwd 1.25 +slitaz-config add_user 1.26 #dialog --yesno "$user account was created. Do you want X autologin ?" 1.27 1.28 # Wireless ? 1.29 -#if ifconfig -a | grep "wlan[0-9]"; then 1.30 - #dialog --yesno "\nDo you wish to setup a Wi-Fi network connection ?" 10 72 1.31 - #opt=$? 1.32 - #echo $opt 1.33 - #[ "$?" == "0" ] && slitaz-config wifi_setup 1.34 -#fi 1.35 +if ifconfig -a | grep "wlan[0-9]"; then 1.36 + dialog --title "{ Network config }" \ 1.37 + --yesno "\nDo you wish to setup a Wi-Fi network connection ?" 10 72 1.38 + opt=$? 1.39 + echo $opt 1.40 + [ "$?" == "0" ] && slitaz-config wifi_setup 1.41 +fi 1.42 1.43 # No post install on next boot. 1.44 -#mkdir -p /var/lib/slitaz 1.45 -#echo "$ARCH" > /var/lib/slitaz/post-install 1.46 +mkdir -p /var/lib/slitaz 1.47 +echo "$ARCH" > /var/lib/slitaz/post-install 1.48 1.49 # Run packages post_install since when we generate a distro from 1.50 # an i486 machine we can't chroot and run ARM binaries. If we don't 1.51 @@ -48,14 +49,16 @@ 1.52 db=/var/lib/tazpkg/installed 1.53 installed=$(ls $db | wc -l) 1.54 1.55 - # Get the % alocated for 1 pkg and split % left 1.56 - echo "XXX" && echo 4 1.57 + # Get the % alocated for each pkgs and split % left. We use 4% to 1.58 + # start so 96% is for packages. 1.59 + echo "XXX" && echo 5 1.60 echo -e "\nInstalled packages to check: \Zb\Z2$installed" 1.61 echo "XXX" 1.62 total=$(grep "^post_install" ${db}/*/receipt | wc -l) 1.63 - pkgpct=$((100 / ${total})) 1.64 + pkgpct=$((100 / ${total})) 1.65 left=$((100 - (${pkgpct} * ${total}))) 1.66 split=$((${left} / 2)) 1.67 + [ "$pkgpct" == 0 ] && pkgpct=1 # If too much installed pkgs 1.68 sleep 2 1.69 1.70 # Show pkgs to configure a few sec 1.71 @@ -63,21 +66,27 @@ 1.72 echo -e "\nPackages to configure: \Zb\Z2$total" 1.73 echo "XXX" && sleep 3 1.74 1.75 - # Lets run all thes post_install 1.76 + # Run all these post_install 1.77 pct="$split" 1.78 for pkg in ${db}/* 1.79 do 1.80 - receipt="$installed/$pkg/receipt" 1.81 + receipt="$pkg/receipt" 1.82 [ ! -f "$receipt" ] && continue 1.83 if grep -q ^post_install ${receipt}; then 1.84 - echo -e "\nConfiguring: $pkg" 1.85 + # If we run on a system with <1000 packages... 1.86 + [ "$pct" == 100 ] && pct=0 1.87 + pct=$(($pct + $pkgpct)) 1.88 + echo "XXX" && echo ${pct} 1.89 + echo -e "\nConfiguring: $(basename $pkg)" 1.90 + echo "XXX" 1.91 . ${receipt} 1.92 - #post_install 1.93 - #fi 1.94 + post_install >/dev/null 2>&1 1.95 + #usleep 250000 1.96 + fi 1.97 done 1.98 1.99 echo "XXX" && echo 100 1.100 - echo -e "\nAll packages are configured... exiting" 1.101 + echo -e "\nAll packages are configured..." 1.102 echo "XXX" && sleep 2 1.103 } | dialog --title "{ Packages Post Install }" --colors --gauge "" 8 72 0 1.104