write up man pages

This commit is contained in:
illiliti 2020-03-08 03:28:00 +03:00
parent 2f725a9ff7
commit 537b89819f
5 changed files with 293 additions and 39 deletions

29
config
View File

@ -5,29 +5,28 @@
# debug mode # debug mode
#debug=0 #debug=0
# overwrite existing initramfs image # overwrite initramfs
#force=0 #force=0
# custom init # init
#init="" #init=""
# custom output name # initramfs name
#initramfs="" #initramfs=""
# custom drivers directory # drivers directory
#moddir="" #moddir=""
# custom kernel version # kernel version
#kernel="" #kernel=""
# custom compression program # compression program
#compress="" #compress=""
# root fs ( device,partuuid,uuid,label ) # root
#root="" #root=""
# root type # root type
# change this if you using busybox util-linux
#root_type="" #root_type=""
# root options # root options
@ -36,19 +35,19 @@
# util-linux binaries # util-linux binaries
#util_linux=0 #util_linux=0
# device manager ( mdev,mdevd,udev ) # device manager
#devmgr="" #devmgr=""
# hostonly mode # hostonly mode
#hostonly=0 #hostonly=0
# custom drivers # additional drivers
#drivers="" #drivers=""
# exclude drivers # exclude drivers
#drivers_exclude="" #drivers_exclude=""
# custom binaries # additional binaries
#binaries="" #binaries=""
# LVM support # LVM support
@ -60,8 +59,8 @@
# LVM volume group name # LVM volume group name
#lvm_group="" #lvm_group=""
# LVM include config # LVM config
#lvm_conf=0 #lvm_config=0
# LVM issue_discards # LVM issue_discards
#lvm_discard=0 #lvm_discard=0
@ -72,10 +71,10 @@
# LUKS support # LUKS support
#luks=0 #luks=0
# LUKS encrypted root ( device,partuuid,uuid,label ) # LUKS encrypted root
#luks_root="" #luks_root=""
# luks mapper name ( /dev/mapper/<name> ) # LUKS mapper name
#luks_name="" #luks_name=""
# LUKS detached header # LUKS detached header

View File

@ -165,7 +165,7 @@ install_devmgr() {
! -path "*hwdb.d*" \ ! -path "*hwdb.d*" \
-type f | -type f |
cpio -pd "$workdir" > /dev/null 2>&1 || msg panic "failed to install udev" cpio -pd "$workdir" > /dev/null 2>&1
;; ;;
mdev) mdev)
install -m644 "${filesdir}/mdev.conf" "${workdir}/etc/mdev.conf" install -m644 "${filesdir}/mdev.conf" "${workdir}/etc/mdev.conf"
@ -179,9 +179,6 @@ install_devmgr() {
install -m644 "${filesdir}/mdev.conf" "${workdir}/etc/mdev.conf" install -m644 "${filesdir}/mdev.conf" "${workdir}/etc/mdev.conf"
install -Dm755 "${filesdir}/storage-device" "${workdir}/lib/mdev/storage-device" install -Dm755 "${filesdir}/storage-device" "${workdir}/lib/mdev/storage-device"
;; ;;
*)
msg panic "devmgr option broken"
;;
esac esac
} }
@ -196,11 +193,10 @@ install_lvm() {
done done
# install lvm config # install lvm config
if [ "$lvm_conf" = 1 ]; then if [ "$lvm_config" = 1 ]; then
mkdir -p "${workdir}/etc/lvm" mkdir -p "${workdir}/etc/lvm"
cp /etc/lvm/*.conf "${workdir}/etc/lvm" || cp /etc/lvm/*.conf "${workdir}/etc/lvm"
msg panic "failed to install LVM config"
else else
mkdir -p "${workdir}/etc/lvm" mkdir -p "${workdir}/etc/lvm"
@ -238,17 +234,13 @@ install_luks() {
# copy luks header # copy luks header
[ -f "$luks_header" ] && { [ -f "$luks_header" ] && {
install -m400 "$luks_header" "${workdir}/root/luks_header" || install -m400 "$luks_header" "${workdir}/root/luks_header"
msg panic "failed to copy LUKS header"
luks_args="--header=/root/luks_header $luks_args" luks_args="--header=/root/luks_header $luks_args"
} }
# copy luks keyfile # copy luks keyfile
[ -f "$luks_keyfile" ] && { [ -f "$luks_keyfile" ] && {
install -m400 "$luks_keyfile" "${workdir}/root/luks_keyfile" || install -m400 "$luks_keyfile" "${workdir}/root/luks_keyfile"
msg panic "failed to copy LUKS keyfile"
luks_args="--key-file=/root/luks_keyfile $luks_args" luks_args="--key-file=/root/luks_keyfile $luks_args"
} }
} }
@ -283,9 +275,6 @@ install_driver() {
install_hostonly_drivers() { install_hostonly_drivers() {
msg info "installing hostonly drivers" msg info "installing hostonly drivers"
[ "$root_type" ] ||
msg panic "hostonly mode required root_type option to be configured"
# perform autodetection of drivers via /sys # perform autodetection of drivers via /sys
find /sys -name modalias -exec sort -u {} + | find /sys -name modalias -exec sort -u {} + |
@ -293,9 +282,6 @@ install_hostonly_drivers() {
install_driver "$_driver" install_driver "$_driver"
done done
# install root fs driver
install_driver "$root_type"
# install user specified drivers # install user specified drivers
[ "$drivers" ] && [ "$drivers" ] &&
for _driver in $drivers; do for _driver in $drivers; do

View File

@ -0,0 +1,172 @@
.TH tinyramfs 5 "March 2020" tinyramfs
.SH NAME
tinyramfs \- configuration options
.SH GENERAL
.TP
.BR \fBdebug=\fR"\&\fI {0|1} \fR\&"
Enable shell debugging
This option also drop you to shell after root partition being mounted in initramfs
.TP
.TP
.BR \fBforce=\fR"\&\fI {0|1} \fR\&"
Disable warning about exists initramfs image
.TP
.TP
.BR \fBinit=\fR"\&\fI /path/to/file \fR\&"
Specify init program
.TP
.TP
.BR \fBinitramfs=\fR"\&\fI /path/to/file \fR\&"
Specify initramfs output name
.TP
.TP
.BR \fBmoddir=\fR"\&\fI /path/to/dir \fR\&"
Specify directory of drivers
.TP
.TP
.BR \fBkernel=\fR"\&\fI ... \fR\&"
Specify kernel version
.TP
.TP
.BR \fBcompress=\fR"\&\fI ... \fR\&"
Specify compression program
.TP
.TP
.BR \fBroot=\fR"\&\fI ... \fR\&"
Specify root partition [PARTUUID, UUID, LABEL, DEVICE]
This option is required
.TP
.TP
.BR \fBroot_type=\fR"\&\fI ... \fR\&"
Specify root partition type
.TP
.TP
.BR \fBroot_opts=\fR"\&\fI ... \fR\&"
Specify root partition mount options (comma separated)
.TP
.TP
.BR \fButil_linux=\fR"\&\fI {0|1} \fR\&"
Include util-linux binaries
This option required if you need PARTUUID support
.TP
.TP
.BR \fBdevmgr=\fR"\&\fI ... \fR\&"
Specify device manager [udev, mdev, mdevd]
This option is required
.TP
.TP
.BR \fBhostonly=\fR"\&\fI {0|1} \fR\&"
Enable hostonly mode
.TP
.TP
.BR \fBdrivers=\fR"\&\fI ... \fR\&"
Include additional drivers (space separated)
If host only mode enabled you need to specify your root partition driver
.TP
.TP
.BR \fBdrivers_exclude=\fR"\&\fI ... \fR\&"
Exclude specified drivers (space separated)
.TP
.TP
.BR \fBbinaries=\fR"\&\fI ... \fR\&"
Include additional binaries (space separated)
.TP
.SH LVM
.TP
.BR \fBlvm=\fR"\&\fI {0|1} \fR\&"
Enable LVM support
This option required if you need LVM support
.TP
.TP
.BR \fBlvm_name=\fR"\&\fI ... \fR\&"
Specify logical volume name
.TP
.TP
.BR \fBlvm_group=\fR"\&\fI ... \fR\&"
Specify volume group name
.TP
.TP
.BR \fBlvm_config=\fR"\&\fI {0|1} \fR\&"
Include config from /etc/lvm
This option overwrite lvm_discard option
.TP
.TP
.BR \fBlvm_discard=\fR"\&\fI {0|1} \fR\&"
Enable TRIM requests
.TP
.TP
.BR \fBlvm_args=\fR"\&\fI ... \fR\&"
Pass additional options to lvm
.TP
.SH LUKS
.TP
.BR \fBluks=\fR"\&\fI {0|1} \fR\&"
Enable LUKS support
This option required if you need LUKS support
.TP
.TP
.BR \fBluks_root=\fR"\&\fI ... \fR\&"
Specify encrypted root partition [PARTUUID, UUID, LABEL, DEVICE]
This option required if you need LUKS support
.TP
.TP
.BR \fBluks_name=\fR"\&\fI ... \fR\&"
Specify device mapper name
.TP
.TP
.BR \fBluks_header=\fR"\&\fI /path/to/file \fR\&"
Embed header into initramfs
.TP
.TP
.BR \fBluks_keyfile=\fR"\&\fI /path/to/file \fR\&"
Embed key into initramfs
.TP
.TP
.BR \fBluks_discard=\fR"\&\fI {0|1} \fR\&"
Enable TRIM requests
.TP
.TP
.BR \fBluks_args=\fR"\&\fI ... \fR\&"
Pass additional options to cryptsetup
.TP

View File

@ -0,0 +1,102 @@
.TH tinyramfs 7 "March 2020" tinyramfs
.SH NAME
tinyramfs \- kernel command line options
.SH GENERAL
.TP
.BR \fBdebug=\fR"\&\fI {0|1} \fR\&"
Enable shell debugging
This option also drop you to shell after root partition being mounted
.TP
.TP
.BR \fBinit=\fR"\&\fI /path/to/file \fR\&"
Specify init program
.TP
.TP
.BR \fBroot=\fR"\&\fI ... \fR\&"
Specify root partition [PARTUUID, UUID, LABEL, DEVICE]
.TP
.TP
.BR \fBroot.type=\fR"\&\fI ... \fR\&"
Specify root partition type
.TP
.TP
.BR \fBroot.opts=\fR"\&\fI ... \fR\&"
Specify root partition mount options (comma separated)
.TP
.SH LVM
.TP
.BR \fBlvm=\fR"\&\fI {0|1} \fR\&"
Enable LVM support
.TP
.TP
.BR \fBlvm.name=\fR"\&\fI ... \fR\&"
Specify logical volume name
.TP
.TP
.BR \fBlvm.group=\fR"\&\fI ... \fR\&"
Specify volume group name
.TP
.TP
.BR \fBlvm.config=\fR"\&\fI {0|1} \fR\&"
Not implemented
.TP
.TP
.BR \fBlvm.discard=\fR"\&\fI {0|1} \fR\&"
Not implemented
.TP
.TP
.BR \fBlvm.args=\fR"\&\fI ... \fR\&"
Pass additional options to lvm
.TP
.SH LUKS
.TP
.BR \fBluks=\fR"\&\fI {0|1} \fR\&"
Enable LUKS support
.TP
.TP
.BR \fBluks.root=\fR"\&\fI ... \fR\&"
Specify encrypted root partition [PARTUUID, UUID, LABEL, DEVICE]
.TP
.TP
.BR \fBluks.name=\fR"\&\fI ... \fR\&"
Specify device mapper name
.TP
.TP
.BR \fBluks.header=\fR"\&\fI /path/to/file \fR\&"
Not implemented
.TP
.TP
.BR \fBluks.keyfile=\fR"\&\fI /path/to/file \fR\&"
Not implemented
.TP
.TP
.BR \fBluks.discard=\fR"\&\fI {0|1} \fR\&"
Enable TRIM requests
.TP
.TP
.BR \fBluks.args=\fR"\&\fI ... \fR\&"
Pass additional options to cryptsetup
.TP

View File

@ -68,9 +68,6 @@ setup_devmgr() {
mdevd & mdevd &
mdevd-coldplug mdevd-coldplug
;; ;;
*)
panic "devmgr option broken"
;;
esac esac
} }
@ -82,7 +79,6 @@ findfs_sh() {
UUID) device="/dev/disk/by-uuid/${value}" ;; UUID) device="/dev/disk/by-uuid/${value}" ;;
PARTUUID) device="/dev/disk/by-partuuid/${value}" ;; PARTUUID) device="/dev/disk/by-partuuid/${value}" ;;
/dev/*) device="$1" ;; /dev/*) device="$1" ;;
*) panic "findfs option broken" ;;
esac esac
# avoid race condition # avoid race condition
@ -131,7 +127,6 @@ cleanup() {
mdevd) killall mdevd ;; mdevd) killall mdevd ;;
esac esac
# unmount pseudofs's
umount /dev /sys /proc umount /dev /sys /proc
} }