This file is indexed.

/usr/share/tcos/hooks/tcosmods is in initramfs-tools-tcos 0.89.93ubuntu2.

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
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
#!/bin/bash

# new header not using prereqs
if [ "$1" = "prereqs" ]; then
  echo ""
  exit 0
fi


# Hooks for loading necesary modules for the tcos system into the initramfs
#
. /usr/share/initramfs-tools/hook-functions

. $CONFDIR/initramfs.conf

# read from env vars TCOS_BOOT
TCOS_BOOT=$(env| awk -F "=" '/^TCOS_BOOT=/ {print $2}')
if [ "${TCOS_BOOT}" != "" ]; then
  BOOT=$TCOS_BOOT
fi

if [ "${BOOT}" = "tcos" ]; then

. $CONFDIR/tcos.conf
. $TCOS_DIR/tcos-modules.conf
. $TCOS_DIR/tcos-generation-functions.sh

for tpl in $(tcos_get_templates); do
  _verbose "(tcosmods) loading template $(basename $tpl)"
  . $tpl
done


# load forced settings for derivatives
if [ -d $CONFDIR/conf.d/ ]; then
  for file in $CONFDIR/conf.d/tcos*conf; do
    [ -e $file ] && . $file
  done
fi


TCOS_USB=$(read_env_var "TCOS_USB" "$TCOS_USB")
TCOS_XORG=$(read_env_var "TCOS_XORG" "$TCOS_XORG")
TCOS_SOUND=$(read_env_var "TCOS_SOUND" "$TCOS_SOUND")
TCOS_DISABLE_USB=$(read_env_var "TCOS_DISABLE_USB" "$TCOS_DISABLE_USB")
TCOS_DISABLE_IDE=$(read_env_var "TCOS_DISABLE_IDE" "$TCOS_DISABLE_IDE")



    if [ "$TCOS_USB" != "1" ] ;then
        _echo "   * Not USB support"
        USB_MODULES=""
        TCOS_DISABLE_USB=1
    fi

    if [ "$TCOS_XORG" != "1" ]; then
        _echo "   * Not Xorg support"
        XORG_MODULES=""
    fi


    if [ "$TCOS_SOUND" != "1" ]; then
        _echo "   * Not Sound support"
        SOUND_MODULES=""
    fi

    if [ "$TCOS_SOUND_ISA" != "1" ]; then
       _echo "   * Not Sound ISA modules"
       SOUNDISA_MODULES=""
    else
       #ISADIR=$(find /lib/modules/${TCOS_KERNEL}/ -type d -name isa)
       #SOUNDISA_MODULES=$(find ${ISADIR} -type f -exec basename '{}' \; | sed s/".ko"//g)
       SOUNDISA_MODULES="snd-gusmax snd-gusclassic snd-gusextreme snd-gus-synth snd-gus-lib snd-interwave-stb snd-interwave snd-opl3sa2 snd-als100 snd-miro snd-opti93x snd-opti92x-ad1848 snd-opti92x-cs4231 snd-adlib snd-es18xx snd-dt019x snd-sb8 snd-sb16 snd-es968 snd-sb16-csp snd-sb8-dsp snd-sbawe snd-sb16-dsp snd-sb-common snd-emu8000-synth snd-sgalaxy snd-cs4236-lib snd-cs4231 snd-cs4231-lib snd-cs4236 snd-cs4232 snd-es1688 snd-es1688-lib snd-sscape snd-ad1848-lib snd-ad1848 snd-cmi8330 snd-azt2320 snd-ad1816a snd-wavefront"
    fi

    MODULES="${CORE_MODULES} ${USB_MODULES} ${LIVE_MODULES} ${NETWORK_MODULES}"
    MODULES="${MODULES} ${XORG_MODULES} ${SOUND_MODULES} ${SOUNDISA_MODULES} ${MYTCOS_MODULES} "

    for x in ${MODULES} ; do
      _verbose "(tcosmods) Adding module ${x}"
      #manual_add_modules ${x}
      tcos_manual_add_modules ${x} 
      #force_add_module ${x}
    done

    BLACKLIST_MODULES="${BLACKLIST_MODULES}"

    for x in ${BLACKLIST_MODULES} ; do
      _verbose "(tcosmods) blacklist module ${x}"
      echo "blacklist ${x}" >> ${DESTDIR}/etc/modprobe.d/blacklist-tcos.conf
    done

    # put floppy outside /lib/modules
    mkdir -p $DESTDIR/lib/extramodules


    if tcos_find_module "floppy"; then
        FLOPPY_MOD=$(find /lib/modules/${TCOS_KERNEL} -name floppy.ko | tail -1)
    fi
    if tcos_find_module "ide-floppy"; then
        FLOPPY_IDE_MOD=$(find /lib/modules/${TCOS_KERNEL} -name ide-floppy.ko | tail -1)
    fi

    if [ "${FLOPPY_MOD}" != "" ]; then
      # don't use cpifexists
      cp -a "${FLOPPY_MOD}" $DESTDIR/lib/extramodules

      # delete floppy kernel
      rm -f ${DESTDIR}/${FLOPPY_MOD}
    fi

    if [ "${FLOPPY_IDE_MOD}" != "" ]; then
      # don't use cpifexists
      cp -a "${FLOPPY_IDE_MOD}" $DESTDIR/lib/extramodules

      # delete floppy kernel
      rm -f ${DESTDIR}/${FLOPPY_IDE_MOD}
    fi

    if [ "$TCOS_EXTRA_MODULES" != "" ]; then
       TCOS_EXTRA_MODULES=$(echo ${TCOS_EXTRA_MODULES} | sed s/","/" "/g)
       for module in ${TCOS_EXTRA_MODULES}; do
         _echo "   TCOS extra module: adding ${module}"
         tcos_manual_add_modules ${module}
       done
    fi

    if [ "$TCOS_BLACKLIST_MODULES" != "" ]; then
       TCOS_BLACKLIST_MODULES=$(echo ${TCOS_BLACKLIST_MODULES} | sed s/","/" "/g)
       for module in ${TCOS_BLACKLIST_MODULES}; do
         _echo "   TCOS blacklist module: adding ${module}"
         echo "blacklist ${module}" >> ${DESTDIR}/etc/modprobe.d/blacklist-tcos.conf
       done
    fi

    if [ "$TCOS_DISABLE_USB" = "1" ] ;then
       # delete some SCSI and USB stuff because we boot from network
       _echo "   * DISABLE USB : deleting some SCSI and USB kernel modules..."
       rm -rf ${DESTDIR}/lib/modules/${version}/kernel/drivers/usb/
       rm -rf ${DESTDIR}/lib/modules/${version}/kernel/drivers/scsi/
       rm -rf ${DESTDIR}/lib/modules/${version}/kernel/drivers/ieee1394/
       rm -rf ${DESTDIR}/lib/modules/${version}/kernel/drivers/md/
       rm -rf ${DESTDIR}/lib/modules/${version}/kernel/drivers/cdrom/
       rm -rf ${DESTDIR}/lib/modules/${version}/kernel/drivers/block/
       # restore deleted loop module
       tcos_manual_add_modules loop
    fi

    if [ "$TCOS_DISABLE_IDE" = "1" ] ;then
       # delete some IDE and filesystem modules
       _echo "   * DISABLE IDE : deleting some IDE and FS kernel modules..."
       rm -rf ${DESTDIR}/lib/modules/${version}/kernel/fs/reiserfs/
       rm -rf ${DESTDIR}/lib/modules/${version}/kernel/fs/xfs/
       rm -rf ${DESTDIR}/lib/modules/${version}/kernel/fs/ext3/
       rm -rf ${DESTDIR}/lib/modules/${version}/kernel/fs/isofs/
       rm -rf ${DESTDIR}/lib/modules/${version}/kernel/fs/isofs/
       rm -rf ${DESTDIR}/lib/modules/${version}/kernel/drivers/ide/
       rm -rf ${DESTDIR}/lib/modules/${version}/kernel/drivers/ata/
       rm -f ${DESTDIR}/sbin/vgchange
       rm -f ${DESTDIR}/lib/libdevmapper*
    fi


    if [ "$TCOS_CPUFREQ" = "1" ]; then
        for _mod in $(find /lib/modules/${TCOS_KERNEL} | grep cpufreq| grep ko$); do
            tcos_manual_add_modules $(basename $_mod .ko)
        done
    fi

fi