[OS-BUILD PATCH 1/2] spec: rework filter-mods and mod-denylist

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Jan Stancek <jstancek@xxxxxxxxxx>

spec: rework filter-mods and mod-denylist

Replace filter-modules* shell scripts, which are a constant pain
to keep updated. Main advantage of new script is that it takes
kmod and package dependencies into account, so config doesn't
require you to list every kmod (and its dependencies) explicitly.

mod-denylist is trimmed down to only generate blacklist files,
and no longer does any kmod file moves or looks at dependencies.

Signed-off-by: Jan Stancek <jstancek@xxxxxxxxxx>

diff --git a/redhat/Makefile b/redhat/Makefile
index blahblah..blahblah 100644
--- a/redhat/Makefile
+++ b/redhat/Makefile
@@ -692,11 +692,9 @@ sources-rh: $(TARBALL) $(KABI_TARBALL) $(KABIDW_TARBALL) generate-testpatch-tmp
 		configs/$(SPECPACKAGE_NAME)-*.config \
 		configs/partial*.config \
 		scripts/gating/gating.yaml \
+		scripts/filtermods.py \
 		scripts/mod/mod-denylist.sh \
-		scripts/mod/mod-internal.list \
-		scripts/mod/mod-partner.list \
 		scripts/mod/mod-sign.sh \
-		scripts/mod/mod-kvm.list \
 		configs/flavors \
 		configs/generate_all_configs.sh \
 		configs/merge.py \
diff --git a/redhat/fedora_files/def_variants.yaml.fedora b/redhat/fedora_files/def_variants.yaml.fedora
new file mode 100644
index blahblah..blahblah 100644
--- /dev/null
+++ b/redhat/fedora_files/def_variants.yaml.fedora
@@ -0,0 +1,504 @@
+packages:
+  - name: modules-core
+    depends-on: []
+  - name: modules
+    depends-on:
+    - modules-core
+  - name: modules-internal
+    depends-on:
+    - modules-core
+    - modules
+  - name: modules-extra
+    depends-on:
+    - modules-core
+    - modules
+  - name: modules-rt-kvm
+    if_variant_in: ["rt"]
+    depends-on:
+    - modules-core
+
+
+rules:
+  - arch/x86/kvm/kvm(-amd|-intel|\.).*: modules-rt-kvm
+    if_variant_in: ["rt"]
+
+  - arch/.*: modules-core
+  - crypto/.*: modules-core
+
+  - drivers/accel/.*: modules-core
+  - drivers/accessibility/.*: modules-core
+  - drivers/acpi/video.*: modules
+  - drivers/acpi/.*: modules-core
+  - drivers/ata/.*: modules-core
+
+  - drivers/base/.*(kunit|test).*: modules-internal
+  - drivers/base/regmap/regmap-sdw.*: modules
+  - drivers/base/.*: modules-core
+  - drivers/block/floppy.*: modules-extra
+  - drivers/block/rnbd.*: modules
+  - drivers/block/.*: modules-core
+  - drivers/bus/.*: modules-core
+
+  - drivers/cdx/.*: modules-core
+  - drivers/char/mwave.*: modules
+  - drivers/char/.*: modules-core
+  - drivers/clk/.*test.*: modules-internal
+  - drivers/clk/.*: modules-core
+  - drivers/counter/.*: modules-core
+  - drivers/cpufreq/.*: modules-core
+  - drivers/crypto/caam/.*: modules
+  - drivers/crypto/cavium/.*: modules
+  - drivers/crypto/chelsio/.*: modules
+  - drivers/crypto/hisilicon/.*: modules
+  - drivers/crypto/marvell/.*: modules
+  - drivers/crypto/.*: modules-core
+  - drivers/cxl/.*: modules-core
+
+  - drivers/dax/.*: modules-core
+  - drivers/dca/.*: modules-core
+  - drivers/devfreq/.*: modules-core
+  - drivers/dma/dmatest.*: modules-internal
+  - drivers/dma/.*: modules-core
+
+  - drivers/edac/.*: modules-core
+  - drivers/extcon/.*: modules-core
+
+  - drivers/firmware/iscsi_ibft.*: modules
+  - drivers/firmware/.*: modules-core
+  - drivers/fsi/.*: modules-core
+
+  - drivers/gnss/.*: modules-core
+  - drivers/gpio/gpio-dln2.*: modules-extra
+  - drivers/gpio/gpio-ljca.*: modules
+  - drivers/gpio/.*: modules-core
+  - drivers/gpu/drm/i915/kvmgt.*: modules-rt-kvm
+    if_variant_in: ["rt"]
+  - drivers/gpu/drm/display/drm_.*: modules-core
+  - drivers/gpu/drm/drm.*: modules-core
+  - drivers/gpu/drm/etnaviv/.*: modules-core
+  - drivers/gpu/drm/gud/.*: modules-core
+  - drivers/gpu/drm/hyperv/.*: modules-core
+  - drivers/gpu/drm/imagination/.*: modules-core
+  - drivers/gpu/drm/lima/.*: modules-core
+  - drivers/gpu/drm/mxsfb/.*: modules-core
+  - drivers/gpu/drm/panfrost/.*: modules-core
+  - drivers/gpu/drm/qxl/.*: modules-core
+  - drivers/gpu/drm/scheduler/.*: modules-core
+  - drivers/gpu/drm/solomon/.*: modules-core
+  - drivers/gpu/drm/tests/.*: modules-internal
+  - drivers/gpu/drm/tidss/.*: modules-core
+  - drivers/gpu/drm/tiny/.*: modules-core
+  - drivers/gpu/drm/ttm/.*: modules-core
+  - drivers/gpu/drm/udl/.*: modules-core
+  - drivers/gpu/drm/v3d/.*: modules-core
+  - drivers/gpu/drm/vgem/.*: modules-core
+  - drivers/gpu/drm/virtio/.*: modules-core
+  - drivers/gpu/drm/vkms/.*: modules-core
+  - drivers/gpu/drm/vmwgfx/.*: modules-core
+  - drivers/gpu/drm/xlnx/.*: modules-core
+  - drivers/gpu/host1x/.*: modules-core
+
+  - drivers/hid/.*test.*: modules-internal
+  - drivers/hid/hid-asus.*: modules
+  - drivers/hid/hid-nintendo.*: modules
+  - drivers/hid/hid-picolcd.*: modules
+  - drivers/hid/hid-playstation.*: modules
+  - drivers/hid/surface-hid.*: modules
+  - drivers/hid/hid-prodikeys.*: modules
+  - drivers/hid/.*: modules-core
+  - drivers/hte/.*: modules-core
+  - drivers/hv/.*: modules-core
+  - drivers/hwmon/asus_wmi_sensors.*: modules
+  - drivers/hwmon/dell-smm-hwmon.*: modules
+  - drivers/hwmon/hp-wmi-sensors.*: modules
+  - drivers/hwmon/intel-m10-bmc-hwmon.*: modules
+  - drivers/hwmon/nct6775.*: modules
+  - drivers/hwmon/.*: modules-core
+  - drivers/hwspinlock/.*: modules-core
+  - drivers/hwtracing/.*: modules-core
+
+  - drivers/i2c/busses/i2c-dln2.*: modules-extra
+  - drivers/i2c/busses/i2c-ljca.*: modules
+  - drivers/i2c/.*: modules-core
+  - drivers/i3c/.*: modules-core
+  - drivers/iio/adc/dln2-adc.*: modules-extra
+  - drivers/iio/accel/.*: modules
+  - drivers/iio/common/cros_ec_sensors/.*: modules
+  - drivers/iio/light/.*: modules
+  - drivers/iio/pressure/.*: modules
+  - drivers/iio/proximity/.*: modules
+  - drivers/iio/test/.*: modules-internal
+  - drivers/iio/.*: modules-core
+  - drivers/input/gameport/.*: modules
+  - drivers/input/joystick/.*: modules-extra
+  - drivers/input/misc/pcspkr.*: modules-extra
+  - drivers/input/tablet/.*: modules
+  - drivers/input/tests/.*: modules-internal
+  - drivers/input/touchscreen/.*: modules
+  - drivers/input/.*: modules-core
+  - drivers/interconnect/.*: modules-core
+  - drivers/iommu/.*: modules-core
+  - drivers/irqchip/.*: modules-core
+
+  - drivers/mailbox/.*: modules-core
+  - drivers/md/.*: modules-core
+  - drivers/memory/dfl-emif.*: modules
+  - drivers/memory/.*: modules-core
+  - drivers/message/fusion/mptctl.*: modules-extra
+  - drivers/message/fusion/mptfc.*: modules-extra
+  - drivers/message/fusion/.*: modules
+  - drivers/message/.*: modules-core
+  - drivers/mfd/dln2.*: modules-extra
+  - drivers/misc/.*: modules-core
+  - drivers/mux/.*: modules-core
+
+  - drivers/net/amt.ko: modules-core
+  - drivers/net/bareudp.ko: modules-core
+  - drivers/net/bonding/.*: modules-core
+  - drivers/net/can/slcan/slcan.*: modules-extra
+  - drivers/net/can/usb/ems_usb.*: modules-extra
+  - drivers/net/can/vcan.*: modules-extra
+  - drivers/net/dummy.ko: modules-core
+  - drivers/net/eql.ko: modules-core
+
+  - drivers/net/ethernet/8390/.*: modules-core
+  - drivers/net/ethernet/adi/.*: modules-core
+  - drivers/net/ethernet/agere/.*: modules-core
+  - drivers/net/ethernet/altera/.*: modules-core
+  - drivers/net/ethernet/amazon/.*: modules-core
+  - drivers/net/ethernet/amd/.*: modules-core
+  - drivers/net/ethernet/apm/.*: modules-core
+  - drivers/net/ethernet/asix/.*: modules-core
+  - drivers/net/ethernet/brocade/.*: modules-core
+  - drivers/net/ethernet/cavium/.*: modules-core
+  - drivers/net/ethernet/dnet.ko: modules-core
+  - drivers/net/ethernet/engleder/.*: modules-core
+  - drivers/net/ethernet/ethoc.ko: modules-core
+  - drivers/net/ethernet/fealnx.ko: modules-core
+  - drivers/net/ethernet/freescale/.*: modules-core
+  - drivers/net/ethernet/fungible/.*: modules-core
+  - drivers/net/ethernet/google/.*: modules-core
+  - drivers/net/ethernet/hisilicon/.*: modules-core
+  - drivers/net/ethernet/ibm/.*: modules-core
+  - drivers/net/ethernet/intel/.*: modules-core
+  - drivers/net/ethernet/jme.ko: modules-core
+  - drivers/net/ethernet/litex/.*: modules-core
+  - drivers/net/ethernet/mellanox/.*: modules-core
+  - drivers/net/ethernet/microsoft/.*: modules-core
+  - drivers/net/ethernet/natsemi/.*: modules-core
+  - drivers/net/ethernet/netronome/.*: modules-core
+  - drivers/net/ethernet/pensando/.*: modules-core
+  - drivers/net/ethernet/rocker/rocker.*: modules-internal
+  - drivers/net/ethernet/qualcomm/.*: modules-core
+  - drivers/net/ethernet/realtek/.*: modules-core
+  - drivers/net/ethernet/renesas/.*: modules-core
+  - drivers/net/ethernet/socionext/.*: modules-core
+  - drivers/net/ethernet/vertexcom/.*: modules-core
+  - drivers/net/ethernet/wangxun/.*: modules-core
+  - drivers/net/ethernet/xilinx/.*: modules-core
+
+  - drivers/net/fjes/.*: modules-core
+  - drivers/net/geneve.ko: modules-core
+  - drivers/net/gtp.ko: modules-core
+  - drivers/net/hamradio/.*: modules-extra
+  - drivers/net/hyperv/.*: modules-core
+  - drivers/net/ifb.ko: modules-core
+  - drivers/net/ipa/.*: modules-core
+  - drivers/net/ipvlan/.*: modules-core
+  - drivers/net/macsec.ko: modules-core
+  - drivers/net/macvlan.ko: modules-core
+  - drivers/net/macvtap.ko: modules-core
+  - drivers/net/mctp/.*: modules-core
+  - drivers/net/mdio.*: modules-core
+  - drivers/net/mhi_net.ko: modules-core
+  - drivers/net/mii.ko: modules-core
+  - drivers/net/net_failover.ko: modules-core
+  - drivers/net/netdevsim/netdevsim.*: modules-internal
+  - drivers/net/netconsole.ko: modules-core
+  - drivers/net/nlmon.ko: modules-core
+  - drivers/net/pcs/.*: modules-core
+  - drivers/net/phy/.*: modules-core
+  - drivers/net/rionet.ko: modules-core
+  - drivers/net/slip/slip.*: modules-extra
+  - drivers/net/sungem_phy.ko: modules-core
+  - drivers/net/tap.ko: modules-core
+  - drivers/net/team/.*: modules-core
+  - drivers/net/thunderbolt/.*: modules-core
+  - drivers/net/tun.ko: modules-core
+  - drivers/net/veth.ko: modules-core
+  - drivers/net/virtio_net.ko: modules-core
+  - drivers/net/vmxnet3/.*: modules-core
+  - drivers/net/vrf.ko: modules-core
+  - drivers/net/vsockmon.ko: modules-core
+  - drivers/net/vxlan/.*: modules-core
+  - drivers/net/wireguard/.*: modules-core
+  - drivers/net/wireless/virtual/mac80211_hwsim.*: modules-internal
+  - drivers/net/wwan/wwan_hwsim.*: modules-internal
+  - drivers/net/wwan/.*: modules-core
+  - drivers/net/xen.*: modules-core
+
+  - drivers/nvdimm/.*: modules-core
+  - drivers/nvme/host/nvme-rdma.*: modules
+  - drivers/nvme/target/nvmet-rdma.*: modules
+  - drivers/nvme/.*: modules-core
+  - drivers/nvmem/nvmem_u-boot-env.*: modules
+  - drivers/nvmem/.*: modules-core
+
+  - drivers/parport/parport_serial.*: modules
+  - drivers/parport/.*: modules-core
+  - drivers/pci/pcie/aer_inject.*: modules-extra
+  - drivers/pci/.*: modules-core
+  - drivers/perf/.*: modules-core
+  - drivers/phy/.*: modules-core
+  - drivers/pinctrl/.*: modules-core
+  - drivers/platform/chrome/.*test.*: modules-internal
+  - drivers/pmdomain/.*: modules-core
+  - drivers/powercap/intel_rapl_tpmi.*: modules
+  - drivers/powercap/.*: modules-core
+  - drivers/pps/.*: modules-core
+  - drivers/ptp/ptp_kvm.*: modules-rt-kvm
+    if_variant_in: ["rt"]
+  - drivers/ptp/ptp_dfl_tod.*: modules
+  - drivers/ptp/.*: modules-core
+  - drivers/pwm/.*: modules-core
+
+  - drivers/rapidio/.*: modules-core
+  - drivers/regulator/arizona-micsupp.*: modules
+  - drivers/regulator/.*: modules-core
+  - drivers/remoteproc/.*: modules-core
+  - drivers/reset/.*: modules-core
+  - drivers/rpmsg/.*: modules-core
+  - drivers/rtc/.*test.*: modules-internal
+  - drivers/rtc/.*: modules-core
+
+  - drivers/s390/.*: modules-core
+
+  - drivers/scsi/3w.*: modules-core
+  - drivers/scsi/BusLogic.ko: modules-core
+  - drivers/scsi/a100u2w.ko: modules-core
+  - drivers/scsi/advansys.ko: modules-core
+  - drivers/scsi/am53c974.ko: modules-core
+  - drivers/scsi/arcmsr.*: modules-core
+  - drivers/scsi/atp870u.ko: modules-core
+  - drivers/scsi/ch.ko: modules-core
+  - drivers/scsi/cxlflash/.*: modules-core
+  - drivers/scsi/dc395x.ko: modules-core
+  - drivers/scsi/device_handler/.*: modules-core
+  - drivers/scsi/dmx3191d.ko: modules-core
+  - drivers/scsi/elx/.*: modules-core
+  - drivers/scsi/esp_scsi.ko: modules-core
+  - drivers/scsi/fdomain.*: modules-core
+  - drivers/scsi/hpsa.ko: modules-core
+  - drivers/scsi/hptiop.ko: modules-core
+  - drivers/scsi/hv_storvsc.ko: modules-core
+  - drivers/scsi/ibmvscsi.*: modules-core
+  - drivers/scsi/initio.ko: modules-core
+  - drivers/scsi/ipr.ko: modules-core
+  - drivers/scsi/ips.ko: modules-core
+  - drivers/scsi/iscsi_tcp.ko: modules-core
+  - drivers/scsi/libfc/.*: modules-core
+  - drivers/scsi/libiscsi.*: modules-core
+  - drivers/scsi/mpi3mr/.*: modules-core
+  - drivers/scsi/mvumi.ko: modules-core
+  - drivers/scsi/myrb.ko: modules-core
+  - drivers/scsi/myrs.ko: modules-core
+  - drivers/scsi/raid_class.ko: modules-core
+  - drivers/scsi/scsi_debug.ko: modules-core
+  - drivers/scsi/scsi_transport_.*: modules-core
+  - drivers/scsi/ses.ko: modules-core
+  - drivers/scsi/smartpqi/.*: modules-core
+  - drivers/scsi/snic/.*: modules-core
+  - drivers/scsi/st.ko: modules-core
+  - drivers/scsi/stex.ko: modules-core
+  - drivers/scsi/virtio_scsi.ko: modules-core
+  - drivers/scsi/vmw_pvscsi.ko: modules-core
+  - drivers/scsi/wd719x.ko: modules-core
+  - drivers/scsi/xen-scsifront.ko: modules-core
+
+  - drivers/slimbus/.*: modules-core
+  - drivers/soc/.*: modules-core
+  - drivers/spi/spi-altera-dfl.*: modules
+  - drivers/spi/spi-dln2.*: modules-extra
+  - drivers/spi/spi-ljca.*: modules
+  - drivers/spi/.*: modules-core
+  - drivers/spmi/.*: modules-core
+
+  - drivers/target/iscsi/cxgbit/cxgbit.*: modules
+  - drivers/target/sbp/sbp_target.*: modules
+  - drivers/target/target_core_user.*: modules
+  - drivers/target/.*: modules-core
+  - drivers/tee/.*: modules-core
+  - drivers/thermal/intel/int340x_thermal/int3406_thermal.*: modules
+  - drivers/thermal/.*: modules-core
+  - drivers/thunderbolt/.*: modules-core
+
+  - drivers/ufs/.*: modules-core
+  - drivers/usb/atm/.*: modules
+  - drivers/usb/gadget/function/usb_f_midi2.*: modules
+  - drivers/usb/image/.*: modules
+  - drivers/usb/misc/trancevibrator.*: modules-extra
+  - drivers/usb/misc/.*: modules
+  - drivers/usb/serial/.*: modules
+  - drivers/usb/typec/mux/nb7vpq904m.*: modules
+  - drivers/usb/usbip/.*: modules-extra
+  - drivers/usb/.*: modules-core
+
+  - drivers/vdpa/mlx5/mlx5_vdpa.*: modules
+  - drivers/vdpa/pds/pds_vdpa.*: modules
+  - drivers/vdpa/.*: modules-core
+  - drivers/vfio/pci/mlx5/mlx5-vfio-pci.*: modules
+  - drivers/vfio/pci/pds/pds-vfio-pc.*: modules
+  - drivers/vfio/.*: modules-core
+  - drivers/vhost/.*: modules-core
+  - drivers/video/backlight/apple_bl.*: modules
+  - drivers/video/.*: modules-core
+  - drivers/virt/.*: modules-core
+  - drivers/virtio/.*: modules-core
+
+  - drivers/watchdog/iTCO_wdt.*: modules
+  - drivers/watchdog/.*: modules-core
+
+  - drivers/xen/.*: modules-core
+
+  - drivers/w1/masters/ds2482.*: modules-extra
+  - drivers/w1/masters/ds2490.*: modules-extra
+  - drivers/w1/slaves/w1_ds2408.*: modules-extra
+  - drivers/w1/slaves/w1_ds2423.*: modules-extra
+  - drivers/w1/slaves/w1_ds2431.*: modules-extra
+  - drivers/w1/slaves/w1_ds2433.*: modules-extra
+  - drivers/w1/slaves/w1_ds2780.*: modules-extra
+  - drivers/w1/slaves/w1_ds2781.*: modules-extra
+  - drivers/w1/slaves/w1_ds28e04.*: modules-extra
+  - drivers/w1/slaves/w1_smem.*: modules-extra
+  - drivers/w1/slaves/w1_therm.*: modules-extra
+
+  - fs/.*test.*: modules-internal
+  - fs/9p/.*: modules-core
+  - fs/afs/.*: modules-core
+  - fs/affs/affs.*: modules-extra
+  - fs/bcachefs/.*: modules-core
+  - fs/befs/befs.*: modules-extra
+  - fs/binfmt_misc.ko: modules-core
+  - fs/cachefiles/.*: modules-core
+  - fs/ceph/.*: modules-core
+  - fs/coda/coda.*: modules-extra
+  - fs/dlm/.*: modules-extra
+  - fs/erofs/.*: modules-core
+  - fs/exfat/.*: modules-core
+  - fs/f2fs/.*: modules-core
+  - fs/fat/.*: modules-core
+  - fs/fuse/cuse.*: modules-extra
+  - fs/fuse/.*: modules-core
+  - fs/gfs2/.*: modules-extra
+  - fs/isofs/.*: modules-core
+  - fs/lockd/.*: modules-core
+  - fs/netfs/.*: modules-core
+  - fs/nfs.*: modules-core
+  - fs/nilfs2/nilfs2.*: modules-extra
+  - fs/nls/.*: modules-core
+  - fs/ntfs3/.*: modules-core
+  - fs/ocfs2/.*: modules-extra
+  - fs/orangefs/.*: modules-core
+  - fs/overlayfs/.*: modules-core
+  - fs/pstore/.*: modules-core
+  - fs/smb/.*: modules-core
+  - fs/squashfs/.*: modules-core
+  - fs/sysv/.*: modules-extra
+  - fs/ubifs/.*: modules-extra
+  - fs/udf/.*: modules-core
+  - fs/ufs/.*: modules-extra
+  - fs/vboxsf/.*: modules-core
+  - fs/xfs/.*: modules-core
+  - fs/zonefs/.*: modules-core
+
+  - kernel/.*test.*: modules-internal
+  - kernel/locking/locktorture.*: modules-internal
+  - kernel/rcu/rcuscale.*: modules-internal
+  - kernel/rcu/rcutorture.*: modules-internal
+  - kernel/rcu/refscale.*: modules-internal
+  - kernel/resource_kunit.*: modules-internal
+  - kernel/scftorture.*: modules-internal
+  - kernel/torture.*: modules-internal
+  - kernel/.*: modules-core
+
+  - lib/.*(test|kunit).*: modules-internal
+  - lib/.*: modules-core
+
+  - mm/kasan/kasan_test: modules-internal
+  - mm/kfence/.*test.*: modules-internal
+
+  - net/.*test.*: modules-internal
+  - net/802/.*: modules-core
+  - net/8021q/.*: modules-core
+  - net/9p/9pnet_rdma.ko: modules
+  - net/9p/.*: modules-core
+  - net/appletalk/appletalk.*: modules-extra
+  - net/atm/br2684.*: modules-extra
+  - net/atm/clip.*: modules-extra
+  - net/atm/lec.*: modules-extra
+  - net/atm/pppoatm.*: modules-extra
+  - net/ax25/ax25.*: modules-extra
+  - net/batman-adv/batman-adv.*: modules-extra
+  - net/bridge/.*: modules-core
+  - net/ceph/.*: modules-core
+  - net/core/pktgen.*: modules-internal
+  - net/core/.*: modules-core
+  - net/dns_resolver/.*: modules-core
+  - net/hsr/.*: modules-core
+  - net/ife/.*: modules-core
+  - net/ipv4/tcp_bic.*: modules-extra
+  - net/ipv4/tcp_highspeed.*: modules-extra
+  - net/ipv4/tcp_htcp.*: modules-extra
+  - net/ipv4/tcp_hybla.*: modules-extra
+  - net/ipv4/tcp_illinois.*: modules-extra
+  - net/ipv4/tcp_lp.*: modules-extra
+  - net/ipv4/tcp_scalable.*: modules-extra
+  - net/ipv4/tcp_vegas.*: modules-extra
+  - net/ipv4/tcp_veno.*: modules-extra
+  - net/ipv4/tcp_westwood.*: modules-extra
+  - net/ipv4/tcp_yeah.*: modules-extra
+  - net/ipv4/.*: modules-core
+  - net/ipv6/.*: modules-core
+  - net/iucv/.*: modules-core
+  - net/kcm/.*: modules-core
+  - net/key/.*: modules-core
+  - net/l2tp/l2tp_debugfs.*: modules-extra
+  - net/l2tp/l2tp_eth.*: modules-extra
+  - net/l2tp/l2tp_netlink.*: modules-extra
+  - net/l2tp/l2tp_ppp.*: modules-extra
+  - net/llc/.*: modules-core
+  - net/netfilter/.*: modules-core
+  - net/netrom/netrom.*: modules-extra
+  - net/nsh/.*: modules-core
+  - net/openvswitch/.*: modules-core
+  - net/psample/.*: modules-core
+  - net/qrtr/.*: modules-core
+  - net/rds/rds.*: modules-extra
+  - net/rose/rose.*: modules-extra
+  - net/rxrpc/.*: modules-core
+  - net/sched/sch_choke.*: modules-extra
+  - net/sched/sch_drr.*: modules-extra
+  - net/sched/sch_etf.*: modules-extra
+  - net/sched/sch_gred.*: modules-extra
+  - net/sched/sch_mqprio.ko: modules-extra
+  - net/sched/sch_multiq.*: modules-extra
+  - net/sched/sch_netem.*: modules-extra
+  - net/sched/sch_qfq.*: modules-extra
+  - net/sched/sch_red.*: modules-extra
+  - net/sched/sch_sfb.*: modules-extra
+  - net/sched/sch_teql.*: modules-extra
+  - net/sched/.*: modules-core
+  - net/sunrpc/xprtrdma/rpcrdma.*: modules
+  - net/sunrpc/.*: modules-core
+  - net/tipc/.*: modules-core
+  - net/tls/.*: modules-core
+  - net/vmw_vsock/.*: modules-core
+  - net/xdp/.*: modules-core
+  - net/xfrm/.*: modules-core
+
+  - sound/pci/.*test.*: modules-internal
+  - sound/soc/.*test.*: modules-internal
+
+  - virt/.*: modules-core
+
+  - default: modules
diff --git a/redhat/fedora_files/filter-aarch64.sh.fedora b/redhat/fedora_files/filter-aarch64.sh.fedora
deleted file mode 100644
index blahblah..blahblah 0
--- a/redhat/fedora_files/filter-aarch64.sh.fedora
+++ /dev/null
@@ -1,20 +0,0 @@
-#! /bin/bash
-
-# This is the aarch64 override file for the core/drivers package split.  The
-# module directories listed here and in the generic list in filter-modules.sh
-# will be moved to the resulting kernel-modules package for this arch.
-# Anything not listed in those files will be in the kernel-core package.
-#
-# Please review the default list in filter-modules.sh before making
-# modifications to the overrides below.  If something should be removed across
-# all arches, remove it in the default instead of per-arch.
-
-overrides="aux-bridge aux-hpd-bridge cec"
-
-driverdirs="atm auxdisplay bcma bluetooth firewire fpga infiniband leds media memstick message mmc mtd nfc ntb pcmcia power ssb soundwire staging tty uio w1"
-
-ethdrvs="3com adaptec arc alteon atheros broadcom cadence calxeda chelsio cisco dec dlink emulex marvell micrel myricom neterion nvidia packetengines qlogic rdc sfc silan sis smsc stmicro sun tehuti ti via wiznet xircom"
-
-drmdrvs="amd arm bridge ast exynos hisilicon i2c imx mgag200 meson msm nouveau panel pl111 radeon rockchip tegra sun4i tiny vc4"
-
-singlemods="ntb_netdev iscsi_ibft iscsi_boot_sysfs megaraid pmcraid qedi qla1280 9pnet_rdma rpcrdma nvmet-rdma nvme-rdma hid-picolcd hid-prodikeys hwpoison-inject target_core_user sbp_target cxgbit chcr rnbd-client rnbd-server mlx5_vdpa dfl-emif octeontx2-cpt octeontx2-cptvf spi-altera-dfl rvu_cptpf rvu_cptvf regmap-sdw regmap-sdw-mbq hid-playstation hid-nintendo nvmem_u-boot-env intel-m10-bmc-pmci intel-m10-bmc-hwmon ptp_dfl_tod pds_vdpa usb_f_midi2 cs42l43-sdw"
diff --git a/redhat/fedora_files/filter-modules.sh.fedora b/redhat/fedora_files/filter-modules.sh.fedora
deleted file mode 100755
index blahblah..blahblah 0
--- a/redhat/fedora_files/filter-modules.sh.fedora
+++ /dev/null
@@ -1,201 +0,0 @@
-#! /bin/bash
-#
-# Called as filter-modules.sh list-of-modules Arch
-
-# This script filters the modules into the kernel-core and kernel-modules
-# 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
-# pruned is contained in the kernel-modules package.
-#
-# 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
-# subsys should be in kernel-modules on all arches, please change the defaults
-# listed here.
-
-# Overrides is individual modules which need to remain in kernel-core due to deps.
-overrides="cec"
-
-# Set the default dirs/modules to filter out
-driverdirs="atm auxdisplay bcma bluetooth firewire fpga infiniband leds media memstick mfd mmc mtd nfc ntb pcmcia platform power ssb soundwire staging tty uio w1"
-
-chardrvs="mwave pcmcia"
-
-netdrvs="appletalk can dsa hamradio ieee802154 ppp slip usb wireless"
-
-ethdrvs="3com adaptec alteon amd aquantia atheros broadcom cadence calxeda chelsio cisco dec dlink emulex marvell mellanox neterion nvidia packetengines qlogic rdc sfc silan sis smsc stmicro sun tehuti ti wiznet xircom"
-
-cryptdrvs="bcm caam cavium chelsio hisilicon marvell qat"
-
-iiodrvs="accel light pressure proximity"
-
-iiocommondrvs="cros_ec_sensors"
-
-inputdrvs="gameport tablet touchscreen"
-
-hiddrvs="surface-hid"
-
-scsidrvs="aacraid aic7xxx be2iscsi bfa bnx2i bnx2fc csiostor cxgbi esas2r fcoe fnic isci libsas lpfc megaraid mpt3sas mvsas pm8001 qla2xxx qla4xxx sym53c8xx_2 ufs qedf"
-
-usbdrvs="atm image misc serial"
-
-fsdrvs="affs befs coda cramfs dlm ecryptfs hfs hfsplus jfs jffs2 minix nilfs2 ocfs2 reiserfs romfs sysv ubifs ufs"
-
-netprots="6lowpan appletalk atm ax25 batman-adv bluetooth can dsa ieee802154 l2tp mac80211 mac802154 mpls netrom nfc rds rfkill rose sctp smc wireless"
-
-drmdrvs="amd ast bridge gma500 i2c i915 mgag200 nouveau panel radeon xe"
-
-singlemods="ntb_netdev iscsi_ibft iscsi_boot_sysfs megaraid pmcraid qedi qla1280 9pnet_rdma rpcrdma nvmet-rdma nvme-rdma hid-picolcd hid-prodikeys hwpoison-inject target_core_user sbp_target cxgbit  chcr parport_serial regmap-sdw regmap-sdw-mbq arizona-micsupp hid-asus iTCO_wdt rnbd-client rnbd-server mlx5_vdpa spi-altera-dfl nct6775 hid-playstation hid-nintendo asus_wmi_sensors asus_wmi_ec_sensors mlx5-vfio-pci video int3406_thermal apple_bl ptp_dfl_tod intel-m10-bmc-hwmon intel_rapl_tpmi pds_vdpa hp-wmi-sensors pds-vfio-pci gpio-ljca spi-ljca i2c-ljca dell-smm-hwmon"
-
-# 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
-
-# Filter the char drivers
-for char in ${chardrvs}
-do
-	filter_dir $1 drivers/char/${char}
-done
-
-# Filter the ethernet drivers
-for eth in ${ethdrvs}
-do
-	filter_dir $1 drivers/net/ethernet/${eth}
-done
-
-# Filter the crypto drivers
-for crypt in ${cryptdrvs}
-do
-	filter_dir $1 drivers/crypto/${crypt}
-done
-
-# SCSI
-for scsi in ${scsidrvs}
-do
-	filter_dir $1 drivers/scsi/${scsi}
-done
-
-# IIO
-for iio in ${iiodrvs}
-do
-        filter_dir $1 drivers/iio/${iio}
-done
-
-# IIO Common
-for iio in ${iiocommondrvs}
-do
-        filter_dir $1 drivers/iio/common/${iio}
-done
-
-# Input
-for input in ${inputdrvs}
-do
-	filter_dir $1 drivers/input/${input}
-done
-
-# hid
-for hid in ${hiddrvs}
-do
-	filter_dir $1 drivers/hid/${hid}
-done
-
-# 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
-filter_dir $1 kernel/drivers/soundwire
-
-# 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
-
-# Now process the override list to bring those modules back into core
-for mod in ${overrides}
-do
-	grep -v -e "/${mod}.ko" k-d.list > k-d.list.tmp
-	if [ $? -ne 0 ]
-        then
-                echo "Couldn't save ${mod}.ko  Skipping."
-        else
-                grep -e "/${mod}.ko" k-d.list >> $filelist
-                mv k-d.list.tmp k-d.list
-        fi
-
-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
diff --git a/redhat/fedora_files/filter-ppc64le.sh.fedora b/redhat/fedora_files/filter-ppc64le.sh.fedora
deleted file mode 100644
index blahblah..blahblah 0
--- a/redhat/fedora_files/filter-ppc64le.sh.fedora
+++ /dev/null
@@ -1,14 +0,0 @@
-#! /bin/bash
-
-# This is the ppc64le override file for the core/drivers package split.  The
-# module directories listed here and in the generic list in filter-modules.sh
-# will be moved to the resulting kernel-modules package for this arch.
-# Anything not listed in those files will be in the kernel-core package.
-#
-# Please review the default list in filter-modules.sh before making
-# modifications to the overrides below.  If something should be removed across
-# all arches, remove it in the default instead of per-arch.
-
-driverdirs="atm auxdisplay bcma bluetooth firewire fpga infiniband leds media memstick message mmc mtd nfc ntb pcmcia platform power ssb staging tty uio w1"
-
-singlemods="ntb_netdev iscsi_ibft iscsi_boot_sysfs megaraid pmcraid qedi qla1280 9pnet_rdma rpcrdma nvmet-rdma nvme-rdma hid-picolcd hid-prodikeys hwpoison-inject target_core_user sbp_target cxgbit chcr rnbd-client rnbd-server mlx5_vdpa hid-playstation hid-nintendo mlx5-vfio-pci nvmem_u-boot-env intel-m10-bmc-pmci intel-m10-bmc-hwmon ptp_dfl_tod pds_vdpa pds-vfio-pci nb7vpq904m"
diff --git a/redhat/fedora_files/filter-s390x.sh.fedora b/redhat/fedora_files/filter-s390x.sh.fedora
deleted file mode 100644
index blahblah..blahblah 0
--- a/redhat/fedora_files/filter-s390x.sh.fedora
+++ /dev/null
@@ -1,12 +0,0 @@
-#! /bin/bash
-
-# This is the s390x override file for the core/drivers package split.  The
-# module directories listed here and in the generic list in filter-modules.sh
-# will be moved to the resulting kernel-modules package for this arch.
-# Anything not listed in those files will be in the kernel-core package.
-#
-# Please review the default list in filter-modules.sh before making
-# modifications to the overrides below.  If something should be removed across
-# all arches, remove it in the default instead of per-arch.
-
-# Defaults work so no need to override
diff --git a/redhat/fedora_files/filter-x86_64.sh.fedora b/redhat/fedora_files/filter-x86_64.sh.fedora
deleted file mode 100644
index blahblah..blahblah 0
--- a/redhat/fedora_files/filter-x86_64.sh.fedora
+++ /dev/null
@@ -1,12 +0,0 @@
-#! /bin/bash
-
-# This is the x86_64 override file for the core/drivers package split.  The
-# module directories listed here and in the generic list in filter-modules.sh
-# will be moved to the resulting kernel-modules package for this arch.
-# Anything not listed in those files will be in the kernel-core package.
-#
-# Please review the default list in filter-modules.sh before making
-# modifications to the overrides below.  If something should be removed across
-# all arches, remove it in the default instead of per-arch.
-
-# Defaults work so no need to override
diff --git a/redhat/fedora_files/mod-extra.list.fedora b/redhat/fedora_files/mod-extra.list.fedora
deleted file mode 100644
index blahblah..blahblah 0
--- a/redhat/fedora_files/mod-extra.list.fedora
+++ /dev/null
@@ -1,200 +0,0 @@
-6pack.ko
-a3d.ko
-act200l-sir.ko
-actisys-sir.ko
-adi.ko
-aer_inject.ko
-af_802154.ko
-affs.ko
-ali-ircc.ko
-analog.ko
-appletalk.ko
-atm.ko
-avma1_cs.ko
-avm_cs.ko
-avmfritz.ko
-ax25.ko
-b1.ko
-bas_gigaset.ko
-batman-adv.ko
-baycom_par.ko
-baycom_ser_fdx.ko
-baycom_ser_hdx.ko
-befs.ko
-bpqether.ko
-br2684.ko
-capi.ko
-c_can.ko
-c_can_platform.ko
-clip.ko
-cobra.ko
-coda.ko
-cuse.ko
-db9.ko
-dccp_diag.ko
-dccp_ipv4.ko
-dccp_ipv6.ko
-dccp.ko
-dccp_probe.ko
-diva_idi.ko
-divas.ko
-dlm.ko
-dln2-adc.ko
-dln2.ko
-ds1wm.ko
-ds2482.ko
-ds2490.ko
-dss1_divert.ko
-elsa_cs.ko
-ems_pci.ko
-ems_usb.ko
-esd_usb2.ko
-esi-sir.ko
-floppy.ko
-gamecon.ko
-gf2k.ko
-gfs2.ko
-gigaset.ko
-girbil-sir.ko
-gpio-dln2.ko
-grip.ko
-grip_mp.ko
-guillemot.ko
-hdlcdrv.ko
-hfc4s8s_l1.ko
-hfcmulti.ko
-hfcpci.ko
-hisax.ko
-hwa-rc.ko
-hysdn.ko
-i2400m.ko
-i2400m-sdio.ko
-i2400m-usb.ko
-i2c-dln2.ko
-ieee802154.ko
-iforce.ko
-interact.ko
-ipddp.ko
-ipx.ko
-isdn.ko
-joydump.ko
-kingsun-sir.ko
-ks959-sir.ko
-ksdazzle-sir.ko
-kvaser_pci.ko
-l2tp_core.ko
-l2tp_debugfs.ko
-l2tp_eth.ko
-l2tp_ip.ko
-l2tp_netlink.ko
-l2tp_ppp.ko
-lec.ko
-ma600-sir.ko
-magellan.ko
-mcp2120-sir.ko
-mISDN_core.ko
-mISDN_dsp.ko
-mkiss.ko
-mptbase.ko
-mptctl.ko
-mptfc.ko
-nci.ko
-ncpfs.ko
-netjet.ko
-netrom.ko
-nfc.ko
-nilfs2.ko
-ocfs2_dlmfs.ko
-ocfs2_dlm.ko
-ocfs2.ko
-ocfs2_nodemanager.ko
-ocfs2_stackglue.ko
-ocfs2_stack_o2cb.ko
-ocfs2_stack_user.ko
-old_belkin-sir.ko
-orinoco_cs.ko
-orinoco.ko
-orinoco_nortel.ko
-orinoco_pci.ko
-orinoco_plx.ko
-orinoco_usb.ko
-pcspkr.ko
-plx_pci.ko
-pn_pep.ko
-pppoatm.ko
-rds.ko
-rds_rdma.ko
-rds_tcp.ko
-rose.ko
-sch_atm.ko
-sch_cbq.ko
-sch_choke.ko
-sch_drr.ko
-sch_dsmark.ko
-sch_etf.ko
-sch_gred.ko
-sch_mqprio.ko
-sch_multiq.ko
-sch_netem.ko
-sch_qfq.ko
-sch_red.ko
-sch_sfb.ko
-sch_teql.ko
-sctp.ko
-sctp_probe.ko
-sidewinder.ko
-sja1000.ko
-sja1000_platform.ko
-slcan.ko
-slip.ko
-softing_cs.ko
-softing.ko
-spaceball.ko
-spaceorb.ko
-spi-dln2.ko
-stinger.ko
-sysv.ko
-tcp_bic.ko
-tcp_highspeed.ko
-tcp_htcp.ko
-tcp_hybla.ko
-tcp_illinois.ko
-tcp_lp.ko
-tcp_scalable.ko
-tcp_vegas.ko
-tcp_veno.ko
-tcp_westwood.ko
-tcp_yeah.ko
-tekram-sir.ko
-tmdc.ko
-toim3232-sir.ko
-trancevibrator.ko
-turbografx.ko
-twidjoy.ko
-ubifs.ko
-ufs.ko
-umc.ko
-usbip-core.ko
-usbip-host.ko
-uwb.ko
-vcan.ko
-vhci-hcd.ko
-w1_bq27000.ko
-w1_ds2408.ko
-w1_ds2423.ko
-w1_ds2431.ko
-w1_ds2433.ko
-w1_ds2760.ko
-w1_ds2780.ko
-w1_ds2781.ko
-w1_ds28e04.ko
-w1_smem.ko
-w1_therm.ko
-w6692.ko
-walkera0701.ko
-wanrouter.ko
-warrior.ko
-whci.ko
-wire.ko
-yam.ko
-zhenhua.ko
diff --git a/redhat/kernel.spec.template b/redhat/kernel.spec.template
index blahblah..blahblah 100644
--- a/redhat/kernel.spec.template
+++ b/redhat/kernel.spec.template
@@ -660,7 +660,9 @@ BuildRequires: bzip2, xz, findutils, m4, perl-interpreter, perl-Carp, perl-devel
 BuildRequires: gcc, binutils, redhat-rpm-config, hmaccalc, bison, flex, gcc-c++
 BuildRequires: net-tools, hostname, bc, elfutils-devel
 BuildRequires: dwarves
+BuildRequires: python3
 BuildRequires: python3-devel
+BuildRequires: python3-pyyaml
 BuildRequires: kernel-rpm-macros
 # glibc-static is required for a consistent build environment (specifically
 # CONFIG_CC_CAN_LINK_STATIC=y).
@@ -669,7 +671,7 @@ BuildRequires: glibc-static
 BuildRequires: rsync
 %endif
 %if %{with_doc}
-BuildRequires: xmlto, asciidoc, python3-sphinx, python3-sphinx_rtd_theme, python3-pyyaml
+BuildRequires: xmlto, asciidoc, python3-sphinx, python3-sphinx_rtd_theme
 %endif
 %if %{with_sparse}
 BuildRequires: sparse
@@ -858,6 +860,7 @@ Source13: redhatsecureboot003.cer
 
 Source20: mod-denylist.sh
 Source21: mod-sign.sh
+Source22: filtermods.py
 
 %define modsign_cmd %{SOURCE21}
 
@@ -866,7 +869,6 @@ Source23: x509.genkey.rhel
 
 Source24: %{name}-aarch64-rhel.config
 Source25: %{name}-aarch64-debug-rhel.config
-Source26: mod-extra.list.rhel
 
 Source27: %{name}-ppc64le-rhel.config
 Source28: %{name}-ppc64le-debug-rhel.config
@@ -876,11 +878,7 @@ Source31: %{name}-s390x-zfcpdump-rhel.config
 Source32: %{name}-x86_64-rhel.config
 Source33: %{name}-x86_64-debug-rhel.config
 
-Source34: filter-x86_64.sh.rhel
-Source35: filter-aarch64.sh.rhel
-Source36: filter-ppc64le.sh.rhel
-Source37: filter-s390x.sh.rhel
-Source38: filter-modules.sh.rhel
+Source34: def_variants.yaml.rhel
 
 Source41: x509.genkey.centos
 # ARM64 64K page-size kernel config
@@ -891,7 +889,6 @@ Source43: %{name}-aarch64-64k-debug-rhel.config
 
 %if 0%{?include_fedora}
 Source50: x509.genkey.fedora
-Source51: mod-extra.list.fedora
 
 Source52: %{name}-aarch64-fedora.config
 Source53: %{name}-aarch64-debug-fedora.config
@@ -904,11 +901,7 @@ Source59: %{name}-s390x-debug-fedora.config
 Source60: %{name}-x86_64-fedora.config
 Source61: %{name}-x86_64-debug-fedora.config
 
-Source62: filter-x86_64.sh.fedora
-Source63: filter-aarch64.sh.fedora
-Source64: filter-ppc64le.sh.fedora
-Source65: filter-s390x.sh.fedora
-Source66: filter-modules.sh.fedora
+Source62: def_variants.yaml.fedora
 %endif
 
 Source70: partial-kgcov-snip.config
@@ -922,9 +915,6 @@ Source77: partial-clang_lto-aarch64-debug-snip.config
 Source80: generate_all_configs.sh
 Source81: process_configs.sh
 
-Source84: mod-internal.list
-Source85: mod-partner.list
-
 Source86: dracut-virt.conf
 
 Source87: flavors
@@ -948,9 +938,6 @@ Source213: Module.kabi_dup_x86_64
 Source300: kernel-abi-stablelists-%{kabiversion}.tar.xz
 Source301: kernel-kabi-dw-%{kabiversion}.tar.xz
 
-# RT specific virt module
-Source400: mod-kvm.list
-
 %if %{include_rt}
 # realtime config files
 Source474: %{name}-aarch64-rt-rhel.config
@@ -1502,6 +1489,7 @@ The meta-package for the %{1} kernel\
 Summary: KVM modules for package kernel%{?1:-%{1}}\
 Group: System Environment/Kernel\
 Requires: kernel-uname-r = %{KVERREL}%{uname_suffix %{?1:%{1}}}\
+Requires: kernel%{?1:-%{1}}-modules-core-uname-r = %{KVERREL}%{uname_suffix %{?1:+%{1}}}\
 Provides: installonlypkg(kernel-module)\
 Provides: kernel%{?1:-%{1}}-kvm-%{_target_cpu} = %{version}-%{release}\
 AutoReq: no\
@@ -2522,97 +2510,30 @@ BuildKernel() {
     ( find $RPM_BUILD_ROOT/lib/modules/$KernelVer -name '*.ko' | xargs /sbin/modinfo -l | \
         grep -E -v 'GPL( v2)?$|Dual BSD/GPL$|Dual MPL/GPL$|GPL and additional rights$' ) && exit 1
 
-    remove_depmod_files()
-    {
-        # remove files that will be auto generated by depmod at rpm -i time
-        pushd $RPM_BUILD_ROOT/lib/modules/$KernelVer/
-            # in case below list needs to be extended, remember to add a
-            # matching ghost entry in the files section as well
-            rm -f modules.{alias,alias.bin,builtin.alias.bin,builtin.bin} \
-                  modules.{dep,dep.bin,devname,softdep,symbols,symbols.bin}
-        popd
-    }
 
-    %{log_msg "Remove depmod files"}
-    remove_depmod_files
-
-    %{log_msg "Identify modules in kenrel-modules-* packages"}
-    # Identify modules in the kernel-modules-extras package
-    %{SOURCE20} $RPM_BUILD_ROOT lib/modules/$KernelVer $(realpath configs/mod-extra.list)
-    # Identify modules in the kernel-modules-internal package
-    %{SOURCE20} $RPM_BUILD_ROOT lib/modules/$KernelVer %{SOURCE84} internal
-%if 0%{!?fedora:1}
-    # Identify modules in the kernel-modules-partner package
-    %{SOURCE20} $RPM_BUILD_ROOT lib/modules/$KernelVer %{SOURCE85} partner
-%endif
-    if [[ "$Variant" == "rt" || "$Variant" == "rt-debug" ]]; then
-    # Identify modules in the kernel-rt-kvm package
-        %{SOURCE20} $RPM_BUILD_ROOT lib/modules/$KernelVer %{SOURCE400} kvm
+    if [ $DoModules -eq 0 ]; then
+        %{log_msg "Create empty files for RPM packaging"}
+        # Ensure important files/directories exist to let the packaging succeed
+        echo '%%defattr(-,-,-)' > ../kernel${Variant:+-${Variant}}-modules-core.list
+        echo '%%defattr(-,-,-)' > ../kernel${Variant:+-${Variant}}-modules.list
+        echo '%%defattr(-,-,-)' > ../kernel${Variant:+-${Variant}}-modules-extra.list
+        echo '%%defattr(-,-,-)' > ../kernel${Variant:+-${Variant}}-modules-internal.list
+        echo '%%defattr(-,-,-)' > ../kernel${Variant:+-${Variant}}-modules-partner.list
+        mkdir -p $RPM_BUILD_ROOT/lib/modules/$KernelVer/kernel
+        # Add files usually created by make modules, needed to prevent errors
+        # thrown by depmod during package installation
+        touch $RPM_BUILD_ROOT/lib/modules/$KernelVer/modules.order
+        touch $RPM_BUILD_ROOT/lib/modules/$KernelVer/modules.builtin
     fi
 
-    #
-    # Generate the kernel-core and kernel-modules files lists
-    #
-    %{log_msg "Gemerate the kernel-core and kernel-modules files lists"}
-
-    # Copy the System.map file for depmod to use, and create a backup of the
-    # full module tree so we can restore it after we're done filtering
+    # Copy the System.map file for depmod to use
     cp System.map $RPM_BUILD_ROOT/.
-    cp configs/filter-*.sh $RPM_BUILD_ROOT/.
-    pushd $RPM_BUILD_ROOT
-    mkdir restore
-    cp -r lib/modules/$KernelVer/* restore/.
-
-    %{log_msg "Remove files in the kernel-modules-* file lists"}
-    # don't include anything going into kernel-modules-extra in the file lists
-    xargs rm -rf < mod-extra.list
-    # don't include anything going into kernel-modules-internal in the file lists
-    xargs rm -rf < mod-internal.list
-%if 0%{!?fedora:1}
-    # don't include anything going into kernel-modules-partner in the file lists
-    xargs rm -rf < mod-partner.list
-%endif
-    if [[ "$Variant" == "rt" || "$Variant" == "rt-debug" ]]; then
-    	# don't include anything going into kernel-rt-kvm in the file lists
-	xargs rm -rf < mod-kvm.list
-    fi
-
-    if [ $DoModules -eq 1 ]; then
-	%{log_msg "Filter files into core and modules lists"}
-	# Find all the module files and filter them out into the core and
-	# modules lists.  This actually removes anything going into -modules
-	# from the dir.
-	find lib/modules/$KernelVer/kernel -name *.ko | sort -n > modules.list
-	./filter-modules.sh modules.list %{_target_cpu}
-	rm filter-*.sh
-
-	# Run depmod on the resulting module tree and make sure it isn't broken
-	depmod -b . -aeF ./System.map $KernelVer &> depmod.out
-	if [ -s depmod.out ]; then
-	    %{log_msg "Depmod failure"}
-	    cat depmod.out
-	    exit 1
-	else
-	    rm depmod.out
-	fi
-    else
-	%{log_msg "Create empty files for RPM packaging"}
-	# Ensure important files/directories exist to let the packaging succeed
-	echo '%%defattr(-,-,-)' > modules.list
-	echo '%%defattr(-,-,-)' > k-d.list
-	mkdir -p lib/modules/$KernelVer/kernel
-	# Add files usually created by make modules, needed to prevent errors
-	# thrown by depmod during package installation
-	touch lib/modules/$KernelVer/modules.order
-	touch lib/modules/$KernelVer/modules.builtin
-    fi
 
     if [[ "$Variant" == "rt" || "$Variant" == "rt-debug" ]]; then
 	%{log_msg "Skipping efiuki build"}
     else
 %if %{with_efiuki}
-	%{log_msg "Setup the EFI UKI kernel"}
-	popd
+        %{log_msg "Setup the EFI UKI kernel"}
 
 	KernelUnifiedImageDir="$RPM_BUILD_ROOT/lib/modules/$KernelVer"
     	KernelUnifiedImage="$KernelUnifiedImageDir/$InstallName-virt.efi"
@@ -2645,57 +2566,116 @@ BuildKernel() {
 # signkernel
 %endif
 
-	pushd $RPM_BUILD_ROOT
 
 # with_efiuki
 %endif
 	:  # in case of empty block
     fi # "$Variant" == "rt" || "$Variant" == "rt-debug"
 
-    remove_depmod_files
 
-    # Go back and find all of the various directories in the tree.  We use this
-    # for the dir lists in kernel-core
-    find lib/modules/$KernelVer/kernel -mindepth 1 -type d | sort -n > module-dirs.list
+    #
+    # Generate the modules files lists
+    #
+    move_kmod_list()
+    {
+        local module_list="$1"
+        local subdir_name="$2"
+
+        mkdir -p "$RPM_BUILD_ROOT/lib/modules/$KernelVer/$subdirname"
+
+        set +x
+        while read -r kmod; do
+            local target_file="$RPM_BUILD_ROOT/lib/modules/$KernelVer/$subdir_name/$kmod"
+            local target_dir="${target_file%/*}"
+            mkdir -p "$target_dir"
+            mv "$RPM_BUILD_ROOT/lib/modules/$KernelVer/kernel/$kmod" "$target_dir"
+        done < <(sed -e 's|^kernel/||' "$module_list")
+        set -x
+    }
 
-    # Cleanup
-    %{log_msg "Cleanup build files"}
-    rm System.map
-    # Just "cp -r" can be very slow: here, it rewrites _existing files_
-    # with open(O_TRUNC). Many filesystems synchronously wait for metadata
-    # update for such file rewrites (seen in strace as final close syscall
-    # taking a long time). On a rotational disk, cp was observed to take
-    # more than 5 minutes on ext4 and more than 15 minutes (!) on xfs.
-    # With --remove-destination, we avoid this, and copying
-    # (with enough RAM to cache it) takes 5 seconds:
-    cp -r --remove-destination restore/* lib/modules/$KernelVer/.
-    rm -rf restore
-    popd
+    create_module_file_list()
+    {
+        # subdirectory within /lib/modules/$KernelVer where kmods should go
+        local module_subdir="$1"
+        # kmod list with relative paths produced by filtermods.py
+        local relative_kmod_list="$2"
+        # list with absolute paths to kmods and other files to be included
+        local absolute_file_list="$3"
+        # if 1, this adds also all kmod directories to absolute_file_list
+        local add_all_dirs="$4"
+
+        if [ "$module_subdir" == "kernel" ]; then
+            # make kmod paths absolute
+            sed -e 's|^kernel/|/lib/modules/'$KernelVer'/kernel/|' %{?zipsed} $relative_kmod_list > $absolute_file_list
+        else
+            # move kmods into subdirs if needed (internal, partner, extra,..)
+            move_kmod_list $relative_kmod_list $module_subdir
+            # make kmod paths absolute
+            sed -e 's|^kernel/|/lib/modules/'$KernelVer'/'$module_subdir'/|' $relative_kmod_list > $absolute_file_list
+            # run deny-mod script, this adds blacklist-* files to absolute_file_list
+            %{SOURCE20} "$RPM_BUILD_ROOT" lib/modules/$KernelVer $absolute_file_list
+%if %{zipmodules}
+            # deny-mod script works with kmods as they are now (not compressed),
+            # but if they will be we need to add compext to all
+            sed -i %{?zipsed} $absolute_file_list
+%endif
+            # add also dir for the case when there are no kmods
+            echo "%dir /lib/modules/$KernelVer/$module_subdir" >> $absolute_file_list
+        fi
 
-    # Make sure the files lists start with absolute paths or rpmbuild fails.
-    # Also add in the dir entries
-    %{log_msg "Create module list files for all kernel variants"}
-    sed -e 's/^lib*/\/lib/' %{?zipsed} $RPM_BUILD_ROOT/k-d.list > ../kernel${Variant:+-${Variant}}-modules.list
-    sed -e 's/^lib*/%dir \/lib/' %{?zipsed} $RPM_BUILD_ROOT/module-dirs.list > ../kernel${Variant:+-${Variant}}-modules-core.list
-    sed -e 's/^lib*/\/lib/' %{?zipsed} $RPM_BUILD_ROOT/modules.list >> ../kernel${Variant:+-${Variant}}-modules-core.list
-    sed -e 's/^lib*/\/lib/' %{?zipsed} $RPM_BUILD_ROOT/mod-extra.list >> ../kernel${Variant:+-${Variant}}-modules-extra.list
-    if [[ "$Variant" == "rt" || "$Variant" == "rt-debug" ]]; then
-    	sed -e 's/^lib*/\/lib/' %{?zipsed} $RPM_BUILD_ROOT/mod-kvm.list >> ../kernel${Variant:+-${Variant}}-kvm.list
-    fi
+        if [ "$add_all_dirs" -eq 1 ]; then
+            (cd $RPM_BUILD_ROOT; find lib/modules/$KernelVer/kernel -mindepth 1 -type d | sort -n) > ../module-dirs.list
+            sed -e 's|^lib|%dir /lib|' ../module-dirs.list >> $absolute_file_list
+        fi
+    }
+
+    if [ $DoModules -eq 1 ]; then
+        # save modules.dep for debugging
+        cp $RPM_BUILD_ROOT/lib/modules/$KernelVer/modules.dep ../
 
-    # Cleanup kernel variant module lists
-    %{log_msg "Clean up kernel variant module lists"}
-    rm -f $RPM_BUILD_ROOT/k-d.list
-    rm -f $RPM_BUILD_ROOT/modules.list
-    rm -f $RPM_BUILD_ROOT/module-dirs.list
-    rm -f $RPM_BUILD_ROOT/mod-extra.list
-    rm -f $RPM_BUILD_ROOT/mod-internal.list
+        %{log_msg "Create module list files for all kernel variants"}
+        variants_param=""
+        if [[ "$Variant" == "rt" || "$Variant" == "rt-debug" ]]; then
+            variants_param="-r rt"
+        fi
+        # this creates ../modules-*.list output, where each kmod path is as it
+        # appears in modules.dep (relative to lib/modules/$KernelVer)
+        %{SOURCE22} sort -d $RPM_BUILD_ROOT/lib/modules/$KernelVer/modules.dep -c configs/def_variants.yaml $variants_param -o ..
+        if [ $? -ne 0 ]; then
+            echo "8< --- modules.dep ---"
+            cat $RPM_BUILD_ROOT/lib/modules/$KernelVer/modules.dep
+            echo "--- modules.dep --- >8"
+            exit 1
+        fi
+
+        create_module_file_list "kernel" ../modules-core.list ../kernel${Variant:+-${Variant}}-modules-core.list 1
+        create_module_file_list "kernel" ../modules.list ../kernel${Variant:+-${Variant}}-modules.list 0
+        create_module_file_list "internal" ../modules-internal.list ../kernel${Variant:+-${Variant}}-modules-internal.list 0
+        create_module_file_list "extra" ../modules-extra.list ../kernel${Variant:+-${Variant}}-modules-extra.list 0
+        if [[ "$Variant" == "rt" || "$Variant" == "rt-debug" ]]; then
+            create_module_file_list "kvm" ../modules-rt-kvm.list ../kernel${Variant:+-${Variant}}-modules-rt-kvm.list 0
+        fi
 %if 0%{!?fedora:1}
-    rm -f $RPM_BUILD_ROOT/mod-partner.list
+        create_module_file_list "partner" ../modules-partner.list ../kernel${Variant:+-${Variant}}-modules-partner.list 1 0
 %endif
-    if [[ "$Variant" == "rt" || "$Variant" == "rt-debug" ]]; then
-    	rm -f $RPM_BUILD_ROOT/mod-kvm.list
-    fi
+    fi # $DoModules -eq 1
+
+    remove_depmod_files()
+    {
+        # remove files that will be auto generated by depmod at rpm -i time
+        pushd $RPM_BUILD_ROOT/lib/modules/$KernelVer/
+            # in case below list needs to be extended, remember to add a
+            # matching ghost entry in the files section as well
+            rm -f modules.{alias,alias.bin,builtin.alias.bin,builtin.bin} \
+                  modules.{dep,dep.bin,devname,softdep,symbols,symbols.bin}
+        popd
+    }
+
+    # Cleanup
+    %{log_msg "Cleanup build files"}
+    rm -f $RPM_BUILD_ROOT/System.map
+    %{log_msg "Remove depmod files"}
+    remove_depmod_files
 
 %if %{signmodules}
     if [ $DoModules -eq 1 ]; then
@@ -3860,12 +3840,9 @@ fi\
 /usr/src/kernels/%{KVERREL}%{?3:+%{3}}\
 %{expand:%%files %{?3:%{3}-}devel-matched}\
 %{expand:%%files -f kernel-%{?3:%{3}-}modules-extra.list %{?3:%{3}-}modules-extra}\
-%config(noreplace) /etc/modprobe.d/*-blacklist.conf\
-%{expand:%%files %{?3:%{3}-}modules-internal}\
-/lib/modules/%{KVERREL}%{?3:+%{3}}/internal\
+%{expand:%%files -f kernel-%{?3:%{3}-}modules-internal.list %{?3:%{3}-}modules-internal}\
 %if 0%{!?fedora:1}\
-%{expand:%%files %{?3:%{3}-}modules-partner}\
-/lib/modules/%{KVERREL}%{?3:+%{3}}/partner\
+%{expand:%%files -f kernel-%{?3:%{3}-}modules-partner.list %{?3:%{3}-}modules-partner}\
 %endif\
 %if %{with_debuginfo}\
 %ifnarch noarch\
@@ -3873,8 +3850,7 @@ fi\
 %endif\
 %endif\
 %if "%{3}" == "rt" || "%{3}" == "rt-debug"\
-%{expand:%%files %{?3:%{3}-}kvm}\
-/lib/modules/%{KVERREL}%{?3:+%{3}}/kvm\
+%{expand:%%files -f kernel-%{?3:%{3}-}modules-rt-kvm.list %{?3:%{3}-}kvm}\
 %else\
 %if %{with_efiuki}\
 %{expand:%%files %{?3:%{3}-}uki-virt}\
diff --git a/redhat/rhel_files/def_variants.yaml.rhel b/redhat/rhel_files/def_variants.yaml.rhel
new file mode 100644
index blahblah..blahblah 100644
--- /dev/null
+++ b/redhat/rhel_files/def_variants.yaml.rhel
@@ -0,0 +1,519 @@
+packages:
+  - name: modules-core
+    depends-on: []
+  - name: modules
+    depends-on:
+    - modules-core
+  - name: modules-internal
+    depends-on:
+    - modules-core
+    - modules
+  - name: modules-extra
+    depends-on:
+    - modules-core
+    - modules
+  - name: modules-rt-kvm
+    if_variant_in: ["rt"]
+    depends-on:
+    - modules-core
+  - name: modules-partner
+    depends-on:
+    - modules-core
+    - modules
+
+rules:
+  - arch/x86/kvm/kvm(-amd|-intel|\.).*: modules-rt-kvm
+    if_variant_in: ["rt"]
+
+  - arch/.*: modules-core
+  - block/t10-pi.ko: modules-core
+  - crypto/.*: modules-core
+
+  - drivers/accel/.*: modules-core
+  - drivers/accessibility/.*: modules-core
+  - drivers/acpi/video.*: modules
+  - drivers/acpi/.*: modules-core
+  - drivers/ata/.*: modules-core
+
+  - drivers/base/.*(kunit|test).*: modules-internal
+  - drivers/base/regmap/regmap-sdw.*: modules
+  - drivers/base/.*: modules-core
+  - drivers/block/floppy.*: modules-extra
+  - drivers/block/rnbd.*: modules
+  - drivers/block/.*: modules-core
+  - drivers/bus/.*: modules-core
+
+  - drivers/cdrom/.*: modules-core
+  - drivers/cdx/.*: modules-core
+  - drivers/char/mwave.*: modules
+  - drivers/char/.*: modules-core
+  - drivers/clk/.*test.*: modules-internal
+  - drivers/clk/.*: modules-core
+  - drivers/counter/.*: modules-core
+  - drivers/cpufreq/.*: modules-core
+  - drivers/crypto/caam/.*: modules
+  - drivers/crypto/cavium/.*: modules
+  - drivers/crypto/chelsio/.*: modules
+  - drivers/crypto/hisilicon/.*: modules
+  - drivers/crypto/marvell/.*: modules
+  - drivers/crypto/.*: modules-core
+  - drivers/cxl/.*: modules-core
+
+  - drivers/dax/.*: modules-core
+  - drivers/dca/.*: modules-core
+  - drivers/devfreq/.*: modules-core
+  - drivers/dma/dmatest.*: modules-internal
+  - drivers/dma/.*: modules-core
+
+  - drivers/edac/.*: modules-core
+  - drivers/extcon/.*: modules-core
+
+  - drivers/firmware/iscsi_ibft.*: modules
+  - drivers/firmware/.*: modules-core
+  - drivers/fsi/.*: modules-core
+
+  - drivers/gnss/.*: modules-core
+  - drivers/gpio/gpio-dln2.*: modules-extra
+  - drivers/gpio/gpio-ljca.*: modules
+  - drivers/gpio/.*: modules-core
+  - drivers/gpu/drm/i915/kvmgt.*: modules-rt-kvm
+    if_variant_in: ["rt"]
+  - drivers/gpu/drm/display/drm_.*: modules-core
+  - drivers/gpu/drm/drm.*: modules-core
+  - drivers/gpu/drm/etnaviv/.*: modules-core
+  - drivers/gpu/drm/gud/.*: modules-core
+  - drivers/gpu/drm/hyperv/.*: modules-core
+  - drivers/gpu/drm/imagination/.*: modules-core
+  - drivers/gpu/drm/lima/.*: modules-core
+  - drivers/gpu/drm/mxsfb/.*: modules-core
+  - drivers/gpu/drm/panfrost/.*: modules-core
+  - drivers/gpu/drm/qxl/.*: modules-core
+  - drivers/gpu/drm/scheduler/.*: modules-core
+  - drivers/gpu/drm/solomon/.*: modules-core
+  - drivers/gpu/drm/tests/.*: modules-internal
+  - drivers/gpu/drm/tidss/.*: modules-core
+  - drivers/gpu/drm/tiny/.*: modules-core
+  - drivers/gpu/drm/ttm/.*: modules-core
+  - drivers/gpu/drm/udl/.*: modules-core
+  - drivers/gpu/drm/v3d/.*: modules-core
+  - drivers/gpu/drm/vgem/.*: modules-core
+  - drivers/gpu/drm/virtio/.*: modules-core
+  - drivers/gpu/drm/vkms/.*: modules-core
+  - drivers/gpu/drm/vmwgfx/.*: modules-core
+  - drivers/gpu/drm/xlnx/.*: modules-core
+  - drivers/gpu/host1x/.*: modules-core
+
+  - drivers/hid/.*test.*: modules-internal
+  - drivers/hid/hid-asus.*: modules
+  - drivers/hid/hid-nintendo.*: modules
+  - drivers/hid/hid-picolcd.*: modules
+  - drivers/hid/hid-playstation.*: modules
+  - drivers/hid/surface-hid.*: modules
+  - drivers/hid/hid-prodikeys.*: modules
+  - drivers/hid/.*: modules-core
+  - drivers/hte/.*: modules-core
+  - drivers/hv/.*: modules-core
+  - drivers/hwmon/asus_wmi_sensors.*: modules
+  - drivers/hwmon/dell-smm-hwmon.*: modules
+  - drivers/hwmon/hp-wmi-sensors.*: modules
+  - drivers/hwmon/intel-m10-bmc-hwmon.*: modules
+  - drivers/hwmon/nct6775.*: modules
+  - drivers/hwmon/ntc_thermistor.*: modules
+  - drivers/hwmon/.*: modules-core
+  - drivers/hwspinlock/.*: modules-core
+  - drivers/hwtracing/.*: modules-core
+
+  - drivers/i2c/busses/i2c-dln2.*: modules-extra
+  - drivers/i2c/busses/i2c-ljca.*: modules
+  - drivers/i2c/.*: modules-core
+  - drivers/i3c/.*: modules-core
+  - drivers/iio/adc/dln2-adc.*: modules-extra
+  - drivers/iio/test/.*: modules-internal
+  - drivers/input/gameport/.*: modules
+  - drivers/input/joystick/.*: modules-extra
+  - drivers/input/tablet/.*: modules
+  - drivers/input/tests/.*: modules-internal
+  - drivers/input/touchscreen/.*: modules
+  - drivers/input/.*: modules-core
+  - drivers/interconnect/.*: modules-core
+  - drivers/iommu/.*: modules-core
+  - drivers/irqchip/.*: modules-core
+
+  - drivers/mailbox/.*: modules-core
+  - drivers/md/.*: modules-core
+  - drivers/memory/dfl-emif.*: modules
+  - drivers/memory/.*: modules-core
+  - drivers/message/fusion/mptctl.*: modules-extra
+  - drivers/message/fusion/mptfc.*: modules-extra
+  - drivers/message/fusion/.*: modules
+  - drivers/message/.*: modules-core
+  - drivers/mfd/dln2.*: modules-extra
+  - drivers/misc/.*: modules-core
+  - drivers/mux/.*: modules-core
+
+  - drivers/net/amt.ko: modules-core
+  - drivers/net/bareudp.ko: modules-core
+  - drivers/net/bonding/.*: modules-core
+  - drivers/net/can/slcan/slcan.*: modules-extra
+  - drivers/net/can/usb/ems_usb.*: modules-extra
+  - drivers/net/can/vcan.*: modules-extra
+  - drivers/net/dummy.ko: modules-core
+  - drivers/net/eql.ko: modules-core
+
+  - drivers/net/ethernet/8390/.*: modules-core
+  - drivers/net/ethernet/adi/.*: modules-core
+  - drivers/net/ethernet/agere/.*: modules-core
+  - drivers/net/ethernet/altera/.*: modules-core
+  - drivers/net/ethernet/amazon/.*: modules-core
+  - drivers/net/ethernet/amd/.*: modules-core
+  - drivers/net/ethernet/apm/.*: modules-core
+  - drivers/net/ethernet/asix/.*: modules-core
+  - drivers/net/ethernet/brocade/.*: modules-core
+  - drivers/net/ethernet/cavium/.*: modules-core
+  - drivers/net/ethernet/dnet.ko: modules-core
+  - drivers/net/ethernet/engleder/.*: modules-core
+  - drivers/net/ethernet/ethoc.ko: modules-core
+  - drivers/net/ethernet/fealnx.ko: modules-core
+  - drivers/net/ethernet/freescale/.*: modules-core
+  - drivers/net/ethernet/fungible/.*: modules-core
+  - drivers/net/ethernet/google/.*: modules-core
+  - drivers/net/ethernet/hisilicon/.*: modules-core
+  - drivers/net/ethernet/huawei/.*: modules-core
+  - drivers/net/ethernet/ibm/.*: modules-core
+  - drivers/net/ethernet/intel/.*: modules-core
+  - drivers/net/ethernet/jme.ko: modules-core
+  - drivers/net/ethernet/litex/.*: modules-core
+  - drivers/net/ethernet/mellanox/.*: modules-core
+  - drivers/net/ethernet/microsoft/.*: modules-core
+  - drivers/net/ethernet/myricom/.*: modules-core
+  - drivers/net/ethernet/natsemi/.*: modules-core
+  - drivers/net/ethernet/netronome/.*: modules-core
+  - drivers/net/ethernet/pensando/.*: modules-core
+  - drivers/net/ethernet/rocker/rocker.*: modules-internal
+  - drivers/net/ethernet/qualcomm/.*: modules-core
+  - drivers/net/ethernet/realtek/.*: modules-core
+  - drivers/net/ethernet/renesas/.*: modules-core
+  - drivers/net/ethernet/socionext/.*: modules-core
+  - drivers/net/ethernet/vertexcom/.*: modules-core
+  - drivers/net/ethernet/wangxun/.*: modules-core
+  - drivers/net/ethernet/xilinx/.*: modules-core
+
+  - drivers/net/fjes/.*: modules-core
+  - drivers/net/geneve.ko: modules-core
+  - drivers/net/gtp.ko: modules-core
+  - drivers/net/hamradio/.*: modules-extra
+  - drivers/net/hyperv/.*: modules-core
+  - drivers/net/ifb.ko: modules-core
+  - drivers/net/ipa/.*: modules-core
+  - drivers/net/ipvlan/.*: modules-core
+  - drivers/net/macsec.ko: modules-core
+  - drivers/net/macvlan.ko: modules-core
+  - drivers/net/macvtap.ko: modules-core
+  - drivers/net/mctp/.*: modules-core
+  - drivers/net/mdio.*: modules-core
+  - drivers/net/mhi_net.ko: modules-core
+  - drivers/net/mii.ko: modules-core
+  - drivers/net/net_failover.ko: modules-core
+  - drivers/net/netdevsim/netdevsim.*: modules-internal
+  - drivers/net/netconsole.ko: modules-core
+  - drivers/net/nlmon.ko: modules-core
+  - drivers/net/pcs/.*: modules-core
+  - drivers/net/phy/.*: modules-core
+  - drivers/net/rionet.ko: modules-core
+  - drivers/net/slip/slip.*: modules-extra
+  - drivers/net/sungem_phy.ko: modules-core
+  - drivers/net/tap.ko: modules-core
+  - drivers/net/team/.*: modules-core
+  - drivers/net/thunderbolt/.*: modules-core
+  - drivers/net/tun.ko: modules-core
+  - drivers/net/veth.ko: modules-core
+  - drivers/net/virtio_net.ko: modules-core
+  - drivers/net/vmxnet3/.*: modules-core
+  - drivers/net/vrf.ko: modules-core
+  - drivers/net/vsockmon.ko: modules-core
+  - drivers/net/vxlan/.*: modules-core
+  - drivers/net/wan/hdlc.*: modules-core
+  - drivers/net/wireguard/.*: modules-core
+  - drivers/net/wireless/virtual/mac80211_hwsim.*: modules-internal
+  - drivers/net/wwan/wwan_hwsim.*: modules-internal
+  - drivers/net/wwan/.*: modules-core
+  - drivers/net/xen.*: modules-core
+
+  - drivers/nvdimm/.*: modules-core
+  - drivers/nvme/host/nvme-rdma.*: modules
+  - drivers/nvme/target/nvmet-rdma.*: modules
+  - drivers/nvme/.*: modules-core
+  - drivers/nvmem/nvmem_u-boot-env.*: modules
+  - drivers/nvmem/.*: modules-core
+
+  - drivers/parport/parport_serial.*: modules
+  - drivers/parport/.*: modules-core
+  - drivers/pci/pcie/aer_inject.*: modules-extra
+  - drivers/pci/.*: modules-core
+  - drivers/perf/.*: modules-core
+  - drivers/phy/.*: modules-core
+  - drivers/pinctrl/.*: modules-core
+  - drivers/platform/chrome/.*test.*: modules-internal
+  - drivers/platform/x86/intel/intel_vsec.*: modules-core
+  - drivers/pmdomain/.*: modules-core
+  - drivers/powercap/intel_rapl_tpmi.*: modules
+  - drivers/powercap/.*: modules-core
+  - drivers/pps/.*: modules-core
+  - drivers/ptp/ptp_kvm.*: modules-rt-kvm
+    if_variant_in: ["rt"]
+  - drivers/ptp/ptp_dfl_tod.*: modules
+  - drivers/ptp/.*: modules-core
+  - drivers/pwm/.*: modules-core
+
+  - drivers/rapidio/.*: modules-core
+  - drivers/regulator/arizona-micsupp.*: modules
+  - drivers/regulator/.*: modules-core
+  - drivers/remoteproc/.*: modules-core
+  - drivers/reset/.*: modules-core
+  - drivers/rpmsg/.*: modules-core
+  - drivers/rtc/.*test.*: modules-internal
+  - drivers/rtc/.*: modules-core
+
+  - drivers/s390/net/ism.*: modules
+  - drivers/s390/.*: modules-core
+
+  - drivers/scsi/3w.*: modules-core
+  - drivers/scsi/BusLogic.ko: modules-core
+  - drivers/scsi/a100u2w.ko: modules-core
+  - drivers/scsi/advansys.ko: modules-core
+  - drivers/scsi/am53c974.ko: modules-core
+  - drivers/scsi/arcmsr.*: modules-core
+  - drivers/scsi/atp870u.ko: modules-core
+  - drivers/scsi/ch.ko: modules-core
+  - drivers/scsi/cxlflash/.*: modules-core
+  - drivers/scsi/dc395x.ko: modules-core
+  - drivers/scsi/device_handler/.*: modules-core
+  - drivers/scsi/dmx3191d.ko: modules-core
+  - drivers/scsi/elx/.*: modules-core
+  - drivers/scsi/esp_scsi.ko: modules-core
+  - drivers/scsi/fdomain.*: modules-core
+  - drivers/scsi/hpsa.ko: modules-core
+  - drivers/scsi/hptiop.ko: modules-core
+  - drivers/scsi/hv_storvsc.ko: modules-core
+  - drivers/scsi/ibmvscsi.*: modules-core
+  - drivers/scsi/initio.ko: modules-core
+  - drivers/scsi/ipr.ko: modules-core
+  - drivers/scsi/ips.ko: modules-core
+  - drivers/scsi/iscsi_tcp.ko: modules-core
+  - drivers/scsi/libfc/.*: modules-core
+  - drivers/scsi/libiscsi.*: modules-core
+  - drivers/scsi/mpi3mr/.*: modules-core
+  - drivers/scsi/mvumi.ko: modules-core
+  - drivers/scsi/myrb.ko: modules-core
+  - drivers/scsi/myrs.ko: modules-core
+  - drivers/scsi/raid_class.ko: modules-core
+  - drivers/scsi/scsi_debug.ko: modules-core
+  - drivers/scsi/scsi_transport_.*: modules-core
+  - drivers/scsi/sd_mod.ko: modules-core
+  - drivers/scsi/ses.ko: modules-core
+  - drivers/scsi/sg.ko: modules-core
+  - drivers/scsi/smartpqi/.*: modules-core
+  - drivers/scsi/snic/.*: modules-core
+  - drivers/scsi/sr_mod.ko: modules-core
+  - drivers/scsi/st.ko: modules-core
+  - drivers/scsi/stex.ko: modules-core
+  - drivers/scsi/virtio_scsi.ko: modules-core
+  - drivers/scsi/vmw_pvscsi.ko: modules-core
+  - drivers/scsi/wd719x.ko: modules-core
+  - drivers/scsi/xen-scsifront.ko: modules-core
+
+  - drivers/slimbus/.*: modules-core
+  - drivers/soc/.*: modules-core
+  - drivers/spi/spi-altera-dfl.*: modules
+  - drivers/spi/spi-dln2.*: modules-extra
+  - drivers/spi/spi-ljca.*: modules
+  - drivers/spi/.*: modules-core
+  - drivers/spmi/.*: modules-core
+
+  - drivers/target/iscsi/cxgbit/cxgbit.*: modules
+  - drivers/target/sbp/sbp_target.*: modules
+  - drivers/target/target_core_user.*: modules
+  - drivers/target/.*: modules-core
+  - drivers/tee/.*: modules-core
+  - drivers/thermal/intel/int340x_thermal/int3406_thermal.*: modules
+  - drivers/thermal/.*: modules-core
+  - drivers/thunderbolt/.*: modules-core
+
+  - drivers/ufs/.*: modules-core
+  - drivers/usb/atm/.*: modules
+  - drivers/usb/gadget/function/usb_f_midi2.*: modules
+  - drivers/usb/image/.*: modules
+  - drivers/usb/misc/trancevibrator.*: modules-extra
+  - drivers/usb/misc/.*: modules
+  - drivers/usb/serial/.*: modules
+  - drivers/usb/typec/mux/nb7vpq904m.*: modules
+  - drivers/usb/usbip/.*: modules-extra
+  - drivers/usb/.*: modules-core
+
+  - drivers/vdpa/mlx5/mlx5_vdpa.*: modules
+  - drivers/vdpa/pds/pds_vdpa.*: modules
+  - drivers/vdpa/.*: modules-core
+  - drivers/vfio/pci/mlx5/mlx5-vfio-pci.*: modules
+  - drivers/vfio/pci/pds/pds-vfio-pc.*: modules
+  - drivers/vfio/.*: modules-core
+  - drivers/vhost/.*: modules-core
+  - drivers/video/backlight/apple_bl.*: modules
+  - drivers/video/.*: modules-core
+  - drivers/virt/.*: modules-core
+  - drivers/virtio/.*: modules-core
+
+  - drivers/watchdog/.*: modules-core
+
+  - drivers/xen/.*: modules-core
+
+  - drivers/w1/masters/ds2482.*: modules-extra
+  - drivers/w1/masters/ds2490.*: modules-extra
+  - drivers/w1/slaves/w1_ds2408.*: modules-extra
+  - drivers/w1/slaves/w1_ds2423.*: modules-extra
+  - drivers/w1/slaves/w1_ds2431.*: modules-extra
+  - drivers/w1/slaves/w1_ds2433.*: modules-extra
+  - drivers/w1/slaves/w1_ds2780.*: modules-extra
+  - drivers/w1/slaves/w1_ds2781.*: modules-extra
+  - drivers/w1/slaves/w1_ds28e04.*: modules-extra
+  - drivers/w1/slaves/w1_smem.*: modules-extra
+  - drivers/w1/slaves/w1_therm.*: modules-extra
+
+  - fs/.*test.*: modules-internal
+  - fs/9p/.*: modules-core
+  - fs/afs/.*: modules-partner
+  - fs/affs/affs.*: modules-extra
+  - fs/bcachefs/.*: modules-core
+  - fs/befs/befs.*: modules-extra
+  - fs/binfmt_misc.ko: modules-core
+  - fs/cachefiles/.*: modules-core
+  - fs/ceph/.*: modules-core
+  - fs/coda/coda.*: modules-extra
+  - fs/dlm/.*: modules-core
+  - fs/erofs/.*: modules-core
+  - fs/exfat/.*: modules-core
+  - fs/ext4/.*: modules-core
+  - fs/f2fs/.*: modules-core
+  - fs/fat/.*: modules-core
+  - fs/fuse/cuse.*: modules-extra
+  - fs/fuse/.*: modules-core
+  - fs/gfs2/.*: modules-core
+  - fs/isofs/.*: modules-core
+  - fs/jbd2/.*: modules-core
+  - fs/lockd/.*: modules-core
+  - fs/mbcache.ko: modules-core
+  - fs/netfs/.*: modules-core
+  - fs/nfs.*: modules-core
+  - fs/nilfs2/nilfs2.*: modules-extra
+  - fs/nls/.*: modules-core
+  - fs/ntfs3/.*: modules-core
+  - fs/ocfs2/.*: modules-extra
+  - fs/orangefs/.*: modules-core
+  - fs/overlayfs/.*: modules-core
+  - fs/pstore/.*: modules-core
+  - fs/sysv/.*: modules-extra
+  - fs/ubifs/.*: modules-extra
+  - fs/udf/.*: modules-core
+  - fs/ufs/.*: modules-extra
+  - fs/vboxsf/.*: modules-core
+  - fs/xfs/.*: modules-core
+  - fs/zonefs/.*: modules-core
+
+  - kernel/.*test.*: modules-internal
+  - kernel/locking/locktorture.*: modules-internal
+  - kernel/rcu/rcuscale.*: modules-internal
+  - kernel/rcu/rcutorture.*: modules-internal
+  - kernel/rcu/refscale.*: modules-internal
+  - kernel/resource_kunit.*: modules-internal
+  - kernel/scftorture.*: modules-internal
+  - kernel/torture.*: modules-internal
+  - kernel/.*: modules-core
+
+  - lib/.*(test|kunit).*: modules-internal
+  - lib/.*: modules-core
+
+  - mm/kasan/kasan_test: modules-internal
+  - mm/kfence/.*test.*: modules-internal
+  - mm/zsmalloc.ko: modules-core
+
+  - net/.*test.*: modules-internal
+  - net/802/.*: modules-core
+  - net/8021q/.*: modules-core
+  - net/9p/9pnet_rdma.ko: modules
+  - net/9p/.*: modules-core
+  - net/appletalk/appletalk.*: modules-extra
+  - net/atm/br2684.*: modules-extra
+  - net/atm/clip.*: modules-extra
+  - net/atm/lec.*: modules-extra
+  - net/atm/pppoatm.*: modules-extra
+  - net/ax25/ax25.*: modules-extra
+  - net/batman-adv/batman-adv.*: modules-extra
+  - net/bridge/br_netfilter.*: modules-extra
+  - net/bridge/netfilter/ebt.*: modules-extra
+  - net/bridge/.*: modules-core
+  - net/ceph/.*: modules-core
+  - net/core/pktgen.*: modules-internal
+  - net/core/.*: modules-core
+  - net/dns_resolver/.*: modules-core
+  - net/hsr/.*: modules-core
+  - net/ife/.*: modules-core
+  - net/ipv4/netfilter/arp.*: modules-extra
+  - net/ipv4/netfilter/ip[_t].*: modules-extra
+  - net/ipv4/tcp_bic.*: modules-extra
+  - net/ipv4/tcp_highspeed.*: modules-extra
+  - net/ipv4/tcp_htcp.*: modules-extra
+  - net/ipv4/tcp_hybla.*: modules-extra
+  - net/ipv4/tcp_illinois.*: modules-extra
+  - net/ipv4/tcp_lp.*: modules-extra
+  - net/ipv4/tcp_scalable.*: modules-extra
+  - net/ipv4/tcp_vegas.*: modules-extra
+  - net/ipv4/tcp_veno.*: modules-extra
+  - net/ipv4/tcp_westwood.*: modules-extra
+  - net/ipv4/tcp_yeah.*: modules-extra
+  - net/ipv4/.*: modules-core
+  - net/ipv6/netfilter/ebt.*: modules-extra
+  - net/ipv6/netfilter/ip6[_t].*: modules-extra
+  - net/ipv6/.*: modules-core
+  - net/iucv/.*: modules-core
+  - net/kcm/.*: modules-core
+  - net/key/.*: modules-core
+  - net/l2tp/.*: modules-extra
+  - net/llc/.*: modules-core
+  - net/netfilter/ipset/.*: modules-extra
+  - net/netfilter/nft_compat.*: modules-extra
+  - net/netfilter/xt_.*: modules-extra
+  - net/netfilter/.*: modules-core
+  - net/netrom/netrom.*: modules-extra
+  - net/nsh/.*: modules-core
+  - net/openvswitch/.*: modules-core
+  - net/psample/.*: modules-core
+  - net/qrtr/.*: modules-core
+  - net/rds/rds.*: modules-extra
+  - net/rose/rose.*: modules-extra
+  - net/rxrpc/.*: modules-partner
+  - net/sched/sch_choke.*: modules-extra
+  - net/sched/sch_drr.*: modules-extra
+  - net/sched/sch_gred.*: modules-extra
+  - net/sched/sch_mqprio.ko: modules-extra
+  - net/sched/sch_multiq.*: modules-extra
+  - net/sched/sch_netem.*: modules-extra
+  - net/sched/sch_qfq.*: modules-extra
+  - net/sched/sch_red.*: modules-extra
+  - net/sched/sch_sfb.*: modules-extra
+  - net/sched/sch_teql.*: modules-extra
+  - net/sched/.*: modules-core
+  - net/sctp/.*: modules-extra
+  - net/sunrpc/xprtrdma/rpcrdma.*: modules
+  - net/sunrpc/.*: modules-core
+  - net/tipc/.*: modules-core
+  - net/tls/.*: modules-core
+  - net/vmw_vsock/.*: modules-core
+  - net/xdp/.*: modules-core
+  - net/xfrm/.*: modules-core
+
+  - samples/.*: modules-internal
+  - sound/pci/.*test.*: modules-internal
+  - sound/soc/.*test.*: modules-internal
+
+  - virt/.*: modules-core
+
+  - default: modules
diff --git a/redhat/rhel_files/filter-aarch64.sh.rhel b/redhat/rhel_files/filter-aarch64.sh.rhel
deleted file mode 100644
index blahblah..blahblah 0
--- a/redhat/rhel_files/filter-aarch64.sh.rhel
+++ /dev/null
@@ -1,18 +0,0 @@
-#! /bin/bash
-
-# This is the aarch64 override file for the core/drivers package split.  The
-# module directories listed here and in the generic list in filter-modules.sh
-# will be moved to the resulting kernel-modules package for this arch.
-# Anything not listed in those files will be in the kernel-core package.
-#
-# Please review the default list in filter-modules.sh before making
-# modifications to the overrides below.  If something should be removed across
-# all arches, remove it in the default instead of per-arch.
-
-driverdirs="atm auxdisplay bcma bluetooth firewire fmc infiniband isdn leds media memstick message mmc mtd mwave nfc ntb pcmcia platform power ssb staging tty uio uwb w1"
-
-ethdrvs="3com adaptec arc alteon atheros broadcom cadence calxeda chelsio cisco dec dlink emulex icplus marvell micrel myricom neterion nvidia oki-semi packetengines qlogic rdc renesas sfc silan sis smsc stmicro sun tehuti ti via wiznet xircom"
-
-drmdrvs="amd arm bridge ast exynos hisilicon i2c imx mgag200 meson msm nouveau panel radeon rockchip tegra sun4i tinydrm vc4"
-
-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 target_core_user sbp_target cxgbit iw_cxgb3 iw_cxgb4 cxgb3i cxgb3i cxgb3i_ddp cxgb4i chcr chtls"
diff --git a/redhat/rhel_files/filter-armv7hl.sh.rhel b/redhat/rhel_files/filter-armv7hl.sh.rhel
deleted file mode 100644
index blahblah..blahblah 0
--- a/redhat/rhel_files/filter-armv7hl.sh.rhel
+++ /dev/null
diff --git a/redhat/rhel_files/filter-modules.sh.rhel b/redhat/rhel_files/filter-modules.sh.rhel
deleted file mode 100755
index blahblah..blahblah 0
--- a/redhat/rhel_files/filter-modules.sh.rhel
+++ /dev/null
@@ -1,177 +0,0 @@
-#! /bin/bash
-#
-# Called as filter-modules.sh list-of-modules Arch
-
-# This script filters the modules into the kernel-core and kernel-modules
-# 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
-# pruned is contained in the kernel-modules package.
-#
-# 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
-# subsys should be in kernel-modules on all arches, please change the defaults
-# listed here.
-
-# Overrides is individual modules which need to remain in kernel-core due to deps.
-overrides="cec isst_if_common isst_tpmi_core isst_tpmi intel_vsec intel_vsec_tpmi"
-
-# Set the default dirs/modules to filter out
-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"
-
-netdrvs="appletalk can dsa hamradio ieee802154 irda ppp slip usb wireless"
-
-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"
-
-cryptdrvs="bcm caam cavium chelsio hisilicon marvell qat"
-
-inputdrvs="gameport tablet touchscreen"
-
-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"
-
-usbdrvs="atm image misc serial wusbcore"
-
-fsdrvs="affs befs coda cramfs ecryptfs hfs hfsplus jfs minix ncpfs nilfs2 ocfs2 reiserfs romfs smb squashfs sysv ubifs ufs"
-
-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"
-
-drmdrvs="amd ast gma500 i2c i915 mgag200 nouveau radeon via "
-
-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 chtls parport_serial ism regmap-sdw regmap-sdw-mbq arizona-micsupp hid-asus nct6775 ntc_thermistor video apple_bl kasan_test intel-m10-bmc-hwmon dell-smm-hwmon"
-
-# 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
-
-# Filter the char drivers
-for char in ${chardrvs}
-do
-	filter_dir $1 drivers/char/${char}
-done
-
-# Filter the ethernet drivers
-for eth in ${ethdrvs}
-do
-	filter_dir $1 drivers/net/ethernet/${eth}
-done
-
-# Filter the crypto drivers
-for crypt in ${cryptdrvs}
-do
-	filter_dir $1 drivers/crypto/${crypt}
-done
-
-# SCSI
-for scsi in ${scsidrvs}
-do
-	filter_dir $1 drivers/scsi/${scsi}
-done
-
-# Input
-for input in ${inputdrvs}
-do
-	filter_dir $1 drivers/input/${input}
-done
-
-# 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
-filter_dir $1 kernel/drivers/soundwire
-
-# 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
-
-# Now process the override list to bring those modules back into core
-for mod in ${overrides}
-do
-	grep -v -e "/${mod}.ko" k-d.list > k-d.list.tmp
-	if [ $? -ne 0 ]
-        then
-                echo "Couldn't save ${mod}.ko  Skipping."
-        else
-                grep -e "/${mod}.ko" k-d.list >> $filelist
-                mv k-d.list.tmp k-d.list
-        fi
-
-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
diff --git a/redhat/rhel_files/filter-ppc64le.sh.rhel b/redhat/rhel_files/filter-ppc64le.sh.rhel
deleted file mode 100644
index blahblah..blahblah 0
--- a/redhat/rhel_files/filter-ppc64le.sh.rhel
+++ /dev/null
@@ -1,14 +0,0 @@
-#! /bin/bash
-
-# This is the ppc64le override file for the core/drivers package split.  The
-# module directories listed here and in the generic list in filter-modules.sh
-# will be moved to the resulting kernel-modules package for this arch.
-# Anything not listed in those files will be in the kernel-core package.
-#
-# Please review the default list in filter-modules.sh before making
-# modifications to the overrides below.  If something should be removed across
-# all arches, remove it in the default instead of per-arch.
-
-driverdirs="atm auxdisplay bcma bluetooth firewire fmc infiniband isdn leds media memstick message mmc mtd mwave nfc ntb pcmcia platform power ssb staging tty uio uwb w1"
-
-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 target_core_user sbp_target cxgbit iw_cxgb3 iw_cxgb4 cxgb3i cxgb3i cxgb3i_ddp cxgb4i chcr chtls"
diff --git a/redhat/rhel_files/filter-s390x.sh.rhel b/redhat/rhel_files/filter-s390x.sh.rhel
deleted file mode 100644
index blahblah..blahblah 0
--- a/redhat/rhel_files/filter-s390x.sh.rhel
+++ /dev/null
@@ -1,12 +0,0 @@
-#! /bin/bash
-
-# This is the s390x override file for the core/drivers package split.  The
-# module directories listed here and in the generic list in filter-modules.sh
-# will be moved to the resulting kernel-modules package for this arch.
-# Anything not listed in those files will be in the kernel-core package.
-#
-# Please review the default list in filter-modules.sh before making
-# modifications to the overrides below.  If something should be removed across
-# all arches, remove it in the default instead of per-arch.
-
-# Defaults work so no need to override
diff --git a/redhat/rhel_files/filter-x86_64.sh.rhel b/redhat/rhel_files/filter-x86_64.sh.rhel
deleted file mode 100644
index blahblah..blahblah 0
--- a/redhat/rhel_files/filter-x86_64.sh.rhel
+++ /dev/null
@@ -1,12 +0,0 @@
-#! /bin/bash
-
-# This is the x86_64 override file for the core/drivers package split.  The
-# module directories listed here and in the generic list in filter-modules.sh
-# will be moved to the resulting kernel-modules package for this arch.
-# Anything not listed in those files will be in the kernel-core package.
-#
-# Please review the default list in filter-modules.sh before making
-# modifications to the overrides below.  If something should be removed across
-# all arches, remove it in the default instead of per-arch.
-
-# Defaults work so no need to override
diff --git a/redhat/rhel_files/mod-extra.list.rhel b/redhat/rhel_files/mod-extra.list.rhel
deleted file mode 100644
index blahblah..blahblah 0
--- a/redhat/rhel_files/mod-extra.list.rhel
+++ /dev/null
@@ -1,326 +0,0 @@
-6pack.ko
-a3d.ko
-act200l-sir.ko
-actisys-sir.ko
-adi.ko
-aer_inject.ko
-af_802154.ko
-affs.ko
-ali-ircc.ko
-analog.ko
-appletalk.ko
-arptable_filter.ko
-arp_tables.ko
-arpt_mangle.ko
-atm.ko
-avma1_cs.ko
-avm_cs.ko
-avmfritz.ko
-ax25.ko
-b1.ko
-bas_gigaset.ko
-batman-adv.ko
-baycom_par.ko
-baycom_ser_fdx.ko
-baycom_ser_hdx.ko
-befs.ko
-bpqether.ko
-br2684.ko
-br_netfilter.ko
-capi.ko
-c_can.ko
-c_can_platform.ko
-clip.ko
-cobra.ko
-coda.ko
-cuse.ko
-db9.ko
-dccp_diag.ko
-dccp_ipv4.ko
-dccp_ipv6.ko
-dccp.ko
-dccp_probe.ko
-diva_idi.ko
-divas.ko
-ds1wm.ko
-ds2482.ko
-ds2490.ko
-dss1_divert.ko
-ebt_802_3.ko
-ebtable_broute.ko
-ebtable_filter.ko
-ebtable_nat.ko
-ebtables.ko
-ebt_among.ko
-ebt_arp.ko
-ebt_arpreply.ko
-ebt_dnat.ko
-ebt_ip6.ko
-ebt_ip.ko
-ebt_limit.ko
-ebt_log.ko
-ebt_mark.ko
-ebt_mark_m.ko
-ebt_nflog.ko
-ebt_pkttype.ko
-ebt_redirect.ko
-ebt_snat.ko
-ebt_stp.ko
-ebt_vlan.ko
-elsa_cs.ko
-ems_pci.ko
-ems_usb.ko
-esd_usb2.ko
-esi-sir.ko
-gamecon.ko
-gf2k.ko
-gigaset.ko
-girbil-sir.ko
-grip.ko
-grip_mp.ko
-guillemot.ko
-hdlcdrv.ko
-hfc4s8s_l1.ko
-hfcmulti.ko
-hfcpci.ko
-hisax.ko
-hwa-rc.ko
-hysdn.ko
-i2400m.ko
-i2400m-sdio.ko
-i2400m-usb.ko
-ieee802154.ko
-iforce.ko
-interact.ko
-ip6table_filter.ko
-ip6table_mangle.ko
-ip6table_nat.ko
-ip6table_raw.ko
-ip6table_security.ko
-ip6_tables.ko
-ip6t_ah.ko
-ip6t_eui64.ko
-ip6t_frag.ko
-ip6t_hbh.ko
-ip6t_ipv6header.ko
-ip6t_mh.ko
-ip6t_NPT.ko
-ip6t_REJECT.ko
-ip6t_rpfilter.ko
-ip6t_rt.ko
-ipddp.ko
-ip_set_bitmap_ip.ko
-ip_set_bitmap_ipmac.ko
-ip_set_bitmap_port.ko
-ip_set_hash_ip.ko
-ip_set_hash_ipmac.ko
-ip_set_hash_ipmark.ko
-ip_set_hash_ipportip.ko
-ip_set_hash_ipport.ko
-ip_set_hash_ipportnet.ko
-ip_set_hash_mac.ko
-ip_set_hash_netiface.ko
-ip_set_hash_net.ko
-ip_set_hash_netnet.ko
-ip_set_hash_netport.ko
-ip_set_hash_netportnet.ko
-ip_set.ko
-ip_set_list_set.ko
-iptable_filter.ko
-iptable_mangle.ko
-iptable_nat.ko
-iptable_raw.ko
-iptable_security.ko
-ip_tables.ko
-ipt_ah.ko
-ipt_ECN.ko
-ipt_REJECT.ko
-ipt_rpfilter.ko
-ipx.ko
-isdn.ko
-joydump.ko
-kingsun-sir.ko
-ks959-sir.ko
-ksdazzle-sir.ko
-kvaser_pci.ko
-l2tp_core.ko
-l2tp_debugfs.ko
-l2tp_eth.ko
-l2tp_ip.ko
-l2tp_ip6.ko
-l2tp_netlink.ko
-l2tp_ppp.ko
-lec.ko
-ma600-sir.ko
-magellan.ko
-mcp2120-sir.ko
-mISDN_core.ko
-mISDN_dsp.ko
-mkiss.ko
-mptbase.ko
-mptctl.ko
-mptfc.ko
-nci.ko
-ncpfs.ko
-netjet.ko
-netrom.ko
-nfc.ko
-nft_compat.ko
-nilfs2.ko
-ocfs2_dlmfs.ko
-ocfs2_dlm.ko
-ocfs2.ko
-ocfs2_nodemanager.ko
-ocfs2_stackglue.ko
-ocfs2_stack_o2cb.ko
-ocfs2_stack_user.ko
-old_belkin-sir.ko
-orinoco_cs.ko
-orinoco.ko
-orinoco_nortel.ko
-orinoco_pci.ko
-orinoco_plx.ko
-orinoco_usb.ko
-plx_pci.ko
-pn_pep.ko
-pppoatm.ko
-rds.ko
-rds_rdma.ko
-rds_tcp.ko
-rose.ko
-sch_atm.ko
-sch_cbq.ko
-sch_choke.ko
-sch_drr.ko
-sch_dsmark.ko
-sch_gred.ko
-sch_mqprio.ko
-sch_multiq.ko
-sch_netem.ko
-sch_qfq.ko
-sch_red.ko
-sch_sfb.ko
-sch_teql.ko
-sctp.ko
-sctp_diag.ko
-sctp_probe.ko
-sidewinder.ko
-sja1000.ko
-sja1000_platform.ko
-slcan.ko
-slip.ko
-softing_cs.ko
-softing.ko
-spaceball.ko
-spaceorb.ko
-stinger.ko
-sysv.ko
-tcp_bic.ko
-tcp_highspeed.ko
-tcp_htcp.ko
-tcp_hybla.ko
-tcp_illinois.ko
-tcp_lp.ko
-tcp_scalable.ko
-tcp_vegas.ko
-tcp_veno.ko
-tcp_westwood.ko
-tcp_yeah.ko
-tekram-sir.ko
-tmdc.ko
-toim3232-sir.ko
-trancevibrator.ko
-turbografx.ko
-twidjoy.ko
-ubifs.ko
-ufs.ko
-umc.ko
-usbip-core.ko
-usbip-host.ko
-uwb.ko
-vcan.ko
-vhci-hcd.ko
-w1_bq27000.ko
-w1_ds2408.ko
-w1_ds2423.ko
-w1_ds2431.ko
-w1_ds2433.ko
-w1_ds2760.ko
-w1_ds2780.ko
-w1_ds2781.ko
-w1_ds28e04.ko
-w1_smem.ko
-w1_therm.ko
-w6692.ko
-walkera0701.ko
-wanrouter.ko
-warrior.ko
-whci.ko
-wire.ko
-xt_addrtype.ko
-xt_AUDIT.ko
-xt_bpf.ko
-xt_cgroup.ko
-xt_CHECKSUM.ko
-xt_CLASSIFY.ko
-xt_cluster.ko
-xt_comment.ko
-xt_connbytes.ko
-xt_connlabel.ko
-xt_connlimit.ko
-xt_connmark.ko
-xt_CONNSECMARK.ko
-xt_conntrack.ko
-xt_cpu.ko
-xt_CT.ko
-xt_dccp.ko
-xt_devgroup.ko
-xt_dscp.ko
-xt_DSCP.ko
-xt_ecn.ko
-xt_esp.ko
-xt_hashlimit.ko
-xt_helper.ko
-xt_hl.ko
-xt_HL.ko
-xt_HMARK.ko
-xt_IDLETIMER.ko
-xt_iprange.ko
-xt_ipvs.ko
-xt_length.ko
-xt_limit.ko
-xt_LOG.ko
-xt_mac.ko
-xt_mark.ko
-xt_MASQUERADE.ko
-xt_multiport.ko
-xt_nat.ko
-xt_NETMAP.ko
-xt_NFLOG.ko
-xt_NFQUEUE.ko
-xt_osf.ko
-xt_owner.ko
-xt_physdev.ko
-xt_pkttype.ko
-xt_policy.ko
-xt_quota.ko
-xt_rateest.ko
-xt_RATEEST.ko
-xt_realm.ko
-xt_recent.ko
-xt_REDIRECT.ko
-xt_sctp.ko
-xt_SECMARK.ko
-xt_set.ko
-xt_socket.ko
-xt_state.ko
-xt_statistic.ko
-xt_string.ko
-xt_tcpmss.ko
-xt_TCPMSS.ko
-xt_TCPOPTSTRIP.ko
-xt_TEE.ko
-xt_TPROXY.ko
-xt_TRACE.ko
-yam.ko
-zhenhua.ko
diff --git a/redhat/rhel_files/mod-kvm.list b/redhat/rhel_files/mod-kvm.list
deleted file mode 100644
index blahblah..blahblah 0
--- a/redhat/rhel_files/mod-kvm.list
+++ /dev/null
@@ -1,5 +0,0 @@
-kvm-amd
-kvm-intel
-kvm
-kvmgt
-ptp_kvm
diff --git a/redhat/scripts/filtermods-testdata/test1.dep b/redhat/scripts/filtermods-testdata/test1.dep
new file mode 100644
index blahblah..blahblah 100644
--- /dev/null
+++ b/redhat/scripts/filtermods-testdata/test1.dep
@@ -0,0 +1,4 @@
+kernel/kmod1:
+kernel/kmod2: kernel/kmod1
+kernel/kmod3: kernel/kmod2
+kernel/kmod4:
diff --git a/redhat/scripts/filtermods-testdata/test1.yaml b/redhat/scripts/filtermods-testdata/test1.yaml
new file mode 100644
index blahblah..blahblah 100644
--- /dev/null
+++ b/redhat/scripts/filtermods-testdata/test1.yaml
@@ -0,0 +1,20 @@
+packages:
+  - name: modules-core
+    depends-on: []
+  - name: modules
+    depends-on:
+    - modules-core
+  - name: modules-extra
+    depends-on:
+    - modules-core
+  - name: rt-kvm
+    if_variant_in: ["rt"]
+    depends-on:
+    - modules-core
+
+rules:
+  - kmod[2]: modules-core
+  - kmod4: rt-kvm
+    if_variant_in: ["rt"]
+  - default: modules
+

--
https://gitlab.com/cki-project/kernel-ark/-/merge_requests/2943
--
_______________________________________________
kernel mailing list -- kernel@xxxxxxxxxxxxxxxxxxxxxxx
To unsubscribe send an email to kernel-leave@xxxxxxxxxxxxxxxxxxxxxxx
Fedora Code of Conduct: https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: https://lists.fedoraproject.org/archives/list/kernel@xxxxxxxxxxxxxxxxxxxxxxx
Do not reply to spam, report it: https://pagure.io/fedora-infrastructure/new_issue




[Index of Archives]     [Fedora General Discussion]     [Older Fedora Users Archive]     [Fedora Advisory Board]     [Fedora Security]     [Fedora Devel Java]     [Fedora Legacy]     [Fedora Desktop]     [ATA RAID]     [Fedora Marketing]     [Fedora Mentors]     [Fedora Package Announce]     [Fedora Package Review]     [Fedora Music]     [Fedora Packaging]     [Centos]     [Fedora SELinux]     [Coolkey]     [Yum Users]     [Tux]     [Yosemite News]     [KDE Users]     [Fedora Art]     [Fedora Docs]     [USB]     [Asterisk PBX]

  Powered by Linux