Init commit

master
Dmitry Razumov 3 years ago
commit cfbff390b2

@ -0,0 +1,48 @@
ЛИЦЕНЗИОННОЕ СОГЛАШЕНИЕ ДЛЯ КОНЕЧНОГО ПОЛЬЗОВАТЕЛЯ
ПО ИСПОЛЬЗОВАНИЮ
ОПЕРАЦИОННЫХ СИСТЕМ
«UBLINUX DESKTOP ENTERPRISE»
«UBLINUX EDUCATION»
«UBLINUX SERVER»
«UBLINUX ADARA DESKTOP ENTERPRISE»
«UBLINUX ADARA SERVER»
«UBLINUX DESKTOP ENTERPRISE SIBSUTIS»
«UBLINUX EDUCATION SIBSUTIS»
«UBLINUX SERVER SIBSUTIS»
ВНИМАНИЕ! Прочтите внимательно нижеизложенное Лицензионное соглашение, прежде чем устанавливать, копировать или иным образом использовать приобретенный Программный продукт. Любое использование приобретенного Программного продукта, в том числе его установка и копирование, означает согласие с условиями приведенного ниже Лицензионного соглашения.
Настоящее Лицензионное соглашение для конечного пользователя (СОГЛАШЕНИЕ) является юридическим соглашением между Вами (физическим или юридическим лицом) (ПОЛЬЗОВАТЕЛЕМ) и обществом ограниченной ответственности «Юбитех» (ПРАВООБЛАДАТЕЛЕМ), которое является разработчиком Операционной системы «UB LINUX» (ПРОГРАММНЫЙ ПРОДУКТ). Устанавливая, копируя или иным образом используя ПРОГРАММНЫЙ ПРОДУКТ, ПОЛЬЗОВАТЕЛЬ тем самым соглашается с положениями настоящего СОГЛАШЕНИЯ. Если ПОЛЬЗОВАТЕЛЬ не согласен с положениями настоящего СОГЛАШЕНИЯ, ПРАВООБЛАДАТЕЛЬ отказывает ему в праве на любое использование ПРОГРАММНОГО ПРОДУКТА. В этом случае ПОЛЬЗОВАТЕЛЬ не имеет права устанавливать, копировать или иным образом использовать ПРОГРАММНЫЙ ПРОДУКТ, а также вправе вернуть ПРОГРАММНЫЙ ПРОДУКТ организации, у которой его приобрел, при условии целостности (отсутствия признаков вскрытия) товарной упаковки.
1. ОБЩИЕ ПОЛОЖЕНИЯ
1.1. ПРОГРАММНЫЙ ПРОДУКТ охраняется авторским правом, международными соглашениями о защите интеллектуальной собственности и действующим законодательством Российской Федерации. Соответствие ПРОГРАММНОГО ПРОДУКТА требованиям безопасности информации подтверждается сертификатом, оформленным согласно действующего законодательства Российской Федерации.
1.2. ПРОГРАММНЫЙ ПРОДУКТ лицензируется, а не продается. ПРОГРАММНЫЙ ПРОДУКТ лицензируется как единое целое. Приобретение настоящего ПРОГРАММНОГО ПРОДУКТА это приобретение простой лицензии (неисключительного права) на его использование.
1.3. ПРОГРАММНЫЙ ПРОДУКТ включает в себя собственно компьютерную программу на соответствующих носителях, а также сопровождающие печатные материалы и электронную документацию.
1.4. ПРОГРАММНЫЙ ПРОДУКТ является сложным объектом и содержит компоненты как собственной разработки ПРАВООБЛАДАТЕЛЯ, так и сторонних авторов.
1.5. При нарушении ПОЛЬЗОВАТЕЛЕМ положений данного СОГЛАШЕНИЯ ПРАВООБЛАДАТЕЛЬ имеет право отменить его действие. В этом случае ПОЛЬЗОВАТЕЛЬ обязан прекратить использование ПРОГРАММНОГО ПРОДУКТА и уничтожить все его копии, находящиеся в распоряжении ПОЛЬЗОВАТЕЛЯ.
1.6. Все условия, оговоренные далее, относятся как к ПРОГРАММНОМУ ПРОДУКТУ в целом, так и ко всем его компонентам в отдельности.
2. НЕИСКЛЮЧИТЕЛЬНОЕ ПРАВО, ПРЕДОСТАВЛЯЕМОЕ ПОЛЬЗОВАТЕЛЮ
2.1. Настоящее СОГЛАШЕНИЕ предоставляет ПОЛЬЗОВАТЕЛЮ право на установку и использование ПРОГРАММНОГО ПРОДУКТА на ОДНОМ компьютере и изготовление ОДНОЙ резервной копии, используемой в случае утраты или порчи основных носителей из состава ПРОГРАММНОГО ПРОДУКТА, придерживаясь условий данного СОГЛАШЕНИЯ и правил, содержащихся в прилагаемой печатной или электронной документации.
2.2. ПОЛЬЗОВАТЕЛЬ имеет право на получение обновлений ПРОГРАММНОГО ПРОДУКТА, общей технической поддержки и иных услуг от ПРАВООБЛАДАТЕЛЯ или его представителя по отдельному договору, заключаемому с ПОЛЬЗОВАТЕЛЕМ.
3. ОГРАНИЧЕНИЯ
3.1. Настоящее СОГЛАШЕНИЕ НЕ дает ПОЛЬЗОВАТЕЛЮ права на:
3.1.1. Декомпиляцию и дизассемблирование любых составных частей ПРОГРАММНОГО ПРОДУКТА, кроме случаев, предусмотренных законодательством Российской Федерации.
3.1.2. Передачу в аренду, в залог или лизинг ПРОГРАММНОГО ПРОДУКТА.
3.1.3. Распространение ПРОГРАММНОГО ПРОДУКТА, любых его изменений или перевод его текста на другой язык.
3.1.4. Установку ПРОГРАММНОГО ПРОДУКТА более чем на ОДИН компьютер без заключения ЛИЦЕНЗИОННОГО ДОГОВОРА.
3.2. ПРАВООБЛАДАТЕЛЬ не несет ответственности за любую информацию, которая создается или обрабатывается в процессе использования ПРОГРАММНОГО ПРОДУКТА.
3.3. Настоящее СОГЛАШЕНИЕ не предоставляет ПОЛЬЗОВАТЕЛЮ никаких прав в отношении каких-либо товарных знаков или знаков обслуживания, принадлежащих ПРАВООБЛАДАТЕЛЮ или его партнерам/контрагентам.
3.4. Ни при каких обстоятельствах ПРАВООБЛАДАТЕЛЬ, а также его партнеры и контрагенты не несут ответственность за действия третьих лиц, временные технические сбои и перерывы в работе ПРОГРАММНОГО ПРОДУКТА, вызванные неполадками используемых технических средств, иные аналогичные сбои, а также вызванные неполадками компьютера, который ПОЛЬЗОВАТЕЛЬ использовал для работы с ПРОГРАММНЫМ ПРОДУКТОМ.
4. СРОК ДЕЙСТВИЯ СОГЛАШЕНИЯ
4.1. Настоящее СОГЛАШЕНИЕ вступает в силу с момента установки или копирования ПРОГРАММНОГО ПРОДУКТА.
4.2. По инициативе ПРАВООБЛАДАТЕЛЯ СОГЛАШЕНИЕ может быть расторгнуто в случае нарушения ПОЛЬЗОВАТЕЛЕМ условий настоящего СОГЛАШЕНИЯ.
5. ПРАВА НА ИНТЕЛЛЕКТУАЛЬНУЮ СОБСТВЕННОСТЬ
5.1. Правовой титул и все права интеллектуальной собственности на ПРОГРАММНЫЙ ПРОДУКТ, включая (но не ограничиваясь только этим) любые входящие в его состав элементы мультимедиа, текст и программы, а также содержание сопровождающих его печатных материалов и любые копии ПРОГРАММНОГО ПРОДУКТА принадлежат ПРАВООБЛАДАТЕЛЮ, за исключением случаев, указанных в 5.2. настоящего СОГЛАШЕНИЯ.
5.2. Правовой титул и все права на объекты интеллектуальной собственности, которые не являются разработкой ПРАВООБЛАДАТЕЛЯ, но входят в состав ПРОГРАММНОГО ПРОДУКТА, включая (но не ограничиваясь только этим) любые входящие в его состав элементы мультимедиа, текст и программы, и доступ к которым предоставляет ПРОГРАММНЫЙ ПРОДУКТ, принадлежат владельцам прав на такие элементы и защищены международными соглашениями и законодательством Российской Федерации о защите интеллектуальной собственности. Настоящее СОГЛАШЕНИЕ не предоставляет ПОЛЬЗОВАТЕЛЮ никаких прав на использование такого содержания ПРОГРАММНОГО ПРОДУКТА. Права на такое содержание ПРОГРАММНОГО ПРОДУКТА определяются отдельными лицензионными соглашениями правообладателей данных объектов интеллектуальной собственности.
5.3. За нарушение авторских прав ПРАВООБЛАДАТЕЛЯ на ПРОГРАММНЫЙ ПРОДУКТ ПОЛЬЗОВАТЕЛЬ несет гражданскую, административную или уголовную ответственность в соответствии с действующим законодательством Российской Федерации.
6. ГАРАНТИИ
6.1. ПРАВООБЛАДАТЕЛЬ гарантирует, что:
6.1.1. ПРОГРАММНЫЙ ПРОДУКТ содержится в полном объеме, соответствующем описанию, представленному в печатных материалах или электронной документации, которые входят в состав ПРОГРАММНОГО ПРОДУКТА.
6.1.2. Функции, которые выполняет ПРОГРАММНЫЙ ПРОДУКТ, соответствуют функциям, указанным в печатных и электронных материалах и (или) документации к ПРОГРАММНОМУ ПРОДУКТУ, либо превосходят их.
6.2. Настоящая гарантия недействительна, если сбой в работе ПРОГРАММНОГО ПРОДУКТА возник в результате неосторожности, неправильного обращения или применения, а также в случаях, перечисленных в 3.4. настоящего СОГЛАШЕНИЯ.
7. ПРИМЕНИМОЕ ЗАКОНОДАТЕЛЬСТВО
7.1. При использовании ПРОГРАММНОГО ПРОДУКТА применяются международные соглашения Российской Федерации и действующее законодательство Российской Федерации, регулирующее отношения в области интеллектуальной собственности.

@ -0,0 +1,88 @@
Последняя дата обновления — 01 сентября 2019 г.
Полностью заменяет предыдущую версию.
 
ЛИЦЕНЗИОННОЕ СОГЛАШЕНИЕ ДЛЯ КОНЕЧНОГО ПОЛЬЗОВАТЕЛЯ
ПО ИСПОЛЬЗОВАНИЮ
ОПЕРАЦИОННОЙ СИСТЕМЫ
«UBLINUX DESKTOP BASIC»
   
ВНИМАНИЕ! Прочтите внимательно нижеизложенное Лицензионное соглашение, прежде чем устанавливать, копировать или иным образом использовать приобретенный Программный продукт.
Любое использование приобретенного Программного продукта, в том числе его установка и копирование, означает согласие с условиями приведенного ниже Лицензионного соглашения.
  
Настоящее Лицензионное соглашение для конечного пользователя (СОГЛАШЕНИЕ) является юридически значимым соглашением между Вами (физическим или юридическим лицом) (ПОЛЬЗОВАТЕЛЕМ)
и обществом ограниченной ответственности «Юбитех» (ПРАВООБЛАДАТЕЛЕМ), которое является разработчиком Операционной системы «UB Linux Desktop Basic» (далее - ПРОГРАММНЫЙ ПРОДУКТ).
Устанавливая, копируя или иным образом используя ПРОГРАММНЫЙ ПРОДУКТ, ПОЛЬЗОВАТЕЛЬ тем самым соглашается с положениями настоящего СОГЛАШЕНИЯ. Если ПОЛЬЗОВАТЕЛЬ не согласен с
положениями настоящего СОГЛАШЕНИЯ, ПРАВООБЛАДАТЕЛЬ отказывает ему в праве на любое использование ПРОГРАММНОГО ПРОДУКТА. В этом случае ПОЛЬЗОВАТЕЛЬ не имеет права устанавливать,
копировать или иным образом использовать ПРОГРАММНЫЙ ПРОДУКТ, , а также вправе вернуть ПРОГРАММНЫЙ ПРОДУКТ организации, у которой его приобрел, при условии целостности (отсутствия
признаков вскрытия) товарной упаковки.
1. ОБЩИЕ ПОЛОЖЕНИЯ
1.1. ПРОГРАММНЫЙ ПРОДУКТ охраняется авторским правом, международными соглашениями о защите интеллектуальной собственности и действующим законодательством Российской Федерации.
1.2. ПРОГРАММНЫЙ ПРОДУКТ лицензируется, а не продается. ПРОГРАММНЫЙ ПРОДУКТ лицензируется как единое целое. Приобретение настоящего ПРОГРАММНОГО ПРОДУКТА это приобретение простой
(неисключительной) лицензии (права использования на условиях простой (неисключительной) лицензии) на его использование.
1.3. ПРОГРАММНЫЙ ПРОДУКТ включает в себя собственно компьютерную программу и электронную документацию на соответствующих носителях.
1.4. ПРОГРАММНЫЙ ПРОДУКТ является сложным объектом и содержит компоненты как собственной разработки ПРАВООБЛАДАТЕЛЯ, так и сторонних авторов.
1.5. При нарушении ПОЛЬЗОВАТЕЛЕМ положений данного СОГЛАШЕНИЯ ПРАВООБЛАДАТЕЛЬ имеет право отменить его действие. В этом случае ПОЛЬЗОВАТЕЛЬ обязан прекратить использование
ПРОГРАММНОГО ПРОДУКТА и уничтожить все его копии, находящиеся в распоряжении ПОЛЬЗОВАТЕЛЯ.
1.6. Все условия, оговоренные далее, относятся как к ПРОГРАММНОМУ ПРОДУКТУ в целом, так и ко всем его компонентам в отдельности.
2. НЕИСКЛЮЧИТЕЛЬНОЕ ПРАВО, ПРЕДОСТАВЛЯЕМОЕ ПОЛЬЗОВАТЕЛЮ
2.1. Настоящее СОГЛАШЕНИЕ предоставляет ПОЛЬЗОВАТЕЛЮ, являющемуся юридическим лицом (любой организационно-правовой формы), органом государственной власти или индивидуальным
предпринимателем право на установку и использование ПРОГРАММНОГО ПРОДУКТА на ОДНОМ компьютере и изготовление ОДНОЙ резервной копии, используемой в случае утраты или порчи
носителей из состава ПРОГРАММНОГО ПРОДУКТА, придерживаясь условий данного СОГЛАШЕНИЯ и правил, содержащихся в прилагаемой документации, на основании отдельно заключаемого
лицензионного договора.
2.2. Если ПОЛЬЗОВАТЕЛЕМ является частное физическое лицо, в рамках настоящего СОГЛАШЕНИЯ такому ПОЛЬЗОВАТЕЛЮ — физическому лицу предоставляется право на установку и использование
ПРОГРАММНОГО ПРОДУКТА на условиях простой (неисключительной) лицензии исключительно для личных, семейных, домашних и иных бытовых нужд, не связанных с осуществлением
предпринимательской деятельности (без цели извлечения прибыли или иной материальной выгоды), на неограниченном количестве компьютеров при условии соблюдения требований данного
СОГЛАШЕНИЯ и правил, содержащихся в прилагаемой печатной или электронной документации.
2.3. ПОЛЬЗОВАТЕЛЬ имеет право на получение обновлений ПРОГРАММНОГО ПРОДУКТА, общей технической поддержки и иных услуг от ПРАВООБЛАДАТЕЛЯ или его представителя по отдельному
договору, заключаемому с ПОЛЬЗОВАТЕЛЕМ.
3. ОГРАНИЧЕНИЯ
3.1. Настоящее СОГЛАШЕНИЕ НЕ дает ПОЛЬЗОВАТЕЛЮ права на:
3.1.1. Использование ПРОГРАММНОГО ПРОДУКТА при осуществлении предпринимательской деятельности, а также установку ПРОГРАММНОГО ПРОДУКТА на компьютеры юридических лиц (любой
организационно-правовой формы), органов государственной власти и/или индивидуальных предпринимателей без заключения соответствующего лицензионного (сублицензионного) договора.
3.1.2. Декомпиляцию и дизассемблирование любых составных частей ПРОГРАММНОГО ПРОДУКТА, кроме случаев, предусмотренных законодательством Российской Федерации.
3.1.3. Передачу в аренду, в залог или лизинг ПРОГРАММНОГО ПРОДУКТА.
3.1.4. Распространение ПРОГРАММНОГО ПРОДУКТА, любых его изменений или перевод его текста на другой язык.
3.2. ПРАВООБЛАДАТЕЛЬ не несет ответственности за любую информацию, которая создается или обрабатывается в процессе использования ПРОГРАММНОГО ПРОДУКТА.
3.3. Настоящее СОГЛАШЕНИЕ не предоставляет ПОЛЬЗОВАТЕЛЮ никаких прав в отношении каких-либо товарных знаков или знаков обслуживания, принадлежащих ПРАВООБЛАДАТЕЛЮ или его
партнерам/контрагентам.
3.4. Лицензии в отношении ПРОГРАММНОГО ПРОДУКТА предоставляются на условиях «как есть» (AS IS): ПРАВООБЛАДАТЕЛЬ не предоставляет никаких гарантий в отношении безошибочной и
бесперебойной работы ПРОГРАММНОГО ПРОДУКТА, соответствия ПРОГРАММНОГО ПРОДУКТА конкретным целям и ожиданиям ПОЛЬЗОВАТЕЛЯ, а также не предоставляют никаких иных гарантий, прямо
не указанных в настоящем СОГЛАШЕНИИ. ПОЛЬЗОВАТЕЛЬ принимает на себя ответственность за выбор ПРОГРАММНОГО ПРОДУКТА с целью достижения желаемых результатов, и в отношении
результатов, получаемых в ходе использования ПОЛЬЗОВАТЕЛЕМ ПРОГРАММНОГО ПРОДУКТА.
3.5. ПРАВООБЛАДАТЕЛЬ ни при каких условиях не несет ответственности перед ПОЛЬЗОВАТЕЛЕМ или любым иным лицом, связанным с ПОЛЬЗОВАТЕЛЕМ, в отношении любых непрямых, случайных,
косвенных, специальных, штрафных убытков или убытков, присуждаемых в качестве меры ответственности (включая, без ограничения, утратой данных или иными подобными убытками в
денежной форме), в соответствии с принципами договорного права, по гарантии, в связи с гражданским правонарушением (включая небрежность), ответственностью в отношении продукции
или на иных основаниях.
3.6. Ни при каких обстоятельствах ПРАВООБЛАДАТЕЛЬ, а также его партнеры и контрагенты не несут ответственность за действия третьих лиц, временные технические сбои и перерывы в
работе ПРОГРАММНОГО ПРОДУКТА, вызванные неполадками используемых технических средств, иные аналогичные сбои, а также вызванные неполадками компьютера, который ПОЛЬЗОВАТЕЛЬ
использовал для работы с ПРОГРАММНЫМ ПРОДУКТОМ.
4. СРОК ДЕЙСТВИЯ СОГЛАШЕНИЯ
4.1. Настоящее СОГЛАШЕНИЕ вступает в силу с момента установки или копирования ПРОГРАММНОГО ПРОДУКТА его ПОЛЬЗОВАТЕЛЕМ и действует до момента полного прекращения использования
ПРОГРАММНОГО ПРОДУКТА .
4.2. По инициативе ПРАВООБЛАДАТЕЛЯ СОГЛАШЕНИЕ может быть расторгнуто в случае нарушения ПОЛЬЗОВАТЕЛЕМ условий настоящего СОГЛАШЕНИЯ.
5. ПРАВА НА ИНТЕЛЛЕКТУАЛЬНУЮ СОБСТВЕННОСТЬ
5.1. Правовой титул и все права интеллектуальной собственности на ПРОГРАММНЫЙ ПРОДУКТ, включая (но не ограничиваясь только этим) любые входящие в его состав элементы мультимедиа,
текст и программы, а также содержание сопровождающих его печатных материалов и любые копии ПРОГРАММНОГО ПРОДУКТА принадлежат ПРАВООБЛАДАТЕЛЮ, за исключением случаев, указанных
в п. 5.2 настоящего СОГЛАШЕНИЯ.
5.2. Правовой титул и все права на объекты интеллектуальной собственности, которые не являются разработкой ПРАВООБЛАДАТЕЛЯ, но входят в состав ПРОГРАММНОГО ПРОДУКТА, включая
(но не ограничиваясь только этим) любые входящие в его состав элементы мультимедиа, текст и программы, и доступ к которым предоставляет ПРОГРАММНЫЙ ПРОДУКТ, принадлежат
владельцам прав на такие элементы и защищены международными соглашениями и законодательством Российской Федерации о защите интеллектуальной собственности. Настоящее СОГЛАШЕНИЕ
не предоставляет ПОЛЬЗОВАТЕЛЮ никаких прав на использование такого содержания ПРОГРАММНОГО ПРОДУКТА. Права на такое содержание ПРОГРАММНОГО ПРОДУКТА определяются отдельными
лицензионными соглашениями правообладателей данных объектов интеллектуальной собственности.
5.3. За нарушение авторских прав ПРАВООБЛАДАТЕЛЯ на ПРОГРАММНЫЙ ПРОДУКТ, в том числе за нарушение условия настоящего СОГЛАШЕНИЯ ПОЛЬЗОВАТЕЛЬ несет гражданскую, административную
или уголовную ответственность в соответствии с действующим законодательством Российской Федерации.
6. ГАРАНТИИ
6.1. ПРАВООБЛАДАТЕЛЬ гарантирует, что:
6.1.1. ПРОГРАММНЫЙ ПРОДУКТ содержится в полном объеме, соответствующем описанию, представленному в печатных материалах или электронной документации, которые входят в состав
ПРОГРАММНОГО ПРОДУКТА.
6.1.2. Функции, которые выполняет ПРОГРАММНЫЙ ПРОДУКТ, соответствуют функциям, указанным в печатных и электронных материалах и (или) документации к ПРОГРАММНОМУ ПРОДУКТУ, либо
превосходят их.
6.2. Настоящая гарантия недействительна, если сбой в работе ПРОГРАММНОГО ПРОДУКТА возник в результате неосторожности, неправильного обращения или применения, а также в случаях,
перечисленных в п. 3.6 настоящего СОГЛАШЕНИЯ.
7. ПРИМЕНИМОЕ ЗАКОНОДАТЕЛЬСТВО
7.1. При использовании ПРОГРАММНОГО ПРОДУКТА применяются международные соглашения Российской Федерации и действующее законодательство Российской Федерации, регулирующее отношения
в области интеллектуальной собственности.
8. ПРИОРИТЕТНОЕ ПРИМЕНЕНИЕ
8.1. В случае наличия противоречий между документами, включенными в электронном виде в ПРОГРАММНЫЙ ПРОДУКТ, и настоящим СОГЛАШЕНИЕМ, приоритет имеют положения настоящего СОГЛАШЕНИЯ
(в том числе относительно объема предоставляемых ПОЛЬЗОВАТЕЛЮ прав).

@ -0,0 +1,717 @@
License:
This software consicts of several parts designed by various
companies and contributors. Source scripts and the most of parts
are licensing under GNU GPL (http://www.gnu.org/copyleft/gpl.html).
This allows you to use, copy and modify it freely. Some of parts
are distributed with various licenses which can prohibit you
to hack and modify it.
(Please see documentation in /usr/share/doc/ or developer's websites)
Warranty:
This software is distributed with NO WARRANTY, use it at your own risk.
Authors:
UBLinux Team http://ublinux.ru
-------------------------------------------------------------------------
Лицензия:
Данное программное обеспечение (ПО) состоит из компонентов, созданных
различными людьми или организациями. Сборочные скрипты и основная
часть компонентов распространяются под лицензиями
GNU GPL (http://www.gnu.org/copyleft/gpl.html), которые позволяют
вам свободно использовать, тиражировать, адаптировать или
перераспределять компоненты, на которые распространяется действие
лицензий . Остальные компоненты имеют различные лицензии, которые могут
ограничивать исследование кода и изменение этих компонентов
(см. документацию в /usr/share/doc/ или на сайте производителя).
Гарантии:
Данное программное обеспечение поставляется без каких-либо гарантий
Авторы:
Сообщество UBLinux http://ublinux.ru
-------------------------------------------------------------------------
GNU GENERAL PUBLIC LICENSE
Version 3, 29 June 2007
Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The GNU General Public License is a free, copyleft license for
software and other kinds of works.
The licenses for most software and other practical works are designed
to take away your freedom to share and change the works. By contrast,
the GNU General Public License is intended to guarantee your freedom to
share and change all versions of a program--to make sure it remains free
software for all its users. We, the Free Software Foundation, use the
GNU General Public License for most of our software; it applies also to
any other work released this way by its authors. You can apply it to
your programs, too.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
them if you wish), that you receive source code or can get it if you
want it, that you can change the software or use pieces of it in new
free programs, and that you know you can do these things.
To protect your rights, we need to prevent others from denying you
these rights or asking you to surrender the rights. Therefore, you have
certain responsibilities if you distribute copies of the software, or if
you modify it: responsibilities to respect the freedom of others.
For example, if you distribute copies of such a program, whether
gratis or for a fee, you must pass on to the recipients the same
freedoms that you received. You must make sure that they, too, receive
or can get the source code. And you must show them these terms so they
know their rights.
Developers that use the GNU GPL protect your rights with two steps:
(1) assert copyright on the software, and (2) offer you this License
giving you legal permission to copy, distribute and/or modify it.
For the developers' and authors' protection, the GPL clearly explains
that there is no warranty for this free software. For both users' and
authors' sake, the GPL requires that modified versions be marked as
changed, so that their problems will not be attributed erroneously to
authors of previous versions.
Some devices are designed to deny users access to install or run
modified versions of the software inside them, although the manufacturer
can do so. This is fundamentally incompatible with the aim of
protecting users' freedom to change the software. The systematic
pattern of such abuse occurs in the area of products for individuals to
use, which is precisely where it is most unacceptable. Therefore, we
have designed this version of the GPL to prohibit the practice for those
products. If such problems arise substantially in other domains, we
stand ready to extend this provision to those domains in future versions
of the GPL, as needed to protect the freedom of users.
Finally, every program is threatened constantly by software patents.
States should not allow patents to restrict development and use of
software on general-purpose computers, but in those that do, we wish to
avoid the special danger that patents applied to a free program could
make it effectively proprietary. To prevent this, the GPL assures that
patents cannot be used to render the program non-free.
The precise terms and conditions for copying, distribution and
modification follow.
TERMS AND CONDITIONS
0. Definitions.
"This License" refers to version 3 of the GNU General Public License.
"Copyright" also means copyright-like laws that apply to other kinds of
works, such as semiconductor masks.
"The Program" refers to any copyrightable work licensed under this
License. Each licensee is addressed as "you". "Licensees" and
"recipients" may be individuals or organizations.
To "modify" a work means to copy from or adapt all or part of the work
in a fashion requiring copyright permission, other than the making of an
exact copy. The resulting work is called a "modified version" of the
earlier work or a work "based on" the earlier work.
A "covered work" means either the unmodified Program or a work based
on the Program.
To "propagate" a work means to do anything with it that, without
permission, would make you directly or secondarily liable for
infringement under applicable copyright law, except executing it on a
computer or modifying a private copy. Propagation includes copying,
distribution (with or without modification), making available to the
public, and in some countries other activities as well.
To "convey" a work means any kind of propagation that enables other
parties to make or receive copies. Mere interaction with a user through
a computer network, with no transfer of a copy, is not conveying.
An interactive user interface displays "Appropriate Legal Notices"
to the extent that it includes a convenient and prominently visible
feature that (1) displays an appropriate copyright notice, and (2)
tells the user that there is no warranty for the work (except to the
extent that warranties are provided), that licensees may convey the
work under this License, and how to view a copy of this License. If
the interface presents a list of user commands or options, such as a
menu, a prominent item in the list meets this criterion.
1. Source Code.
The "source code" for a work means the preferred form of the work
for making modifications to it. "Object code" means any non-source
form of a work.
A "Standard Interface" means an interface that either is an official
standard defined by a recognized standards body, or, in the case of
interfaces specified for a particular programming language, one that
is widely used among developers working in that language.
The "System Libraries" of an executable work include anything, other
than the work as a whole, that (a) is included in the normal form of
packaging a Major Component, but which is not part of that Major
Component, and (b) serves only to enable use of the work with that
Major Component, or to implement a Standard Interface for which an
implementation is available to the public in source code form. A
"Major Component", in this context, means a major essential component
(kernel, window system, and so on) of the specific operating system
(if any) on which the executable work runs, or a compiler used to
produce the work, or an object code interpreter used to run it.
The "Corresponding Source" for a work in object code form means all
the source code needed to generate, install, and (for an executable
work) run the object code and to modify the work, including scripts to
control those activities. However, it does not include the work's
System Libraries, or general-purpose tools or generally available free
programs which are used unmodified in performing those activities but
which are not part of the work. For example, Corresponding Source
includes interface definition files associated with source files for
the work, and the source code for shared libraries and dynamically
linked subprograms that the work is specifically designed to require,
such as by intimate data communication or control flow between those
subprograms and other parts of the work.
The Corresponding Source need not include anything that users
can regenerate automatically from other parts of the Corresponding
Source.
The Corresponding Source for a work in source code form is that
same work.
2. Basic Permissions.
All rights granted under this License are granted for the term of
copyright on the Program, and are irrevocable provided the stated
conditions are met. This License explicitly affirms your unlimited
permission to run the unmodified Program. The output from running a
covered work is covered by this License only if the output, given its
content, constitutes a covered work. This License acknowledges your
rights of fair use or other equivalent, as provided by copyright law.
You may make, run and propagate covered works that you do not
convey, without conditions so long as your license otherwise remains
in force. You may convey covered works to others for the sole purpose
of having them make modifications exclusively for you, or provide you
with facilities for running those works, provided that you comply with
the terms of this License in conveying all material for which you do
not control copyright. Those thus making or running the covered works
for you must do so exclusively on your behalf, under your direction
and control, on terms that prohibit them from making any copies of
your copyrighted material outside their relationship with you.
Conveying under any other circumstances is permitted solely under
the conditions stated below. Sublicensing is not allowed; section 10
makes it unnecessary.
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
No covered work shall be deemed part of an effective technological
measure under any applicable law fulfilling obligations under article
11 of the WIPO copyright treaty adopted on 20 December 1996, or
similar laws prohibiting or restricting circumvention of such
measures.
When you convey a covered work, you waive any legal power to forbid
circumvention of technological measures to the extent such circumvention
is effected by exercising rights under this License with respect to
the covered work, and you disclaim any intention to limit operation or
modification of the work as a means of enforcing, against the work's
users, your or third parties' legal rights to forbid circumvention of
technological measures.
4. Conveying Verbatim Copies.
You may convey verbatim copies of the Program's source code as you
receive it, in any medium, provided that you conspicuously and
appropriately publish on each copy an appropriate copyright notice;
keep intact all notices stating that this License and any
non-permissive terms added in accord with section 7 apply to the code;
keep intact all notices of the absence of any warranty; and give all
recipients a copy of this License along with the Program.
You may charge any price or no price for each copy that you convey,
and you may offer support or warranty protection for a fee.
5. Conveying Modified Source Versions.
You may convey a work based on the Program, or the modifications to
produce it from the Program, in the form of source code under the
terms of section 4, provided that you also meet all of these conditions:
a) The work must carry prominent notices stating that you modified
it, and giving a relevant date.
b) The work must carry prominent notices stating that it is
released under this License and any conditions added under section
7. This requirement modifies the requirement in section 4 to
"keep intact all notices".
c) You must license the entire work, as a whole, under this
License to anyone who comes into possession of a copy. This
License will therefore apply, along with any applicable section 7
additional terms, to the whole of the work, and all its parts,
regardless of how they are packaged. This License gives no
permission to license the work in any other way, but it does not
invalidate such permission if you have separately received it.
d) If the work has interactive user interfaces, each must display
Appropriate Legal Notices; however, if the Program has interactive
interfaces that do not display Appropriate Legal Notices, your
work need not make them do so.
A compilation of a covered work with other separate and independent
works, which are not by their nature extensions of the covered work,
and which are not combined with it such as to form a larger program,
in or on a volume of a storage or distribution medium, is called an
"aggregate" if the compilation and its resulting copyright are not
used to limit the access or legal rights of the compilation's users
beyond what the individual works permit. Inclusion of a covered work
in an aggregate does not cause this License to apply to the other
parts of the aggregate.
6. Conveying Non-Source Forms.
You may convey a covered work in object code form under the terms
of sections 4 and 5, provided that you also convey the
machine-readable Corresponding Source under the terms of this License,
in one of these ways:
a) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by the
Corresponding Source fixed on a durable physical medium
customarily used for software interchange.
b) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by a
written offer, valid for at least three years and valid for as
long as you offer spare parts or customer support for that product
model, to give anyone who possesses the object code either (1) a
copy of the Corresponding Source for all the software in the
product that is covered by this License, on a durable physical
medium customarily used for software interchange, for a price no
more than your reasonable cost of physically performing this
conveying of source, or (2) access to copy the
Corresponding Source from a network server at no charge.
c) Convey individual copies of the object code with a copy of the
written offer to provide the Corresponding Source. This
alternative is allowed only occasionally and noncommercially, and
only if you received the object code with such an offer, in accord
with subsection 6b.
d) Convey the object code by offering access from a designated
place (gratis or for a charge), and offer equivalent access to the
Corresponding Source in the same way through the same place at no
further charge. You need not require recipients to copy the
Corresponding Source along with the object code. If the place to
copy the object code is a network server, the Corresponding Source
may be on a different server (operated by you or a third party)
that supports equivalent copying facilities, provided you maintain
clear directions next to the object code saying where to find the
Corresponding Source. Regardless of what server hosts the
Corresponding Source, you remain obligated to ensure that it is
available for as long as needed to satisfy these requirements.
e) Convey the object code using peer-to-peer transmission, provided
you inform other peers where the object code and Corresponding
Source of the work are being offered to the general public at no
charge under subsection 6d.
A separable portion of the object code, whose source code is excluded
from the Corresponding Source as a System Library, need not be
included in conveying the object code work.
A "User Product" is either (1) a "consumer product", which means any
tangible personal property which is normally used for personal, family,
or household purposes, or (2) anything designed or sold for incorporation
into a dwelling. In determining whether a product is a consumer product,
doubtful cases shall be resolved in favor of coverage. For a particular
product received by a particular user, "normally used" refers to a
typical or common use of that class of product, regardless of the status
of the particular user or of the way in which the particular user
actually uses, or expects or is expected to use, the product. A product
is a consumer product regardless of whether the product has substantial
commercial, industrial or non-consumer uses, unless such uses represent
the only significant mode of use of the product.
"Installation Information" for a User Product means any methods,
procedures, authorization keys, or other information required to install
and execute modified versions of a covered work in that User Product from
a modified version of its Corresponding Source. The information must
suffice to ensure that the continued functioning of the modified object
code is in no case prevented or interfered with solely because
modification has been made.
If you convey an object code work under this section in, or with, or
specifically for use in, a User Product, and the conveying occurs as
part of a transaction in which the right of possession and use of the
User Product is transferred to the recipient in perpetuity or for a
fixed term (regardless of how the transaction is characterized), the
Corresponding Source conveyed under this section must be accompanied
by the Installation Information. But this requirement does not apply
if neither you nor any third party retains the ability to install
modified object code on the User Product (for example, the work has
been installed in ROM).
The requirement to provide Installation Information does not include a
requirement to continue to provide support service, warranty, or updates
for a work that has been modified or installed by the recipient, or for
the User Product in which it has been modified or installed. Access to a
network may be denied when the modification itself materially and
adversely affects the operation of the network or violates the rules and
protocols for communication across the network.
Corresponding Source conveyed, and Installation Information provided,
in accord with this section must be in a format that is publicly
documented (and with an implementation available to the public in
source code form), and must require no special password or key for
unpacking, reading or copying.
7. Additional Terms.
"Additional permissions" are terms that supplement the terms of this
License by making exceptions from one or more of its conditions.
Additional permissions that are applicable to the entire Program shall
be treated as though they were included in this License, to the extent
that they are valid under applicable law. If additional permissions
apply only to part of the Program, that part may be used separately
under those permissions, but the entire Program remains governed by
this License without regard to the additional permissions.
When you convey a copy of a covered work, you may at your option
remove any additional permissions from that copy, or from any part of
it. (Additional permissions may be written to require their own
removal in certain cases when you modify the work.) You may place
additional permissions on material, added by you to a covered work,
for which you have or can give appropriate copyright permission.
Notwithstanding any other provision of this License, for material you
add to a covered work, you may (if authorized by the copyright holders of
that material) supplement the terms of this License with terms:
a) Disclaiming warranty or limiting liability differently from the
terms of sections 15 and 16 of this License; or
b) Requiring preservation of specified reasonable legal notices or
author attributions in that material or in the Appropriate Legal
Notices displayed by works containing it; or
c) Prohibiting misrepresentation of the origin of that material, or
requiring that modified versions of such material be marked in
reasonable ways as different from the original version; or
d) Limiting the use for publicity purposes of names of licensors or
authors of the material; or
e) Declining to grant rights under trademark law for use of some
trade names, trademarks, or service marks; or
f) Requiring indemnification of licensors and authors of that
material by anyone who conveys the material (or modified versions of
it) with contractual assumptions of liability to the recipient, for
any liability that these contractual assumptions directly impose on
those licensors and authors.
All other non-permissive additional terms are considered "further
restrictions" within the meaning of section 10. If the Program as you
received it, or any part of it, contains a notice stating that it is
governed by this License along with a term that is a further
restriction, you may remove that term. If a license document contains
a further restriction but permits relicensing or conveying under this
License, you may add to a covered work material governed by the terms
of that license document, provided that the further restriction does
not survive such relicensing or conveying.
If you add terms to a covered work in accord with this section, you
must place, in the relevant source files, a statement of the
additional terms that apply to those files, or a notice indicating
where to find the applicable terms.
Additional terms, permissive or non-permissive, may be stated in the
form of a separately written license, or stated as exceptions;
the above requirements apply either way.
8. Termination.
You may not propagate or modify a covered work except as expressly
provided under this License. Any attempt otherwise to propagate or
modify it is void, and will automatically terminate your rights under
this License (including any patent licenses granted under the third
paragraph of section 11).
However, if you cease all violation of this License, then your
license from a particular copyright holder is reinstated (a)
provisionally, unless and until the copyright holder explicitly and
finally terminates your license, and (b) permanently, if the copyright
holder fails to notify you of the violation by some reasonable means
prior to 60 days after the cessation.
Moreover, your license from a particular copyright holder is
reinstated permanently if the copyright holder notifies you of the
violation by some reasonable means, this is the first time you have
received notice of violation of this License (for any work) from that
copyright holder, and you cure the violation prior to 30 days after
your receipt of the notice.
Termination of your rights under this section does not terminate the
licenses of parties who have received copies or rights from you under
this License. If your rights have been terminated and not permanently
reinstated, you do not qualify to receive new licenses for the same
material under section 10.
9. Acceptance Not Required for Having Copies.
You are not required to accept this License in order to receive or
run a copy of the Program. Ancillary propagation of a covered work
occurring solely as a consequence of using peer-to-peer transmission
to receive a copy likewise does not require acceptance. However,
nothing other than this License grants you permission to propagate or
modify any covered work. These actions infringe copyright if you do
not accept this License. Therefore, by modifying or propagating a
covered work, you indicate your acceptance of this License to do so.
10. Automatic Licensing of Downstream Recipients.
Each time you convey a covered work, the recipient automatically
receives a license from the original licensors, to run, modify and
propagate that work, subject to this License. You are not responsible
for enforcing compliance by third parties with this License.
An "entity transaction" is a transaction transferring control of an
organization, or substantially all assets of one, or subdividing an
organization, or merging organizations. If propagation of a covered
work results from an entity transaction, each party to that
transaction who receives a copy of the work also receives whatever
licenses to the work the party's predecessor in interest had or could
give under the previous paragraph, plus a right to possession of the
Corresponding Source of the work from the predecessor in interest, if
the predecessor has it or can get it with reasonable efforts.
You may not impose any further restrictions on the exercise of the
rights granted or affirmed under this License. For example, you may
not impose a license fee, royalty, or other charge for exercise of
rights granted under this License, and you may not initiate litigation
(including a cross-claim or counterclaim in a lawsuit) alleging that
any patent claim is infringed by making, using, selling, offering for
sale, or importing the Program or any portion of it.
11. Patents.
A "contributor" is a copyright holder who authorizes use under this
License of the Program or a work on which the Program is based. The
work thus licensed is called the contributor's "contributor version".
A contributor's "essential patent claims" are all patent claims
owned or controlled by the contributor, whether already acquired or
hereafter acquired, that would be infringed by some manner, permitted
by this License, of making, using, or selling its contributor version,
but do not include claims that would be infringed only as a
consequence of further modification of the contributor version. For
purposes of this definition, "control" includes the right to grant
patent sublicenses in a manner consistent with the requirements of
this License.
Each contributor grants you a non-exclusive, worldwide, royalty-free
patent license under the contributor's essential patent claims, to
make, use, sell, offer for sale, import and otherwise run, modify and
propagate the contents of its contributor version.
In the following three paragraphs, a "patent license" is any express
agreement or commitment, however denominated, not to enforce a patent
(such as an express permission to practice a patent or covenant not to
sue for patent infringement). To "grant" such a patent license to a
party means to make such an agreement or commitment not to enforce a
patent against the party.
If you convey a covered work, knowingly relying on a patent license,
and the Corresponding Source of the work is not available for anyone
to copy, free of charge and under the terms of this License, through a
publicly available network server or other readily accessible means,
then you must either (1) cause the Corresponding Source to be so
available, or (2) arrange to deprive yourself of the benefit of the
patent license for this particular work, or (3) arrange, in a manner
consistent with the requirements of this License, to extend the patent
license to downstream recipients. "Knowingly relying" means you have
actual knowledge that, but for the patent license, your conveying the
covered work in a country, or your recipient's use of the covered work
in a country, would infringe one or more identifiable patents in that
country that you have reason to believe are valid.
If, pursuant to or in connection with a single transaction or
arrangement, you convey, or propagate by procuring conveyance of, a
covered work, and grant a patent license to some of the parties
receiving the covered work authorizing them to use, propagate, modify
or convey a specific copy of the covered work, then the patent license
you grant is automatically extended to all recipients of the covered
work and works based on it.
A patent license is "discriminatory" if it does not include within
the scope of its coverage, prohibits the exercise of, or is
conditioned on the non-exercise of one or more of the rights that are
specifically granted under this License. You may not convey a covered
work if you are a party to an arrangement with a third party that is
in the business of distributing software, under which you make payment
to the third party based on the extent of your activity of conveying
the work, and under which the third party grants, to any of the
parties who would receive the covered work from you, a discriminatory
patent license (a) in connection with copies of the covered work
conveyed by you (or copies made from those copies), or (b) primarily
for and in connection with specific products or compilations that
contain the covered work, unless you entered into that arrangement,
or that patent license was granted, prior to 28 March 2007.
Nothing in this License shall be construed as excluding or limiting
any implied license or other defenses to infringement that may
otherwise be available to you under applicable patent law.
12. No Surrender of Others' Freedom.
If conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot convey a
covered work so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you may
not convey it at all. For example, if you agree to terms that obligate you
to collect a royalty for further conveying from those to whom you convey
the Program, the only way you could satisfy both those terms and this
License would be to refrain entirely from conveying the Program.
13. Use with the GNU Affero General Public License.
Notwithstanding any other provision of this License, you have
permission to link or combine any covered work with a work licensed
under version 3 of the GNU Affero General Public License into a single
combined work, and to convey the resulting work. The terms of this
License will continue to apply to the part which is the covered work,
but the special requirements of the GNU Affero General Public License,
section 13, concerning interaction through a network will apply to the
combination as such.
14. Revised Versions of this License.
The Free Software Foundation may publish revised and/or new versions of
the GNU General Public License from time to time. Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
Each version is given a distinguishing version number. If the
Program specifies that a certain numbered version of the GNU General
Public License "or any later version" applies to it, you have the
option of following the terms and conditions either of that numbered
version or of any later version published by the Free Software
Foundation. If the Program does not specify a version number of the
GNU General Public License, you may choose any version ever published
by the Free Software Foundation.
If the Program specifies that a proxy can decide which future
versions of the GNU General Public License can be used, that proxy's
public statement of acceptance of a version permanently authorizes you
to choose that version for the Program.
Later license versions may give you additional or different
permissions. However, no additional obligations are imposed on any
author or copyright holder as a result of your choosing to follow a
later version.
15. Disclaimer of Warranty.
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
16. Limitation of Liability.
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
SUCH DAMAGES.
17. Interpretation of Sections 15 and 16.
If the disclaimer of warranty and limitation of liability provided
above cannot be given local legal effect according to their terms,
reviewing courts shall apply local law that most closely approximates
an absolute waiver of all civil liability in connection with the
Program, unless a warranty or assumption of liability accompanies a
copy of the Program in return for a fee.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest
to attach them to the start of each source file to most effectively
state the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
<one line to give the program's name and a brief idea of what it does.>
Copyright (C) <year> <name of author>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
Also add information on how to contact you by electronic and paper mail.
If the program does terminal interaction, make it output a short
notice like this when it starts in an interactive mode:
<program> Copyright (C) <year> <name of author>
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.
The hypothetical commands `show w' and `show c' should show the appropriate
parts of the General Public License. Of course, your program's commands
might be different; for a GUI interface, you would use an "about box".
You should also get your employer (if you work as a programmer) or school,
if any, to sign a "copyright disclaimer" for the program, if necessary.
For more information on this, and how to apply and follow the GNU GPL, see
<http://www.gnu.org/licenses/>.
The GNU General Public License does not permit incorporating your program
into proprietary programs. If your program is a subroutine library, you
may consider it more useful to permit linking proprietary applications with
the library. If this is what you want to do, use the GNU Lesser General
Public License instead of this License. But first, please read
<http://www.gnu.org/philosophy/why-not-lgpl.html>.

@ -0,0 +1,435 @@
#!/bin/bash
# Make from ini file text file with strings like [SECTION]Name=Value
# $1 - input filename
# stdout - result file
export TEXTDOMAINDIR=/usr/share/locale
export TEXTDOMAIN=ublinux_functions
function ini2simple()
{
SECTION='[]'
cat $1 | while read a ;do
[ "$a" = "" ] && continue
if [ "${a#\[*\]}" = "" -a "$a" != "" ] ;then
SECTION=$a
else
echo "$SECTION$a"
fi
done
}
# Restore ini file from text file with strings like [SECTION]Name=Value
# $1 - input filename
# stdout - result file
function simple2ini()
{
LASTSECTION='[]'
cat $1 | while read a ;do
SECTION=${a%%\]*}']'
if [ "$SECTION" != "$LASTSECTION" ] ;then
[ "LASTSECTION" != "[]" ] && echo
echo "$SECTION"
LASTSECTION=$SECTION
fi
echo ${a#\[*\]}
done
}
# It include string from $2 file and apply to $1 file
# $1 - base file
# $2 - included file
function apply2simple()
{
cat "$2" | while read a ;do
SECTION=${a%%\]*}
SECTION=${SECTION#\[}
STR=${a#\[*\]}
PNAME=${STR%%=*}
PVAL=${a#*=}
# echo $SECTION $PNAME $PVAL
echo -ne >"$1.tmp"
echo -ne >"$1.lck"
FOUNDS=
cat "$1" | while read b ;do
BSECTION=${b%%\]*}
BSECTION=${BSECTION#\[}
BSTR=${b#\[*\]}
BPNAME=${BSTR%%=*}
BPVAL=${b#*=}
[ "$BSECTION" = "$SECTION" ] && FOUNDS=1
if [ "$BSECTION" = "$SECTION" -a "$BPNAME" = "$PNAME" ] ;then
b="$a"
rm -f "$1.lck"
fi
if [ "$BSECTION" != "$SECTION" -a "$FOUNDS" != "" -a -f "$1.lck" ] ;then
echo "$a" >> "$1.tmp"
rm -f "$1.lck"
fi
echo "$b" >> "$1.tmp"
done
[ -f "$1.lck" ] && echo "$a" >> "$1.tmp"
mv -f "$1.tmp" "$1"
rm -f "$1.lck"
done
}
# It include string from $2 ini file and apply to $1 ini file
# $1 - base file
# $2 - included file
function concatenate_ini()
{
[ -f "$1" -a -f "$2" ] || return 1
ini2simple "$1" >"$1.tmp"
ini2simple "$2" >"$2.tmp"
apply2simple "$1.tmp" "$2.tmp"
simple2ini "$1.tmp" >"$1"
rm -f "$1.tmp" "$2.tmp"
}
detectDE()
{
if [ x"$KDE_FULL_SESSION" = x"true" ]; then SESSION=kde
elif [ x"$XDG_CURRENT_DESKTOP" = x"XFCE" ]; then SESSION=xfce
elif [ x"$DESKTOP_SESSION" = x"LXDE" ]; then SESSION=lxde
elif [ x"$XDG_CURRENT_DESKTOP" = x"LXQt" ]; then SESSION=lxqt
elif [ x"$DESKTOP_SESSION" = x"i3" ]; then SESSION=i3
elif [ x"$XDG_CURRENT_DESKTOP" = x"i3" ]; then SESSION=i3
elif [ x"$DESKTOP_SESSION" = x"i3term" ]; then SESSION=i3term
elif [ x"$XDG_CURRENT_DESKTOP" = x"i3term" ]; then SESSION=i3term
elif [ x"$XDG_CURRENT_DESKTOP" = x"MATE" ]; then SESSION=mate
fi
if [ -z "$SESSION" ]; then
ps -A | grep -q "xfce4-session" && SESSION=xfce
ps -A | grep -q "kdeinit" && SESSION=kde
ps -A | grep -q " i3$" && SESSION=i3
ps -A | grep -q " i3term$" && SESSION=i3term
ps -A | grep -q "gnome-panel" && SESSION=gnome
ps -A | grep -q "gnome-shell" && SESSION=gnome-shell
fi
[ "$SESSION" = "kde" -a -f /etc/X11/wmsession.d/01Plasma ] && SESSION=plasma
[ -z "$SESSION" -a -x /usr/bin/startxfce4 ] && SESSION=xfce
[ -z "$SESSION" -a -x /usr/bin/startlxde ] && SESSION=lxde
[ -z "$SESSION" -a -x /usr/bin/startlxqt ] && SESSION=lxqt
echo $SESSION
}
# ===========================================================
# liblinuxlive functions
# ===========================================================
debug_log()
{
if grep -q "debug" /proc/cmdline ; then
echo "- debug: $*" >&2
log "- debug: $*"
fi
}
log()
{
echo "$@" 2>/dev/null >>/var/log/ublinuxlog
}
debug_mode()
{
if [ "$(cmdline_parameter debug)" -o "$DEBUGMODE" == "yes" ] ; then
name=$(basename $0)
slash="/"
[ "$(pwd)" == "/union" ] && slash=""
if ! test -f ${slash}var/log/ublinux/${name}.log ; then
echo "$0 -- debug mode enabled"
test -d ${slash}var/log/ublinux || mkdir -p ${slash}var/log/ublinux
echo $(date) > ${slash}var/log/ublinux/${name}.log || echo "can not create log file"
$0 "$@" 2>&1 | tee -a ${slash}var/log/ublinux/${name}.log
exit 0
fi
fi
}
echodebug()
{
[ "$DEBUG_IS_ENABLED" -o "$DEBUGMODE" == "yes" ] && echo "$1"
if [ -n "$2" ] ;then
command=$2
shift ; shift
if [ -z $1 ] ;then
$command
else
$command "$@"
fi
fi
}
# Create module
# call mksquashfs with apropriate arguments
# $1 = directory which will be compressed to squashfs module
# $2 = output filesystem module file
# $3..$9 = optional arguments like -keep-as-directory or -b 123456789
#
create_module()
{
. /usr/lib/ublinux/os-config
. /etc/ublinux/config 2>/dev/null
echo " $@ " | egrep -q ' -comp | -noD ' && MKSQFS_OPTS=
mksquashfs "$1" "$2" $MKSQFS_OPTS $3 $4 $5 $6 $7 $8 $9 -noappend >/dev/null || return 1
chmod 444 "$2"
}
# look into cmdline and echo $1 back if $1 is set
# $1 = value name, case sensitive, for example 'debug'
#
cmdline_parameter()
{
. /etc/ublinux/config 2>/dev/null || . etc/ublinux/config 2>/dev/null
echo -n " $CMDLINE " | cat /proc/cmdline - 2>/dev/null | tr "[:cntrl:]" " " | egrep -m1 -o "(^|[[:space:]])$1([[:space:]]|\$)" | head -1 | tr -d " "
}
# look into cmdline and echo value of $1 option
# $1 = value name, case sensitive, for example 'changes'
#
cmdline_value()
{
. /etc/ublinux/config 2>/dev/null || . etc/ublinux/config 2>/dev/null
echo -n " $CMDLINE " | cat /proc/cmdline - 2>/dev/null | tr "[:cntrl:]" " " | egrep -m1 -o "(^|[[:space:]])$1=[^[:space:]]+" | head -1 | cut -d "=" -f 2-
}
# Find and run all scripts from the given module
# This function is used by the activate and deactivate script when the distro
# is already started, not during live setup
# $1 = mounted module full path
# $2..$n = optional arguments for the scripts, eg. 'start'
#
find_n_run_scripts()
{
debug_log "find_n_run_scripts" "$*"
local MOD
MOD="$1"
shift
RCPATH=/etc/rc.d/init.d
[ -d $RCPATH ] || RCPATH=/etc/init.d
RUNLEVEL=$(runlevel | awk '{print $2}')
[ -d "/etc/rc$RUNLEVEL.d" ] && RCPATH=/etc/rc$RUNLEVEL.d
[ -d "/etc/rc.d/rc$RUNLEVEL.d" ] && RCPATH=/etc/rc.d/rc$RUNLEVEL.d
RUNSCRIPTS="$MOD$RCPATH|$MOD/usr/lib/ublinux/rc.local|$MOD/usr/lib/ublinux/rc.post"
echo $@ | grep -q start || RUNSCRIPTS="$MOD$RCPATH"
find "$MOD" | egrep "$RUNSCRIPTS" | cut -b "${#MOD}"- | cut -b 2- | xargs -n 1 -r readlink -f | sort -u | \
while read SCRIPT; do
if [ "$SCRIPT" != "" -a -x "$SCRIPT" -a ! -d "$SCRIPT" ]; then
# call the script by real path, not from the module
log "starting '"$SCRIPT" $@'"
"${SCRIPT}" "$@"
fi
done
}
# test if the script is started by root user. If not, exit
allow_only_root()
{
if [ "0$UID" -ne 0 ]; then
echo "Only root can run $(basename $0)"; exit 1
fi
}
#####################
# Hotkeys functions #
#####################
show_run()
{
DE=$(detectDE)
if [ "$DE" = "kde" -o "$DE" = "plasma" ] ; then
krunner
elif [ "$DE" = "gnome" ] ; then
gnome-panel-control --run-dialog
elif [ "$DE" = "lxqt" ] ; then
lxqt-runner
else
rofi -config /usr/share/ublinux/i3/rofi.cfg -show
fi
}
lock_session()
{
DE=$(detectDE)
# qdbus org.freedesktop.ScreenSaver /ScreenSaver org.freedesktop.ScreenSaver.Lock
xterm -geometry 0x0+1+1 -e "dbus-send --dest=org.freedesktop.ScreenSaver --print-reply /ScreenSaver org.freedesktop.ScreenSaver.Lock"
if [ "$DE" != "kde" -a "$DE" != "plasma" ] ; then
ps -U $(id -u) | grep -q xscreensaver || xscreensaver -no-splash &
sleep 0.5s
xscreensaver-command -lock
fi
}
xss_slideshow()
{
chbg -xscreensaver -randomize -R -effect 1 -interval 0.2 -mode smart -max_size 100 -R /usr/share/ublinux/screensaver/Default >/dev/null 2>&1
}
xss_heartbeat()
{
. /usr/lib/ublinux/os-config
. /etc/ublinux/config 2>/dev/null
SSAVERBLOCKAPPS="$(echo "$SSAVERBLOCKAPPS"| tr ',; ' '|' )"
bash -c "while true ;do top -bn1 -u $(id -un) | awk '{ print \$7 FS \$NF }' | grep ^[1-9] | egrep -q \"$SSAVERBLOCKAPPS\" && xscreensaver-command -deactivate >/dev/null ; sleep 20s ; done " &
}
show_hotkeys()
{
MSG1=$(gettext -s "UBLinux magic keys:")
echo "$MSG1" > /tmp/listkeys
echo " " >> /tmp/listkeys
cat $HOME/.xbindkeysrc | sed -e 's/^".*"//' -e 's/Mod4/WIN/' -e '/^#.*#/ d' -e '/^ *$/ d' -e 's/^# *//' | while read a ; do
gettext -s "$a" >> /tmp/listkeys
done
mdialog --textbox /tmp/listkeys 600 600
rm -f /tmp/listkeys
}
show_info()
{
. /etc/os-release
LIVECDNAME="$NAME"
UPTIME=$(uptime | awk '{print "time - "$1", up - "$3}')
RAM=$(free -m | grep Mem | awk '{ print "total - "$2", free - "$4}')
SWAP=$(free -m | grep Swap | awk '{ print "total - "$2", free - "$4}')
CPU="$(cat /proc/cpuinfo | sed -e '/model name/!d' -e 's/^.*://')"
CPUARCH=$(uname -p)
KERNEL=$(uname -r)
VIDEO=$(lspci | sed -e '/VGA/!d' -e 's/^.*://')
GLXINFO=$(glxinfo | sed '2,3!d')
AUDIO=$(lspci | sed -e '/Audio/!d' -e 's/^.*://')
CMDLINE=$(cat /proc/cmdline)
VERSION=$(cat /etc/ublinux-release)
if [ $(cmdline_parameter unionfs) ] ;then
PROF_SIZE=$(df -h / |grep unionfs | awk '{print " ["$5"] total - "$2", free - "$4}')
else
PROF_SIZE=$(df -h / |grep aufs | awk '{print " ["$5"] total - "$2", free - "$4}')
fi
echo "$LIVECDNAME ($VERSION)" > ~/info.txt
echo "UPTIME: $UPTIME" >> ~/info.txt
echo "KERNEL: $KERNEL" >> ~/info.txt
echo "RAM: $RAM" >> ~/info.txt
echo "SWAP: $SWAP" >> ~/info.txt
[ "$(cat /proc/cmdline | grep changes= )" ] && echo "PROFILE: $PROF_SIZE" >> ~/info.txt
echo -e "CPU: ($CPUARCH) \n$CPU" >> ~/info.txt
echo "VIDEO: $VIDEO" >> ~/info.txt
echo "$GLXINFO" >> ~/info.txt
echo "AUDIO: $AUDIO" >> ~/info.txt
echo "CMDLINE: $CMDLINE" >> ~/info.txt
echo "MODULES:" >> ~/info.txt
grep squashfs /proc/mounts | awk '{print $2}' | sort >> ~/info.txt
mdialog --textbox $HOME/info.txt
rm -f $HOME/info.txt
}
touchpad()
{
MSG2=$(gettext -s "Touchpad disabled, WIN+t to enable again")
if [ $(synclient -l | grep TouchpadOff | awk '{ print $3 }') -eq 0 ] ;then
synclient TouchpadOff=1
mdialog --passivepopup "$MSG2"
else
synclient TouchpadOff=0
fi
}
rfswitch()
{
MSG3=$(gettext -s "bluetooth, WI-FI interfaces disabled, WIN+w to enable again")
rfkill list | grep yes
if [ $? -eq 0 ] ;then
rfkill unblock all
else
rfkill block all
mdialog --passivepopup "$MSG3"
fi
}
recordvideo()
{
MSG1=$(gettext -s "Recording are stoped, please wait for encoding")
MSG2=$(gettext -s "Video are encoded and placed to your home dir")
RMDOPT=
. /etc/ublinux/config 2>/dev/null
ps -U $UID | grep -q pulseaudio && RMDOPT="$RMDOPT --device pulse"
PID=$(ps -U $UID -o pid,comm | grep recordmydesktop | awk '{print $1}')
if [ -z "$PID" ] ;then
recordmydesktop $RMDOPT &
else
kill "$PID"
mdialog --passivepopup "$MSG1"
bash -c "while true ;do ps -A -o pid | grep -q ^$PID$ || break ; sleep 1s ;done ; mdialog --passivepopup \"$MSG2\""
fi
}
show_network()
{
echo "netstat --inet" > ~/network.txt
netstat --inet >> ~/network.txt
echo -e "\nlsof -i" >> ~/network.txt
/usr/sbin/lsof -i >> ~/network.txt
mdialog --textbox $HOME/network.txt 600 250
rm -f $HOME/info.txt
}
google_search()
{
xclip -o | sed -r '2~1d;s/(^\s+|\s+$)//g;s/%/%25/g;s/#/%23/g;s/\$/%24/g;s/&/%26/g;s/\+/%2B/;s/,/%2C/g;s/:/%3A/g;s/;/%3B/g;s/=/%3D/g;s/\?/%3F/g;s/@/%40/g;s/\s/+/g' | awk '{print "http://www.google.ru/search?hl=ru&q=" $1}' | xargs firefox -new-tab
}
translate_en_rus()
{
[ "$1" == "passive" ] && mdialog --passivepopup "$(wget -U "Mozilla/5.0" -qO - "http://translate.google.com/translate_a/t?client=t&text=$(xclip -o | sed "s/[\"'<>]//g")&sl=auto&tl=ru" | sed 's/\[\[\[\"//' | cut -d \" -f 1)"
[ "$1" == "msgbox" ] && mdialog --msgbox "$(wget -U "Mozilla/5.0" -qO - "http://translate.google.com/translate_a/t?client=t&text=$(xclip -o | sed "s/[\"'<>]//g")&sl=auto&tl=ru" | sed 's/\[\[\[\"//' | cut -d \" -f 1)"
[ "$1" == "firefox" ] && xclip -o | sed -r '2~1d;s/(^\s+|\s+$)//g;s/%/%25/g;s/#/%23/g;s/\$/%24/g;s/&/%26/g;s/\+/%2B/;s/,/%2C/g;s/:/%3A/g;s/;/%3B/g;s/=/%3D/g;s/\?/%3F/g;s/@/%40/g;s/\s/+/g' | awk '{print "translate.google.com/translate_t?hl=en#en|ru|" $1}' | xargs firefox -new-tab
}
translate_rus_en()
{
[ "$1" == "passive" ] && mdialog --passivepopup "$(wget -U "Mozilla/5.0" -qO - "http://translate.google.com/translate_a/t?client=t&text=$(xclip -o | sed "s/[\"'<>]//g")&sl=auto&tl=en" | sed 's/\[\[\[\"//' | cut -d \" -f 1)"
[ "$1" == "msgbox" ] && mdialog --msgbox "$(wget -U "Mozilla/5.0" -qO - "http://translate.google.com/translate_a/t?client=t&text=$(xclip -o | sed "s/[\"'<>]//g")&sl=auto&tl=en" | sed 's/\[\[\[\"//' | cut -d \" -f 1)"
[ "$1" == "firefox" ] && xclip -o | sed -r '2~1d;s/(^\s+|\s+$)//g;s/%/%25/g;s/#/%23/g;s/\$/%24/g;s/&/%26/g;s/\+/%2B/;s/,/%2C/g;s/:/%3A/g;s/;/%3B/g;s/=/%3D/g;s/\?/%3F/g;s/@/%40/g;s/\s/+/g' | awk '{print "translate.google.com/translate_t?hl=ru#ru|en|" $1}' | xargs firefox -new-tab
}
open_url()
{
xclip -o | sed -n 1p | xargs firefox -new-tab
}
userkeys()
{
string=$(head -n $1 $HOME/.userkeys | tail -n 1)
TMPFILE=$HOME/tmp/userkey-$(id -un)
> $TMPFILE
echo "#!/bin/bash" > $TMPFILE
echo "$string" >> $TMPFILE
chmod +x $TMPFILE
$TMPFILE
rm -f $TMPFILE
}
screen_scale()
{
scale_[1]=1x1
scale_[2]=1x1.2
scale_[3]=1.2x1.2
scale_[4]=1.2x1.5
scale_[5]=1.5x1.5
scale=2
[ -f /tmp/scale ] && scale=$(cat /tmp/scale)
xrandr --output LVDS1 --scale ${scale_[$scale]}
if [ $scale == 5 ] ; then
echo 1 > /tmp/scale
else
echo $(expr $scale + 1) > /tmp/scale
fi
}
[ "$(basename $0)" = "functions" ] && $@ || true

@ -0,0 +1,186 @@
#!/usr/bin/bash
#this file contains different values for ublinux scripts
declare -A AUTHPAM
declare -A DOMAIN
##rc.desktop/all/* is launching when desktop is ready
#rc.desktop/all/autoexec
# autostart apps/scripts
#AUTOEXEC=
#rc.desktop/all/fusion-icon
# timeout to start fusion-icon
#FUSIONICONTIMEOUT=5
# disable fusion-icon for de
#FUSIONICONDEDIS=gnome-shell,gnome,i3term
#rc.desktop/all/keyboard
# set keyboard layout when system start
#RESETKBMODE=yes
# set on/off/autoset numlock kbd mode
#NUMLOCK
#rc.desktop/all/ublinuxupdate
UBLINUXUPDATE=ask
MUPDSRCHTTP=http://mirror.yandex.ru/mirrors/ublinux/netlive
MUPDSRCRSYNC=rsync://mirror.yandex.ru:/mirrors/ublinux/netlive
#rc.desktop/all/xbindkeys
#XBINDKEYSSTART=yes
#XBINDKEYSOPTIONS=
#rc.desktop/gnome/guake
#GUAKESTART=yes
#rc.desktop/all/pulseaudio
#PULSEAUDIOSTART=yes
#rc.desktop/kde/hideloop4dolphin
# kde dolphin workaround. scripts hides loop devices in places bar
#HIDELOOP4DOLPHIN=yes
#DOLPHINBOOKMARKS=.local/share/user-places.xbel
#HIDELOOP=255
#HIDERAM=0
#rc.desktop/kde/yakuake
#YAKUAKESTART=yes
#rc.desktop/kde/parcellite
#PARCELLITESTART=yes
#rc.domain.d/30-usershwaccess
#DOMUSGR=audio,video,usb,vboxusers,bumblebee,cdrom,cdwriter,lp,floppy
#rc.halt/20-timesave
#HALTSAVETIME=yes
#rc.local.d/01-background
WALLPAPERSRES=1920x1080
WPDEFDIR=/mnt/livedata/ublinux-data/backgrounds/wallpapers/Default
SSDEFDIR=/mnt/livedata/ublinux-data/backgrounds/screensaver/Default
WPSYSDIR=/usr/share/ublinux/wallpapers/Default
SSSYSDIR=/usr/share/ublinux/screensaver/Default
WPDEFFILE=/usr/share/ublinux/wallpapers/default.jpg
#rc.local.d/10-network
# start interface if its not networkmanager
#AUTOSTARTIFNNM=yes
#NFSMOUNTTM=10
#NFSMOUNTWAIT=6
#NFSOPTS="vers=3,nolock,users,noauto"
#rc.local.d/31-sound
# to set default alsa card in case of 0 card is HDMI (see aplay -l)
#SNDFINCARD=yes
# mixer settings (see amixer)
#SNDMIXSET=yes
#SNDMIX_MASTER_N=Master
#SNDMIX_MASTER_VOL=35%
#SNDMIX_DEFAULT_VOL=90%
#SNDMIX_SWITCH_ON="IEC958 Playback Default,IEC958 Playback Switch"
#SNDMIX_SWITCH_OFF="Beep Playback Switch,Mic Playback Switch"
#rc.local.d/51-gtk-update-icon-cache
#UPDATEGTKICONCACHE=yes
#UPDATEGTKICONOPTS="-fit /usr/share/icons/hicolor"
#rc.local.d/51-mozilla_extensions
#REGISTERMOZEXT=yes
#rc.local.d/81-samba
# make random passwords for samba users (for home nets)
#MKSMBPWD=yes
#rc.post.d/02-hwclock
#SETCLKATSTART=yes
# for help "man xkeyboard-config"
#rc.post.d/11-xorg
HARDCONF=etc/ublinux/service.conf
# make /etc/X11/xorg.conf.d/00-keyboard.conf
#SETXORGRES=yes
#MKKBDFXORG=yes
# options (only if its not specified in /etc/ublinux/keyboard )
XkbModel=pc105
XkbLayout=us,ru
KEYBOARD=ru
KEYTABLE=ru4
GRP_TOGGLE=lctrl_lshift_toggle
XkbOptions=grp:lctrl_lshift_toggle,grp_led:scroll,compose:rwin
#STEAMNODPMS=yes
#/rc.preinit/10-accounts
DEFAULTPASSWD='$6$E7stRhRS8fCKk7UU$Qoqw62AUaUa5uLIc2KC7WV3MUThhrR8kjXtCODmnKCzKe2zHu1/wmsiWBHZEIk/IQnk/aELQYbUK93OUtrwg60'
DEFAULTROOTPASSWD='$6$E7stRhRS8fCKk7UU$Qoqw62AUaUa5uLIc2KC7WV3MUThhrR8kjXtCODmnKCzKe2zHu1/wmsiWBHZEIk/IQnk/aELQYbUK93OUtrwg60'
DEFAULTUSER=superadmin
DEFAULTGROUP=users
USERGROUPS=nobody,scanner,power,audio,lp,optical,storage,video,sambashare,vboxusers,libvirt
NOSECUREROOTPASSWD=$DEFAULTROOTPASSWD
ADMGROUPS=wheel,vboxsf,disk
ADMUID=1000
ADDADM=yes
#/rc.preinit/10-accounts
HASHPASSWD=sha512crypt
#/rc.preinit/50-xorg
#NVIDIATEST="nvidia-current nvidia340 nvidia304 nvidia"
#FAILSAFENVIDIA=nouveau
#CREATE_XORG_CONF=yes
#XFILE=etc/X11/xorg.conf
#/rc.preinit/02-skel-adds
STEAMAPP=/mnt/livedata/ublinux-data/steam
#/rc.preinit.d/53-language
#FORCE_LOCARCHIVE=no
LOCALE="en_US.UTF-8,ru_RU.UTF-8"
LANG="ru_RU.UTF-8"
CONSOLE_FONT=cyr-sun16
#/rc.preinit.d/20-services
SERVICESSTART=dbus-broker,NetworkManager,sshd,systemd-swap,systemd-timesyncd,cups,cockpit.socket,avahi-daemon,avahi-dnsconfd,veyon,smb,nmb,winbind,bluetooth
#/rc.preinit.d/23-publicdir
# Папка с правами 777 доступная всем локальным пользователям и при разрешении всем из сети
PUBLICDIR=/home/public
#/rc.halt.pre/10-shutdown
#HALTSERVICESSTOP=""
#HALTPROCESSESKILL="slim kdm X lxdm xdm sddm cupsd pdnsd mc mandb"
#/rc.post.d/03-modprobepreload
#MODPROBEPRELOAD=yes
#/rc.post/11-xorg
#DELETE_XORG_CONF=no
#/scripts/ublinuxrepack
#MKSQFS_FASTALG="-b 512K -comp lz4 -Xhc"
MKSQFS_FASTALG="-b 32K -comp gzip"
#/rc.desktop/lxqt/qterminal
#QTERMINALSTART=yes
#/rc.preinit.d/52-desktop
#/rc.post.d/02-hwclock
#/rc.post.d/11-xorg
SYSCONF=/etc/ublinux
#/rc.d/rc.desktop
#NOEXEC="i3term:xbindkeys;i3term:fusion-icon;i3term:ublinuxupdate"
#/rc.desktop/i3term/exclusiveapp
#EXCLUSIVEAPP=remmina
#/functions
#MKSQFS_OPTS="-b 512K -comp xz -Xbcj x86"
MKSQFS_OPTS="-b 32K -comp gzip"
AUTHPAM[minimal]=with-faillock,with-time,with-systemd-homed
DOMAIN[client]=realmd_sssd

@ -0,0 +1,67 @@
#!/bin/sh
#
# Compcache startup script
#
# chkconfig: 2345 26 59
#
# description: Compcache uses part of the RAM as a compressed swap device
#
### BEGIN INIT INFO
# Provides: compcache
# Default-Start: 2 3 4 5
# Short-Description: Compcache service
# Description: Compcache uses part of the RAM as a compressed swap device
### END INIT INFO
. /lib/lsb/init-functions
[ -f /etc/ublinux/services/compcache ] && . /etc/ublinux/services/compcache
NUM_DEVICES=${NUM_DEVICES:-4}
[ -z "$ZRAMSIZE" ] && ZRAMSIZE=$(($(free -b | grep -m1 -i ^mem: | awk '{print $2}') /4))
GPRINTF=gprintf
[ -f /etc/init.d/functions ] || GPRINTF=log_daemon_msg
case "$1" in
start)
$GPRINTF "Loading compcache: "
/sbin/modprobe zram num_devices=$NUM_DEVICES && \
echo $ZRAMSIZE > /sys/block/zram0/disksize && \
mkswap /dev/zram0 >/dev/null 2>&1 && \
swapon /dev/zram0
RETVAL=$?
if [ $RETVAL = 0 ]; then
log_success_msg $"%s startup" "$base"
else
log_failure_msg $"%s startup" "$base"
fi
echo
[ $RETVAL -eq 0 ] && touch /var/lock/subsys/compcache
;;
stop)
$GPRINTF "Stopping compcache: "
test -e /dev/zram0 && swapoff /dev/zram0 && sleep 0.5 && rmmod zram
RETVAL=$?
if [ $RETVAL = 0 ]; then
log_success_msg $"%s stop" "$base"
else
log_failure_msg $"%s stop" "$base"
fi
echo
[ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/compcache
;;
status)
swapon -s | grep -q /dev/zram0
RETVAL=$?
;;
restart|reload)
$0 stop
$0 start
;;
*)
echo "Usage: $0 {start|stop|status|restart}"
RETVAL=1
;;
esac
exit $RETVAL

@ -0,0 +1,113 @@
#!/bin/sh
#
# Polipo Startup script for the NTLM Authorization Proxy Server
#
# chkconfig: - 95 15
# description: NTLMAPS is a proxy-like software, that will authorize you at MS proxy server\
# and at web servers (ISS especially) using MS proprietary NTLM authorization method
# processname: ntlmaps
### BEGIN INIT INFO
# Provides: ntlmaps
# Required-Start: $local_fs $network $named winbind
# Required-Stop: $local_fs $network $named winbind
# Short-Description: NTLM Authorization Proxy Server
# Default-Start: 3 4 5
# Description: NTLMAPS is a proxy-like software, that will authorize you at MS proxy server
# and at web servers (ISS especially) using MS proprietary NTLM authorization method.
### END INIT INFO
# Source function library.
. /lib/lsb/init-functions
# Source networking configuration
[ -f /etc/ublinux/network ] && . /etc/ublinux/network
STATUS=status
[ -f /etc/init.d/functions ] || STATUS=status_of_proc
GPRINTF=gprintf
[ -f /etc/init.d/functions ] || GPRINTF=log_daemon_msg
ntlmaps=${NTLMAPS-/usr/share/ntlmaps/ntlmaps}
prog=ntlmaps
config=${CONFIG-/etc/ntlmaps.cfg}
pidfile=${PIDFILE-/var/run/ntlmaps.pid}
lockfile=${LOCKFILE-/var/lock/subsys/ntlmaps}
logdir=${LOGDIR-/var/log/ntlmaps}
pwddir=$PWD
port=5865
TIMEOUT=${TIMEOUT-10}
RETVAL=0
start() {
# Check that networking is up.
[ ${NETWORKING} = "no" ] && exit 1
[ -x $ntlmaps ] || exit 1
[ `id -u` -ne 0 ] && exit 4
# check if the config is present
[ -f $config ] || exit 6
[ -f $pidfile ] && exit 1
[ -d $logdir ] || mkdir $logdir
chmod 700 $logdir
cd $logdir
$GPRINTF "Starting ntlmaps: " "$prog"
start_daemon $ntlmaps -c $config </dev/null >/dev/null 2>/dev/null &
while [ "$TIMEOUT" != "0" ] ;do
PRPID=$(/usr/sbin/lsof 2>/dev/null| grep ":$port .LISTEN." | awk '{print $2}')
[ -z "$PRPID" ] || break
sleep 1
TIMEOUT=$(( $TIMEOUT - 1 ))
done
if [ "$PRPID" = "" ] ;then
RETVAL=1
log_failure_msg
else
RETVAL=0
log_success_msg
touch ${lockfile}
echo -ne $PRPID > ${pidfile}
fi
echo
cd $pwddir
return $RETVAL
}
stop() {
$GPRINTF "Stopping ntlmaps: " "$prog"
PRPID=$(cat $pidfile 2>/dev/null)
if [ "$PRPID" = "" ] ;then
log_failure_msg
else
kill $PRPID >/dev/null 2>&1 && log_success_msg || log_failure_msg
fi
echo
rm -f ${lockfile} ${pidfile} 2>/dev/null
}
# See how we were called.
case "$1" in
start)
start
;;
stop)
stop
;;
status)
$STATUS -p ${pidfile} $prog
RETVAL=$?
;;
restart)
stop
start
;;
condrestart|try-restart)
if $STATUS -p ${pidfile} $ntlmaps >&/dev/null; then
stop
start
fi
;;
*)
echo "Usage: $prog {start|stop|restart|condrestart|status}"
RETVAL=3
esac
exit $RETVAL

@ -0,0 +1,30 @@
#!/bin/bash
ENABLED=yes
[ "$ENABLED" != "yes" ] && exit 0
NOEXEC="i3term:xbindkeys;i3term:fusion-icon;i3term:ublinuxupdate"
. /usr/lib/ublinux/functions
. /usr/lib/ublinux/os-config
SOURCE=${SYSCONF}/config; [ -f ${SOURCE} ] && . ${SOURCE} 2>/dev/null
DE=$(detectDE)
cd $HOME
NOEXEC=$(echo " $NOEXEC " | tr ',;' ' ')
# We have to launch some rc scripts
for a in /usr/lib/ublinux/rc.desktop/$DE/* ;do
[ -x $a ] && $a & 2>/dev/null
done
for a in /usr/lib/ublinux/rc.desktop/all/* ;do
echo "$NOEXEC" | grep -q " $(basename $a) " && continue
echo "$NOEXEC" | grep -q " $DE:$(basename $a) " && continue
[ -x $a ] && $a & 2>/dev/null
done
echo 1 > /run/ublinux_started
true

@ -0,0 +1,7 @@
#!/bin/bash
for a in /usr/lib/ublinux/rc.halt/* ;do
[ -x $a ] && $a 2>/dev/null
done
true

@ -0,0 +1,7 @@
#!/bin/bash
for a in /usr/lib/ublinux/rc.halt.pre/* ;do
[ -x $a ] && $a 2>/dev/null
done
true

@ -0,0 +1,19 @@
#!/bin/bash
DEBUGMODE=no
. /usr/lib/ublinux/functions
. /usr/lib/ublinux/os-config
debug_mode "$0" "$@"
SOURCE=${SYSCONF}/config; [ -f ${SOURCE} ] && . ${SOURCE} 2>/dev/null
# We have to launch some rc scripts
for a in /usr/lib/ublinux/rc.local.d/* ;do
[ -x $a ] && $a 2>/dev/null &
done
echo -ne > /run/ublinux_started
chgrp users /run/ublinux_started
chmod 664 /run/ublinux_started
true

@ -0,0 +1,15 @@
#!/bin/bash
DEBUGMODE=no
. /usr/lib/ublinux/functions
. /usr/lib/ublinux/os-config
debug_mode "$0" "$@"
SOURCE=${SYSCONF}/config; [ -f ${SOURCE} ] && . ${SOURCE} 2>/dev/null
# We have to launch some rc scripts
for a in /usr/lib/ublinux/rc.network.d/* ;do
[ -x $a ] && $a 2>/dev/null &
done
true

@ -0,0 +1,25 @@
#!/usr/bin/env bash
DEBUGMODE=no
. /usr/lib/ublinux/functions
debug_mode "$0" "$@"
for a in /usr/lib/ublinux/rc.post.d/* ;do
[ -x $a ] && $a 2>/dev/null &
done
for a in /usr/lib/ublinux/rc.post/* ;do
[ -x $a ] && $a 2>/dev/null
done
# We have to launch some rc scripts from external modules
LOCKDIR=/var/lock/ublinux/rc.runonce
[ -d "$LOCKDIR" ] || mkdir -p "$LOCKDIR"
for a in /usr/lib/ublinux/rc.runonce/* ;do
[ -f "$LOCKDIR/$(basename $a)" -o ! -x "$a" ] && continue
$a start 2>/dev/null
touch "$LOCKDIR/$(basename $a)"
done
readlink -fq /usr/bin/init 2>/dev/null | grep -q /lib/systemd/systemd && wait
true

@ -0,0 +1,25 @@
#!/bin/bash
PATH=.:/:/usr/bin:/usr/local/bin:/usr/local/sbin
DEBUGMODE=no
. /liblinuxlive 2>/dev/null || . /mnt/live/liblinuxlive
debug_mode "$0" "$@"
debug_log "starting rc.preinit"
debug_shell
# install systemd services
[ ! -h usr/lib/systemd/system/ublinux-postinit.service ] && bash usr/lib/ublinux/rootfs-patches/ublinux/ublinux-00-install.sh
# We have to launch some rc scripts
for a in usr/lib/ublinux/rc.preinit/* ;do
[ -x $a ] && $a 2>/dev/null
done
for a in usr/lib/ublinux/rc.preinit.d/* ;do
[ -x $a ] && $a 2>/dev/null &
done
wait
true

@ -0,0 +1,7 @@
#!/bin/sh
for a in /usr/lib/ublinux/rc.xorg/* ;do
[ -x $a ] && $a 2>/dev/null
done
true

@ -0,0 +1,22 @@
#!/bin/sh
ENABLED=yes
[ "$ENABLED" != "yes" ] && exit 0
. /usr/lib/ublinux/functions
. /usr/lib/ublinux/os-config
SOURCE=${SYSCONF}/config; [ -f ${SOURCE} ] && . ${SOURCE} 2>/dev/null
DE=$(detectDE)
cd $HOME
EXEC=$(cmdline_value exec)
[ "$EXEC" != "" -a "$AUTOEXEC" != "" ] && DELIM=,
echo "$AUTOEXEC$DELIM$EXEC" | tr ',;' \\n | while read a ;do
NEEDDE=$(echo $a | grep : | awk -F: '{print $1}' | tr A-Z a-z)
PROGRAM=${a/*:/}
[ "$NEEDDE" -a "$NEEDDE" != "$DE" ] && continue
[ -z "$PROGRAM" ] || bash -c "$PROGRAM" &
done

@ -0,0 +1,10 @@
#!/bin/sh
ENABLED=yes
[ "$ENABLED" != "yes" ] && exit 0
. /usr/lib/ublinux/os-config
# Фиксим ~/.config/gtk-3.0/bookmarks подставляя тукущего пользователя вместо ${USER}
sed -i "s/\${USER}/${USER}/g" ~/.config/gtk-3.0/bookmarks

@ -0,0 +1,21 @@
#!/bin/sh
ENABLED=yes
[ "$ENABLED" != "yes" ] && exit 0
FUSIONICONTIMEOUT=5
FUSIONICONDEDIS=gnome-shell,gnome,i3term
[ -f /etc/ublinux/compositing-wm ] && . /etc/ublinux/compositing-wm
. /usr/lib/ublinux/functions
. /usr/lib/ublinux/os-config
SOURCE=${SYSCONF}/config; [ -f ${SOURCE} ] && . ${SOURCE} 2>/dev/null
DE=$(detectDE)
if [ "$COMPOSITING_WM_START" = "yes" -a "$COMPOSITING_WM" = "compiz-fusion" ] ;then
if ! echo " $FUSIONICONDEDIS " | tr ',;' " " | grep -q " $DE " ;then
sleep $FUSIONICONTIMEOUT
fusion-icon -f &
fi
fi

@ -0,0 +1,22 @@
#!/bin/sh
ENABLED=yes
[ "$ENABLED" != "yes" ] && exit 0
. /usr/lib/ublinux/os-config
SOURCE=${SYSCONF}/config; [ -f ${SOURCE} ] && . ${SOURCE} 2>/dev/null
SOURCE=${SYSCONF}/keyboard; [ -f ${SOURCE} ] && . ${SOURCE} 2>/dev/null
[ "$RESETKBMODE" != "no" ] && setxkbmap $XkbLayout -model $XkbModel -option $XkbOptions
# Automatic detection PC/notebooks
if [ -z "$NUMLOCK" ] ; then
if xinput list | grep -qi touchpad ; then
NUMLOCK=no
else
NUMLOCK=yes
fi
fi
[ "$NUMLOCK" = "yes" -o "$NUMLOCK" = "on" ] && numlockx on
[ "$NUMLOCK" = "no" -o "$NUMLOCK" = "off" ] && numlockx off

@ -0,0 +1,8 @@
#!/bin/bash
ENABLED=no
[ "$ENABLED" != "yes" ] && exit 0
. /usr/lib/ublinux/os-config
SOURCE=${SYSCONF}/config; [ -f ${SOURCE} ] && . ${SOURCE} 2>/dev/null
[ "$RUNLDCONFIG" != "yes" -a "$RUNLDCONFIG" != "no" ] && bash -c "sleep 30 && sudo /sbin/ldconfig" &

@ -0,0 +1,21 @@
#!/bin/sh
ENABLED=yes
[ "$ENABLED" != "yes" ] && exit 0
XDG_DESKTOP_DIR="$HOME/Рабочий стол"
. /usr/lib/ublinux/os-config
SOURCE=${SYSCONF}/config; [ -f ${SOURCE} ] && . ${SOURCE} 2>/dev/null
[ -z "$PLACEONDESKTOP" ] && exit 0
[ -f ~/.config/.desktopinitialized ] && exit 0
. ~/.config/user-dirs.dirs
[ -d "$XDG_DESKTOP_DIR" ] || mkdir -p "$XDG_DESKTOP_DIR"
echo "$PLACEONDESKTOP" | tr ',;' \\n | while read a ;do
DF=$(find /usr/share/applications -type f -name $a.desktop )
[ -f "$DF" ] && cp "$DF" "$XDG_DESKTOP_DIR"
grep "#!/usr/bin/env xdg-open" "$XDG_DESKTOP_DIR"/$a.desktop || sed -i 1s%^%'\#\!/usr/bin/env xdg-open\n'% "$XDG_DESKTOP_DIR"/$a.desktop
chmod 755 "$XDG_DESKTOP_DIR"/$a.desktop
done
touch ~/.config/.desktopinitialized

@ -0,0 +1,9 @@
#!/bin/sh
ENABLED=yes
[ "$ENABLED" != "yes" ] && exit 0
. /usr/lib/ublinux/os-config
[ -f /etc/sound/profiles/current/profile.conf ] && . /etc/sound/profiles/current/profile.conf
[ "$SOUNDPROFILE" = "pulse" -a "$PULSEAUDIOSTART" != "no" ] && start-pulseaudio-x11 &

@ -0,0 +1,19 @@
#!/bin/sh
[ -f ~/.config/tox/qtox.ini ] && exit 0
ENABLED=yes
[ "$ENABLED" != "yes" ] && exit 0
. /usr/lib/ublinux/functions
. /usr/lib/ublinux/os-config
SOURCE=${SYSCONF}/config; [ -f ${SOURCE} ] && . ${SOURCE} 2>/dev/null
TOXLANG=$(cmdline_value lang)
[ -z "$TOXLANG" ] && TOXLANG=ru
mkdir -p ~/.config/tox
cat >~/.config/tox/qtox.ini <<EOF
[%General]
translation=$TOXLANG
EOF

@ -0,0 +1,8 @@
#!/bin/sh
ENABLED=yes
[ "$ENABLED" != "yes" ] && exit 0
. /usr/lib/ublinux/functions
[ "$(cmdline_parameter flightmode)" ] && rfkill block all

@ -0,0 +1,149 @@
#!/bin/bash
# Description: This script ask user for update system
ENABLED=no
[ "$ENABLED" != "yes" ] && exit 0
function stopstatus()
{
[ "$VERBOSE" = "1" -a "$STATUSPID" != "" ] && kill $STATUSPID 2>/dev/null && STATUSPID=
}
function dialogreboot()
{
MSG01=$(gettext -s "System update is over")
MSG02=$(gettext -s "System updated. Please reboot computer.")
MSG03=$(gettext -s "Reboot now")
MSG04=$(gettext -s "No, i will reboot later")
CHOISE=$(Xdialog --title "$MSG01" --radiolist "$MSG02" 0 0 3 "1" "$MSG03" on "2" "$MSG04" off 2>&1 | tail -1)
[ "$CHOISE" = "1" ] || exit 0
systemctl reboot
reboot
}
function dialogrevert()
{
stopstatus
MSG01=$(gettext -s "It's possible to revert update.")
MSG02=$(gettext -s "System started from backup version currently.")"\n"$(gettext -s "If you have a problems with new version, you can revert update.")"\n"$(gettext -s "Do you want to remove new version and switch to old one?")
MSG03=$(gettext -s "Yes, downgrade back to old version now")
MSG04=$(gettext -s "No, do nothing right now")
CHOISE=$(Xdialog --title "$MSG01" --radiolist "$MSG02" 0 0 3 "1" "$MSG03" off "2" "$MSG04" on 2>&1 | tail -1)
[ "$CHOISE" = "1" ] && return 0
return 1
}
function dialogerrorlog()
{
stopstatus
MSG01=$(gettext -s "Update was unsuccessful.")
cat $LOGFILE-$(id -u).log $LOGFILE-0.log > $LOGFILE.log 2>/dev/null
Xdialog --title "$MSG01" --no-cancel --textbox $LOGFILE.log 0 0
exit 1
}
function dialognoupdates()
{
stopstatus
MSG01=$(gettext -s "System update")
MSG02=$(gettext -s "Updates were not found at server.")
Xdialog --title "$MSG01" --msgbox "$MSG02" 0 0
}
function errorexit()
{
stopstatus
if [ "$VERBOSE" = "1" ] ;then
MSG01=$(gettext -s "Error")
MSG02=$(gettext -s "$1")
Xdialog --title "$MSG01" --msgbox "$MSG02" 0 0
else
echo $1
fi
exit 1
}
# $1 text string
function dialogupdate()
{
stopstatus
MSG01=$(gettext -s "Please select")
MSG02=$(gettext -s "$1")
MSG03=$(gettext -s "Do you want to update it now?")
MSG04=$(gettext -s "Yes, right now")
MSG05=$(gettext -s "No, later")
MSG06=$(gettext -s "Never, don't ask me again")
CHOISE=$(Xdialog --title "$MSG01" --radiolist "$MSG02\n$MSG03" 0 0 4 "1" "$MSG04" on "2" "$MSG05" off "3" "$MSG06" off 2>&1 | tail -1)
if [ "$CHOISE" = "3" ] ;then
touch $UBLINUXPATH/.dontupdateublinux 2>/dev/null || touch $HOME/.config/.dontupdateublinux
fi
[ "$CHOISE" = "1" ] && return 0
return 1
}
export TEXTDOMAINDIR=/usr/share/locale
export TEXTDOMAIN=ublinux_functions
echo $PATH | grep -q /usr/lib/ublinux/scripts || PATH=/usr/lib/ublinux/scripts:$PATH
. /etc/os-release
. /usr/lib/ublinux/functions
. /usr/lib/ublinux/os-config
SOURCE=${SYSCONF}/config; [ -f ${SOURCE} ] && . ${SOURCE} 2>/dev/null
DEBUGMODE=no
debug_mode "$0" "$@"
LOGFILE=/tmp/ublinuxupdate
UBLINUXPATH=/mnt/livemedia/ublinux
[ -f /mnt/live/etc/modules ] && . /mnt/live/etc/modules
[ ! -z "$UBLINUXMODS" -a -d "$UBLINUXMODS/base" ] && UBLINUXPATH="$UBLINUXMODS"
[ -f "$UBLINUXPATH/vmlinuz" -a -d "$UBLINUXPATH/base" ] || errorexit "Can't find system folder"
NEEDREBOOT=0
[ "$1" = "--verbose" ] && VERBOSE=1
grep -q "ub.from=ublinux.bak" /proc/cmdline && RUNFROMBACKUP=1
if [ "$VERBOSE" = "1" ] ;then
MSG01=$(gettext -s "System update")
MSG02=$(gettext -s "Please wait. Connecting to server...")
Xdialog --title "$MSG01" --no-close --no-buttons --infobox "\n$MSG02\n" 0 0 990000 2>/dev/null &
STATUSPID=$!
fi
#check for readonly filesystem
ublinuxupdate --checkdir || errorexit "Can't find system folder"
if [ "$RUNFROMBACKUP" != "1" ] ;then
#check for internet connection
if [ "$VERBOSE" = "1" ] ;then
ping -c 1 -W 1 77.88.8.8 >/dev/null 2>&1 || errorexit "Not connected to internet"
else
#check if update is disabled or auto
echo $UBLINUXUPDATE | grep -qi ^ask$ || exit 0
[ -f $UBLINUXPATH/.dontupdateublinux -o -f $HOME/.config/.dontupdateublinux ] && exit 0
fi
ublinuxupdate --checkserver || errorexit "Can't connect with server"
fi
#check for updates
MSG01=$(gettext -s "New version of")" $PRETTY_NAME "$(gettext -s "is detected on server.")
MSG02=$(gettext -s "New updates for")" $PRETTY_NAME "$(gettext -s "are detected on server.")
if ublinuxupdate --checknewversion ;then
if dialogupdate "$MSG01" ;then
ublinuxupdate --updateversion || dialogerrorlog
grep -qi "please reboot" ${LOGFILE}-*.log && NEEDREBOOT=1
fi
elif ublinuxupdate --checkupdates ;then
if dialogupdate "$MSG02" ;then
ublinuxupdate --updatebase || dialogerrorlog
grep -qi "please reboot" ${LOGFILE}-*.log && NEEDREBOOT=1
fi
elif [ "$RUNFROMBACKUP" = "1" ] ;then
dialognoupdates
if dialogrevert ;then
ublinuxupdate --revertversion || dialogerrorlog
NEEDREBOOT=1
fi
elif [ "$VERBOSE" = "1" ] ;then
dialognoupdates
fi
[ "$NEEDREBOOT" = "1" ] && dialogreboot

@ -0,0 +1,8 @@
#!/bin/sh
ENABLED=yes
[ "$ENABLED" != "yes" ] && exit 0
. /usr/lib/ublinux/os-config
[ "$XBINDKEYSSTART" = "yes" ] && xbindkeys $XBINDKEYSOPTIONS &

@ -0,0 +1,37 @@
#!/bin/sh
# xscreensaver helper scripts
ENABLED=no
[ "$ENABLED" != "yes" ] && exit 0
XSSHBTM=20s
# exit for DE
XSSDEIGNORE="kde,mate"
# exit if process started
XSSEXIT="screensaver"
# stop xss if process started
XSSBLRUNED="kscreenlocker"
# stop xss if process eats resources
XSSBLLOADED="media-play,mplayer,tvtime,firefox,steam,chromium"
/usr/lib/ublinux/functions
. /usr/lib/ublinux/os-config
SOURCE=${SYSCONF}/config; [ -f ${SOURCE} ] && . ${SOURCE} 2>/dev/null
which xscreensaver >/dev/null 2>&1 || exit 0
DE=$(detectDE)
[ "$XSSDEIGNORE" = "all" ] && exit 0
echo " $XSSDEIGNORE " | tr ',;' ' ' | grep -q " $DE " && exit 0
XSSEXIT="$(echo "$XSSEXIT" | tr ',; ' '|' )"
ps -U $(id -un) -o comm | egrep -q "$XSSEXIT" && exit 0
xscreensaver -no-splash &
sleep 1s
while true ;do
XSSBLRUNED="$(echo "$XSSBLRUNED" | tr ',; ' '|' )"
XSSBLLOADED="$(echo "$XSSBLLOADED" | tr ',; ' '|' )"
ps -U $(id -un) -o comm | egrep -q "$XSSBLRUNED" && xscreensaver-command -deactivate >/dev/null 2>&1
top -bn1 -u $(id -un) | awk '{ print $7 FS $NF }' | grep ^[1-9] | egrep -q "$XSSBLLOADED" && xscreensaver-command -deactivate >/dev/null 2>&1
sleep $XSSHBTM
done

@ -0,0 +1,14 @@
#!/bin/sh
#
# Задача: заменить на sirikali (больше возможностей)
#
ENABLED=no
[ "$ENABLED" != "yes" ] && exit 0
. /usr/lib/ublinux/os-config
SOURCE=${SYSCONF}/config; [ -f ${SOURCE} ] && . ${SOURCE} 2>/dev/null
which $(basename $0) >/dev/null 2>&1 || exit 0
[ "$CRYPTKEEPERSTART" != "no" ] && $(basename $0) &

@ -0,0 +1,60 @@
#!/bin/sh
ENABLED=no
[ "$ENABLED" != "yes" ] && exit 0
EXCLUSIVEAPP=remmina
TERMMODEEXIT="i3-msg exit"
TERMMODSCRIPTPRE=
TERMMODETIMEOUT=15
. /usr/lib/ublinux/os-config
SOURCE=${SYSCONF}/config; [ -f ${SOURCE} ] && . ${SOURCE} 2>/dev/null
function setsetting()
{
if [ -f "$1" ];then
if grep -q ^$2= $1 ;then
sed -i s%"^$2=.*"%"$2=$3"% $1
else
echo "$2=$3" >> $1
fi
fi
}
if [ "$EXCLUSIVEAPP" ] ;then
if [ ! -z "$TERMMODSCRIPTPRE" ] ;then
zenity --info --text="Запуск скрипта установки соединения с сервером. Пожалуйста, ожидайте" &
pid=$!
$TERMMODSCRIPTPRE
kill $pid
fi
if echo "$EXCLUSIVEAPP" | grep -q "remmina" ;then
FILEPREF=$HOME/.remmina/remmina.pref
setsetting "$FILEPREF" disable_tray_icon true
setsetting "$FILEPREF" save_view_mode false
FILEPREF=$HOME/.config/remmina/remmina.pref
setsetting "$FILEPREF" disable_tray_icon true
setsetting "$FILEPREF" save_view_mode false
FILEPREF=$(ls $HOME/.remmina/*.remmina | head -1)
if [ ! -z "$FILEPREF" ] ;then
setsetting "$FILEPREF" viewmode 4
TMSERVER=$(grep ^server= "$FILEPREF" |awk -F= '{print $2}' | awk -F: '{print $1}')
TMPORT=$(grep ^server= "$FILEPREF" |awk -F= '{print $2}' | awk -F: '{print $2}')
[ -z "$TMPORT" ] && TMPORT=3389
if [ "$TMSERVER" ] && [ "0$TERMMODETIMEOUT" -gt "0" ] ;then
STEP=$(( 100 * 100 / $TERMMODETIMEOUT ))
for a in $(seq 1 $TERMMODETIMEOUT) ;do
nmap --open -p$TMPORT $TMSERVER 2>/dev/null | grep -q "^$TMPORT/" && break
sleep 1
echo "$(( $a * $STEP / 100 ))"
done | zenity --progress --percentage=0 --no-cancel --text "Ожидание подключения к удаленному серверу." --auto-close
fi
EXCLUSIVEAPP="$EXCLUSIVEAPP -c $FILEPREF"
fi
fi
$EXCLUSIVEAPP &
pid=$!
wait $pid
$TERMMODEEXIT
fi

@ -0,0 +1,11 @@
#!/bin/sh
ENABLED=no
[ "$ENABLED" != "yes" ] && exit 0
. /usr/lib/ublinux/os-config
SOURCE=${SYSCONF}/config; [ -f ${SOURCE} ] && . ${SOURCE} 2>/dev/null
which $(basename $0) >/dev/null 2>&1 || exit 0
[ "$GUAKESTART" != "no" ] && $(basename $0) &

@ -0,0 +1,86 @@
#!/bin/sh
ENABLED=no
[ "$ENABLED" != "yes" ] && exit 0
DOLPHINBOOKMARKS=.local/share/user-places.xbel
HIDELOOP=255
HIDERAM=0
HIDEZRAM=8
. /usr/lib/ublinux/os-config
[ "$HIDELOOP4DOLPHIN" = "no" ] && exit 0
if [ "$1" != "fork" ] ;then
$0 fork &
exit 0
fi
sleep 3
FFP=$HOME/$DOLPHINBOOKMARKS
if [ ! -f $FFP ] ;then
dolphin /home &
PIDDOL=$!
while [ ! -f $FFP ] ;do sleep 0.1 ;done
kill $PIDDOL
fi
if ! grep -q "devices/loop$HIDELOOP" $FFP ;then
for a in $(seq 0 "$HIDELOOP") ;do
grep -q devices/loop$a $FFP && continue
cat >>$FFP <<EOF
<separator>
<info>
<metadata owner="http://www.kde.org">
<UDI>/org/freedesktop/UDisks2/block_devices/loop$a</UDI>
<isSystemItem>true</isSystemItem>
<IsHidden>true</IsHidden>
</metadata>
<metadata owner="http://freedesktop.org">
<bookmark:icon name="drive-harddisk"/>
</metadata>
</info>
<title>Loop device</title>
</separator>
EOF
done
for a in $(seq 0 "$HIDERAM") ;do
grep -q devices/ram$a $FFP && continue
cat >>$FFP <<EOF
<separator>
<info>
<metadata owner="http://www.kde.org">
<UDI>/org/freedesktop/UDisks2/block_devices/ram$a</UDI>
<isSystemItem>true</isSystemItem>
<IsHidden>true</IsHidden>
</metadata>
<metadata owner="http://freedesktop.org">
<bookmark:icon name="drive-harddisk"/>
</metadata>
</info>
<title>Ram device</title>
</separator>
EOF
done
for a in $(seq 0 "$HIDEZRAM") ;do
grep -q devices/ram$a $FFP && continue
cat >>$FFP <<EOF
<separator>
<info>
<metadata owner="http://www.kde.org">
<UDI>/org/freedesktop/UDisks2/block_devices/zram$a</UDI>
<isSystemItem>true</isSystemItem>
<IsHidden>true</IsHidden>
</metadata>
<metadata owner="http://freedesktop.org">
<bookmark:icon name="drive-harddisk"/>
</metadata>
</info>
<title>ZRam device</title>
</separator>
EOF
done
sed -i /'<\/xbel>'/d $FFP
echo '</xbel>' >> $FFP
fi

@ -0,0 +1,12 @@
#!/bin/sh
ENABLED=no
[ "$ENABLED" != "yes" ] && exit 0
I3_NOTIFYD=yes
. /usr/lib/ublinux/os-config
SOURCE=${SYSCONF}/config; [ -f ${SOURCE} ] && . ${SOURCE} 2>/dev/null
[ "$I3_NOTIFYD" != "no" ] && dex /usr/share/applications/notification-daemon.desktop &

@ -0,0 +1,7 @@
#!/bin/sh
ENABLED=no
[ "$ENABLED" != "yes" ] && exit 0
. /usr/lib/ublinux/os-config
[ "$MATEPAAGENTSTART" != "no" ] && /usr/lib64/polkit-mate-authentication-agent-1 &

@ -0,0 +1,11 @@
#!/bin/sh
ENABLED=no
[ "$ENABLED" != "yes" ] && exit 0
. /usr/lib/ublinux/os-config
SOURCE=${SYSCONF}/config; [ -f ${SOURCE} ] && . ${SOURCE} 2>/dev/null
which $(basename $0) >/dev/null 2>&1 || exit 0
[ "$PARCELLITESTART" != "no" ] && $(basename $0) &

@ -0,0 +1,11 @@
#!/bin/sh
ENABLED=no
[ "$ENABLED" != "yes" ] && exit 0
. /usr/lib/ublinux/os-config
SOURCE=${SYSCONF}/config; [ -f ${SOURCE} ] && . ${SOURCE} 2>/dev/null
which $(basename $0) >/dev/null 2>&1 || exit 0
[ "$QTERMINALSTART" != "no" ] && $(basename $0) --drop &

@ -0,0 +1,8 @@
#!/bin/sh
ENABLED=no
[ "$ENABLED" != "yes" ] && exit 0
if [ ! -f $HOME/.config/Trolltech.conf ] ;then
[ -f /usr/share/lxqt/themes/Default/Trolltech.conf ] && cp /usr/share/lxqt/themes/Default/Trolltech.conf $HOME/.config/Trolltech.conf
fi

@ -0,0 +1,25 @@
#!/bin/bash
ENABLED=yes
[ "$ENABLED" != "yes" ] && exit 0
#. /etc/ublinux/config
# Если не загружен ни один драйвер видео KMS, то xfce4-screensaver закрываем, т.к. не правильно отрабатывает блокировка
sleep 5
if pidof -qx xfce4-screensaver; then
if ! lspci -k | egrep -i -A 3 'VGA|3D' | grep -q 'Kernel driver in use:'; then
BLOBPS=$(ps -u $(id -u) -o pid= | xargs -I{} cat /proc/{}/environ 2>/dev/null | tr '\0' '\n')
DISPLAY=$(grep -m1 '^DISPLAY=' <<< "${BLOBPS}")
# XAUTHORITY=$(grep -m1 '^XAUTHORITY=' <<< "${BLOBPS}")
DBUS_SESSION_BUS_ADDRESS=$(grep -m1 '^DBUS_SESSION_BUS_ADDRESS=' <<< "${BLOBPS}")
# USER=$(cut -d/ -f3 <<< "${XAUTHORITY}")
# su -l ${USER} -c "${DISPLAY} ${XAUTHORITY} ${DBUS_SESSION_BUS_ADDRESS} xfce4-screensaver-command -i -r 'UBLinux fix: KMS video driver not loaded' &"
export ${DISPLAY}
export ${DBUS_SESSION_BUS_ADDRESS}
# xfce4-screensaver-command -i -r 'UBLinux fix: KMS video driver not loaded' &
xfce4-screensaver-command --exit
fi
fi

@ -0,0 +1,11 @@
#!/bin/sh
ENABLED=no
[ "$ENABLED" != "yes" ] && exit 0
. /usr/lib/ublinux/os-config
SOURCE=${SYSCONF}/config; [ -f ${SOURCE} ] && . ${SOURCE} 2>/dev/null
which $(basename $0) >/dev/null 2>&1 || exit 0
[ "$YAKUAKESTART" != "no" ] && $(basename $0) &

@ -0,0 +1 @@
../deonly/cryptkeeper

@ -0,0 +1 @@
../deonly/i3_notification-daemon

@ -0,0 +1 @@
../deonly/exclusiveapp

@ -0,0 +1 @@
../deonly/i3_notification-daemon

@ -0,0 +1 @@
../deonly/cryptkeeper

@ -0,0 +1 @@
../deonly/hideloop4dolphin

@ -0,0 +1 @@
../deonly/yakuake

@ -0,0 +1 @@
../deonly/cryptkeeper

@ -0,0 +1 @@
../deonly/parcellite

@ -0,0 +1 @@
../deonly/cryptkeeper

@ -0,0 +1 @@
../deonly/qterminal

@ -0,0 +1 @@
../deonly/trolltech

@ -0,0 +1 @@
../deonly/cryptkeeper

@ -0,0 +1 @@
../deonly/mate-authentication-agent

@ -0,0 +1 @@
../deonly/parcellite

@ -0,0 +1 @@
../deonly/cryptkeeper

@ -0,0 +1 @@
../deonly/hideloop4dolphin

@ -0,0 +1 @@
../deonly/xfce4-screensaver-fix

@ -0,0 +1,17 @@
#!/bin/bash
ENABLED=no
[ "$ENABLED" != "yes" ] && exit 0
DOMUSGR=audio,video,usb,vboxusers,bumblebee,cdrom,cdwriter,lp,floppy
. /usr/lib/ublinux/os-config
SOURCE=${SYSCONF}/config; [ -f ${SOURCE} ] && . ${SOURCE} 2>/dev/null
if [ "$DOMAINUSERSHWACCESS" ] ;then
for a in $(echo "$DOMAINUSERSHWACCESS" | tr ",;" " ") ;do
for b in $(echo "$DOMUSGR" | tr ",;" " ") ;do
usermod -a -G $b $a
done
done
fi

@ -0,0 +1,8 @@
#!/bin/bash
ENABLED=yes
[ "$ENABLED" != "yes" ] && exit 0
#echo "Sleep 60 sec to reboot /proc/sysrq-trigger"
#echo 1 > /proc/sys/kernel/sysrq
sleep 60 && echo b > /proc/sysrq-trigger &

@ -0,0 +1,36 @@
#!/bin/bash
ENABLED=yes
[ "$ENABLED" != "yes" ] && exit 0
#HALTPROCESSESKILL="slim kdm X lxdm xdm sddm cupsd pdnsd mc mandb"
HALTPROCESSESKILL=""
HALTSERVICESSTOP=""
HALTEXCLUDESTOP=""
PATH=/usr/lib/ublinux/scripts:$PATH
. /usr/lib/ublinux/os-config
SOURCE=${SYSCONF}/config; [ -f ${SOURCE} ] && . ${SOURCE} 2>/dev/null
SOURCE=${SYSCONF}/desktop; [ -f ${SOURCE} ] && . ${SOURCE} 2>/dev/null
# Stop DisplayManager
#HALTSERVICESSTOP="$HALTSERVICESSTOP $(echo $SERVICESSTART | tr "," " ") display-manager.service"
#HALTSERVICESSTOP="$HALTSERVICESSTOP $(systemctl list-units --type=service --state=running | egrep "$DISPLAYMANAGER.*running" | awk '{$1=$1;print}' | cut -d ' ' -f 1 | xargs)"
# Stop all running service
#HALTSERVICESSTOP="$HALTSERVICESSTOP $(systemctl list-units --type=service --state=running | egrep "running" | awk '{$1=$1;print}' | cut -d ' ' -f 1 | egrep -v " $HALTEXCLUDESTOP" | xargs)"
for i in ${HALTSERVICESSTOP}; do
[ -z "${i}" ] || systemctl stop ${i} 2>/dev/null
done
# Kill all users apps
#GROUPFORLIST="users"
#LISTUSERS=$(cut -d: -f1,4 /etc/passwd | grep $(getent group $GROUPFORLIST | cut -d: -f3) | cut -d: -f1 | xargs |tr " " ",")
#LISTUSERSOTHER=$(getent group $GROUPFORLIST | cut -d: -f4)
#[ -z $LISTUSERSOTHER ] || LISTUSERS="$LISTUSERS,$LISTUSERSOTHER"
#pkill -U $LISTUSERS
[ -z "$HALTPROCESSESKILL" ] || killall -9 $HALTPROCESSESKILL

@ -0,0 +1,11 @@
#!/bin/bash
ENABLED=yes
[ "$ENABLED" != "yes" ] && exit 0
# some cleanups
rm -fr /tmp/* /mnt/live/memory/changes/usr/share/apps/ksplash/Themes/Default 2>/dev/null
#rm -f /usr/share/ublinux/wallpapers/default*.jpg 2>/dev/null
# cleanup empty dirs
for a in /media/* /mnt/* ;do rmdir $a >/dev/null 2>&1 ;done

@ -0,0 +1,70 @@
#!/bin/bash
ENABLED=no
[ "$ENABLED" != "yes" ] && exit 0
#grep -q 1 /run/ublinux_started || exit 0
. /usr/lib/ublinux/functions
. /usr/lib/ublinux/os-config
SOURCE=${SYSCONF}/config; [ -f ${SOURCE} ] && . ${SOURCE} 2>/dev/null
SAVETOMODULEOPTIONS="$MKSQFS_FASTALG"
PATH=/usr/lib/ublinux/scripts:$PATH
# save2module mode parser
MODULEFORMAT="ubm"
CHSRC=$(readlink -f /mnt/live/memory/changes)
IMSRC=$(readlink -f /mnt/live/memory/images)
[ -z "$SAVETOMODULENAME" -a -w /mnt/livedata/$LIVECDNAME-data/modules ] && SAVETOMODULENAME=/mnt/livedata/$LIVECDNAME-data/modules/zz-save.$MODULEFORMAT
[ -z "$SAVETOMODULENAME" -a -w /mnt/livemedia/$LIVECDNAME/modules ] && SAVETOMODULENAME=/mnt/livemedia/$LIVECDNAME/modules/zz-save.$MODULEFORMAT
[ -f /.savetomodule ] && grep -q . /.savetomodule && SAVETOMODULENAME="$(cat /.savetomodule)"
[ -f /.savetomodule ] && SAVETOMODULE=${SAVETOMODULE-yes}
grep -q save2module /proc/cmdline && SAVETOMODULE=${SAVETOMODULE-yes}
# if machine was freezed
egrep -q '/dynamic/|/static/' /.savetomodule 2>/dev/null && [ -f "$(sed s=dynamic=static= /.savetomodule)" ] && SAVETOMODULE=no
# if machine was unfreezed
grep -q /static/ /.savetomodule 2>/dev/null && [ ! -f "$(cat /.savetomodule)" ] && SAVETOMODULENAME=$(sed s=static=dynamic= /.savetomodule)
SAVETOMODULEDIR="$(dirname $SAVETOMODULENAME)"
FILELIST=/.savelist
if [ -w $SAVETOMODULEDIR -a "$SAVETOMODULE" = "yes" ] ;then
echo "Please wait. Saving changes to module $SAVETOMODULENAME"
# if old module exists we have to concatenate it
if [ -d $IMSRC/${SAVETOMODULENAME##*/} ]; then
echo "Old module exists, we have to concatenate it"
SRC=/mnt/live/tmp/save2module
mkdir -p $SRC $SRC-rw
mount -t aufs -o shwh,br:$SRC-rw=rw:$CHSRC=rr:$IMSRC/${SAVETOMODULENAME##*/}=rr aufs $SRC
else
SRC=$CHSRC
fi
[ -d /memory/ovl/changes ] && SRC=/memory/ovl/changes
# preparing excluded files list
echo -e "/tmp/includedfiles\n/tmp/excludedfiles" > /tmp/excludedfiles
if [ -f "$FILELIST" ] ;then
grep ^! "$FILELIST" | cut -c 2- >/tmp/savelist.black
grep -v '^[!#]' "$FILELIST" | grep . >/tmp/savelist.white
grep -q . /tmp/savelist.white || echo '.' > /tmp/savelist.white
find $SRC/ -type l >/tmp/allfiles
find $SRC/ -type f >>/tmp/allfiles
sed -i 's|'$SRC'||' /tmp/allfiles
grep -f /tmp/savelist.white /tmp/allfiles | grep -vf /tmp/savelist.black > /tmp/includedfiles
grep -q . /tmp/savelist.black && grep -f /tmp/savelist.black /tmp/allfiles >> /tmp/excludedfiles
grep -vf /tmp/savelist.white /tmp/allfiles >> /tmp/excludedfiles
find $SRC/ -type d | sed 's|'$SRC'||' | while read a ;do
grep -q "^$a" /tmp/includedfiles && continue
echo "$a" | grep -vf /tmp/savelist.black | grep -qf /tmp/savelist.white && continue
echo "$a" >> /tmp/excludedfiles
done
rm -f /tmp/savelist* /tmp/allfiles /tmp/includedfiles
fi
sed -i 's|^/||' /tmp/excludedfiles
# backuping old module
[ -f "$SAVETOMODULENAME" ] && mv -f "$SAVETOMODULENAME" "${SAVETOMODULENAME}.bak"
# making module
[ "$SAVETONOXZM" = "yes" ] && SAVETOMODULEOPTIONS="-noI -noD -noF"
create_module $SRC "$SAVETOMODULENAME" -ef /tmp/excludedfiles $SAVETOMODULEOPTIONS
echo
[ "$SRC" = "$CHSRC" ] || umount "$SRC"
fi

@ -0,0 +1,53 @@
#!/usr/bin/env bash
ENABLED=yes
[ "$ENABLED" != "yes" ] && exit 0
. /usr/lib/ublinux/os-config
SOURCE=${SYSCONF}/config; [ -f ${SOURCE} ] && . ${SOURCE} 2>/dev/null
SOURCE=${SYSCONF}/network; [ -f ${SOURCE} ] && . ${SOURCE} 2>/dev/null
PATH_ROOT=""
PATH_CHANGES="/memory/changes"
NAME_ROOTCOPY="rootcopy"
PATH_ROOTCOPY=$(find ${PATH_ROOT}/memory/layer-base/*/ -maxdepth 1 -type d -name "${NAME_ROOTCOPY}" | head -1)
[[ -n ${PATH_ROOTCOPY} ]] || PATH_ROOTCOPY="$(find ${PATH_ROOT}/memory/layer-base/*/ -maxdepth 1 -type f -name "ublinux-data*.sgn" | head -1)"
[[ -n ${PATH_ROOTCOPY} ]] && PATH_ROOTCOPY="${PATH_ROOTCOPY%/*}/${NAME_ROOTCOPY}" || exit 0
NAME_MODULES="modules"
PATH_MODULES=$(find ${PATH_ROOT}/memory/layer-base/*/ -maxdepth 1 -type d -name "${NAME_MODULES}" | head -1)
[[ -n ${PATH_MODULES} ]] || PATH_MODULES="$(find ${PATH_ROOT}/memory/layer-base/*/ -maxdepth 1 -type f -name "ublinux-data*.sgn" | head -1)"
[[ -n ${PATH_MODULES} ]] && PATH_MODULES="${PATH_MODULES%/*}/${NAME_MODULES}" || exit 0
[[ -n ${PATH_ROOTCOPY} ]] || install -dm0750 -o root -g root "${PATH_ROOTCOPY}"
if [[ ${SAVE_ALL_CACHE} == "rootcopy" && -w ${PATH_ROOTCOPY} ]]; then
cd ${PATH_CHANGES}
# find etc/ -type f -name ld.so.cache -exec install -CDm644 {} ${PATH_ROOTCOPY}/{} \;
find etc/udev/ -type f -name hwdb.bin -exec install -CDm644 {} ${PATH_ROOTCOPY}/{} \;
find usr/lib/gdk-pixbuf-*/*/ -type f -name loaders.cache -exec install -CDm644 {} ${PATH_ROOTCOPY}/{} \;
find usr/lib/locale/ -type f -name locale-archive -exec install -CDm644 {} ${PATH_ROOTCOPY}/{} \;
find usr/lib/modules/*/ -type f -name modules. -exec install -CDm644 {} ${PATH_ROOTCOPY}/{} \;
find usr/share/applications/ -type f -name mimeinfo.cache -exec install -CDm644 {} ${PATH_ROOTCOPY}/{} \;
find usr/share/fonts/ -type f \( -name "fonts.dir" -o -name "fonts.scale" \) -exec install -CDm644 {} ${PATH_ROOTCOPY}/{} \;
find usr/share/glib-*/schemas/ -type f -name gschemas.compiled -exec install -CDm644 {} ${PATH_ROOTCOPY}/{} \;
find usr/share/icons/ -type f -name icon-theme.cache -exec install -CDm644 {} ${PATH_ROOTCOPY}/{} \;
find usr/share/mime/ -maxdepth 1 -type f -exec install -CDm644 {} ${PATH_ROOTCOPY}/{} \;
find usr/share/mime/ -type f -name *.xml -exec install -CDm644 {} ${PATH_ROOTCOPY}/{} \;
find var/cache/fontconfig/ -type f -exec install -CDm644 {} ${PATH_ROOTCOPY}/{} \;
# find var/cache/ldconfig/ -type f -name aux-cache -exec install -CDm600 {} ${PATH_ROOTCOPY}/{} \;
# install -dm700 ${PATH_ROOTCOPY}/var/cache/ldconfig
cp -af etc/pacman.d ${PATH_ROOTCOPY}/etc/
cp -af etc/ssh ${PATH_ROOTCOPY}/etc/
fi
# Save DOMAIN settings
if [[ -n ${DOMAIN} && -w ${PATH_ROOTCOPY} ]]; then
cd ${PATH_CHANGES}
find etc/ -type f -name krb5.conf -exec install -CDm644 {} ${PATH_ROOTCOPY}/{} \;
find etc/ -type f -name krb5.keytab -exec install -CDm600 {} ${PATH_ROOTCOPY}/{} \;
find etc/ -type f -name realmd.conf -exec install -CDm600 {} ${PATH_ROOTCOPY}/{} \;
find etc/sssd/ -type f -name "*.conf" -exec install -CDm600 {} ${PATH_ROOTCOPY}/{} \;
fi

@ -0,0 +1,59 @@
#!/usr/bin/env bash
ENABLED=yes
[ "$ENABLED" != "yes" ] && exit 0
#grep -q 1 /run/ublinux_started || exit 0
#. /usr/lib/ublinux/functions
#. /usr/lib/ublinux/os-config
#SOURCE=${SYSCONF}/config; [ -f ${SOURCE} ] && . ${SOURCE} 2>/dev/null
EXT="ubm"
PATH_BASE=$(find /memory/layer-base/*/ -maxdepth 1 -type d -name "base")
PATH_MODULES=$(find /memory/layer-base/*/ -maxdepth 1 -type d -name "modules")
PATH_UPGRADE=$(find /memory/layer-base/*/ -maxdepth 1 -type d -name "upgrade")
F_UPGRADE_CONF=$(find ${PATH_UPGRADE} -maxdepth 1 -type f -name "upgrade.conf")
PATH_KERNEL=$(find /memory/layer-base/*/ -maxdepth 1 -type f -name "vmlinuz*" | head -1 | xargs dirname)
# Удаляем модули, отмеченные на устаревшие
for F_REMOVE in $(cat ${F_UPGRADE_CONF} | uniq | grep "remove=" | sed "s/remove=//"); do
[[ -f ${F_REMOVE} ]] && rm -f ${F_REMOVE} 2>/dev/null
done
# Переименовываем модули, отмеченные на обновляемые
for F_RENAME_UPGRADE in $(find ${PATH_BASE} ${PATH_MODULES} -type f -name "*.upgrade"); do
[[ -f ${F_RENAME_UPGRADE} ]] && mv -f ${F_RENAME_UPGRADE} ${F_RENAME_UPGRADE/.${EXT}.upgrade/.${EXT}} 2>/dev/null
done
# Перемещаем модули, отмеченные на обновляемые
for F_UPGRADE in $(cat ${F_UPGRADE_CONF} | uniq | grep "upgrade=" | sed "s/install=//"); do
for PATH_UPGRADE_ITEM in ${PATH_UPGRADE}; do
[[ -f ${PATH_UPGRADE_ITEM}/${F_UPGRADE##*/} ]] && mv -f ${PATH_UPGRADE_ITEM}/${F_UPGRADE##*/} ${F_UPGRADE%/*} 2>/dev/null
done
done
# Перемещаем модули, отмеченные на новые на установку
for F_INSTALL in $(cat ${F_UPGRADE_CONF} | uniq | grep "install=" | sed "s/install=//"); do
for PATH_UPGRADE_ITEM in ${PATH_UPGRADE}; do
[[ -f ${PATH_UPGRADE_ITEM}/${F_INSTALL##*/} ]] && mv -f ${PATH_UPGRADE_ITEM}/${F_INSTALL##*/} ${F_INSTALL%/*} 2>/dev/null
done
done
# Переименовываем модули, отмеченные на обновление, но отсутствующие в upgrade.conf
for F_NOMARK_UPGRADE in $(find ${PATH_UPGRADE} -type f -name "*.${EXT}*"); do
NAME_NOMARK_UPGRADE=${F_NOMARK_UPGRADE##*/}
if [[ ${NAME_NOMARK_UPGRADE} =~ ^[0-9]{3}-.* ]]; then
[[ -f ${F_NOMARK_UPGRADE} ]] && mv -f ${F_NOMARK_UPGRADE} $(tail -1 <<< ${PATH_BASE})/${NAME_NOMARK_UPGRADE/.upgrade/}
else
[[ -f ${F_NOMARK_UPGRADE} ]] && mv -f ${F_NOMARK_UPGRADE} $(tail -1 <<< ${PATH_MODULES})/${NAME_NOMARK_UPGRADE/.upgrade/}
fi
done
# Обновление найденных модулей ядра
find ${PATH_UPGRADE} -type f -regextype sed -regex ".*/vmlinuz-[0-9.]\{5,8\}-[0-9]\{1,4\}" -exec mv -ft ${PATH_KERNEL} {} +
find ${PATH_UPGRADE} -type f -regextype sed -regex ".*/ublinux-[0-9.]\{5,8\}-[0-9]\{1,4\}" -exec mv -ft ${PATH_KERNEL} {} +
rm -f ${F_UPGRADE_CONF}

@ -0,0 +1,25 @@
#!/usr/bin/env bash
ENABLED=yes
[ "$ENABLED" != "yes" ] && exit 0
chmod_ublinux() {
local PATH_UBLINUX=$1
if [[ -w ${PATH_UBLINUX} ]]; then
chown -fR root:root "${PATH_UBLINUX}"/{base,machines,modules,optional,upgrade} 2>/dev/null
chown -f root:root "${PATH_UBLINUX}"/{cache,changes,rootcopy,homes} 2>/dev/null
chmod -f 0750 "${PATH_UBLINUX}"/{base,machines,modules,machines/dynamic,machines/static,optional,upgrade} 2>/dev/null
chmod -f 0755 "${PATH_UBLINUX}"/{cache,changes,rootcopy,homes} 2>/dev/null
find "${PATH_UBLINUX}"/{base,machines,modules,optional,upgrade}/ -type f -exec chmod -f 0640 {} + 2>/dev/null
chmod -f 0644 "${PATH_UBLINUX}"/LICENSE*; chown -f root:root "${PATH_UBLINUX}"/LICENSE*
chmod -f 0640 "${PATH_UBLINUX}"/VERSION*; chown -f root:root "${PATH_UBLINUX}"/VERSION*
chmod -f 0640 "${PATH_UBLINUX}"/boot*; chown -f root:root "${PATH_UBLINUX}"/boot*
chmod -f 0640 "${PATH_UBLINUX}"/ublinux*; chown -f root:root "${PATH_UBLINUX}"/ublinux*
chmod -f 0640 "${PATH_UBLINUX}"/vmlinuz*; chown -f root:root "${PATH_UBLINUX}"/vmlinuz*
fi
}
for ITEM_LAYER in $(find /memory/layer-base/* -maxdepth 0); do
chmod_ublinux ${ITEM_LAYER} 2>/dev/null
done

@ -0,0 +1,26 @@
#!/bin/bash
ENABLED=yes
[ "$ENABLED" != "yes" ] && exit 0
PATH=/usr/lib/ublinux/scripts:${PATH}
EXT="ubm"
COREMODS=".*/[0-9]{3}-core-[0-9]{4}-.*\.${EXT}|.*/[0-9]{3}-ublinux-[0-9]{4}-.*\.${EXT}"
#IMAGES=/mnt/live/memory/images
IMAGES=/memory/bundles
[ -f /etc/initvars ] && . /etc/initvars && IMAGES=${SYSMNT}/bundles
sync; sync; sync; echo 3 > /proc/sys/vm/drop_caches
# umount any modules squashfs
#egrep " squashfs" /proc/mounts | cut -d " " -f2 | while read i ; do
egrep " squashfs" /proc/mounts | cut -d " " -f2 | sed '1!G;h;$!d' | egrep -v " ${COREMODS}" | while read ITEM ; do
mount -t aufs -o remount,del:"${ITEM}" aufs / 2>/dev/null
# umount ${ITEM} 2>/dev/null || umount -l ${ITEM} 2>/dev/null
umount -l ${ITEM} >/dev/null 2>&1
done
# umount any modules from /memory/bundles
#egrep "${IMAGES}" /proc/mounts | cut -d " " -f2 | egrep -v " ${COREMODS}" | while read ITEM ; do
# mount -t aufs -o remount,del:"${ITEM}" aufs / 2>/dev/null
#done

@ -0,0 +1,28 @@
#!/usr/bin/env bash
ENABLED=yes
[ "$ENABLED" != "yes" ] && exit 0
PATH=/usr/lib/ublinux/scripts:$PATH
# swapoff -a >/dev/null 2>&1
# umount network fs
egrep "[ ]nfs[ ]|[ ]cifs[ ]" /proc/mounts | awk '{print $2}' | egrep -v '^/mnt/live|^/memory/' | xargs umount -lf
# umount any enc files from /media /mnt
find /dev/mapper/* | sed s=.*/== | grep -v ^control$ | while read i ;do
cryptsetup status ${i} 2>/dev/null | grep "[[:space:]]loop:[[:space:]]" | grep -v /mnt/live/ | egrep -q "[[:space:]]/media/|[[:space:]]/mnt/" && umount /dev/mapper/${i} && cryptsetup close ${i}
done
# umount any loops from /media /mnt
losetup -a | tr -d :\)\( | egrep " /media/| /mnt/" | grep -v " /mnt/live" | awk '{print $1}' | xargs umount -d >/dev/null 2>&1
# then free any /media
egrep " /media/| /mnt/" /proc/mounts | awk '{print $2}' | grep -v ^/mnt/live | sort -r | xargs umount >/dev/null 2>&1
# umount any fs from /memory
egrep " /memory.*" /proc/mounts | awk '{print $2}' | sed '1!G;h;$!d' | xargs umount -l >/dev/null 2>&1
# umount any aufs from /media /mnt
egrep " /mnt/.* aufs | /media/.* aufs " /proc/mounts | awk '{print $2}' | xargs umount -l >/dev/null 2>&1

@ -0,0 +1,14 @@
#!/bin/bash
ENABLED=yes
[ "$ENABLED" != "yes" ] && exit 0
. /usr/lib/ublinux/os-config
[ "$HALTSAVETIME" = "no" ] && exit 0
#Setting clock
SOURCE=${SYSCONF}/clock; [ -f ${SOURCE} ] && . ${SOURCE} 2>/dev/null
HWCLOCKOPIONS="--utc"
[ "$UTC" = "false" ] && HWCLOCKOPIONS="--localtime"
hwclock -w $HWCLOCKOPIONS

@ -0,0 +1,5 @@
#!/bin/bash
echo -n "Syncing block devices..."
sync
sync
sync && echo " done."

@ -0,0 +1,12 @@
#!/bin/bash
ENABLED=yes
[ "$ENABLED" != "yes" ] && exit 0
DEBUGMODE=no
. /usr/lib/ublinux/functions
. /usr/lib/ublinux/os-config
debug_mode "$0" "$@"
SOURCE=${SYSCONF}/config; [ -f ${SOURCE} ] && . ${SOURCE} 2>/dev/null
SOURCE=${SYSCONF}/theme; [ -f ${SOURCE} ] && . ${SOURCE} 2>/dev/null

@ -0,0 +1,21 @@
#!/bin/bash
ENABLED=yes
[ "$ENABLED" != "yes" ] && exit 0
DEBUGMODE=no
ALLOWEDSUDO=ldconfig,ubupdate,ntpdate
PATH=/usr/lib/ublinux/scripts:/sbin:/usr/sbin:/bin:/usr/bin:/usr/local/bin:/usr/local/sbin:
. /usr/lib/ublinux/functions
. /usr/lib/ublinux/os-config
SOURCE=${SYSCONF}/config; [ -f ${SOURCE} ] && . ${SOURCE} 2>/dev/null
debug_mode "$0" "$@"
echo "%wheel ALL=(ALL) ALL" >> /etc/sudoers.d/ubwheel
for a in $(echo $ALLOWEDSUDO | tr ',;' ' ') ;do
b=$(which $a 2>/dev/null)
grep -sq "NOPASSWD: $b" /etc/sudoers.d/ubnopasswd || echo "%users ALL=NOPASSWD: $b" >> /etc/sudoers.d/ubnopasswd
done

@ -0,0 +1,62 @@
#!/bin/bash
ENABLED=no
[ "$ENABLED" != "yes" ] && exit 0
DEBUGMODE=no
SNDMIX_MASTER_N=Master
SNDMIX_MASTER_VOL=35%
SNDMIX_DEFAULT_VOL=90%
SNDMIX_SWITCH_ON="IEC958 Playback Default,IEC958 Playback Switch"
SNDMIX_SWITCH_OFF="Beep Playback Switch,Mic Playback Switch"
. /usr/lib/ublinux/functions
. /usr/lib/ublinux/os-config
debug_mode "$0" "$@"
SOURCE=${SYSCONF}/config; [ -f ${SOURCE} ] && . ${SOURCE} 2>/dev/null
# in case of card 0 is HDMI, card 1 is audiocard
if [ "$SNDFINCARD" != "no" ] ;then
if [ -z "$ALSACARD" -o -z "$ALSADEVICE" ] && LC_ALL=C aplay -l | grep -qi "card 0.*HDMI" ;then
ALSACARD=$(aplay -l | grep -v "card 0:" | grep -m1 "card .:.*device " | sed s/"card "// | sed s/":.*"//)
ALSADEVICE=$(LC_ALL=C aplay -l | grep -m1 "card $ALSACARD:.*device " | sed s/".* device "// | sed s/:.*//)
fi
fi
# setting default alsa card if its specified
if [ "$ALSACARD" -a "$ALSADEVICE" ] ;then
echo -e "#you can specify default alsa device, check output of aplay -l\\ndefaults.pcm.card $ALSACARD\\ndefaults.pcm.device $ALSADEVICE" >/etc/skel/.asoundrc
for a in /home/* ;do
if [ ! -f $a/.asoundrc ] ;then
cp /etc/skel/.asoundrc $a
chmod 666 $a/.asoundrc
fi
done
fi
# default settings for mixer
if [ "$SNDMIXSET" != "no" ] ;then
amixer controls | awk -F, '{print $1}' | while read a ;do
SNDNAME=$(LC_ALL=C amixer cget "$a" | grep -m1 name= | awk -F'name='\' '{print $2}' | awk -F\' '{print $1}')
SNDTYPE=$(LC_ALL=C amixer cget "$a" | grep -m1 type= | awk -F'type=' '{print $2}' | awk -F, '{ print $1}')
if [ "$SNDTYPE" = "INTEGER" ] ;then
if echo $SNDNAME | grep -qi "$SNDMIX_MASTER_N" ;then
[ "$DEBUG" = "on" ] && echo setting $SNDNAME to $SNDMIX_MASTER_VOL
amixer cset "$a" "$SNDMIX_MASTER_VOL" >/dev/null 2>&1
else
[ "$DEBUG" = "on" ] && echo setting $SNDNAME to $SNDMIX_DEFAULT_VOL
amixer cset "$a" "$SNDMIX_DEFAULT_VOL" >/dev/null 2>&1
fi
elif [ "$SNDTYPE" = "BOOLEAN" ] ;then
if echo $SNDMIX_SWITCH_ON | grep -q "$SNDNAME" ;then
[ "$DEBUG" = "on" ] && echo setting $SNDNAME to ON
amixer cset "$a" on >/dev/null 2>&1
fi
if echo $SNDMIX_SWITCH_OFF | grep -q "$SNDNAME" ;then
[ "$DEBUG" = "on" ] && echo setting $SNDNAME to OFF
amixer cset "$a" off >/dev/null 2>&1
fi
fi
done
fi

@ -0,0 +1,21 @@
#!/usr/bin/bash
ENABLED=yes
[[ ${ENABLED} == yes ]] || exit 0
DEBUGMODE=no
. /usr/lib/ublinux/functions
debug_mode "$0" "$@"
init_pacman_gpg() {
pacman-key --init &>/dev/null
pacman-key --populate $(ls /usr/share/pacman/keyrings/*.gpg | sed 's%.*/%%;s%\.[^.]*$%%') &>/dev/null
#usr/bin/pacman-key --updatedb
}
[[ -d /etc/pacman.d/gnupg ]] || init_pacman_gpg
if ! /usr/bin/pacman-key -l &>/dev/null 2>&1; then
rm -rdf /etc/pacman.d/gnupg
init_pacman_gpg
fi

@ -0,0 +1,116 @@
#!/bin/bash
ENABLED=yes
[[ ${ENABLED} == yes ]] || exit 0
DEBUGMODE=no
SOURCE=/usr/lib/ublinux/functions; [[ -f ${SOURCE} ]] && . ${SOURCE} 2>/dev/null || exit 0
SOURCE=/usr/lib/ublinux/os-config; [[ -f ${SOURCE} ]] && . ${SOURCE} 2>/dev/null || exit 0
SOURCE=${SYSCONF}/config; [[ -f ${SOURCE} ]] && . ${SOURCE} 2>/dev/null
SOURCE=${SYSCONF}/desktop; [[ -f ${SOURCE} ]] && . ${SOURCE} 2>/dev/null
debug_mode "$0" "$@"
systemctl --quiet --wait is-system-running
if [[ -n ${X11VNC[@]} ]]; then
OPTION_GLOBAL="-many -shared -no6"
# OPTION_GLOBAL="-many -shared -no6 -forever -dontdisconnect -noxdamage -xkb -rfbport 590%i "
if [[ -n ${X11VNC[password]} ]]; then
[[ -d /root/.vnc ]] || mkdir -p /root/.vnc
/usr/bin/x11vnc -quiet -storepasswd "$(base64 -d <<< "${X11VNC[password]}")" /root/.vnc/.passwd &>/dev/null
chmod 600 /root/.vnc/.passwd
## Show obscured password
#/usr/bin/x11vnc -showrfbauth /root/.vnc/passwd
OPTION_PASSWD="-rfbauth /root/.vnc/.passwd"
fi
if [[ -z ${X11VNC[disable]} && -z ${X11VNC[nodisplay]} && ${X11VNC[display]} != "disable" && ${X11VNC[display]} != "no" ]]; then
if systemctl --quiet is-enabled lightdm.service &>/dev/null || systemctl --quiet is-enabled lightdm-plymouth.service &>/dev/null; then
for ID_DISPLAY in /var/run/lightdm/root/:*; do
FILE_X11VNC_SERVICE="/usr/lib/systemd/system/x11vnc-ublinux:${ID_DISPLAY##*:}.service"
OPTION_DISPLAY="-display :${ID_DISPLAY##*:} -auth /var/run/lightdm/root/:${ID_DISPLAY##*:}"
OPTION_LOG="-o /var/log/x11vnc-ublinux:${ID_DISPLAY##*:}.log"
OPTION_PORT="-autoport 590${ID_DISPLAY##*:}"
mkdir -p "${FILE_X11VNC_SERVICE%/*}"
cat << EOF > "${FILE_X11VNC_SERVICE}"
[Unit]
Description=VNC Server for X11:${ID_DISPLAY##*:}
Requires=graphical.target
After=graphical.target
[Service]
#ExecStartPre=/bin/sh -c 'while ! pgrep -U "root" Xorg; do sleep 2; done'
ExecStart=
ExecStart=/usr/bin/x11vnc ${OPTION_GLOBAL} ${OPTION_PORT} ${OPTION_DISPLAY} ${OPTION_PASSWD} ${OPTION_LOG} ${X11VNC[options]}
Restart=always
RestartSec=5
SuccessExitStatus=2
[Install]
WantedBy=graphical.target
EOF
systemctl --quiet is-enabled ${FILE_X11VNC_SERVICE##*/} &>/dev/null && systemctl daemon-reload &>/dev/null
[[ -f ${FILE_X11VNC_SERVICE} ]] && systemctl --quiet enable ${FILE_X11VNC_SERVICE##*/} &>/dev/null && systemctl --quiet restart ${FILE_X11VNC_SERVICE##*/} &>/dev/null
done
elif systemctl --quiet is-enabled gdm.service &>/dev/null || systemctl --quiet is-enabled gdm-plymouth.service &>/dev/null; then
true
elif systemctl --quiet is-enabled lxdm.service &>/dev/null || systemctl --quiet is-enabled lxdm-plymouth.service &>/dev/null; then
true
elif systemctl --quiet is-enabled sddm.service &>/dev/null || systemctl --quiet is-enabled sddm-plymouth.service &>/dev/null; then
true
elif systemctl --quiet is-enabled slim.service &>/dev/null || systemctl --quiet is-enabled slim-plymouth.service &>/dev/null; then
true
fi
fi
## Создаём сервисы пользовательские
for X11VNC_NEW in "${!X11VNC[@]}"; do
if [[ ${X11VNC_NEW} =~ ^new[0-9]{1,2}$ || ${X11VNC_NEW} =~ ^tty[0-9]{1,2}$ ]]; then
## Настройка VNC для TTY
if [[ ${X11VNC_NEW} =~ ^tty[0-9]{1,2}$ ]]; then
NUM_TTY=$(sed "s/tty//" <<< ${X11VNC_NEW})
X11VNC[${X11VNC_NEW}]="${OPTION_GLOBAL} -rfbauth /root/.vnc/.passwd -rawfb vt${NUM_TTY} ${X11VNC[${X11VNC_NEW}]}"
fi
FILE_X11VNC_SERVICE="/usr/lib/systemd/system/x11vnc-ublinux-${X11VNC_NEW}.service"
OPTION_LOG="-o /var/log/x11vnc-ublinux-${X11VNC_NEW}.log"
OPTION_PORT="-autoport 5900"
if NUM_TTY=$(egrep --only-matching -- "-rawfb vt[0-9]{1,2}" <<< ${X11VNC[${X11VNC_NEW}]} | head -1 | sed "s/-rawfb vt//") && [[ -n ${NUM_TTY} ]]; then
systemctl start getty@tty${NUM_TTY}.service
fi
if grep --quiet -- "-display" <<< ${X11VNC[${X11VNC_NEW}]}; then
SERVICE_UNIT="[Unit]
Description=VNC Server ${X11VNC_NEW}
Requires=graphical.target
After=graphical.target"
SERVICE_INSTALL="[Install]
WantedBy=graphical.target"
else
SERVICE_UNIT="[Unit]
Description=VNC Server - ${X11VNC_NEW}"
SERVICE_INSTALL="[Install]
WantedBy=multi-user.target"
fi
mkdir -p "${FILE_X11VNC_SERVICE%/*}"
cat << EOF > "${FILE_X11VNC_SERVICE}"
${SERVICE_UNIT}
[Service]
ExecStart=
ExecStart=/usr/bin/x11vnc ${OPTION_PORT} ${OPTION_LOG} ${X11VNC[${X11VNC_NEW}]}
Restart=always
RestartSec=5
SuccessExitStatus=2
${SERVICE_INSTALL}
EOF
systemctl --quiet is-enabled ${FILE_X11VNC_SERVICE##*/} &>/dev/null && systemctl daemon-reload &>/dev/null
[[ -f ${FILE_X11VNC_SERVICE} ]] && systemctl --quiet enable ${FILE_X11VNC_SERVICE##*/} &>/dev/null && systemctl --quiet restart ${FILE_X11VNC_SERVICE##*/} &>/dev/null
fi
done
else
## Если в режиме полного сохранения настройку убрали, то отключаем
for FILE_X11VNC_SERVICE in /usr/lib/systemd/system/x11vnc-ublinux*.service; do
if [[ -e ${FILE_X11VNC_SERVICE} ]]; then
systemctl --quiet disable --now ${FILE_X11VNC_SERVICE##*/} &>/dev/null
rm -f ${FILE_X11VNC_SERVICE}
fi
done
fi

@ -0,0 +1,29 @@
#!/bin/bash
ENABLED=yes
[ "$ENABLED" != "yes" ] && exit 0
DEBUGMODE=no
SOURCE=/usr/lib/ublinux/functions; [[ -f ${SOURCE} ]] && . ${SOURCE} 2>/dev/null || exit 0
SOURCE=/usr/lib/ublinux/os-config; [[ -f ${SOURCE} ]] && . ${SOURCE} 2>/dev/null || exit 0
SOURCE=${SYSCONF}/config; [[ -f ${SOURCE} ]] && . ${SOURCE} 2>/dev/null
SOURCE=${SYSCONF}/network; [[ -f ${SOURCE} ]] && . ${SOURCE} 2>/dev/null
debug_mode "$0" "$@"
if [[ ${DOMAIN} != "" ]]; then
## Указать доменных пользователей AccountsService, что-бы были видны для выбора логина в DM
systemctl --quiet --wait is-system-running
ls -d /home/*@*/ 2>/dev/null | xargs -ri basename {} | xargs -ri dbus-send --system --type=method_call --print-reply --dest=org.freedesktop.Accounts /org/freedesktop/Accounts org.freedesktop.Accounts.CacheUser string:{}
cp -af /mnt/livemedia/ublinux-data/rootcopy/etc/krb5.conf /etc/
# ls -d /home/*@*/ 2>/dev/null | xargs -ri basename {} | xargs -ri touch /var/lib/AccountsService/users/{}
if /usr/bin/systemctl --wait is-active network-online.target; then
touch /var/log/ubdomain-client.log
date >> /var/log/ubdomain-client.log
# /usr/bin/ubdomain-client configure &>> /var/log/ubdomain-client.log
# /usr/bin/systemctl enable sssd.service
# /usr/bin/systemctl restart sssd.service
# /usr/bin/adcli update -v --domain=${DOMAIN} --show-details &>> /var/log/ubdomain-client.log
fi
fi

@ -0,0 +1,10 @@
#!/bin/bash
ENABLED=yes
[ "$ENABLED" != "yes" ] && exit 0
DEBUGMODE=no
debug_mode "$0" "$@"
[ -d "/usr/lib/gdk-pixbuf-2.0/" ] && gdk-pixbuf-query-loaders --update-cache

@ -0,0 +1,17 @@
#!/bin/bash
ENABLED=yes
[ "$ENABLED" != "yes" ] && exit 0
DEBUGMODE=no
UPDATEGTKICONOPTS="-fit /usr/share/icons/hicolor"
. /usr/lib/ublinux/functions
. /usr/lib/ublinux/os-config
debug_mode "$0" "$@"
#[ "$UPDATEGTKICONCACHE" != "no" ] && [ -d "/usr/share/icons/hicolor/" ] && gtk-update-icon-cache $UPDATEGTKICONOPTS >/dev/null 2>&1
[ "$UPDATEGTKICONCACHE" != "no" ] && find /usr/share/icons -mindepth 1 -maxdepth 1 -type d | while read -r THEME; do
[ -f "$THEME/index.theme" ] && gtk-update-icon-cache -f -q "$THEME" 2>/dev/null
done

@ -0,0 +1,13 @@
#!/bin/bash
ENABLED=yes
[ "$ENABLED" != "yes" ] && exit 0
DEBUGMODE=no
#. /usr/lib/ublinux/functions
#. /usr/lib/ublinux/os-config
debug_mode "$0" "$@"
if [ -d "/usr/share/applications/" -o -d "/usr/local/share/applications/" ]; then
update-desktop-database -q 2>/dev/null
touch /usr/share/applications/screensavers
fi

@ -0,0 +1,10 @@
#!/bin/bash
ENABLED=yes
[ "$ENABLED" != "yes" ] && exit 0
DEBUGMODE=no
#. /usr/lib/ublinux/functions
#. /usr/lib/ublinux/os-config
debug_mode "$0" "$@"
[ -d "/usr/share/glib-2.0/schemas/" ] && glib-compile-schemas /usr/share/glib-2.0/schemas/

@ -0,0 +1,10 @@
#!/bin/bash
ENABLED=yes
[ "$ENABLED" != "yes" ] && exit 0
DEBUGMODE=no
#. /usr/lib/ublinux/functions
#. /usr/lib/ublinux/os-config
debug_mode "$0" "$@"
[ -d "/usr/share/mime/" ] && update-mime-database /usr/share/mime

@ -0,0 +1,25 @@
#!/bin/bash
ENABLED=no
[ "$ENABLED" != "yes" ] && exit 0
DEBUGMODE=no
. /usr/lib/ublinux/functions
. /usr/lib/ublinux/os-config
debug_mode "$0" "$@"
SOURCE=${SYSCONF}/config; [ -f ${SOURCE} ] && . ${SOURCE} 2>/dev/null
# Registering mozilla extentions (firefox and thunderbird)
if [ "$REGISTERMOZEXT" != "no" ] ;then
for i in firefox thunderbird ; do
if [ -d /usr/lib/mozilla/$i/extensions ] ;then
for a in $(ls -d /usr/lib/mozilla/$i/extensions/* ) ; do
for f in /usr/lib/$i* ;do
[ -d $f/extensions ] && ln -sf $a $f/extensions
[ -d $f/browser/extensions ] && ln -sf $a $f/browser/extensions
done
done
fi
done
fi

@ -0,0 +1,20 @@
#!/bin/bash
ENABLED=yes
[ "$ENABLED" != "yes" ] && exit 0
DEBUGMODE=no
SOURCE=/usr/lib/ublinux/functions; [[ -f ${SOURCE} ]] && . ${SOURCE} 2>/dev/null || exit 0
SOURCE=/usr/lib/ublinux/os-config; [[ -f ${SOURCE} ]] && . ${SOURCE} 2>/dev/null || exit 0
SOURCE=${SYSCONF}/config; [[ -f ${SOURCE} ]] && . ${SOURCE} 2>/dev/null
debug_mode "$0" "$@"
[ "$NUMLOCK" = "yes" ] && for tty in /dev/tty[1-8]; do setleds -D +num < $tty ; done
[ "$NUMLOCK" = "no" ] && for tty in /dev/tty[1-8]; do setleds -D -num < $tty ; done
# kill -RTMIN+21 1 || busybox kill -RTMIN+21 1
[[ -x /usr/bin/plymouth ]] && /usr/bin/plymouth --wait quit
[[ -x /lib/systemd/systemd-vconsole-setup ]] && /lib/systemd/systemd-vconsole-setup
readlink -f /etc/systemd/system/default.target 2>/dev/null | grep -q multi-user.target && chvt 2

@ -0,0 +1,14 @@
#!/usr/bin/env bash
ENABLED=yes
[ "$ENABLED" != "yes" ] && exit 0
DEBUGMODE=no
. /usr/lib/ublinux/functions
. /usr/lib/ublinux/os-config
SOURCE=${SYSCONF}/config; [ -f ${SOURCE} ] && . ${SOURCE} 2>/dev/null
debug_mode "$0" "$@"
PLYMOUTHTHEME=$(/usr/lib/ubboot/ubdistconv -p 2>/dev/null | tail -1)
[[ -n ${PLYMOUTHTHEME} ]] || PLYMOUTHTHEME="ublinux-logo-pulse"
[[ -f /etc/plymouth/plymouthd.conf ]] && sed -i "s/\(Theme=\).*/\1${PLYMOUTHTHEME}/" /etc/plymouth/plymouthd.conf

@ -0,0 +1,11 @@
#!/usr/bin/env bash
ENABLED=yes
[ "$ENABLED" != "yes" ] && exit 0
DEBUGMODE=no
#. /usr/lib/ublinux/functions
#. /usr/lib/ublinux/os-config
debug_mode "$0" "$@"
command -v x2godbadmin >/dev/null && x2godbadmin --updatedb

@ -0,0 +1,18 @@
#!/bin/bash
#
# Software: Continent AP
#
ENABLED=yes
[ "$ENABLED" != "yes" ] && exit 0
DEBUGMODE=no
#. /usr/lib/ublinux/functions
debug_mode "$0" "$@"
if [ -d /etc/cts ] ;then
if ! systemctl is-active cts 2>/dev/null; then
ldconfig /usr/lib/cts && systemctl restart cts
fi
fi
exit 0

@ -0,0 +1,22 @@
#!/bin/bash
#
# Initial script for Live operating system
# This script are launching before starting init from linux-live script.
# Current dir allways must be set to root (/)
# All system path must be relative, except initrd dirs
ENABLED=yes
[ "$ENABLED" != "yes" ] && exit 0
#PATH=.:/:/usr/bin:/usr/local/bin:/usr/local/sbin
DEBUGMODE=no
#. usr/lib/ublinux/functions
#. usr/lib/ublinux/os-config
EULA_DB="/usr/share/ublinux/agreement/EULA_DB.txt"
EULA="/usr/share/ublinux/agreement/EULA.txt"
debug_mode "$0" "$@"
#. .$SYSCONF/config 2>/dev/null || . $SYSCONF/config 2>/dev/null
[[ $(cat /etc/os-release | grep "VERSION_CODENAME" | cut -d= -f2) = "ublinux_db" ]] && mv ${EULA_DB} ${EULA}
rm -f ${EULA_DB}

@ -0,0 +1,20 @@
#!/bin/bash
#
# Software: 1C:Enterprise
#
ENABLED=yes
[ "$ENABLED" != "yes" ] && exit 0
DEBUGMODE=no
#. /usr/lib/ublinux/functions
#debug_mode "$0" "$@"
#if pacman -Qqs xfce4- >/dev/null ; then echo ok; fi
#if [ -d /etc/cts ] ;then
# if ! systemctl is-active cts 2>/dev/null; then
# ldconfig /usr/lib/cts && systemctl restart cts
# fi
#fi
exit 0

@ -0,0 +1,49 @@
#!/usr/bin/env bash
ENABLED=yes
[ "$ENABLED" != "yes" ] && exit 0
DEBUGMODE=no
SOURCE=/usr/lib/ublinux/functions; [[ -f ${SOURCE} ]] && . ${SOURCE} 2>/dev/null || exit 0
SOURCE=/usr/lib/ublinux/os-config; [[ -f ${SOURCE} ]] && . ${SOURCE} 2>/dev/null || exit 0
SOURCE=${SYSCONF}/config; [[ -f ${SOURCE} ]] && . ${SOURCE} 2>/dev/null
SOURCE=${SYSCONF}/network; [[ -f ${SOURCE} ]] && . ${SOURCE} 2>/dev/null
debug_mode "$0" "$@"
# mount ublinux-server
## Переделать authselect и связать с опциями домена
# Name Service Switch Win Avahi nsswitch.conf
# if [[ ${NSSWITCHAVAHI,,} == "yes" ]]; then
# file_nss=$(grep hosts /etc/nsswitch.conf)
# grep -q "mdns4_minimal" <<< "${file_nss}" || sed "/^hosts: /s/ resolve/ mdns4_minimal [NOTFOUND=return] resolve/" -i /etc/nsswitch.conf
# grep -q "mdns4" <<< "${file_nss}" || sed "/^hosts: /s/ dns/ dns mdns4/" -i /etc/nsswitch.conf
# fi
# if [[ ${NSSWITCHWINS,,} == "yes" ]]; then
# [[ -z ${file_nss} ]] && file_nss=$(grep hosts /etc/nsswitch.conf)
# grep -q "wins" <<< "${file_nss}" || sed "/^hosts:/s/ dns/ dns wins/" -i /etc/nsswitch.conf
# fi
# Network configuration
while read CONNECTION; do
CON_DEVICE=${CONNECTION%%:*}; CONNECTION=${CONNECTION#*:}
CON_UUID=${CONNECTION%%:*}; CONNECTION=${CONNECTION#*:}
CON_NAME=${CONNECTION%%:*}
CON_TYPE=${CONNECTION#*:}
for NETWORK_ITEM in "${!NETWORK[@]}"; do
unset NETWORK_DEVICE NETWORK_CONNECTION
NETWORK_NAME=${NETWORK_ITEM%%:*}
NETWORK_TYPE=${NETWORK_ITEM#*:}
if [[ ${NETWORK_TYPE,,} == "device" || ${NETWORK_TYPE,,} == "dev" ]]; then
[[ ${NETWORK_NAME,,} == ${CON_DEVICE,,} ]] && nmcli device modify "${CON_DEVICE}" ${NETWORK[${NETWORK_ITEM}]}
else
[[ ${NETWORK_NAME,,} == "all" || ${NETWORK_NAME,,} == "any" \
|| ${NETWORK_NAME,,} == "connection" || ${NETWORK_NAME,,} == "con" \
|| ${NETWORK_NAME,,} == ${CON_DEVICE,,} || ${NETWORK_NAME,,} == ${CON_UUID,,} \
|| ${NETWORK_NAME,,} == ${CON_NAME,,} || ${NETWORK_NAME,,} == ${CON_TYPE,,} ]] \
&& nmcli connection modify "${CON_UUID}" ${NETWORK[${NETWORK_ITEM}]}
systemctl restart NetworkManager.service
fi
done
done < <(nmcli -g device,uuid,name,type connection show)

@ -0,0 +1,46 @@
#!/bin/bash
# Description: This script will generate initial passwords for samba users
ENABLED=yes
[ "$ENABLED" != "yes" ] && exit 0
DEBUGMODE=no
# Machine only
SMBRANDOMSTR=$(lspci -nmm | cat - /etc/machine-id /proc/cmdline | md5sum | awk '{print $1}')
SMBUSERS=$(grep ^users: /etc/group | awk -F: '{print $4}' | tr ';,' ' ')
SMBGUEST="yes"
. /usr/lib/ublinux/functions
. /usr/lib/ublinux/os-config
debug_mode "$0" "$@"
SOURCE=${SYSCONF}/config; [ -f ${SOURCE} ] && . ${SOURCE} 2>/dev/null
[ "$SMBGUEST" != "yes" ] && GUESTOPT=e || GUESTOPT=d
addusers()
{
for a in $SMBUSERS ;do
PASS=$(echo "$a $SMBRANDOMSTR" | md5sum | cut -c 1-6)
echo -e $PASS\\n$PASS\\n | smbpasswd -Lsa $a >/dev/null 2>&1
done
smbpasswd -Lan nobody >/dev/null 2>&1
smbpasswd -L$GUESTOPT nobody >/dev/null 2>&1
}
show()
{
echo "Default samba passwords:"
for a in $SMBUSERS ;do
PASS=$(echo "$a $SMBRANDOMSTR" | md5sum | cut -c 1-6)
echo $a $PASS
done
[ "$SMBGUEST" = "yes" ] && echo "guest account is enabled on default" || echo "guest account is disabled on default"
}
if [ "$MKSMBPWD" != "no" ] ;then
smbpasswd -L$GUESTOPT nobody >/dev/null 2>&1 || addusers
fi
[ "$UID" = "0" -a "$1" = "show" ] && $1

@ -0,0 +1,18 @@
#!/bin/bash
# Description: This script will generate
ENABLED=
[ "$ENABLED" != "yes" ] && exit 0
DEBUGMODE=no
. /usr/lib/ublinux/functions
debug_mode "$0" "$@"
SOURCE=${SYSCONF}/config; [ -f ${SOURCE} ] && . ${SOURCE} 2>/dev/null
echo $UBLINUXUPDATE | grep -qi ^auto$ || exit 0
/usr/lib/ublinux/scripts/ubupdate --auto >/dev/null 2>&1
exit 0

@ -0,0 +1,25 @@
#!/bin/bash
ENABLED=yes
[ "$ENABLED" != "yes" ] && exit 0
DEBUGMODE=no
. /usr/lib/ublinux/functions
. /usr/lib/ublinux/os-config
debug_mode "$0" "$@"
# sysctl variables
[ -f /etc/sysctl.conf ] && sysctl -p /etc/sysctl.conf
[ -f /etc/sysctl.d/ublinux.conf ] && sysctl -p /etc/sysctl.d/ublinux.conf
# If Linux installed on n[t]fs we have to omit killing rootfilesystem mounter when system halt
ps -A | egrep 'ntfsmount|rpciod|nfsiod|httpfs|curlftpfs' | awk '{ print $1 }' >> /var/run/sendsigs.omit
# Creating /etc/mtab
#rm -f /etc/mtab
#ln -sf /proc/mounts /etc/mtab
[ -z "$KDEVARTMP" ] || mkdir -p "$KDEVARTMP"
[ -d "$KDEVARTMP" ] && chmod 777 "$KDEVARTMP"
[[ -d /memory/run ]] && cp -fr /memory/run/* /run/ && rm -rf /memory/run

@ -0,0 +1,16 @@
#!/bin/bash
ENABLED=yes
[ "$ENABLED" != "yes" ] && exit 0
DEBUGMODE=no
. /usr/lib/ublinux/functions
. /usr/lib/ublinux/os-config
debug_mode "$0" "$@"
[ "$SETCLKATSTART" = "no" ] && exit 0
SOURCE=${SYSCONF}/clock; [ -f ${SOURCE} ] && . ${SOURCE} 2>/dev/null
HWCLOCKOPIONS="--utc"
[ "$UTC" = "false" ] && HWCLOCKOPIONS="--localtime"
hwclock -s $HWCLOCKOPIONS

@ -0,0 +1,14 @@
#!/bin/bash
ENABLED=yes
[ "$ENABLED" != "yes" ] && exit 0
DEBUGMODE=no
. /usr/lib/ublinux/functions
. /usr/lib/ublinux/os-config
debug_mode "$0" "$@"
[ "$MODPROBEPRELOAD" = "no" ] && exit 0
cat /etc/modprobe.preload | sed s/'#.*'// | sed /^$/d | while read a ;do
modprobe $a
done

@ -0,0 +1,34 @@
#!/bin/bash
ENABLED=yes
[ "$ENABLED" != "yes" ] && exit 0
DEBUGMODE=no
#SMBOPTSDEF="vers=3,nolock,users,noauto"
# Everybody will have full read/write access
# OPTSDEF="noperm"
OPTSDEF=""
. /usr/lib/ublinux/functions
. /usr/lib/ublinux/os-config
debug_mode "$0" "$@"
SOURCE=${SYSCONF}/config; [ -f ${SOURCE} ] && . ${SOURCE} 2>/dev/null
if [[ -n "${AUTOMOUNT_SHARE[@]}" ]]; then
for SHARE in "${!AUTOMOUNT_SHARE[@]}"; do
if [[ "$(cut -d: -f1 <<< ${AUTOMOUNT_SHARE[${SHARE}]})" == "direct" ]]; then
PATH_MOUNT_FROM="$(cut -d: -f2 <<< ${AUTOMOUNT_SHARE[${SHARE}]})"
[[ -d ${SHARE} ]] && umount -qRlf "${SHARE}" || mkdir -p "${SHARE}"
GROUP="$(cut -d: -f3 <<< ${AUTOMOUNT_SHARE[${SHARE}]})"
[[ -n ${GROUP} ]] && chown -f root:${GROUP} ${SHARE}
MOD="$(cut -d: -f4 <<< ${AUTOMOUNT_SHARE[${SHARE}]})"
[[ -n ${MOD} ]] && chmod -f ${MOD} "${SHARE}"
OPTS="$(cut -d: -f5 <<< ${AUTOMOUNT_SHARE[${SHARE}]})"
[[ -z ${OPTS} ]] && OPTS="${OPTSDEF}"
[[ -n ${OPTS} ]] && OPTS=" -o ${OPTS}"
mount ${PATH_MOUNT_FROM} ${SHARE} ${OPTS}
fi
done
fi

@ -0,0 +1,428 @@
#!/usr/bin/env bash
##
## ./script ${RESOLUTION} ${VERSION_CODENAME} ${STATE_MODE}
## RESOLUTION:
## 1024x768 #(4:3)
## 2048x1536 #(4:3)
## 1440x1080 #(4:3)
## 2560x2048 #(5:4)
## 1920x1080 #(16:9)
## 3840x2160 #(16:9)
## 3440x1440 #(21:9)
## 1440x900 #(16:10)
## 2560x1600 #(16:10)
## VERSION_CODENAME:
## ublinux_db
## ublinux_de
## ublinux_edu
## ublinux_srv
## ublinux_exp
## ublinux_de_adara
## ublinux_srv_adara
## ublinux_de_sibsutis
## ublinux_edu_sibsutis
## ublinux_srv_sibsutis
## ublinux_liveoffice
## ublinux_unknown
## STATE_MODE
## "changes" # Полное сохранение ub.mode=changes
## "toxzm" or "machines" # Сохранение в модуль ub.mode=toxzm ub.mode=machines
## "/" # Песочница с сохранением профиля пользователя ub.mode= ; ub.home=/ublinux-data/homes
## "" # Полная песочница RAM ub.mode= (clean); ub.home=
## "" # Полная песочница HDD ub.mode=clear; ub.home=
##
ENABLED=yes
[ "$ENABLED" != "yes" ] && exit 0
DEBUGMODE=no
. /usr/lib/ublinux/functions
. /usr/lib/ublinux/os-config
debug_mode "$0" "$@"
SOURCE=${SYSCONF}/config; [ -f ${SOURCE} ] && . ${SOURCE} 2>/dev/null
SOURCE=${SYSCONF}/desktop; [ -f ${SOURCE} ] && . ${SOURCE} 2>/dev/null
SOURCE=${SYSCONF}/video; [ -f ${SOURCE} ] && . ${SOURCE} 2>/dev/null
[[ ${DISPLAYMANAGER} == "none" ]] && exit
ROOTDIR= #`pwd`
[[ -n $1 ]] && [[ -n $2 ]] && build_manual=yes
source_img_dir=${ROOTDIR}/usr/share/ublinux/backgrounds/source #Каталог с исходниками изображений
wallpapers_tmp=${ROOTDIR}/tmp/ublinux_bg #Каталог скомпиллированных изображений
wallpapers_dst=${ROOTDIR}/usr/share/backgrounds/ublinux #Каталог скомпиллированных изображений
default_de_img=${wallpapers_dst%/*}/background.jpg
default_dm_img=${wallpapers_dst%/*}/dm.jpg
bg_desktop_basic=bg_db.png # Фон для Desktop Basic
bg_desktop_enterprise=bg_de.png # Фон для Desktop Enterprise
bg_education=bg_edu.png # Фон для Education
bg_expert=bg_exp.png # Фон для Expert
bg_server=bg_srv.png # Фон для Server
shadow_img=shadow.png # Затенение
hex_img=hex.png # Сетка из шестигранников
transparent=transparent.png # Изображение прозрачный пиксель
logo_img=logo.png # Логотип исходный
logo_desktop_basic=logo_db.png # Изображение редакции дистрибутива
logo_desktop_enterprise=logo_de.png # Изображение редакции дистрибутива
logo_education=logo_edu.png # Изображение редакции дистрибутива
logo_expert=logo_exp.png # *Deprecated* Изображение редакции дистрибутива
logo_server=logo_srv.png # Изображение редакции дистрибутива
logo_light=logo_light.png # Изображение свечения логотипа
logo_adara=logo_adara.png # Изображение редакции дистрибутива Adara
logo_sibsutis=logo_sibsutis.png # Изображение редакции дистрибутива SibSUTIS
logo_liveoffice=logo_liveoffice.png # Изображение редакции дистрибутива LiveOffice
logo_clue_img=logo_clue.png # Имя склееного логотипа с редакцией дистрибутива
img_state_bg_de=bg_icon_state_de.png # Фон для иконки режима сохранения (рабочий стол)
img_state_bg_dm=bg_icon_state_dm.png # Фон для иконки режима сохранения (гритер)
img_nosave=icon_state_ro.png # Иконка для режима "без сохранения"
img_fullsave=icon_state_rw.png # Иконка для режима "полное сохранение"
img_homesave=icon_state_uw.png # Иконка для режима "сохранение home"
img_modulesave=icon_state_mw.png # Иконка для режима "сохранение в модуль"
passwd_block_img=passwd_text.png # Изображение с текстом для FirstSart
wp_de_filename=tmp_wp_de.jpg # Имя файла обоев
wp_dm_filename=tmp_wp_dm.jpg # Имя файла фона гритера
shadow_level=175 # Степень затенения обоев рабочего стола в %, где 100 - исходная яркость, <100 - светлее, >100 - темнее
declare -A monitors
RESOLUTION=
# Функция получения всех видеовыходов с максимальными разрешениями
# В теле основном:
# declare -A monitors
# Входной параметр: имя переменной массива
# get_max_resolution "monitors"
# Выходной параметр: заполненный массив, вида
# card0-HDMI-A-1:1920x2000
# card0-DP-1:1920x1080
# card0-VGA-1:1280x720
# RESOLUTION:1920x2000
get_max_resolution() {
local max_mode # Максимальное разрешение из всех мониторов
# Метод определения разрешения №1, подходит для свободных драйверов KMS
# Без драйверов по VGA не находит разрешение
if ls /sys/class/drm/*/status &>/dev/null; then
for video_output in /sys/class/drm/*/status; do
if [[ $(cat ${video_output}) == "connected" ]]; then
video_name="${video_output%/*}"; video_name="${video_name##*/}"
video_modes="${video_output%/*}/modes"
[[ -f ${video_modes} ]] || break
max_mode="0"
while read line_mode; do
pixel_line_mode=$(echo ${line_mode} | tr -d "i" | tr x "*" | bc)
[[ "${line_mode}" == "1440x900" ]] && pixel_line_mode=$( echo ${pixel_line_mode} + 14721 | bc) # fix 1440x900 > 1280x1024
pixel_max_mode=$(echo ${max_mode} | tr -d "i" | tr x "*" | bc)
[[ ${pixel_line_mode} -gt ${pixel_max_mode} ]] && max_mode=$(echo ${line_mode} | tr -d "i")
pixel_max_mode_all=$(echo ${RESOLUTION} | tr -d "i" | tr x "*" | bc)
[[ ${pixel_line_mode} -gt ${pixel_max_mode_all} ]] && RESOLUTION=$(echo ${line_mode} | tr -d "i")
done < ${video_modes}
monitors[${video_name}]=${max_mode}
fi
done
fi
# Метод определения разрешения №2
# из конфига /etc/ublinux/video по статическим заданным разрешениям
[[ -n "${XORG_MONITOR[@]}" ]] && declare -n MONITOR=XORG_MONITOR
[[ -n "${XRANDR_MONITOR[@]}" ]] && declare -n MONITOR=XRANDR_MONITOR
if [[ -n "${MONITOR[@]}" ]]; then
for VIDEO_PORT in "${!MONITOR[@]}"; do
while read VIDEO_PORT_PARAM; do
if egrep -iq "^[0-9]*x[0-9]*$|^[0-9]*x[0-9]*x[0-9]*$" <<< "${VIDEO_PORT_PARAM}"; then
RESOLUTION="$(sed 's/\([0-9]*\*[0-9]*\) .*/\1/' <<< ${VIDEO_PORT_PARAM//x/*})"
# fix 1440x900 > 1280x1024
[[ "${RESOLUTION}" == "1440*900" ]] && pixel_line_mode=$(bc <<< "${RESOLUTION}+14721") || pixel_line_mode=$(bc <<< ${RESOLUTION})
[[ ${pixel_line_mode} -gt ${pixel_max_mode} ]] && pixel_max_mode=${pixel_line_mode} && RESOLUTION_MAX=${RESOLUTION}
fi
done < <(tr ',' '\n' <<< "${MONITOR[${VIDEO_PORT}]}")
done
RESOLUTION=${RESOLUTION_MAX//\*/x}
fi
# Метод определения разрешения №99, при условии запущенного lightdm
local PATH_XAUTHORITY="/var/lib/lightdm/.Xauthority"
[[ -z ${RESOLUTION} && -f ${PATH_XAUTHORITY} && -n $(ls /tmp/.X11-unix/X* 2>/dev/null) ]] && \
RESOLUTION=$(XAUTHORITY=${PATH_XAUTHORITY} xrandr -d $(ls /tmp/.X11-unix | tr 'X' ':' | head -n 1) 2>/dev/null | grep "*" | xargs | cut -d" " -f1)
# $(xrandr -d :0 --current | sed -n 's/.* connected \([0-9]*\)x\([0-9]*\)+.*/\1x\2/p')
# Если не обнаружено ни одно разрешение, то статическое
[[ -z ${RESOLUTION} ]] && RESOLUTION=${WALLPAPERSRES}
[[ -z ${RESOLUTION} ]] && RESOLUTION="1920x1080"
}
build_logo_ublinux_all(){
# Склейка логотипа UBLinux со свечением
[[ -n ${logo_light} ]] && convert $source_img_dir/$logo_light $source_img_dir/$logo_img -gravity center -background none +smush -710 $wallpapers_tmp/tmp_$logo_clue_img \
|| cp $source_img_dir/$logo_img $wallpapers_tmp/tmp_$logo_clue_img
# Конвеер вставки логотипа редакции ОС
[[ -n ${edition_img} ]] && composite -geometry $geometry_edition_wp -gravity east $source_img_dir/$edition_img $wallpapers_tmp/tmp_$logo_clue_img $wallpapers_tmp/tmp_$logo_clue_img
# Конвеер вставки логотипа суббренда
if [ ${geometry_adara_wp} ]; then
img_logo_width=$(identify $wallpapers_tmp/tmp_$logo_clue_img | cut -d" " -f3 | cut -d"x" -f1)
img_adara_width=$(identify $source_img_dir/$logo_adara | cut -d" " -f3 | cut -d"x" -f1)
let img_logo_width=($img_logo_width+$img_adara_width)
convert $wallpapers_tmp/tmp_$logo_clue_img -gravity west -background none -extent $img_logo_width'x' $wallpapers_tmp/tmp_$logo_clue_img
composite -geometry $geometry_adara_wp -gravity east $source_img_dir/$logo_adara $wallpapers_tmp/tmp_$logo_clue_img $wallpapers_tmp/tmp_$logo_clue_img
elif [ ${geometry_sibsutis_wp} ]; then
img_logo_width=$(identify $wallpapers_tmp/tmp_$logo_clue_img | cut -d" " -f3 | cut -d"x" -f1)
convert $wallpapers_tmp/tmp_$logo_clue_img -gravity west -background none -extent $img_logo_width'x' $wallpapers_tmp/tmp_$logo_clue_img
composite -geometry $geometry_sibsutis_wp -gravity north $source_img_dir/$logo_sibsutis $wallpapers_tmp/tmp_$logo_clue_img $wallpapers_tmp/tmp_$logo_clue_img
fi
}
build_background_all(){
# Наложение градиентного затемнения DE
convert -composite $background $source_img_dir/$shadow_img $wallpapers_tmp/$wp_de_filename
# Наложение градиентного затемнения DM
cp $wallpapers_tmp/$wp_de_filename $wallpapers_tmp/$wp_dm_filename
}
build_background_de(){
# Наложение сетки шестигранников DE
convert -composite $wallpapers_tmp/$wp_de_filename $source_img_dir/$hex_img $wallpapers_tmp/$wp_de_filename
# Конвеер вставки объединенного логотипа на фон DE
composite -geometry $geometry_logo_wp -gravity west $wallpapers_tmp/tmp_$logo_clue_img $wallpapers_tmp/$wp_de_filename $wallpapers_tmp/$wp_de_filename
# Затенения обоев рабочего стола
convert $wallpapers_tmp/$wp_de_filename -level 0,$shadow_level% $wallpapers_tmp/$wp_de_filename
}
build_background_dm(){
# Вычисление коэффициента скейлинга
img_hight=$(identify $background | cut -d" " -f3 | cut -d"x" -f2)
ratio_scale=$(echo "scale=2;$img_hight/$hight" | bc)
# echo RS=$ratio_scale
tmp_logo_clue_hight=$(identify $wallpapers_tmp/tmp_$logo_clue_img | cut -d" " -f3 | cut -d"x" -f2)
nsize_logo_clue_hight=$(echo "scale=0;$tmp_logo_clue_hight/$ratio_scale" | bc)
# echo RSCF Logo=$nsize_logo_clue_hight
convert $wallpapers_tmp/tmp_$logo_clue_img -resize x$nsize_logo_clue_hight $wallpapers_tmp/tmp_dm_$logo_clue_img
convert $wallpapers_tmp/tmp_dm_$logo_clue_img -resize 35% $wallpapers_tmp/tmp_dm_$logo_clue_img
x_shift=$(echo "scale=0;150/$ratio_scale" | bc)
y_shift=$(echo "scale=0;170/$ratio_scale" | bc)
# echo "LOGO $x_shift on $y_shift px"
# Конвеер вставки объединенного уменьшенного логотипа на фон DM
composite -geometry +$x_shift+$y_shift $wallpapers_tmp/tmp_dm_$logo_clue_img $wallpapers_tmp/$wp_dm_filename $wallpapers_tmp/$wp_dm_filename
}
insert_background_dm_txtpass(){
# Вычисление коэффициента скейлинга
img_hight=$(identify $background | cut -d" " -f3 | cut -d"x" -f2)
ratio_scale=$(echo "scale=2;$img_hight/$hight" | bc)
tmp_passwd_text_hight=$(identify $source_img_dir/$passwd_block_img | cut -d" " -f3 | cut -d"x" -f2)
nsize_passwd_text_hight=$(echo "scale=0;$tmp_passwd_text_hight/$ratio_scale" | bc)
x_shift_text=$(echo "scale=0;0/$ratio_scale" | bc)
y_shift_text=$(echo "scale=0;370/$ratio_scale" | bc)
# echo "TXT $x_shift_text on $y_shift_text px"
# echo RSCF first=$nsize_passwd_text_hight
convert $source_img_dir/$passwd_block_img -resize x$nsize_passwd_text_hight -colorspace RGB $wallpapers_tmp/tmp_$passwd_block_img
composite -geometry +$x_shift_text+$y_shift_text -gravity NorthEast $wallpapers_tmp/tmp_$passwd_block_img $default_dm_img $default_dm_img
}
# $1 Файл иконки для вставки
insert_background_icon(){
# Вычисление коэффициента скейлинга
img_hight=$(identify $background | cut -d" " -f3 | cut -d"x" -f2)
ratio_scale=$(echo "scale=2;$img_hight/$hight" | bc)
# DM
# bg icon
tmp_state_icon_bg_hight=$(identify $source_img_dir/$img_state_bg_dm | cut -d" " -f3 | cut -d"x" -f2)
nsize_state_icon_bg_hight=$(echo "scale=0;$tmp_state_icon_bg_hight/$ratio_scale" | bc)
x_shift_img_bg=$(echo "scale=0;-160/$ratio_scale" | bc)
y_shift_img_bg=$(echo "scale=0;170/$ratio_scale" | bc)
convert $source_img_dir/$img_state_bg_dm -resize x$nsize_state_icon_bg_hight -colorspace RGB $wallpapers_tmp/tmp_$img_state_bg_dm
composite -geometry +$x_shift_img_bg+$y_shift_img_bg -gravity NorthEast $wallpapers_tmp/tmp_$img_state_bg_dm $default_dm_img $default_dm_img
# icon
tmp_state_icon_hight=$(identify $source_img_dir/$1 | cut -d" " -f3 | cut -d"x" -f2)
nsize_state_icon_hight=$(echo "scale=0;$tmp_state_icon_hight/($ratio_scale*1.5)" | bc)
x_shift_img=$(echo "scale=0;120/$ratio_scale" | bc)
y_shift_img=$(echo "scale=0;168/$ratio_scale" | bc)
convert $source_img_dir/$1 -resize x$nsize_state_icon_hight -colorspace sRGB $wallpapers_tmp/tmp_state.png
composite -geometry +$x_shift_img+$y_shift_img -gravity NorthEast $wallpapers_tmp/tmp_state.png $default_dm_img $default_dm_img
# DE
# bg icon
tmp_state_icon_bg_hight=$(identify $source_img_dir/$img_state_bg_de | cut -d" " -f3 | cut -d"x" -f2)
nsize_state_icon_bg_hight=$(echo "scale=0;$tmp_state_icon_bg_hight/$ratio_scale" | bc)
x_shift_img_bg=$(echo "scale=0;1785/$ratio_scale" | bc)
y_shift_img_bg=$(echo "scale=0;0/$ratio_scale" | bc)
convert $source_img_dir/$img_state_bg_de -resize x$nsize_state_icon_bg_hight -colorspace RGB $wallpapers_tmp/tmp_$img_state_bg_de
composite -geometry +$x_shift_img_bg+$y_shift_img_bg -gravity NorthWest $wallpapers_tmp/tmp_$img_state_bg_de $default_de_img $default_de_img
# icon
tmp_state_icon_hight=$(identify $source_img_dir/$1 | cut -d" " -f3 | cut -d"x" -f2)
nsize_state_icon_hight=$(echo "scale=0;$tmp_state_icon_hight/($ratio_scale*1.5)" | bc)
x_shift_img=$(echo "scale=0;1940/$ratio_scale" | bc)
y_shift_img=$(echo "scale=0;50/$ratio_scale" | bc)
convert $source_img_dir/$1 -resize x$nsize_state_icon_hight -colorspace sRGB $wallpapers_tmp/tmp_state.png
composite -geometry +$x_shift_img+$y_shift_img -gravity NorthWest $wallpapers_tmp/tmp_state.png $default_de_img $default_de_img
}
# Test get resolution || Проверить массив мониторов с разрешениями
# get_max_resolution "array_monitor_modes"
# for key in "${!monitors[@]}"; do
# echo "${key}:${monitors[${key}]}"
# done
# echo "${RESOLUTION}"
mkdir -p ${wallpapers_tmp}
# [[ -L ${wallpapers_dst} ]] || mkdir -p ${wallpapers_dst}
if [[ ! -e ${wallpapers_dst} ]]; then
mkdir -p $(readlink ${wallpapers_dst}) || mkdir -p ${wallpapers_dst}
fi
grep -q xres= /proc/cmdline && RESOLUTION=$(cat /proc/cmdline | awk -F xres= '{print $2}' | awk '{print $1}')
# xres=$(cmdline_value desktop) && [[ ! -z ${xres} ]] && RESOLUTION=${xres}
# Определение разрешения экрана
[[ -z $1 ]] || RESOLUTION=$1
[[ -z "${RESOLUTION}" ]] && get_max_resolution
[[ -z "${RESOLUTION}" ]] && echo "ERROR: resolution not detect" && exit 1
# Определение редакции ОС
[[ -z $2 ]] && edition_os=$(cat /etc/os-release | grep VERSION_CODENAME | cut -d"=" -f2 2>/dev/null) || edition_os=$2
width=${RESOLUTION%x*}
hight=${RESOLUTION#*x}
#echo "${width} on ${hight}"
# Вычисление соотношения сторон экрана
ratio=$(bc <<< "scale=2;${width:=1024}/${hight:=768}")
if [ $(bc -l <<< "$ratio==1.33") -eq 1 ]; then
fname_ratio="4:3"
elif [ $(bc -l <<< "$ratio==1.25") -eq 1 ]; then
fname_ratio="5:4"
elif [ $(bc -l <<< "$ratio==1.77") -eq 1 ]; then
fname_ratio="16:9"
elif [ $(bc -l <<< "$ratio==1.6") -eq 1 ]; then
fname_ratio="16:10"
elif [ $(bc -l <<< "$ratio==2.38") -eq 1 ]; then
fname_ratio="21:9"
else
exit 0
fi
#echo "==> ${width}x${hight} :: $ratio :: $fname_ratio" && exit 1
# Установка значений переменных для графических ресурсов, исходя из типа редакции ОС
geometry_logo_wp=+69-52
case "$edition_os" in
ublinux_db)
background=$source_img_dir/$bg_desktop_basic
edition_img=$logo_desktop_basic
geometry_edition_wp=+86+256
;;
ublinux_de)
background=$source_img_dir/$bg_desktop_enterprise
edition_img=$logo_desktop_enterprise
geometry_edition_wp=+86+256
;;
ublinux_edu)
background=$source_img_dir/$bg_education
edition_img=$logo_education
geometry_edition_wp=+70+256
;;
ublinux_srv)
background=$source_img_dir/$bg_server
edition_img=$logo_server
geometry_edition_wp=+86+256
;;
ublinux_exp)
background=$source_img_dir/$bg_exp
edition_img=$logo_expert
geometry_edition_wp=+72+256
;;
ublinux_de_adara)
background=$source_img_dir/$bg_desktop_enterprise
edition_img=$logo_desktop_enterprise
geometry_edition_wp=+86+256
geometry_adara_wp=+130+42
;;
ublinux_srv_adara)
background=$source_img_dir/$bg_server
edition_img=$logo_server
geometry_edition_wp=+86+256
geometry_adara_wp=+130+42
;;
ublinux_de_sibsutis)
background=$source_img_dir/$bg_desktop_enterprise
edition_img=$logo_desktop_enterprise
geometry_edition_wp=+86+256
geometry_sibsutis_wp=+470+166
;;
ublinux_edu_sibsutis)
background=$source_img_dir/$bg_education
edition_img=$logo_education
geometry_edition_wp=+70+256
geometry_sibsutis_wp=+470+166
;;
ublinux_srv_sibsutis)
background=$source_img_dir/$bg_server
edition_img=$logo_server
geometry_edition_wp=+86+256
geometry_sibsutis_wp=+470+166
;;
ublinux_liveoffice)
background=$source_img_dir/$bg_desktop_enterprise
logo_img=$logo_liveoffice
geometry_logo_wp=+260-130
unset logo_light
;;
ublinux_unknown | *)
background=$source_img_dir/$bg_desktop_basic
edition_img=$logo_desktop_basic
geometry_edition_wp=+86+256
;;
esac
CHECK_BOOT_FILE=$(find $wallpapers_dst/ -name "${edition_os}_boot_${fname_ratio}_${RESOLUTION}.jpg" | wc -l)
CHECK_BACKGROUND_FILE=$(find $wallpapers_dst/ -name "${edition_os}_background_${fname_ratio}_${RESOLUTION}.jpg" | wc -l)
if [[ ${CHECK_BOOT_FILE} -eq 0 ]] || [[ ${CHECK_BACKGROUND_FILE} -eq 0 ]]; then
[[ ! -x /usr/bin/composite ]] && [[ ! -x /usr/bin/convert ]] && echo "Error: not fount /usr/bin/composite or /usr/bin/convert" && exit 0
build_logo_ublinux_all
build_background_all
build_background_de
# Изменение разрешения фонов DM DE
case ${fname_ratio} in
"4:3" | "5:4" | "16:10" ) # Изменить размер по высоте (hight)
for filename in $wp_de_filename $wp_dm_filename; do
convert -resize x$hight $wallpapers_tmp/${filename} $wallpapers_tmp/${filename}
convert -crop $width\x+0+0 $wallpapers_tmp/${filename} $wallpapers_tmp/${filename}
done
;;
"21:9") # Изменить размер по ширине (width)
for filename in $wp_de_filename $wp_dm_filename; do
convert -resize $width $wallpapers_tmp/${filename} $wallpapers_tmp/${filename}
out_img_hight=$(identify $wallpapers_tmp/${filename} | cut -d" " -f3 | cut -d"x" -f2)
let crop_top=($out_img_hight-$hight)/2
convert -crop x$hight+0+$crop_top $wallpapers_tmp/${filename} $wallpapers_tmp/${filename}
done
;;
"16:9") # Изменить размер пропорционально
for filename in $wp_de_filename $wp_dm_filename; do
convert -resize x$hight $wallpapers_tmp/${filename} $wallpapers_tmp/${filename}
done
;;
esac
build_background_dm
[[ -z ${build_manual} ]] && mv $wallpapers_tmp/$wp_de_filename $wallpapers_dst/${edition_os}_background_${fname_ratio}_${RESOLUTION}.jpg || mv $wallpapers_tmp/$wp_de_filename $wallpapers_tmp/${edition_os}_background_${fname_ratio}_${RESOLUTION}.jpg
[[ ${build_manual} ]] && mogrify -format png -write $wallpapers_tmp/${edition_os}_boot_${fname_ratio}_${RESOLUTION}.png $wallpapers_tmp/$wp_dm_filename
[[ -z ${build_manual} ]] && mv $wallpapers_tmp/$wp_dm_filename $wallpapers_dst/${edition_os}_boot_${fname_ratio}_${RESOLUTION}.jpg || mv $wallpapers_tmp/$wp_dm_filename $wallpapers_tmp/${edition_os}_boot_${fname_ratio}_${RESOLUTION}.jpg
fi
[[ -z ${build_manual} ]] && cp -pf $wallpapers_dst/${edition_os}_background_${fname_ratio}_${RESOLUTION}.jpg $default_de_img
[[ -z ${build_manual} ]] && cp -pf $wallpapers_dst/${edition_os}_boot_${fname_ratio}_${RESOLUTION}.jpg $default_dm_img
# Если пароли по умолчанию ublinux, то вывести подсказку пароля
[[ -z ${build_manual} ]] && grep -q "^root:$DEFAULTROOTPASSWD:" /etc/shadow && grep -q "^$(getent passwd "${ADMUID}" | cut -d: -f1):$DEFAULTPASSWD:" /etc/shadow && insert_background_dm_txtpass
if [[ -z ${build_manual} ]] && [[ "$GRAFFITI" != "no" ]]; then
[[ -z $3 ]] && state_mode="$(cmdline_value ub.mode)" || state_mode=$3
[[ -z $3 ]] && state_home="$(cmdline_value ub.home)" || state_home=$3
# Полное сохранение ub.mode=changes
if [[ $state_mode =~ ^"changes"$ ]]; then
insert_background_icon $img_fullsave
# Сохранение в модуль ub.mode=toxzm ub.mode=machines
elif [[ $state_mode =~ ^("toxzm"|"machines")$ ]]; then
insert_background_icon $img_modulesave
# Песочница с сохранением профиля пользователя ub.mode= ; ub.home=/ublinux-data/homes
elif [[ $state_home =~ ^"/" ]]; then
insert_background_icon $img_homesave
# Полная песочница RAM ub.mode= (clean); ub.home=
# Полная песочница HDD ub.mode=clear; ub.home=
else
insert_background_icon $img_nosave
fi
fi
[[ -n ${build_manual} ]] || rm -rdf $wallpapers_tmp

@ -0,0 +1,132 @@
#!/usr/bin/env bash
ENABLED=yes
[ "$ENABLED" != "yes" ] && exit 0
DEBUGMODE=no
. /usr/lib/ublinux/functions
. /usr/lib/ublinux/os-config
debug_mode "$0" "$@"
#. $HARDCONF
#echo "$XDRIVER" | grep -q "nvidia" || rmmod nvidia
#STEAMNODPMS=yes
SOURCE=${SYSCONF}/config; [ -f ${SOURCE} ] && . ${SOURCE} 2>/dev/null
SOURCE=${SYSCONF}/video; [ -f ${SOURCE} ] && . ${SOURCE} 2>/dev/null
SOURCE=${SYSCONF}/desktop; [ -f ${SOURCE} ] && . ${SOURCE} 2>/dev/null
SOURCE=${SYSCONF}/keyboard; [ -f ${SOURCE} ] && . ${SOURCE} 2>/dev/null
[[ ${DISPLAYMANAGER} == "none" ]] && exit
# Auto VGA driver loader
if [[ -n ${VGADRV_AUTO} ]]; then
while read LSPCI_DEVICE; do
while read KERNEL_MODULE; do
[[ ${KERNEL_MODULE} != "nouveau" ]] && modprobe ${KERNEL_MODULE} 2>/dev/null && break
done < <(lspci -ks ${LSPCI_DEVICE%% *} | grep 'Kernel modules:' | cut -d: -f2 | tr ',' '\n' | tac)
done < <(lspci | egrep -i 'vga|3d')
if lsmod | grep nvidia &>/dev/null; then
#[[ -f /usr/bin/nvidia-xconfig ]] && nvidia-xconfig -s --no-logo --no-composite --no-dynamic-twinview --force-generate --output-xconfig=/etc/X11/xorg.conf
[[ -e /etc/X11/xorg.conf.d/20-nvidia-ubconfig.conf ]] || ln -sf /usr/lib/ublinux/xorg.conf.d/20-nvidia-ubconfig.conf /etc/X11/xorg.conf.d/
#[[ -e /etc/udev/rules.d/70-nvidia-ubconfig.rules ]] || ln -sf /usr/lib/ublinux/udev/70-nvidia-ubconfig.rules /etc/udev/rules.d/
/usr/bin/nvidia-modprobe -c0 -umsl
modprobe nvidia_drm
modprobe nvidia_uvm
modprobe nvidia_modeset
#modprobe drm_kms_helper
#modprobe drm
#echo -e nvidia_drm\\nvidia_uvm\\nnvidia_modeset > usr/lib/modules-load.d/nvidia-dkms.conf
fi
else
rm -f /etc/X11/xorg.conf.d/20-nvidia-ubconfig.conf
rm -f /etc/udev/rules.d/70-nvidia-ubconfig.rules
fi
#[ ! -z "$VGAID" ] && grep -q $VGAID /usr/share/ublinux/hwdata/deleteconf && rm -f /etc/X11/xorg.conf
[[ -n "${DELETE_XORG_CONF}" ]] && rm -f /etc/X11/xorg.conf
## Parametrs:
## cvt | gtf | reduced|r | dpms | nodpms | enable | disable | ignore | primary |
## lo|LeftOf:{name} | ro|RightOf:{name} | ab|Above:{name} | be|Below:{name} |
## rotate:normal | rotate:left | rotate:right | rotate:invert
grep -q xres= /proc/cmdline && XORG_MONITOR=$(cat /proc/cmdline | awk -F xres= '{print $2}' | awk '{print $1}')
if [[ "${SETXORGRES}" != "no" ]] && [[ -n "${XORG_MONITOR[@]}" ]]; then
XORG_FILE_MONITOR="/etc/X11/xorg.conf.d/10-monitor.conf"
for VIDEO_PORT in "${!XORG_MONITOR[@]}"; do
SOFT_MODELINE="gtf"
SOFT_MODELINE_R=
PREFERRED_MODE=
XORG_STR_MONITOR=
while read VIDEO_PORT_PARAM; do
if egrep -iq "^[0-9]*x[0-9]*$|^[0-9]*x[0-9]*x[0-9]*$" <<< "${VIDEO_PORT_PARAM}"; then
if [[ -n ${SOFT_MODELINE_R} ]]; then
XORG_STR_MONITOR+="$(cvt -r $(sed 's/\([0-9]* [0-9]*\) .*/\1/' <<< ${VIDEO_PORT_PARAM//x/ }))\n"
SOFT_MODELINE_R=
elif [[ ${SOFT_MODELINE} == "cvt" ]]; then
XORG_STR_MONITOR+="$(cvt ${VIDEO_PORT_PARAM//x/ })\n"
else
if egrep -iq "^[0-9]*x[0-9]*$" <<< "${VIDEO_PORT_PARAM}"; then
XORG_STR_MONITOR+="$(gtf ${VIDEO_PORT_PARAM//x/ } 60 | grep -v '^\s*$')\n"
else
XORG_STR_MONITOR+="$(gtf ${VIDEO_PORT_PARAM//x/ } | grep -v '^\s*$')\n"
fi
fi
elif egrep -iq "^cvt$" <<< "${VIDEO_PORT_PARAM}"; then
SOFT_MODELINE="cvt"
elif egrep -iq "^gtf$" <<< "${VIDEO_PORT_PARAM}"; then
SOFT_MODELINE="gtf"
elif egrep -iq "^reduced|r$" <<< "${VIDEO_PORT_PARAM}"; then
SOFT_MODELINE_R="reduced"
elif egrep -iq "^nodpms$" <<< "${VIDEO_PORT_PARAM}"; then
XORG_STR_MONITOR+=' Option "DPMS" "false"\n'
elif egrep -iq "^dpms$" <<< "${VIDEO_PORT_PARAM}"; then
XORG_STR_MONITOR+=' Option "DPMS" "true"\n'
elif egrep -iq "^enable$" <<< "${VIDEO_PORT_PARAM}"; then
XORG_STR_MONITOR+=' Option "Enable" "true"\n'
elif egrep -iq "^disable$" <<< "${VIDEO_PORT_PARAM}"; then
XORG_STR_MONITOR+=' Option "Enable" "false"\n'
elif egrep -iq "^ignore$" <<< "${VIDEO_PORT_PARAM}"; then
XORG_STR_MONITOR+=' Option "Ignore" "true"\n'
elif egrep -iq "^primary$" <<< "${VIDEO_PORT_PARAM}"; then
XORG_STR_MONITOR+=' Option "Primary" "true"\n'
elif egrep -iq "^lo:[A-z0-9]*$|^LeftOf:[A-z0-9]*$" <<< "${VIDEO_PORT_PARAM}"; then
XORG_STR_MONITOR+=" Option \"LeftOf\" \"$(cut -d: -f2 <<< ${VIDEO_PORT_PARAM^^})\"\n"
elif egrep -iq "^ro:[A-z0-9]*$|^RightOf:[A-z0-9]*$" <<< "${VIDEO_PORT_PARAM}"; then
XORG_STR_MONITOR+=" Option \"RightOf\" \"$(cut -d: -f2 <<< ${VIDEO_PORT_PARAM^^})\"\n"
elif egrep -iq "^ab:[A-z0-9]*$|^Above:[A-z0-9]*$" <<< "${VIDEO_PORT_PARAM}"; then
XORG_STR_MONITOR+=" Option \"Above\" \"$(cut -d: -f2 <<< ${VIDEO_PORT_PARAM^^})\"\n"
elif egrep -iq "^be:[A-z0-9]*$|^Below:[A-z0-9]*$" <<< "${VIDEO_PORT_PARAM}"; then
XORG_STR_MONITOR+=" Option \"Below\" \"$(cut -d: -f2 <<< ${VIDEO_PORT_PARAM^^})\"\n"
elif egrep -iq "^Rotate:[A-z]*$" <<< "${VIDEO_PORT_PARAM}"; then
XORG_STR_MONITOR+=" Option \"Rotate\" \"$(cut -d: -f2 <<< ${VIDEO_PORT_PARAM^^})\"\n"
fi
[[ -z ${PREFERRED_MODE} ]] && PREFERRED_MODE=$(grep Modeline <<< "${XORG_STR_MONITOR}" | cut -d'"' -f2)
done < <(tr ',' '\n' <<< "${XORG_MONITOR[${VIDEO_PORT}]}")
if [[ -n ${XORG_STR_MONITOR} && ${VIDEO_PORT} != 0 ]]; then
XORG_STR+='Section "Monitor"\n'
XORG_STR+=" Identifier \"${VIDEO_PORT^^}\"\n"
XORG_STR+="${XORG_STR_MONITOR}"
[[ -n ${PREFERRED_MODE} ]] && XORG_STR+=" Option \"PreferredMode\" \"${PREFERRED_MODE}\"\n"
XORG_STR+='EndSection\n\n'
fi
done
[[ -n ${XORG_STR} ]] && echo -e "${XORG_STR}" > "${XORG_FILE_MONITOR}"
fi
if [ "$MKKBDFXORG" != "no" ] ;then
if ! grep -sqi XkbOptions /etc/X11/xorg.conf; then
cat > /etc/X11/xorg.conf.d/00-keyboard.conf <<EOF
Section "InputClass"
Identifier "system-keyboard"
MatchIsKeyboard "on"
Option "XkbLayout" "$XkbLayout"
Option "XkbModel" "$XkbModel"
Option "XkbVariant" "$KEYBOARD"
Option "XkbOptions" "$XkbOptions"
EndSection
EOF
fi
fi

@ -0,0 +1,37 @@
#!/usr/bin/env bash
ENABLED=yes
[ "$ENABLED" != "yes" ] && exit 0
DEBUGMODE=no
. /usr/lib/ublinux/functions
. /usr/lib/ublinux/os-config
debug_mode "$0" "$@"
SOURCE=${SYSCONF}/config; [ -f ${SOURCE} ] && . ${SOURCE} 2>/dev/null
SOURCE=${SYSCONF}/kiosk; [ -f ${SOURCE} ] && . ${SOURCE} 2>/dev/null
rm -f /etc/polkit-1/rules.d/kiosk-*
if [[ -n ${POLKIT[@]} ]]; then
for RULES in "${!POLKIT[@]}"; do
RULES_GROUP=
RULES_FILE="/etc/polkit-1/rules.d/kiosk-$(sed 's/\([A-z0-9]*.[A-z0-9]*.[A-z0-9]*\)\..*/\1/' <<< ${RULES}).rules"
RULES_RESULT=$(cut -d: -f1 <<< ${POLKIT[${RULES}]})
for GROUP in $(cut -d: -f2 <<< ${POLKIT[${RULES}]} | tr ',' '\n'); do
RULES_GROUP+="&& subject.isInGroup(\"${GROUP}\") "
done
cat >> ${RULES_FILE} <<EOF
polkit.addRule(function(action, subject) {
if (action.id.indexOf("${RULES}") == 0
&& subject.active == true
&& subject.local == true
${RULES_GROUP}
)
{
return polkit.Result.${RULES_RESULT^^};
}
});
EOF
done
fi

@ -0,0 +1,22 @@
#!/bin/bash
ENABLED=no
[ "$ENABLED" != "yes" ] && exit 0
DEBUGMODE=no
. /usr/lib/ublinux/functions
debug_mode "$0" "$@"
# free some space if pxe server are not using
if [ -d /mnt/livemedia/ublinux ] ;then
rm -f /boot/vmlinuz /boot/ublinux /boot/addon
if LC_ALL=C chkconfig --list tftp 2>/dev/null | grep -q off ;then
ln -sf /mnt/livemedia/ublinux/vmlinuz /boot
ln -sf /mnt/livemedia/ublinux/ublinux /boot
ln -sf /mnt/livemedia/ublinux/addon /boot
else
cp -pf /mnt/livemedia/ublinux/vmlinuz /boot
cp -pf /mnt/livemedia/ublinux/ublinux /boot
cp -pf /mnt/livemedia/ublinux/addon /boot
fi
fi

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save