1. delete the redundant space before "-d" of "[ -d xx ]" 2. add blank line after "continue" cmd 3. turn some 2 line code block into one line to be more compact
Signed-off-by: Xu Xijian hdxuxijian@163.com --- container/dracut-initrd/bin/overlay-lkp.sh | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-)
diff --git a/container/dracut-initrd/bin/overlay-lkp.sh b/container/dracut-initrd/bin/overlay-lkp.sh index 1f5819b..9a2800e 100644 --- a/container/dracut-initrd/bin/overlay-lkp.sh +++ b/container/dracut-initrd/bin/overlay-lkp.sh @@ -2,7 +2,7 @@ # SPDX-License-Identifier: GPL-2.0
# transfer LKP dirs -[ -d /lkp ] || return 0 +[ -d /lkp ] || return 0
cp -a /lkp "$NEWROOT"/
@@ -11,8 +11,8 @@ do dir=$(basename "$i")
[ "$i" != "${i%/*}" ] && continue # skip: i='dir/*' - [ -d "$NEWROOT/$dir" ] || - mkdir -p "$NEWROOT/$dir" + + [ -d "$NEWROOT/$dir" ] || mkdir -p "$NEWROOT/$dir"
for j in "$i"/* "$i"/.??* do @@ -25,8 +25,7 @@ do
subdir=$(basename "$j")
- [ -d "$NEWROOT/$dir/$subdir" ] || - mkdir -p "$NEWROOT/$dir/$subdir" + [ -d "$NEWROOT/$dir/$subdir" ] || mkdir -p "$NEWROOT/$dir/$subdir"
for k in "$j"/* do @@ -37,7 +36,7 @@ do done done
-[ -d /usr/src ] && +[ -d /usr/src ] && cp -a /usr/src "$NEWROOT"/usr/
kmdir=/lib/modules/$(uname -r)