Creating a Custom ISO ?

Post here if you are a new Porteus member and you're looking for some help.
PotatoHead
White ninja
White ninja
Posts: 5
Joined: 26 Jan 2024, 00:44
Distribution: Debian

Creating a Custom ISO ?

Post#1 by PotatoHead » 26 Jan 2024, 01:11

Hey,

I am new to Porteus and have a couple of questions for the following use case:

I would like to use Porteus with the XFCE desktop in RAM-only mode as a non-root user booted from a CD or DVD in UEFI mode with the following customizations:

- changed root and guest passwords
- additional non-root user
- no auto-login on boot -> choose account and type pasword
- latest Firefox and Chrome (or Vivaldi) installed
- Firewall enabled and configured
- A graphical network manager to create and edit VPN connections

So the basic idea is to make the required changes and customizations, create a custom iso with these changes and burn it to a new CD / DVD so that I can boot into the exact same, custom version every time.

I find the documentation a bit hard to navigate.

Could you please guide me how to implement this?

Thank you! :good:

User avatar
Ed_P
Contributor
Contributor
Posts: 8374
Joined: 06 Feb 2013, 22:12
Distribution: Cinnamon 5.01 ISO
Location: Western NY, USA

Creating a Custom ISO ?

Post#2 by Ed_P » 26 Jan 2024, 08:57

PotatoHead wrote:
26 Jan 2024, 01:11
I would like to use Porteus with the XFCE desktop in RAM-only mode as a non-root user booted from a CD or DVD in UEFI mode with the following customizations:
Well, to start with a XFCE desktop I would find a convenient Porteus mirror: http://porteus.org/porteus-mirrors.html and download the XFCE ISO in the /porteus/x86_64/Porteus-v5.01/ folder. Like the one is this mirror: http://mirrors.dotsrc.org/porteus/x86_64/Porteus-v5.01/

I would then format a medium size USB drive as FAT32 and copy all the folders and files in the ISO to the drive and then run the appropriate Porteus-installer app on the USB drive's /boot folder. This will allow you to boot Porteus on BIOS and EFI machines.

Do note on EFI systems you will need to disable the system's Secure Boot option.

To add a browser to the USB system download one from the mirror's /porteus/x86_64/Porteus-v5.01/modules folder and copy it to the USB's /porteus/modules folder.

To ensure you have the most current system updates download from one of the mirrors' /porteus/x86_64/Porteus-v5.01/updates/core/202321228 folder the 001- and 2 002- files plus the 003-XFCE xzm files and copy them to the USB drive's /porteus/base folder replacing the files there.

At this point you have a bootable non-changable Porteus system and time to take a break, have something to drink and review the cheatcodes.txt file in the USB drive's /boot/docs folder. Do not make an ISO file of the USB drive just yet. :)

You can not save system changes on a FAT32 drive, Porteus doesn't support it. Some people create a 2nd partition on their Porteus drive and have changes written to it. I've never done that but it is a common approach. The approach I use is to create a Savefile on the USB drive. You do that with the Porteus menu's Administration's Porteus Savefile Manager app. My savefile is 512MB and is 48% full. If you think you will need a bigger one feel free to create a larger one. I don't save movies or music to my Porteus system. Once you create the savefile file, usually referred to as save.date, you need to add a cheatcode to the boot menu to reference the file and it's location, usually the /porteus/changes folder and then reboot to be able to save changes.

It's late for me and at this point I'm going to bed. Things to read in the cheatcodes.txt file should include changes=EXIT and UUID plus the things you want to do with the system. :happy62:

Added in 10 hours 17 minutes 6 seconds:
'mornin PotatoHead.

So, have you created you save.dat file? If so at this point making a backup of the USB system would be a good idea.

As for these items"
PotatoHead wrote:
26 Jan 2024, 01:11
following customizations:

- changed root and guest passwords
- additional non-root user
- no auto-login on boot -> choose account and type pasword
- latest Firefox and Chrome (or Vivaldi) installed
- Firewall enabled and configured
- A graphical network manager to create and edit VPN connections
The 1st two you should be able to do. The 3rd one I can't help you with. The next one we've covered and the 2 are included with Porteus.
PotatoHead wrote:
26 Jan 2024, 01:11
so that I can boot into the exact same, custom version every time.
For this I suggest this approach for you. Once you've made your changes and have them saved in the save.dat file reboot and run this script:

Code: Select all

#!/bin/sh

Changes=/porteus/changes
Modules=/porteus/modules
Savedat=mychanges.dat

echo "Please wait, copying in progress."
cp $Changes/$Savedat $Modules/$Savedat.xzm

ls $Modules
echo "$Savedat copied"
sleep 8
exit
Save the script in your /home/guest/ folder. I named mine savedat2xzm.sh and make it to be executable by executing this command in a terminal window:

Code: Select all

chmod +X /home/guest/savedat2xzm.sh
And the final step with this approach is tweaking the Porteus boot menu, /boot/syslinux/porteus.cfg which I will get to later. :)
Ed

i3slkiller
Black ninja
Black ninja
Posts: 43
Joined: 03 Feb 2020, 18:51
Distribution: Porteus XFCE v5.0rc2 x86_64
Location: Poland

Creating a Custom ISO ?

Post#3 by i3slkiller » 26 Jan 2024, 20:38

:hi:
PotatoHead wrote:
26 Jan 2024, 01:11
- no auto-login on boot -> choose account and type pasword
Try to comment or delete autologin property in /etc/lxdm/lxdm.conf (by default it looks like here):

Code: Select all

[base]
## uncomment and set autologin username to enable autologin
autologin=guest
EDIT: I just found nologin cheatcode which does it, but I didn't found any mention of it in /usr/doc/porteus/cheatcodes.txt
PotatoHead wrote:
26 Jan 2024, 01:11
- A graphical network manager to create and edit VPN connections
It depends what VPN you mean, in case of:
* OpenVPN, it is installed by default, you have to add NetworkManager-openvpn package
* Wireguard, it looks like you can add Wireguard connection, but this program itself is not installed, add wireguard-tools package

There are other networkmanager plugins (install one you need + dependencies if required).
Image

PotatoHead
White ninja
White ninja
Posts: 5
Joined: 26 Jan 2024, 00:44
Distribution: Debian

Creating a Custom ISO ?

Post#4 by PotatoHead » 26 Jan 2024, 23:27

Thank you so much @Ed_P and @i3slkiller for your detailed responses. :worship:

It's really difficult to access this forum. I think the security threshold might be set a bit too restrictive... :%)

Let me try this and I will report back if I encounter any problems.

Just another clarification question:

Is the initial USB pendrive installation mandatory?

Would it be possible to simply burn the default Porteus iso image to a CD, create the required customizations in RAM, create a new iso with all customizations and burn it to a new CD ?

User avatar
Ed_P
Contributor
Contributor
Posts: 8374
Joined: 06 Feb 2013, 22:12
Distribution: Cinnamon 5.01 ISO
Location: Western NY, USA

Creating a Custom ISO ?

Post#5 by Ed_P » 27 Jan 2024, 01:21

PotatoHead wrote:
26 Jan 2024, 23:27
It's really difficult to access this forum. I think the security threshold might be set a bit too restrictive... :%)
Tell me about it. :x The admins need to work on it.
PotatoHead wrote:
26 Jan 2024, 23:27
Just another clarification question:

Is the initial USB pendrive installation mandatory?
No, but it is very useful. AT the end I was going to recommend that you use it instead of your CD/DVD goal. Few pcs have CD/DVD readers these days but they all have USB ports. So if you want to use your Porteus system on many machines you will do better with a USB device. USB drives are easier to update then CD/DVD discs and a 32GB drive is only $5 at Walmart here.
PotatoHead wrote:
26 Jan 2024, 23:27
Would it be possible to simply burn the default Porteus iso image to a CD, create the required customizations in RAM, create a new iso with all customizations and burn it to a new CD ?
I've never done it so I don't know. But anything is possible if you set your mind to it. :)

As for the Porteus boot menu, the change I made to mine was to tweak the top menu to save save.dat changes, make a copy of it, post it under the top menu and tweak it to not save changes.

Code: Select all

LABEL GRAPHICAL
MENU LABEL Graphics mode
KERNEL /boot/syslinux/vmlinuz
INITRD /boot/syslinux/initrd.xz
APPEND changes=EXIT:UUID:C23A-6012/changes/50save.dat  "
TEXT HELP
    Run Porteus the best way we can.
    Try to autoconfigure graphics
    card and use the maximum allowed
    resolution. If booting from a
    non-posix (FAT/NTFS) drive,
    see the Saving Changes Help
    below for how to save changes.
ENDTEXT

LABEL safe
MENU LABEL Graphics mode (Safe)
KERNEL /boot/syslinux/vmlinuz
INITRD /boot/syslinux/initrd.xz
APPEND extramod=UUID:C23A-6012/Modules noload=50save.dat
TEXT HELP
    Run Porteus the best way we can.
    Try to autoconfigure graphics
    card and use the maximum allowed
    resolution and with NO changes
    saved. 
ENDTEXT
Added in 3 hours 41 minutes 50 seconds:
One last change to make to the Porteus boot menu, /boot/syslinux/porteus.cfg, change line 4's DEFAULT setting to be the name of the new menu.

Code: Select all

DEFAULT safe
:)
Ed

PotatoHead
White ninja
White ninja
Posts: 5
Joined: 26 Jan 2024, 00:44
Distribution: Debian

Creating a Custom ISO ?

Post#6 by PotatoHead » 27 Jan 2024, 23:31

Thanks, Ed. It's like winning the lottery trying to access this forum... :roll:

You won't believe it but there are regions on this planet where it is incredibly difficult to buy USB pendrives and those sell at crazy prices. So that's why I was looking for a CD / DVD based solution as my PCs all have a respective drive and I have a good supply level. Another advantage I see is that a CD (choosing the right type) won't be rewritable so there are no worries about data changes that might happen on a USB stick.

I am not sure where I read it but there was an image generation script in Porteus. I am struggling a bit with the documentation. Bits and pieces are all over the place... :hmmm: I need to take notes of links.

Otto
White ninja
White ninja
Posts: 14
Joined: 09 Nov 2023, 18:31
Distribution: linux

Creating a Custom ISO ?

Post#7 by Otto » 28 Jan 2024, 01:49

I have not used cd/dvd anymore since after laptop without cd/dvd player on the market.
Basically you dont need it, you can install porteus frugally or direct from ISO on your internal H-Drive.
Porteus has a feature to activate/deactivate read only mode. Setup porteus & customize what ever you like and save it,
The next just activate Boot stanza to read only mode. Thats it & enjoy.

PotatoHead
White ninja
White ninja
Posts: 5
Joined: 26 Jan 2024, 00:44
Distribution: Debian

Creating a Custom ISO ?

Post#8 by PotatoHead » 28 Jan 2024, 11:44

This is a RAM-only system, no hard drive connected... :happy62:

Might the make_iso.sh script be what I am looking for?

http://www.porteus.org/faq.html

Code: Select all

How can I customize the Porteus ISO?

Make all of your desired changes to the /boot and /porteus folders to make them look exactly how they should appear on your custom ISO. Then run the script /porteus/make_iso.sh which will create a new ISO with a name and location you provide.

Example of how to run make_iso.sh:

cd /mnt/sdXN/porteus/
./make_iso.sh

where sdXN is the location of your /boot and /porteus folders.

Otto
White ninja
White ninja
Posts: 14
Joined: 09 Nov 2023, 18:31
Distribution: linux

Creating a Custom ISO ?

Post#9 by Otto » 28 Jan 2024, 14:44

This is a RAM-only system
Sure, using copy2ram boot parameter will run the system from the HD totally in RAM also.

User avatar
Ed_P
Contributor
Contributor
Posts: 8374
Joined: 06 Feb 2013, 22:12
Distribution: Cinnamon 5.01 ISO
Location: Western NY, USA

Creating a Custom ISO ?

Post#10 by Ed_P » 28 Jan 2024, 16:53

Ref: your ISO request:

After you create a folder on your harddrive and extract all the folders and files in the Porteus ISO that you download into it and make all the updates and tweaks we have discussed above try running this script to make a NEW ISO.

Code: Select all

#!/bin/sh

if [ `whoami` != "root" ]; then
   echo -e "Enter root's password\033[1;31m"
   su -c "sh $0 $1 $2"; exit
fi
echo -e "\033[0m"; echo -en "\033]0;Porteus ISO Update\a" 

mkisofs -o NEW.iso -v -l -J -joliet-long  -R -D -A Porteus -V Porteus \
        -no-emul-boot -boot-info-table -boot-load-size 4 \
        -b boot/syslinux/isolinux.bin -c boot/syslinux/isolinux.boot   URUPDATEDISOFILESFOLDER
        
ls -hon 
In fact, before trying this you should try writing the downloaded Porteus ISO file to your CD and see if it boots.

PotatoHead wrote:
28 Jan 2024, 11:44
Might the make_iso.sh script be what I am looking for?

http://www.porteus.org/faq.html
Interesting. I wonder what happened to that script.

Code: Select all

root@porteus:/home/guest# make_iso.sh
bash: make_iso.sh: command not found
root@porteus:/home/guest# 
Found it: Porteus 3.2rc3 bug - sidebar :)
Ed

PotatoHead
White ninja
White ninja
Posts: 5
Joined: 26 Jan 2024, 00:44
Distribution: Debian

Creating a Custom ISO ?

Post#11 by PotatoHead » 29 Jan 2024, 15:22

Thanks Ed. Let me try your iso generation script.

In the post that you cited, you also mentioned IsoMaster.

Are you referring to the following tool?

https://littlesvr.ca/isomaster/

donald
Full of knowledge
Full of knowledge
Posts: 2074
Joined: 17 Jun 2013, 13:17
Distribution: Porteus 3.2.2 XFCE 32bit
Location: Germany

Creating a Custom ISO ?

Post#12 by donald » 29 Jan 2024, 18:24

@PotatoHead

isomaster + small dependencies modules -- go here:
[Solved] Porteus 5.0 Updater (Post by donald #92179)
and click the link below "EDIT" > extract the zip to get both modules -- should still work

Image

User avatar
Ed_P
Contributor
Contributor
Posts: 8374
Joined: 06 Feb 2013, 22:12
Distribution: Cinnamon 5.01 ISO
Location: Western NY, USA

Creating a Custom ISO ?

Post#13 by Ed_P » 29 Jan 2024, 23:13

Is there a config file that needs to be included?

Code: Select all

guest@porteus:~$ isomaster
ISO Master warning: failed to open config file for reading, trying to create
Quitting
guest@porteus:~$ 
Ed

donald
Full of knowledge
Full of knowledge
Posts: 2074
Joined: 17 Jun 2013, 13:17
Distribution: Porteus 3.2.2 XFCE 32bit
Location: Germany

Creating a Custom ISO ?

Post#14 by donald » 30 Jan 2024, 00:22

@Ed
This file is created at first run of isomaster.
It should be in /home/guest/

What does 'Quitting' mean? - didn't the app run? - it work ok for me (5.01-x86_64-XFCE)

User avatar
Ed_P
Contributor
Contributor
Posts: 8374
Joined: 06 Feb 2013, 22:12
Distribution: Cinnamon 5.01 ISO
Location: Western NY, USA

Creating a Custom ISO ?

Post#15 by Ed_P » 30 Jan 2024, 20:12

After activating the two files in the zip, with no Menu entry for ISO Master and no .desktop entry for it in my /home/guest/desktop folder I started isomaster from the terminal window and the "Quitting" came when I closed the ISO Master GUI window. There is no new file in my /home/guest/ folder.

Added in 4 minutes 24 seconds:
I found the config file. It's name is .isomaster and is hidden. When I started ISO Master a second time the error msg didn't appear.
Ed

Post Reply