From ea46267e857f6f93c26ca0caee0aecc38b0c4281 Mon Sep 17 00:00:00 2001 From: illiliti Date: Sat, 7 Mar 2020 22:24:59 +0300 Subject: [PATCH] minor fixes --- README.md | 9 ++++----- config | 7 ++++--- files/init | 23 ++++++++--------------- tinyramfs | 18 +++++++++--------- 4 files changed, 25 insertions(+), 32 deletions(-) diff --git a/README.md b/README.md index 34a56b9..45d1f28 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,5 @@ # initramfs -Just another one implemetation of initramfs +Tiny initramfs for suckless systems Features -------- @@ -7,7 +7,7 @@ Features - Easy configuration - LUKS - LVM -- mdev,mdevd and eudev +- mdev, mdevd, eudev Installation ------------ @@ -15,15 +15,14 @@ Requirements: * busybox - --install [-s] [DIR] - mdev - - uevent - switch_root - mount - umount - blkid * kmod -* cryptsetup - LUKS +* cryptsetup - LUKS * lvm2 - LVM -* util-linux - PARTUUID +* util-linux - PARTUUID Download & Setup: ``` diff --git a/config b/config index b459c89..a5cef04 100644 --- a/config +++ b/config @@ -14,6 +14,9 @@ # custom output name #initramfs="" +# custom drivers directory +#moddir="" + # custom kernel version #kernel="" @@ -30,9 +33,7 @@ # root options #root_opts="" -# disable this if you want to get rid of util-linux -# NOTE busybox util-linux implemetation doesn't have -# PARTUUID support and proper filesystem type autodetection +# util-linux binaries #util_linux=0 # device manager ( mdev,mdevd,udev ) diff --git a/files/init b/files/init index 829de82..10f6b2e 100644 --- a/files/init +++ b/files/init @@ -6,7 +6,7 @@ panic() { printf "panic >> %s\n" "$1" # TODO fix job control - sh -l + sh } parse_cmdline() { @@ -36,10 +36,10 @@ parse_cmdline() { luks.discard) luks_discard="$value" ;; luks.args) luks_args="$value" ;; # TODO implement - #lvm.discard) ;; - #lvm.conf) ;; - #luks_header) ;; - #luks_keyfile) ;; + #lvm.discard) ;; + #lvm.config) ;; + #luks.header) ;; + #luks.keyfile) ;; esac done } @@ -59,17 +59,10 @@ setup_devmgr() { udevadm settle ;; mdev) - uevent mdev & - mdev -s - - for device in /sys/bus/usb/devices/*; do - case "${device##*/}" in [0-9]*-[0-9]*) - printf add > "${device}/uevent" ;; - esac - done + mdev -df & find /sys -name modalias -type f -exec sort -u {} + | - xargs modprobe -b > /dev/null 2>&1 + xargs modprobe -ba ;; mdevd) mdevd & @@ -134,7 +127,7 @@ mount_rootfs() { cleanup() { case "$devmgr" in udev) udevadm control -e ;; - mdev) killall uevent ;; + mdev) killall mdev ;; mdevd) killall mdevd ;; esac diff --git a/tinyramfs b/tinyramfs index d227b69..3d5fbd5 100755 --- a/tinyramfs +++ b/tinyramfs @@ -28,13 +28,13 @@ usage() { cat << EOF usage: $0 [options] - -o, --output set initramfs image path - -c, --config set config file path - -m, --moddir specify drivers directory - -k, --kernel set kernel version - -F, --files specify files directory - -d, --debug enable debug mode - -f, --force overwrite existing initramfs image + -o, --output set initramfs image name + -c, --config set config file path + -m, --moddir set drivers directory + -k, --kernel set kernel version + -F, --files set files directory + -d, --debug enable debug mode + -f, --force overwrite existing initramfs image EOF } @@ -470,8 +470,6 @@ trap "remove_workdir && trap - EXIT && exit" EXIT INT TERM HUP create_workdir create_structure create_symlinks -install_requirements -install_devmgr [ "$lvm" = 1 ] && install_lvm [ "$luks" = 1 ] && install_luks @@ -491,7 +489,9 @@ else msg warn "looks like you have monolithic kernel" fi +install_devmgr install_files +install_requirements create_initramfs msg info "done! check out $initramfs"