File: functions.sh

package info (click to toggle)
grub-installer 1.22etch1
  • links: PTS
  • area: main
  • in suites: etch
  • size: 908 kB
  • ctags: 26
  • sloc: sh: 650; makefile: 36
file content (20 lines) | stat: -rw-r--r-- 609 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
# Make sure mtab in the chroot reflects the currently mounted partitions.
update_mtab() {
	[ "$ROOT" ] || return 0

	mtab=$ROOT/etc/mtab
	grep "$ROOT" /proc/mounts | (
	while read devpath mountpoint fstype options n1 n2 ; do
		devpath=`mapdevfs $devpath || echo $devpath`
		mountpoint=`echo $mountpoint | sed "s%^$ROOT%%"`
		# The sed line removes the mount point for root.
		if [ -z "$mountpoint" ] ; then
			mountpoint="/"
		fi
		echo $devpath $mountpoint $fstype $options $n1 $n2
	done ) > $mtab
}

is_floppy () {
	echo "$1" | grep -q '(fd' || echo "$1" | grep -q "/dev/fd" || echo "$1" | grep -q floppy
}