ventoy / vtoyboot

Work with ventoy to support boot Linux distros in a vdisk file (vhd/vdi/raw ...)
GNU General Public License v3.0
275 stars 23 forks source link

Finer control to install uninstall of aspects of vtoyboot #63

Open hgkamath opened 1 year ago

hgkamath commented 1 year ago

It is desirable to have finer control on install and uninstall of vtoyboot.

One wants 1) Most importantly, a way to clear all traces of vtoyboot and restore root-filesystem and initramfs to as before 2) More control over whether the files/scripts for dm_patch feature is installed. (This is more stronger that not setting VTOY_LINUX_REMOUNT in plugson/ventoy-grub2-cmdline) 3) Manual step-by-step removal instructions: For the time being, a description of what needs to be manually, like which files to delete, what config files to edit, and command to enter so that it regenerate a fresh pristine initramfs.

Files:

[root@fedora vtoyboot-1.0.26]# find /usr | grep -iE "ventoy|vtoy"
/usr/bin/vtoydump
/usr/bin/vtoypartx
/usr/bin/vtoytool
/usr/bin/vtoydmpatch
/usr/lib/dracut/modules.d/99ventoy
/usr/lib/dracut/modules.d/99ventoy/ventoy-settled.sh
/usr/lib/dracut/modules.d/99ventoy/module-setup.sh

[root@fedora etc]# find /etc | grep -iE "ventoy|vtoy" | grep -vE "probe/|editenv/"
/etc/dracut.conf.d/ventoy.conf
/etc/vtoyboot
/etc/vtoyboot/probe
/etc/vtoyboot/editenv

[root@fedora tmp]# lsinitrd -m | grep -i toy
ventoy

[root@fedora vtoyboot-1.0.26]# lsinitrd | grep -i toy
ventoy
-rw-r--r--   1 root     root        59464 Nov 16 23:30 usr/bin/vtoydmpatch
-rwxr-xr-x   1 root     root        51792 Mar 19  2022 usr/bin/vtoydump
-rwxr-xr-x   1 root     root       299640 Sep 23  2020 usr/bin/vtoypartx
-rwxr-xr-x   1 root     root        74360 Apr  2  2022 usr/bin/vtoytool
-rwxr-xr-x   1 root     root         8857 Nov 16 23:30 usr/lib/dracut/hooks/initqueue/settled/99-ventoy-settled.sh

command to rebuild initramfs on fedora

[root@fedora ~]# dracut -f 

Q) Is it sufficient to manually delete these files? Any other file/config missing?

tbh, I am leaning towards not using vtoyboot for host partition mounting and going with the creating a dm-device for mounting host partition as mentioned in https://github.com/ventoy/Ventoy/issues/2234 & #62. A non-patching approach seems to be the secure way that does not do kernel-taint.
Apparently the taint is recorded even if patch fails to load. Value of /proc/sys/kernel/tainted will be 0 for untainted kernels.

[root@fedora ~]# dmesg | grep taint
[    5.305134] dm_patch: module verification failed: signature and/or required key missing - tainting kernel
[root@fedora ~]# cat /proc/sys/kernel/tainted
8192
[root@fedora ~]# cat /proc/modules | grep dm_patch
[root@fedora ~]# 

ps. The need for an uninstaller has mentioned as a sub-requirement in an issue (#2) from 2 yrs ago (Jan 4, 2021)