Thinstation / thinstation

A framework for making thin and light Linux based images for x86 based machines and thinclients.
https://www.thinstation.net/
788 stars 188 forks source link

The package is built but does not start after loading #710

Closed AlexanderZhirov closed 2 years ago

AlexanderZhirov commented 2 years ago

I have a compiled project (there are no sources). On my PC it runs, it looks like this:

изображение изображение изображение изображение

I think it's an add-on over FreeRDP. I wanted to run this application after downloading the thin client.

[root@TS_chroot]/ts/ports/components/mstsc# pkgmk -d
=======> Package '/ts/ports/components/mstsc/mstsc#1.0-1.pkg.tar.xz' is up to date.

file Pkgfile:

name=mstsc
version=1.0
release=1
#source=($name-$version.tar.xz)
build() {
    cd $name-$version
    cp -R usr $PKG/
}
[root@TS_chroot]/ts/build/packages/mstsc# ls -l
total 12
drwxr-xr-x 2 root root 4096 Apr 15 13:10 bin
drwxr-xr-x 2 root root 4096 Apr 15 13:10 build
-rw-r--r-- 1 root root    0 Apr 15 13:04 dependencies
drwxr-xr-x 2 root root 4096 Apr 15 13:10 lib

I created a package. All dependencies are installed. However, it gives an error when calling ldd.

[root@TS_chroot]/# ldd /usr/bin/mstsc 
/usr/bin/mstsc: /lib/libc.so.6: version `GLIBC_2.33' not found (required by /usr/lib/libcrypto.so.1.0.0)
/usr/bin/mstsc: /lib/libc.so.6: version `GLIBC_2.34' not found (required by /usr/lib/libcrypto.so.1.0.0)
    linux-vdso.so.1 (0x00007ffc345de000)
    libfltk.so.1.3 => /usr/lib/libfltk.so.1.3 (0x00007ffb974ec000)
    libfltk_images.so.1.3 => /usr/lib/libfltk_images.so.1.3 (0x00007ffb974dd000)
    libX11.so.6 => /usr/lib/libX11.so.6 (0x00007ffb97399000)
    libXinerama.so.1 => /usr/lib/libXinerama.so.1 (0x00007ffb97394000)
    libstdc++.so.6 => /usr/lib/libstdc++.so.6 (0x00007ffb971c6000)
    libz.so.1 => /lib/libz.so.1 (0x00007ffb971ac000)
    libpng16.so.16 => /usr/lib/libpng16.so.16 (0x00007ffb97171000)
    libgd.so.3 => /usr/lib/libgd.so.3 (0x00007ffb97106000)
    libm.so.6 => /lib/libm.so.6 (0x00007ffb96fc1000)
    libXrender.so.1 => /usr/lib/libXrender.so.1 (0x00007ffb96fb4000)
    libXrandr.so.2 => /usr/lib/libXrandr.so.2 (0x00007ffb96fa7000)
    libXcursor.so.1 => /usr/lib/libXcursor.so.1 (0x00007ffb96f9a000)
    libXfixes.so.3 => /usr/lib/libXfixes.so.3 (0x00007ffb96f8f000)
    libXext.so.6 => /usr/lib/libXext.so.6 (0x00007ffb96f7a000)
    libXi.so.6 => /usr/lib/libXi.so.6 (0x00007ffb96f67000)
    libpthread.so.0 => /lib/libpthread.so.0 (0x00007ffb96f46000)
    libdl.so.2 => /lib/libdl.so.2 (0x00007ffb96f40000)
    librt.so.1 => /lib/librt.so.1 (0x00007ffb96f35000)
    libssl.so.1.0.0 => /usr/lib/libssl.so.1.0.0 (0x00007ffb96ec3000)
    libcrypto.so.1.0.0 => /usr/lib/libcrypto.so.1.0.0 (0x00007ffb96c6b000)
    libxkbfile.so.1 => /usr/lib/libxkbfile.so.1 (0x00007ffb96c43000)
    libasound.so.2 => /usr/lib/libasound.so.2 (0x00007ffb96b43000)
    libgcc_s.so.1 => /usr/lib/libgcc_s.so.1 (0x00007ffb96b29000)
    libc.so.6 => /lib/libc.so.6 (0x00007ffb9695f000)
    /lib64/ld-linux-x86-64.so.2 => /lib/ld-linux-x86-64.so.2 (0x00007ffb97630000)
    libXft.so.2 => /usr/lib/libXft.so.2 (0x00007ffb96944000)
    libfontconfig.so.1 => /usr/lib/libfontconfig.so.1 (0x00007ffb968fc000)
    libjpeg.so.8 => /usr/lib/libjpeg.so.8 (0x00007ffb96864000)
    libxcb.so.1 => /usr/lib/libxcb.so.1 (0x00007ffb96839000)
    libXau.so.6 => /usr/lib/libXau.so.6 (0x00007ffb96834000)
    libXdmcp.so.6 => /usr/lib/libXdmcp.so.6 (0x00007ffb9682c000)
    libbsd.so.0 => /usr/lib/libbsd.so.0 (0x00007ffb96811000)
    libfreetype.so.6 => /usr/lib/libfreetype.so.6 (0x00007ffb96750000)
    libXpm.so.4 => /usr/lib/libXpm.so.4 (0x00007ffb9673c000)
    libtiff.so.5 => /usr/lib/libtiff.so.5 (0x00007ffb966be000)
    libwebp.so.7 => /usr/lib/libwebp.so.7 (0x00007ffb9664f000)
    libexpat.so.1 => /usr/lib/libexpat.so.1 (0x00007ffb96620000)
    libuuid.so.1 => /lib/libuuid.so.1 (0x00007ffb96617000)
    libglib-2.0.so.0 => /usr/lib/libglib-2.0.so.0 (0x00007ffb964eb000)
    libbz2.so.1.0 => /usr/lib/libbz2.so.1.0 (0x00007ffb964d8000)
    libharfbuzz.so.0 => /usr/lib/libharfbuzz.so.0 (0x00007ffb963f1000)
    libgraphite2.so.3 => /usr/lib/libgraphite2.so.3 (0x00007ffb963c8000)
    libzstd.so.1 => /usr/lib/libzstd.so.1 (0x00007ffb96320000)
    liblzma.so.5 => /usr/lib/liblzma.so.5 (0x00007ffb962f7000)
    libpcre.so.1 => /lib/libpcre.so.1 (0x00007ffb96284000)

But after downloading, it gives this message:

изображение

build.conf enabled this package:

...
package mstsc
...

thinstation.conf.buildtime

SESSION_0_TYPE=mstsc
SESSION_0_AUTOSTART=on

NO_SESSION="shutdown"

NET_USE=BOTH
NET_USE_DHCP=on
NET_HOSTNAME=ts_*

TIME_ZONE=America/Los_Angeles

BIND_MOUNT0="home:/root"
BIND_MOUNT1="boot:/boot"

USB_STORAGE_SYNC=on
BASE_MOUNT_PATH=/media
USB_MOUNT_DIR="."
#USB_MOUNT_OPTIONS="gid=1000,uid=1000"

GTK_THEME=Adwaita
ICONS_THEME=Adwaita
ICONS_CUT_SIZES="8x8 22x22 24x24 48x48 36x36 96x96 192x192 512x512 72x72 128x128 64x64 256x256 scalable"
AlexanderZhirov commented 2 years ago

UPD

I downloaded the correct libraries libcrypto.so.1.0.0 and libssl.so.1.0.0 and now the dependencies are correct, there are no errors:

[root@TS_chroot]/build# mstsc 
No protocol specified
display not found

[root@TS_chroot]/build# ldd /usr/bin/mstsc 
    linux-vdso.so.1 (0x00007fffdbfd5000)
    libfltk.so.1.3 => /usr/lib/libfltk.so.1.3 (0x00007f7eb3f9d000)
    libfltk_images.so.1.3 => /usr/lib/libfltk_images.so.1.3 (0x00007f7eb3f8e000)
    libX11.so.6 => /usr/lib/libX11.so.6 (0x00007f7eb3e4a000)
    libXinerama.so.1 => /usr/lib/libXinerama.so.1 (0x00007f7eb3e45000)
    libstdc++.so.6 => /usr/lib/libstdc++.so.6 (0x00007f7eb3c77000)
    libz.so.1 => /lib/libz.so.1 (0x00007f7eb3c5d000)
    libpng16.so.16 => /usr/lib/libpng16.so.16 (0x00007f7eb3c22000)
    libgd.so.3 => /usr/lib/libgd.so.3 (0x00007f7eb3bb7000)
    libm.so.6 => /lib/libm.so.6 (0x00007f7eb3a72000)
    libXrender.so.1 => /usr/lib/libXrender.so.1 (0x00007f7eb3a65000)
    libXrandr.so.2 => /usr/lib/libXrandr.so.2 (0x00007f7eb3a58000)
    libXcursor.so.1 => /usr/lib/libXcursor.so.1 (0x00007f7eb3a4b000)
    libXfixes.so.3 => /usr/lib/libXfixes.so.3 (0x00007f7eb3a40000)
    libXext.so.6 => /usr/lib/libXext.so.6 (0x00007f7eb3a2b000)
    libXi.so.6 => /usr/lib/libXi.so.6 (0x00007f7eb3a18000)
    libpthread.so.0 => /lib/libpthread.so.0 (0x00007f7eb39f7000)
    libdl.so.2 => /lib/libdl.so.2 (0x00007f7eb39f1000)
    librt.so.1 => /lib/librt.so.1 (0x00007f7eb39e6000)
    libssl.so.1.0.0 => /usr/lib/libssl.so.1.0.0 (0x00007f7eb3775000)
    libcrypto.so.1.0.0 => /usr/lib/libcrypto.so.1.0.0 (0x00007f7eb330a000)
    libxkbfile.so.1 => /usr/lib/libxkbfile.so.1 (0x00007f7eb32e2000)
    libasound.so.2 => /usr/lib/libasound.so.2 (0x00007f7eb31e2000)
    libgcc_s.so.1 => /usr/lib/libgcc_s.so.1 (0x00007f7eb31c8000)
    libc.so.6 => /lib/libc.so.6 (0x00007f7eb2ffe000)
    /lib64/ld-linux-x86-64.so.2 => /lib/ld-linux-x86-64.so.2 (0x00007f7eb40e1000)
    libXft.so.2 => /usr/lib/libXft.so.2 (0x00007f7eb2fe3000)
    libfontconfig.so.1 => /usr/lib/libfontconfig.so.1 (0x00007f7eb2f9b000)
    libjpeg.so.8 => /usr/lib/libjpeg.so.8 (0x00007f7eb2f03000)
    libxcb.so.1 => /usr/lib/libxcb.so.1 (0x00007f7eb2ed8000)
    libXau.so.6 => /usr/lib/libXau.so.6 (0x00007f7eb2ed3000)
    libXdmcp.so.6 => /usr/lib/libXdmcp.so.6 (0x00007f7eb2ecb000)
    libbsd.so.0 => /usr/lib/libbsd.so.0 (0x00007f7eb2eb0000)
    libfreetype.so.6 => /usr/lib/libfreetype.so.6 (0x00007f7eb2def000)
    libXpm.so.4 => /usr/lib/libXpm.so.4 (0x00007f7eb2ddb000)
    libtiff.so.5 => /usr/lib/libtiff.so.5 (0x00007f7eb2d5d000)
    libwebp.so.7 => /usr/lib/libwebp.so.7 (0x00007f7eb2cee000)
    libexpat.so.1 => /usr/lib/libexpat.so.1 (0x00007f7eb2cbf000)
    libuuid.so.1 => /lib/libuuid.so.1 (0x00007f7eb2cb6000)
    libglib-2.0.so.0 => /usr/lib/libglib-2.0.so.0 (0x00007f7eb2b8a000)
    libbz2.so.1.0 => /usr/lib/libbz2.so.1.0 (0x00007f7eb2b77000)
    libharfbuzz.so.0 => /usr/lib/libharfbuzz.so.0 (0x00007f7eb2a90000)
    libgraphite2.so.3 => /usr/lib/libgraphite2.so.3 (0x00007f7eb2a67000)
    libzstd.so.1 => /usr/lib/libzstd.so.1 (0x00007f7eb29bf000)
    liblzma.so.5 => /usr/lib/liblzma.so.5 (0x00007f7eb2996000)
    libpcre.so.1 => /lib/libpcre.so.1 (0x00007f7eb2923000)

I made a distribution kit build. The initrd contains the data of the mstsc package, but the error is still the same:

ERROR: Package mtstsc doesn't exist, aborting bootup.
AlexanderZhirov commented 2 years ago

Corrected the package installation file, prescribed the necessary rights. But, after unpacking the initrd, there is no launch rights for execution:

name=mstsc
version=1.0
release=1
#source=($name-$version.tar.xz)
build() {
    cd $name-$version
    install -Dm00755 usr/bin/mstsc $PKG/usr/bin/mstsc
    install -Dm00755 usr/lib/libssl.so.1.0.0 $PKG/usr/lib/libssl.so.1.0.0
    install -Dm00755 usr/lib/libcrypto.so.1.0.0 $PKG/usr/lib/libcrypto.so.1.0.0
}

изображение

And for some reason there are no libraries from the installation package in the usr/lib/ directory inside initrd

AlexanderZhirov commented 2 years ago

In general, I managed to build a package with support for this program. I can't figure out how to run the software in the middle of the screen after launching the distribution. I want to get rid of freerdp, run only mstsc (my package).

When specifying the package in thinstation.conf.buildtime displays the same error:

ERROR: Package mtstsc doesn't exist, aborting bootup.

I connected via ssh, manually launched Xorg:

изображение изображение

then launched mstsc and this is the result:

изображение изображение

I can't figure out how to automate all this correctly?

Thinstation commented 2 years ago

It looks like mstsc can't can not do it's own window placement. You will need to use a WM in session 0 to compensate. Try icewm or openbox for speed and size.

Look at /build/packages/template for an example of making your own package.

AlexanderZhirov commented 2 years ago

Try icewm or openbox for speed and size.

I think this will significantly increase the size of the distribution.

Thinstation commented 2 years ago

Not really. Icewwm and openbox are pretty small. XFWM will for sure.

AlexanderZhirov commented 2 years ago

If anything, here is the package itself, to which I picked up all the libraries.

AlexanderZhirov commented 2 years ago

Not really. Icewwm and openbox are pretty small. XFWM will for sure.

The image has grown to 63 megabytes. It feels like there are too many unnecessary dependencies being loaded. I look at the dependencies files, then I look at how much these packages weigh - they are too small, but after the assembly as a whole, the image is too big...

machine ati

module usb-storage
#module isofs               # ISO9960 file system support for CDRoms
#module udf         # CDRom UDF file system support
module vfat                 # Fat and VFat file system support
module exfat
module ntfs                 # NTFS file system support
#module ext2                # Ext2 file system support
#module ext4            # Ext4 file system support
module fuse

#package ts-classic              # The classic ts logic for network/netfiles/hostname/mounting/telnetd/telnet/playcd
package automount
package autonet
#package alsa
package upIPdb
#package mstsc
#package fonts-cyrillic
#package fonts-TTF-liberation

#package xorg7-vmware
#package xorg7
package xorg7vnc

package locale-en_US  # English-US
#package locale-ru_RU
package icewm
#package freerdp        # X RDP Client - fork of rdesktop
#package open-vm-tools
#package cups       # Common Unix Printing System

#package gtk-2.0            # Full gtk-2.0 plus clearlooks theme
#package gtk-3.0
#package gtk-theme-adwaita
#package icons-adwaita
package fonts-TTF-BH        # This one works nicely most of the time and is small.
package fonts-TTF-noto
package scp
package sshd
package ntfs-3g
#package fuse

#param fastboot       true              # Mangles the filesystem a special way as to improve boot speed and reduce
                            # memory utilization. Cool/Dangerous . Harder to dubug other packages. (Finishing Touch)
                            # Set to 'true' to enable or 'lotsofmem' for slightly slower booting but no squash lag on app launch.
#param tsuser         root                            # Name of the user that thinstation will run as.
#param tsuserpasswd   pleasechangeme                    # Do Change! Console/telnet password for non-root

param xorgvncpasswd  123345
param rootpasswd     123345         # Do Change!  Console/telnet password for root
                                                # If this is enabled, Telnetd will be enabled.
param bootlogo       false              # Enable or Disable the use of the Boot splash.
param boottheme      default                    # Backgound picture during boot
param splash         silent
param fbmtrr         0                                  # MTRR value for uvesafb (default = 0, 4 is the best) grep your log to make sure you have not set it to high
param fbsm           ywrap                              # Window scrolling method (redraw, ypan, ywrap) ywrap is best, but may not work correctly for all people
param bootresolution 1280x768-32

param desktop file:./backgrounds/Hive_Lite.jpg      # Custom image to load as desktop background
param defaultconfig  thinstation.conf.buildtime     # The file with default setup.  No other config file is found
                                                    #  during boot.
param basename       thinstation                # Used for all config/tftp/scp file names
param basepath       ts6.2                      # Used to determine path to tftp/scp files
param baseurl        http://www.doncuppjr.net       # Used to determine url to wget files
param haltonerror    false              # Will halt on error, default is true
param hardlinkfs     true
param sametimestmp   true                               # When enabled, the timestamps for all files and folders will be set to 00:00 of todays date in your timezone
param initrdcmd      "xz -9e --check=crc32 --threads=0"             # Compression mode and level of initrd file. none, gzip -9, lzma -9 ,bzip2 -9

param downloads         /downloads
param syslinuxtheme     "default"
#param allres       true        # Includes a lot of resolution splash images for live-cd s
#param allfirmware  true        # Includes a lot of firmwares for live-cd s
param blacklist "snd-pcsp.ko pcspkr.ko"
param mesa_3d   disable
param blockpackage "alsa pcscd ccidreader acpi splash switchuser gnome-pulse gstreamer gst-libav gst-plugins-base x-common dbus"
Thinstation commented 2 years ago

Try also blocking messagebox desktop wmsetbg python

Make sure you have the latest code so that the blocking feature works.

Thinstation commented 2 years ago

I think you have to have x-common and dbus.

Thinstation commented 2 years ago

I think you can also block polkit if you are running as root.

AlexanderZhirov commented 2 years ago

Yes, I did it, as you advised! Gorgeous! Can it be worth adding such things (about packet locks) to the description of the instructions? I think a lot of people may have the same questions about optimizing a thin client. I'll check it on the work machine tomorrow.

изображение изображение

Thinstation commented 2 years ago

fonts-TTF-noto is very large. You might try looking for something smaller.

Doncuppjr commented 1 year ago

Try just /lib