/usr/share/grub-installer/functions.sh is in ubiquity 2.10.16.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 | # Make sure mtab in the chroot reflects the currently mounted partitions.
update_mtab() {
[ "$ROOT" ] || return 0
[ ! -h "$ROOT/etc/mtab" ] || 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
}
|