Have you ever modified the source code of an open source application?
Linux - GeneralThis Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
View Poll Results: Have you ever modified the source code of an open source application?
Modified quite a lot of downloaded code, unfortunately not FOSS. I’ll have to pick my sources more carefully in the future so I can give back. I’ve contributed to Arch’s AUR. Not sure if either of those count, so answered “not sure”
If you use any of the big standard distributions in a large heterogeneous corporate environment, you will find the process of getting bugs fixed in the distro is so tedious and slow that you frequently have to patch locally now rather than send the patch upstream and wait for updates. (This contrasts strongly with using FOSS software direct from author(s) instead of through a distro.)
For example RHEL8 has an selinux policy that prevents systemd from loading iptables - pretty disastrous, right? And might even be pretty simple to fix since it looks like a regression to a known Fedora bug, right? https://edubirdie.com/nursing-papers-for-sale
Red Hat: Well, it'll get fixed in the next quarterly update set, yawn yawn.
Not meaning to pick solely on Red Hat, just using a current and pertinent example.
The bug in RHEL8 is but I can't find the old Fedora bug any more.
Thank you!
Last edited by RonaldLabonte; 05-02-2020 at 03:45 PM.
I've answered yes, despite being no programmer. There was a thing with some OSS Radeon driver on my box, which had a really early vintage 2007 radeon gpu. The ttys were blanking to white. After posting the bug, I had to join the LKML & roll the latest kernel to try it, and confirmed the bug. The dev wrote the patch (in 5 seconds apparently) and sent it for trying. He simply added an extra if statement in the same chain bracket which was ignored. I fixed the syntax error by shifting punctuation around and changing if -->elseif (courtesy of the elementary C coding we did on a Hardware course programming PICs). That meant 2 more (LONG) kernel compiles. The dev was mighty aggrieved that I patched his patch and I got roasted. But mine worked and his didn't. He kind of left it then.
Last edited by business_kid; 04-28-2020 at 01:37 PM.
The closest I’ve come is: modifying Arduino code; and modifying a Slackware build script for Arduino IDE for x86 and x86_64 to build a newer version of the package, for ARM, and linking to a different library in SlackwareARM -current.
I think the first open source I did anything much to was nethack in 1992. At that time Linux did not have X11 (or in-kernel networking), but our PC had a serial port, so by hooking up a terminal (Digital Equipment Corporation vt-320) I was able to add another user. But I needed a compelling reason for another user to login and use the system, so I made a few mod's to the nethack source to get it to build and run, and then uploaded the result to banjo.concert.net. Here's my first posting concerning the mod's from October 1989:
Quote:
I recently ported nethack (I wanted to provide an incentive for someone
other than myself to login and make an entry in /etc/wtmp :-)
In doing this I encountered problems with the following (f/s)scanf statement
(in topten.c):
I had problems with both the [] specs, the results are unpredictable.
I'm using 0.12 with the abc release, and have applied almost all the
patches/enhancements around (nonblobking, curses, poe-IGL, ...). Is
there a better implementation of scanf available (or in the wind)? I
eventually gave up on scanf and wrote a simple parser using the str*()
routines. I built nethack 3 patch level 6 (I think pl10 has a workaround
for systems that have bad scanf's).
Apart from this problem, there are only a few minor porting problems.
In a handful of places Linux prototypes differed from ones declared in
the game.
Nethack runs fine on my console, and also on a vt320 connected to
/dev/tty64. I had to change the vt320 entry in inittab to vt100 (the
original /etc/termcap entries look OK - problem with termcap
routines?).
There seems to be a minor problem with rip.c, it doesn't print the
proper details (maybe a curses problem). Also curses sometimes gets
the updates wrong, eg zap, throw.
In case anyone wants them, here are my diffs (I can make the binaries
available if anyones interested):
# flags may have to be changed as required
--- 33,37 ----
# a non-ANSI <sys/ioctl.h> -- either run fixincludes on it or use
# -traditional in CFLAGS
! CC = gcc
# flags may have to be changed as required
***************
*** 52,64 ****
# Sysatt uses shared library in lieu of this option
# TERMLIB = -ltermcap
! # TERMLIB = -lcurses
! TERMLIB = -ltermlib
# yacc/lex programs to use to generate lev_comp.c, lev_comp.h, and lev_lex.c.
# if, instead of yacc/lex you have bison/flex, comment/uncomment the following.
! YACC = yacc
! LEX = lex
! # YACC = bison -y
! # LEX = flex
# make NetHack
--- 52,64 ----
# Sysatt uses shared library in lieu of this option
# TERMLIB = -ltermcap
! TERMLIB = -lcurses
! # TERMLIB = -ltermlib
# yacc/lex programs to use to generate lev_comp.c, lev_comp.h, and lev_lex.c.
# if, instead of yacc/lex you have bison/flex, comment/uncomment the following.
! # YACC = yacc
! # LEX = lex
! YACC = bison -y
! LEX = flex
# make NetHack
***************
*** 68,73 ****
# with a reasonable random number generator -- also remember to get random.c
# into the src directory
! # RANDOBJ = random.o
! RANDOBJ =
# nothing below this line should have to be changed
--- 68,73 ----
# with a reasonable random number generator -- also remember to get random.c
# into the src directory
! RANDOBJ = random.o
! # RANDOBJ =
# nothing below this line should have to be changed
*** ../include/config.h.origi Thu Mar 5 22:33:32 1992
--- ../include/config.h Thu Mar 5 22:53:25 1992
***************
*** 62,69 ****
#ifndef WIZARD /* allow for compile-time or Makefile changes */
# ifndef KR1ED
! #define WIZARD "izchak" /* the person allowed to use the -D option */
# else
#define WIZARD 1
! #define WIZARD_NAME "johnny"
# endif
#endif
--- 62,69 ----
#ifndef WIZARD /* allow for compile-time or Makefile changes */
# ifndef KR1ED
! #define WIZARD "michael" /* the person allowed to use the -D option */
# else
#define WIZARD 1
! #define WIZARD_NAME "michael"
# endif
#endif
***************
*** 79,83 ****
*/
! #define COMPRESS "/usr/local/compress" /* path name for 'compress' */
#ifndef COMPRESS
#define ZEROCOMP /* Use only if COMPRESS is not used -- Olaf Seibert */
--- 79,83 ----
*/
! #define COMPRESS "/usr/bin/compress" /* path name for 'compress' */
#ifndef COMPRESS
#define ZEROCOMP /* Use only if COMPRESS is not used -- Olaf Seibert */
*** ../include/unixconf.h.ori Thu Mar 5 22:33:55 1992
--- ../include/unixconf.h Thu Mar 5 22:53:15 1992
***************
*** 22,29 ****
/* #define BSD /* define for 4.n BSD */
/* also for relatives like SunOS */
! #define ULTRIX /* define for Ultrix v3.0 or higher (but not lower) */
/* Use BSD for < v3.0 */
/* "ULTRIX" not to be confused with "ultrix" */
! /* #define SYSV /* define for System V */
/* #define NETWORK /* if running on a networked system */
/* e.g. Suns sharing a playground through NFS */
--- 22,29 ----
/* #define BSD /* define for 4.n BSD */
/* also for relatives like SunOS */
! /* #define ULTRIX /* define for Ultrix v3.0 or higher (but not lower) */
/* Use BSD for < v3.0 */
/* "ULTRIX" not to be confused with "ultrix" */
! #define SYSV /* define for System V */
/* #define NETWORK /* if running on a networked system */
/* e.g. Suns sharing a playground through NFS */
***************
*** 42,46 ****
By Jay Maynard */
! /* #define RANDOM /* if neither random/srandom nor lrand48/srand48
is available from your system */
/* #define TEXTCOLOR /* Use System V r3.2 terminfo color support */
--- 42,46 ----
By Jay Maynard */
! #define RANDOM /* if neither random/srandom nor lrand48/srand48
is available from your system */
/* #define TEXTCOLOR /* Use System V r3.2 terminfo color support */
***************
*** 64,69 ****
* Hack will use its internal pager if DEF_PAGER is not defined.
* (This might be preferable for security reasons.)
- * #define DEF_PAGER ".../mydir/mypager"
*/
/*
--- 64,69 ----
* Hack will use its internal pager if DEF_PAGER is not defined.
* (This might be preferable for security reasons.)
*/
+ #define DEF_PAGER "/usr/bin/less"
/*
***************
*** 73,79 ****
* variable MAILREADER; otherwise an internal pager will be used.
* A stat system call is done on the mailbox every MAILCKFREQ moves.
*/
- #define MAIL /* Deliver mail during the game */
#ifdef MAIL
--- 73,79 ----
* variable MAILREADER; otherwise an internal pager will be used.
* A stat system call is done on the mailbox every MAILCKFREQ moves.
+ * #define MAIL /* Deliver mail during the game
*/
Quite often. The Linux source is often the target and I can be found in the depths of some device driver (fixing bugs on newer products not yet mature) or at times adding custom sysfs hooks to debug a board-level issue on a piece of custom hardware. And I've several times had to back-port fixes from a newer kernel version to continue to support old hardware.
Nope. I left software development before I had an opportunity to do this. Got burned out on the hectic schedules and tight deadlines ... consumed too much of my life back then.
Have you ever modified the source code of an open source application?
Actually yes! I did examine and correct the spelling for a module for a webcam. It seems that the spelling was not correct for the Slackware supplied GCC build to create the module. Surprisingly enough it worked. And I've attempted to maintain the Slackware stuff for OWFS, it's a file system for the One-Wire parts from MAXIM, originally Dallas Semiconductor.
And of course helping Slackware build its custom kernels for Slackware-11.0 and even earlier.
I think the first open source I did anything much to was nethack in 1992. At that time Linux did not have X11 (or in-kernel networking), but our PC had a serial port, so by hooking up a terminal (Digital Equipment Corporation vt-320) I was able to add another user. But I needed a compelling reason for another user to login and use the system, so I made a few mod's to the nethack source to get it to build and run, and then uploaded the result to banjo.concert.net. Here's my first posting concerning the mod's from October 1989:
Wow!
I am impressed. I've been working like crazy to get Slackware to properly grok an external terminal. And now we've got X11 running and the networking methods.
There has often been too much anarchy in GNU libs. On building a package you get errors that a certain variable is not defined in such and such's header file. The data was needed, and too often someone didn't like the structure it was defined in. It's not hard to track down it or it's equivalent and patch the code so it would compile and run correctly.
I have on occasion modified code for my own use. If I think it's something others may find useful I'll suggest it to the dev. Once in a while they'll accept and use it.
I investigated a bug with wxWindows and file names with accented characters. I made a fix in the code to use the unicode version of a function by adding a "u" in front of its name. So I made a fix in one byte. Quite efficient, no?
Normally, after installing this and that after my Gentoo was up, dependencies were shot t. h. and the 'fun' began. Success rate was max 5%, the rest of the time I either continued using a limping system or reinstalled it which, then at least, was a royal pain in the neck.
I was using a laptop and compiling kde... whew!
Normally: compile, goto bed, get up in the morning, find the error, recompile. Loop until success.
At work I used Windows and Gentoo in a wmware setup up 2000-2002 when I went all Gentoo. In 2004 I switched to Ubuntu 4.10, Warty Warthog. Very little editing sources since then. As "cdjc" says: "[hacking sources] consumed too much of my life back then".
Sure, but only back in the 80s, when SIMTEL was the only source for free and open software, and even then I did it mostly for experimentation and/or minor bug fixing, always for my own use.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.