Patch for 4.2.2008 for 3.12

OSS specific Linux discussion (x86/amd64)

Moderators: dev, hannu, cesium

igorzwx
Known Member
Posts: 1262
Joined: Sun Jun 28, 2009 9:31 pm

Re: Patch for 4.2.2008 for 3.12

Postby igorzwx » Sat Jan 18, 2014 2:24 am

Matti wrote:

Code: Select all

sudo apt-get install -y git
cd /usr/src
sudo git clone git://git.code.sf.net/p/opensound/git opensound-git

"sudo git" might be replaced with "git", and the download folder should not be owned by root.
"sudo hg" is also very suspicious _https://help.ubuntu.com/community/OpenSound#Building_from_Source
For example, "apt-get source" is not supposed to be run by root.
You would not run a web browser with root privileges, would you?

In any case, the OSS4 users do need a clear manual on how to install OSS4 from the "official git".

Matti
Member
Posts: 42
Joined: Sun May 29, 2011 12:34 pm

Re: Patch for 4.2.2008 for 3.12

Postby Matti » Sat Jan 18, 2014 12:32 pm

igorzwx wrote:"sudo git" might be replaced with "git", and the download folder should not be owned by root.
"sudo hg" is also very suspicious _https://help.ubuntu.com/community/OpenSound#Building_from_Source
For example, "apt-get source" is not supposed to be run by root.
You would not run a web browser with root privileges, would you?

In any case, the OSS4 users do need a clear manual on how to install OSS4 from the "official git".


Except that the official guide for building OSSv4 from source also suggest using /usr/src as download folder for it's files. Then you should create a build directory in home and that's because the OSS build system must use separate build and source directories.

Building the source
Basic use of the build system is close to autoconf-based build system ("configure && make && make install"), with one very important difference: The OSS build system must use separate build and source directories (unlike GNU autoconf where both are mixed), so a command like "./configure" will NOT work. These instructions will show how it's used.


http://www.opensound.com/wiki/index.php ... rom_source

igorzwx
Known Member
Posts: 1262
Joined: Sun Jun 28, 2009 9:31 pm

Re: Patch for 4.2.2008 for 3.12

Postby igorzwx » Sat Jan 18, 2014 12:50 pm

Matti wrote:Except that the official guide for building OSSv4 from source also suggest using /usr/src as download folder for it's files. Then you should create a build directory in home and that's because the OSS build system must use separate build and source directories.
http://www.opensound.com/wiki/index.php ... rom_source


This seems to be a very strange habit. Nobody else is doing such things.
There is, for example, a tool for building packages from source in Arch Linux, named "yaourt" https://wiki.archlinux.org/index.php/Yaourt
It downloads sources from net (git, hg, or tar.gz, and the like). It can also install them, if you want.
It is "forbidden" to run it as "root". It will ask for your password, when the package is ready, and you decided to install it.

_______________________________________________________

EDIT: It is not clear who owns /usr/src/oss . It is not explain in that "wiki":
_http://www.opensound.com/wiki/index.php/Building_OSSv4_from_source#Obtain_the_OSS_source
The "root" is only mentioned at the end:

Installing the OSS kernel modules
The kernel modules are built during a separate phase of the installation. It is necessary to become root to build the kernel modules:

Code: Select all

su root
make install

_http://www.opensound.com/wiki/index.php/Building_OSSv4_from_source#Installing_the_OSS_kernel_modules


Most probably, Ubuntu users misunderstood something.
Last edited by igorzwx on Sat Jan 18, 2014 1:28 pm, edited 1 time in total.

Matti
Member
Posts: 42
Joined: Sun May 29, 2011 12:34 pm

Re: Patch for 4.2.2008 for 3.12

Postby Matti » Sat Jan 18, 2014 1:25 pm

igorzwx wrote:EDIT: It is not clear who owns /usr/src/oss . It is not explain in that "wiki" http://www.opensound.com/wiki/index.php ... rom_source

Most probably, Ubuntu users misunderstood something.


In Ubuntu /usr/src directory is owned by "root" (both owner and group).

igorzwx
Known Member
Posts: 1262
Joined: Sun Jun 28, 2009 9:31 pm

Re: Patch for 4.2.2008 for 3.12

Postby igorzwx » Sat Jan 18, 2014 2:01 pm

Matti wrote:
igorzwx wrote:EDIT: It is not clear who owns /usr/src/oss . It is not explain in that "wiki" http://www.opensound.com/wiki/index.php ... rom_source

Most probably, Ubuntu users misunderstood something.


In Ubuntu /usr/src directory is owned by "root" (both owner and group).


This does not mean that it is owned by "root" in any distro.
Linux Mint 14 does not have /usr/src

Since the "root" is only mentioned at the final "installation stage", it might be obvious for any Linux newbie that all previous stages do not require root privileges _http://www.opensound.com/wiki/index.php/Building_OSSv4_from_source#Installing_the_OSS_kernel_modules

"hg clone" should not be run by root, and the OSS Wiki does not recommend such "heresy"
_http://www.opensound.com/wiki/index.php/Building_OSSv4_from_source#Obtain_the_OSS_source

Such strange ideas, like "sudo hg clone", are to be found only in the Ubuntu Documentation
_https://help.ubuntu.com/community/OpenSound#Obtaining_the_OSS_Source

In any case, the OSS Wiki is not a kind of Koran, or Bible. If it is a Holy Book, Ubuntu users should not be allowed to interpret it how they want.

The Russian Orthodox Church, for example, does not allow ordinary people to interpret the Russian Bible. Moreover, you should have a special theological education to be able to read the Russian Bible, because it was written in a kind of ancient Bulgarian language. It is forbidden to translate it to Russian to prevent misinterpretations. They know that misunderstanding of Holy Scriptures may cause religious conflicts and wars, as it happened in Europe, when somebody translated the Bible
_https://en.wikipedia.org/wiki/Protestant_Reformation
_https://en.wikipedia.org/wiki/Thirty_Years%27_War

For a similar reason, the Bible also caused troubles in Papua New Guinea. The translation of the Bible into Pidgin inspired anti-western Cargo cults (see: Colin Swatridge, Delivering the goods: Education as cargo in Papua New Guinea, Manchester University Press, 1985). See also: Peter Lawrence, Road belong Cargo: A study of the Cargo movement in the Southern Madang District, New Guinea. Manchester University Press 1964 _https://en.wikipedia.org/wiki/Peter_Lawrence_(anthropologist)

The problem is that Cargo cultists (and, perhaps, Ubuntu users) are "missing something essential" (Richard Feynman) _http://www.lhup.edu/~DSIMANEK/cargocul.htm

Mike Daisey, The Last Cargo Cult (interviews) _https://www.youtube.com/watch?v=YB-26XqDZj8
Cargo Cult _https://www.youtube.com/watch?v=qmlYe2KS0-Y
Cargo Cult (Russian translation) _https://www.youtube.com/watch?v=J6qxREv-EyM
Last edited by igorzwx on Tue Jan 21, 2014 7:01 pm, edited 4 times in total.

Matti
Member
Posts: 42
Joined: Sun May 29, 2011 12:34 pm

Re: Patch for 4.2.2008 for 3.12

Postby Matti » Sat Jan 18, 2014 4:06 pm

igorzwx wrote:This does not mean that it is owned by "root" in any distro.
Linux Mint 14 does not have /usr/src


I would think that the directory in a "root" filesystem must be owned by "root" in any distribution. In Ubuntu you have kernel headers and NVIDIA drivers sources and for example VirtualBox sources installed in /usr/src.

http://en.wikipedia.org/wiki/Filesystem ... y_Standard

/usr/src
Source code, e.g., the kernel source code with its header files.


http://www.pathname.com/fhs/pub/fhs-2.3.pdf (Filesystem Hierarchy Standard: Current Standard)

/usr is the second major section of the filesystem. /usr is shareable, read-only data.

igorzwx
Known Member
Posts: 1262
Joined: Sun Jun 28, 2009 9:31 pm

Re: Patch for 4.2.2008 for 3.12

Postby igorzwx » Sat Jan 18, 2014 4:43 pm

Matti wrote:I would think that the directory in a "root" filesystem must be owned by "root"


1. Of course, one would expect that /usr/src is owned by root.

2. /tmp is owned by root, but all users are allowed to "create and delete files" inside /tmp (try it).

3. A Linux user may (or may not) change access rights to a folder how he wants.
The problem is whether it is secure or not to run "git", "hg", "wget", or web browsers with root privileges.

4. The OSS Wiki does not say anything about root privileges for "downloading the source code", and it does not say that "hg clone" should run by root _http://www.opensound.com/wiki/index.php/Building_OSSv4_from_source#Obtain_the_OSS_source

5. The "root" is only mentioned at the final "installation stage"
_http://www.opensound.com/wiki/index.php/Building_OSSv4_from_source#Installing_the_OSS_kernel_modules

If this manual was written by the Prophet himself, it is a kind of "divine revelation", which might be misunderstood by ordinary Ubuntu users.

In any case, the OSS Wiki is not a Holy Book. If an Ubuntu user firmly believes that it is secure to run "git", "hg", or "wget", or web browsers with root privileges, he may try.

The main problem of the Ubuntu community, is that Ubuntu users, as a rule, have no formal theological education. Therefore, they often fail to discriminate between "sacred books" (e.g. Koran) and "secular books" (e.g. Linux documentation). That is why Ubuntu/Mint users are often involved into "theological disputes" over the meaning of sacred commands and words in the Holy Ubuntu Documentation.
Last edited by igorzwx on Tue Jan 21, 2014 5:31 pm, edited 6 times in total.

Matti
Member
Posts: 42
Joined: Sun May 29, 2011 12:34 pm

Re: Patch for 4.2.2008 for 3.12

Postby Matti » Sat Jan 18, 2014 5:49 pm

keantoken wrote:I compiled the Git repository version and it says

Code: Select all

Build ID will be 2006


Why does it seem the Git version is two years late, whereas the latest binaries are 2008? The source archives respond with a build ID 2008.


The git version isn't behind but it simply doesn't have the new tag. Also it has fixes for building OSSv4 on Linux 3.8, 3.10 and 3.11 but not 3.12 (look at the commits) so if you are trying to use it on a system with Linux 3.12 and newer it will fail. You have to apply the patch from this thread to the git sources and then build new package.

jhanger wrote:I'm having trouble with getting OSS4.2 build 2008 going on kernel 3.12.7
I custom built the kernel, it failed to build OSS from OSS 4.2 build 2007
So i downloaded it, ran this patch, followed instructions:
make build
make deb - to make the deb packages


The OSS 4.2 build 2008 source most likely doesn't have fixes for Linux 3.10 and 3.11 (maybe even 3.8 ). Atleast they aren't mentioned in the changelog.

OSS 4.2 build 2008 is being announced for Linux, Solaris, UnixWare, OSR6 and FreeBSD.

- fixes for AMD CS5536 device
- fixes for LynxTwo
- updated license - now OSS is licensed for 1 year from this announcement date.


You can either build new package from git or apply the patches to your current build.

Patch for Linux 3.11

Patch for Linux 3.10

Patch for Linux 3.8

moer
New Member
Posts: 3
Joined: Sun Jan 19, 2014 1:25 pm

Re: Patch for 4.2.2008 for 3.12

Postby moer » Sun Jan 19, 2014 1:34 pm

非常感谢补丁作者,这个补丁让我在linux kernel 3.11.10里成功安装OSS GIT。
Thank you!

keantoken
Member
Posts: 44
Joined: Fri Jul 08, 2011 2:54 am

Re: Patch for 4.2.2008 for 3.12

Postby keantoken » Mon Jan 20, 2014 11:09 pm

Thanks for the clarification.

It still doesn't work. Here is what I'm doing:

Code: Select all

su
cd /usr/src
git clone git://git.code.sf.net/p/opensound/git opensound-git
patch -p0 <patch
mkdir ./oss
cd ./oss
../opensound-git/configure
make install


And I still get this:

Code: Select all

modprobe: ERROR: could not insert 'osscore': Invalid argument
Loading the osscore module failed
make: *** [install] Error 60


Code: Select all

tail /var/log/messages
Jan 20 16:54:33 ronin kernel: osscore: no symbol version for memmove
Jan 20 16:54:33 ronin kernel: osscore: Unknown symbol memmove (err -22)


I have tried gcc-4.6 and gcc-4.7, using more than one of the methods in Igor's posts.

igorzwx
Known Member
Posts: 1262
Joined: Sun Jun 28, 2009 9:31 pm

Re: Patch for 4.2.2008 for 3.12

Postby igorzwx » Tue Jan 21, 2014 12:19 am

keantoken wrote:Thanks for the clarification.

It still doesn't work. Here is what I'm doing:

Code: Select all

su
cd /usr/src
git clone git://git.code.sf.net/p/opensound/git opensound-git
patch -p0 <patch
mkdir ./oss
cd ./oss
../opensound-git/configure
make install


And I still get this:

Code: Select all

modprobe: ERROR: could not insert 'osscore': Invalid argument
Loading the osscore module failed
make: *** [install] Error 60


Code: Select all

tail /var/log/messages
Jan 20 16:54:33 ronin kernel: osscore: no symbol version for memmove
Jan 20 16:54:33 ronin kernel: osscore: Unknown symbol memmove (err -22)


I have tried gcc-4.6 and gcc-4.7, using more than one of the methods in Igor's posts.


Perhaps, you applied the patch to a wrong folder.

The patch should be applied from within the directory that needs to be patched:
The first step is to change into the directory that needs to be patched...
Now you simply need to apply the patch from within this directory

Code: Select all

patch -p1 -i /path-to-the-patch

_https://wiki.archlinux.org/index.php/Patching_in_ABS


"-i" means "input" (see "patch --help"):

Code: Select all

patch -p1 --input=/path-to-the-patch


If you do not understand the meaning of a Linux command, do not use it.

The patch is a text file. You can open it with a text editor, read it, and apply changes manually with a text editor.
NOTE: It may happen, sometimes, that a patch is outdated (because the source code has been modified), but it can still be applied manually with a text editor.
The manual on "patch" (diff) is here: _https://en.wikipedia.org/wiki/Diff

If it fails, you may post complete information about your system, your actions, and the log of compilation.

If nothing helps, you may try Linux Mint Mate 16:
_http://www.opensound.com/forum/viewtopic.php?f=3&t=5586&start=30#p20366
It was already tested with 32bit and 64 bit.

keantoken wrote:It still doesn't work. Here is what I'm doing:

Code: Select all

su
cd /usr/src
git clone git://git.code.sf.net/p/opensound/git opensound-git



Never run, "git", "hg", "wget", and web browsers with root privileges. It is not secure.
If it is not obvious, you may ask for advice on Ubuntu Security forum: _http://ubuntuforums.org/forumdisplay.php?f=338

You can simply download the source code with "git" to a folder, then move it (with command "sudo mv") to /usr/src, or /opt/oss-devel, or /opt/oss-mumu (if you want).
The manual on "mv" is here: _https://en.wikipedia.org/wiki/Mv
To see how it works, you may create test folders and move them one into another.
See: _http://www.cyberciti.biz/faq/mv-command-howto-move-folder-in-linux-terminal/

keantoken wrote:

Code: Select all

mkdir ./oss
cd ./oss
../opensound-git/configure


You may want to read the OSS4 manual: _https://help.ubuntu.com/community/OpenSound#Building_from_Source

EXAMPLE (the "configure" script is located in the source folder /opt/oss-devel ):

Code: Select all

$ ls /opt/oss-devel | grep configure
configure

Code: Select all

$ cd ~/
$ sudo rm -rf oss42build
$ mkdir oss42build
$ cd oss42build/
$ NO_WARNING_CHECKS=yes /opt/oss-devel/configure --enable-libsalsa=NO
$ make
$ sudo make deb
$ sudo dpkg -i oss*.deb


Do not forget that "the build directory [oss42build] must be empty"
_http://www.opensound.com/wiki/index.php/Building_OSSv4_from_source#Create_a_build_directory.2C_and_make_it_current

keantoken
Member
Posts: 44
Joined: Fri Jul 08, 2011 2:54 am

Re: Patch for 4.2.2008 for 3.12

Postby keantoken » Tue Feb 04, 2014 4:16 pm

Well, I'm a moron, but I think I'm less of a moron now.

I figured out how to patch things right. So I clone the Git repo into a totally new directory with user privileges. I run the patch and it fails! Eventually I try to open osscore.c and it's totally blank!

So I erase the entire build directory and clone from Git again. Same thing, osscore.c is totally blank, before I even do anything!

So I go to the Git webpage here:

http://sourceforge.net/p/opensound/git/ ... /osscore.c

And find what is SUPPOSED to be in osscore.c. And Hannu has just changed it 2 days ago - I hoped to make it so we don't have to keep applying all these patches.

So I save that file over osscore.c

Then I tried to build, but it failed. So I used the patch at the beginning of this thread, and it worked, and now everything seems to work! This is what I did:

Code: Select all

mkdir ./keantoken
sudo mv ./keantoken /usr/src
cd /usr/src/keantoken
git clone git://git.code.sf.net/p/opensound/git opensound-git
cd ./opensound-git
patch -p1 < /path/to/patch
mkdir ../oss
cd ../oss
NO_WARNING_CHECKS=yes ../opensound-git/configure --enable-libsalsa=NO
make -j8
sudo make deb
sudo dpkg -i oss*.deb

igorzwx
Known Member
Posts: 1262
Joined: Sun Jun 28, 2009 9:31 pm

Re: Patch for 4.2.2008 for 3.12

Postby igorzwx » Tue Feb 04, 2014 7:57 pm

keantoken wrote:Well, I'm a moron, but I think I'm less of a moron now.

I figured out how to patch things right. So I clone the Git repo into a totally new directory with user privileges. I run the patch and it fails! Eventually I try to open osscore.c and it's totally blank!

So I erase the entire build directory and clone from Git again. Same thing, osscore.c is totally blank, before I even do anything!

So I go to the Git webpage here:

http://sourceforge.net/p/opensound/git/ ... /osscore.c

And find what is SUPPOSED to be in osscore.c. And Hannu has just changed it 2 days ago - I hoped to make it so we don't have to keep applying all these patches.

So I save that file over osscore.c

Then I tried to build, but it failed. So I used the patch at the beginning of this thread, and it worked, and now everything seems to work! This is what I did:

Code: Select all

mkdir ./keantoken
sudo mv ./keantoken /usr/src
cd /usr/src/keantoken
git clone git://git.code.sf.net/p/opensound/git opensound-git
cd ./opensound-git
patch -p1 < /path/to/patch
mkdir ../oss
cd ../oss
NO_WARNING_CHECKS=yes ../opensound-git/configure --enable-libsalsa=NO
make -j8
sudo make deb
sudo dpkg -i oss*.deb


I do not know how you manage to perform such a strange experiment.
Perhaps, your experiments are not reproducible.

Everything works as it should.
In short, "osscore.c" is not blank, and the patch works as it should.


Step 1: Clone the source:

Code: Select all

$ mkdir mumu
$ cd mumu
$ git clone git://git.code.sf.net/p/opensound/git opensound-git
Cloning into 'opensound-git'...
remote: Counting objects: 10108, done.
remote: Compressing objects: 100% (3437/3437), done.
remote: Total 10108 (delta 6595), reused 9932 (delta 6447)
Receiving objects: 100% (10108/10108), 18.31 MiB | 308 KiB/s, done.
Resolving deltas: 100% (6595/6595), done.
$ ls
opensound-git 


"osscore.c" is not blank. This can be easily verified:

Code: Select all

$ cat ~/mumu/opensound-git/setup/Linux/oss/build/osscore.c


You may save a copy of "osscore.c" before patching.

Step 2: Patching (the patch is located in the folder "~/mumu/")

Code: Select all

$ ls
opensound-git 
oss-4.2.2008-linux-3.12.patch
$ cd opensound-git
$ patch -p1 -i ~/mumu/oss-4.2.2008-linux-3.12.patch
patching file setup/Linux/oss/build/osscore.c
Hunk #1 succeeded at 472 (offset 36 lines).


The patch was successfully applied.

"osscore.c" is not blank. This can be easily verified:

Code: Select all

$ cat ~/mumu/opensound-git/setup/Linux/oss/build/osscore.c


You may read the "patch" and compare the old "osscore.c" with the patched "osscore.c".

Code: Select all

$ cd ~/mumu
$ ls
opensound-git 
oss-4.2.2008-linux-3.12.patch
$ cat oss-4.2.2008-linux-3.12.patch
diff -ur oss-v4.2-build2008-src-gpl.orig/setup/Linux/oss/build/osscore.c oss-v4.2-build2008-src-gpl/setup/Linux/oss/build/osscore.c
--- oss-v4.2-build2008-src-gpl.orig/setup/Linux/oss/build/osscore.c   2013-11-06 22:22:05.760399613 +0400
+++ oss-v4.2-build2008-src-gpl/setup/Linux/oss/build/osscore.c   2013-11-06 22:34:41.908792755 +0400
@@ -436,11 +436,15 @@
 int
 oss_get_uid (void)
 {
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0)
+  return __kuid_val(current->cred->uid);
+#else
 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,29)
   return current->cred->uid;
 #else
   return current->uid;
 #endif
+#endif
 }
 
 typedef struct tmout_desc


____________________________________________

Do you think that it is a good idea to post your "strange experiments" into somebody's thread?
It is a kind of "information pollution" _https://en.wikipedia.org/wiki/Information_pollution

You may simply start your own thread and post there all your "strange results".

keantoken
Member
Posts: 44
Joined: Fri Jul 08, 2011 2:54 am

Re: Patch for 4.2.2008 for 3.12

Postby keantoken » Tue Feb 04, 2014 8:22 pm

osscore.c WAS blank when I did git clone, twice. That was my point. Only after I went to the webpage and downloaded that file specifically did everything work. I don't think this was a coincidence since that is the last and most recent update by Hannu. It must be some sort of Git error. It's no surprise that it worked for you, since errors are often anomalous and a sample of 2 users (you and me) is not conclusive, but there must be others who have had the same problem I just had.

You're right, my posts don't really belong in this thread anymore. I will think about what I'm posting where.

cesium
Developer
Posts: 902
Joined: Sun Aug 12, 2007 12:51 am

Re: Patch for 4.2.2008 for 3.12

Postby cesium » Tue Feb 04, 2014 11:58 pm

Igorzwx, I may be barely available, but do not try to 'inform' on what is tolerated or not. Tone down a bit.


Return to “Linux”

Who is online

Users browsing this forum: Baidu [Spider] and 2 guests