Discussion:
[X2Go-Dev] [X2Go-Commits] [x2gothinclient] 01/01: let user choose architecture by setting TC_ARCH variable. Default amd64.
Mike Gabriel
2018-02-28 15:26:59 UTC
Permalink
Hi Alex,

unless you have proper reason for selection the 4.9.0-4 kernel, I'd
rather suggest to pick the generic package

e.g. for amd64
https://packages.debian.org/stretch/linux-image-amd64

This pulls in the always newest kernel, which currently is 4.9.0-6
(containing meltdown and spectre fixes, which are not shipped in the
-4 kernel).

Mike
This is an automated email from the git hooks/post-receive script.
x2go pushed a commit to branch master
in repository x2gothinclient.
commit 31db9fbda0fa546494554fc4499fb5fd586af29b
Date: Wed Feb 28 13:14:26 2018 +0100
let user choose architecture by setting TC_ARCH variable. Default amd64.
---
debian/changelog | 1 +
management/etc/x2gothinclient_settings | 5 +++++
management/sbin/x2gothinclient_create | 24 ++++++++++++++++++------
management/sbin/x2gothinclient_preptftpboot | 18 +++++++++++++++---
management/share/tftpboot/x2go-tce.cfg | 4 ++--
5 files changed, 41 insertions(+), 11 deletions(-)
diff --git a/debian/changelog b/debian/changelog
index 4dfd269..e4420b9 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -144,6 +144,7 @@ x2gothinclient (1.5.0.0-0x2go1) UNRELEASED; urgency=low
* fix link in x2gothinclient_create
* install chroot for amd64
* fix x2gothinclient_update to create files needed by x2gothinclientd
+ * let user choose architecture by setting TC_ARCH variable. Default amd64.
[ Martti PitkÀnen ]
diff --git a/management/etc/x2gothinclient_settings
b/management/etc/x2gothinclient_settings
index a0f6530..fc7f995 100644
--- a/management/etc/x2gothinclient_settings
+++ b/management/etc/x2gothinclient_settings
@@ -47,6 +47,10 @@ TC_DISTRO_CODENAME="stretch"
# or use older Debian ...
#TC_DISTRO_CODENAME="jessie"
+# Default architecture is "amd64"
+TC_ARCH="amd64"
+#TC_ARCH="i386"
+
# Retrieve X2Go packages from this URL
### FIXME: once we release this project, we have to remove the
heuler area from the deburl below!!!! ###
TC_X2GO_DEBURL="deb http://packages.x2go.org/debian
$TC_DISTRO_CODENAME main heuler"
@@ -82,6 +86,7 @@ echo "TC_CONFIG=$TC_CONFIG"
echo "TC_CHROOT=$TC_CHROOT"
echo "TC_SHELL=$TC_SHELL"
echo "TC_DISTRO_CODENAME=$TC_DISTRO_CODENAME"
+echo "TC_ARCH=$TC_ARCH"
echo "TC_DEBMIRROR_URL=$TC_DEBMIRROR_URL"
echo "TC_X2GO_DEBURL=$TC_X2GO_DEBURL"
echo "TC_HTTP_PROXY=$TC_HTTP_PROXY"
diff --git a/management/sbin/x2gothinclient_create
b/management/sbin/x2gothinclient_create
index 0ffb199..204a4a5 100755
--- a/management/sbin/x2gothinclient_create
+++ b/management/sbin/x2gothinclient_create
@@ -51,6 +51,18 @@ TC_MODULE_BLACKLIST="${TC_MODULE_BLACKLIST:-'pcspkr'}"
TC_NONINTERACTIVE="${TC_NONINTERACTIVE:-}"
TC_FLAVOUR="${TC_FLAVOUR:-displaymanager}"
+if [ "$TC_ARCH" == "amd64" ]
+then
+ ARCHSTR=""
+ KERNEL_VERSION="4.9.0-4-amd64"
+fi
+
+if [ "$TC_ARCH" == "i386" ]
+then
+ ARCHSTR="--arch i386"
+ KERNEL_VERSION="4.9.0-4-686"
+fi
+
if [ "x$TC_FLAVOUR" != "xminidesktop" ] && [ "x$TC_FLAVOUR" !=
"xdisplaymanager" ]; then
TC_FLAVOUR="displaymanager"
fi
@@ -105,7 +117,7 @@ export http_proxy="$TC_HTTP_PROXY"
export https_proxy="$TC_HTTPS_PROXY"
export ftp_proxy="$TC_FTP_PROXY"
-debootstrap "$TC_DISTRO_CODENAME" "$TC_CHROOT/" "$TC_DEBMIRROR_URL"
+debootstrap $ARCHSTR "$TC_DISTRO_CODENAME" "$TC_CHROOT/" "$TC_DEBMIRROR_URL"
cp /etc/resolv.conf "$TC_CHROOT/etc/resolv.conf"
if [ "$TC_DISTRO_CODENAME" = "squeeze" ]; then
@@ -199,11 +211,11 @@ export X2GO_HANDLE_DAEMONS=false
if [ \$? -eq 0 -a "x${TC_NONINTERACTIVE}" != "x" ]; then
dpkg-reconfigure locales
fi
-[ \$? -eq 0 ] && apt-get install linux-image-4.9.0-4-amd64 -y
-[ \$? -eq 0 ] && test -h /vmlinuz && mv /vmlinuz
/vmlinuz.4.9.0-4-amd64.tmp || true
-[ \$? -eq 0 ] && LINK_TARGET=\$(readlink /vmlinuz.4.9.0-4-amd64.tmp
/vmlinuz.4.9.0-4-amd64 && rm -f /vmlinuz.4.9.0-4-amd64.tmp
-[ \$? -eq 0 ] && test -h /initrd.img && mv /initrd.img
/initrd.img.4.9.0-4-amd64.tmp || true
-[ \$? -eq 0 ] && LINK_TARGET=\$(readlink
\$LINK_TARGET /initrd.img.4.9.0-4-amd64 && rm -f
/initrd.img.4.9.0-4-amd64.tmp
+[ \$? -eq 0 ] && apt-get install linux-image-$KERNEL_VERSION -y
+[ \$? -eq 0 ] && test -h /vmlinuz && mv /vmlinuz
/vmlinuz.$KERNEL_VERSION.tmp || true
+[ \$? -eq 0 ] && LINK_TARGET=\$(readlink
\$LINK_TARGET /vmlinuz.$KERNEL_VERSION && rm -f
/vmlinuz.$KERNEL_VERSION.tmp
+[ \$? -eq 0 ] && test -h /initrd.img && mv /initrd.img
/initrd.img.$KERNEL_VERSION.tmp || true
+[ \$? -eq 0 ] && LINK_TARGET=\$(readlink
\$LINK_TARGET /initrd.img.$KERNEL_VERSION && rm -f
/initrd.img.$KERNEL_VERSION.tmp
[ \$? -eq 0 ] && apt-get install x2gothinclient-chroot
x2gothinclient-${TC_FLAVOUR} -y --force-yes
diff --git a/management/sbin/x2gothinclient_preptftpboot
b/management/sbin/x2gothinclient_preptftpboot
index 8b3493a..98a2ab9 100755
--- a/management/sbin/x2gothinclient_preptftpboot
+++ b/management/sbin/x2gothinclient_preptftpboot
@@ -65,9 +65,21 @@ echo
echo "Linking files for X2Go's TFTP (syslinux) boot environment..."
cd "$TC_TFTP_BOOT"
-# amd64 kernel image
-ln -sfv "$TC_CHROOT/vmlinuz.4.9.0-4-amd64" "$TC_TFTP_BOOT/vmlinuz.amd64"
-ln -sfv "$TC_CHROOT/initrd.img.4.9.0-4-amd64"
"$TC_TFTP_BOOT/initrd.img.amd64"
+
+if [ "$TC_ARCH" == "amd64" ]
+then
+ KERNEL_VERSION="4.9.0-4-amd64"
+fi
+
+if [ "$TC_ARCH" == "i386" ]
+then
+ KERNEL_VERSION="4.9.0-4-686"
+fi
+
+
+# kernel image
+ln -sfv "$TC_CHROOT/vmlinuz.$KERNEL_VERSION" "$TC_TFTP_BOOT/vmlinuz"
+ln -sfv "$TC_CHROOT/initrd.img.$KERNEL_VERSION" "$TC_TFTP_BOOT/initrd.img"
# memtest86+
ln -sfv "$TC_CHROOT/boot/memtest86+.bin" "$TC_TFTP_BOOT/memtest86+.bin"
# syslinux components
diff --git a/management/share/tftpboot/x2go-tce.cfg
b/management/share/tftpboot/x2go-tce.cfg
index 365f385..137f73d 100644
--- a/management/share/tftpboot/x2go-tce.cfg
+++ b/management/share/tftpboot/x2go-tce.cfg
@@ -1,4 +1,4 @@
LABEL x2go-tce
MENU LABEL X2Go ^Thin Client
- KERNEL vmlinuz.amd64
- APPEND initrd=initrd.img.amd64
nfsroot=/opt/x2gothinclient/chroot boot=nfs ro quiet nomodeset splash
+ KERNEL vmlinuz
+ APPEND initrd=initrd.img nfsroot=/opt/x2gothinclient/chroot
boot=nfs ro quiet nomodeset splash
--
Alioth's
/home/x2go-admin/maintenancescripts/git/hooks/post-receive-email on
/srv/git/code.x2go.org/x2gothinclient.git
_______________________________________________
x2go-commits mailing list
https://lists.x2go.org/listinfo/x2go-commits
--
DAS-NETZWERKTEAM
mike gabriel, herweg 7, 24357 fleckeby
mobile: +49 (1520) 1976 148
landline: +49 (4354) 8390 139

GnuPG Fingerprint: 9BFB AEE8 6C0A A5FF BF22 0782 9AF4 6B30 2577 1B31
mail: ***@das-netzwerkteam.de, http://das-netzwerkteam.de
Oleksandr Shneyder
2018-03-02 09:13:06 UTC
Permalink
Hi Mike,

thanks for the hint, I'll take a look.

Regards
Alex
Post by Mike Gabriel
Hi Alex,
unless you have proper reason for selection the 4.9.0-4 kernel, I'd
rather suggest to pick the generic package
  e.g. for amd64
  https://packages.debian.org/stretch/linux-image-amd64
This pulls in the always newest kernel, which currently is 4.9.0-6
(containing meltdown and spectre fixes, which are not shipped in the -4
kernel).
Mike
This is an automated email from the git hooks/post-receive script.
x2go pushed a commit to branch master
in repository x2gothinclient.
commit 31db9fbda0fa546494554fc4499fb5fd586af29b
Date:   Wed Feb 28 13:14:26 2018 +0100
    let user choose architecture by setting TC_ARCH variable. Default
amd64.
---
 debian/changelog                            |  1 +
 management/etc/x2gothinclient_settings      |  5 +++++
 management/sbin/x2gothinclient_create       | 24
++++++++++++++++++------
 management/sbin/x2gothinclient_preptftpboot | 18 +++++++++++++++---
 management/share/tftpboot/x2go-tce.cfg      |  4 ++--
 5 files changed, 41 insertions(+), 11 deletions(-)
diff --git a/debian/changelog b/debian/changelog
index 4dfd269..e4420b9 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -144,6 +144,7 @@ x2gothinclient (1.5.0.0-0x2go1) UNRELEASED; urgency=low
   * fix link in x2gothinclient_create
   * install chroot for amd64
   * fix x2gothinclient_update to create files needed by x2gothinclientd
+  * let user choose architecture by setting TC_ARCH variable. Default
amd64.
   [ Martti PitkÀnen ]
diff --git a/management/etc/x2gothinclient_settings
b/management/etc/x2gothinclient_settings
index a0f6530..fc7f995 100644
--- a/management/etc/x2gothinclient_settings
+++ b/management/etc/x2gothinclient_settings
@@ -47,6 +47,10 @@ TC_DISTRO_CODENAME="stretch"
 # or use older Debian ...
 #TC_DISTRO_CODENAME="jessie"
+# Default architecture is "amd64"
+TC_ARCH="amd64"
+#TC_ARCH="i386"
+
 # Retrieve X2Go packages from this URL
 ### FIXME: once we release this project, we have to remove the heuler
area from the deburl below!!!! ###
 TC_X2GO_DEBURL="deb http://packages.x2go.org/debian
$TC_DISTRO_CODENAME main heuler"
@@ -82,6 +86,7 @@ echo "TC_CONFIG=$TC_CONFIG"
 echo "TC_CHROOT=$TC_CHROOT"
 echo "TC_SHELL=$TC_SHELL"
 echo "TC_DISTRO_CODENAME=$TC_DISTRO_CODENAME"
+echo "TC_ARCH=$TC_ARCH"
 echo "TC_DEBMIRROR_URL=$TC_DEBMIRROR_URL"
 echo "TC_X2GO_DEBURL=$TC_X2GO_DEBURL"
 echo "TC_HTTP_PROXY=$TC_HTTP_PROXY"
diff --git a/management/sbin/x2gothinclient_create
b/management/sbin/x2gothinclient_create
index 0ffb199..204a4a5 100755
--- a/management/sbin/x2gothinclient_create
+++ b/management/sbin/x2gothinclient_create
@@ -51,6 +51,18 @@ TC_MODULE_BLACKLIST="${TC_MODULE_BLACKLIST:-'pcspkr'}"
 TC_NONINTERACTIVE="${TC_NONINTERACTIVE:-}"
 TC_FLAVOUR="${TC_FLAVOUR:-displaymanager}"
+if [ "$TC_ARCH" == "amd64" ]
+then
+  ARCHSTR=""
+  KERNEL_VERSION="4.9.0-4-amd64"
+fi
+
+if [ "$TC_ARCH" == "i386" ]
+then
+  ARCHSTR="--arch i386"
+  KERNEL_VERSION="4.9.0-4-686"
+fi
+
 if [ "x$TC_FLAVOUR" != "xminidesktop" ] && [ "x$TC_FLAVOUR" !=
"xdisplaymanager" ]; then
     TC_FLAVOUR="displaymanager"
 fi
@@ -105,7 +117,7 @@ export http_proxy="$TC_HTTP_PROXY"
 export https_proxy="$TC_HTTPS_PROXY"
 export ftp_proxy="$TC_FTP_PROXY"
-debootstrap "$TC_DISTRO_CODENAME" "$TC_CHROOT/" "$TC_DEBMIRROR_URL"
+debootstrap $ARCHSTR "$TC_DISTRO_CODENAME" "$TC_CHROOT/"
"$TC_DEBMIRROR_URL"
 cp /etc/resolv.conf "$TC_CHROOT/etc/resolv.conf"
 if [ "$TC_DISTRO_CODENAME" = "squeeze" ]; then
@@ -199,11 +211,11 @@ export X2GO_HANDLE_DAEMONS=false
 if [ \$? -eq 0 -a "x${TC_NONINTERACTIVE}" != "x" ]; then
     dpkg-reconfigure locales
 fi
-[ \$? -eq 0 ] && apt-get install linux-image-4.9.0-4-amd64 -y
-[ \$? -eq 0 ] && test -h /vmlinuz && mv /vmlinuz
/vmlinuz.4.9.0-4-amd64.tmp || true
-[ \$? -eq 0 ] && LINK_TARGET=\$(readlink /vmlinuz.4.9.0-4-amd64.tmp |
rm -f /vmlinuz.4.9.0-4-amd64.tmp
-[ \$? -eq 0 ] && test -h /initrd.img && mv /initrd.img
/initrd.img.4.9.0-4-amd64.tmp || true
-[ \$? -eq 0 ] && LINK_TARGET=\$(readlink
\$LINK_TARGET /initrd.img.4.9.0-4-amd64 && rm -f
/initrd.img.4.9.0-4-amd64.tmp
+[ \$? -eq 0 ] && apt-get install linux-image-$KERNEL_VERSION -y
+[ \$? -eq 0 ] && test -h /vmlinuz && mv /vmlinuz
/vmlinuz.$KERNEL_VERSION.tmp || true
+[ \$? -eq 0 ] && LINK_TARGET=\$(readlink /vmlinuz.$KERNEL_VERSION.tmp
/vmlinuz.$KERNEL_VERSION && rm -f /vmlinuz.$KERNEL_VERSION.tmp
+[ \$? -eq 0 ] && test -h /initrd.img && mv /initrd.img
/initrd.img.$KERNEL_VERSION.tmp || true
+[ \$? -eq 0 ] && LINK_TARGET=\$(readlink
\$LINK_TARGET /initrd.img.$KERNEL_VERSION && rm -f
/initrd.img.$KERNEL_VERSION.tmp
 [ \$? -eq 0 ] && apt-get install x2gothinclient-chroot
x2gothinclient-${TC_FLAVOUR} -y --force-yes
diff --git a/management/sbin/x2gothinclient_preptftpboot
b/management/sbin/x2gothinclient_preptftpboot
index 8b3493a..98a2ab9 100755
--- a/management/sbin/x2gothinclient_preptftpboot
+++ b/management/sbin/x2gothinclient_preptftpboot
@@ -65,9 +65,21 @@ echo
 echo "Linking files for X2Go's TFTP (syslinux) boot environment..."
 cd "$TC_TFTP_BOOT"
-# amd64 kernel image
-ln -sfv "$TC_CHROOT/vmlinuz.4.9.0-4-amd64" "$TC_TFTP_BOOT/vmlinuz.amd64"
-ln -sfv "$TC_CHROOT/initrd.img.4.9.0-4-amd64"
"$TC_TFTP_BOOT/initrd.img.amd64"
+
+if [ "$TC_ARCH" == "amd64" ]
+then
+  KERNEL_VERSION="4.9.0-4-amd64"
+fi
+
+if [ "$TC_ARCH" == "i386" ]
+then
+  KERNEL_VERSION="4.9.0-4-686"
+fi
+
+
+# kernel image
+ln -sfv "$TC_CHROOT/vmlinuz.$KERNEL_VERSION" "$TC_TFTP_BOOT/vmlinuz"
+ln -sfv "$TC_CHROOT/initrd.img.$KERNEL_VERSION"
"$TC_TFTP_BOOT/initrd.img"
 # memtest86+
 ln -sfv "$TC_CHROOT/boot/memtest86+.bin" "$TC_TFTP_BOOT/memtest86+.bin"
 # syslinux components
diff --git a/management/share/tftpboot/x2go-tce.cfg
b/management/share/tftpboot/x2go-tce.cfg
index 365f385..137f73d 100644
--- a/management/share/tftpboot/x2go-tce.cfg
+++ b/management/share/tftpboot/x2go-tce.cfg
@@ -1,4 +1,4 @@
 LABEL x2go-tce
         MENU LABEL  X2Go ^Thin Client
-        KERNEL vmlinuz.amd64
-        APPEND initrd=initrd.img.amd64
nfsroot=/opt/x2gothinclient/chroot boot=nfs ro quiet nomodeset splash
+        KERNEL vmlinuz
+        APPEND initrd=initrd.img nfsroot=/opt/x2gothinclient/chroot
boot=nfs ro quiet nomodeset splash
--
Alioth's
/home/x2go-admin/maintenancescripts/git/hooks/post-receive-email on
/srv/git/code.x2go.org/x2gothinclient.git
_______________________________________________
x2go-commits mailing list
https://lists.x2go.org/listinfo/x2go-commits
_______________________________________________
x2go-dev mailing list
https://lists.x2go.org/listinfo/x2go-dev
--
-----------------------------------------------------------
Oleksandr Shneyder | Email: ***@phoca-gmbh.de
phoca GmbH | Tel. : 0911 - 14870374 0
Harzstr. 4 | Fax. : 0911 - 14870374 9
D-90491 NÃŒrnberg | Mobil: 0163 - 49 64 461

GeschÀftsfÌhrung:
Dipl.-Inf. Oleksandr Shneyder

Amtsgericht MÃŒnchen | http://www.phoca-gmbh.de
HRB 196 658 | http://www.x2go.org
USt-IdNr.: DE281977973
-----------------------------------------------------------
Loading...