This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision Next revision Both sides next revision | ||
doc:howto:tce [2022/12/02 13:05] stefanbaur [Live-Patching the Build] |
doc:howto:tce [2024/01/26 19:39] stefanbaur [Client Branding/Theming using SVGs] Added link to Branding/Theming Wiki page |
||
---|---|---|---|
Line 61: | Line 61: | ||
# Select ONE of the following git reposities | # Select ONE of the following git reposities | ||
# this one loosely corresponds to " | # this one loosely corresponds to " | ||
- | #export LBX2GO_CONFIG=' | + | #export LBX2GO_CONFIG=' |
- | #export LBX2GO_CONFIG=' | + | #export LBX2GO_CONFIG=' |
- | export LBX2GO_CONFIG=' | + | export LBX2GO_CONFIG=' |
- | #export LBX2GO_CONFIG=' | + | #export LBX2GO_CONFIG=' |
- | # this one loosely corresponds to " | + | #export LBX2GO_CONFIG=' |
- | #export LBX2GO_CONFIG=' | + | #export LBX2GO_CONFIG=' |
- | #export LBX2GO_CONFIG=' | + | # NOTES: 1) https:// |
- | #export LBX2GO_CONFIG=' | + | # 2) Minidesktop builds are work in progress and not production-ready. Cont(r)act us if you need them; feel free to submit patches. |
- | #export LBX2GO_CONFIG=' | + | # |
- | # NOTE: Add " | + | # |
- | # | + | # |
- | # | + | # add " |
# Select ONE of the following LBX2GO_ARCH lines and comment out the others | # Select ONE of the following LBX2GO_ARCH lines and comment out the others | ||
Line 114: | Line 114: | ||
export LBX2GO_DEBVERSION=" | export LBX2GO_DEBVERSION=" | ||
export LBX2GO_BOOTAPPEND_LIVE+=" | export LBX2GO_BOOTAPPEND_LIVE+=" | ||
+ | elif [ -z " | ||
+ | export LBX2GO_DEBVERSION=" | ||
+ | export LBX2GO_BOOTAPPEND_LIVE+=" | ||
+ | export LBX2GO_ARCHIVE_AREAS=" | ||
else | else | ||
export LBX2GO_DEBVERSION=" | export LBX2GO_DEBVERSION=" | ||
Line 183: | Line 187: | ||
fi | fi | ||
- | export LBX2GO_ARCHIVE_AREAS=" | + | export LBX2GO_ARCHIVE_AREAS=" |
# This is for minidesktop builds and currently only adds firefox-esr language packs | # This is for minidesktop builds and currently only adds firefox-esr language packs | ||
Line 253: | Line 257: | ||
To add patches that aren't part of any package yet, you can use the directory ./patch/ for patches that should be added to all versions, and ./ | To add patches that aren't part of any package yet, you can use the directory ./patch/ for patches that should be added to all versions, and ./ | ||
- | You will need to create a directory structure like ./ | + | You will need to create a directory structure like < |
+ | |||
+ | e.g. to override < | ||
+ | < | ||
+ | # | ||
+ | |||
+ | # Copyright (C) 2010-2024 by X2Go project, https:// | ||
+ | # | ||
+ | # | ||
+ | # Mike Gabriel < | ||
+ | # | ||
+ | # | ||
+ | # X2Go is free software; you can redistribute it and/or modify | ||
+ | # it under the terms of the GNU General Public License as published by | ||
+ | # the Free Software Foundation; either version 2 of the License, or | ||
+ | # (at your option) any later version. | ||
+ | # | ||
+ | # X2Go is distributed in the hope that it will be useful, | ||
+ | # but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
+ | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. | ||
+ | # GNU General Public License for more details. | ||
+ | # | ||
+ | # You should have received a copy of the GNU General Public License | ||
+ | # along with this program; if not, write to the | ||
+ | # Free Software Foundation, Inc., | ||
+ | # 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. | ||
+ | |||
+ | # make sure pulseaudio can be reached via TCP from the X2Go Server side... | ||
+ | if ! / | ||
+ | / | ||
+ | fi | ||
+ | |||
+ | # make sure we don't start before sessions and settings files exist - avoids race conditions | ||
+ | while ! [ -e ~x2gothinclient/ | ||
+ | sleep 1; | ||
+ | done | ||
+ | |||
+ | while ! [ -e ~x2gothinclient/ | ||
+ | sleep 1 | ||
+ | done | ||
+ | |||
+ | [ -s / | ||
+ | [ -s / | ||
+ | |||
+ | |||
+ | / | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | & | ||
+ | |||
+ | </ | ||
==== Starting the Build ==== | ==== Starting the Build ==== | ||
In the directory where you want to save your builds, save the following file as x2go-tce-build, | In the directory where you want to save your builds, save the following file as x2go-tce-build, | ||
Line 265: | Line 325: | ||
LBX2GO_TIMESTAMP=$(date +" | LBX2GO_TIMESTAMP=$(date +" | ||
+ | # Log all output to a logfile in /tmp | ||
exec > >(tee "/ | exec > >(tee "/ | ||
Line 271: | Line 332: | ||
if [ -z " | if [ -z " | ||
- | | + | ( echo " |
[ -z " | [ -z " | ||
[ -z " | [ -z " | ||
Line 341: | Line 402: | ||
if echo $LBX2GO_ARCH | grep -q " | if echo $LBX2GO_ARCH | grep -q " | ||
- | | + | # bullseye and newer do not need this |
- | echo " | + | if [ " |
+ | # firmware for wifi | ||
+ | echo " | ||
+ | fi | ||
- | | + | if [ " |
- | # modules required for Raspberry Pi 3 LAN | + | # modules required for Raspberry Pi 3 LAN |
- | echo " | + | echo " |
- | echo " | + | echo " |
- | echo " | + | echo " |
- | echo " | + | echo " |
- | echo " | + | echo " |
- | echo " | + | echo " |
- | echo " | + | echo " |
- | | + | # firmware for basic raspi functions - required for boot on Pi3 |
- | echo " | + | echo " |
- | # standard linux kernel - for Pi3 | + | # standard linux kernel - for Pi3 |
- | echo " | + | echo " |
- | | + | elif [ " |
- | # firmware for basic raspi functions - required for boot on Pi4 | + | # bullseye and newer do not need this |
- | echo " | + | if [ " |
- | echo " | + | # firmware for basic raspi functions - required for boot on Pi4 |
- | + | echo " | |
- | # newer linux kernel - required for pi4/pi400 | + | echo " |
- | echo " | + | |
- | + | ||
- | else | + | |
- | echo " | + | |
- | fi | + | |
+ | # newer linux kernel - required for pi4/pi400 | ||
+ | echo " | ||
+ | fi | ||
+ | else | ||
+ | echo " | ||
+ | fi | ||
fi | fi | ||
+ | |||
# This is for minidesktop builds only | # This is for minidesktop builds only | ||
Line 404: | Line 469: | ||
# at files not being downloaded, disable these three entries. | # at files not being downloaded, disable these three entries. | ||
export https_proxy=$LB_APT_HTTP_PROXY | export https_proxy=$LB_APT_HTTP_PROXY | ||
- | | + | export http_proxy=$LB_APT_HTTP_PROXY |
export ftp_proxy=$LB_APT_FTP_PROXY | export ftp_proxy=$LB_APT_FTP_PROXY | ||
fi | fi | ||
Line 410: | Line 475: | ||
# This is part of our experimental ARM support | # This is part of our experimental ARM support | ||
# It is used when building for the ARM architecture (on Intel/AMD hardware and on ARM). | # It is used when building for the ARM architecture (on Intel/AMD hardware and on ARM). | ||
- | # It makes some necessary changes, and also tries to speed up squashfs creation when it | + | # It makes some necessary changes, and also tries to speed up squashfs creation when it |
# detects a crossbuild environment. | # detects a crossbuild environment. | ||
if echo $LBX2GO_ARCH | grep -q ' | if echo $LBX2GO_ARCH | grep -q ' | ||
Line 419: | Line 484: | ||
sed -e ' | sed -e ' | ||
- | | + | # This command removes the X2Go repository from the directory where additional |
- | # archives are stored. | + | # archives are stored. |
# packages, but Debian Buster does - so that's what we're falling back to. | # packages, but Debian Buster does - so that's what we're falling back to. | ||
echo " | echo " | ||
rm ./ | rm ./ | ||
- | | + | # The following is a hack to reduce squashfs creation time in a crossbuild environment. |
- | # We're replacing mksquashfs in the changeroot with a wrapper script that drops the | + | # We're replacing mksquashfs in the changeroot with a wrapper script that drops the |
- | # original mksquashfs call into a file. | + | # original mksquashfs call into a file. |
- | | + | if (uname -r | grep -q ' |
- | # We need to do this as a background task, waiting for the mksquashfs executable to | + | # We need to do this as a background task, waiting for the mksquashfs executable to |
- | # appear in the changeroot; as the changeroot will only be created later on, once | + | # appear in the changeroot; as the changeroot will only be created later on, once |
- | # lb build is called. | + | # lb build is called. |
+ | |||
+ | # The other background task waits until the command file has been created, then | ||
+ | # it applies some necessary patches to it, and starts the mksquashfs command natively | ||
+ | # on the build host, rather than in the changeroot environment. | ||
+ | # This is because in the changeroot, we'd be running the ARM mksquashfs in a qemu | ||
+ | # software emulation of the ARM architecture, | ||
+ | # native, raw CPU power and cores available to us. | ||
- | | + | # To make sure we don't have any lingering processes in the background, we're passing |
- | # it applies some necessary patches | + | # our own PID along to the background tasks, and tell them to terminate if our PID |
- | # on the build host, rather than in the changeroot environment. | + | # disappears while they're still in their waiting/ |
- | # This is because in the changeroot, we'd be running the ARM mksquashfs | + | |
- | # software emulation of the ARM architecture, | + | |
- | # native, raw CPU power and cores available to us. | + | |
- | # To make sure we don't have any lingering processes in the background, we're passing | + | MASTERPID=$$ |
- | # our own PID along to the background tasks, and tell them to terminate if our PID | + | |
- | # disappears while they' | + | |
- | | + | # Replace mksquashfs in chroot with script |
+ | # (script will undo this upon completion) | ||
+ | ( | ||
+ | # wait until the chroot has been populated or until our parent process dies | ||
+ | while ! [ -x ./ | ||
+ | ps $MASTERPID | ||
+ | sleep 1 | ||
+ | done | ||
+ | # make sure we don't overwrite the real executable if it has already been | ||
+ | # moved out of the way | ||
+ | if ! [ -x ./ | ||
+ | cp ./ | ||
+ | fi | ||
+ | echo '# | ||
+ | # log the name we've been called with and all parameters into this file | ||
+ | echo 'echo "$0 $@" >/ | ||
+ | # once the native mksquashfs is complete, we will remove this file | ||
+ | echo 'while [ -f / | ||
+ | echo ' | ||
+ | echo ' | ||
+ | # so let's wait until it has been removed before deleting ourselves ... | ||
+ | echo 'rm / | ||
+ | # ... and moving the real executable back into its place | ||
+ | echo 'mv / | ||
+ | chmod 755 ./ | ||
+ | ) & | ||
- | | + | # start the native |
- | # (script will undo this upon completion) | + | ( |
- | | + | |
- | # wait until the chroot | + | |
- | while ! [ -x ./chroot/usr/bin/ | + | ps $MASTERPID >/ |
- | ps $MASTERPID >/ | + | sleep 1 |
- | sleep 1 | + | |
- | done | + | |
- | # make sure we don't overwrite | + | |
- | # moved out of the way | + | # parameter completely |
- | if ! [ -x ./chroot/ | + | # also, all absolute paths (detected by beginning with " |
- | | + | # prefixed with "./chroot" so the mksquashfs |
- | fi | + | # to look for the corresponding paths/files. |
- | | + | sed -e 's/ -Xbcj x86/ /g' |
- | # log the name we've been called with and all parameters into this file | + | ./chroot/ |
- | echo 'echo "$0 $@" >/ | + | #needs switch from e.g. / |
- | | + | sed -e "s#^.*mksquashfs#$(which mksquashfs)# |
- | echo 'while [ -f / | + | ./chroot/ |
- | echo ' | + | |
- | echo ' | + | |
- | # so let' | + | |
- | echo 'rm / | + | |
- | # ... and moving the real executable | + | |
- | echo 'mv / | + | |
- | chmod 755 ./chroot/usr/bin/ | + | |
- | ) & | + | |
- | # start the native mksquashfs after patching the parameters | + | |
- | ( | + | |
- | # wait until the trigger file has been created or until our parent process dies | + | |
- | while ! [ -f ./ | + | |
- | ps $MASTERPID >/ | + | |
- | sleep 1 | + | |
- | done | + | |
- | # using any of the available filters (x86, arm, armthumb) for the | + | |
- | # -Xbcj command results in an unusable squashfs on arm, so we drop the | + | |
- | # parameter completely if it's there. | + | |
- | # also, all absolute paths (detected by beginning with " /") need to be | + | |
- | # prefixed with " | + | |
- | # to look for the corresponding paths/ | + | |
- | sed -e 's/ -Xbcj x86/ /g' -e 's# /# ./ | + | ) & |
- | ./ | + | fi |
- | #needs switch from e.g. / | + | |
- | sed -e " | + | |
- | ./ | + | |
- | # now let's make this executable | + | |
- | chmod 755 ./ | + | |
- | + | ||
- | | + | |
- | # in the squashfs - no idea why we don't need them while inside the chroot ... | + | |
- | echo ' | + | |
- | echo ' | + | |
- | echo ' | + | |
- | # now let's execute the script and, if it terminates without an error, | + | |
- | # we'll move the newly created squashfs into the chroot where the chrooted | + | |
- | # mksquashfs command would have created it; if that worked as well, we' | + | |
- | # remove the script file so our dummy mksquashfs inside the chroot knows | + | |
- | # it's time to terminate itself. | + | |
- | ./ | + | |
- | mv ./ | + | |
- | rm ./ | + | |
- | ) & | + | |
- | fi | + | |
fi | fi | ||
Line 525: | Line 590: | ||
# This is part of our experimental ARM support | # This is part of our experimental ARM support | ||
if [ " | if [ " | ||
- | | + | # after the build, let's determine the name of our image file ... |
- | IMAGEFILE=" | + | IMAGEFILE=" |
- | | + | # ... and change the partition type to reflect the file system actually in use for partition 1 |
- | # (" | + | # (" |
- | sfdisk --part-type $IMAGEFILE 1 b | + | sfdisk --part-type $IMAGEFILE 1 b |
- | | + | # next, we need to patch two things inside the image, so we need to set up a loop device for it. |
- | FREELOOP=$(losetup -f) # note that this could become a TOCTOU issue if more than 1 process tries to use loop devices | + | FREELOOP=$(losetup -f) # note that this could become a TOCTOU issue if more than 1 process tries to use loop devices |
- | | + | # as the image is a full disk image containing a partition, we need to jump to the position where the first partition starts |
- | losetup -o 1048576 $FREELOOP $IMAGEFILE | + | losetup -o 1048576 $FREELOOP $IMAGEFILE |
- | | + | # now let's mount it |
- | mkdir -p ./ | + | mkdir -p ./ |
- | mount $FREELOOP ./tempmount | + | mount $FREELOOP ./tempmount |
- | | + | # purge this dir, so we have enough space; we'll return to fill it later |
- | rm ./ | + | rm ./ |
- | | + | # first, we copy the contents of the boot/ |
- | # see if inplace helps against out of space errors | + | # see if inplace helps against out of space errors |
- | rsync -aP --inplace ./ | + | rsync -aP --inplace ./ |
- | | + | mkdir -p ./ |
- | rsync -aP ./ | + | rsync -aP ./ |
- | | + | # next, we replace the " |
- | sed -e ' | + | sed -e ' |
- | | + | # here comes the cleanup part |
- | sync | + | sync |
- | umount $FREELOOP | + | umount $FREELOOP |
- | losetup -d $FREELOOP | + | losetup -d $FREELOOP |
- | rmdir ./ | + | rmdir ./ |
- | fi | + | fi |
if [ " | if [ " | ||
Line 982: | Line 1047: | ||
* '' | * '' | ||
* '' | * '' | ||
+ | * '' | ||
* '' | * '' | ||
* '' | * '' | ||
Line 999: | Line 1065: | ||
* '' | * '' | ||
+ | ===== Client Branding/ | ||
+ | It is possible to make X2Go-TCE-Live match your Corporate Design/ | ||
+ | This is actually a feature of X2GoClient itself, so it will also work on //fat client// installations, | ||
+ | |||
+ | You can find a more detailed explanation in the [[wiki: | ||
===== Querying X2Go-TCE version info ===== | ===== Querying X2Go-TCE version info ===== | ||
images built using the https:// | images built using the https:// |