implement hostonly LUKS and LVM
This commit is contained in:
parent
f5891c7811
commit
f6a9226f88
2
config
2
config
@ -12,7 +12,7 @@ debug=1
|
|||||||
root="UUID=07729c48-25d8-4096-acaf-ce5322915680"
|
root="UUID=07729c48-25d8-4096-acaf-ce5322915680"
|
||||||
|
|
||||||
# root type
|
# root type
|
||||||
#root_type="ext4"
|
root_type="ext4"
|
||||||
|
|
||||||
# root mount options
|
# root mount options
|
||||||
#root_args=""
|
#root_args=""
|
||||||
|
31
generate
31
generate
@ -119,24 +119,43 @@ install_luks() {
|
|||||||
# TODO keyfile
|
# TODO keyfile
|
||||||
}
|
}
|
||||||
|
|
||||||
# TODO implement hostonly mode
|
|
||||||
# install drivers
|
# install drivers
|
||||||
install_drivers() {
|
install_drivers() {
|
||||||
modker="${moddir}${kernel}"
|
modker="${moddir}${kernel}"
|
||||||
|
# TODO reimplement using functions
|
||||||
if [ "$hostonly" = 1 ]; then
|
if [ "$hostonly" = 1 ]; then
|
||||||
[ -n "$root_type" ] || panic "hostonly mode required root_type option to be configured"
|
[ -n "$root_type" ] || panic "hostonly mode required root_type option to be configured"
|
||||||
for modalias in $(find /sys/devices -name modalias -exec sort -u "{}" "+"); do
|
for driver in $(find /sys/devices -name modalias -exec sort -u "{}" "+"); do
|
||||||
for driver in $(modprobe -D "$modalias" 2>/dev/null | cut -d " " -f 2); do
|
for driver_dep in $(modprobe -D "$driver" 2>/dev/null | cut -d " " -f 2); do
|
||||||
install -Dm644 "$driver" "${tmpdir}${driver}"
|
install -Dm644 "$driver_dep" "${tmpdir}${driver_dep}"
|
||||||
done
|
done
|
||||||
done
|
done
|
||||||
|
|
||||||
|
# TODO separate root type option
|
||||||
|
# install root fs driver
|
||||||
for root_driver in $(modprobe -D "$root_type" 2>/dev/null | cut -d " " -f 2); do
|
for root_driver in $(modprobe -D "$root_type" 2>/dev/null | cut -d " " -f 2); do
|
||||||
install -Dm644 "$root_driver" "${tmpdir}${root_driver}"
|
install -Dm644 "$root_driver" "${tmpdir}${root_driver}"
|
||||||
done
|
done
|
||||||
|
|
||||||
# TODO LUKS
|
# TODO move to install_luks function
|
||||||
# TODO LVM
|
# install LUKS drivers
|
||||||
|
[ "$use_luks" = 1 ] && {
|
||||||
|
for luks_driver in aes dm-crypt sha256 sha512 wp512 ecb lrw xts twofish serpent; do
|
||||||
|
for luks_driver_dep in $(modprobe -D "$luks_driver" 2>/dev/null | cut -d " " -f 2); do
|
||||||
|
install -Dm644 "${luks_driver_dep}" "${tmpdir}${luks_driver_dep}"
|
||||||
|
done
|
||||||
|
done
|
||||||
|
}
|
||||||
|
|
||||||
|
# TODO move to install_lvm function
|
||||||
|
# install LVM drivers
|
||||||
|
[ "$use_lvm" = 1 ] && {
|
||||||
|
for lvm_driver in dm-thin-pool dm-multipath dm-snapshot dm-cache dm-log dm-mirror; do
|
||||||
|
for lvm_driver_dep in $(modprobe -D "$lvm_driver" 2>/dev/null | cut -d " " -f 2); do
|
||||||
|
install -Dm644 "$lvm_driver_dep" "${tmpdir}${lvm_driver_dep}"
|
||||||
|
done
|
||||||
|
done
|
||||||
|
}
|
||||||
else
|
else
|
||||||
find \
|
find \
|
||||||
"${modker}/kernel/drivers/virtio" \
|
"${modker}/kernel/drivers/virtio" \
|
||||||
|
Loading…
Reference in New Issue
Block a user