Skip to content

Commit

Permalink
mkinitramfs-ll.{ba,z}sh: minor fix (override applet on request)
Browse files Browse the repository at this point in the history
  • Loading branch information
tokiclover committed Jan 13, 2015
1 parent 6351383 commit a670c65
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 14 deletions.
8 changes: 1 addition & 7 deletions mkinitramfs-ll.bash
Original file line number Diff line number Diff line change
Expand Up @@ -261,14 +261,12 @@ function docpio {
(lz4) ext+=.lz4;;
(*) opts[-compressor]=; warn "initramfs will not be compressed";;
esac

if [[ -f ${initramfs}${ext} ]]; then
mv ${initramfs}${ext}{,.old}
fi
if [[ -n "${ext#.cpio}" ]]; then
cmd+=" | ${opts[-compressor]} -c"
fi

eval ${cmd} > /${initramfs}${ext} ||
die "Failed to build ${initramfs}${ext} initramfs"
}
Expand Down Expand Up @@ -349,7 +347,6 @@ for hook in ${opts[-H]//:/ } ${opts[-hook]//:/ }; do
cp -a "${file}" lib/${PKG[name]}/
done
(( $? != 0 )) && warn "$mod module does not exist"

opts[-bin]+=:${opts[-b$hook]}
opts[-mgrp]+=:$hook
done
Expand Down Expand Up @@ -416,7 +413,6 @@ function domod {
local verbose=$2
shift 2;;
esac

local mod ret name prefix=/lib/modules/${opts[-kv]}/
local -a modules

Expand Down Expand Up @@ -510,7 +506,6 @@ function docp {
rm -f .${link} && cp -a {,.}${link} || die
[[ -h ${link} ]] || break
done

return 0
}

Expand All @@ -519,7 +514,6 @@ function docp {
function dobin {
local bin=$1 lib
docp ${bin} || return

ldd ${bin} >/dev/null || return 0

for lib in $(ldd ${bin} | sed -nre 's,.* (/.*lib.*/.*.so.*) .*,\1,p' \
Expand All @@ -530,7 +524,7 @@ function dobin {

for bin in ${opts[-b]//:/ } ${opts[-bin]//:/ }; do
for b in {usr/,}{,s}bin/${bin}; do
[[ -x ${b} ]] && continue 2
[ -x ${b} -a ! -h ${b} ] && continue 2
done
[[ -x ${bin} ]] && binary=${bin} || binary=$(type -p ${bin})
[[ "${binary}" ]] && dobin ${binary} || warn "no ${bin} binary found"
Expand Down
8 changes: 1 addition & 7 deletions mkinitramfs-ll.zsh
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,6 @@ function docpio {
(lz4) ext+=.lz4;;
(*) opts[-compressor]=; warn "initramfs will not be compressed";;
}

if [[ -f ${initramfs}${ext} ]] {
mv ${initramfs}${ext}{,.old}
}
Expand Down Expand Up @@ -310,7 +309,6 @@ for hook (${(pws,:,)opts[-H]} ${(pws,:,)opts[-hook]}) {
cp -a ${file} lib/${PKG[name]}
}
(( $? != 0 )) && warn "$mod module does not exist"

opts[-bin]+=:${opts[-b$hook]}
opts[-mgrp]+=:$hook
}
Expand Down Expand Up @@ -387,7 +385,6 @@ function domod {
local verbose=$2
shift 2;;
esac

local mod ret prefix=/lib/modules/${opts[-kv]}/
local -a modules

Expand Down Expand Up @@ -452,7 +449,6 @@ if (( ${+$opts[-s]} )) || (( ${+opts[-splash]} )) {
if (( ${+opts[-toi]} || ${+opts[-t]} )) {
opts[-bin]+=:tuxoniceui_text
}

for theme (${(pws,:,)opts[-splash]})
if [[ -d etc/splash/${theme} ]] {
:;
Expand All @@ -478,7 +474,6 @@ function docp {
rm -f .${link} && cp -f {,.}${link} || die
[[ -h ${link} ]] || break
done

return 0
}

Expand All @@ -487,7 +482,6 @@ function docp {
function dobin {
local bin=$1 lib
docp ${bin} || return

ldd ${bin} >/dev/null || return 0

for lib ($(ldd ${bin} | sed -nre 's,.* (/.*lib.*/.*.so.*) .*,\1,p' \
Expand All @@ -496,7 +490,7 @@ function dobin {
}

for bin (${(pws,:,)opts[-b]} ${(pws,:,)opts[-bin]}) {
for b ({usr/,}{,s}bin/${bin}) { [[ -x ${b} ]] && continue 2 }
for b ({usr/,}{,s}bin/${bin}) [ -x ${b} -a ! -h ${b} ] && continue 2
[[ -x ${bin} ]] && binary=${bin} || binary=${commands[$bin]}
[[ -n ${binary} ]] && dobin ${binary} || warn "no ${bin} binary found"
}
Expand Down

0 comments on commit a670c65

Please sign in to comment.