Le blog de Jean David TECHER, un Réunionnais à Saint-Priest/Lyon

Aller au contenu | Aller au menu | Aller à la recherche


dimanche 19 mars 2017

[Wine-Staging 2.3]Daz Studios 4.9.0.166 and PostgreSQL CMS on Linux

Daz Studio and PostgreSQL CMS

Daz Studio 4.9 uses PostgreSQL CMS (a module) to store data. It is a database (backend database). Due to admin privileges being too high with wine, we can NOT install and star the PostgreSQL database provided with. We need less privileges.

HOWEVER even if Wine is not able to install the PostgreSQL database -- as a simple workaround -- we can install a PostgreSQL database natively on Linux . Let's first check which PostgreSQL version is used by Daz Studio

PostgreSQL version used by Daz Studio

We have
  • For the version
    david@amdgaming:/opt/Builds/wine/data/Daz_Studio/drive_c/Program Files/DAZ 3D$ wine "${WINEPREFIX}/drive_c/Program Files/DAZ 3D/PostgreSQL CMS"/bin/psql.exe --version
    psql (PostgreSQL) 9.3.4
  • For the options
    david@amdgaming:/opt/Builds/wine/data/Daz_Studio/drive_c/Program Files/DAZ 3D$ wine"${WINEPREFIX}/drive_c/Program Files/DAZ 3D/PostgreSQL CMS"/bin/pg_config --configure
    --enable-thread-safety --enable-integer-datetimes --enable-nls --with-ldap --with-ossp-uuid --with-libxml --with-libxslt --with-tcl --with-perl --with-python
    

Daz Studio used PostgreSQL 9.3.4.

Build PostgreSQL 9.3.4 from sources

Let's build PostgreSQL 9.3.4 from sources

Notice: I took decision to not install PostgreSQL by my packages software (apt-get) because PostgreSQL version can be too old or too recent

sudo su
wget "https://ftp.postgresql.org/pub/source/v9.3.4/postgresql-9.3.4.tar.bz2"
tar xvjf postgresql-9.3.4.tar.bz2 
apt-get install libossp-uuid-dev libperl-dev libpython-dev
cd postgresql-9.3.4
./configure --prefix=/opt/PostgreSQL/9.3.4 --enable-thread-safety --enable-integer-datetimes --enable-nls --with-ldap --with-ossp-uuid --with-libxml --with-libxslt  --with-perl --with-python
make -j4
make install
cd contrib/
make -j4
make install

Configure the PostgreSQL cluster

  • Log out and get back to your current Linux user
  • Update your environment variables PATH and LD_LIBRARY_PATH to include paths to its bin and lib folder.
    export PATH=/opt/PostgreSQL/9.3.4/bin/:$PATH
    export LD_LIBRARY_PATH=/opt/PostgreSQL/9.3.4/lib/:$LD_LIBRARY_PATH
  • Then initialize the PostgreSQL cluster
    initdb -A trust /home/david/daz_studio_cms
Apply recommendations from http://amyaimei.deviantart.com/journal/Install-DAZ-Studio-4-9-0-63-32-bit-on-Linux-593421068
  • Here is the content of my PostgreSQL configuration file /home/david/daz_studio_cms/postgresql.conf without comments
    david@amdgaming:~$ grep -E '^[a-z]' /home/david/daz_studio_cms/postgresql.conf|sed -e "s:\#.*::g"
    max_connections = 100			
    shared_buffers = 512MB			
    temp_buffers = 30MB			
    log_destination = 'stderr'		
    logging_collector = on		
    log_directory = 'pg_log'		
    log_filename = 'postgresql-%Y-%m-%d_%H%M%S.log'	
    log_connections = on
    log_line_prefix = '%t [%a] [database=%d user=%u host=%h pid=%p]\n'			
    log_timezone = 'Europe/Paris'
    stats_temp_directory = 'pg_stat_tmp'
    datestyle = 'iso, dmy'
    timezone = 'Europe/Paris'
    lc_messages = 'fr_FR.UTF-8'			
    lc_monetary = 'fr_FR.UTF-8'			
    lc_numeric = 'fr_FR.UTF-8'			
    lc_time = 'fr_FR.UTF-8'				
    default_text_search_config = 'pg_catalog.french'
    
  • Start the PostgreSQL server
    /home/david/daz_studio_cms
  • Create a temporary file with the following content
    david@amdgaming:~$ cat zozo.sql 
    CREATE ROLE dzcms LOGIN SUPERUSER INHERIT CREATEDB CREATEROLE REPLICATION;
    
    CREATE DATABASE "Content" WITH OWNER = dzcms ENCODING = 'UTF8' TABLESPACE = pg_default  CONNECTION LIMIT = -1;
    
    \c Content
    
    CREATE EXTENSION citext
     SCHEMA public
     VERSION "1.0";
    
    ALTER ROLE dzcms
     SET search_path = dzcontent, public;
    
  • Apply it. Using psql its output should be similar to below output
    david@amdgaming:~$ psql postgres -e -f zozo.sql
    CREATE ROLE dzcms LOGIN SUPERUSER INHERIT CREATEDB CREATEROLE REPLICATION;
    CREATE ROLE
    CREATE DATABASE "Content" WITH OWNER = dzcms ENCODING = 'UTF8' TABLESPACE = pg_default  CONNECTION LIMIT = -1;
    CREATE DATABASE
    Vous êtes maintenant connecté à la base de données « Content » en tant qu'utilisateur « david ».
    CREATE EXTENSION citext
     SCHEMA public
     VERSION "1.0";
    CREATE EXTENSION
    ALTER ROLE dzcms
     SET search_path = dzcontent, public;
    ALTER ROLE
    

PostgreSQL CMS - Installation

  • While PostgreSQL CMS is still being downloaded from the main manager (see below image)

    PostgreSQL CMS is stillbeing downloaded
    Daz Studio has just written a file = ${WINEPREFIX}/drive_c/users/${YOUR_USER}/Application\ Data/DAZ\ 3D/cms/cmscfg.json
  • Replace its content by this one
    {
    	"Port" : 5432,
    	"ConnectionURI" : "postgresql://dzcms@localhost:5432/Content"
    }
    
Then PostgreSQL CMS installation should be fine!

jeudi 16 mars 2017

Wine Configure |Resort options in alphabetical order

Here is the command line I used to sort wine switches/options

  • WITH Gallium-Nine support and Without HAL support
    echo  $(echo -n $(./configure --help|grep -E '  \-\-with'|grep -vE '(PACKAGE|\-wine)'|sort|sed -e "s:without:with:g;s:with-hal:without-hal:g"|awk '{print $1}'|sort)) | \
    sed -e "s:--with-d3d9-nine-headers-path --with-d3d9-nine-module:--with-d3d9-nine-module=auto --with-d3d9-nine-headers-path=auto:g"
    Should print something like
    --with-alsa --with-capi --with-cms --with-coreaudio --with-cups --with-curses --with-d3d9-nine --with-d3d9-nine-module=auto --with-d3d9-nine-headers-path=auto \
    --with-dbus --with-fontconfig --with-freetype --with-gettext --with-gettextpo --with-glu --with-gnutls --with-gphoto --with-gsm --with-gstreamer --with-gtk3 --with-jpeg --with-ldap \
    --with-mpg123 --with-netapi --with-openal --with-opencl --with-opengl --with-osmesa --with-oss --without-hal --with-pcap --with-png --with-pthread --with-pulse --with-sane --with-tiff \
    --with-udev --with-v4l --with-va --with-x --with-xattr --with-xcb --with-xcomposite --with-xcursor --with-xinerama --with-xinput --with-xinput2 --with-xml --with-xrandr --with-xrender\
     --with-xshape --with-xshm --with-xslt --with-xxf86vm --with-zlib
  • WITHOUT Gallium-Nine support and Without HAL support if you use NVIDIA GPU
    echo  $(echo -n $(./configure --help|grep -E '  \-\-with'|grep -vE '(PACKAGE|\-wine)'|sort|sed -e "s:without:with:g;s:with-hal:without-hal:g"|awk '{print $1}'|sort)) 
    Should print something like
    --with-alsa --with-capi --with-cms --with-coreaudio --with-cups --with-curses --with-dbus --with-fontconfig --with-freetype --with-gettext --with-gettextpo --with-glu \
    --with-gnutls --with-gphoto --with-gsm --with-gstreamer --with-gtk3 --with-jpeg --with-ldap --with-mpg123 --with-netapi --with-openal --with-opencl --with-opengl --with-osmesa \
    --with-oss --without-hal --with-pcap --with-png --with-pthread --with-pulse --with-sane --with-tiff --with-udev --with-v4l --with-va --with-x --with-xattr --with-xcb --with-xcomposite \
    --with-xcursor --with-xinerama --with-xinput --with-xinput2 --with-xml --with-xrandr --with-xrender --with-xshape --with-xshm --with-xslt --with-xxf86vm --with-zlib

dimanche 12 mars 2017

Upgrade kernel 4.4: From 4.4.36 to 4.4.53

This ticket is just a reminder on how to upgrade my old kernel 4.4.36 to kernel 4.4.53 using incrementals patches. [more]
  • Go to the sources folder and clean up its content using make mrproper
    cd /opt/Sources/linux-4.4
    make mrproper
  • Create a temporary folder tmp_sources for all patches
    cd /opt/Sources/linux-4.4
    mkdir tmp_patches
    cd tmp_patches
  • Download patches
    for((inc=36;inc<=52;inc++));
    do 
    wget https://cdn.kernel.org/pub/linux/kernel/v4.x/incr/patch-4.4.${inc}-$(expr ${inc} + 1).xz -O - | xz -d > patch-4.4.${inc}-$(expr ${inc} + 1);
    done
  • Content of the current folder is
    /opt/Sources/linux-4.4/tmp_patch# ls
    patch-4.4.36-37  patch-4.4.38-39  patch-4.4.40-41  patch-4.4.42-43  patch-4.4.44-45  patch-4.4.46-47  patch-4.4.48-49  patch-4.4.50-51  patch-4.4.52-53
    patch-4.4.37-38  patch-4.4.39-40  patch-4.4.41-42  patch-4.4.43-44  patch-4.4.45-46  patch-4.4.47-48  patch-4.4.49-50  patch-4.4.51-52
    
  • Apply these patches
    cd ..
    for((inc=36;inc<=52;inc++));
    do 
    patch -p1 < tmp_patch/patch-4.4.${inc}-$(expr ${inc} + 1);
    done
Time to buidl the kernel
  • Configure the kernel
    make menuconfig
  • Build everything
    make -j4 bzImage modules
    Notice: If you have a DVD or a film to watch then enjoy it! Above commands should take a while to be executed.

    On my PC with CPU=i5-4430, it took 30 minutes.

  • Install
    make -j4 INSTALL_MOD_STRIP=1 modules_install
    make -j4 INSTALL_MOD_STRIP=1 install
    make -j4 INSTALL_MOD_STRIP=1 headers_install
    
    Notice: INSTALL_MOD_STRIP=1 is pretty useful. This flag helps to install binaries with a smaller size :)