Projet

Général

Profil

« Précédent | Suivant » 

Révision f5813962

Ajouté par Renato Botelho il y a presque 10 ans

Sometimes fsck requires a second run, teach rc script to call it more than once when it's necessary

Voir les différences:

etc/rc
72 72
	# Mount /. If it fails run a fsck.
73 73
	if [ "$PLATFORM" = "nanobsd" ]; then
74 74
		export PKG_TMPDIR=/root/
75
		/sbin/mount -uw / || (/sbin/fsck -y /; /sbin/fsck -y /cf; /sbin/mount -uw /)
76
	else 
77
		/sbin/mount -a || (/sbin/fsck -y /; /sbin/mount -a)
75
		/sbin/mount -uw / 2>/dev/null
76
		mount_rc=$?
77
		attempts=0
78
		while [ ${mount_rc} != 0 -a ${attempts} -lt 3 ]; do
79
			/sbin/fsck -y /
80
			/sbin/fsck -y /cf
81
			/sbin/mount -uw / 2>/dev/null
82
			mount_rc=$?
83
			attempts=$((attempts+1))
84
		done
85
	else
86
		/sbin/mount -a 2>/dev/null
87
		mount_rc=$?
88
		attempts=0
89
		while [ ${mount_rc} != 0 -a ${attempts} -lt 3 ]; do
90
			/sbin/fsck -y /
91
			/sbin/mount -a 2>/dev/null
92
			mount_rc=$?
93
			attempts=$((attempts+1))
94
		done
78 95
	fi
79 96

  
80 97
	# If /conf is a directory, convert it to a symlink to /cf/conf
......
92 109
		# If it fails to mount then run a fsck -y
93 110
		if grep -q cf /etc/fstab; then
94 111
			/sbin/mount -w /cf 2>/dev/null
95
			/sbin/mount -uw /cf || \
96
				(/sbin/umount /cf; /sbin/fsck -y /cf; /sbin/mount -w /cf)
112
			/sbin/mount -uw /cf 2>/dev/null
113
			mount_rc=$?
114
			attempts=0
115
			while [ ${mount_rc} != 0 -a ${attempts} -lt 3 ]; do
116
				/sbin/umount /cf
117
				/sbin/fsck -y /cf
118
				/sbin/mount -w /cf 2>/dev/null
119
				mount_rc=$?
120
				attempts=$((attempts+1))
121
			done
97 122
		fi
98 123
	fi
99 124

  

Formats disponibles : Unified diff