From 68a5cfe5add9c703c796d5a163f8877981eb4d21 Mon Sep 17 00:00:00 2001 From: illiliti Date: Sat, 18 Apr 2020 18:45:24 +0300 Subject: [PATCH] cleanup --- tinyramfs | 16 ++++++++-------- usr/share/tinyramfs/init | 2 ++ 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/tinyramfs b/tinyramfs index 2f304b2..7b4dc95 100755 --- a/tinyramfs +++ b/tinyramfs @@ -296,15 +296,12 @@ install_module() while read -r module || [ "$module" ]; do # strip unneeded stuff - module="${module##*builtin*}" - module="${module##*net*}" - module="${module#insmod }" - - # exclude user specified modules if any - for _exclude_module in $modules_exclude; do - module="${module##*${_exclude_module}*}" + for _exclude_module in wmi gpu net sound builtin $modules_exclude; do + case "$module" in *"$_exclude_module"*) continue 2 ;; esac done + module="${module#insmod }" + # check if module already installed [ -e "$module" ] && [ ! -e "${workdir}${module}" ] && install -Dm644 "$module" "${workdir}${module}" @@ -423,7 +420,10 @@ install_binary() while read -r _library || [ "$_library" ]; do # strip unneeded stuff - _library="${_library##*vdso*}" + for _exclude_library in vdso gate; do + case "$_library" in *"$_exclude_library"*) continue 2 ;; esac + done + _library="${_library#* => }" _library="${_library% *}" diff --git a/usr/share/tinyramfs/init b/usr/share/tinyramfs/init index 797d5ce..4468684 100755 --- a/usr/share/tinyramfs/init +++ b/usr/share/tinyramfs/init @@ -71,6 +71,8 @@ prepare_environment() trap 'panic "something went wrong"' EXIT + # false positive + # shellcheck disable=2015 [ "$modules" ] && modprobe -a "$modules" 2> /dev/null ||: }