Changeset 5bc19fc for bootscripts/lfs
- Timestamp:
- 08/30/2011 10:54:52 PM (13 years ago)
- Branches:
- 10.0, 10.0-rc1, 10.1, 10.1-rc1, 11.0, 11.0-rc1, 11.0-rc2, 11.0-rc3, 11.1, 11.1-rc1, 11.2, 11.2-rc1, 11.3, 11.3-rc1, 12.0, 12.0-rc1, 12.1, 12.1-rc1, 7.0, 7.1, 7.2, 7.3, 7.4, 7.5, 7.5-systemd, 7.6, 7.6-systemd, 7.7, 7.7-systemd, 7.8, 7.8-systemd, 7.9, 7.9-systemd, 8.0, 8.1, 8.2, 8.3, 8.4, 9.0, 9.1, arm, bdubbs/gcc13, ml-11.0, multilib, renodr/libudev-from-systemd, s6-init, trunk, xry111/arm64, xry111/arm64-12.0, xry111/clfs-ng, xry111/lfs-next, xry111/loongarch, xry111/loongarch-12.0, xry111/loongarch-12.1, xry111/mips64el, xry111/pip3, xry111/rust-wip-20221008, xry111/update-glibc
- Children:
- fe1643e
- Parents:
- c0ad0ec
- Location:
- bootscripts/lfs
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
bootscripts/lfs/init.d/cleanfs
rc0ad0ec r5bc19fc 31 31 # Function to create files/directory on boot. 32 32 create_files() { 33 34 35 36 37 38 39 40 33 # Read in the configuration file. 34 exec 9>&0 < /etc/sysconfig/createfiles 35 while read name type perm usr grp dtype maj min junk 36 do 37 # Ignore comments and blank lines. 38 case "${name}" in 39 ""|\#*) continue ;; 40 esac 41 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 42 # Ignore existing files. 43 if [ ! -e "${name}" ]; then 44 # Create stuff based on its type. 45 case "${type}" in 46 dir) 47 mkdir "${name}" 48 ;; 49 file) 50 :> "${name}" 51 ;; 52 dev) 53 case "${dtype}" in 54 char) 55 mknod "${name}" c ${maj} ${min} 56 ;; 57 block) 58 mknod "${name}" b ${maj} ${min} 59 ;; 60 pipe) 61 mknod "${name}" p 62 ;; 63 *) 64 boot_mesg -n "\nUnknown device type: ${dtype}" ${WARNING} 65 boot_mesg "" ${NORMAL} 66 ;; 67 esac 68 ;; 69 *) 70 boot_mesg -n "\nUnknown type: ${type}" ${WARNING} 71 boot_mesg "" ${NORMAL} 72 continue 73 ;; 74 esac 75 75 76 77 78 79 80 81 76 # Set up the permissions, too. 77 chown ${usr}:${grp} "${name}" 78 chmod ${perm} "${name}" 79 fi 80 done 81 exec 0>&9 9>&- 82 82 } 83 83 84 84 case "${1}" in 85 86 85 start) 86 boot_mesg -n "Cleaning file systems:" ${INFO} 87 87 88 88 if [ "${SKIPTMPCLEAN}" = "" ]; then 89 90 91 89 boot_mesg -n " /tmp" ${NORMAL} 90 cd /tmp && 91 find . -xdev -mindepth 1 ! -name lost+found -delete || failed=1 92 92 fi 93 93 94 94 > /var/run/utmp 95 95 96 97 98 99 96 if grep -q '^utmp:' /etc/group ; then 97 chmod 664 /var/run/utmp 98 chgrp utmp /var/run/utmp 99 fi 100 100 101 102 101 (exit ${failed}) 102 evaluate_retval 103 103 104 105 106 107 108 109 110 111 112 113 104 if egrep -qv '^(#|$)' /etc/sysconfig/createfiles 2>/dev/null; then 105 boot_mesg "Creating files and directories..." 106 create_files 107 evaluate_retval 108 fi 109 ;; 110 *) 111 echo "Usage: ${0} {start}" 112 exit 1 113 ;; 114 114 esac 115 115 -
bootscripts/lfs/init.d/mountfs
rc0ad0ec r5bc19fc 58 58 stop) 59 59 boot_mesg "Unmounting all other currently mounted file systems..." 60 umount -a -d -r >/dev/null60 umount -a -d -r -t notmpfs >/dev/null 61 61 evaluate_retval 62 62 ;; -
bootscripts/lfs/sysconfig/createfiles
rc0ad0ec r5bc19fc 9 9 # 10 10 # Notes : The syntax of this file is as follows: 11 # 12 # 13 # 14 # 11 # if type is equal to "file" or "dir" 12 # <filename> <type> <permissions> <user> <group> 13 # if type is equal to "dev" 14 # <filename> <type> <permissions> <user> <group> <devtype> <major> <minor> 15 15 # 16 # 17 # 18 # 19 # 20 # 21 # 22 # 23 # 24 # 25 # 16 # <filename> is the name of the file which is to be created 17 # <type> is either file, dir, or dev. 18 # file creates a new file 19 # dir creates a new directory 20 # dev creates a new device 21 # <devtype> is either block, char or pipe 22 # block creates a block device 23 # char creates a character deivce 24 # pipe creates a pipe, this will ignore the <major> and <minor> fields 25 # <major> and <minor> are the major and minor numbers used for the device. 26 26 ######################################################################## 27 27
Note:
See TracChangeset
for help on using the changeset viewer.