Don't use awk in early mounthost

Bug #198007 reported by Agostino Russo
2
Affects Status Importance Assigned to Milestone
lupin
Fix Released
Low
Agostino Russo

Bug Description

Awk might not be available by the time mounthost is executed. Replace with somethink like the following

loopfile_fstab_line=$(sed -n '\:^/[^ ]*[ ]*/[ ]*[^ ]*[ ]*.*loop.*[ ]*[^ ]*[ ]*[^ ]*:p' /etc/fstab)
host_mountpoint=${loopfile_fstab_line%% *}
while [ -z "host_device" ] && [ "host_mountpoint" ] && [ "host_mountpoint" -ne "/" ]; do
    host_mountpoint = ${host_mountpoint%/*}
    host_device=$(sed -n "\:^/[^ ]* host_mountpoint :p" /proc/mounts)
done

Related branches

Agostino Russo (ago)
Changed in lupin:
assignee: nobody → ago
importance: Undecided → Low
status: New → Confirmed
Revision history for this message
Agostino Russo (ago) wrote :

take-2:

loopfile_fstab_line=$(sed -n '\:^/[^ ]*[ ]*[ ]/[ ][ ]*[^ ]*[ ].*loop.*[ ]:p' /etc/fstab)
host_mountpoint=${loopfile_fstab_line%% *}
while [ -z "$host_device" ] && [ -n "$host_mountpoint" ] && [ ! "$host_mountpoint" = "/" ]; do
    host_mountpoint=${host_mountpoint%/*}
    host_device=$(sed -n "\:^/[^ ]* $host_mountpoint :p" /proc/mounts)
done

Agostino Russo (ago)
Changed in lupin:
status: Confirmed → Fix Committed
Revision history for this message
Luke Yelavich (themuso) wrote :

Similar changes will need to be done in lupin-sysctl. Unfortunately I don't know awk, so can't attempt to work out replacement code,

Revision history for this message
Agostino Russo (ago) wrote :

Fixed that too in rev 92, thanks

Agostino Russo (ago)
Changed in lupin:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.