notes/source/blog/automaticcrm-iso.rst

156 lines
3.8 KiB
ReStructuredText
Raw Normal View History

2019-08-10 23:00:19 +02:00
.. post:: 2019.08.10
:tags: howto,ubuntu,gnu/linux,installation
:category: gnu/linux
:author: vladan
:location: Belgrade
===========================
AutomaticCRM Ubuntu Desktop
===========================
Below are the steps taken to create the Ubuntu 18.04.2 installer for the needs
of AutomaticCRM according to the requirements ...
Operating system
* Only one domain is allowed ( dev.automaticcrm.ai ) in network adapter
* No print screen functionality
* No usb memory functionality
* No access to the filesystem
* No apps except browser
Steps to set up the build environment
=====================================
.. code-block:: bash
mkdir disk
sudo mount -o ubuntu-18.04.2-desktop-amd64.iso disk
rsync --exclude=/casper/filesystem.squashfs -av disk/ livecd/
Set up the rootfs
=================
.. code-block:: bash
unsquashfs disk/casper/filesystem.squashfs
sudo systemd-nspawn \
--directory squashfs-root/ \
--bind ~/dev/automaticcrm/deb:/opt/deb
--bind /etc/resolv.conf /bin/bash
Once in the shell, run these commands:
.. code-block:: bash
apt-get update
apt-get -y purge \
usb-creator-common \
usb-creator-gtk \
thunderbird-gnome-support \
thunderbird \
remmina-common \
remmina \
remmina-plugin-rdp \
remmina-plugin-vnc \
firefox* \
libreoffice* \
alsa* \
cups* \
gnome-screenshot \
evince \
gedit
dpkg -i /opt/deb/google-chrome-stable_current_amd64.deb
Restrict domains
================
To redirect all domains to localhost, except dev.automaticcrm.ai, create the
file ``/etc/dnsmasq.d/autocrm.conf`` with these lines:
.. code-block:: ini
address=/#/127.0.0.1
server=/dev.automaticcrm.ai/8.8.8.8
Add this line to /etc/dnsmasq.conf
.. code-block:: ini
conf-dir=/etc/dnsmasq.d
Run Chrome ONLY
===============
Override the path for all users.
Edit the desktop entry in ``/usr/share/xsessions/ubuntu.desktop`` so it starts
Chrome in fullscreen mode:
.. code-block:: ini
[Desktop Entry]
Name=Ubuntu
Comment=This session logs you into Ubuntu
Exec=env GNOME_SHELL_SESSION_MODE=ubuntu /usr/bin/google-chrome --kiosk https://dev.automaticcrm.ai
Type=Application
DesktopNames=ubuntu:AutomaticCRM
X-Ubuntu-Gettext-Domain=gnome-session-3.0
.. note::
If you want to change the domain, edit this file and also enable it in the
dnsmqsq config above.
Remove USB drivers
==================
.. code-block:: bash
printf "\n#AutomaticCRM disabled modules\nblacklist uas\nblacklist usb_storage\n" >> /etc/modprobe.d/blacklist.conf
Create the ISO
==============
Pack the squashfs image and copy it to casper.
.. code-block:: bash
sudo mksquashfs squashfs-root/ livecd/casper/filesystem.squashfs
Recreate installation files and pack the ISO.
.. code-block:: bash
printf $(sudo du -sx --block-size=1 squashfs-root | cut -f1) > livecd/casper/filesystem.size
sudo systemd-nspawn --directory squashfs-root/ dpkg-query -W --showformat='${Package} ${Version}\n' > livecd/casper/filesystem.manifest
sudo cp livecd/casper/filesystem.manifest{,-desktop}
sudo rm livecd/md5sum.txt && sudo find livecd/ -type f -print0 | sudo xargs -0 md5sum | grep -v isolinux/boot.cat | sudo tee livecd/md5sum.txt
mkisofs -r \
-V "AutomaticCRM Ubuntu Linux" \
-cache-inodes \
-J -l -b isolinux/isolinux.bin \
-c isolinux/boot.cat -no-emul-boot \
-boot-load-size 4 \
-boot-info-table \
-o automaticcrm-ubuntu-18.04.2.iso livecd/
Test the installation in a vm
=============================
.. code-block:: bash
rm -f ubuntu.qcow2
qemu-img create -f qcow2 ubuntu.qcow2 40G
virsh define ./autocrm.xml && virsh start ubuntu18.04