FS#20620 - [initscripts] rc.sysinit double grep
Attached to Project:
Arch Linux
Opened by Linas (Linas) - Thursday, 26 August 2010, 12:39 GMT
Last edited by Andrea Scarpino (BaSh) - Wednesday, 16 March 2011, 15:10 GMT
Opened by Linas (Linas) - Thursday, 26 August 2010, 12:39 GMT
Last edited by Andrea Scarpino (BaSh) - Wednesday, 16 March 2011, 15:10 GMT
|
Details
Description:
/etc/rc.sysinit (initscripts package) in line 157-158 contains # Set up non-root encrypted partition mappings if [ -f /etc/crypttab -a -n "$(/bin/grep -v ^# /etc/crypttab | /bin/grep -v ^$)" ]; then Instead of calling grep twice over a pipe, it can be moved into a single grep, without having to use non-standard options. if [ -f /etc/crypttab -a -n "$(/bin/grep ^[^#] /etc/crypttab)" ]; then Additionally, not extracting the output for just checking if something was matched should be faster. if [ -f /etc/crypttab ] && /bin/grep -q ^[^#] /etc/crypttab; then (this could also be applied to the mdadm.conf grep of line 139) |
This task depends upon
So at the moment there is still the old double grep in rc.sysinit and no grep at all in rc.shutdown. Please use the new grep command in both scripts.
There is always the message "Deactivating encrypted volumes:" at shutdown although I don't have any.
-if [[ -f /etc/crypttab && $CS && -n $(/bin/grep -v ^# /etc/crypttab | /bin/grep -v ^$) ]]; then
+if [[ $CS ]] && grep -vq '^[[:space:]]*$\|^[[:space:]]*#' /etc/crypttab 2>/dev/null; then
attached in patch form against git master.