Changeset 6ad5a2f for CLFS/master.sh


Ignore:
Timestamp:
08/08/2006 05:26:40 PM (18 years ago)
Author:
Manuel Canales Esparcia <manuel@…>
Branches:
2.3, 2.3.x, 2.4, ablfs, ablfs-more, legacy, new_features, trunk
Children:
daa9b6c
Parents:
983db9f
Message:

Ported LUSER code and last CLFS2 fix from experimental.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • CLFS/master.sh

    r983db9f r6ad5a2f  
    4242025-addinguser:  024-creatingcrossdir
    4343        @\$(call echo_message, Building)
    44         @if [ ! -d /home/clfs ]; then \\
    45                 groupadd clfs; \\
    46                 useradd -s /bin/bash -g clfs -m -k /dev/null clfs; \\
     44        @if [ ! -d /home/\$(LUSER) ]; then \\
     45                groupadd \$(LGROUP); \\
     46                useradd -s /bin/bash -g \$(LGROUP) -m -k /dev/null \$(LUSER); \\
    4747        else \\
    48                 touch user-clfs-exist; \\
     48                touch luser-exist; \\
    4949        fi;
    50         @chown clfs \$(MOUNT_PT) && \\
    51         chown clfs \$(MOUNT_PT)/tools && \\
    52         chown clfs \$(MOUNT_PT)/cross-tools && \\
    53         chown clfs \$(MOUNT_PT)/sources && \\
     50        @chown \$(LUSER) \$(MOUNT_PT) && \\
     51        chown \$(LUSER) \$(MOUNT_PT)/tools && \\
     52        chown \$(LUSER) \$(MOUNT_PT)/cross-tools && \\
     53        chown \$(LUSER) \$(MOUNT_PT)/sources && \\
    5454        touch \$@ && \\
    5555        echo " "\$(BOLD)Target \$(BLUE)\$@ \$(BOLD)OK && \\
     
    5858026-settingenvironment:  025-addinguser
    5959        @\$(call echo_message, Building)
    60         @if [ -f /home/clfs/.bashrc -a ! -f /home/clfs/.bashrc.XXX ]; then \\
    61                 mv /home/clfs/.bashrc /home/clfs/.bashrc.XXX; \\
     60        @if [ -f /home/\$(LUSER)/.bashrc -a ! -f /home/\$(LUSER)/.bashrc.XXX ]; then \\
     61                mv /home/\$(LUSER)/.bashrc /home/\$(LUSER)/.bashrc.XXX; \\
    6262        fi;
    63         @if [ -f /home/clfs/.bash_profile  -a ! -f /home/clfs/.bash_profile.XXX ]; then \\
    64                 mv /home/clfs/.bash_profile /home/clfs/.bash_profile.XXX; \\
     63        @if [ -f /home/\$(LUSER)/.bash_profile  -a ! -f /home/\$(LUSER)/.bash_profile.XXX ]; then \\
     64                mv /home/\$(LUSER)/.bash_profile /home/\$(LUSER)/.bash_profile.XXX; \\
    6565        fi;
    66         @echo "set +h" > /home/clfs/.bashrc && \\
    67         echo "umask 022" >> /home/clfs/.bashrc && \\
    68         echo "CLFS=\$(MOUNT_PT)" >> /home/clfs/.bashrc && \\
    69         echo "LC_ALL=POSIX" >> /home/clfs/.bashrc && \\
    70         echo "PATH=/cross-tools/bin:/bin:/usr/bin" >> /home/clfs/.bashrc && \\
    71         echo "export CLFS LC_ALL PATH" >> /home/clfs/.bashrc && \\
    72         echo "" >> /home/clfs/.bashrc && \\
    73         echo "unset CFLAGS" >> /home/clfs/.bashrc && \\
    74         echo "unset CXXFLAGS" >> /home/clfs/.bashrc && \\
    75         echo "" >> /home/clfs/.bashrc && \\
    76         echo "export CLFS_HOST=\"${CLFS_HOST}\"" >> /home/clfs/.bashrc && \\
    77         echo "export CLFS_TARGET=\"${TARGET}\"" >> /home/clfs/.bashrc && \\
    78         echo "export CLFS_TARGET32=\"${TARGET32}\"" >> /home/clfs/.bashrc && \\
    79         echo "source $JHALFSDIR/envars" >> /home/clfs/.bashrc
    80         @chown clfs:clfs /home/clfs/.bashrc && \\
     66        @echo "set +h" > /home/\$(LUSER)/.bashrc && \\
     67        echo "umask 022" >> /home/\$(LUSER)/.bashrc && \\
     68        echo "CLFS=\$(MOUNT_PT)" >> /home/\$(LUSER)/.bashrc && \\
     69        echo "LC_ALL=POSIX" >> /home/\$(LUSER)/.bashrc && \\
     70        echo "PATH=/cross-tools/bin:/bin:/usr/bin" >> /home/\$(LUSER)/.bashrc && \\
     71        echo "export CLFS LC_ALL PATH" >> /home/\$(LUSER)/.bashrc && \\
     72        echo "" >> /home/\$(LUSER)/.bashrc && \\
     73        echo "unset CFLAGS" >> /home/\$(LUSER)/.bashrc && \\
     74        echo "unset CXXFLAGS" >> /home/\$(LUSER)/.bashrc && \\
     75        echo "" >> /home/\$(LUSER)/.bashrc && \\
     76        echo "export CLFS_HOST=\"${CLFS_HOST}\"" >> /home/\$(LUSER)/.bashrc && \\
     77        echo "export CLFS_TARGET=\"${TARGET}\"" >> /home/\$(LUSER)/.bashrc && \\
     78        echo "export CLFS_TARGET32=\"${TARGET32}\"" >> /home/\$(LUSER)/.bashrc && \\
     79        echo "source $JHALFSDIR/envars" >> /home/\$(LUSER)/.bashrc
     80        @chown \$(LUSER):\$(LGROUP) /home/\$(LUSER)/.bashrc && \\
    8181        touch envars && \\
    8282        touch \$@ && \\
     
    132132    # If $pkg_tarball isn't empty, we've got a package...
    133133    #
    134     [[ "$pkg_tarball" != "" ]] && wrt_unpack_clfs "$pkg_tarball"
    135     #
    136     wrt_run_as_clfs_su "${this_script}" "${file}"
     134    [[ "$pkg_tarball" != "" ]] && wrt_unpack "$pkg_tarball"
     135    #
     136    wrt_RunAsUser "${this_script}" "${file}"
    137137    #
    138138    [[ "$pkg_tarball" != "" ]] && wrt_remove_build_dirs "${name}"
     
    191191    # Insert instructions for unpacking the package and to set the PKGDIR variable.
    192192    #
    193     [[ "$pkg_tarball" != "" ]] && wrt_unpack_clfs "$pkg_tarball"
     193    [[ "$pkg_tarball" != "" ]] && wrt_unpack "$pkg_tarball"
    194194    [[ "$pkg_tarball" != "" ]] && [[ "$OPTIMIZE" = "2" ]] &&  wrt_optimize "$name" && wrt_makeflags "$name"
    195195    #
    196     wrt_run_as_clfs_su "${this_script}" "${file}"
     196    wrt_RunAsUser "${this_script}" "${file}"
    197197    #
    198198    [[ "$pkg_tarball" != "" ]] && wrt_remove_build_dirs "${name}"
     
    263263    # Insert instructions for unpacking the package and changing directories
    264264    #
    265     [[ "$pkg_tarball" != "" ]] && wrt_unpack_clfs "$pkg_tarball"
     265    [[ "$pkg_tarball" != "" ]] && wrt_unpack "$pkg_tarball"
    266266    [[ "$pkg_tarball" != "" ]] && [[ "$OPTIMIZE" = "2" ]] &&  wrt_optimize "$name" && wrt_makeflags "$name"
    267267    #
    268268    # Select a script execution method
    269269    case $this_script in
    270       *changingowner*)  wrt_run_as_clfs_root "${this_script}" "${file}"    ;;
    271       *devices*)        wrt_run_as_clfs_root "${this_script}" "${file}"    ;;
     270      *changingowner*)  wrt_RunAsRoot "${this_script}" "${file}"    ;;
     271      *devices*)        wrt_RunAsRoot "${this_script}" "${file}"    ;;
    272272      *fstab*)   if [[ -n "$FSTAB" ]]; then
    273273                   wrt_copy_fstab "${this_script}"
    274274                 else
    275                    wrt_run_as_clfs_su  "${this_script}" "${file}"
     275                   wrt_RunAsUser  "${this_script}" "${file}"
    276276                 fi
    277277         ;;
    278       *)         wrt_run_as_clfs_su  "${this_script}" "${file}"       ;;
     278      *)         wrt_RunAsUser  "${this_script}" "${file}"       ;;
    279279    esac
    280280    #
     
    333333    if [ "$pkg_tarball" != "" ] ; then
    334334      case $this_script in
    335         *util-linux)    wrt_unpack_clfs  "$pkg_tarball"  ;;
     335        *util-linux)    wrt_unpack  "$pkg_tarball"  ;;
    336336        *)              wrt_unpack2 "$pkg_tarball"  ;;
    337337      esac
     
    341341    # Select a script execution method
    342342    case $this_script in
    343       *kernfs)        wrt_run_as_clfs_root "${this_script}" "${file}"  ;;
    344       *util-linux)    wrt_run_as_clfs_su  "${this_script}" "${file}"  ;;
    345       *)              wrt_run_as_chroot1   "${this_script}" "${file}"  ;;
     343      *kernfs)      wrt_RunAsRoot "${this_script}" "${file}"  ;;
     344      *util-linux)  wrt_RunAsUser "${this_script}" "${file}"  ;;
     345      *)            wrt_run_as_chroot1  "${this_script}" "${file}"  ;;
    346346    esac
    347347    #
     
    10131013MOUNT_PT= $BUILDDIR
    10141014PKG_LST= $PKG_LST
     1015LUSER= $LUSER
     1016LGROUP= $LGROUP
    10151017
    10161018include makefile-functions
     
    10211023  # Add chroot commands
    10221024  if [ "$METHOD" = "chroot" ] ; then
    1023     chroot=`cat chroot/*chroot* | sed -e '/#!\/tools\/bin\/bash/d' \
    1024                             -e '/^export/d' \
    1025                             -e '/^logout/d' \
    1026                             -e 's@ \\\@ @g' | tr -d '\n' |  sed -e 's/  */ /g' \
    1027                                                                 -e 's|\\$|&&|g' \
    1028                                                                 -e 's|exit||g' \
    1029                                                                 -e 's|$| -c|' \
    1030                                                                 -e 's|"$$CLFS"|$(MOUNT_PT)|'\
    1031                                                                 -e 's|set -e||'`
     1025    CHROOT_LOC="`whereis -b chroot | cut -d " " -f2`"
     1026    chroot=`cat chroot/*chroot* | \
     1027            sed  -e "s@chroot@$CHROOT_LOC@" \
     1028                 -e '/#!\/tools\/bin\/bash/d' \
     1029                 -e '/^export/d' \
     1030                 -e '/^logout/d' \
     1031                 -e 's@ \\\@ @g' | \
     1032            tr -d '\n' |  \
     1033            sed -e 's/  */ /g' \
     1034                -e 's|\\$|&&|g' \
     1035                -e 's|exit||g' \
     1036                -e 's|$| -c|' \
     1037                -e 's|"$$CLFS"|$(MOUNT_PT)|'\
     1038                -e 's|set -e||'`
    10321039    echo -e "CHROOT1= $chroot\n" >> $MKFILE
    10331040  fi
     
    10471054chapter4:  chapter3 $temptools
    10481055
    1049 chapter5:  chapter4 $chroottools $testsuitetools
     1056chapter5:  chapter4 $chroottools restore-luser-env $testsuitetools
    10501057
    10511058chapter6:  chapter5 $basicsystem
     
    10641071
    10651072clean-chapter2:
    1066         -if [ ! -f user-clfs-exist ]; then \\
    1067                 userdel clfs; \\
    1068                 rm -rf /home/clfs; \\
     1073        -if [ ! -f luser-exist ]; then \\
     1074                userdel \$(LUSER); \\
     1075                rm -rf /home/\$(LUSER); \\
    10691076        fi;
    10701077        rm -rf \$(MOUNT_PT)/tools
     
    10721079        rm -rf \$(MOUNT_PT)/cross-tools
    10731080        rm -f /cross-tools
    1074         rm -f envars user-clfs-exist
     1081        rm -f envars luser-exist
    10751082        rm -f 02* logs/02*.log
    10761083
    10771084clean-chapter3:
    10781085        rm -rf \$(MOUNT_PT)/tools/*
    1079         rm -f $cross_tools restore-clfs-env sources-dir
     1086        rm -f $cross_tools sources-dir
    10801087        cd logs && rm -f $cross_tools && cd ..
    10811088
     
    10911098
    10921099
    1093 restore-clfs-env:
     1100restore-luser-env:
    10941101        @\$(call echo_message, Building)
    1095         @if [ -f /home/clfs/.bashrc.XXX ]; then \\
    1096                 mv -f /home/clfs/.bashrc.XXX /home/clfs/.bashrc; \\
     1102        @if [ -f /home/\$(LUSER)/.bashrc.XXX ]; then \\
     1103                mv -f /home/\$(LUSER)/.bashrc.XXX /home/\$(LUSER)/.bashrc; \\
    10971104        fi;
    1098         @if [ -f /home/clfs/.bash_profile.XXX ]; then \\
    1099                 mv /home/clfs/.bash_profile.XXX /home/clfs/.bash_profile; \\
     1105        @if [ -f /home/\$(LUSER)/.bash_profile.XXX ]; then \\
     1106                mv /home/\$(LUSER)/.bash_profile.XXX /home/\$(LUSER)/.bash_profile; \\
    11001107        fi;
    1101         @chown clfs:clfs /home/clfs/.bash* && \\
     1108        @chown \$(LUSER):\$(LGROUP) /home/\$(LUSER)/.bash* && \\
    11021109        touch \$@ && \\
    11031110        echo " "\$(BOLD)Target \$(BLUE)\$@ \$(BOLD)OK && \\
     
    11101117        @-umount \$(MOUNT_PT)/sys
    11111118        @-umount \$(MOUNT_PT)/proc
    1112         @-if [ ! -f user-clfs-exist ]; then \\
    1113                 userdel clfs; \\
    1114                 rm -rf /home/clfs; \\
     1119        @-if [ ! -f luser-exist ]; then \\
     1120                userdel \$(LUSER); \\
     1121                rm -rf /home/\$(LUSER); \\
    11151122        fi;
    11161123
     
    11301137        $temptools \
    11311138        $chroottools \
    1132         $boottools
     1139        $boottools restore-luser-env
    11331140        @\$(call echo_boot_finished,$VERSION)
    11341141
     
    11461153
    11471154clean-jhalfs:
    1148         -if [ ! -f user-clfs-exist ]; then \\
    1149                 userdel clfs; \\
    1150                 rm -rf /home/clfs; \\
     1155        -if [ ! -f luser-exist ]; then \\
     1156                userdel \$(LUSER); \\
     1157                rm -rf /home/\$(LUSER); \\
    11511158        fi;
    11521159        rm -rf \$(MOUNT_PT)/tools
     
    11541161        rm -rf \$(MOUNT_PT)/cross-tools
    11551162        rm -f /cross-tools
    1156         rm -f envars user-clfs-exist
     1163        rm -f envars luser-exist
    11571164        rm -f 02* logs/02*.log
    11581165
     
    11601167        rm -rf /tools/*
    11611168        rm -f $cross_tools && rm -f $temptools && rm -f $chroottools && rm -f $boottools
    1162         rm -f restore-clfs-env sources-dir
     1169        rm -f restore-luser-env sources-dir
    11631170        cd logs && rm -f $cross_tools && rm -f $temptools && rm -f $chroottools && rm -f $boottools && cd ..
    11641171
     
    11761183
    11771184
    1178 restore-clfs-env:
     1185restore-luser-env:
    11791186        @\$(call echo_message, Building)
    1180         @if [ -f /home/clfs/.bashrc.XXX ]; then \\
    1181                 mv -fv /home/clfs/.bashrc.XXX /home/clfs/.bashrc; \\
     1187        @if [ -f /home/\$(LUSER)/.bashrc.XXX ]; then \\
     1188                mv -fv /home/\$(LUSER)/.bashrc.XXX /home/\$(LUSER)/.bashrc; \\
    11821189        fi;
    1183         @if [ -f /home/clfs/.bash_profile.XXX ]; then \\
    1184                 mv -v /home/clfs/.bash_profile.XXX /home/clfs/.bash_profile; \\
     1190        @if [ -f /home/\$(LUSER)/.bash_profile.XXX ]; then \\
     1191                mv -v /home/\$(LUSER)/.bash_profile.XXX /home/\$(LUSER)/.bash_profile; \\
    11851192        fi;
    1186         @chown clfs:clfs /home/clfs/.bash* && \\
     1193        @chown \$(LUSER):\$(LGROUP) /home/\$(LUSER)/.bash* && \\
    11871194        touch \$@ && \\
    11881195        echo " "\$(BOLD)Target \$(BLUE)\$@ \$(BOLD)OK && \\
Note: See TracChangeset for help on using the changeset viewer.