nanobsd: Adjust the order of the flags in makefs
The order of the flags matter in makefs(8). The -t (type) flag must come before the -o (options) flag; otherwise, the options are reset. Move the -t flag before the -o flag and remove the shim function _xxx_adjust_code_size() that was created to align to the default makefs FFS values. It effectively prevented us from generating NanoBSD images using unprivileged builds with the partitions internally aligned as intended. Reviewed by: senguptaangshuman17_gmail.com, imp MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D57226
This commit is contained in:
@@ -718,8 +718,8 @@ nano_makefs() {
|
|||||||
image=$4
|
image=$4
|
||||||
dir=$5
|
dir=$5
|
||||||
|
|
||||||
makefs ${options} -F "${metalog}" -N "${NANO_WORLDDIR}/etc" \
|
makefs -t ffs ${options} -F "${metalog}" -N "${NANO_WORLDDIR}/etc" \
|
||||||
-R "${size}b" -T "${NANO_TIMESTAMP}" -t ffs "${image}" "${dir}"
|
-R "${size}b" -T "${NANO_TIMESTAMP}" "${image}" "${dir}"
|
||||||
}
|
}
|
||||||
|
|
||||||
# Convenient spot to work around any umount issues that your build environment
|
# Convenient spot to work around any umount issues that your build environment
|
||||||
|
|||||||
@@ -96,17 +96,6 @@ calculate_partitioning() {
|
|||||||
' > ${NANO_LOG}/_.partitioning
|
' > ${NANO_LOG}/_.partitioning
|
||||||
}
|
}
|
||||||
|
|
||||||
_xxx_adjust_code_size()
|
|
||||||
{
|
|
||||||
# XXX adjust the CODE_SIZE value by rounding it up to
|
|
||||||
# a bsize of 32768 (DFL_BLKSIZE).
|
|
||||||
# Otherwise makefs -s will fail because of the guard
|
|
||||||
# introduced in 5ad283b3c60d.
|
|
||||||
codesize=$1
|
|
||||||
bsize=32768
|
|
||||||
echo $(( ((codesize + (bsize - 1)) / bsize) * bsize ))
|
|
||||||
}
|
|
||||||
|
|
||||||
create_code_slice() {
|
create_code_slice() {
|
||||||
pprint 2 "build code slice"
|
pprint 2 "build code slice"
|
||||||
pprint 3 "log: ${NANO_OBJ}/_.cs"
|
pprint 3 "log: ${NANO_OBJ}/_.cs"
|
||||||
@@ -166,7 +155,6 @@ _create_code_slice() {
|
|||||||
(
|
(
|
||||||
IMG=${NANO_DISKIMGDIR}/${NANO_IMG1NAME}
|
IMG=${NANO_DISKIMGDIR}/${NANO_IMG1NAME}
|
||||||
CODE_SIZE=$(awk '$3 == 1 {print $2}' "${NANO_LOG}/_.partitioning")
|
CODE_SIZE=$(awk '$3 == 1 {print $2}' "${NANO_LOG}/_.partitioning")
|
||||||
CODE_SIZE=$(_xxx_adjust_code_size "$CODE_SIZE")
|
|
||||||
|
|
||||||
echo "Writing code image..."
|
echo "Writing code image..."
|
||||||
if [ -f "${NANO_WORLDDIR}/boot/boot" ]; then
|
if [ -f "${NANO_WORLDDIR}/boot/boot" ]; then
|
||||||
@@ -295,7 +283,6 @@ _create_diskimage() {
|
|||||||
local altroot bootloader cfgimage dataimage diskimage
|
local altroot bootloader cfgimage dataimage diskimage
|
||||||
|
|
||||||
CODE_SIZE=$(awk '$3 == 1 {print $2}' "${NANO_LOG}/_.partitioning")
|
CODE_SIZE=$(awk '$3 == 1 {print $2}' "${NANO_LOG}/_.partitioning")
|
||||||
CODE_SIZE=$(_xxx_adjust_code_size "$CODE_SIZE")
|
|
||||||
CONF_SIZE=$(awk '$3 == 3 {print $2}' "${NANO_LOG}/_.partitioning")
|
CONF_SIZE=$(awk '$3 == 3 {print $2}' "${NANO_LOG}/_.partitioning")
|
||||||
DATA_SIZE=$(awk '$3 == 4 {print $2}' "${NANO_LOG}/_.partitioning")
|
DATA_SIZE=$(awk '$3 == 4 {print $2}' "${NANO_LOG}/_.partitioning")
|
||||||
IMG=${NANO_DISKIMGDIR}/${NANO_IMGNAME}
|
IMG=${NANO_DISKIMGDIR}/${NANO_IMGNAME}
|
||||||
|
|||||||
Reference in New Issue
Block a user