From 2c3b59c5278e92399d84d8e2c11e9a258c27c29a Mon Sep 17 00:00:00 2001 From: tclover Date: Fri, 23 Jan 2015 10:04:05 +0100 Subject: [PATCH] mkinitramfs-ll.{ba,z}sh: minor fix (noexistent hook/script) --- mkinitramfs-ll.bash | 6 ++++-- mkinitramfs-ll.zsh | 7 +++++-- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/mkinitramfs-ll.bash b/mkinitramfs-ll.bash index 4ecc95d..e3b8e2c 100755 --- a/mkinitramfs-ll.bash +++ b/mkinitramfs-ll.bash @@ -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 @@ -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 diff --git a/mkinitramfs-ll.zsh b/mkinitramfs-ll.zsh index a3d13f6..898f33a 100755 --- a/mkinitramfs-ll.zsh +++ b/mkinitramfs-ll.zsh @@ -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" @@ -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 @@ -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 }