2.2 KiB
Adding "disk" formats to osi-mk
Create a file lib/mk/format-*.sh, and source that file from
bin/osi-mk.
In that file:
-
required: set
formats+=('YOURFORMAT') -
required: set
format_options['YOURFORMAT']=to a whitespace-separated list of the--fmtconf=XXX=flags that your format takes. -
optional: define
format_checkconf:YOURFORMAT() { … }to insert your own validation for--conf=flags. -
optional: define
format_genfstab:YOURFORMAT() { … }to override the usualgenfstabcommand. -
required: set
format_is_block['YOURFORMAT']=totrueorfalse, indicating whether osi-mk should pre-allocate a file for you (pointed at by$arg_file).-
if
format_is_block['YOURFORMAT']='true', then-
required: define
format_mkfs:YOURFORMAT() { … }which runs the appropriatemkfson$arg_file. -
required: define
format_editfs:YOURFORMAT() { … }which applies any--fmtconf=XXX=flags. Ifsizeis set, then you don't need to resize the file itself, osi-mk does that before/after callingformat_editfs:YOURFORMAT, but you do need to runresize2fsorbtrfs filesystem resizeor whatever.
-
-
if
format_is_block['YOURFORMAT']='false', then-
required: set
format_wants_tmpfs['YOURFORMAT']totrueorfalse, indicating whether$mount_devshould be set to a tmpfs (instead of$arg_file) and whether$mount_optshould be set tobind. -
required: define
format_before:YOURFORMAT() { … }that does any nescessary setup on$mount_dev/$mount_optbefore mounting it to do the install. -
required: define
format_after:YOURFORMAT() { … }that does any nescessary transforms to get from$mount_devto$arg_file.
- required: set
format_after_clamps_mtime['YOURFORMAT']=totrueorfalseindicating whether yourformat_after:YOURFORMATfunction clamps mtimes toSOURCE_DATE_EPOCH(true), or whether osi-mk should adjust all the mtimes before callingformat_after:YOURFORMAT
-
-