I'm working on a project to customize an ubuntu desktop iso to add/remove packages and eventually have it boot to RAM. Here is my overall idea.
- Create a custom OS that can be flashed into a USB and used to boot a target machine
- Once booted, run a script that creates a persistent partition in my hard disk and copy the iso to the partition
- Every single boot after running the script, shall use the image in the partition and boot to RAM.
- While booting, installation should happen automatically.
Background
I was able to achieve the above mentioned functionality in Debian stretch and I thought it will be fairly straightforward and tried to reuse the scripts for Ubuntu. No surprise, I was wrong. Then I started to reach out online. Learnt and tried the following steps.
- Used Cubic after reading this post - Create an unattended ubuntu 18.04 live cd that run on demo (try ubuntu) environment with premade various steps. Unable to boot from RAM. Also tried
toram
option - Not working - For automatic installation, I referred to this git repo and I was able to accomplish it by modifying preseed and isolinux/txt.cfg file.
- Also read through these tutorials:
- https://help.ubuntu.com/community/LiveCDCustomization - I believe this is similar to what Cubic is doing under the hood. Not much useful apart from learning the inner workings.
- https://wiki.ubuntu.com/BootToRAM - Super out of date and the author even mentions some steps that are not clean.
What I'm looking for?
- I understood how to customize Ubuntu by unpacking it, changing root and installing packages - I'm capable of accomplishing this.
- Run through installation unattended by modifying preseed file - No issues
- During every boot, the OS present in the a hard disk persistent partition must be copied to RAM - Tried a lot, no avail. Also, this may be related to grub.cfg and isolinux/txt.cfg. Not sure.
I'm sure, I'm doing something blatantly wrong. Please forgive me if I come across as a dumb person. I may not be using jargons appropriately. Also, I can improve this question and give more information based on what you are asking. I had to start somewhere! Thank you
Edits
Based on the comments, I tried the following. Please note, I'm using cubic.
- Boot options directory looks like the following:
- Unedited boot/grub/grub.cfg looks like the following:
- My modification:
- Unmodified isolinux/txt.cfg looks like the following and I erased all contents inside:
- Unfortunately, this was my output:
I'm super confused as to what files to modify. I'm not able to understand when the isolinux is used and when grub.cfg is used. Do I have to modify both the same way ? Can someone help me out on this please ?