|
|
|
@ -970,41 +970,34 @@ function unmount_all_drive_partitions {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function uboot_in_boot_partition {
|
|
|
|
|
echo ""
|
|
|
|
|
echo "Using fdisk to create BOOT Partition"
|
|
|
|
|
echo "-----------------------------"
|
|
|
|
|
echo "Debug: now using FDISK_FIRST_SECTOR over fdisk's depreciated method..."
|
|
|
|
|
echo ""
|
|
|
|
|
echo "Using fdisk to create BOOT Partition"
|
|
|
|
|
echo "-----------------------------"
|
|
|
|
|
|
|
|
|
|
#With util-linux, 2.18+, the first sector is now 2048...
|
|
|
|
|
FDISK_FIRST_SECTOR="1"
|
|
|
|
|
if test $(fdisk -v | grep -o -E '2\.[0-9]+' | cut -d'.' -f2) -ge 18 ; then
|
|
|
|
|
FDISK_FIRST_SECTOR="2048"
|
|
|
|
|
fi
|
|
|
|
|
fdisk ${MMC} <<-__EOF__
|
|
|
|
|
n
|
|
|
|
|
p
|
|
|
|
|
1
|
|
|
|
|
|
|
|
|
|
fdisk ${MMC} << END
|
|
|
|
|
n
|
|
|
|
|
p
|
|
|
|
|
1
|
|
|
|
|
${FDISK_FIRST_SECTOR}
|
|
|
|
|
+64M
|
|
|
|
|
t
|
|
|
|
|
e
|
|
|
|
|
p
|
|
|
|
|
w
|
|
|
|
|
END
|
|
|
|
|
|
|
|
|
|
sync
|
|
|
|
|
|
|
|
|
|
echo "Setting Boot Partition's Boot Flag"
|
|
|
|
|
echo "-----------------------------"
|
|
|
|
|
parted --script ${MMC} set 1 boot on
|
|
|
|
|
+64M
|
|
|
|
|
t
|
|
|
|
|
e
|
|
|
|
|
p
|
|
|
|
|
w
|
|
|
|
|
__EOF__
|
|
|
|
|
|
|
|
|
|
if [ "$FDISK_DEBUG" ];then
|
|
|
|
|
echo "Debug: Partition 1 layout:"
|
|
|
|
|
echo "-----------------------------"
|
|
|
|
|
fdisk -l ${MMC}
|
|
|
|
|
echo "-----------------------------"
|
|
|
|
|
fi
|
|
|
|
|
sync
|
|
|
|
|
|
|
|
|
|
echo "Setting Boot Partition's Boot Flag"
|
|
|
|
|
echo "-----------------------------"
|
|
|
|
|
parted --script ${MMC} set 1 boot on
|
|
|
|
|
|
|
|
|
|
if [ "$FDISK_DEBUG" ];then
|
|
|
|
|
echo "Debug: Partition 1 layout:"
|
|
|
|
|
echo "-----------------------------"
|
|
|
|
|
fdisk -l ${MMC}
|
|
|
|
|
echo "-----------------------------"
|
|
|
|
|
fi
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function dd_uboot_before_boot_partition {
|
|
|
|
|