Ventoy/DMPATCH
longpanda 096cc99c3c Fix a bug that VTOY_LINUX_REMOUNT option doesn't take effect in openSUSE. 2022-07-13 22:40:32 +08:00
..
Makefile 1.0.64 release 2022-01-08 23:07:04 +08:00
dmpatch.c Fix a bug that VTOY_LINUX_REMOUNT option doesn't take effect in openSUSE. 2022-07-13 22:40:32 +08:00
readme.txt VTOY_LINUX_REMOUNT support for both 64bit(x86_64) and 32bit(i386) linux distro. 2022-01-12 10:24:44 +08:00

readme.txt

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

1. install ubuntu 21.10
2. apt-get install build-essential flex libncurses-dev linux-headers-generic linux-source libssl-dev ...... and so on
3. cp /lib/modules/5.13.0-23-generic/build/Module.symvers ./
4. /boot/config-5.13.0-23-generic as .config   make oldconfig
5. make menuconfig 
    1. close CONFIG_STACKPROTECTOR
    2. close CONFIG_RETPOLINE

6. modify ./scripts/mod/modpost.c
    1. skip add_srcversion (just return)
    2. force add_retpoline (#ifdef --> #ifndef)
    3. force add_intree_flag

7. make modules_prepare LOCALVERSION=-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

8. Append padding at the end of struct module <include/linux/module.h>
struct module {
    enum module_state state;

	/* Member of list of modules */
	struct list_head list;

	/* Unique handle for this module */
	char name[MODULE_NAME_LEN];
    
    ....
    
    char padding[1024];
};

This is because struct module size is different in different kernel versions or with different CONFIG item.


9. make modules M=/home/dmpatch
10. strip --strip-debug /home/dmpatch/dm_patch.ko