Changeset 8ebf154


Ignore:
Timestamp:
11/17/2005 09:21:39 PM (19 years ago)
Author:
Manuel Canales Esparcia <manuel@…>
Branches:
1.0, 2.3, 2.3.x, 2.4, ablfs, ablfs-more, legacy, new_features, trunk
Children:
ebd1409
Parents:
d13460c
Message:

Triying to manage the cases where the lfs user is already present in the host.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • jhalfs

    rd13460c r8ebf154  
    328328chapter4_Makefiles() {
    329329#----------------------------#
     330
     331# If /home/lfs is already present in the host, we asume that the
     332# lfs user and group are also presents in the host, and a backup
     333# of their bash init files is made.
    330334(
    331335    cat << EOF
     
    339343021-addinguser:  020-creatingtoolsdir
    340344        @\$(call echo_message, Building)
    341         @groupadd lfs && \\
    342         useradd -s /bin/bash -g lfs -m -k /dev/null lfs && \\
    343         chown lfs \$(LFS)/tools && \\
     345        @if [ ! -d /home/lfs ]; then \\
     346                groupadd lfs; \\
     347                useradd -s /bin/bash -g lfs -m -k /dev/null lfs; \\
     348        fi;
     349        @chown lfs \$(LFS)/tools && \\
    344350        chown lfs \$(LFS)/sources && \\
    345351        touch \$@
     
    347353022-settingenvironment:  021-addinguser
    348354        @\$(call echo_message, Building)
     355        @if [ -f /home/lfs/.bashrc -a ! -f /home/lfs/.bashrc.XXX ]; then \\
     356                mv -v /home/lfs/.bashrc /home/lfs/.bashrc.XXX; \\
     357        fi;
     358        @if [ -f /home/lfs/.bash_profile  -a ! -f /home/lfs/.bash_profile.XXX ]; then \\
     359                mv -v /home/lfs/.bash_profile /home/lfs/.bash_profile.XXX; \\
     360        fi;
    349361        @echo "set +h" > /home/lfs/.bashrc && \\
    350362        echo "umask 022" >> /home/lfs/.bashrc && \\
     
    820832chapter4:  020-creatingtoolsdir 021-addinguser 022-settingenvironment
    821833
    822 chapter5:  chapter4 $chapter5
     834chapter5:  chapter4 $chapter5 restore-lfs-env
    823835
    824836chapter6:  chapter5 $chapter6
     
    841853clean-chapter5:
    842854        rm -rf \$(LFS)/tools/*
    843         rm -f $chapter5
     855        rm -f $chapter5 restore-lfs-env
    844856        cd logs && rm -f $chapter5 && cd ..
    845857 
     
    858870        cd logs && rm -f $chapter789 && cd ..
    859871
     872restore-lfs-env:
     873        @\$(call echo_message, Building)
     874        @if [ -f /home/lfs/.bashrc.XXX ]; then \\
     875                mv -fv /home/lfs/.bashrc.XXX /home/lfs/.bashrc; \\
     876        fi;
     877        @if [ -f /home/lfs/.bash_profile.XXX ]; then \\
     878                mv -v /home/lfs/.bash_profile.XXX /home/lfs/.bash_profile; \\
     879        fi;
     880        @chown lfs:lfs /home/lfs/.bash* && \\
     881        @touch \$@
    860882
    861883EOF
Note: See TracChangeset for help on using the changeset viewer.