First sync.

This commit is contained in:
BrainwreckedTech
2019-08-21 17:28:17 -04:00
parent d8848f1108
commit 4a818bb2d5
12 changed files with 505 additions and 1 deletions

32
ckalign Executable file
View File

@@ -0,0 +1,32 @@
#!/usr/bin/env bash
if [ ${1} == "-e" -o ${1} == "--end" ]; then
BOUNDADJ=1
elif [ ${1} == "-s" -o ${1} == "--start" ]; then
BOUNDADJ=0
else
echo "Neither '--start' nor '--end' were specified."
exit 1
fi
BOUNDARY=$(( ${2} + BOUNDADJ ))
ALIGN_4K=$(( BOUNDARY / 8 ))
SECTS_4K=$(( ALIGN_4K * 8 ))
((SECTS_4K-=${BOUNDADJ}))
ALIGN_1M=$(( BOUNDARY / 2048 ))
SECTS_1M=$(( ALIGN_1M * 2048 ))
((SECTS_1M-=${BOUNDADJ}))
if [ ${2} -eq ${SECTS_4K} ]; then
echo "Boundary is 4K aligned."
else
echo "Boundary is not 4K aligned. Proper alignment would be ${SECTS_4K} or $(( SECTS_4K + 8 ))."
fi
if [ ${2} -eq ${SECTS_1M} ]; then
echo "Boundary ${2} is 1M aligned."
else
echo "Boundary is not 1M aligned. Proper alignment would be ${SECTS_1M} or $(( SECTS_1M + 2048 ))."
fi