Index: share/man/man4/md.4 =================================================================== --- share/man/man4/md.4 +++ share/man/man4/md.4 @@ -72,9 +72,32 @@ options ROOTDEVNAME=\\"ufs:md0\\" .Ed .Pp -The image in +This would statically reserve 8MB area in the kernel and put data from the +file referenced by the +.Dv MFS_IMAGE +at the beginning of that area. +It is also possible to omit +.Dv MD_ROOT_SIZE +parameter, in which case the size of the ramdisk is to be +determined automatically from the actual size of the .Pa /h/foo/ARM-MD -will be loaded as the initial image each boot. +file. +.Pp +When available memory is limited, and read-write access to the ramdisk data +is not required, the +.Dv MFS_IMAGE_UZIP +option can also be set to request automatic compression of the image at the +kernel compile time with +.Xr mkuzip 8 +before linking it into the kernel: +.Bd -literal -offset indent +makeoptions MFS_IMAGE_UZIP +options ROOTDEVNAME=\\"ufs:md0.uzip\\" +.Ed +.Pp +Run-time access to read-only uncompressed data is then provided by the +.Xr geom_uzip 4 . +.Pp To create the image to use, please follow the steps to create a file-backed disk found in the .Xr mdconfig 8 Index: sys/conf/kern.post.mk =================================================================== --- sys/conf/kern.post.mk +++ sys/conf/kern.post.mk @@ -127,7 +127,19 @@ .endif .endif -${FULLKERNEL}: ${SYSTEM_DEP} vers.o +.if defined(MFS_IMAGE_UZIP) +MFS_IMAGE_IN:= ${MFS_IMAGE} +MFS_IMAGE:= ${MFS_IMAGE_IN:T:R}.uzip +MKUZP_CBSIZE?= 65536 +MKUZP_FLAGS?= -Ld + +${MFS_IMAGE}: ${MFS_IMAGE_IN} + @echo compressing ${MFS_IMAGE_IN} ... + @mkuzip -S ${MKUZP_FLAGS} -s ${MKUZP_CBSIZE} -o ${.TARGET} \ + ${MFS_IMAGE_IN} +.endif + +${FULLKERNEL}: ${SYSTEM_DEP} ${MFS_IMAGE} vers.o @rm -f ${.TARGET} @echo linking ${.TARGET} ${SYSTEM_LD} Index: sys/conf/kern.pre.mk =================================================================== --- sys/conf/kern.pre.mk +++ sys/conf/kern.pre.mk @@ -253,10 +253,10 @@ EMBEDFS_FORMAT.arm?= elf32-littlearm EMBEDFS_FORMAT.armv6?= elf32-littlearm -EMBEDFS_FORMAT.mips?= elf32-tradbigmips -EMBEDFS_FORMAT.mipsel?= elf32-tradlittlemips -EMBEDFS_FORMAT.mips64?= elf64-tradbigmips -EMBEDFS_FORMAT.mips64el?= elf64-tradlittlemips +EMBEDFS_FORMAT.mips?= elf32-bigmips +EMBEDFS_FORMAT.mipsel?= elf32-littlemips +EMBEDFS_FORMAT.mips64?= elf64-bigmips +EMBEDFS_FORMAT.mips64el?= elf64-littlemips EMBEDFS_FORMAT.riscv?= elf64-littleriscv .endif .endif