diff --git a/helpers/make-hw-detect b/helpers/make-hw-detect
index 518784d1c777d300dae97116b9c3ad6d73eb2af0..9175b472168a109e250728a2442415de9f8ff2b5 100644
--- a/helpers/make-hw-detect
+++ b/helpers/make-hw-detect
@@ -31,7 +31,7 @@ START=$(getline "Template: hw-detect/load_media" debian/hw-detect.templates)
 END=$(getline "If you have such media available now, insert it, and continue." debian/hw-detect.templates)
 sed ${START},${END}d debian/hw-detect.templates -i
 
-sed -i '/need_nonfree=1/d' hw-detect.post-base-installer.d/50install-firmware
+sed -i '/non-free/,/^fi$/ d'  hw-detect.post-base-installer.d/50install-firmware
 
 changelog "Rebranded and adapted for Trisquel"
 compile