Como o Linux e os programas de Software Livre tem código-aberto, gostaria de saber, como vocês modificam seu sistema e/ou programas para rodarem de forma otimizada ou personalizada de acordo com o gosto de cada um.
Exemplo: Pegar o código do Linux, modificar ele e fazer a distro X, ser de tal modo. Ou baixar o GIMP, alterar o código e programar, adicionar funções que antes não existiam.
- o Linux e os programas do Projeto GNU, que juntos formam um SO completo cujo nome correto é GNU/Linux, são distribuídos compilados (binários) e em código-fonte (linguagem de programação);
- qualquer um (*) pode baixar o código-fonte e alterá-lo para excluir ou incluir funções, estando obrigado a redistribuir o código-fonte alterado;
- cada acréscimo no código-fonte implica, ao menos em tese, em desenvolvimento desse mesmo código-fonte, para benefício de todos que o utilizam compilado.
É um "esquema" muito interessante de desenvolver software, que pode ser totalmente ou parcialmente aberto, ou seja, nas formas descritas no livro a "A Catedral e o Bazar", de Eric Steven Raymond (ESR), autor da famosa frase:
"Havendo olhos suficientes, todos os erros são óbvios (Given enough eyeballs, all bugs are shallow)."
A frase supra viria a se transformar na "Lei de Linus", em alusão ao modo como Linus Torvalds desenvolveu o Kernel Linux.
Seu significado principal, não tão evidente na tradução, está ligado ao fato de a progressão no número de desenvolvedores, obtida pelo modelo Bazar de desenvolvimento (código-fonte disponível a todos, via internet), possibilita rapidez inigualável, já que serão muitos "olhos" sobre o código-fonte, procurando e resolvendo bugs.
No modelo Catedral, por sua vez, temos um grupo fechado de programadores comprometidos com determinado projeto, que pode ou não de código aberto ou livre, já que o software proprietário também segue esse modelo. Isso significa que o projeto de software será "visto" por um número limitado de "olhos" durante o processo de desenvolvimento, tornando-o mais lento.
---
(*) é óbvio que só poderá alterar o código-fonte quem tiver capacidade técnica para tanto, sendo a expressão "qualquer um" entendida como "qualquer pessoa capaz de".
3. Re: Modificando o Linux e os Programas
maketuxusa Slackware
Post recolhido
Enviado em 05/02/2013 - 02:45h
pinduvoz
Sua resposta foi excelente e muito completa, obrigado!
Mas, o que eu queria mesmo é saber dos membros do VOL, modificações que já fizeram em programas já existentes ou nas distros que cada um usa, através de "Programação"
Sejam pequenos shells scripts, modificações de software em C/C++ ou otimização do hardware em Assembly.
Já que o Software Livre nos dá essa liberdade de modificar algo já existente ou começar algo do zero.
diff --git parser/parser_yacc.y parser/parser_yacc.y
index 3e2bcd2..a6f12e5 100644
--- parser/parser_yacc.y
+++ parser/parser_yacc.y
@@ -902,6 +902,7 @@ rules: rules TOK_SET TOK_RLIMIT TOK_ID TOK_LE TOK_VALUE opt_id TOK_END_OF_RULE
pwarn(_("RLIMIT 'cpu' no units specified using default units of seconds\n"));
value = tmp;
break;
+#ifdef RLIMIT_RTTIME
case RLIMIT_RTTIME:
/* RTTIME is measured in microseconds */
if (!end || $6 == end || tmp < 0)
@@ -913,6 +914,7 @@ rules: rules TOK_SET TOK_RLIMIT TOK_ID TOK_LE TOK_VALUE opt_id TOK_END_OF_RULE
pwarn(_("RLIMIT 'rttime' no units specified using default units of microseconds\n"));
value = tmp;
break;
+#endif
case RLIMIT_NOFILE:
case RLIMIT_NPROC:
case RLIMIT_LOCKS:
--
2.11.2
diff --git a/config.h b/config.h
index 1c58d0b..0756132 100644
--- a/config.h
+++ b/config.h
@@ -13,13 +13,13 @@ static const float resize_keep_aspect_ratio= 1.03;
///---Offsets---///
/*0)offsetx 1)offsety
*2)maxwidth 3)maxheight */
-static const uint8_t offsets[] = {0,0,0,0};
+static const uint8_t offsets[] = {0,0,0,40};
///---Colors---///
/*0)focuscol 1)unfocuscol
*2)fixedcol 3)unkilcol
*4)fixedunkilcol 5)outerbordercol
*6)emptycol */
-static const char *colors[] = {"#35586c","#333333","#7a8c5c","#ff6666","#cc9933","#0d131a","#000000"};
+static const char *colors[] = {"#cef318","#333333","#7a8c5c","#ff6666","#cc9933","#0d131a","#000000"};
/* if this is set to true the inner border and outer borders colors will be swapped */
static const bool inverted_colors = true;
///---Cursor---///
@@ -39,8 +39,6 @@ static const uint8_t borders[] = {3,5,5,4};
*/
#define LOOK_INTO "WM_NAME"
static const char *ignore_names[] = {"bar", "xclock"};
-///--Menus and Programs---///
-static const char *menucmd[] = { "", NULL };
///--Custom foo---///
static void halfandcentered(const Arg *arg)
{
@@ -83,6 +81,8 @@ static key keys[] = {
// Focus to next/previous window
{ MOD , XK_Tab, focusnext, {.i=TWOBWM_FOCUS_NEXT}},
{ MOD |SHIFT, XK_Tab, focusnext, {.i=TWOBWM_FOCUS_PREVIOUS}},
+ { MOD , XK_o, focusnext, {.i=TWOBWM_FOCUS_NEXT}},
+ { MOD , XK_i, focusnext, {.i=TWOBWM_FOCUS_PREVIOUS}},
// Kill a window
{ MOD , XK_q, deletewin, {}},
// Resize a window
@@ -152,7 +152,7 @@ static key keys[] = {
{ MOD , XK_comma, changescreen, {.i=TWOBWM_NEXT_SCREEN}},
{ MOD , XK_period, changescreen, {.i=TWOBWM_PREVIOUS_SCREEN}},
// Raise or lower a window
- { MOD , XK_r, raiseorlower, {}},
+ { MOD |SHIFT , XK_r, raiseorlower, {}},
// Next/Previous workspace
{ MOD , XK_v, nextworkspace, {}},
{ MOD , XK_c, prevworkspace, {}},
@@ -177,8 +177,6 @@ static key keys[] = {
{ MOD |SHIFT, XK_Down, cursor_move, {.i=TWOBWM_CURSOR_DOWN}},
{ MOD |SHIFT, XK_Right, cursor_move, {.i=TWOBWM_CURSOR_RIGHT}},
{ MOD |SHIFT, XK_Left, cursor_move, {.i=TWOBWM_CURSOR_LEFT}},
- // Start programs
- { MOD , XK_w, start, {.com = menucmd}},
// Exit or restart 2bwm
{ MOD |CONTROL, XK_q, twobwm_exit, {.i=0}},
{ MOD |CONTROL, XK_r, twobwm_restart, {.i=0}},
@@ -190,16 +188,11 @@ static key keys[] = {
DESKTOPCHANGE( XK_4, 3)
DESKTOPCHANGE( XK_5, 4)
DESKTOPCHANGE( XK_6, 5)
- DESKTOPCHANGE( XK_7, 6)
- DESKTOPCHANGE( XK_8, 7)
- DESKTOPCHANGE( XK_9, 8)
- DESKTOPCHANGE( XK_0, 9)
};
// the last argument makes it a root window only event
static Button buttons[] = {
{ MOD ,XCB_BUTTON_INDEX_1, mousemotion, {.i=TWOBWM_MOVE}, false},
{ MOD ,XCB_BUTTON_INDEX_3, mousemotion, {.i=TWOBWM_RESIZE}, false},
- { 0 ,XCB_BUTTON_INDEX_3, start, {.com = menucmd}, true},
{ MOD|SHIFT, XCB_BUTTON_INDEX_1, changeworkspace, {.i=0}, false},
{ MOD|SHIFT, XCB_BUTTON_INDEX_3, changeworkspace, {.i=1}, false},
{ MOD|ALT, XCB_BUTTON_INDEX_1, changescreen, {.i=1}, false},
+configure_file("${CMAKE_CURRENT_SOURCE_DIR}/src/config.h.in"
+ "${CMAKE_CURRENT_SOURCE_DIR}/src/config.h")
+
# create a Config.cmake and a ConfigVersion.cmake file and install them
set(CMAKECONFIG_INSTALL_DIR "${KDE_INSTALL_CMAKEPACKAGEDIR}/KF5I18n")
diff --git a/cmake/FindLibIntl.cmake b/cmake/FindLibIntl.cmake
index cde5da8..a457112 100644
--- a/cmake/FindLibIntl.cmake
+++ b/cmake/FindLibIntl.cmake
@@ -56,3 +56,6 @@ else()
message(STATUS "libintl is a separate library.")
find_package_handle_standard_args(LibIntl REQUIRED_VARS LibIntl_INCLUDE_DIRS LibIntl_LIBRARIES)
endif()
+
+set(CMAKE_REQUIRED_LIBRARIES ${LibIntl_LIBRARIES})
+check_cxx_source_compiles("extern \"C\" int _nl_msg_cat_cntr; int main(void) { ++_nl_msg_cat_cntr; return 0; }" HAVE_NL_MSG_CAT_CNTR)
diff --git a/src/config.h.in b/src/config.h.in
new file mode 100644
index 0000000..f445f88
--- /dev/null
+++ b/src/config.h.in
@@ -0,0 +1,25 @@
+/* This file is part of the KDE libraries
+ Copyright (c) 2016 A. Wilcox <awilfox@adelielinux.org>
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library 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
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#ifndef CONFIG_H
+#define CONFIG_H
+
+#cmakedefine HAS_NL_MSG_CAT_CNTR
+
+#endif
diff --git a/src/kcatalog.cpp b/src/kcatalog.cpp
index 6682d62..a15e661 100644
--- a/src/kcatalog.cpp
+++ b/src/kcatalog.cpp
@@ -21,6 +21,7 @@
#include <stdlib.h>
#include <locale.h>
#include "gettext.h"
+#include "config.h"
+#if defined(HAS_NL_MSG_CAT_CNTR)
// Magic to make sure GNU Gettext doesn't use stale cached translation
// from previous language.
-#if defined(__USE_GNU_GETTEXT)
++_nl_msg_cat_cntr;
#endif
}
--
2.9.2
sys/types.h is required to use dev_t in POSIX environments.
/*
* Class of public mediation types in the AppArmor policy db
@@ -191,6 +193,8 @@ extern int aa_policy_cache_remove(int dirfd, const char *path);
extern int aa_policy_cache_replace_all(aa_policy_cache *policy_cache,
aa_kernel_interface *kernel_interface);
/* XXX: The function requires cooperation from the system libc to store the
@@ -69,7 +72,10 @@ FILE *funopen(const void *cookie,
#define fwopen(cookie, fn) funopen(cookie, NULL, fn, NULL, NULL)
Esses sao patches de pacotes que eu mantenho no meu repositorio publico de ebuilds, denovo, grande maioria nao e minha e grande maioria conserta erros no progrma
Taken from https://patchwork.openembedded.org/patch/139352 this silences all
GCC7 expansion to defined annoyance and allows easier tracking of the build
process
diff --git a/Source/cmake/OptionsCommon.cmake b/Source/cmake/OptionsCommon.cmake
index ddaa233..3d3cc08 100644
--- a/Source/cmake/OptionsCommon.cmake
+++ b/Source/cmake/OptionsCommon.cmake
@@ -32,6 +32,8 @@ if (COMPILER_IS_GCC_OR_CLANG)
set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -fno-exceptions -fno-strict-aliasing")
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -fno-exceptions -fno-strict-aliasing -fno-rtti")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
+ set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-expansion-to-defined")
+ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-expansion-to-defined")
endif ()
if (COMPILER_IS_CLANG AND CMAKE_GENERATOR STREQUAL "Ninja")
diff --git a/wifish b/wifish
index d741180..9282bbd 100755
--- a/wifish
+++ b/wifish
@@ -68,7 +68,7 @@ scan_results() { # {{{ # Scans for APs or shows scanned results. Writes to $stem
echo " * Scanning For APs ..." >&2
# Get the data
- stemp=$(mktemp /tmp/$$.XXXX.menu)
+ stemp=$(mktemp /tmp/$$.menu.XXXXXX)
trap 'rm -f $stemp' INT TERM EXIT
if [ -n "$_IN_TEST" ];then # {{{ # Test/Mock mode
cat data/wscan.txt > $stemp # }}}
8. Re: Modificando o Linux e os Programas
albfnetousa openSUSE
Post recolhido
Enviado em 22/06/2017 - 18:44h
shell scripts, já fiz alguns sim, com ajuda, por não ser programador.
traduções? fiz várias.
agora otimizar pacotes pro meu micro sim, pq eu uso distros de compilação.
sabayon e gentoo. Com elas se pode otimizar o pacote pro seu micro, pq um instalador de pacotes, chamado portage,
parte de programas fonte, compila e faz o pacote no micro.
¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨
Albfneto,
Ribeirão Preto, S.P., Brasil.
Usuário Linux, Linux Counter: #479903.
Distros Favoritas: Sabayon, Gentoo, openSUSE, Mageia e OpenMandriva.
9. Re: Modificando o Linux e os Programas
removidousa Nenhuma
Post recolhido
Enviado em 22/06/2017 - 19:06h
Eu já mexi sutilmente em alguma coisa do kernel e num certo driver de winmodem.
Faz tanto tempo que nem sei o que fiz, nem tenho mais as alterações e já nem importa mais.
Também fucei no código de um certo CMS fazendo um hacking (damn f*cked word) que adiantou [*****] por causa do código mudar demais e as coisas ficarem depreciadas e bugadas de modo extremamente rápido. Não tive saco.
----------------------------------------------------------------------------------------------------------------
Nem direita, nem esquerda. Quando se trata de corrupção o Brasil é ambidestro.
(anônimo)
Encryption works. Properly implemented strong crypto systems are one of the few things that you can rely on. Unfortunately, endpoint security is so terrifically weak that NSA can frequently find ways around it. — Edward Snowden
Usamos cookies essenciais para manter o site funcionando e Google Analytics para métricas de audiência. Cookies de anúncios só serão carregados se você permitir.