D-link dir-615 c1 with luci-app-sqm

Flash with a stable release first in which one you will base your build (I do not recommend to play with trunk builds)...

do a opkg list-installed and save that list for yourself and investigate the dependencies (usually are very easy to see, (you need to create a list of not-needed packages as you described...

example on ChaosCalmer opkg list-installed:

base-files busybox dnsmasq dropbear firewall fstools hostapd-common ip6tables iptables iw jshn jsonfilter kernel kmod-ath kmod-ath9k kmod-ath9k-common kmod-cfg80211 kmod-crypto-aes kmod-crypto-arc4 kmod-crypto-core kmod-gpio-button-hotplug kmod-ip6tables kmod-ipt-conntrack kmod-ipt-core kmod-ipt-nat kmod-ipv6 kmod-ledtrig-usbdev kmod-lib-crc-ccitt kmod-mac80211 kmod-nf-conntrack kmod-nf-conntrack6 kmod-nf-ipt kmod-nf-ipt6 kmod-nf-nat kmod-nf-nathelper kmod-nls-base kmod-ppp kmod-pppoe kmod-pppox kmod-slhc kmod-usb-core kmod-usb2 libblobmsg-json libc libgcc libip4tc libip6tc libiwinfo libiwinfo-lua libjson-c libjson-script liblua libnl-tiny libubox libubus libubus-lua libuci libuci-lua libxtables lua luci luci-app-firewall luci-base luci-lib-ip luci-lib-nixio luci-mod-admin-full luci-proto-ipv6 luci-proto-ppp luci-theme-bootstrap mtd netifd odhcp6c odhcpd opkg ppp ppp-mod-pppoe procd rpcd swconfig uboot-envtools ubox ubus ubusd uci uhttpd uhttpd-mod-ubus usign wpad-mini

to add sqm you just build with "sqm-scripts" or if you want to have sqm config on luci, use "luci-app-sqm" (automagically will add the "sqm-scripts" dependency as stated on opkg info luci-app-sqm | grep Depends

example to remove IPv6 support and add SQM support you could build using:

make image PROFILE=XXXXXXXX PACKAGES="luci-app-sqm -ip6tables -kmod-ip6tables -kmod-ipv6 -kmod-nf-conntrack6 -kmod-nf-ipt6 -libip6tc -luci-proto-ipv6 -odhcp6c -odhcpd"

I've not tested it but I did the same once with ChaosCalmer and worked just fine.