- Timestamp:
- 08/04/2006 08:06:15 PM (18 years ago)
- Branches:
- experimental
- Children:
- 3ba96f2
- Parents:
- 725ae5a
- Location:
- CLFS
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
CLFS/config
r725ae5a r9485eba 6 6 # 7 7 ##### 8 9 #--- Unprivileged user and group name 10 LUSER=clfs 11 LGROUP=clfs 8 12 9 13 #--- Which target architecture you want to build for, … … 38 42 # NOTE: not all combinations are 'bootable' yet. 39 43 METHOD=chroot 44 45 #--- Unprivileged user and group name 46 LUSER=clfs 47 LGROUP=clfs 40 48 41 49 #--- Location of fstab file (if empty, a template is created) -
CLFS/master.sh
r725ae5a r9485eba 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 48 touch user-clfs-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 # … … 758 758 759 759 case $this_script in 760 *udev *) continue ;; # This is not a script but a commentary760 *udev) continue ;; # This is not a script but a commentary 761 761 *console*) continue ;; # Use the files that came with the bootscripts 762 762 *) ;; … … 774 774 -e 's@n32@@'` 775 775 case $name in 776 *bootscripts*) name=bootscripts-cross-lfs 777 ;;776 *bootscripts*) name=bootscripts-cross-lfs ;; 777 *udev-rules) name=udev-cross-lfs ;; 778 778 esac 779 779 … … 1013 1013 MOUNT_PT= $BUILDDIR 1014 1014 PKG_LST= $PKG_LST 1015 LUSER= $LUSER 1016 LGROUP= $LGROUP 1015 1017 1016 1018 include makefile-functions … … 1065 1067 clean-chapter2: 1066 1068 -if [ ! -f user-clfs-exist ]; then \\ 1067 userdel clfs; \\1068 rm -rf /home/ clfs; \\1069 userdel \$(LUSER); \\ 1070 rm -rf /home/\$(LUSER); \\ 1069 1071 fi; 1070 1072 rm -rf \$(MOUNT_PT)/tools … … 1093 1095 restore-clfs-env: 1094 1096 @\$(call echo_message, Building) 1095 @if [ -f /home/ clfs/.bashrc.XXX ]; then \\1096 mv -f /home/ clfs/.bashrc.XXX /home/clfs/.bashrc; \\1097 @if [ -f /home/\$(LUSER)/.bashrc.XXX ]; then \\ 1098 mv -f /home/\$(LUSER)/.bashrc.XXX /home/\$(LUSER)/.bashrc; \\ 1097 1099 fi; 1098 @if [ -f /home/ clfs/.bash_profile.XXX ]; then \\1099 mv /home/ clfs/.bash_profile.XXX /home/clfs/.bash_profile; \\1100 @if [ -f /home/\$(LUSER)/.bash_profile.XXX ]; then \\ 1101 mv /home/\$(LUSER)/.bash_profile.XXX /home/\$(LUSER)/.bash_profile; \\ 1100 1102 fi; 1101 @chown clfs:clfs /home/clfs/.bash* && \\1103 @chown \$(LUSER):\$(LGROUP) /home/\$(LUSER)/.bash* && \\ 1102 1104 touch \$@ && \\ 1103 1105 echo " "\$(BOLD)Target \$(BLUE)\$@ \$(BOLD)OK && \\ … … 1111 1113 @-umount \$(MOUNT_PT)/proc 1112 1114 @-if [ ! -f user-clfs-exist ]; then \\ 1113 userdel clfs; \\1114 rm -rf /home/ clfs; \\1115 userdel \$(LUSER); \\ 1116 rm -rf /home/\$(LUSER); \\ 1115 1117 fi; 1116 1118 … … 1147 1149 clean-jhalfs: 1148 1150 -if [ ! -f user-clfs-exist ]; then \\ 1149 userdel clfs; \\1150 rm -rf /home/ clfs; \\1151 userdel \$(LUSER); \\ 1152 rm -rf /home/\$(LUSER); \\ 1151 1153 fi; 1152 1154 rm -rf \$(MOUNT_PT)/tools … … 1178 1180 restore-clfs-env: 1179 1181 @\$(call echo_message, Building) 1180 @if [ -f /home/ clfs/.bashrc.XXX ]; then \\1181 mv -fv /home/ clfs/.bashrc.XXX /home/clfs/.bashrc; \\1182 @if [ -f /home/\$(LUSER)/.bashrc.XXX ]; then \\ 1183 mv -fv /home/\$(LUSER)/.bashrc.XXX /home/\$(LUSER)/.bashrc; \\ 1182 1184 fi; 1183 @if [ -f /home/ clfs/.bash_profile.XXX ]; then \\1184 mv -v /home/ clfs/.bash_profile.XXX /home/clfs/.bash_profile; \\1185 @if [ -f /home/\$(LUSER)/.bash_profile.XXX ]; then \\ 1186 mv -v /home/\$(LUSER)/.bash_profile.XXX /home/\$(LUSER)/.bash_profile; \\ 1185 1187 fi; 1186 @chown clfs:clfs /home/clfs/.bash* && \\1188 @chown \$(LUSER):\$(LGROUP) /home/\$(LUSER)/.bash* && \\ 1187 1189 touch \$@ && \\ 1188 1190 echo " "\$(BOLD)Target \$(BLUE)\$@ \$(BOLD)OK && \\
Note:
See TracChangeset
for help on using the changeset viewer.