Using Arduino libraries for adding more functionality to a bootloader

I have a short question to ask before putting time for researching. I have an arduino leonardo with LUFA mass storage bootloader flashed. Now what I need to do is to add more functionality to the bootloader. Because in the final product, Leonardo board will be connected to a fitness machine(permanently connected) and the machine has windows os. Then the Leonardo should be able to read RFID card(I need to add a RFID reader to the board, each user has his own RFID card) and then mount remote server directory to local USB Host based on selected user. I will have to use a wifi shield too. My question is this, is it theoretically possible to add all this functionality to the LUFA mass storage bootloader? Because it's not possible to use Arduino IDE for this purpose since I'm not uploading any sketch on the top of bootloader rather than editing the existing mass storage bootloader with the required functionality and re-flash the chip. Am I correct?(This is what I understood after some research. And I'm a noob :D). Could you please elaborate what would be the first step of solving this issue?

I did not understand why you cannot use the Arduino IDE.

Bootloaders are usually tight on space but I do not know about LUFA. Bootloaders usually have a single job to do: boot

You have a lot to do. I suggest starting with an Arduino sketch. It will be easier to debug and may be all that you need.

Sorry for my bad explanation. I'm quite new to AVR programming. Actually LUFA mass storage bootloader is a firmware(IMO). Once I connect the Leonardo the PC recognise it as a mass storage and not as a uc. So what I have to do is (I guess) to modify the existing LUFA mass storage project with my custom functionalities.

The LUFA bootloader may be convenient for the mass storage project that you want to do, but I still believe that the other functionalities should be provided as an Arduino sketch until you see a sufficient reason to integrate them into the bootloader.

The problem is that the Leonardo will be permanently connected to the fitness machine and should act as a mass storage. So it is not possible to have rest of the functionalities as a sketch. Because then the Leonardo will act as MSD at start and then the application will run afterwards. What I need(I guess) is to somehow add all other functionalities inside the mass storage code which will be a firmware rather than a bootloader.

I guess that I am going to have to wrap my brain around the concept of a bootloader that doesn't bootload. Good Luck!

Maybe try this. Tho I haven't tried it myself, it may be the option you need to get this working and combine both Arduino sketch and lufa together.