Skip to content

Commit

Permalink
Fix ShellCheck errors
Browse files Browse the repository at this point in the history
Signed-off-by: Ethan Dye <[email protected]>
  • Loading branch information
ecdye committed Dec 9, 2020
1 parent 42a3408 commit 5b81b58
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# zram-config
![ShellCheck](https://github.com/ecdye/zram-config/workflows/shellcheck/badge.svg?branch=master)
![ShellCheck](https://github.com/ecdye/zram-config/workflows/ShellCheck/badge.svg)

## Overview

Expand Down
10 changes: 5 additions & 5 deletions zram-config
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,8 @@ createZdir() {
mount --verbose --bind "${TARGET_DIR}/" "${ZDIR}${BIND_DIR}/" >> "$ZLOG" 2>&1 || return 1
mount --verbose --make-private "${ZDIR}${BIND_DIR}/" >> "$ZLOG" 2>&1 || return 1

dirMountOpt="$(awk -v a=${ZDIR}${BIND_DIR} '$2 == a {print $4}' /proc/mounts | head -1)"
dirFSType="$(awk -v a=${ZDIR}${BIND_DIR} '$2 == a {print $3}' /proc/mounts | head -1)"
dirMountOpt="$(awk -v a="${ZDIR}${BIND_DIR}" '$2 == a {print $4}' /proc/mounts | head -1)"
dirFSType="$(awk -v a="${ZDIR}${BIND_DIR}" '$2 == a {print $3}' /proc/mounts | head -1)"

echo "dirMountOpt: ${dirMountOpt}; dirFsType: ${dirFSType}" >> "$ZLOG"
createZdevice || return 1
Expand Down Expand Up @@ -234,9 +234,7 @@ enableZephemeral() {
if [[ $ZEPHEMERAL == "false" ]]; then
mkinitramfs -o /boot/initrd
sed -i '/root=PARTUUID/ s|$| init=/bin/ro-root.sh|' /boot/cmdline.txt
echo "initramfs initrd followkernel" >> /boot/config.txt
echo "ramfsfile=initrd" >> /boot/config.txt
echo "ramfsaddr=-1" >> /boot/config.txt
echo -e "initramfs initrd followkernel\\nramfsfile=initrd\\nramfsaddr=-1" >> /boot/config.txt
cp "${ZSHARE}/ro-root.sh" /bin/ro-root.sh
chown root:root /bin/ro-root.sh
chmod a+x /bin/ro-root.sh
Expand Down Expand Up @@ -287,6 +285,7 @@ case "$1" in
;;

*)
# shellcheck disable=SC2086
set -- $line
echo "ztab create ${1} ${2} ${3} ${4} ${5} ${6} ${7} ${8} ${9}" >> "$ZLOG"
ZTAB_EMPTY="false"
Expand Down Expand Up @@ -359,6 +358,7 @@ case "$1" in
;;

*)
# shellcheck disable=SC2086
set -- $line
echo "ztab remove ${1} ${2} ${3} ${4}" >> "$ZLOG"
case "$1" in
Expand Down

3 comments on commit 5b81b58

@yutayu
Copy link

@yutayu yutayu commented on 5b81b58 Dec 9, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sudo ./install.bash
fatal: destination path 'overlayfs-tools' already exists and is not an empty directory.
make: Nothing to be done for 'all'.
install: cannot stat 'uninstall.sh': No such file or directory
Created symlink /etc/systemd/system/basic.target.wants/zram-config.service → /etc/systemd/system/zram-config.service.

Reboot to activate zram-config
edit /etc/ztab to configure options

some seem happen.

@ecdye
Copy link
Owner Author

@ecdye ecdye commented on 5b81b58 Dec 9, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Try removing the overlafyff-tools directory and running it again, also please use the issues to report things like this.

@yutayu
Copy link

@yutayu yutayu commented on 5b81b58 Dec 10, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sudo ./install.bash
Cloning into 'overlayfs-tools'...
remote: Enumerating objects: 48, done.
remote: Counting objects: 100% (48/48), done.
remote: Compressing objects: 100% (25/25), done.
remote: Total 149 (delta 25), reused 41 (delta 23), pack-reused 101
Receiving objects: 100% (149/149), 51.08 KiB | 292.00 KiB/s, done.
Resolving deltas: 100% (85/85), done.
gcc -Wall -std=c99 -c main.c
gcc -Wall -std=c99 -c logic.c
gcc -Wall -std=c99 -c sh.c
gcc -lm main.o logic.o sh.o -o overlay
install: cannot stat 'uninstall.sh': No such file or directory

Reboot to activate zram-config
edit /etc/ztab to configure options

well fine except uninstall.sh.
Thanks.

Please sign in to comment.