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 [2019/09/18 19:29] stefanbaur [Configuring the Build] updated configuration for experimental ARM support |
doc:howto:tce [2019/11/14 00:37] stefanbaur [Configuring the Build] |
||
---|---|---|---|
Line 44: | Line 44: | ||
# we have a successful connect on port 3142, assume | # we have a successful connect on port 3142, assume | ||
# it's apt-cacher-ng and use it | # it's apt-cacher-ng and use it | ||
- | # | + | |
if nc -z 127.0.0.1 3142 ; then | if nc -z 127.0.0.1 3142 ; then | ||
# bad idea with apt-cacher-ng, | # bad idea with apt-cacher-ng, | ||
Line 97: | Line 97: | ||
# set boot loader type - leave this unchanged unless you really know what you're doing | # set boot loader type - leave this unchanged unless you really know what you're doing | ||
- | if echo $LBX2GO_ARCH | awk ' | + | if echo "$LBX2GO_ARCH" |
# This is part of our experimental ARM support | # This is part of our experimental ARM support | ||
LBX2GO_BOOTLOADERPARAMNAME=" | LBX2GO_BOOTLOADERPARAMNAME=" | ||
Line 138: | Line 138: | ||
# This is part of our experimental ARM support | # This is part of our experimental ARM support | ||
- | if echo "$LB_X2GO_ARCH" | grep -q ' | + | if echo "$LBX2GO_ARCH" | grep -q ' |
export LBX2GO_DEFAULTS+=" | export LBX2GO_DEFAULTS+=" | ||
--bootstrap-qemu-static / | --bootstrap-qemu-static / | ||
Line 208: | Line 208: | ||
# Set Directory name | # Set Directory name | ||
- | LBX2GO_TCEDIR=" | + | LBX2GO_TCEDIR=" |
if [ -z " | if [ -z " | ||
Line 257: | Line 257: | ||
if [ -f config/ | if [ -f config/ | ||
if [ -n " | if [ -n " | ||
- | for LBX2GO_SINGLE_LANG in $(echo $LBX2GO_LANG | tr ';' | + | for LBX2GO_SINGLE_LANG in $(echo |
echo "LANG: ' | echo "LANG: ' | ||
sed -i -e ' | sed -i -e ' | ||
Line 275: | Line 275: | ||
chmod 755 ./ | chmod 755 ./ | ||
fi | fi | ||
+ | |||
+ | if [ -n " | ||
+ | echo " | ||
+ | echo " | ||
+ | echo " | ||
+ | # Here, we should have reached a point where it is safe to point all proxy variables | ||
+ | # at the apt-cacher-ng proxy. | ||
+ | # at files not being downloaded, disable these three entries. | ||
+ | export https_proxy=$LB_APT_HTTP_PROXY | ||
+ | export http_proxy=$LB_APT_HTTP_PROXY | ||
+ | export ftp_proxy=$LB_APT_FTP_PROXY | ||
+ | fi | ||
+ | |||
+ | # This is a crude hack to detect crossbuilds for ARM on Intel/AMD hardware. | ||
+ | # It makes some necessary changes, and also tries to speed up squashfs creation. | ||
+ | if (uname -r | grep -q ' | ||
+ | echo " | ||
+ | |||
+ | # This command removes all references to fuseext and x2gothinclient from the | ||
+ | # package list files. | ||
+ | echo " | ||
+ | sed -e ' | ||
+ | |||
+ | # This command removes the X2Go repository from the directory where additional | ||
+ | # archives are stored. | ||
+ | # packages, but Debian Buster does - so that's what we're falling back to. | ||
+ | echo " | ||
+ | rm ./ | ||
+ | |||
+ | # The following is a hack to reduce squashfs creation time. We're replacing mksquashfs | ||
+ | # in the changeroot environment with a wrapper script that drops the original | ||
+ | # mksquashfs call into a file. | ||
+ | |||
+ | # 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 | ||
+ | # 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 | ||
+ | # our own PID along to the background tasks, and tell them to terminate if our PID | ||
+ | # disappears while they' | ||
+ | |||
+ | MASTERPID=$$ | ||
+ | |||
+ | # 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 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# /# ./ | ||
+ | ./ | ||
+ | # now let's make this executable | ||
+ | chmod 755 ./ | ||
+ | |||
+ | # we also need to add some more excludes because they shouldn' | ||
+ | # 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'll | ||
+ | # remove the script file so our dummy mksquashfs inside the chroot knows | ||
+ | # it's time to terminate itself. | ||
+ | ./ | ||
+ | mv ./ | ||
+ | rm ./ | ||
+ | ) & | ||
+ | fi | ||
+ | |||
if lb build ; then | if lb build ; then | ||
echo -e "Build is done: ' | echo -e "Build is done: ' | ||
Line 282: | Line 393: | ||
if [ " | if [ " | ||
- | ln ./ | + | ln ./ |
- | | + | |
fi | fi | ||
if [ " | if [ " | ||
Line 296: | Line 407: | ||
if [ " | if [ " | ||
genisoimage -o ./ | genisoimage -o ./ | ||
- | if [ -e ./ | + | if [ -e ./ |
- | ln ./ | + | ln ./ |
- | | + | |
- | elif [ -e ./ | + | elif [ -e ./ |
- | ln ./ | + | ln ./ |
- | | + | |
fi | fi | ||
mv ./ | mv ./ |