Автор Тема: slackware  (Прочитано 25038 раз)

Оффлайн Speccyfighter

  • Мастер
  • ***
  • Сообщений: 10 259
Re: slackware
« Ответ #15 : 10.05.2019 19:26:48 »
Пересборка deb-пакета netselect в пакет Slackware

По мотивам форумной темы Совместимость rpm


Зеркал у Slackware много и выбор может быть непростым
# sed 's/^#//g' /etc/slackpkg/mirrors | grep http | cut -f -3 -d '/' | sort -u | wc -l
67

И при таком количестве зеркал, пингование может стать непростой задачей.

Для автоматизации, пересоберём deb-пакет netselect:

Получим права root
$ su -

Создадим три каталога:
для скачивания debпакета, для распаковки deb-пакета и для сборки txz-пакета
# mkdir -p deb/build/pkg

Перейдём в каталог deb
# cd deb

Скачаем deb-пакет
# wget http://cdn-fastly.deb.debian.org/debian/pool/main/n/netselect/netselect_0.3.ds1-26_i386.deb

Перейдём в каталог build
# cd build/

Распакуем deb-пакет
# ar -x ../netselect_0.3.ds1-26_i386.deb
# ls
control.tar.gz  data.tar.xz  debian-binary  pkg/

Перейдём в каталог pkg
# cd pkg/

в котором и распакуем data.tar.xz
# tar xvf ../data.tar.xz
./
./usr/
./usr/share/
./usr/share/man/
./usr/share/man/man1/
./usr/share/man/man1/netselect.1.gz
./usr/share/doc/
./usr/share/doc/netselect/
./usr/share/doc/netselect/README.Debian
./usr/share/doc/netselect/changelog.Debian.gz
./usr/share/doc/netselect/copyright
./usr/share/doc/netselect/NEWS.Debian.gz
./usr/share/doc/netselect/changelog.gz
./usr/share/doc/netselect/TODO.Debian
./usr/share/doc/netselect/HISTORY
./usr/share/doc/netselect/README.gz
./usr/bin/
./usr/bin/netselect

Собираем пакет с указание имени пакета, версии, архитектуры, расширения и пути где он будет собран
# makepkg -l y -c n /tmp/netselect-0.3.ds1-26-i486.txz

Slackware package maker, version 3.14159265.

Searching for symbolic links:

No symbolic links were found, so we won't make an installation script.
You can make your own later in ./install/doinst.sh and rebuild the
package if you like.

This next step is optional - you can set the directories in your package
to some sane permissions. If any of the directories in your package have
special permissions, then DO NOT reset them here!

Would you like to reset all directory permissions to 755 (drwxr-xr-x) and
directory ownerships to root.root ([y]es, [n]o)? n

Creating Slackware package:  /tmp/netselect-0.3.ds1-26-i486.txz

./
usr/
usr/bin/
usr/bin/netselect
usr/share/
usr/share/doc/
usr/share/doc/netselect/
usr/share/doc/netselect/HISTORY
usr/share/doc/netselect/NEWS.Debian.gz
usr/share/doc/netselect/README.Debian
usr/share/doc/netselect/README.gz
usr/share/doc/netselect/TODO.Debian
usr/share/doc/netselect/changelog.Debian.gz
usr/share/doc/netselect/changelog.gz
usr/share/doc/netselect/copyright
usr/share/man/
usr/share/man/man1/
usr/share/man/man1/netselect.1.gz
WARNING:  /usr/share/man (with possibly not gzipped man pages) detected

Slackware package /tmp/netselect-0.3.ds1-26-i486.txz created.

Устанавливаем пакет
# installpkg /tmp/netselect-0.3.ds1-26-i486.txz
Verifying package netselect-0.3.ds1-26-i486.txz.
Installing package netselect-0.3.ds1-26-i486.txz:
PACKAGE DESCRIPTION:
Package netselect-0.3.ds1-26-i486.txz installed.

Парсим ресурсы с зеркалами Slsckware и находим самый быстрый сервер:
# netselect -vv $( sed 's/^#//g' /etc/slackpkg/mirrors | grep http: | grep -v 'Project Page' | cut -f -3 -d '/' | sort -u )
netselect: 31 (24 active) nameserver request(s)...       
Duplicate address 150.101.135.3 (http://ftp.iinet.net.au, http://mirror.internode.on.net); keeping only under first name.
netselect: unknown host gd.tuwien.ac.at                     
netselect: unknown host ftp.slackware.at                   
netselect: unknown host mirror.ovh.net                     
Running netselect to choose 1 out of 66 addresses.       
...
http://ftp.is.co.za                   9999 ms  30 hops    0% ok
http://ftp.nluug.nl                     75 ms  13 hops  100% ok (10/10) [  172]
http://ftp.iinet.net.au                339 ms  19 hops   85% ok ( 6/ 7) [ 1145]
http://ftp.isu.edu.tw                 9999 ms  30 hops    0% ok
http://ftp.heanet.ie                    73 ms  15 hops  100% ok (10/10) [  182]
http://ftp.linux.org.tr               9999 ms  30 hops    0% ok
http://ftp.mirrorservice.org            65 ms  16 hops  100% ok (10/10) [  169]
http://ftp.otenet.gr                    74 ms  13 hops  100% ok (10/10) [  170]
http://ftp.cc.uoc.gr                  9999 ms  30 hops    0% ok
http://ftp.pwr.wroc.pl                  68 ms  13 hops  100% ok (10/10) [  156]
http://ftp.slackware-brasil.com.br     303 ms  26 hops   87% ok ( 7/ 8) [ 1249]
http://ftp.slackware.no                 70 ms  17 hops  100% ok (10/10) [  189]
http://ftp.gwdg.de                      67 ms  14 hops  100% ok (10/10) [  160]
http://194.71.11.173                    67 ms  19 hops  100% ok (10/10) [  194]
http://194.71.11.165                    65 ms  19 hops  100% ok (10/10) [  188]
http://mirror.primusdatacentre.com.au   9999 ms  30 hops    0% ok
http://ftp.slackware.pl                 71 ms  11 hops  100% ok (10/10) [  149]
http://ftp.tu-chemnitz.de             9999 ms  30 hops    0% ok
http://mirror.rol.ru                    38 ms  13 hops  100% ok (10/10) [   87]
http://ba.mirror.garr.it                83 ms  17 hops  100% ok (10/10) [  224]
http://ftp.twaren.net                  279 ms  17 hops   88% ok ( 8/ 9) [  847]
http://mirror.as24220.net              369 ms  17 hops   85% ok ( 6/ 7) [ 1163]
http://mirror.csclub.uwaterloo.ca     9999 ms  30 hops    0% ok
http://mirror.aarnet.edu.au            369 ms  25 hops   83% ok ( 5/ 6) [ 1550]
http://mirror.datacenter.by             10 ms   8 hops  100% ok (10/10) [   18]
http://mirror.its.dal.ca               140 ms  15 hops   50% ok ( 1/ 2) [  700]
http://80.68.83.150                     72 ms  20 hops  100% ok (10/10) [  216]
http://212.110.163.12                   70 ms  20 hops  100% ok (10/10) [  210]
http://mirror.nl.leaseweb.net          108 ms  15 hops   50% ok ( 1/ 2) [  540]
http://ftp.cc.swin.edu.au              365 ms  29 hops   80% ok ( 4/ 5) [ 1778]
http://mirror.yandex.ru                 37 ms  10 hops  100% ok (10/10) [   74]
http://mirrors.easynews.com            220 ms  12 hops   90% ok ( 9/10) [  536]
http://gd.tuwien.ac.at                9999 ms  30 hops    0% ok
http://mirror.switch.ch               9999 ms  30 hops    0% ok
http://sunsite.icm.edu.pl               74 ms  10 hops  100% ok (10/10) [  148]
http://mirrors.unixsol.org              63 ms  11 hops  100% ok (10/10) [  132]
http://ftp.slackware.at               9999 ms  30 hops    0% ok
http://riksun.riken.go.jp              287 ms  22 hops   87% ok ( 7/ 8) [ 1049]
http://slackware.cs.utah.edu          9999 ms  30 hops    0% ok
http://mirrors.ucr.ac.cr              9999 ms  30 hops    0% ok
http://patroklos.noc.ntua.gr           119 ms  23 hops   50% ok ( 1/ 2) [  785]
http://spout.ussg.indiana.edu          158 ms  20 hops  100% ok (10/10) [  474]
http://odysseus.linux.cz                79 ms  16 hops  100% ok (10/10) [  205]
http://sunsite.informatik.rwth-aachen.de     68 ms  16 hops  100% ok (10/10) [  176]
http://slackware.mirrors.tds.net       148 ms  12 hops  100% ok (10/10) [  325]
http://202.141.176.110                 317 ms  23 hops   50% ok ( 1/ 2) [ 2092]
http://218.104.71.170                  319 ms  21 hops   85% ok ( 6/ 7) [ 1156]
http://slackware.mirrors.pair.com      149 ms  12 hops   66% ok ( 2/ 3) [  492]
http://mirrors.xmission.com            212 ms  17 hops  100% ok (10/10) [  572]
http://mirror.ovh.net                 9999 ms  30 hops    0% ok
http://nephtys.lip6.fr                  81 ms  23 hops  100% ok (10/10) [  267]
http://teewurst.cc.columbia.edu        122 ms  19 hops  100% ok (10/10) [  353]
http://wrz1013.rz.uni-wuerzburg.de    9999 ms  30 hops    0% ok
http://64.50.236.52                    158 ms  13 hops  100% ok (10/10) [  363]
http://64.50.233.100                   143 ms  12 hops  100% ok (10/10) [  314]
http://140.211.166.134                 209 ms  14 hops  100% ok (10/10) [  501]
http://mirrors.slackware.com           167 ms  13 hops  100% ok (10/10) [  384]
http://z-ftp.wcss.wroc.pl               70 ms  13 hops  100% ok (10/10) [  161]
http://mirrors.us.kernel.org           212 ms  19 hops   90% ok ( 9/10) [  684]
http://ftp.wa.co.za                    234 ms  20 hops   90% ok ( 9/10) [  780]
http://ftp.nara.wide.ad.jp             320 ms  24 hops   87% ok ( 7/ 8) [ 1241]
http://ftp.kddilabs.jp                9999 ms  30 hops    0% ok
http://mirrors.mithril.org.ua           31 ms   9 hops  100% ok (10/10) [   58]
http://kambing.ui.ac.id               9999 ms  30 hops    0% ok
http://slackware.mirror.ac.za          233 ms  20 hops   90% ok ( 9/10) [  777]
http://mirrors.163.com                9999 ms  30 hops    0% ok
   18 http://mirror.datacenter.by

Короткие выводы:
# netselect -v $( sed 's/^#//g' /etc/slackpkg/mirrors | grep http: | grep -v 'Project Page' | cut -f -3 -d '/' | sort -u )
netselect: 48 (23 active) nameserver request(s)...       
Duplicate address 150.101.135.3 (http://ftp.iinet.net.au, http://mirror.internode.on.net); keeping only under first name.
netselect: unknown host ftp.slackware.at                   
netselect: unknown host gd.tuwien.ac.at                     
netselect: unknown host mirror.ovh.net                     
Running netselect to choose 1 out of 66 addresses.     
...
   18 http://mirror.datacenter.by
# netselect $( sed 's/^#//g' /etc/slackpkg/mirrors | grep http: | grep -v 'Project Page' | cut -f -3 -d '/' | sort -u )
netselect: unknown host gd.tuwien.ac.at
netselect: unknown host ftp.slackware.at
netselect: unknown host mirror.ovh.net
   16 http://mirror.datacenter.by


Во вложении бинарный пакет netselect для Slackware под архитектуру i486 (не x86_64!), - у скачанного файла netselect-0.3.ds1-26-i486.txz.txt, переименованием убрать расширение .txt.

Оффлайн Speccyfighter

  • Мастер
  • ***
  • Сообщений: 10 259
Re: slackware
« Ответ #16 : 25.05.2019 05:55:40 »
Эрик Хэймлирс (контрибутор Slackware) выпустил новые сборки нестабильного Slackware

http://bear.alienbase.nl/mirrors/slackware-live/1.3.2/
[PARENTDIR]   Parent Directory  -
[ ]     slackware-live-current.iso                2019-05-11 15:48 3.5G
[TXT]   slackware-live-current.iso.asc            2019-05-11 21:06 801  PGP signature file
[TXT]   slackware-live-current.iso.md5            2019-05-11 15:49 61   MD5 signature file
[ ]     slackware-live-xfce-current.iso           2019-05-14 11:50 688M
[TXT]   slackware-live-xfce-current.iso.asc       2019-05-14 11:58 801  PGP signature file
[TXT]   slackware-live-xfce-current.iso.md5       2019-05-14 11:50 66   MD5 signature file
[ ]     slackware64-live-current.iso              2019-05-11 14:08 3.5G
[TXT]   slackware64-live-current.iso.asc          2019-05-11 21:07 801  PGP signature file
[TXT]   slackware64-live-current.iso.md5          2019-05-11 14:08 63   MD5 signature file
[ ]     slackware64-live-mate-current.iso         2019-05-11 13:23 2.5G
[TXT]   slackware64-live-mate-current.iso.asc     2019-05-11 21:07 801  PGP signature file
[TXT]   slackware64-live-mate-current.iso.md5     2019-05-11 13:23 68   MD5 signature file
[ ]     slackware64-live-plasma5-current.iso      2019-05-11 19:43 4.4G
[TXT]   slackware64-live-plasma5-current.iso.asc  2019-05-11 21:08 801  PGP signature file
[TXT]   slackware64-live-plasma5-current.iso.md5  2019-05-11 19:43 71   MD5 signature file
[ ]     slackware64-live-xfce-current.iso         2019-05-14 11:26 699M
[TXT]   slackware64-live-xfce-current.iso.asc     2019-05-14 11:38 801  PGP signature file
[TXT]   slackware64-live-xfce-current.iso.md5     2019-05-14 11:26 68   MD5 signature file

Ядро
$ uname -rm
4.19.42 i686

Пакет xscreensaver содержит GUI-настройщик$ grep bin/ /var/adm/packages/xscreensaver-5.42-i586-1
usr/bin/
usr/bin/xscreensaver
usr/bin/xscreensaver-command
usr/bin/xscreensaver-demo
usr/bin/xscreensaver-getimage
usr/bin/xscreensaver-getimage-file
usr/bin/xscreensaver-getimage-video
usr/bin/xscreensaver-gl-helper
usr/bin/xscreensaver-text

Сетевой менеджер$ grep bin/ /var/adm/packages/NetworkManager-1.18.1-i586-1
usr/bin/
usr/bin/nm-online
usr/bin/nmcli
usr/bin/nmtui
usr/sbin/
usr/sbin/NetworkManager

На Intel графике используется драйвер Intel и свежая Mesa
$ glxinfo | sed -n '49,53p; 60,62p'
    Vendor: Intel Open Source Technology Center (0x8086)
    Device: Mesa DRI Intel(R) HD Graphics 5500 (Broadwell GT2) x86/MMX/SSE2 (0x1616)
    Version: 19.0.4
    Accelerated: yes
    Video memory: 1536MB
OpenGL vendor string: Intel Open Source Technology Center
OpenGL renderer string: Mesa DRI Intel(R) HD Graphics 5500 (Broadwell GT2) x86/MMX/SSE2
OpenGL core profile version string: 4.5 (Core Profile) Mesa 19.0.4

Исправлена ошибка предыдущей сборки с MANPAGER
$ grep -r MANPAGER /etc/ 2>/dev/null
/etc/profile.d/man-db.csh:#setenv MANPAGER less
/etc/profile.d/man-db.csh:#setenv MANPAGER more
/etc/profile.d/man-db.csh:#setenv MANPAGER most
/etc/profile.d/man-db.sh:#export MANPAGER=less
/etc/profile.d/man-db.sh:#export MANPAGER=more
/etc/profile.d/man-db.sh:#export MANPAGER=most

и теперь man-страницы отображаются$ man su | head -n 7
su(1)                                                 Пользовательские команды                                                su(1)

ИМЯ
       su - изменяет ID пользователя или делает его суперпользователем

СИНОПСИС
       su [параметры] [-] [имя_пользователя [ args ]]

На ноутбуках, световая индикация раскладки не отображается
# cat /etc/X11/xorg.conf.d/30-keyboard.conf

Section "InputClass"
  Identifier "keyboard-all"
  MatchIsKeyboard "on"
  MatchDevicePath "/dev/input/event*"
  Driver "evdev"
  Option "XkbLayout" "ru,us"
  Option "XkbVariant" ","
  Option "XkbOptions" "grp:alt_shift_toggle,grp_led:scroll,lv3:ralt_switch_multikey"
EndSection

Быстрая смена индикации раскладки клавиатуры с ScrollLock на NumLock
# sed -i 's/grp_led:scroll/grep_led:num/' /etc/X11/xorg.conf.d/30-keyboard.conf

Применение без релогина и рестарта X-сов
# setxkbmap -layout us,ru -option grp:alt_shift_toggle,grp_led:num,lv3:ralt_switch_multikey

Все параметры более подробно тут
https://forum.altlinux.org/index.php?topic=32361.msg305657#msg305657

Запись на флешку, как через dd (без сохранения сессии)
так и через скрипт iso2usb.sh
http://docs.slackware.com/start?id=slackware:liveslak

Скрипт также поддерживает и обновление флешки:
https://alien.slackbook.org/blog/new-live-isos-for-slackware-current-20180209/

Refreshing your USB stick instead of re-formatting

If you already use a Slackware Live USB stick that you do not want to re-format, you should use the “-r” parameter to the “iso2usb.sh” script. The “-r” or refresh parameter allows you to refresh the liveslak files on your USB stick without touching your custom content. If you want to modify other parameters of your USB stick, use the script “upslak.sh“. It’s main feature is that it can update the kernel on the USB stick, but it also can replace the Live init script. As with most (if not all) of my scripts, use the “-h” parameter to get help on its functionality.

Обновление вашей флешки вместо переформатирования

Если вы уже используете USB-флешку Slackware Live, которую не хотите переформатировать, вам следует использовать параметр «-r» для сценария «iso2usb.sh». Параметр «-r» или «Обновить» позволяет обновлять файлы livelak на USB-накопителе, не затрагивая пользовательский контент. Если вы хотите изменить другие параметры вашей флешки, используйте скрипт «upslak.sh«. Его главная особенность заключается в том, что он может обновлять ядро на USB-накопителе, но также может заменить скрипт инициализации Live. Как и в большинстве (если не во всех) моих сценариях, используйте параметр «-h», чтобы получить справку по его функциональности.


В сборку xfce входит браузер Firefox Quantum 60.6.3esr.

Пакетный менеджер не вызовет вопросов и во многом похож на apt или подобные
# slackpkg
slackpkg - version 2.83.0

Usage:
slackpkg [OPTIONS] {install|remove|search|file-search|
    upgrade|reinstall|blacklist} {PATTERN|FILE}
slackpkg [OPTIONS] {generate-template|install-template|remove-template}
   TEMPLATENAME
slackpkg [OPTIONS] info PACKAGE
slackpkg [OPTIONS] update [gpg]
slackpkg [OPTIONS] {clean-system|upgrade-all|install-new}
slackpkg [OPTIONS] {new-config|check-updates|help}

If you need more information try to use 'slackpkg help' or look the
slackpkg's manpage.


Выпуск нестабильного Slackware, вполне стабилен и радует глаз.
« Последнее редактирование: 25.05.2019 07:12:11 от Speccyfighter »

Оффлайн Speccyfighter

  • Мастер
  • ***
  • Сообщений: 10 259
Re: slackware
« Ответ #17 : 16.07.2019 14:21:03 »
Какой дебил догадался посадить дисплей менеджер на все runlevel начиная со второго?!
$ grep Default-St ./debian/slim.init
# Default-Start:     2 3 4 5
# Default-Stop:      0 1 6

В Slackware, здесь невероятно просто:

Display Manager и runlevel

В Slackware нет 'runlevel 2' и уровни выполнения 2 и 5 конфигурируются как 'runlevel 3'.
'runlevel 4', - X11 с менеджером сессий:
$ sed -n '14,44p' /etc/inittab

# These are the default runlevels in Slackware:
#   0 = halt
#   1 = single user mode
#   2 = unused (but configured the same as runlevel 3)
#   3 = multiuser mode (default Slackware runlevel)
#   4 = X11 with KDM/GDM/XDM (session managers)
#   5 = unused (but configured the same as runlevel 3)
#   6 = reboot

# Default runlevel. (Do not set to 0 or 6)
id:4:initdefault:

# System initialization (runs when system boots).
si:S:sysinit:/etc/rc.d/rc.S

# Script to run when going single user (runlevel 1).
su:1S:wait:/etc/rc.d/rc.K

# Script to run when going multi user.
rc:2345:wait:/etc/rc.d/rc.M

# What to do at the "Three Finger Salute".
ca::ctrlaltdel:/sbin/shutdown -t5 -r now

# Runlevel 0 halts the system.
l0:0:wait:/etc/rc.d/rc.0

# Runlevel 6 reboots the system.
l6:6:wait:/etc/rc.d/rc.6


Переход на уровни выполнения
# init|telinit N
$ ls -l /sbin/telinit
lrwxrwxrwx 1 root root 4 июн 13 08:43 /sbin/telinit -> init*
где N - уровень выполнения
(подробнее `man init`)

Скрипт выполняющийся при переходе на 'runlevel 4', прост и последовательно перебирает дисплей менеджеры gdm kdm sddm xdm
(предполагается возможность запуска своего /etc/rc.d/rc.4.local)
$ cat /etc/rc.d/rc.4
#! /bin/sh
#
# rc.4 This file is executed by init(8) when the system is being
# initialized for run level 4 (XDM)
#
# Version: @(#)/etc/rc.d/rc.4 2.00 02/17/93
#
# Author: Fred N. van Kempen, <waltje@uwalt.nl.mugnet.org>
# At least 47% rewritten by:  Patrick J. Volkerding <volkerdi@slackware.com>
#

# Tell the viewers what's going to happen...
echo "Starting up X11 session manager..."

# If you'd like to start something different or in a different order than
# the options below, create your own startup script /etc/rc.d/rc.4.local
# and make it executable and it will be used instead:
if [ -x /etc/rc.d/rc.4.local ]; then
  exec /bin/bash /etc/rc.d/rc.4.local
fi

# Try to use GNOME's gdm session manager.  This comes first because if
# gdm is on the machine then the user probably installed it and wants
# to use it by default:
if [ -x /usr/bin/gdm ]; then
  exec /usr/bin/gdm -nodaemon
fi

# Someone thought that gdm looked prettier in /usr/sbin,
# so look there, too:
if [ -x /usr/sbin/gdm ]; then
  exec /usr/sbin/gdm -nodaemon
fi

# Not there?  OK, try to use KDE's kdm session manager:
if [ -x /opt/kde/bin/kdm ]; then
  exec /opt/kde/bin/kdm -nodaemon
elif [ -x /usr/bin/kdm ]; then
  exec /usr/bin/kdm -nodaemon
fi

# Look for SDDM as well:
if [ -x /usr/bin/sddm ]; then
  exec /usr/bin/sddm
fi

# If all you have is XDM, I guess it will have to do:
if [ -x /usr/bin/xdm ]; then
  exec /usr/bin/xdm -nodaemon -config /etc/X11/xdm/liveslak-xdm/xdm-config
elif [ -x /usr/X11R6/bin/xdm ]; then
  exec /usr/X11R6/bin/xdm -nodaemon -config /etc/X11/xdm/liveslak-xdm/xdm-config
fi

# error
echo
echo "Hey, you don't have KDM, GDM, or XDM.  Can't use runlevel 4 without"
echo "one of those installed."
sleep 30

# All done.

Если вам не нравится русская раскладка и индикатор scroll по-умолчанию, это всегда можно изменить:
$ cat /etc/X11/xorg.conf.d/30-keyboard.conf

Section "InputClass"
  Identifier "keyboard-all"
  MatchIsKeyboard "on"
  MatchDevicePath "/dev/input/event*"
  Driver "evdev"
  Option "XkbLayout" "us,ru"
  Option "XkbVariant" ","
  Option "XkbOptions" "grp:alt_shift_toggle,grp_led:num,lv3:ralt_switch_multikey"
EndSection


Разрешение и запрет запуска init-скриптов, снять/установить бит execute.

Все скрипты кратко, но хорошо прокомментированы и знакомство с ними не вызовет трудностей.

Весь вывод был предоставлен из последней сборки slackware-live-xfce-current версии 1.3.2.2:
http://bear.alienbase.nl/mirrors/slackware-live/