Skip to content

Commit

Permalink
mkinitramfs-ll.{ba,z}sh: minor fix (noexistent hook/script)
Browse files Browse the repository at this point in the history
  • Loading branch information
tokiclover committed Jan 23, 2015
1 parent 41f9179 commit 2c3b59c
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
6 changes: 4 additions & 2 deletions mkinitramfs-ll.bash
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,6 @@ if [[ -d "${opts[-usrdir]}" ]]; then
else
die "${opts[-usrdir]} dir not found"
fi

mkdir -p usr/{{,s}bin,share/{consolefonts,keymaps},lib${opts[-arc]}} || die
mkdir -p {,s}bin dev proc sys newroot mnt/tok etc/{${PKG[name]},splash} || die
mkdir -p run lib${opts[-arc]}/{modules/${opts[-kv]},${PKG[name]}} || die
Expand Down Expand Up @@ -330,7 +329,10 @@ for hook in ${opts[-H]//:/ } ${opts[-hook]//:/ }; do
for file in ${opts[-usrdir]}/../hooks/*${hook}*; do
cp -a "${file}" lib/${PKG[name]}/
done
(( $? != 0 )) && warn "$mod module does not exist"
if (( $? != 0 )); then
warn "$hook hook/script does not exist"
continue
fi
opts[-bin]+=:${opts[-b$hook]}
opts[-mgrp]+=:$hook
done
Expand Down
7 changes: 5 additions & 2 deletions mkinitramfs-ll.zsh
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@ unsetopt KSH_ARRAYS
# @VARIABLE: Associative Array holding (almost) every options
typeset -A opts
typeset -a opt

opt=(
"-o" "ab:c::f::F::gk::lH:KLm::p::qrs::thu::y::?"
"-l" "all,bin:,compressor::,firmware::,font::,gpg,help"
Expand Down Expand Up @@ -273,7 +274,6 @@ if [[ ${${(pws:.:)opts[-kv]}[1]} -eq 3 ]] &&
cp -a {/,}dev/loop-control 1>/dev/null 2>&1 ||
mknod -m 600 dev/loop-control c 10 237 || die
}

cp -af ${opts[-usrdir]}/../init . && chmod 775 init || die
[[ -d root ]] && chmod 0700 root || mkdir -m700 root || die

Expand All @@ -288,7 +288,10 @@ for hook (${(pws,:,)opts[-H]} ${(pws,:,)opts[-hook]}) {
for file (${opts[-usrdir]:h}/hooks/*${hook}*) {
cp -a ${file} lib/${PKG[name]}
}
(( $? != 0 )) && warn "$mod module does not exist"
if (( $? != 0 )) {
warn "$hook hook/script does not exist"
continue
}
opts[-bin]+=:${opts[-b$hook]}
opts[-mgrp]+=:$hook
}
Expand Down

0 comments on commit 2c3b59c

Please sign in to comment.