# HG changeset patch # User Dominique Corbex # Date 1311588198 -7200 # Node ID a339d32404958bf0d43674fbfa7d6cdd6c914d23 # Parent b28d4a6bf467ab0811d0d2195be07077a7d1f79a tazinst: showurl+check commands added diff -r b28d4a6bf467 -r a339d3240495 doc/tazinst.en.html --- a/doc/tazinst.en.html Wed Jul 20 15:29:22 2011 +0200 +++ b/doc/tazinst.en.html Mon Jul 25 12:03:18 2011 +0200 @@ -72,32 +72,32 @@
    -
  1. * INST_TYPE : the type of media containing +
  2. * INST_TYPE: the type of media containing the SliTaz source files, either: cdrom (SliTaz LiveCD), usb (SliTaz LiveUSB), iso (ISO image of SliTaz), web (ISO image on the Web), - weboot, ex : INST_TYPE=web
    + weboot, ex: INST_TYPE=web
  3. -
  4. * SRC_FILE : the name of the source file containing +
  5. * SRC_FILE: the name of the source file containing SliTaz. It depends on the type of support:
      -
    • cdrom (SliTaz LiveCD) : +
    • cdrom (SliTaz LiveCD): unused
    • -
    • usb (SliTaz LiveUSB) : name of the - partition on the host USB device, ex : SRC_FILE=/dev/sdb1 +
    • usb (SliTaz LiveUSB): name of the + partition on the host USB device, ex: SRC_FILE=/dev/sdb1
    • -
    • iso (ISO image of SliTaz) : name of the - ISO file, ex : SRC_FILE=~/slitaz.3.0.iso
      +
    • iso (ISO image of SliTaz): name of the + ISO file, ex: SRC_FILE=~/slitaz.3.0.iso
    • -
    • web (ISO image on the Web) : name of the - URL, ex : +
    • web (ISO image on the Web): name of the + URL, ex: SRC_FILE=http://mirror.slitaz.org/iso/cooking/slitaz-cooking.iso. - Note that 3 URLs are predefined: 'stable', 'cooking, 'rolling', ex : + Note that 3 URLs are predefined: 'stable', 'cooking, 'rolling', ex: SRC_FILE=cooking downloads the latest cooking available from the web
    • -
    • weboot : unused
    • +
    • weboot: unused
@@ -109,22 +109,22 @@
    -
  1. * TGT_PARTITION : the name of the target - partition SliTaz will install to or update, ex : TGT_PARTITION= +
  2. * TGT_PARTITION: the name of the target + partition SliTaz will install to or update, ex: TGT_PARTITION= /dev/hda3
  3. -
  4. TGT_FS : if this variable is entered, the +
  5. TGT_FS: if this variable is entered, the target partition will be formatted in the file system specified, otherwise - the partition will be cleaned and /home will be preserved, ex : + the partition will be cleaned and /home will be preserved, ex: TGT_FS=ext3
  6. -
  7. TGT_HOME : this variable indicates if need - be, the name of the partition to receive the /home directory, ex : +
  8. TGT_HOME: this variable indicates if need + be, the name of the partition to receive the /home directory, ex: TGT_HOME=/dev/hda5
  9. -
  10. TGT_HOME_FS : if this variable is entered, +
  11. TGT_HOME_FS: if this variable is entered, the home partition will be formatted in the file system specified, - ex : TGT_HOME_FS=ext2
    + ex: TGT_HOME_FS=ext2
@@ -135,19 +135,19 @@
    -
  1. TGT_HOSTNAME : name of the system, ex : +
  2. TGT_HOSTNAME: name of the system, ex: TGT_HOSTNAME=hd-slitaz, by default TGT_HOSTNAME=slitaz
  3. -
  4. TGT_ROOT_PWD : superuser password, ex : +
  5. TGT_ROOT_PWD: superuser password, ex: TGT_ROOT_PWD=toor, by default TGT_ROOT_PWD=root
  6. -
  7. TGT_USER : user name, - ex : TGT_USER=toto, by default TGT_USER=tux
    +
  8. TGT_USER: user name, + ex: TGT_USER=toto, by default TGT_USER=tux
  9. -
  10. TGT_USER_PWD : user password, - ex : TGT_USER_PWD=titi, by default +
  11. TGT_USER_PWD: user password, + ex: TGT_USER_PWD=titi, by default TGT_USER_PWD=tux
@@ -158,20 +158,14 @@
    -
  1. TGT_GRUB : install the GRUB bootloader (yes or no), ex : +
  2. TGT_GRUB: install the GRUB bootloader (yes or no), ex: TGT_GRUB=yes, by default TGT_GRUB=no
  3. -
  4. TGT_MENU_PARTITION : name of the partition - where the GRUB configuration file is installed. Normally, this variable is not - set, it can be used if GRUB is installed to a dedicated partition, or in a - multi-os configuration, - ex : TGT_MENU_PARTITION=/dev/hda4
    -
  5. -
  6. TGT_WINBOOT : if this variable is entered, +
  7. TGT_WINBOOT: if this variable is entered, it indicates the partition containing Windows© to implement a dual-boot. It can also be set to 'auto', in this case the dual-boot will be on the first partition Windows© detected, - ex : TGT_WINBOOT=auto
    + ex: TGT_WINBOOT=auto
@@ -204,6 +198,27 @@ tazinst upgrade /var/lib/tazinst.conf + +

showurl

+

Display the full URL of the predefined shortcuts: 'stable', 'cooking, 'rolling'.

+

You may overwrite these shortcuts in /etc/slitaz/tazinst.conf:

+
    +
  • URL_STABLE="http://mirror.slitaz.org/iso/stable/slitaz...." for 'stable'
  • +
  • URL_COOKING="http://mirror.slitaz.org/iso/cooking/slitaz..." for 'cooking'
  • +
  • URL_ROLLING="http://mirror.slitaz.org/iso/rolling/slitaz..." for 'rolling'
  • +
+
+tazinst showurl stable
+
+ + +

check

+

Check a configuration file for errors.

+
+tazinst check /var/lib/tazinst.conf
+
+ +

MAINTAINERS

Christophe Lincoln <pankso at slitaz.org>
diff -r b28d4a6bf467 -r a339d3240495 installer/README --- a/installer/README Wed Jul 20 15:29:22 2011 +0200 +++ b/installer/README Mon Jul 25 12:03:18 2011 +0200 @@ -34,4 +34,4 @@ $ make msgmerge -================================================================================ \ No newline at end of file +================================================================================ diff -r b28d4a6bf467 -r a339d3240495 installer/tazinst --- a/installer/tazinst Wed Jul 20 15:29:22 2011 +0200 +++ b/installer/tazinst Mon Jul 25 12:03:18 2011 +0200 @@ -1,5 +1,5 @@ #!/bin/sh -# slitaz-installer - SliTaz GNU/Linux installer. +# tazinst - SliTaz GNU/Linux installer. # # So this is the SliTaz installer. The script starts with a # few main variables, then all the functions and then the @@ -10,16 +10,16 @@ # Authors : Christophe Lincoln # Dominique Corbex # -# Exit codes +# Exit codes: # 1: Parameters error # 2: Configuration file error # 3: Source error # 4: Cancelled by user # 5: Target partition error -# 6: No SliTaz system to upgrade found +# 6: SliTaz system to upgrade not found # 8: Internal error -VERSION=3.01 +VERSION=3.10 # Internationalization . /usr/bin/gettext.sh @@ -39,17 +39,22 @@ URL_COOKING="http://mirror.slitaz.org/iso/cooking/slitaz-cooking.iso" URL_ROLLING="http://mirror.slitaz.org/iso/rolling/slitaz-core.iso" +# Config +[ -r /etc/slitaz/tazinst.conf ] && . /etc/slitaz/tazinst.conf + # Print a short help usage() { echo -e "\n`gettext \"Tazinst - SliTaz installer - Version\"`: $VERSION\n" echo -e "\033[1m`gettext \"Usage\"`:" - echo -e "\033[0m `gettext \"tazinst [command] [config-file]\"`\n" + echo -e "\033[0m `gettext \"tazinst [command] [config-file|url|options]\"`\n" echo -e "\033[1m`gettext \"Commands\"`: \033[0m" echo -e "usage `gettext \"Print this short usage.\"`" echo -e "install `gettext \"Install SliTaz on HDD using a configuration file.\"`" echo -e "upgrade `gettext \"Upgrade SliTaz on HDD using a configuration file.\"`" echo -e "config `gettext \"Generate a configuration file.\"`" + echo -e "check `gettext \"Check configuration file validity.\"`" + echo -e "showurl `gettext \"Show the full URL of a predefined URL (stable|cooking|rolling).\"`" echo -e "cli `gettext \"Install or upgrade using command line options:\"`" echo -e " -i `gettext \"Full Install (not upgrading, all present data will be lost).\"`" echo -e " -u `gettext \"Upgrade (Needs an active internet connection).\"`" @@ -76,7 +81,7 @@ umount $TARGET_ROOT 2>>$LOG fi echo -e "`gettext \"Error\"` $@" - echo -e "`gettext \"Installation cancelled\"`" +# echo -e "`gettext \"Installation cancelled\"`" test $(id -u) = 0 && echo "Installation cancelled on error $@" >> $LOG exit $1 } @@ -270,7 +275,7 @@ # Check Action case $INST_ACTION in - install|upgrade) ;; + install|upgrade|check) ;; *) msg `gettext "INST_ACTION=$INST_ACTION: Invalid setting"`; error=yes ;; esac @@ -299,7 +304,7 @@ msg `gettext "SRC_FILE=$SRC_FILE: file not found"`; error=yes fi ;; web) - if [ $(wget -sq "$SRC_FILE") ]; then + if ! wget -sq "$SRC_FILE" 2> /dev/null ; then msg `gettext "SRC_FILE=$SRC_FILE: file not found on the web"`; error=yes fi ;; esac @@ -766,7 +771,7 @@ [ -e /root/.xinitrc ] && cp /root/.xinitrc /home/$TGT_USER mkdir -p /home/$TGT_USER/.config/slitaz cp -a /etc/slitaz/applications.conf /home/$TGT_USER/.config/slitaz - # chmod $TGT_USER:user doesn't work with most ISO + # Set ownership if grep -q ^users: /etc/group; then chown -R $TGT_USER:users /home/$TGT_USER else @@ -1262,6 +1267,22 @@ grub_install end_of_install ;; esac ;; + showurl) + case $2 in + stable) + echo $URL_STABLE ;; + cooking) + echo $URL_COOKING ;; + rolling) + echo $URL_ROLLING ;; + esac ;; + check) + LOG="/dev/null" + INST_ACTION=check + check_root + init $@ + read_configuration_file $2 + check_vars ;; usage|*) usage ;; esac