minor fixes

This commit is contained in:
illiliti 2020-03-07 22:24:59 +03:00
parent ea4bc83b6e
commit ea46267e85
4 changed files with 25 additions and 32 deletions

View File

@ -1,5 +1,5 @@
# initramfs # initramfs
Just another one implemetation of initramfs Tiny initramfs for suckless systems
Features Features
-------- --------
@ -7,7 +7,7 @@ Features
- Easy configuration - Easy configuration
- LUKS - LUKS
- LVM - LVM
- mdev,mdevd and eudev - mdev, mdevd, eudev
Installation Installation
------------ ------------
@ -15,15 +15,14 @@ Requirements:
* busybox * busybox
- --install [-s] [DIR] - --install [-s] [DIR]
- mdev - mdev
- uevent
- switch_root - switch_root
- mount - mount
- umount - umount
- blkid - blkid
* kmod * kmod
* cryptsetup - LUKS * cryptsetup - LUKS
* lvm2 - LVM * lvm2 - LVM
* util-linux - PARTUUID * util-linux - PARTUUID
Download & Setup: Download & Setup:
``` ```

7
config
View File

@ -14,6 +14,9 @@
# custom output name # custom output name
#initramfs="" #initramfs=""
# custom drivers directory
#moddir=""
# custom kernel version # custom kernel version
#kernel="" #kernel=""
@ -30,9 +33,7 @@
# root options # root options
#root_opts="" #root_opts=""
# disable this if you want to get rid of util-linux # util-linux binaries
# NOTE busybox util-linux implemetation doesn't have
# PARTUUID support and proper filesystem type autodetection
#util_linux=0 #util_linux=0
# device manager ( mdev,mdevd,udev ) # device manager ( mdev,mdevd,udev )

View File

@ -6,7 +6,7 @@ panic() {
printf "panic >> %s\n" "$1" printf "panic >> %s\n" "$1"
# TODO fix job control # TODO fix job control
sh -l sh
} }
parse_cmdline() { parse_cmdline() {
@ -36,10 +36,10 @@ parse_cmdline() {
luks.discard) luks_discard="$value" ;; luks.discard) luks_discard="$value" ;;
luks.args) luks_args="$value" ;; luks.args) luks_args="$value" ;;
# TODO implement # TODO implement
#lvm.discard) ;; #lvm.discard) ;;
#lvm.conf) ;; #lvm.config) ;;
#luks_header) ;; #luks.header) ;;
#luks_keyfile) ;; #luks.keyfile) ;;
esac esac
done done
} }
@ -59,17 +59,10 @@ setup_devmgr() {
udevadm settle udevadm settle
;; ;;
mdev) mdev)
uevent mdev & mdev -df &
mdev -s
for device in /sys/bus/usb/devices/*; do
case "${device##*/}" in [0-9]*-[0-9]*)
printf add > "${device}/uevent" ;;
esac
done
find /sys -name modalias -type f -exec sort -u {} + | find /sys -name modalias -type f -exec sort -u {} + |
xargs modprobe -b > /dev/null 2>&1 xargs modprobe -ba
;; ;;
mdevd) mdevd)
mdevd & mdevd &
@ -134,7 +127,7 @@ mount_rootfs() {
cleanup() { cleanup() {
case "$devmgr" in case "$devmgr" in
udev) udevadm control -e ;; udev) udevadm control -e ;;
mdev) killall uevent ;; mdev) killall mdev ;;
mdevd) killall mdevd ;; mdevd) killall mdevd ;;
esac esac

View File

@ -28,13 +28,13 @@ usage() {
cat << EOF cat << EOF
usage: $0 [options] usage: $0 [options]
-o, --output <file> set initramfs image path -o, --output <file> set initramfs image name
-c, --config <file> set config file path -c, --config <file> set config file path
-m, --moddir <dir> specify drivers directory -m, --moddir <dir> set drivers directory
-k, --kernel <ver> set kernel version -k, --kernel <ver> set kernel version
-F, --files <dir> specify files directory -F, --files <dir> set files directory
-d, --debug enable debug mode -d, --debug enable debug mode
-f, --force overwrite existing initramfs image -f, --force overwrite existing initramfs image
EOF EOF
} }
@ -470,8 +470,6 @@ trap "remove_workdir && trap - EXIT && exit" EXIT INT TERM HUP
create_workdir create_workdir
create_structure create_structure
create_symlinks create_symlinks
install_requirements
install_devmgr
[ "$lvm" = 1 ] && install_lvm [ "$lvm" = 1 ] && install_lvm
[ "$luks" = 1 ] && install_luks [ "$luks" = 1 ] && install_luks
@ -491,7 +489,9 @@ else
msg warn "looks like you have monolithic kernel" msg warn "looks like you have monolithic kernel"
fi fi
install_devmgr
install_files install_files
install_requirements
create_initramfs create_initramfs
msg info "done! check out $initramfs" msg info "done! check out $initramfs"