mirror of
				https://github.com/kevinveenbirkenbach/linux-image-manager.git
				synced 2025-11-04 01:18:10 +00:00 
			
		
		
		
	Refactored function echo_partition_name
This commit is contained in:
		@@ -10,11 +10,11 @@ source "$(dirname "$(readlink -f "${0}")")/../base.sh" || (echo "Loading base.sh
 | 
				
			|||||||
# @parameter $1 is device path
 | 
					# @parameter $1 is device path
 | 
				
			||||||
# @parameter $2 is the partition number
 | 
					# @parameter $2 is the partition number
 | 
				
			||||||
echo_partition_name(){
 | 
					echo_partition_name(){
 | 
				
			||||||
  if [ "${1:5:1}" != "s" ]
 | 
					  if [ "${device_path:5:1}" != "s" ]
 | 
				
			||||||
    then
 | 
					    then
 | 
				
			||||||
      echo "$1""p""$2"
 | 
					      echo "$device_path""p""$2"
 | 
				
			||||||
    else
 | 
					    else
 | 
				
			||||||
      echo "$1$2"
 | 
					      echo "$device_path$2"
 | 
				
			||||||
  fi
 | 
					  fi
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -14,8 +14,8 @@ error
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
root_mount_path="/mnt/raspbian"
 | 
					root_mount_path="/mnt/raspbian"
 | 
				
			||||||
boot_mount_path="/mnt/raspbian/boot"
 | 
					boot_mount_path="/mnt/raspbian/boot"
 | 
				
			||||||
root_partition_path=$(echo_partition_name $device_path "2")
 | 
					root_partition_path=$(echo_partition_name "2")
 | 
				
			||||||
boot_partition_path=$(echo_partition_name $device_path "1")
 | 
					boot_partition_path=$(echo_partition_name "1")
 | 
				
			||||||
 | 
					
 | 
				
			||||||
info "Mount partitions..."
 | 
					info "Mount partitions..."
 | 
				
			||||||
mount -o rw "$boot_partition_path" "$boot_mount_path" ||
 | 
					mount -o rw "$boot_partition_path" "$boot_mount_path" ||
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -157,8 +157,8 @@ root_mount_path="$working_folder""root/"
 | 
				
			|||||||
mkdir -v "$boot_mount_path"
 | 
					mkdir -v "$boot_mount_path"
 | 
				
			||||||
mkdir -v "$root_mount_path"
 | 
					mkdir -v "$root_mount_path"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
boot_partition_path=$(echo_partition_name $device_path "1")
 | 
					boot_partition_path=$(echo_partition_name "1")
 | 
				
			||||||
root_partition_path=$(echo_partition_name $device_path "2")
 | 
					root_partition_path=$(echo_partition_name "2")
 | 
				
			||||||
 | 
					
 | 
				
			||||||
mount_partitions(){
 | 
					mount_partitions(){
 | 
				
			||||||
  info "Mount boot and root partition..."
 | 
					  info "Mount boot and root partition..."
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user