slitaz-tools rev 852
Add doc/post-install.txt and slitaz.config can now add a user and display a welcome post messages (for ARM)
author | Christophe Lincoln <pankso@slitaz.org> |
---|---|
date | Fri Apr 18 14:20:43 2014 +0200 (2014-04-18) |
parents | b5614d25e822 |
children | 59ac61f85a23 |
files | Makefile doc/post-install.txt tinyutils/slitaz-config |
line diff
1.1 --- a/Makefile Fri Apr 18 08:13:02 2014 +0200 1.2 +++ b/Makefile Fri Apr 18 14:20:43 2014 +0200 1.3 @@ -75,7 +75,7 @@ 1.4 install -m 0755 -d $(DESTDIR)/etc 1.5 install -m 0755 -d $(DESTDIR)$(PREFIX)/bin 1.6 install -m 0755 -d $(DESTDIR)$(PREFIX)/sbin 1.7 - install -m 0755 -d $(DESTDIR)$(PREFIX)/share 1.8 + install -m 0755 -d $(DESTDIR)$(PREFIX)$(DOCDIR)/slitaz 1.9 cp -a etc $(DESTDIR)/ 1.10 1.11 # Licenses 1.12 @@ -100,7 +100,7 @@ 1.13 done; 1.14 1.15 # /usr/sbin sound tools. 1.16 - install -m 0755 tinyutils/soundconf $(DESTDIR)$(PREFIX)/sbin 1.17 + #install -m 0755 tinyutils/soundconf $(DESTDIR)$(PREFIX)/sbin 1.18 install -m 0755 tinyutils/setmixer $(DESTDIR)$(PREFIX)/sbin 1.19 1.20 # slitaz-tools i18n 1.21 @@ -110,7 +110,9 @@ 1.22 install -m 0644 po/mo/$$l/slitaz-tools.mo \ 1.23 $(DESTDIR)$(PREFIX)/share/locale/$$l/LC_MESSAGES; \ 1.24 done; 1.25 - 1.26 + 1.27 + # Documentation 1.28 + cp doc/post-install.txt $(DESTDIR)$(PREFIX)$(DOCDIR)/slitaz 1.29 # Permissions 1.30 chmod +x $(DESTDIR)/etc/init.d/* 1.31
2.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 2.2 +++ b/doc/post-install.txt Fri Apr 18 14:20:43 2014 +0200 2.3 @@ -0,0 +1,10 @@ 2.4 + 2.5 +Welcome to SliTaz GNU/Linux post installation setup. To offer 2.6 +the best experience with the distribution you will be asked 2.7 +for basic system settings. 2.8 + 2.9 +SliTaz Config will let you set system keymap, the root password, 2.10 +then add a new user and finally it will configure all packages 2.11 +(it may take a while depending on the installed packages set) 2.12 + 2.13 +SliTaz-config can be run when ever you want from the cmdline.
3.1 --- a/tinyutils/slitaz-config Fri Apr 18 08:13:02 2014 +0200 3.2 +++ b/tinyutils/slitaz-config Fri Apr 18 14:20:43 2014 +0200 3.3 @@ -22,20 +22,50 @@ 3.4 # GUI Functions 3.5 # 3.6 3.7 +about_post_install() { 3.8 + #/usr/share/doc/slitaz/post-install.txt 3.9 + dialog --cr-wrap \ 3.10 + --title "{ Post Installation }" \ 3.11 + --exit-label "Continue" \ 3.12 + --textbox "./tinyutils/post-install.txt" ${height} ${width} 3.13 +} 3.14 + 3.15 # Set root passwd 3.16 root_passwd() { 3.17 - dialog \ 3.18 - --inputbox "Enter new root password:" \ 3.19 - 10 ${width} 2>${tmp} 3.20 + dialog --title "{ Root Password }" \ 3.21 + --inputbox "\nEnter new root password:" \ 3.22 + 12 ${width} 2>${tmp} 3.23 passwd=$(cat $tmp) 3.24 [ "$passwd" == "" ] && return 0 3.25 echo "root:$passwd" | chpasswd --md5 3.26 } 3.27 3.28 +# Add a new user 3.29 +add_user() { 3.30 + title="{ Add User }" 3.31 + dialog --title "$title" \ 3.32 + --inputbox "\nEnter new user name login:" 12 ${width} 2>${tmp} 3.33 + user=$(cat $tmp) 3.34 + [ "$user" == "" ] && return 0 3.35 + dialog --title "$title" \ 3.36 + --inputbox "\nEnter password for $user:" 12 ${width} 2>${tmp} 3.37 + passwd=$(cat $tmp) 3.38 + [ "$passwd" == "" ] && return 0 3.39 + adduser -D -g "SliTaz User" -G users ${user} 3.40 + # User groups 3.41 + for group in audio cdrom video tty; do 3.42 + addgroup ${user} ${group} 3.43 + done 3.44 + # Slim default user on post-install 3.45 + if [ -f "/etc/slim.conf" ] && [ ! -f "/var/lib/slitaz/post-install" ]; then 3.46 + sed -i s"/default_user .*/default_user $user/" /etc/slim.conf 3.47 + fi 3.48 +} 3.49 + 3.50 set_date() { 3.51 clear && newline 3.52 echo -n "Old date:"; date 3.53 - rdate -s 203.129.68.14 2>/dev/null 3.54 + rdate -s tick.greyware.com 2>/dev/null 3.55 echo -n "New date:"; date 3.56 sleep 4 3.57 } 3.58 @@ -48,6 +78,7 @@ 3.59 --menu "" ${height} ${width} 14 \ 3.60 "keyboard" "$(gettext 'System keyboard setting')" \ 3.61 "locale" "$(gettext 'System language setting')" \ 3.62 +"add-user" "$(gettext 'Change root password')" \ 3.63 "root-passwd" "$(gettext 'Change root password')" \ 3.64 "set-date" "$(gettext 'Set system date from the web')" \ 3.65 "quit" "$(gettext 'Exit from SliTaz Config')" 2>${tmp} 3.66 @@ -63,6 +94,7 @@ 3.67 case "$action" in 3.68 keyboard) tazkeymap ;; 3.69 locale) tazlocale ;; 3.70 + add-user) add_user ;; 3.71 root-passwd) root_passwd ;; 3.72 set-date) set_date ;; 3.73 quit) rm -rf ${tmpdir} && exit 0 ;;