Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 26 additions & 10 deletions modules.d/77dracut-systemd/dracut-cmdline-ask.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,21 +4,37 @@

getarg "rd.cmdline=ask" || exit 0

sleep 0.5
echo
sleep 0.5
echo
sleep 0.5
echo
echo
echo
echo
echo "Enter additional kernel command line parameter (end with ctrl-d or .)"
sleep 0.25
echo ""
sleep 0.25
echo " ======================================================================== "
sleep 0.25
echo '(o< >o)'
sleep 0.25
echo '//\ INPUT REQUIRED !!! /\\'

Check warning

Code scanning / shellcheck

SC2028 Warning

echo may not expand escape sequences. Use printf.

Check warning

Code scanning / shellcheck

SC1003 Warning

Want to escape a single quote? echo 'This is how it'''s done'.
sleep 0.25
echo 'V_/_ _\_V'
sleep 0.25
echo " ======================================================================== "
sleep 0.25
echo ""
sleep 0.25
echo ' Enter additional kernel command line, or install program, parameters.'
sleep 0.25
echo ' End with a period "." or Ctrl+d in a new line:'
sleep 0.25

# Ignore Ctrl+c (the d key is too close to c)
trap '' SIGINT

Check warning

Code scanning / shellcheck

SC3048 Warning

In POSIX sh, prefixing signal names with 'SIG' is undefined.

# In POSIX sh, read -p is undefined, but dash supports it
# shellcheck disable=SC3045
while read -r -p "> " ${BASH:+-e} line || [ -n "$line" ]; do
[ "$line" = "." ] && break
[ -n "$line" ] && printf -- "%s\n" "$line" >> /etc/cmdline.d/99-cmdline-ask.conf
done

# Restore Ctrl+c
trap 'exit 2;' SIGINT

Check warning

Code scanning / shellcheck

SC3048 Warning

In POSIX sh, prefixing signal names with 'SIG' is undefined.

exit 0
27 changes: 26 additions & 1 deletion modules.d/80base/init.sh
Original file line number Diff line number Diff line change
Expand Up @@ -110,13 +110,38 @@
source_conf /etc/conf.d

if getarg "rd.cmdline=ask"; then
echo "Enter additional kernel command line parameter (end with ctrl-d or .)"
sleep 0.25
echo ""
sleep 0.25
echo " ======================================================================== "
sleep 0.25
echo '(o< >o)'
sleep 0.25
echo '//\ INPUT REQUIRED !!! /\\'

Check warning

Code scanning / shellcheck

SC2028 Warning

echo may not expand escape sequences. Use printf.

Check warning

Code scanning / shellcheck

SC1003 Warning

Want to escape a single quote? echo 'This is how it'''s done'.
sleep 0.25
echo 'V_/_ _\_V'
sleep 0.25
echo " ======================================================================== "
sleep 0.25
echo ""
sleep 0.25
echo ' Enter additional kernel command line, or install program, parameters.'
sleep 0.25
echo ' End with a period "." or Ctrl+d in a new line:'
sleep 0.25

# Ignore Ctrl+c (the d key is too close to c)
trap '' SIGINT

Check warning

Code scanning / shellcheck

SC3048 Warning

In POSIX sh, prefixing signal names with 'SIG' is undefined.

# In POSIX sh, read -p is undefined, but dash supports it
# shellcheck disable=SC3045
while read -r -p "> " ${BASH:+-e} line || [ -n "$line" ]; do
[ "$line" = "." ] && break
echo "$line" >> /etc/cmdline.d/99-cmdline-ask.conf
done

# Restore Ctrl+c
trap 'exit 2;' SIGINT

Check warning

Code scanning / shellcheck

SC3048 Warning

In POSIX sh, prefixing signal names with 'SIG' is undefined.
fi

if ! getargbool 1 'rd.hostonly'; then
Expand Down
Loading