2014-04-01 12:31:48 +00:00
|
|
|
#! /bin/bash
|
|
|
|
#
|
|
|
|
# Called as filter-modules.sh list-of-modules Arch
|
|
|
|
|
2014-05-02 01:10:44 +00:00
|
|
|
# This script filters the modules into the kernel-core and kernel-modules
|
2014-04-01 12:31:48 +00:00
|
|
|
# subpackages. We list out subsystems/subdirs to prune from the installed
|
|
|
|
# module directory. What is left is put into the kernel-core package. What is
|
2014-05-02 01:10:44 +00:00
|
|
|
# pruned is contained in the kernel-modules package.
|
2014-04-01 12:31:48 +00:00
|
|
|
#
|
|
|
|
# This file contains the default subsys/subdirs to prune from all architectures.
|
|
|
|
# If an architecture needs to differ, we source a per-arch filter-<arch>.sh file
|
|
|
|
# that contains the set of override lists to be used instead. If a module or
|
2014-05-02 01:10:44 +00:00
|
|
|
# subsys should be in kernel-modules on all arches, please change the defaults
|
2014-04-01 12:31:48 +00:00
|
|
|
# listed here.
|
|
|
|
|
|
|
|
# Set the default dirs/modules to filter out
|
2016-01-17 12:49:32 +00:00
|
|
|
driverdirs="atm auxdisplay bcma bluetooth firewire fmc iio infiniband isdn leds media memstick mfd mmc mtd nfc ntb pcmcia platform power ssb staging tty uio uwb w1"
|
|
|
|
|
|
|
|
chardrvs="mwave pcmcia"
|
2014-04-01 12:31:48 +00:00
|
|
|
|
2015-07-31 15:49:28 +00:00
|
|
|
netdrvs="appletalk can dsa hamradio ieee802154 irda ppp slip usb wireless"
|
2014-04-01 12:31:48 +00:00
|
|
|
|
2017-07-27 14:21:20 +00:00
|
|
|
ethdrvs="3com adaptec alteon amd aquantia atheros broadcom cadence calxeda chelsio cisco dec dlink emulex icplus marvell mellanox neterion nvidia oki-semi packetengines qlogic rdc renesas sfc silan sis smsc stmicro sun tehuti ti wiznet xircom"
|
2014-04-01 12:31:48 +00:00
|
|
|
|
2016-01-15 07:37:22 +00:00
|
|
|
inputdrvs="gameport tablet touchscreen"
|
|
|
|
|
2017-03-06 15:43:15 +00:00
|
|
|
scsidrvs="aacraid aic7xxx aic94xx be2iscsi bfa bnx2i bnx2fc csiostor cxgbi esas2r fcoe fnic isci libsas lpfc megaraid mpt2sas mpt3sas mvsas pm8001 qla2xxx qla4xxx sym53c8xx_2 ufs qedf"
|
2014-04-01 12:31:48 +00:00
|
|
|
|
2016-01-15 07:37:20 +00:00
|
|
|
usbdrvs="atm image misc serial wusbcore"
|
2014-04-01 12:31:48 +00:00
|
|
|
|
2017-08-03 18:38:01 +00:00
|
|
|
fsdrvs="affs befs coda cramfs dlm ecryptfs hfs hfsplus jfs minix ncpfs nilfs2 ocfs2 reiserfs romfs squashfs sysv ubifs ufs"
|
2014-04-01 12:31:48 +00:00
|
|
|
|
2016-01-15 07:37:24 +00:00
|
|
|
netprots="6lowpan appletalk atm ax25 batman-adv bluetooth can dccp dsa ieee802154 irda l2tp mac80211 mac802154 mpls netrom nfc rds rfkill rose sctp wireless"
|
2014-04-01 12:31:48 +00:00
|
|
|
|
2018-01-29 22:28:36 +00:00
|
|
|
drmdrvs="amd ast bridge gma500 i2c i915 mgag200 nouveau radeon via "
|
2014-04-01 12:31:48 +00:00
|
|
|
|
2017-11-16 23:35:03 +00:00
|
|
|
singlemods="ntb_netdev iscsi_ibft iscsi_boot_sysfs megaraid pmcraid qedi qla1280 9pnet_rdma rpcrdma nvmet-rdma nvme-rdma hid-picolcd hid-prodikeys hwa-hc hwpoison-inject hid-sensor-hub target_core_user sbp_target cxgbit iw_cxgb3 iw_cxgb4 cxgb3i cxgb3i cxgb3i_ddp cxgb4i chcr parport_serial"
|
2014-04-01 12:31:48 +00:00
|
|
|
|
|
|
|
# Grab the arch-specific filter list overrides
|
|
|
|
source ./filter-$2.sh
|
|
|
|
|
|
|
|
filter_dir() {
|
|
|
|
filelist=$1
|
|
|
|
dir=$2
|
|
|
|
|
|
|
|
grep -v -e "${dir}/" ${filelist} > ${filelist}.tmp
|
|
|
|
|
|
|
|
if [ $? -ne 0 ]
|
|
|
|
then
|
|
|
|
echo "Couldn't remove ${dir}. Skipping."
|
|
|
|
else
|
|
|
|
grep -e "${dir}/" ${filelist} >> k-d.list
|
|
|
|
mv ${filelist}.tmp $filelist
|
|
|
|
fi
|
|
|
|
|
|
|
|
return 0
|
|
|
|
}
|
|
|
|
|
|
|
|
filter_ko() {
|
|
|
|
filelist=$1
|
|
|
|
mod=$2
|
|
|
|
|
|
|
|
grep -v -e "${mod}.ko" ${filelist} > ${filelist}.tmp
|
|
|
|
|
|
|
|
if [ $? -ne 0 ]
|
|
|
|
then
|
|
|
|
echo "Couldn't remove ${mod}.ko Skipping."
|
|
|
|
else
|
|
|
|
grep -e "${mod}.ko" ${filelist} >> k-d.list
|
|
|
|
mv ${filelist}.tmp $filelist
|
|
|
|
fi
|
|
|
|
|
|
|
|
return 0
|
|
|
|
}
|
|
|
|
|
|
|
|
# Filter the drivers/ subsystems
|
|
|
|
for subsys in ${driverdirs}
|
|
|
|
do
|
|
|
|
filter_dir $1 drivers/${subsys}
|
|
|
|
done
|
|
|
|
|
|
|
|
# Filter the networking drivers
|
|
|
|
for netdrv in ${netdrvs}
|
|
|
|
do
|
|
|
|
filter_dir $1 drivers/net/${netdrv}
|
|
|
|
done
|
|
|
|
|
2016-01-17 12:49:32 +00:00
|
|
|
# Filter the char drivers
|
|
|
|
for char in ${chardrvs}
|
|
|
|
do
|
|
|
|
filter_dir $1 drivers/char/${input}
|
|
|
|
done
|
|
|
|
|
2014-04-01 12:31:48 +00:00
|
|
|
# Filter the ethernet drivers
|
|
|
|
for eth in ${ethdrvs}
|
|
|
|
do
|
|
|
|
filter_dir $1 drivers/net/ethernet/${eth}
|
|
|
|
done
|
|
|
|
|
|
|
|
# SCSI
|
|
|
|
for scsi in ${scsidrvs}
|
|
|
|
do
|
|
|
|
filter_dir $1 drivers/scsi/${scsi}
|
|
|
|
done
|
|
|
|
|
2016-01-15 07:37:22 +00:00
|
|
|
# Input
|
|
|
|
for input in ${inputdrvs}
|
|
|
|
do
|
|
|
|
filter_dir $1 drivers/input/${input}
|
|
|
|
done
|
|
|
|
|
2014-04-01 12:31:48 +00:00
|
|
|
# USB
|
|
|
|
for usb in ${usbdrvs}
|
|
|
|
do
|
|
|
|
filter_dir $1 drivers/usb/${usb}
|
|
|
|
done
|
|
|
|
|
|
|
|
# Filesystems
|
|
|
|
for fs in ${fsdrvs}
|
|
|
|
do
|
|
|
|
filter_dir $1 fs/${fs}
|
|
|
|
done
|
|
|
|
|
|
|
|
# Network protocols
|
|
|
|
for prot in ${netprots}
|
|
|
|
do
|
|
|
|
filter_dir $1 kernel/net/${prot}
|
|
|
|
done
|
|
|
|
|
|
|
|
# DRM
|
|
|
|
for drm in ${drmdrvs}
|
|
|
|
do
|
|
|
|
filter_dir $1 drivers/gpu/drm/${drm}
|
|
|
|
done
|
|
|
|
|
|
|
|
# Just kill sound.
|
|
|
|
filter_dir $1 kernel/sound
|
|
|
|
|
|
|
|
# Now go through and filter any single .ko files that might have deps on the
|
|
|
|
# things we filtered above
|
|
|
|
for mod in ${singlemods}
|
|
|
|
do
|
|
|
|
filter_ko $1 ${mod}
|
|
|
|
done
|
|
|
|
|
|
|
|
# Go through our generated drivers list and remove the .ko files. We'll
|
|
|
|
# restore them later.
|
|
|
|
for mod in `cat k-d.list`
|
|
|
|
do
|
|
|
|
rm -rf $mod
|
|
|
|
done
|