Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

hwdetector #7

Open
wants to merge 11 commits into
base: Kyryl.Krynychnyi
Choose a base branch
from

Conversation

Kyryl3231
Copy link

No description provided.

yekovalyov and others added 7 commits January 28, 2020 17:15
Signed-off-by: Kyryl Krynychnyi <[email protected]>
Create two tmp files. Redirect an output of ls /dev to these files and
compare them. If the script is interrupted or exited, delete tmp files

Signed-off-by: Kyryl Krynychnyi <[email protected]>
USB flash detector is a result of comparison of outputs
of ls /dev/sd[a-z]. Change output format and add delay.

Signed-off-by: Kyryl Krynychnyi <[email protected]>
i2c detector checks the output of i2cdetect -l
SD card detector checks the output of ls /dev

Signed-off-by: Kyryl Krynychnyi <[email protected]>
hwdetect/hwdetect.sh Outdated Show resolved Hide resolved
@yekovalyov yekovalyov added question Further information is requested and removed ready for review labels Feb 5, 2020
@Kyryl3231 Kyryl3231 added ready for review and removed question Further information is requested labels Feb 6, 2020
fi

sleep 1
trap 'rm -f $usb0 $usb1 $flash0 $flash1 $i2c0 $i2c1 $sd0 $sd1 && echo -e "\n***********Detection ended***********" && exit' 2 3 15
Copy link
Contributor

Choose a reason for hiding this comment

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

Is it required to configure signal handlers every second? What will happen in case of program break before end of loop?

@yekovalyov yekovalyov added question Further information is requested and removed ready for review labels Feb 6, 2020
Signed-off-by: Kyryl Krynychnyi <[email protected]>
@Kyryl3231 Kyryl3231 added ready for review and removed question Further information is requested labels Feb 6, 2020
@@ -47,6 +47,8 @@ else
fi
echo

trap 'rm -f $usb0 $usb1 $flash0 $flash1 $i2c0 $i2c1 $sd0 $sd1 && echo -e "\n***********Detection ended***********" && exit' 2 3 15
Copy link
Contributor

Choose a reason for hiding this comment

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

This line is too long. Is it possible to fit it to 80 columns by adding some variable like ALL_TMP_FILES or/and MSG_TEXT?

@yekovalyov yekovalyov added question Further information is requested and removed ready for review labels Feb 6, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants