Changeset 6ad5a2f for CLFS/master.sh
- Timestamp:
- 08/08/2006 05:26:40 PM (18 years ago)
- Branches:
- 2.3, 2.3.x, 2.4, ablfs, ablfs-more, legacy, new_features, trunk
- Children:
- daa9b6c
- Parents:
- 983db9f
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
CLFS/master.sh
r983db9f r6ad5a2f 42 42 025-addinguser: 024-creatingcrossdir 43 43 @\$(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); \\ 47 47 else \\ 48 touch user-clfs-exist; \\48 touch luser-exist; \\ 49 49 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 && \\ 54 54 touch \$@ && \\ 55 55 echo " "\$(BOLD)Target \$(BLUE)\$@ \$(BOLD)OK && \\ … … 58 58 026-settingenvironment: 025-addinguser 59 59 @\$(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; \\ 62 62 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; \\ 65 65 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/.bashrc80 @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 && \\ 81 81 touch envars && \\ 82 82 touch \$@ && \\ … … 132 132 # If $pkg_tarball isn't empty, we've got a package... 133 133 # 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}" 137 137 # 138 138 [[ "$pkg_tarball" != "" ]] && wrt_remove_build_dirs "${name}" … … 191 191 # Insert instructions for unpacking the package and to set the PKGDIR variable. 192 192 # 193 [[ "$pkg_tarball" != "" ]] && wrt_unpack _clfs"$pkg_tarball"193 [[ "$pkg_tarball" != "" ]] && wrt_unpack "$pkg_tarball" 194 194 [[ "$pkg_tarball" != "" ]] && [[ "$OPTIMIZE" = "2" ]] && wrt_optimize "$name" && wrt_makeflags "$name" 195 195 # 196 wrt_ run_as_clfs_su"${this_script}" "${file}"196 wrt_RunAsUser "${this_script}" "${file}" 197 197 # 198 198 [[ "$pkg_tarball" != "" ]] && wrt_remove_build_dirs "${name}" … … 263 263 # Insert instructions for unpacking the package and changing directories 264 264 # 265 [[ "$pkg_tarball" != "" ]] && wrt_unpack _clfs"$pkg_tarball"265 [[ "$pkg_tarball" != "" ]] && wrt_unpack "$pkg_tarball" 266 266 [[ "$pkg_tarball" != "" ]] && [[ "$OPTIMIZE" = "2" ]] && wrt_optimize "$name" && wrt_makeflags "$name" 267 267 # 268 268 # Select a script execution method 269 269 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}" ;; 272 272 *fstab*) if [[ -n "$FSTAB" ]]; then 273 273 wrt_copy_fstab "${this_script}" 274 274 else 275 wrt_ run_as_clfs_su"${this_script}" "${file}"275 wrt_RunAsUser "${this_script}" "${file}" 276 276 fi 277 277 ;; 278 *) wrt_ run_as_clfs_su"${this_script}" "${file}" ;;278 *) wrt_RunAsUser "${this_script}" "${file}" ;; 279 279 esac 280 280 # … … 333 333 if [ "$pkg_tarball" != "" ] ; then 334 334 case $this_script in 335 *util-linux) wrt_unpack _clfs"$pkg_tarball" ;;335 *util-linux) wrt_unpack "$pkg_tarball" ;; 336 336 *) wrt_unpack2 "$pkg_tarball" ;; 337 337 esac … … 341 341 # Select a script execution method 342 342 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}" ;; 346 346 esac 347 347 # … … 1013 1013 MOUNT_PT= $BUILDDIR 1014 1014 PKG_LST= $PKG_LST 1015 LUSER= $LUSER 1016 LGROUP= $LGROUP 1015 1017 1016 1018 include makefile-functions … … 1021 1023 # Add chroot commands 1022 1024 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||'` 1032 1039 echo -e "CHROOT1= $chroot\n" >> $MKFILE 1033 1040 fi … … 1047 1054 chapter4: chapter3 $temptools 1048 1055 1049 chapter5: chapter4 $chroottools $testsuitetools1056 chapter5: chapter4 $chroottools restore-luser-env $testsuitetools 1050 1057 1051 1058 chapter6: chapter5 $basicsystem … … 1064 1071 1065 1072 clean-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); \\ 1069 1076 fi; 1070 1077 rm -rf \$(MOUNT_PT)/tools … … 1072 1079 rm -rf \$(MOUNT_PT)/cross-tools 1073 1080 rm -f /cross-tools 1074 rm -f envars user-clfs-exist1081 rm -f envars luser-exist 1075 1082 rm -f 02* logs/02*.log 1076 1083 1077 1084 clean-chapter3: 1078 1085 rm -rf \$(MOUNT_PT)/tools/* 1079 rm -f $cross_tools restore-clfs-envsources-dir1086 rm -f $cross_tools sources-dir 1080 1087 cd logs && rm -f $cross_tools && cd .. 1081 1088 … … 1091 1098 1092 1099 1093 restore- clfs-env:1100 restore-luser-env: 1094 1101 @\$(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; \\ 1097 1104 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; \\ 1100 1107 fi; 1101 @chown clfs:clfs /home/clfs/.bash* && \\1108 @chown \$(LUSER):\$(LGROUP) /home/\$(LUSER)/.bash* && \\ 1102 1109 touch \$@ && \\ 1103 1110 echo " "\$(BOLD)Target \$(BLUE)\$@ \$(BOLD)OK && \\ … … 1110 1117 @-umount \$(MOUNT_PT)/sys 1111 1118 @-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); \\ 1115 1122 fi; 1116 1123 … … 1130 1137 $temptools \ 1131 1138 $chroottools \ 1132 $boottools 1139 $boottools restore-luser-env 1133 1140 @\$(call echo_boot_finished,$VERSION) 1134 1141 … … 1146 1153 1147 1154 clean-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); \\ 1151 1158 fi; 1152 1159 rm -rf \$(MOUNT_PT)/tools … … 1154 1161 rm -rf \$(MOUNT_PT)/cross-tools 1155 1162 rm -f /cross-tools 1156 rm -f envars user-clfs-exist1163 rm -f envars luser-exist 1157 1164 rm -f 02* logs/02*.log 1158 1165 … … 1160 1167 rm -rf /tools/* 1161 1168 rm -f $cross_tools && rm -f $temptools && rm -f $chroottools && rm -f $boottools 1162 rm -f restore- clfs-env sources-dir1169 rm -f restore-luser-env sources-dir 1163 1170 cd logs && rm -f $cross_tools && rm -f $temptools && rm -f $chroottools && rm -f $boottools && cd .. 1164 1171 … … 1176 1183 1177 1184 1178 restore- clfs-env:1185 restore-luser-env: 1179 1186 @\$(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; \\ 1182 1189 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; \\ 1185 1192 fi; 1186 @chown clfs:clfs /home/clfs/.bash* && \\1193 @chown \$(LUSER):\$(LGROUP) /home/\$(LUSER)/.bash* && \\ 1187 1194 touch \$@ && \\ 1188 1195 echo " "\$(BOLD)Target \$(BLUE)\$@ \$(BOLD)OK && \\
Note:
See TracChangeset
for help on using the changeset viewer.