Blame SOURCES/filter-modules.sh

f70460
#! /bin/bash
f70460
#
f70460
# Called as filter-modules.sh list-of-modules Arch
f70460
f70460
# This script filters the modules into the kernel-core and kernel-modules
f70460
# subpackages.  We list out subsystems/subdirs to prune from the installed
f70460
# module directory.  What is left is put into the kernel-core package.  What is
f70460
# pruned is contained in the kernel-modules package.
f70460
#
f70460
# This file contains the default subsys/subdirs to prune from all architectures.
f70460
# If an architecture needs to differ, we source a per-arch filter-<arch>.sh file
f70460
# that contains the set of override lists to be used instead.  If a module or
f70460
# subsys should be in kernel-modules on all arches, please change the defaults
f70460
# listed here.
f70460
f70460
# Set the default dirs/modules to filter out
9e9920
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 virt"
f70460
f70460
chardrvs="mwave pcmcia"
f70460
f70460
netdrvs="appletalk can dsa hamradio ieee802154 irda ppp slip usb wireless"
f70460
f70460
ethdrvs="3com adaptec alteon amd aquantia atheros broadcom cadence calxeda chelsio cisco dec dlink emulex icplus marvell neterion nvidia oki-semi packetengines qlogic rdc renesas sfc silan sis smsc stmicro sun tehuti ti wiznet xircom"
f70460
f70460
inputdrvs="gameport tablet touchscreen"
f70460
f70460
scsidrvs="aacraid aic7xxx aic94xx be2iscsi bfa bnx2i bnx2fc csiostor cxgbi esas2r fcoe fnic hisi_sas isci libsas lpfc megaraid mpt2sas mpt3sas mvsas pm8001 qla2xxx qla4xxx sym53c8xx_2 ufs qedf"
f70460
f70460
usbdrvs="atm image misc serial wusbcore"
f70460
9e9920
fsdrvs="affs befs cifs coda cramfs ecryptfs hfs hfsplus jfs minix ncpfs nilfs2 ocfs2 reiserfs romfs squashfs sysv ubifs ufs"
f70460
f70460
netprots="6lowpan appletalk atm ax25 batman-adv bluetooth can dccp dsa ieee802154 irda l2tp mac80211 mac802154 mpls netrom nfc rds rfkill rose sctp smc wireless"
f70460
f70460
drmdrvs="amd ast gma500 i2c i915 mgag200 nouveau radeon via "
f70460
257349
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 ism xt_u32 act_ct"
f70460
f70460
# Grab the arch-specific filter list overrides
f70460
source ./filter-$2.sh
f70460
f70460
filter_dir() {
f70460
	filelist=$1
f70460
	dir=$2
f70460
f70460
	grep -v -e "${dir}/" ${filelist} > ${filelist}.tmp
f70460
f70460
	if [ $? -ne 0 ]
f70460
	then
f70460
		echo "Couldn't remove ${dir}.  Skipping."
f70460
	else
f70460
		grep -e "${dir}/" ${filelist} >> k-d.list
f70460
		mv ${filelist}.tmp $filelist
f70460
	fi
f70460
	
f70460
	return 0
f70460
}
f70460
f70460
filter_ko() {
f70460
	filelist=$1
f70460
	mod=$2
f70460
f70460
	grep -v -e "${mod}.ko" ${filelist} > ${filelist}.tmp
f70460
f70460
	if [ $? -ne 0 ]
f70460
	then
f70460
		echo "Couldn't remove ${mod}.ko  Skipping."
f70460
	else
f70460
		grep -e "${mod}.ko" ${filelist} >> k-d.list
f70460
		mv ${filelist}.tmp $filelist
f70460
	fi
f70460
	
f70460
	return 0
f70460
}
f70460
f70460
# Filter the drivers/ subsystems
f70460
for subsys in ${driverdirs}
f70460
do
f70460
	filter_dir $1 drivers/${subsys}
f70460
done
f70460
f70460
# Filter the networking drivers
f70460
for netdrv in ${netdrvs}
f70460
do
f70460
	filter_dir $1 drivers/net/${netdrv}
f70460
done
f70460
f70460
# Filter the char drivers
f70460
for char in ${chardrvs}
f70460
do
f70460
	filter_dir $1 drivers/char/${input}
f70460
done
f70460
f70460
# Filter the ethernet drivers
f70460
for eth in ${ethdrvs}
f70460
do
f70460
	filter_dir $1 drivers/net/ethernet/${eth}
f70460
done
f70460
f70460
# SCSI
f70460
for scsi in ${scsidrvs}
f70460
do
f70460
	filter_dir $1 drivers/scsi/${scsi}
f70460
done
f70460
f70460
# Input
f70460
for input in ${inputdrvs}
f70460
do
f70460
	filter_dir $1 drivers/input/${input}
f70460
done
f70460
f70460
# USB
f70460
for usb in ${usbdrvs}
f70460
do
f70460
	filter_dir $1 drivers/usb/${usb}
f70460
done
f70460
f70460
# Filesystems
f70460
for fs in ${fsdrvs}
f70460
do
f70460
	filter_dir $1 fs/${fs}
f70460
done
f70460
f70460
# Network protocols
f70460
for prot in ${netprots}
f70460
do
f70460
	filter_dir $1 kernel/net/${prot}
f70460
done
f70460
f70460
# DRM
f70460
for drm in ${drmdrvs}
f70460
do
f70460
	filter_dir $1 drivers/gpu/drm/${drm}
f70460
done
f70460
f70460
# Just kill sound.
f70460
filter_dir $1 kernel/sound
9e9920
filter_ko $1 drivers/base/regmap/regmap-sdw
99460b
filter_ko $1 drivers/base/regmap/regmap-sdw-mbq
9e9920
filter_dir $1 drivers/soundwire
f70460
f70460
# Now go through and filter any single .ko files that might have deps on the
f70460
# things we filtered above
f70460
for mod in ${singlemods}
f70460
do
f70460
        filter_ko $1 ${mod}
f70460
done
f70460
f70460
# Go through our generated drivers list and remove the .ko files.  We'll
f70460
# restore them later.
f70460
for mod in `cat k-d.list`
f70460
do
f70460
	rm -rf $mod
f70460
done