Can I create a custom live ISO with all persist options defined?  [Solved]

Message
Author
User avatar
a_freed_man
Posts: 160
Joined: Tue Nov 03, 2020 11:25 am

Can I create a custom live ISO with all persist options defined?

#1 Post by a_freed_man »

I booted one of dolphin_oracle's respins with systemd on a VM from ISO and the live session looks good for my needs and starts with systemd. I presume if I created a snapshot with that live session and used MX Live USB Maker and started that in a VM it would behave exactly the same.

In a live session I see the /live folder with all the antiX, syslinux and boot files, but where do those files live on an installed instance? My goal is to preselect as many boot options as possible to simplify installation by the end users I'm targeting.

I am installing the live MX onto a large, fast, USB3 SSD and want to use the p_static_root to have minimal impact on host system RAM and zero on host system disk.

I'm reading about the various antiX boot parameters and I see the menus/tz.data, tz.menu, but I don't see the code that manages any of the boot menu items. Is that in syslinux?

Where do I go for a tutorial, guide or explanation for how to change the boot choices? Is it possible to streamline the boot process for a specific use case and minimize the choices users have to make?

User avatar
seaken64
Posts: 819
Joined: Wed Jan 02, 2019 1:43 pm

Re: Can I create a custom live ISO with all persist options defined?

#2 Post by seaken64 »

I have setup a LiveUSB with MX using p_static-root. When I install to a machine's hard drive from that LiveUSB all the settings and apps from the LiveUSB are duplicated on the new install.

I suggest you try it out. You will get your answers by going ahead and installing and check out if the newly installed system meets your needs.

Seaken64
MX21-64 XFCE & W11 on Lenovo 330S LT. MX21-KDE & MX21-XFCE on Live USB.
MX18-64 & W7, Fedora on HP Core2 DT
MX21-32 XFCE w/ MX-Fluxbox on P4HT DT w/ antiX21, SUSE Tumbleweed, Q4OS, WXP
antiX21 on Compaq PIII 1 Ghz DT, w/ Debian, MX18FB, W2K

User avatar
fehlix
Developer
Posts: 12873
Joined: Wed Apr 11, 2018 5:09 pm

Re: Can I create a custom live ISO with all persist options defined?

#3 Post by fehlix »

a_freed_man wrote: Mon Feb 14, 2022 10:43 pm I'm reading about the various antiX boot parameters and I see the menus/tz.data, tz.menu, but I don't see the code that manages any of the boot menu items. Is that in syslinux?
Yes, The snapshot is using a template for iso/syslinx and grub from here :

/lib/iso-template/iso-template.tar.gz/utar://iso-template/boot

where template syslinux ends up on the USB to be used for BIOS bootloader and
grub template as grub loader used in UEFI boot. The grub-stuff can also be loaded in BIOS-mode
using Switch to Grub option in the BIOS-boot menu.

The easiest, to generate a customized LiveBOOT menu, would be
to boot from LiveUSB and select items to be changed and press F8 -> save.
This will adjust /boot/syslinux menu on the LiveUSB, which can be
used/adjusted and placed into the iso-template.

User avatar
a_freed_man
Posts: 160
Joined: Tue Nov 03, 2020 11:25 am

Re: Can I create a custom live ISO with all persist options defined?

#4 Post by a_freed_man »

fehlix wrote: Tue Feb 15, 2022 9:34 am
a_freed_man wrote: Mon Feb 14, 2022 10:43 pm I'm reading about the various antiX boot parameters and I see the menus/tz.data, tz.menu, but I don't see the code that manages any of the boot menu items. Is that in syslinux?
Yes, The snapshot is using a template for iso/syslinx and grub from here :

/lib/iso-template/iso-template.tar.gz/utar://iso-template/boot

where template syslinux ends up on the USB to be used for BIOS bootloader and
grub template as grub loader used in UEFI boot. The grub-stuff can also be loaded in BIOS-mode
using Switch to Grub option in the BIOS-boot menu.

The easiest, to generate a customized LiveBOOT menu, would be
to boot from LiveUSB and select items to be changed and press F8 -> save.
This will adjust /boot/syslinux menu on the LiveUSB, which can be
used/adjusted and placed into the iso-template.
Fehlix nailed it, that was exactly the info I was hoping to learn. Seaken64, that is the approach I've been taking, and making considerable progress that way. However I found I was blocked in my investigation for the custom boot menu / setup, and fehlix just helped me to transcend that.

Thank you both for those replies!

User avatar
seaken64
Posts: 819
Joined: Wed Jan 02, 2019 1:43 pm

Re: Can I create a custom live ISO with all persist options defined?  [Solved]

#5 Post by seaken64 »

Good, glad you are making progress. And fehlix has often been very helpful sorting this stuff out. I've learned a lot about the Live system from him. Thanks fehlix for another good tip.

Seaken64
MX21-64 XFCE & W11 on Lenovo 330S LT. MX21-KDE & MX21-XFCE on Live USB.
MX18-64 & W7, Fedora on HP Core2 DT
MX21-32 XFCE w/ MX-Fluxbox on P4HT DT w/ antiX21, SUSE Tumbleweed, Q4OS, WXP
antiX21 on Compaq PIII 1 Ghz DT, w/ Debian, MX18FB, W2K

User avatar
a_freed_man
Posts: 160
Joined: Tue Nov 03, 2020 11:25 am

Re: Can I create a custom live ISO with all persist options defined?

#6 Post by a_freed_man »

For some reason the /var/log/nginx folder is removed after I generated a new live usb with all of my changes. It is not listed in any of the files under /usr/local/share/excludes so I don't know why it's removed.

I'm also a bit confused about the proper sequence to build new live USBs. If any particular iteration of changes are going to be the final version, shouldn't I always use remaster for each change? The bulk of the changes made from dolphin_oracle's systemd-only respin have been remastered into a new live usb iso I'm currently booted from. If I were to do it that way, I could remove the linuxfs.old file each time I've tested the changes and am ready to create a new remastered live USB to boot from for the next cycle of iterations, right?

Alternatively I could use the live usb maker and check the box to create from the currently running live system, or create a snapshot iso and use live usb maker with that snapshot as the source. I suspect that would be the same as the former option tho.

Also I don't see the boot menu choices I saved when I booted last in /boot, plus the boot menu has no F key choices at the bottom on this system, which is a new Acer Swift 5 I bought last year, probably UEFI only. I guess that means if I wanted to capture my boot choices to fold back into the iso-template.tar.gz file as a default like fehlix described I'll have to capture those choices for each type of boot (grub_x64, grub_386, isolinux, syslinux etc...) I want to support.

How to change the boot menu theme so it is used when the live USB is booted? I presume any of those in /boot/grub/themes are equally OK to use, and if so I'll use Gradient_Glow_Blue. When I try to run the mx-boot-options tool is says "Live environment detected", so I select the live USB device I'm booted from and it complains "Cannot create chroot environment, cannot change boot options. Exiting".

I changed it in /etc/defaults/grub so I'll see if that's adequate when I remaster next time.

User avatar
fehlix
Developer
Posts: 12873
Joined: Wed Apr 11, 2018 5:09 pm

Re: Can I create a custom live ISO with all persist options defined?

#7 Post by fehlix »

Ok lot's of questions..
let's cover those rg. bootloader:
a_freed_man wrote: Sat Feb 19, 2022 6:30 pm Also I don't see the boot menu choices I saved when I booted last in /boot, plus the boot menu has no F key choices at the bottom on this system, which is a new Acer Swift 5 I bought last year, probably UEFI only. I guess that means if I wanted to capture my boot choices to fold back into the iso-template.tar.gz file as a default like fehlix described I'll have to capture those choices for each type of boot (grub_x64, grub_386, isolinux, syslinux etc...) I want to support.
The LiveUSB/ISO can boot in either BIOS/MBR - or UEFI-boot mode.

For BIOS-booting the iso/syslinux bootloader is loaded and the iso/syslinux GFX-boot menu with those funny Fn-keys will be displayed. With F8-save the GFX-boot menu the boot options are saved and available for BIOS booting only.

For UEFI-boot the EFI-GRUB boot loader is loaded and the GRUB menu is shown. As the used GRUB is a pure Debian provided one, no Fn-keys are available but instead boot options can be selected and saved (on a writable boot medium.)
Under Save-option you can select either "grub-save", for making the boot option only available for GRUB booting or in addtion gfx-save, which does a bit more and "injetcts" the choosen boot options into the sys-linux boot menu.
After booting in UEFI-mode the saved boot options are stored with grubsave.cfg on the LiveUSB /boot/grub directory.
Those saved options are loaded next boot.
a_freed_man wrote: Sat Feb 19, 2022 6:30 pm How to change the boot menu theme so it is used when the live USB is booted? I presume any of those in /boot/grub/themes are equally OK to use, and if so I'll use Gradient_Glow_Blue. When I try to run the mx-boot-options tool is says "Live environment detected", so I select the live USB device I'm booted from and it complains "Cannot create chroot environment, cannot change boot options. Exiting".

I changed it in /etc/defaults/grub so I'll see if that's adequate when I remaster next time.
Re. Theming: both boot systems BIOS/UEFI do use a complete different technique.
For LiveGRUB the "normal" grub theming technique is used.
Those LiveGRUB options and LiveGRUB theming can not be dealt with "MX Boot Options",
and nothing from the running system's grub-default settings are used within the LiveGRUB.
It needs some manual adjustments on the LiveGRUB.

The easiest might be the background to adjust, all under Live /boot/grub on the USB, not within the booted system.
LiveGRUB and LiveGFX (sys/iso) boot should work regardless whther a 32bit or 64bit system is used.
Uff..

User avatar
a_freed_man
Posts: 160
Joined: Tue Nov 03, 2020 11:25 am

Re: Can I create a custom live ISO with all persist options defined?

#8 Post by a_freed_man »

fehlix wrote: Sat Feb 19, 2022 7:31 pm Ok lot's of questions..
let's cover those rg. bootloader:

Under Save-option you can select either "grub-save", for making the boot option only available for GRUB booting or in addtion gfx-save, which does a bit more and "injetcts" the choosen boot options into the sys-linux boot menu.
After booting in UEFI-mode the saved boot options are stored with grubsave.cfg on the LiveUSB /boot/grub directory.
Those saved options are loaded next boot.

The easiest might be the background to adjust, all under Live /boot/grub on the USB, not within the booted system.
LiveGRUB and LiveGFX (sys/iso) boot should work regardless whther a 32bit or 64bit system is used.
Uff..
Thanks fehlix, & sorry for the barrage of questions.

I successfully modified the background image which it now boots with. I don't see any for isolinux & syslinux tho.

For now, I will workaround the missing /var/log/nginx folder by changing nginx init script to create it if not there. It probably means all logs will be lost, so I'd like to understand why / how they're being removed since they are not listed in any of the excluded files.

I noticed the mx-welcome panel lists the root and demo accounts & passwords. Can those be removed? The demo account has been removed and the root password changed so that message is no longer valid.

As for the best process / tools to produce a Live USB, well I'll figure it out eventually. What I'm doing with remastering seems to be working OK.

User avatar
a_freed_man
Posts: 160
Joined: Tue Nov 03, 2020 11:25 am

Re: Can I create a custom live ISO with all persist options defined?

#9 Post by a_freed_man »

fehlix wrote: Tue Feb 15, 2022 9:34 am Yes, The snapshot is using a template for iso/syslinx and grub from here :
/lib/iso-template/iso-template.tar.gz/utar://iso-template/boot

The easiest, to generate a customized LiveBOOT menu, would be
to boot from LiveUSB and select items to be changed and press F8 -> save.
This will adjust /boot/syslinux menu on the LiveUSB, which can be
used/adjusted and placed into the iso-template.
Great tip, worked well for setting most of the default boot options for both grub & syslinux, including the background image for grub menu.

Best I can tell, the background menu image for syslinux or isolinux must be incorporated into one of the .c32 files. There are no image files or subdirectories in either syslinux or isolinux folders.

Q1) Can anyone explain how to change the boot menu background image for syslinux?

I couldn't figure out how to set the defaults for customizing root or swap filesystem sizes tho.
Q2) Can those questions even be answered and default values provided for them?

User avatar
fehlix
Developer
Posts: 12873
Joined: Wed Apr 11, 2018 5:09 pm

Re: Can I create a custom live ISO with all persist options defined?

#10 Post by fehlix »

a_freed_man wrote: Thu Mar 03, 2022 9:58 am Q1) Can anyone explain how to change the boot menu background image for syslinux?
There are couple of ways, you may try this way:
* Extract gfx-cpio
++> easiest with unpack-gfx-cpio, which you may find on live-booted under /live/bin/unpack-gfx-cpio
( -h/--help shows usage )
* background image are within the extracted directory gfx-cpio-dir named as:
back1024.jpg
back640.jpg
back800.jpg
* the tricky part is now to create such images, as gfx-boot system is highly sensible about not needed metadata within the image and may show just a black screen. Last time I tried I couldn't figure aut to make it with GIMP, so I used mtpaint
to save already prepared images with the proper size as jpg. I guess mtpaint removes all not needed metadata.
HTH

Post Reply

Return to “antiX”