Chrooting into unsquashed live environment

I am trying to create a customized live iso. I’m having trouble figuring out how to chroot into the system to intall packages. I know of Manjaros iso tools, but I would like to go my own route since installation of AUR packages is so complicated with it.
I can do manjaro-chroot into rootfs, but from what I understand this is not the place to put user packages.
I tried that anyways and the package is available in the filesystem of the booted live environment, but it is not accessible through the launcher since no files were copied to /usr/share/applications. I tried symlinking desktopfs/usr/share/applications into rootfs/usr/share/applications, but pacman errors out. I tried specifying a different root to pacman with the -r option by creating a symlink to the desktopfs path into the rootfs root and passing -r to pacman but no joy.
Does anyone know the right way to do this?

There is no offical way to do it as file:// based repos is unsupported - but you can cheat :slight_smile:

  1. Build your aur packages - preferably using a clean chroot - e.g. using chrootbuild from the package manjaro-chrootbuild and place the result in a folder.
  2. Inside the package folder - use repo-add to build a database.
  3. Start a python http server and use database folder as root.
  4. Create a file in your profile folder named user-repos.conf
    [your-database-name]
    SigLevel = Optional TrustAll
    Server = http://localhost:8080
    
  5. Finally run buildiso to build your profile.

The pacman.conf file inside the ISO will have the custom repo added - which will cause issues when the iso is installed onto a system and you try to update it.

To work around this, you use buildiso -x which builds the components without actually assembling the iso

buildiso -x -p $PROFILE

When the process exits - edit pacman.conf in the buildroot - usually starting at /var/lib/manjaro-tools - and remove the custom repo.

sudo nano /var/lib/manjaro-tools/buildiso/$PROFILE/x86_64/rootfs/etc/pacman.conf

Then assemble the iso using

buildiso -zc -p $PROFILE

To see all available arguments

buildiso -h

Thanks, I will keep that in mind. Is there also a way to chroot into the unsquashed file systems, as an alternative approach? I successfully installed a pacman package in rootfs and it was available in both the live iso and the installed system, but I did not get any .desktop files to launch it from the launcher in either.

For self use theroteticaly inserting packages into the file system is one way to go. But if you have any plans to distribute the iso its a bad idea. There would be no way to upgrade the software and trying to install other packages or upgrade into an installed system from the iso would likely cause file conflicts from files in the system that would be in packages the package manager was trying to install.