Changeset 2351


Ignore:
Timestamp:
10/29/07 08:47:48 (6 years ago)
Author:
alanbach-guest
Message:
  • Updated manpage, * Supports TuxOnIce? 3.0, * Implemented other distro detection system based on D-I, * Moved final_cleanup to the right section
Location:
pkg/main/parsix-installer/trunk
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • pkg/main/parsix-installer/trunk/TODO

    r96 r2351  
    1 - Detect existing installations automatically. 
    21- Some more clean-ups. 
  • pkg/main/parsix-installer/trunk/boot-tools.bm

    r2338 r2351  
    545545} 
    546546 
     547# Make sure mtab in the chroot reflects the currently mounted partitions. 
     548update_mtab() { 
     549        [ "$ROOT" ] || return 0 
     550 
     551        mtab=$ROOT/etc/mtab 
     552        grep "$ROOT" /proc/mounts | ( 
     553        while read devpath mountpoint fstype options n1 n2 ; do 
     554                devpath=`mapdevfs $devpath || echo $devpath` 
     555                mountpoint=`echo $mountpoint | sed "s%^$ROOT%%"` 
     556                # The sed line removes the mount point for root. 
     557                if [ -z "$mountpoint" ] ; then 
     558                        mountpoint="/" 
     559                fi 
     560                echo $devpath $mountpoint $fstype $options $n1 $n2 
     561        done ) > $mtab 
     562} 
     563 
     564is_floppy () { 
     565        echo "$1" | grep -q '(fd' || echo "$1" | grep -q "/dev/fd" || echo "$1" | grep -q floppy 
     566} 
     567 
    547568grub_write_chain() { 
    548569        cat >> $TARGET_MNT_POINT/boot/grub/menu.lst <<EOF 
     
    581602} # grub_write_chain end 
    582603 
     604grub2_write_chain() { 
     605        cat >> $TARGET_MNT_POINT/boot/grub/menu.lst <<EOF 
     606 
     607# This entry automatically added by the Debian installer for a non-linux OS 
     608# on $partition 
     609menuentry "$title" { 
     610        set root=$grubdrive 
     611        chainloader +1 
     612} 
     613EOF 
     614 
     615} # grub2_write_chain end 
     616 
     617grub_write_linux() { 
     618        cat >> $TARGET_MNT_POINT/boot/grub/menu.lst <<EOF 
     619 
     620# This entry automatically added by the Debian installer for an existing 
     621# linux installation on $mappedpartition. 
     622title           $label (on $mappedpartition) 
     623root            $grubdrive 
     624kernel          $kernel $params 
     625EOF 
     626        if [ -n "$initrd" ]; then 
     627                cat >> $TARGET_MNT_POINT/boot/grub/menu.lst <<EOF 
     628initrd          $initrd 
     629EOF 
     630        fi 
     631        cat >> $TARGET_MNT_POINT/boot/grub/menu.lst <<EOF 
     632savedefault 
     633boot 
     634 
     635EOF 
     636} # grub_write_linux end 
     637 
     638grub2_write_linux() { 
     639        cat >> $TARGET_MNT_POINT/boot/grub/menu.lst <<EOF 
     640 
     641# This entry automatically added by the Debian installer for an existing 
     642# linux installation on $mappedpartition. 
     643menuentry "$label (on $mappedpartition)" { 
     644        set root=$grubdrive 
     645        linux $kernel $params 
     646EOF 
     647        if [ -n "$initrd" ]; then 
     648                cat >> $TARGET_MNT_POINT/boot/grub/menu.lst <<EOF 
     649        initrd $initrd 
     650EOF 
     651        fi 
     652        cat >> $TARGET_MNT_POINT/boot/grub/menu.lst <<EOF 
     653} 
     654 
     655EOF 
     656} # grub2_write_linux end 
     657 
     658grub_write_hurd() { 
     659        cat >> $TARGET_MNT_POINT/boot/grub/menu.lst <<EOF 
     660 
     661# This entry automatically added by the Debian installer for an existing 
     662# hurd installation on $partition. 
     663title           $title (on $partition) 
     664root            $grubdrive 
     665kernel          /boot/gnumach.gz root=device:$hurddrive 
     666module          /hurd/ext2fs.static --readonly \\ 
     667                        --multiboot-command-line=\${kernel-command-line} \\ 
     668                        --host-priv-port=\${host-port} \\ 
     669                        --device-master-port=\${device-port} \\ 
     670                        --exec-server-task=\${exec-task} -T typed \${root} \\ 
     671                        \$(task-create) \$(task-resume) 
     672module          /lib/ld.so.1 /hurd/exec \$(exec-task=task-create) 
     673savedefault 
     674boot 
     675 
     676EOF 
     677} # grub_write_hurd end 
     678 
     679grub2_write_hurd() { 
     680        cat >> $TARGET_MNT_POINT/boot/grub/menu.lst <<EOF 
     681 
     682# This entry automatically added by the Debian installer for an existing 
     683# hurd installation on $partition. 
     684menuentry "$title (on $partition)" { 
     685        set root=$grubdrive 
     686        multiboot /boot/gnumach.gz root=device:$hurddrive 
     687        module /hurd/ext2fs.static --readonly \\ 
     688                        --multiboot-command-line=\${kernel-command-line} \\ 
     689                        --host-priv-port=\${host-port} \\ 
     690                        --device-master-port=\${device-port} \\ 
     691                        --exec-server-task=\${exec-task} -T typed \${root} \\ 
     692                        \$(task-create) \$(task-resume) 
     693        module /lib/ld.so.1 /hurd/exec \$(exec-task=task-create) 
     694} 
     695 
    583696grub_write_divider() { 
    584697        cat >> $TARGET_MNT_POINT/boot/grub/menu.lst << EOF 
     
    591704EOF 
    592705} # grub_write_divider end 
     706 
     707# Convert a linux non-devfs disk device name into the hurd's syntax 
     708translate_hurd_to_grub () { 
     709        dr_type=$(expr "$1" : '.*\([hs]d\)[a-h][0-9]*') 
     710        dr_letter=$(expr "$1" : '.*d\([a-h]\)[0-9]*') 
     711        dr_part=$(expr "$1" : '.*d[a-h]\([0-9]*\)') 
     712        case "$dr_letter" in 
     713        a) dr_num=0 ;; 
     714        b) dr_num=1 ;; 
     715        c) dr_num=2 ;; 
     716        d) dr_num=3 ;; 
     717        e) dr_num=4 ;; 
     718        f) dr_num=5 ;; 
     719        g) dr_num=6 ;; 
     720        h) dr_num=7 ;; 
     721        esac 
     722        echo "$dr_type${dr_num}s$dr_part" 
     723} 
    593724 
    594725install_grub() 
     
    682813        #Suspend2 
    683814        SWAP=$(cat $TARGET_MNT_POINT/etc/fstab | grep swap | awk '{print $1}') 
    684         GRUB_CMDLINE="$GRUB_CMDLINE resume2=swap:$SWAP" 
     815        GRUB_CMDLINE="$GRUB_CMDLINE resume=swap:$SWAP" 
    685816        #end Suspend2 
    686817 
     
    697828        perl -pi -e "s|^# kopt=root=(.*) ro|# kopt=root=\1 ro $GRUB_CMDLINE|g" $TARGET_MNT_POINT/boot/grub/menu.lst 
    698829 
    699         # Add other Operating Systems 
     830        # Add other Operating Systems, Be sure to remove installed Parsix partition 
    700831        os-prober > /tmp/os-probed 
     832        cat /tmp/os-probed | grep -v "$HD_CHOICE" > /tmp/os-probed.tmp  
     833        mv /tmp/os-probed.tmp /tmp/os-probed 2>/dev/null 
    701834 
    702835        export device_map=$TARGET_MNT_POINT/boot/grub/device.map 
     836 
     837        # update menu.lst 
     838        chroot_it update-grub -y >/dev/null 2>/dev/null 
     839 
     840        PARSIXVER=`cat /etc/parsix-version | awk '{print $3}'` 
     841        sed -i "s/Debian GNU\/Linux/Parsix GNU\/Linux $PARSIXVER/g" $TARGET_MNT_POINT/boot/grub/menu.lst 
     842        sed -i 's/nomce\ \vga/nomce\ \quiet\ \vga/g' $TARGET_MNT_POINT/boot/grub/menu.lst 
    703843 
    704844        if [ -s /tmp/os-probed ]; then 
     
    706846        fi 
    707847 
     848        newline=" 
     849" 
     850        # GRUB Legacy defaults 
     851        grub_version="grub" 
     852 
     853        OLDIFS="$IFS" 
     854        IFS="$newline" 
    708855        for os in $(cat /tmp/os-probed); do 
    709           title=$(echo "$os" | cut -d: -f2) 
    710           shortname=$(echo "$os" | cut -d: -f3) 
    711           type=$(echo "$os" | cut -d: -f4) 
    712            
    713           case "$type" in 
    714                 chain) 
    715                         partition=$(mapdevfs $(echo "$os" | cut -d: -f1)) 
    716                         grubdrive=$(translate_linux_to_grub "$partition") || true 
    717                         if [ -n "$grubdrive" ]; then 
    718                                     grub_write_chain 
    719                         fi 
    720                 ;; 
    721           esac 
    722         done 
     856             IFS="$OLDIFS" 
     857             title=$(echo "$os" | cut -d: -f2) 
     858             shortname=$(echo "$os" | cut -d: -f3) 
     859             type=$(echo "$os" | cut -d: -f4) 
     860             case "$type" in 
     861                        chain) 
     862                                partition=$(mapdevfs $(echo "$os" | cut -d: -f1)) 
     863                                grubdrive=$(translate_linux_to_grub "$partition") || true 
     864                                if [ -n "$grubdrive" ]; then 
     865                                        case $grub_version in 
     866                                            grub)       grub_write_chain ;; 
     867                                            grub2)      grub2_write_chain ;; 
     868                                        esac 
     869                                fi 
     870                        ;; 
     871                        linux) 
     872                                partition=$(echo "$os" | cut -d: -f1) 
     873                                mappedpartition=$(mapdevfs "$partition") 
     874                                IFS="$newline" 
     875                                for entry in $(linux-boot-prober "$partition"); do 
     876                                        IFS="$OLDIFS" 
     877                                        bootpart=$(echo "$entry" | cut -d: -f2) 
     878                                        mappedbootpart=$(mapdevfs "$bootpart") || true 
     879                                        if [ -z "$mappedbootpart" ]; then 
     880                                                mappedbootpart="$bootpart" 
     881                                        fi 
     882                                        label=$(echo "$entry" | cut -d : -f3) 
     883                                        if [ -z "$label" ]; then 
     884                                                label="$title" 
     885                                        fi 
     886                                        kernel=$(echo "$entry" | cut -d : -f4) 
     887                                        initrd=$(echo "$entry" | cut -d : -f5) 
     888                                        if echo "$kernel" | grep -q '^/boot/' && \ 
     889                                           [ "$mappedbootpart" != "$mappedpartition" ]; then 
     890                                                # separate /boot partition 
     891                                                kernel=$(echo "$kernel" | sed 's!^/boot!!') 
     892                                                initrd=$(echo "$initrd" | sed 's!^/boot!!') 
     893                                                grubdrive=$(translate_linux_to_grub "$mappedbootpart") || true 
     894                                        else 
     895                                                grubdrive=$(translate_linux_to_grub "$mappedpartition") || true 
     896                                        fi 
     897                                        params="$(echo "$entry" | cut -d : -f6-) $serial" 
     898                                        case $grub_version in 
     899                                            grub)       grub_write_linux ;; 
     900                                            grub2)      grub2_write_linux ;; 
     901                                        esac 
     902                                        IFS="$newline" 
     903                                done 
     904                                IFS="$OLDIFS" 
     905                        ;; 
     906                        hurd) 
     907                                partition=$(mapdevfs $(echo "$os" | cut -d: -f1)) 
     908                                grubdrive=$(translate_linux_to_grub "$partition") || true 
     909                                hurddrive=$(translate_hurd_to_grub "$partition") || true 
     910                                # Use the standard hurd boilerplate to boot it. 
     911                                case $grub_version in 
     912                                    grub)       grub_write_hurd ;; 
     913                                    grub2)      grub2_write_hurd ;; 
     914                                esac 
     915                        ;; 
     916                esac 
     917                IFS="$newline" 
     918          done 
     919          IFS="$OLDIFS" 
     920          rm -f /tmp/os-probed 2>/dev/null 
     921 
    723922        # End Adding other Operating Systems 
    724  
    725         # update menu.lst 
    726         chroot_it update-grub -y >/dev/null 2>/dev/null 
    727923 
    728924        # hook update-grub -y into the kernel installing chain 
     
    761957} 
    762958 
    763 final_cleanup(){ 
    764         PARSIXVER=`cat /etc/parsix-version | awk '{print $3}'` 
    765         sed -i "s/Debian GNU\/Linux/Parsix GNU\/Linux $PARSIXVER/g" $TARGET_MNT_POINT/boot/grub/menu.lst 
    766         sed -i 's/nomce\ \vga/nomce\ \quiet\ \vga/g' $TARGET_MNT_POINT/boot/grub/menu.lst 
    767  
    768         # disable auto-login, KDM and GDM 
    769         if [ -f /etc/init.d/gdm ]; then 
    770                 sed -i  -e "s/AutomaticLoginEnable=true//" \ 
    771                         -e "s/AutomaticLogin=parsix//" \ 
    772                                 $TARGET_MNT_POINT/etc/gdm/gdm.conf 
    773         elif [ -f /etc/init.d/kdm ]; then 
    774                 sed -i  -e "s/AutoReLogin=1true//" \ 
    775                         -e "s/AutoLoginEnable=true//" \ 
    776                         -e "s/AutoLoginAgain=true//" \ 
    777                         -e "s/AutoLoginDelay=1//" \ 
    778                         -e "s/AutoLoginUser=parsix//" \ 
    779                                 $TARGET_MNT_POINT/etc/kde3/kdm/kdmrc 
    780         fi 
    781  
    782         # some clean-ups 
    783         rm -rf $TARGET_MNT_POINT/none/  
    784         rm -rf $TARGET_MNT_POINT/rr_moved/ 
    785         rm -f $TARGET_MNT_POINT/boot/message 
    786  
    787         # cleaning unwanted links 
    788         if [ -x $TARGET_MNT_POINT/etc/rcS.d/S00live-autoconfig ]; then 
    789                 rm -f $TARGET_MNT_POINT/etc/rcS.d/S00live-autoconfig 
    790         fi 
    791         if [ -x $TARGET_MNT_POINT/etc/rc6.d/S90live-reboot ]; then 
    792                 rm -f $TARGET_MNT_POINT/etc/rc6.d/S90live-reboot 
    793         fi 
    794         if [ -x $TARGET_MNT_POINT/etc/rc0.d/S90live-halt ]; then 
    795                 rm -f $TARGET_MNT_POINT/etc/rc0.d/S90live-halt 
    796         fi 
    797          
    798         if [ -x $TARGET_MNT_POINT/etc/rc5.d/S80xprep ]; then 
    799                 rm -f $TARGET_MNT_POINT/etc/rc5.d/S80xprep 
    800         fi 
    801  
    802         for x in $TARGET_MNT_POINT/home/* 
    803         do 
    804                 if [ -f  $TARGET_MNT_POINT/home/$x/Desktop/parsix-installer.desktop ]; then 
    805                         rm -f $TARGET_MNT_POINT/home/$x/Desktop/parsix-installer.desktop 
    806                 fi 
    807         done 
    808 } 
    809  
    810959# Requierements: $BOOT_WHERE, $TARGET_MNT_POINT 
    811960# 
     
    8661015        then 
    8671016                install_grub                     
    868                 final_cleanup                    
    8691017        else 
    8701018                install_lilo 
  • pkg/main/parsix-installer/trunk/debian/changelog

    r2337 r2351  
     1parsix-installer (0.81.1) unstable; urgency=low 
     2 
     3  * Updated manpage 
     4  * Supports TuxOnIce 3.0 
     5  * Implemented other distro detection system based on D-I 
     6  * Moved final_cleanup to the right section 
     7 
     8 -- Alan Baghumian <alan@technotux.org>  Mon, 29 Oct 2007 08:27:44 +0330 
     9 
    110parsix-installer (0.81.0) barry; urgency=low 
    211 
  • pkg/main/parsix-installer/trunk/parsix-installer

    r2337 r2351  
    153153        echo -e "XXX\n$*\nXXX" 
    154154        logit "$*" 
     155} 
     156 
     157function final_cleanup 
     158{ 
     159        # disable auto-login, KDM and GDM 
     160        if [ -f /etc/init.d/gdm ]; then 
     161                sed -i  -e "s/AutomaticLoginEnable=true//" \ 
     162                        -e "s/AutomaticLogin=parsix//" \ 
     163                                $TARGET_MNT_POINT/etc/gdm/gdm.conf 
     164        elif [ -f /etc/init.d/kdm ]; then 
     165                sed -i  -e "s/AutoReLogin=1true//" \ 
     166                        -e "s/AutoLoginEnable=true//" \ 
     167                        -e "s/AutoLoginAgain=true//" \ 
     168                        -e "s/AutoLoginDelay=1//" \ 
     169                        -e "s/AutoLoginUser=parsix//" \ 
     170                                $TARGET_MNT_POINT/etc/kde3/kdm/kdmrc 
     171        fi 
     172 
     173        # some clean-ups 
     174        rm -rf $TARGET_MNT_POINT/none/  
     175        rm -rf $TARGET_MNT_POINT/rr_moved/ 
     176        rm -f $TARGET_MNT_POINT/boot/message 
     177 
     178        # cleaning unwanted links 
     179        if [ -x $TARGET_MNT_POINT/etc/rcS.d/S00live-autoconfig ]; then 
     180                rm -f $TARGET_MNT_POINT/etc/rcS.d/S00live-autoconfig 
     181        fi 
     182        if [ -x $TARGET_MNT_POINT/etc/rc6.d/S90live-reboot ]; then 
     183                rm -f $TARGET_MNT_POINT/etc/rc6.d/S90live-reboot 
     184        fi 
     185        if [ -x $TARGET_MNT_POINT/etc/rc0.d/S90live-halt ]; then 
     186                rm -f $TARGET_MNT_POINT/etc/rc0.d/S90live-halt 
     187        fi 
     188         
     189        if [ -x $TARGET_MNT_POINT/etc/rc5.d/S80xprep ]; then 
     190                rm -f $TARGET_MNT_POINT/etc/rc5.d/S80xprep 
     191        fi 
     192 
     193        for x in $TARGET_MNT_POINT/home/* 
     194        do 
     195                if [ -f  $TARGET_MNT_POINT/home/$x/Desktop/parsix-installer.desktop ]; then 
     196                        rm -f $TARGET_MNT_POINT/home/$x/Desktop/parsix-installer.desktop 
     197                fi 
     198        done 
    155199} 
    156200 
     
    333377{ 
    334378        echo "" 
    335         INSTALL_LIST="module_hd_doaction module_swap_doaction update_fstab old_installer add_bootmanager :" 
     379        INSTALL_LIST="module_hd_doaction module_swap_doaction update_fstab old_installer add_bootmanager final_cleanup :" 
    336380        INSTALL_LIST_NUM=$[6-1] 
    337381        N=0; 
  • pkg/main/parsix-installer/trunk/parsix-installer.8

    r1817 r2351  
    1 .TH Parsix-Installer 8 "July 2007" "Release: 0.80.2"  
     1.TH Parsix-Installer 8 "November 2007" "Release: 0.81.0"  
    22.SH NAME 
    33Parsix GNU/Linux Installation Script - parsix-installer 
     
    4444 
    4545.SH MORE QUESTIONS  
    46 If you hve more questions about installing Parsix GNU/Linux on hard disk you can ask in Parsix IRC chanel at \fIirc.freenode.net/#parsix\fR or ask it in Parsix GNU/Linux  Mailing List, for more information about Parsix Mailing list see \fIhttp://lists.parsix.org\fR. 
     46If you hve more questions about installing Parsix GNU/Linux on hard disk you can ask in Parsix IRC chanel at \fIirc.freenode.net/#parsix\fR or ask it in Parsix GNU/Linux  Mailing List, for more information about Parsix Mailing list see \fIhttp://parsix.org/mailman/listinfo\fR. 
    4747 
    4848.SH FILES 
Note: See TracChangeset for help on using the changeset viewer.