convert varius scripts mkfs_partitions
This commit is contained in:
@@ -58,14 +58,7 @@ loopdevice=$(losetup --show -fP "${image_dir}/${image_name}.img")
|
||||
rootp="${loopdevice}p1"
|
||||
|
||||
# Create file systems
|
||||
status "Formatting partitions"
|
||||
if [[ "$fstype" == "ext4" ]]; then
|
||||
features="^64bit,^metadata_csum"
|
||||
elif [[ "$fstype" == "ext3" ]]; then
|
||||
features="^64bit"
|
||||
fi
|
||||
mkfs -U "$root_uuid" -O "$features" -t "$fstype" -L ROOTFS "${rootp}"
|
||||
|
||||
mkfs_partitions
|
||||
# Make fstab.
|
||||
make_fstab
|
||||
|
||||
|
||||
@@ -51,14 +51,7 @@ loopdevice=$(losetup --show -fP "${image_dir}/${image_name}.img")
|
||||
rootp="${loopdevice}p1"
|
||||
|
||||
# Create file systems
|
||||
status "Formatting partitions"
|
||||
if [[ "$fstype" == "ext4" ]]; then
|
||||
features="^64bit,^metadata_csum"
|
||||
elif [[ "$fstype" == "ext3" ]]; then
|
||||
features="^64bit"
|
||||
fi
|
||||
mkfs -U "$root_uuid" -O "$features" -t "$fstype" -L ROOTFS "${rootp}"
|
||||
|
||||
mkfs_partitions
|
||||
# Make fstab.
|
||||
make_fstab
|
||||
|
||||
|
||||
@@ -170,15 +170,7 @@ bootp="${loopdevice}p1"
|
||||
rootp="${loopdevice}p2"
|
||||
|
||||
# Create file systems
|
||||
status "Formatting partitions"
|
||||
mkfs.vfat -n BOOT -F 16 "${bootp}"
|
||||
if [[ "$fstype" == "ext4" ]]; then
|
||||
features="^64bit,^metadata_csum"
|
||||
elif [[ "$fstype" == "ext3" ]]; then
|
||||
features="^64bit"
|
||||
fi
|
||||
mkfs -U "$root_uuid" -O "$features" -t "$fstype" -L ROOTFS "${rootp}"
|
||||
|
||||
mkfs_partitions
|
||||
# Make fstab.
|
||||
make_fstab
|
||||
|
||||
|
||||
@@ -96,15 +96,7 @@ bootp="${loopdevice}p1"
|
||||
rootp="${loopdevice}p2"
|
||||
|
||||
# Create file systems
|
||||
status "Formatting partitions"
|
||||
mkfs.vfat -n BOOT -F 32 "${bootp}"
|
||||
if [[ "$fstype" == "ext4" ]]; then
|
||||
features="^64bit,^metadata_csum"
|
||||
elif [[ "$fstype" == "ext3" ]]; then
|
||||
features="^64bit"
|
||||
fi
|
||||
mkfs -U "$root_uuid" -O "$features" -t "$fstype" -L ROOTFS "${rootp}"
|
||||
|
||||
mkfs_partitions
|
||||
# Make fstab.
|
||||
make_fstab
|
||||
|
||||
|
||||
@@ -55,14 +55,7 @@ loopdevice=$(losetup --show -fP "${image_dir}/${image_name}.img")
|
||||
rootp="${loopdevice}p1"
|
||||
|
||||
# Create file systems
|
||||
status "Formatting partitions"
|
||||
if [[ "$fstype" == "ext4" ]]; then
|
||||
features="^64bit,^metadata_csum"
|
||||
elif [[ "$fstype" == "ext3" ]]; then
|
||||
features="^64bit"
|
||||
fi
|
||||
mkfs -U "$root_uuid" -O "$features" -t "$fstype" -L ROOTFS "${rootp}"
|
||||
|
||||
mkfs_partitions
|
||||
# Make fstab.
|
||||
make_fstab
|
||||
|
||||
|
||||
9
cubox.sh
9
cubox.sh
@@ -109,14 +109,7 @@ loopdevice=$(losetup --show -fP "${image_dir}/${image_name}.img")
|
||||
rootp="${loopdevice}p1"
|
||||
|
||||
# Create file systems
|
||||
status "Formatting partitions"
|
||||
if [[ "$fstype" == "ext4" ]]; then
|
||||
features="^64bit,^metadata_csum"
|
||||
elif [[ "$fstype" == "ext3" ]]; then
|
||||
features="^64bit"
|
||||
fi
|
||||
mkfs -U "$root_uuid" -O "$features" -t "$fstype" -L ROOTFS "${rootp}"
|
||||
|
||||
mkfs_partitions
|
||||
# Make fstab.
|
||||
make_fstab
|
||||
|
||||
|
||||
10
nanopc-t.sh
10
nanopc-t.sh
@@ -98,15 +98,7 @@ bootp="${loopdevice}p1"
|
||||
rootp="${loopdevice}p2"
|
||||
|
||||
# Create file systems
|
||||
status "Formatting partitions"
|
||||
if [[ "$fstype" == "ext4" ]]; then
|
||||
features="^64bit,^metadata_csum"
|
||||
elif [[ "$fstype" == "ext3" ]]; then
|
||||
features="^64bit"
|
||||
fi
|
||||
mkfs -O "$features" -t "$fstype" -L BOOT "${bootp}"
|
||||
mkfs -U "$root_uuid" -O "$features" -t "$fstype" -L ROOTFS "${rootp}"
|
||||
|
||||
mkfs_partitions
|
||||
# Make fstab.
|
||||
make_fstab
|
||||
|
||||
|
||||
@@ -69,14 +69,7 @@ loopdevice=$(losetup --show -fP "${image_dir}/${image_name}.img")
|
||||
rootp="${loopdevice}p1"
|
||||
|
||||
# Create file systems
|
||||
status "Formatting partitions"
|
||||
if [[ "$fstype" == "ext4" ]]; then
|
||||
features="^64bit,^metadata_csum"
|
||||
elif [[ "$fstype" == "ext3" ]]; then
|
||||
features="^64bit"
|
||||
fi
|
||||
mkfs -U "$root_uuid" -O "$features" -t "$fstype" -L ROOTFS "${rootp}"
|
||||
|
||||
mkfs_partitions
|
||||
# Make fstab.
|
||||
make_fstab
|
||||
|
||||
|
||||
10
nanopi2.sh
10
nanopi2.sh
@@ -148,15 +148,7 @@ bootp="${loopdevice}p1"
|
||||
rootp="${loopdevice}p2"
|
||||
|
||||
# Create file systems
|
||||
status "Formatting partitions"
|
||||
mkfs.ext2 -L BOOT "${bootp}"
|
||||
if [[ "$fstype" == "ext4" ]]; then
|
||||
features="^64bit,^metadata_csum"
|
||||
elif [[ "$fstype" == "ext3" ]]; then
|
||||
features="^64bit"
|
||||
fi
|
||||
mkfs -U "$root_uuid" -O "$features" -t "$fstype" -L ROOTFS "${rootp}"
|
||||
|
||||
mkfs_partitions
|
||||
# Make fstab.
|
||||
make_fstab
|
||||
|
||||
|
||||
@@ -87,14 +87,7 @@ loopdevice=$(losetup --show -fP "${image_dir}/${image_name}.img")
|
||||
rootp="${loopdevice}p1"
|
||||
|
||||
# Create file systems
|
||||
status "Formatting partitions"
|
||||
if [[ "$fstype" == "ext4" ]]; then
|
||||
features="^64bit,^metadata_csum"
|
||||
elif [[ "$fstype" == "ext3" ]]; then
|
||||
features="^64bit"
|
||||
fi
|
||||
mkfs -U "$root_uuid" -O "$features" -t "$fstype" -L ROOTFS "${rootp}"
|
||||
|
||||
mkfs_partitions
|
||||
# Make fstab.
|
||||
make_fstab
|
||||
|
||||
|
||||
@@ -159,14 +159,9 @@ bootp="${loopdevice}p1"
|
||||
rootp="${loopdevice}p2"
|
||||
|
||||
# Create file systems
|
||||
status "Formatting partitions"
|
||||
if [[ "$fstype" == "ext4" ]]; then
|
||||
features="^64bit,^metadata_csum"
|
||||
elif [[ "$fstype" == "ext3" ]]; then
|
||||
features="^64bit"
|
||||
fi
|
||||
mkfs -O "$features" -t "$fstype" -L BOOT "${bootp}"
|
||||
mkfs -U "$root_uuid" -O "$features" -t "$fstype" -L ROOTFS "${rootp}"
|
||||
mkfs_partitions
|
||||
# Make fstab.
|
||||
make_fstab
|
||||
|
||||
# Create the dirs for the partitions and mount them
|
||||
status "Create the dirs for the partitions and mount them"
|
||||
@@ -175,9 +170,6 @@ mount "${rootp}" "${base_dir}"/root
|
||||
mkdir -p "${base_dir}"/root/boot
|
||||
mount "${bootp}" "${base_dir}"/root/boot
|
||||
|
||||
# Make fstab.
|
||||
make_fstab
|
||||
|
||||
status "Rsyncing rootfs into image file"
|
||||
rsync -HPavz -q "${work_dir}"/ "${base_dir}"/root/
|
||||
sync
|
||||
|
||||
@@ -197,21 +197,15 @@ loopdevice=$(losetup --show -fP "${image_dir}/${image_name}.img")
|
||||
rootp="${loopdevice}p1"
|
||||
|
||||
# Create file systems
|
||||
status "Formatting partitions"
|
||||
if [[ "$fstype" == "ext4" ]]; then
|
||||
features="^64bit,^metadata_csum"
|
||||
elif [[ "$fstype" == "ext3" ]]; then
|
||||
features="^64bit"
|
||||
fi
|
||||
mkfs -U "$root_uuid" -O "$features" -t "$fstype" -L ROOTFS "${rootp}"
|
||||
mkfs_partitions
|
||||
# Make fstab.
|
||||
make_fstab
|
||||
|
||||
# Create the dirs for the partitions and mount them
|
||||
status "Create the dirs for the partitions and mount them"
|
||||
mkdir -p "${base_dir}"/root/
|
||||
mount "${rootp}" "${base_dir}"/root
|
||||
|
||||
# Make fstab.
|
||||
make_fstab
|
||||
|
||||
# FUTURE: Move to debian u-boot when it works properly
|
||||
# Ensure we don't have root=/dev/sda3 in the extlinux.conf which comes from running u-boot-menu in a cross chroot
|
||||
|
||||
12
pinebook.sh
12
pinebook.sh
@@ -116,21 +116,15 @@ loopdevice=$(losetup --show -fP "${image_dir}/${image_name}.img")
|
||||
rootp="${loopdevice}p1"
|
||||
|
||||
# Create file systems
|
||||
status "Formatting partitions"
|
||||
if [[ "$fstype" == "ext4" ]]; then
|
||||
features="^64bit,^metadata_csum"
|
||||
elif [[ "$fstype" == "ext3" ]]; then
|
||||
features="^64bit"
|
||||
fi
|
||||
mkfs -U "$root_uuid " -O "$features" -t "$fstype" -L ROOTFS "${rootp}"
|
||||
mkfs_partitions
|
||||
# Make fstab.
|
||||
make_fstab
|
||||
|
||||
# Create the dirs for the partitions and mount them
|
||||
status "Create the dirs for the partitions and mount them"
|
||||
mkdir -p "${base_dir}"/root/
|
||||
mount "${rootp}" "${base_dir}"/root
|
||||
|
||||
# Make fstab.
|
||||
make_fstab
|
||||
|
||||
# Ensure we don't have root=/dev/sda3 in the extlinux.conf which comes from running u-boot-menu in a cross chroot
|
||||
# We do this down here because we don't know the UUID until after the image is created
|
||||
|
||||
Reference in New Issue
Block a user