File: umountinitrd.sh

package info (click to toggle)
nslu2-utils 0.10%2Br71-9
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 304 kB
  • ctags: 5
  • sloc: sh: 2,408; perl: 780; makefile: 56
file content (24 lines) | stat: -rw-r--r-- 725 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#!/bin/sh
#
# umount /mnt, which is where the initrd ends up mounted
# if the directory /initrd is not present, if this fails
# then the /initrd is mounted and we want to remount that
# ro - this works round the shutdown -r hang problem
. /etc/default/functions
while read device directory remainder
do
	case "$directory" in
	/mnt)	echo "InitRD: unmount initrd on /mnt" >&2
		umount /mnt;;
	/initrd)# need the device for a remount
		ffspart=Flashdisk
		ffsdev="$(mtblockdev $ffspart)"
		echo "InitRD: remount $ffdev read-only on /initrd" >&2
		if test -n "$ffsdev" -a -b "$ffsdev"
		then
			mount -o remount,ro "$ffsdev" /initrd
		else
			echo "Flashdisk: $ffsdev: flash device not found" >&2
		fi;;
	esac
done </proc/mounts