add support for bind mounting
Signed-off-by: Steven Armstrong <steven@icarus.ethz.ch>
This commit is contained in:
		
					parent
					
						
							
								efd9351500
							
						
					
				
			
			
				commit
				
					
						e74d2be2d4
					
				
			
		
					 1 changed files with 13 additions and 10 deletions
				
			
		| 
						 | 
					@ -47,16 +47,19 @@ fi
 | 
				
			||||||
   exit 1
 | 
					   exit 1
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
if [ "$type" = "swap" ]; then
 | 
					if [ "$type" = "swap" ]; then
 | 
				
			||||||
   echo "swapon \"$device\""
 | 
					   printf 'swapon "%s"\n' "$device"
 | 
				
			||||||
else
 | 
					else
 | 
				
			||||||
   if [ -f "$__object/parameter/options" ]; then
 | 
					 | 
				
			||||||
      options="$(cat "$__object/parameter/options")"
 | 
					 | 
				
			||||||
   else
 | 
					 | 
				
			||||||
      options=""
 | 
					 | 
				
			||||||
   fi
 | 
					 | 
				
			||||||
   [ -n "$options" ] && options="-o $options"
 | 
					 | 
				
			||||||
   mount_point="${prefix}${dir}"
 | 
					   mount_point="${prefix}${dir}"
 | 
				
			||||||
 | 
					   printf '[ -d "%s" ] || mkdir -p "%s"\n' "$mount_point" "$mount_point"
 | 
				
			||||||
   echo "[ -d \"$mount_point\" ] || mkdir -p \"$mount_point\""
 | 
					   printf 'mount'
 | 
				
			||||||
   echo "mount -t \"$type\" $options \"$device\" \"$mount_point\""
 | 
					   if [ "$type" = "bind" ]; then
 | 
				
			||||||
 | 
					      printf ' --bind'
 | 
				
			||||||
 | 
					   else
 | 
				
			||||||
 | 
					      printf ' -t "%s"' "$type"
 | 
				
			||||||
 | 
					   fi
 | 
				
			||||||
 | 
					   if [ -f "$__object/parameter/options" ]; then
 | 
				
			||||||
 | 
					      printf ' -o %s' "$(cat "$__object/parameter/options")"
 | 
				
			||||||
 | 
					   fi
 | 
				
			||||||
 | 
					   printf ' "%s"' "$device"
 | 
				
			||||||
 | 
					   printf ' "%s"\n' "$mount_point"
 | 
				
			||||||
fi
 | 
					fi
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue