This file is indexed.

/usr/lib/fai/mount2dir is in fai-client 5.3.6ubuntu1.

This file is owned by root:root, with mode 0o755.

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
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
#! /bin/bash

#*********************************************************************
#
# mount2dir -- mount partitions to a directory using a fstab file
#
# This script is part of FAI (Fully Automatic Installation)
# (c) 2001-2015 by Thomas Lange, lange@informatik.uni-koeln.de
# Universitaet zu Koeln
#
#*********************************************************************
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
# General Public License for more details.
#
# A copy of the GNU General Public License is available as
# `/usr/share/common-licences/GPL' in the Debian GNU/Linux distribution
# or on the World Wide Web at http://www.gnu.org/copyleft/gpl.html.  You
# can also obtain it by writing to the Free Software Foundation, Inc.,
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
#*********************************************************************

# examples:
# mount new created partitions to /target
# mount2dir /target /tmp/fstab 1
#
# root filesystem already mounted. Found a fstab inside. Now mount
# the remaining partitons
# mount2dir $target $target/etc/fstab 0 ro
#
# TODO: option parsing with getopts, option for also mounting nfs directories
# matching a certain server name

target=$1 # where to mount
fstab=$2
fscheck=$3 # make fsck if 1
moptions=$4 # if set, use only this mount option (mostly -r)

# exit if too few parameters given
[ "$fstab" ] || {
    echo "Too few parameters."
    echo "Usage: mount2dir targetdir fstab [ fscheck mopt ]"
    exit 1
}

[ -f $fstab ] || {
    echo "No fstab file $fstab found."
    exit 2
}

(
while read device mountpoint fstype mopt dummy; do

    case $mopt in
        *noauto*) continue ;;
    esac

    [ "$mountpoint" == "none" ]  && continue
    [ "$fstype" == "swap" ]  && continue
    [ "$fstype" == "proc" ]  && continue
    [ "$fstype" == "usbfs" ]  && continue
    [ "$fstype" == "sysfs" ]  && continue
    [ "$fstype" == "tmpfs" ]  && continue
    [ "$fstype" == "devpts" ]  && continue

    case $device in
        ""|\#*) continue ;;

        /dev/*|LABEL=*|UUID=*)

            # overwrite mount options
            mopt="-o $mopt -o noatime"
            [ "$moptions" ] && mopt+=" -o $moptions"

            mkdir -p $target$mountpoint
            if [ $debug ]; then
                echo "Mounting $device to $target$mountpoint type: $fstype opt: $mopt"
            else
                [ X$verbose = X1 ] && echo "Mounting $device to $target$mountpoint"
            fi
            # should we fsck the partition first?
            [ "$fscheck" = 1 ] && fsck -nt $fstype $device
            [ $debug ] && echo "$BASH_SOURCE: calling 'mount -t $fstype $mopt $device $target$mountpoint'"
            mount -t $fstype $mopt $device $target$mountpoint || exit 4
    esac
done

) < $fstab