Chmod ACL removal
Hey all,
A simple question...
For the life of me, I haven't figured out to do one easy command:
chmod -a "user allow attribute1, attribute2, etc.." file
That seems to take off the ACL entires for the user on that file.
Now, lets say I've got a folder with hundreds of sub directories and files with 50 users ACL'd all over the place inside.
How do I do something like: chmod -R -a "*" main_directory
in one command instead of going through all day one by one or in sets of users?
Much appriciated to anyone who can help me out!
Basically, we have a custom piece of software we developed that has an SQL database of "libraries" which are a collection of various media files.
Each of the libraries is stored on an xserve raid and the file structure looks something like:
Libraries
Libraries/library1
Libraries/library2
Libraries/library3
Libraries/libraryetc....
and there's a unix account for each library for a organization that can log in and only access their stuff. So as a result, we have all the unix users have read access into Libraries and then have individual read write for their own specific library folder. The second we used ACL to give the inherited permission, everyone started gaining access to each other's folders.
Now obviously, I'd usually just do that via unix permission, however qtss user needed to be the owner with rwx and www needed r_x permission, and other permission needed to be nothing, so ACL was necessary. And we couldn't switch around to have qtss and www under ACL cause Quicktime Streaming Server hates it
Plus this is all done from a web interface which passes the command to do all this to a cronjob that root is always looking for.
Similar Messages
-
Set-Acl removing inherited permissions
Hi,
I am trying to set permissions on a remote share. However, using Set-Acl removes the inherited permissions from the share.
i.e. F:\SHARE inherits permissions from F:\
Using Set-Acl in any way, removes the permissions inherited from F:\.
i.e. (Get-Acl \\SERVER\SHARE) | Set-Acl \\SERVER\SHARE
After running that command, the inherited permissions from F:\ will no longer be applied to F:\SHARE
Ideas?
Another thread suggested this was a UAC issue. UAC is turned off on both the computer running Set-Acl, and the computer with the share. UAC was turned off by changing the value of EnableLUA from 1 to 0 in "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\policies\system".This is because setting the ACL on the root of a share using the UNC path disables inheritance for that folder. It has nothing to do with UAC and is by design. Try doing it in explorer and you'll get a warning stating just that.
EDIT: To set the permissions remotely in this particular case, you'll need to be an administrator on the remote machine. This allows you to connect via \\SERVER\F$, where you are then free to set permissions on the \\SERVER\F$\SHARE folder without disabling
inheritance.
Best Regards,
Carl S
All code is provided as-is with no guarantees. Always try it out in a test environment before applying it in a production environment. -
The backup was not performed because an error occurred while copying files
One Time Capsule, Two MacBook's, OS10.6.6
One MacBook can backup no problem, The other cannot backup says: the backup was not performed because an error occurred while copying files to the backup disk.
Using a Time Machine Buddy widget gives:
Starting standard backup
Attempting to mount network destination using URL: afp://Rachel%[email protected]/Data
Mounted network destination using URL: afp://Rachel%[email protected]/Data
QUICKCHECK ONLY; FILESYSTEM CLEAN
Disk image /Volumes/Data/Rachel Feuchtwang’s MacBook.sparsebundle mounted at: /Volumes/Time Machine Backups
Backing up to: /Volumes/Time Machine Backups/Backups.backupdb
No pre-backup thinning needed: 4.70 GB requested (including padding), 721.52 GB available
Indexing a file failed. Returned 200 for: /Applications/Dashboard.app, /Volumes/Time Machine Backups/Backups.backupdb/Rachel Feuchtwang’s MacBook/2011-01-12-115852.inProgress/F82EB140-616F-4213-9B4A-072C2C98B556/MAC/A pplications/Dashboard.app
Aborting backup because indexing a file failed.
Stopping backup.
Copied 5 files (84 bytes) from volume MAC.
Copy stage failed with error:11
Backup failed with error: 11
Ejected Time Machine disk image.
Ejected Time Machine network volume.
Who would be so kind to point me in the direction to make thsi work again?
Thanks! HugoThis could very well have to do with ACLs.
I bumped into the same problem:
5/8/11 10:43:22 PM com.apple.backupd[7126] Error: (-41) SrcErr:NO Copying /Users/SA/Public/Drop Box/HandBrake.app/Contents/Frameworks/Sparkle.framework/Versions/A/ Resources/de.lproj/SUAutomaticUpdateAlert.nib/classes.nib to /Volumes/Local Backup/Backups.backupdb/Server/2011-05-08-221524.inProgress/88ACE716-0660-44C8- A128-CF01046FC2F8/Macintosh HD/Users/SA/Public/Drop Box/HandBrake.app/Contents/Frameworks/Sparkle.framework/Versions/A/ Resources/de.lproj/SUAutomaticUpdateAlert.nib
Using DD or CCC is no option for me, I don't want downtime and I want incremental backups. So I started to investigate.
I repartitioned my external Time Machine drive, did the backup again. It didn't work. Then I blocked the culprit file mentioned in the logs from being backed up with TM. That helped, only to find that a bit later it found another file with issues.
So i looked at the files an found they had ACLs on them that somehow prevented them from being copied.
SOLUTION:
remove the ACL from the file.
If you want to remove all ACLs in a directory, use Terminal and navigate to that directory. Then issue this command:
sudo echo | sudo chmod -R -E ./*
If you would like to remove ACLs from a single file or package (e.g. an application), issue this:
sudo echo | sudo chmod -R -E <nameoffile>
You might have to this several times since there might be multiple files affected. Unlike previous solutions, this one does not require you to delete the file.
I got the command to remove ACLs from http://osxadmin.blogspot.com/2008/01/chmod-acl-removal.html -
A strange account been added to all docs
A strange account named "wheel" has been added to all most all of my documents.
What happened?
How do I get rid of it? Instead of going, one document at a time and deleting "wheel."Hello, wheel is a common group from Unix...
http://superuser.com/questions/191955/what-is-the-wheel-user-in-os-x
http://forums.macnn.com/90/mac-os-x/108958/group-permissions-wheel-vs-staff-what s/
Might be ACLs, but I don't think there's much reason to change it/them...
https://discussions.apple.com/thread/2194012?start=0&tstart=0
http://osxadmin.blogspot.com/2008/01/chmod-acl-removal.html
http://hintsforums.macworld.com/showthread.php?t=114817 -
Need help removing an unremovable ACL
Hi All,
I'm running OS X Mavericks Server on a machine and have come across some files that I cannot do anything with. Their POSIX access control is set to 700 and I am the owner of the files. They also have a single ACL entry "0: group:everyone deny delete". I am unable through any "normal" means that I am aware of, such as chmod -N to get this ACL removed so that I can do something with them. I have tried the sudo variations of chmod -N and chmod -E as well. Anything I attempt to do with the files either as myself or via sudo results in the error message "Operation not permitted". Not that it should make any difference but these file reside on an external Promise Pegasus raid drive. All the search results I have been able to find thus far all discuss the chmod -N approach which does not work with this ACL. Have also tried adding an ACL to allow me to do something with the files but the chmod +a and -a don't work either. I assume I will have to boot into some other OS or safe mode or something weird but I'm stuck here, anyone know how to correct this?
TIA
RonOoops! Linc repied while I was composing the following, so just consider this additional information for someone that is trying to transfer their Unix knowledge to Mac OS X.
What was it in the jumble of information that told you the file was locked?
Linc saw the "uchg" flag in the ls output, which Mac OS X uses for the File Info "Locked" check box.
While "man chflags" will tell you, in the typical cryptic Unix way, what uchg is, you "just gotta know" that File Info "Locked" uses that flag, from years of either reading these, or similar, forums, and/or experimenting with the GUI and command line to see how A affects B.
"man chmod" is used to change permissions and ACLs
"man chflags" is used to change flags
"man xattr" is used to change extended attributes (eg. com.apple.FinderInfo)
"man chown" is use to to change owner/group
"man touch" is used to change dates
"man ls" with the host of options Linc gave you is very useful in seeing the file metadata
"man stat" with -s can give you all the date information, -s gives POSIX info, but not creation date.
As with all Unix commands, good backups are important when playing with any command that will change something on the file system.
Message was edited by: BobHarris -
"don't have permission to see its contents"
Greetings,
I'm really having problems with this Snow Leopard, and don't want to be agitated, or frustrated, but it's getting harder and harder to do so.
After installing on my 17" Macbook Pro, I was able to log in, fine, but was unable to do much of anything, as I was prompted to give a administrator password, but had no idea of what this was.
After trying every combination of my name (which has been my user name from before time), and pass work, I got it in my head that "this messing ain't cutting it."
After a bit of looking here on the forum, I was able to find out how to use my install disc to crate a "system administrator" account, and then, after restarting from my hard drive, I was able to go into the system preferences, find my users, and give myself permissions to act as an administrator (after this, I read several posts about how it's scary to crate an administrator account -- and it was -- but just tried to be strong -- channeling bit of strength from an alligator I once saw eat a big chunk of old truck tire, and just pressed on).
Now I should note that while I was log in as the (scary) administrator, I did seem that I was able to open folders without issue, however, when I logged back in as me (the monkey of wire), nothing much had changed, I could not open any folders with exception of "public" and something else like that...
The warning I get is ""don't have premission to see its contents" -- wow, I can't even look?
Frightening.
And, what scares me even more, is that I can go back in my time machine and see things that I would like to bring forward, but when I try to, I'm told "this is part of OS X and can't be modified... " or something close to that... Don't worry about this issue right now, I think it might be tied to the "no permission" deal, but if I've lost those back ups... Well, we all know what that feeling is like, and I will be feeding parts of my grays anatomy to said "Alligator."
So, while I'm here, what about just going back to OSX plain old Leopard?
Can I do this if I do a reset to factory install?
Will that boot out all the snow?
And if so, what I fear is that I have already corrupted my time machine drive with a back up done while this Snow Leopard OS installed... Yeah, when I plugged in the drive to check what it's staturse was, the Macbook just jumped in and performed a new back up -- of this state of affaires.... Scary again.
I was thinking I might be able to go into the drive and erase this one (or perhaps two) backups, but then when I looked there is a document that's very new -- like just at the time this back up was being done -- and it's called something catalog, I think, and I have a gut wrenching feeling that to erase that would be the beginning of a horror show... So, let me not go there just yet...
Wow, that's a lot... Any help on this would just be awesome.
I honestly just rock out hard no my apple products, I'm a long time user, and always do things carefully and with thought, but this is very underwater frozen under the snow black water gator **** for me right this moment in time.
Thank you,
WMI found a solution over on Macrumors forums, though it's not for the faint of heart. The solution starts at post #36, about halfway down the page:
http://forums.macrumors.com/showthread.php?t=417647&highlight=ACL&page=2
As I suspected, this is a Terminal / Unix / Command-line procedure, and anyone uncomfortable with it should probably just take their Mac to the Genius Bar at their local Apple store. That said, below is the procedure that worked for me (I'll make it easier for those who don't want to read the whole thread on macrumors.com).
Also, the first procedure is ONLY FOR HARD DRIVES/VOLUMES WITH ONE-WORD NAMES. If you have two or more words in the name(s), the procedure is slightly different, and I've listed that below the first procedure.
*1. Open an application in your Utilities folder called Terminal.*
This is the Unix part of Mac OS X that does not have a GUI (graphic user interface). Think of it like working in DOS (or BASIC), if you're as old as I am. It's also a bit like a word processing program, only much more powerful.
You type a command (_EXACTLY, character for character, space for space, as it is shown in the example_) and then hit ENTER or RETURN to execute the command. After the first ENTER/RETURN, you will probably have to enter your account password (or an administrator password if you're not logged in as such).
You won't see any characters appear as you type your password, (the cursor remains in the same place) but continue typing it and then hit RETURN/ENTER.
2. In Terminal, CUT AND PASTE the following lines +one at a time+ (obviously replace "Volumename" with the name of your volume). Make SURE you include spaces where there are spaces. And those are ZEROS after "chflags" and "chown", not Oh's.
Hit RETURN/ENTER after the "Volumename", and watch your HD's icon on your desktop after each command. In my case, the little padlock disappeared first, then my custom icon was restored, and then it was just blink blink every time after. But it works!!! REMEMBER, THIS FIRST PROCEDURE IS ONLY FOR VOLUMES WITH SINGLE-WORD NAMES:
*sudo chflags 0 /Volumes/Volumename* <HIT RETURN/ENTER HERE> (don't type this part in Terminal.
*sudo chown 0:80 /Volumes/Volumename* <HIT RETURN/ENTER HERE>
*sudo chmod 775 /Volumes/Volumename* <HIT RETURN/ENTER HERE>
*sudo chmod -N /Volumes/Volumename* <HIT RETURN/ENTER HERE>
BUT if your volume's name includes one or more spaces like this: "My HD Backup", then you must write the command like this (Notice the spaces :
sudo chflags 0 /Volumes/firstname\ secondname\ thirdname\ fourthname\ fifth etc.
sudo chown 0:80 /Volumes/firstname\ secondname\ thirdname\ fourthname\ fifth etc.
sudo chmod 775 /Volumes/firstname\ secondname\ thirdname\ fourthname\ fifth etc.
sudo chmod -N /Volumes/firstname\ secondname\ thirdname\ fourthname\ fifth etc.
or like in my example:
Quote:
sudo chflags 0 /Volumes/My\ HD\ Backup
sudo chown 0:80 /Volumes/My\ HD\ Backup
sudo chmod 775 /Volumes/My\ HD\ Backup
sudo chmod -N /Volumes/My\ HD\ Backup
That should do it! Hope it works for everyone with this problem. Thanks to "IEatApples" on MacRumors for the solution!
For anyone who cares, here's what another MacRumors user (angelwatt) said these commands actually do:
1. chflags 0 removes all flags from the file(s)
2. chown 0:80 ensures root:admin (owner:group) permissions so the system can access the files
3. chmod 775 adjusts file permissions so you and your group have read/write/execute permissions
4. chmod -N removes the ACL (Access Control Lists) from the named file(s)
Cheers!
*disclaimer: I take no responsibility for any mucking up this does to your machine due to mis-types by you or me. But pull up your bootstraps, be brave, this works! -
Network users can not read Applications or Library
Not sure exactly where to post this but I think the server section will have more expertise than the desktop section.
We have 10.5.4 clients authenticating against a 10.4 Open Directory master. Prior to upgrading the clients to 10.5.5 everything was working fine. After upgrading the clients network users could no longer read the Applications or Library folders. When logging in all the icons in the dock would be replaced with the generic application icon and when trying to launch one the system reports the application could not be opened because it may be damaged or incomplete.
Viewing the iMac hard drive in a Finder window the Applications and Library folders have the do not enter sign on them. Viewing Sharing & Permissions under the Get Info window as the local admin user shows Read & Write for system and admin and Read only for everyone. This looks correct.
An `ls -l` on the root directory in Terminal as a network user reports that Applications and Library do not exist (no such file or directory). When running `ls -l` as the local admin the two folders appear and have a + sign after their permission strings which indicates extended security attributes (an ACL). I cannot find a command line tool to display or manipulate ACLs (such as getfacl and setfacl in Solaris) other than fsaclctl which enables and disables ACLs for an entire filesystem.
I disabled ACLs for the root fileystem (sudo fsaclctl -p / -d) and then network users could read the Applications and Library folders without problem. So there must be something in the ACL for those two folders that is restricting network users.
One other thing I noticed was that I tried to add a network user to Sharing & Permissions under the Get Info window, I could search for network users in the pop-up window but they would not get added to the list when I clicked select. So perhaps the problem is not with the ACL on Applications and Library but with 10.5.5 somehow not recognizing network users.
Installing Security Update 2008-007 does not resolve the issue. In fact it re-eanbles ACLs and they have to be disabled again in order for network users to work properly.I eventually managed to fix it again - don't know exactly what broke it and what resulted in a fix.
Check what groups your network users are in, in a terminal enter the command:
groups <username>
My machine was only reporting the primary group of the user - none of the secondary groups were listed. This machine has a Open Directory custom mapping to force local home folders (a special case, we generally use NFS homes), and when I removed and re-added this mapping (rebooting in between changes) the groups command began to work correctly again and access to these folders was restored.
I was able to confirm that the ACL was the problem, removing it allowed the network users to gain access, restoring it broke it again.
BTW, the error messages you got when you ran the ACL removal chmod command are nothing to worry about, these are just device special files (representing hardware devices in the filesystem), I doubt that ACLs can be setup for these. -
SSL VPN on C2821 Radius auth issues
I've been looking through the discussions and I can't seem to nail this one down. I'm implimenting SSL VPN on a 2821 to do SMTP only. I need it to auth off the radius server and it is only asking for local router login P/Ws. It will not auth against Radius. I've created a seperate aaa auth group to no avail and tried a few different tweaks. I'm throwing science at the wall and seeing what sticks at this point.
I've made a new group server for Radius to test it, not working. I've tried variations in domain, not working. Can't use SDM, nor want to.
This is what the config looks like
Building configuration...
Current configuration : 24735 bytes
! Last configuration change at 08:19:39 Arizona Tue Aug 28 2012 by dci
version 15.1
service timestamps debug datetime msec
service timestamps log datetime msec
no service password-encryption
hostname N****
aaa new-model
aaa group server radius IAS_AUTH
server-private 10.12.1.7 auth-port 1645 acct-port 1646 key $*****
aaa group server radius Global ***made for testing. Redundant
server-private 10.12.1.7 auth-port 1645 acct-port 1646 key $*****
aaa authentication login default local
aaa authentication login sdm_vpn_xauth_ml_1 group IAS_AUTH
aaa authentication login sdm_vpn_xauth_ml_2 local
aaa authentication login SSL_Global group Global ** created for SSL VPN redundant, but did for testing
aaa authorization network sdm_vpn_group_ml_1 local
aaa authorization network sdm_vpn_group_ml_2 local
aaa session-id common
clock timezone Arizona -7
dot11 syslog
ip source-route
ip cef
password encryption aes
crypto pki trustpoint TP-self-signed-2464190257
enrollment selfsigned
subject-name cn=IOS-Self-Signed-Certificate-2464190257
revocation-check none
rsakeypair TP-self-signed-2464190257
crypto pki certificate chain TP-self-signed-2464190257
certificate self-signed 01
REMOVED
interface GigabitEthernet0/0
INTERFACES REMOVED
ip local pool SDM_POOL_2 10.12.252.1 10.12.252.254
ip forward-protocol nd
ip http server
ip http authentication local
ip http secure-server
ip http timeout-policy idle 600 life 86400 requests 10000
ip flow-cache timeout inactive 10
ip flow-cache timeout active 5
ip flow-export source GigabitEthernet0/0
ip flow-export version 5 peer-as
ip flow-export destination 10.12.1.17 2048
ROUTES REMOVED
ACLS REMOVED SSL IS ALLOWED
route-map STAT_NAT permit 10
match ip address 109
route-map DYN_NAT permit 10
match ip address 108
snmp-server community $DCI$ RO
control-plane
banner login ^C
line con 0
password 7 01100F175804
login authentication local
line aux 0
line vty 0 4
privilege level 15
transport input telnet ssh
line vty 5 15
privilege level 15
transport input telnet ssh
scheduler allocate 20000 1000
webvpn gateway gateway_1
ip address **outside ip*** port 443
http-redirect port 80
ssl trustpoint TP-self-signed-2464190257
no inservice
webvpn context webvpn
secondary-color white
title-color #CCCC66
text-color black
ssl authenticate verify all
port-forward "portforward_list_1"
local-port 3000 remote-server "10.12.1.23" remote-port 25 description "Email"
policy group policy_1
port-forward "portforward_list_1"
default-group-policy policy_1
aaa authentication list SSL_Global
aaa authentication domain @n****
gateway gateway_1 domain N****
max-users 10
no inservice
end
Can't change "no inservice" to "inservice" and I can't figure out why. Any help with this?OK, upgraded IOS to most current stable version and I'm now able to do inservice on the context and gateway. I'm trying to go through the SDM route, but Java crashes with ValidatorException errors. I'm going to try updating the SDM since it's the original version to the 2008 version since all the little "fixes" for this do not work. Any ideas on that?
-
[SOLVED] [makepkg] attempts to process source files multiple times
OK, so I decided I was going to update the PKGBUILD for linux-lts-tresor to the new format with separate sources for different architectures and PGP keys, having successfully done it for the nvidia packages I maintain and I get the following issue when I run mkaurball on the linux-lts-tresor PKGBUILD:
claire ~/Builds/linux-lts-tresor % mkaurball
==> Making package: linux-lts-tresor 3.14.28-1 (Fri 9 Jan 10:51:06 GMT 2015)
==> Retrieving sources...
-> Found linux-3.14.tar.xz
-> Found linux-3.14.tar.sign
-> Found patch-3.14.28.xz
-> Found patch-3.14.28.sign
-> Found config
-> Found config.x86_64
-> Found linux-lts-tresor.preset
-> Found linux-lts-tresor.install
-> Found change-default-console-loglevel.patch
-> Found 0001-Bluetooth-allocate-static-minor-for-vhci.patch
-> Found 0002-module-allow-multiple-calls-to-MODULE_DEVICE_TABLE-p.patch
-> Found 0003-module-remove-MODULE_GENERIC_TABLE.patch
-> Found 0006-genksyms-fix-typeof-handling.patch
-> Found tresor_sysfs.c
-> Found tresor-patch-3.6.2_i686
-> Found tresor-patch-3.6.2_i686.patch
-> Found tresor-patch-3.6.2_i686.patch.sig
-> Found patch-3.14.28.sign
-> Found config
-> Found config.x86_64
-> Found linux-lts-tresor.preset
-> Found linux-lts-tresor.install
-> Found change-default-console-loglevel.patch
-> Found 0001-Bluetooth-allocate-static-minor-for-vhci.patch
-> Found 0002-module-allow-multiple-calls-to-MODULE_DEVICE_TABLE-p.patch
-> Found 0003-module-remove-MODULE_GENERIC_TABLE.patch
-> Found 0006-genksyms-fix-typeof-handling.patch
-> Found tresor_sysfs.c
-> Found tresor-patch-3.8.2_aesni
-> Found tresor-patch-3.8.2_aesni.patch
-> Found tresor-patch-3.8.2_aesni.patch.sig
-> Found patch-3.14.28.sign
-> Found config
-> Found config.x86_64
-> Found linux-lts-tresor.preset
-> Found linux-lts-tresor.install
-> Found change-default-console-loglevel.patch
-> Found 0001-Bluetooth-allocate-static-minor-for-vhci.patch
-> Found 0002-module-allow-multiple-calls-to-MODULE_DEVICE_TABLE-p.patch
-> Found 0003-module-remove-MODULE_GENERIC_TABLE.patch
-> Found 0006-genksyms-fix-typeof-handling.patch
-> Found tresor_sysfs.c
==> Validating source files with sha256sums...
linux-3.14.tar.xz ... Passed
linux-3.14.tar.sign ... Skipped
patch-3.14.28.xz ... Passed
patch-3.14.28.sign ... Skipped
config ... Passed
config.x86_64 ... Passed
linux-lts-tresor.preset ... Passed
linux-lts-tresor.install ... Passed
change-default-console-loglevel.patch ... Passed
0001-Bluetooth-allocate-static-minor-for-vhci.patch ... Passed
0002-module-allow-multiple-calls-to-MODULE_DEVICE_TABLE-p.patch ... Passed
0003-module-remove-MODULE_GENERIC_TABLE.patch ... Passed
0006-genksyms-fix-typeof-handling.patch ... Passed
tresor_sysfs.c ... Passed
==> Validating source files with sha256sums...
tresor-patch-3.6.2_i686 ... Passed
tresor-patch-3.6.2_i686.patch ... Passed
tresor-patch-3.6.2_i686.patch.sig ... Skipped
==> Validating source files with sha256sums...
tresor-patch-3.8.2_aesni ... Passed
tresor-patch-3.8.2_aesni.patch ... Passed
tresor-patch-3.8.2_aesni.patch.sig ... Skipped
==> Verifying source file signatures with gpg...
linux-3.14.tar ... Passed
patch-3.14.28 ... Passed
tresor-patch-3.6.2_i686.patch ... Passed
patch-3.14.28 ... Passed
tresor-patch-3.8.2_aesni.patch ... Passed
patch-3.14.28 ... Passed
==> Entering fakeroot environment...
==> Creating source package...
-> Adding PKGBUILD...
-> Generating .SRCINFO file...
-> Adding config...
-> Adding config.x86_64...
-> Adding linux-lts-tresor.preset...
-> Adding linux-lts-tresor.install...
-> Adding change-default-console-loglevel.patch...
-> Adding 0001-Bluetooth-allocate-static-minor-for-vhci.patch...
-> Adding 0002-module-allow-multiple-calls-to-MODULE_DEVICE_TABLE-p.patch...
-> Adding 0003-module-remove-MODULE_GENERIC_TABLE.patch...
-> Adding 0006-genksyms-fix-typeof-handling.patch...
-> Adding tresor-patch-3.6.2_i686.patch...
-> Adding tresor-patch-3.6.2_i686.patch.sig...
-> Adding config...
ln: failed to create symbolic link ‘/home/claire/Builds/linux-lts-tresor/srclinks.Qb2SC9gzL/linux-lts-tresor/config’: File exists
-> Adding config.x86_64...
ln: failed to create symbolic link ‘/home/claire/Builds/linux-lts-tresor/srclinks.Qb2SC9gzL/linux-lts-tresor/config.x86_64’: File exists
-> Adding linux-lts-tresor.preset...
ln: failed to create symbolic link ‘/home/claire/Builds/linux-lts-tresor/srclinks.Qb2SC9gzL/linux-lts-tresor/linux-lts-tresor.preset’: File exists
-> Adding linux-lts-tresor.install...
ln: failed to create symbolic link ‘/home/claire/Builds/linux-lts-tresor/srclinks.Qb2SC9gzL/linux-lts-tresor/linux-lts-tresor.install’: File exists
-> Adding change-default-console-loglevel.patch...
ln: failed to create symbolic link ‘/home/claire/Builds/linux-lts-tresor/srclinks.Qb2SC9gzL/linux-lts-tresor/change-default-console-loglevel.patch’: File exists
-> Adding 0001-Bluetooth-allocate-static-minor-for-vhci.patch...
ln: failed to create symbolic link ‘/home/claire/Builds/linux-lts-tresor/srclinks.Qb2SC9gzL/linux-lts-tresor/0001-Bluetooth-allocate-static-minor-for-vhci.patch’: File exists
-> Adding 0002-module-allow-multiple-calls-to-MODULE_DEVICE_TABLE-p.patch...
ln: failed to create symbolic link ‘/home/claire/Builds/linux-lts-tresor/srclinks.Qb2SC9gzL/linux-lts-tresor/0002-module-allow-multiple-calls-to-MODULE_DEVICE_TABLE-p.patch’: File exists
-> Adding 0003-module-remove-MODULE_GENERIC_TABLE.patch...
ln: failed to create symbolic link ‘/home/claire/Builds/linux-lts-tresor/srclinks.Qb2SC9gzL/linux-lts-tresor/0003-module-remove-MODULE_GENERIC_TABLE.patch’: File exists
-> Adding 0006-genksyms-fix-typeof-handling.patch...
ln: failed to create symbolic link ‘/home/claire/Builds/linux-lts-tresor/srclinks.Qb2SC9gzL/linux-lts-tresor/0006-genksyms-fix-typeof-handling.patch’: File exists
-> Adding tresor-patch-3.8.2_aesni.patch...
-> Adding tresor-patch-3.8.2_aesni.patch.sig...
-> Adding config...
ln: failed to create symbolic link ‘/home/claire/Builds/linux-lts-tresor/srclinks.Qb2SC9gzL/linux-lts-tresor/config’: File exists
-> Adding config.x86_64...
ln: failed to create symbolic link ‘/home/claire/Builds/linux-lts-tresor/srclinks.Qb2SC9gzL/linux-lts-tresor/config.x86_64’: File exists
-> Adding linux-lts-tresor.preset...
ln: failed to create symbolic link ‘/home/claire/Builds/linux-lts-tresor/srclinks.Qb2SC9gzL/linux-lts-tresor/linux-lts-tresor.preset’: File exists
-> Adding linux-lts-tresor.install...
ln: failed to create symbolic link ‘/home/claire/Builds/linux-lts-tresor/srclinks.Qb2SC9gzL/linux-lts-tresor/linux-lts-tresor.install’: File exists
-> Adding change-default-console-loglevel.patch...
ln: failed to create symbolic link ‘/home/claire/Builds/linux-lts-tresor/srclinks.Qb2SC9gzL/linux-lts-tresor/change-default-console-loglevel.patch’: File exists
-> Adding 0001-Bluetooth-allocate-static-minor-for-vhci.patch...
ln: failed to create symbolic link ‘/home/claire/Builds/linux-lts-tresor/srclinks.Qb2SC9gzL/linux-lts-tresor/0001-Bluetooth-allocate-static-minor-for-vhci.patch’: File exists
-> Adding 0002-module-allow-multiple-calls-to-MODULE_DEVICE_TABLE-p.patch...
ln: failed to create symbolic link ‘/home/claire/Builds/linux-lts-tresor/srclinks.Qb2SC9gzL/linux-lts-tresor/0002-module-allow-multiple-calls-to-MODULE_DEVICE_TABLE-p.patch’: File exists
-> Adding 0003-module-remove-MODULE_GENERIC_TABLE.patch...
ln: failed to create symbolic link ‘/home/claire/Builds/linux-lts-tresor/srclinks.Qb2SC9gzL/linux-lts-tresor/0003-module-remove-MODULE_GENERIC_TABLE.patch’: File exists
-> Adding 0006-genksyms-fix-typeof-handling.patch...
ln: failed to create symbolic link ‘/home/claire/Builds/linux-lts-tresor/srclinks.Qb2SC9gzL/linux-lts-tresor/0006-genksyms-fix-typeof-handling.patch’: File exists
-> Compressing source package...
==> Leaving fakeroot environment.
==> Source package created: linux-lts-tresor (Fri 9 Jan 10:51:25 GMT 2015)
Here is the PKGBUILD:
# Maintainers:
# Claire Farron <[email protected]>
# Andes Ho <[email protected]> (Secondary Package Tester)
# Former Maintainer(s)
# Ido Rosen <[email protected]>
# xerc <aur[at]xerc.de>
# Contributor: tresor-patch-3.6.2_i686.patch and consolidation of patches
# Seth Dickson <[email protected]>
# Contributor(s) of the linux PKGBUILD
# Tobias Powalowski <[email protected]>
# Thomas Baechler <[email protected]>
### Do not edit below this line unless you know what you're doing
pkgbase=linux-lts-tresor # Build stock -lts kernel with TRESOR patches
#pkgbase=linux-custom # Build kernel with a different name
_srcname=linux-3.14
pkgname=linux-lts-tresor # placeholder
pkgdesc="Linux longterm stable kernel and modules with integrated TRESOR"
pkgver=3.14.28
pkgrel=1
arch=('i686' 'x86_64')
url="http://www1.informatik.uni-erlangen.de/tresor"
license=('GPL2')
makedepends=('xmlto' 'docbook-xsl' 'kmod' 'inetutils' 'bc')
options=('!strip')
source=("https://www.kernel.org/pub/linux/kernel/v3.x/${_srcname}.tar.xz"
"https://www.kernel.org/pub/linux/kernel/v3.x/${_srcname}.tar.sign"
"https://www.kernel.org/pub/linux/kernel/v3.x/patch-${pkgver}.xz"
"https://www.kernel.org/pub/linux/kernel/v3.x/patch-${pkgver}.sign"
# the main kernel config files
'config' 'config.x86_64'
# standard config files for mkinitcpio ramdisk
"${pkgbase}.preset"
"${pkgbase}.install"
'change-default-console-loglevel.patch'
'0001-Bluetooth-allocate-static-minor-for-vhci.patch'
'0002-module-allow-multiple-calls-to-MODULE_DEVICE_TABLE-p.patch'
'0003-module-remove-MODULE_GENERIC_TABLE.patch'
'0006-genksyms-fix-typeof-handling.patch'
'http://www1.informatik.uni-erlangen.de/filepool/projects/tresor/tresor_sysfs.c')
source_i686+=("http://www1.informatik.uni-erlangen.de/filepool/projects/tresor/tresor-patch-3.6.2_i686"
'tresor-patch-3.6.2_i686.patch'
'tresor-patch-3.6.2_i686.patch.sig')
source_x86_64+=("http://www1.informatik.uni-erlangen.de/filepool/projects/tresor/tresor-patch-3.8.2_aesni"
'tresor-patch-3.8.2_aesni.patch'
'tresor-patch-3.8.2_aesni.patch.sig')
sha256sums=('61558aa490855f42b6340d1a1596be47454909629327c49a5e4e10268065dffa'
'SKIP'
'e3c79a30ac959c84c329be5461da88a5c79c6463da30d376c27bb103aee79b51'
'SKIP'
'6291d78969d8db94525d9614fa15c6a5db97b070af50d84f68d32ecd5f40fd69'
'145a66ef4f702ed516a57d846dd00b5acac7b5cc1eff86d1e7ee6bd5a66040b2'
'003b45593f1b5cdb81ea2da6ab67deef04402eb15aae231921ff55f65948fbdd'
'edb6d4ed9ca2af1ffc15ddbf195152c219e77bd12da3ea176c5c24afc0a779d4'
'faced4eb4c47c4eb1a9ee8a5bf8a7c4b49d6b4d78efbe426e410730e6267d182'
'6d72e14552df59e6310f16c176806c408355951724cd5b48a47bf01591b8be02'
'52dec83a8805a8642d74d764494acda863e0aa23e3d249e80d4b457e20a3fd29'
'65d58f63215ee3c5f9c4fc6bce36fc5311a6c7dbdbe1ad29de40647b47ff9c0d'
'cf2e7a2d00787f754028e7459688c2755a406e632ce48b60952fa4ff7ed6f4b7'
'd6fcbd0ea7a5a4c42d326286b60bbd5b1d476b8a6752046fa28133e05351c1fe')
sha256sums_i686=('9a286a85c16ca5b6a02419af1aedbfe6e8b89bcabdcb32670ead3f26c09eadfd'
'2fb8c26e237883f39de57a264873b21bcdfc5b6b0c1e7c60cec8d141e5db33ba'
'SKIP')
sha256sums_x86_64=('54009b369b95a77ab13f6dd7cdbe22b0785b6314cae3a6c39190b48f4c4b12ce'
'6d0580f05db9cf47dd097326c2f3c0e493854493544d32692ab63290e12fc3e1'
'SKIP')
validpgpkeys=(
'ABAF11C65A2970B130ABE3C479BE3E4300411886' # Linux Torvalds
'647F28654894E3BD457199BE38DBBDC86092693E' # Greg Kroah-Hartman
'5F885602C7FD0951F565E27949F67298E6366A92' # Claire Farron
[[ "$CARCH" = "i686" ]] && _tresorpatch="tresor-patch-3.6.2_i686"
[[ "$CARCH" = "x86_64" ]] && _tresorpatch="tresor-patch-3.8.2_aesni"
_kernelname=${pkgbase#linux}
prepare() {
cd "${srcdir}/${_srcname}"
# add upstream patch
patch -p1 -i "${srcdir}/patch-${pkgver}"
# add latest fixes from stable queue, if needed
# http://git.kernel.org/?p=linux/kernel/git/stable/stable-queue.git
# set DEFAULT_CONSOLE_LOGLEVEL to 4 (same value as the 'quiet' kernel param)
# remove this when a Kconfig knob is made available by upstream
# (relevant patch sent upstream: https://lkml.org/lkml/2011/7/26/227)
patch -p1 -i "${srcdir}/change-default-console-loglevel.patch"
# Fix vhci warning in kmod (to restore every kernel maintainer's sanity)
msg "Patching source to fix vhci warning in kmod"
patch -p1 -i "${srcdir}/0001-Bluetooth-allocate-static-minor-for-vhci.patch"
# Fix atkbd aliases
msg "Patching source to fix atkbd aliases"
patch -p1 -i "${srcdir}/0002-module-allow-multiple-calls-to-MODULE_DEVICE_TABLE-p.patch"
patch -p1 -i "${srcdir}/0003-module-remove-MODULE_GENERIC_TABLE.patch"
# Fix generation of symbol CRCs
# http://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=dc53324060f324e8af6867f57bf4891c13c6ef18
msg "Patching source to fix generation of symbol CRCs"
patch -p1 -i "${srcdir}/0006-genksyms-fix-typeof-handling.patch"
# TRESOR Runs Encryption Securely Outside RAM
# i.e. the purpose of this package :-)
msg "Patching TRESOR for linux"
# Initialized the patched TRESOR file with the upstream patch.
cp "${srcdir}/${_tresorpatch}" "${_tresorpatch}.patched"
patch --follow-symlinks "${_tresorpatch}.patched" "${srcdir}/${_tresorpatch}.patch"
msg "Patching source with TRESOR"
patch -p1 -i "${_tresorpatch}.patched"
if [ "${CARCH}" = "x86_64" ]; then
cat "${srcdir}/config.x86_64" > ./.config
else
cat "${srcdir}/config" > ./.config
fi
if [ "${_kernelname}" != "" ]; then
sed -i "s|CONFIG_LOCALVERSION=.*|CONFIG_LOCALVERSION=\"${_kernelname}\"|g" ./.config
sed -i "s|CONFIG_LOCALVERSION_AUTO=.*|CONFIG_LOCALVERSION_AUTO=n|" ./.config
fi
# set extraversion to pkgrel
sed -ri "s|^(EXTRAVERSION =).*|\1 -${pkgrel}|" Makefile
# don't run depmod on 'make install'. We'll do this ourselves in packaging
sed -i '2iexit 0' scripts/depmod.sh
cd "${srcdir}"
cc tresor_sysfs.c -o tresor_sysfs
cd "${srcdir}/${_srcname}"
# get kernel version
make prepare
# load configuration
# Configure the kernel. Replace the line below with one of your choice.
#make menuconfig # CLI menu for configuration
#make nconfig # new CLI menu for configuration
#make xconfig # X-based configuration
#make oldconfig # using old config from previous kernel version
# ... or manually edit .config
# rewrite configuration
#yes "" | make config >/dev/null
make oldconfig
# save configuration for later reuse
# if [ "${CARCH}" = "x86_64" ]; then
# cat .config > "${startdir}/config.x86_64.last"
# else
# cat .config > "${startdir}/config.last"
# fi
build() {
cd "${srcdir}/${_srcname}"
make ${MAKEFLAGS} LOCALVERSION= bzImage modules
_package() {
true && pkgdesc="The ${pkgbase/linux/Linux} kernel and modules - stable longtime supported with integrated TRESOR"
depends=('coreutils' 'linux-firmware' 'kmod' 'mkinitcpio>=0.7')
optdepends=('crda: to set the correct wireless channels of your country')
provides=("kernel26${_kernelname}=${pkgver}")
conflicts=("kernel26${_kernelname}")
replaces=("kernel26${_kernelname}")
backup=("etc/mkinitcpio.d/${pkgbase}.preset")
install=${pkgbase}.install
# TRESOR sysfs utility - not necessary but nice to have, in case someone
# enables CONFIG_TRESOR_SYSFS in a fork of this PKGBUILD...
cd "${srcdir}"
install -D -m755 tresor_sysfs "${pkgdir}/usr/bin/tresor_sysfs"
cd "${srcdir}/${_srcname}"
KARCH=x86
# get kernel version
_kernver="$(make LOCALVERSION= kernelrelease)"
_basekernel=${_kernver%%-*}
_basekernel=${_basekernel%.*}
mkdir -p "${pkgdir}"/{lib/modules,lib/firmware,boot}
make LOCALVERSION= INSTALL_MOD_PATH="${pkgdir}" modules_install
cp arch/$KARCH/boot/bzImage "${pkgdir}/boot/vmlinuz-${pkgbase}"
# set correct depmod command for install
cp -f "${startdir}/${install}" "${startdir}/${install}.pkg"
true && install=${install}.pkg
sed \
-e "s/KERNEL_NAME=.*/KERNEL_NAME=${_kernelname}/" \
-e "s/KERNEL_VERSION=.*/KERNEL_VERSION=${_kernver}/" \
-i "${startdir}/${install}"
# install mkinitcpio preset file for kernel
install -D -m644 "${srcdir}/${pkgbase}.preset" \
"${pkgdir}/etc/mkinitcpio.d/${pkgbase}.preset"
sed \
-e "1s|'linux.*'|'${pkgbase}'|" \
-e "s|ALL_kver=.*|ALL_kver=\"/boot/vmlinuz-${pkgbase}\"|" \
-e "s|default_image=.*|default_image=\"/boot/initramfs-${pkgbase}.img\"|" \
-e "s|fallback_image=.*|fallback_image=\"/boot/initramfs-${pkgbase}-fallback.img\"|" \
-i "${pkgdir}/etc/mkinitcpio.d/${pkgbase}.preset"
# remove build and source links
rm -f "${pkgdir}"/lib/modules/${_kernver}/{source,build}
# remove the firmware
rm -rf "${pkgdir}/lib/firmware"
# gzip -9 all modules to save 100MB of space
find "${pkgdir}" -name '*.ko' -exec gzip -9 {} \;
# make room for external modules
ln -s "../extramodules-${_basekernel}${_kernelname:--ARCH}" \
"${pkgdir}/lib/modules/${_kernver}/extramodules"
# add real version for building modules and running depmod from post_install/upgrade
mkdir -p "${pkgdir}/lib/modules/extramodules-${_basekernel}${_kernelname:--ARCH}"
echo "${_kernver}" > \
"${pkgdir}/lib/modules/extramodules-${_basekernel}${_kernelname:--ARCH}/version"
# Now we call depmod...
depmod -b "${pkgdir}" -F System.map "${_kernver}"
# move module tree /lib -> /usr/lib
mkdir -p "${pkgdir}/usr"
mv "${pkgdir}/lib" "${pkgdir}/usr/"
# add vmlinux
install -D -m644 vmlinux "${pkgdir}/usr/lib/modules/${_kernver}/build/vmlinux"
_package-headers() {
true && pkgdesc="Header files and scripts for building modules for ${pkgbase/linux/Linux} kernel"
provides=("kernel26${_kernelname}-headers=${pkgver}")
conflicts=("kernel26${_kernelname}-headers")
replaces=("kernel26${_kernelname}-headers")
install -dm755 "${pkgdir}/usr/lib/modules/${_kernver}"
cd "${srcdir}/${_srcname}"
install -D -m644 Makefile \
"${pkgdir}/usr/lib/modules/${_kernver}/build/Makefile"
install -D -m644 kernel/Makefile \
"${pkgdir}/usr/lib/modules/${_kernver}/build/kernel/Makefile"
install -D -m644 .config \
"${pkgdir}/usr/lib/modules/${_kernver}/build/.config"
mkdir -p "${pkgdir}/usr/lib/modules/${_kernver}/build/include"
for i in acpi asm-generic config crypto drm generated keys linux math-emu \
media net pcmcia scsi sound trace uapi video xen; do
cp -a include/${i} "${pkgdir}/usr/lib/modules/${_kernver}/build/include/"
done
# copy arch includes for external modules
mkdir -p "${pkgdir}/usr/lib/modules/${_kernver}/build/arch/x86"
cp -a arch/x86/include "${pkgdir}/usr/lib/modules/${_kernver}/build/arch/x86/"
# copy files necessary for later builds, like nvidia and vmware
cp Module.symvers "${pkgdir}/usr/lib/modules/${_kernver}/build"
cp -a scripts "${pkgdir}/usr/lib/modules/${_kernver}/build"
# fix permissions on scripts dir
chmod og-w -R "${pkgdir}/usr/lib/modules/${_kernver}/build/scripts"
mkdir -p "${pkgdir}/usr/lib/modules/${_kernver}/build/.tmp_versions"
mkdir -p "${pkgdir}/usr/lib/modules/${_kernver}/build/arch/${KARCH}/kernel"
cp arch/${KARCH}/Makefile "${pkgdir}/usr/lib/modules/${_kernver}/build/arch/${KARCH}/"
if [ "${CARCH}" = "i686" ]; then
cp arch/${KARCH}/Makefile_32.cpu \
"${pkgdir}/usr/lib/modules/${_kernver}/build/arch/${KARCH}/"
fi
cp arch/${KARCH}/kernel/asm-offsets.s \
"${pkgdir}/usr/lib/modules/${_kernver}/build/arch/${KARCH}/kernel/"
# add docbook makefile
install -D -m644 Documentation/DocBook/Makefile \
"${pkgdir}/usr/lib/modules/${_kernver}/build/Documentation/DocBook/Makefile"
# add dm headers
mkdir -p "${pkgdir}/usr/lib/modules/${_kernver}/build/drivers/md"
cp drivers/md/*.h "${pkgdir}/usr/lib/modules/${_kernver}/build/drivers/md"
# add inotify.h
mkdir -p "${pkgdir}/usr/lib/modules/${_kernver}/build/include/linux"
cp include/linux/inotify.h "${pkgdir}/usr/lib/modules/${_kernver}/build/include/linux/"
# add wireless headers
mkdir -p "${pkgdir}/usr/lib/modules/${_kernver}/build/net/mac80211/"
cp net/mac80211/*.h "${pkgdir}/usr/lib/modules/${_kernver}/build/net/mac80211/"
# add dvb headers for external modules
# in reference to:
# http://bugs.archlinux.org/task/9912
mkdir -p "${pkgdir}/usr/lib/modules/${_kernver}/build/drivers/media/dvb-core"
cp drivers/media/dvb-core/*.h \
"${pkgdir}/usr/lib/modules/${_kernver}/build/drivers/media/dvb-core/"
# and...
# http://bugs.archlinux.org/task/11194
mkdir -p "${pkgdir}/usr/lib/modules/${_kernver}/build/include/config/dvb/"
cp include/config/dvb/*.h \
"${pkgdir}/usr/lib/modules/${_kernver}/build/include/config/dvb/"
# add dvb headers for http://mcentral.de/hg/~mrec/em28xx-new
# in reference to:
# http://bugs.archlinux.org/task/13146
mkdir -p "${pkgdir}/usr/lib/modules/${_kernver}/build/drivers/media/dvb-frontends/"
cp drivers/media/dvb-frontends/lgdt330x.h \
"${pkgdir}/usr/lib/modules/${_kernver}/build/drivers/media/dvb-frontends/"
mkdir -p "${pkgdir}/usr/lib/modules/${_kernver}/build/drivers/media/i2c/"
cp drivers/media/i2c/msp3400-driver.h \
"${pkgdir}/usr/lib/modules/${_kernver}/build/drivers/media/i2c/"
# add dvb headers
# in reference to:
# http://bugs.archlinux.org/task/20402
mkdir -p "${pkgdir}/usr/lib/modules/${_kernver}/build/drivers/media/usb/dvb-usb"
cp drivers/media/usb/dvb-usb/*.h \
"${pkgdir}/usr/lib/modules/${_kernver}/build/drivers/media/usb/dvb-usb/"
mkdir -p "${pkgdir}/usr/lib/modules/${_kernver}/build/drivers/media/dvb-frontends"
cp drivers/media/dvb-frontends/*.h \
"${pkgdir}/usr/lib/modules/${_kernver}/build/drivers/media/dvb-frontends/"
mkdir -p "${pkgdir}/usr/lib/modules/${_kernver}/build/drivers/media/tuners"
cp drivers/media/tuners/*.h \
"${pkgdir}/usr/lib/modules/${_kernver}/build/drivers/media/tuners/"
# add xfs and shmem for aufs building
mkdir -p "${pkgdir}/usr/lib/modules/${_kernver}/build/fs/xfs"
mkdir -p "${pkgdir}/usr/lib/modules/${_kernver}/build/mm"
cp fs/xfs/xfs_sb.h "${pkgdir}/usr/lib/modules/${_kernver}/build/fs/xfs/xfs_sb.h"
# copy in Kconfig files
for i in $(find . -name "Kconfig*"); do
mkdir -p "${pkgdir}"/usr/lib/modules/${_kernver}/build/`echo ${i} | sed 's|/Kconfig.*||'`
cp ${i} "${pkgdir}/usr/lib/modules/${_kernver}/build/${i}"
done
chown -R root.root "${pkgdir}/usr/lib/modules/${_kernver}/build"
find "${pkgdir}/usr/lib/modules/${_kernver}/build" -type d -exec chmod 755 {} \;
# strip scripts directory
find "${pkgdir}/usr/lib/modules/${_kernver}/build/scripts" -type f -perm -u+w 2>/dev/null | while read binary ; do
case "$(file -bi "${binary}")" in
*application/x-sharedlib*) # Libraries (.so)
/usr/bin/strip ${STRIP_SHARED} "${binary}";;
*application/x-archive*) # Libraries (.a)
/usr/bin/strip ${STRIP_STATIC} "${binary}";;
*application/x-executable*) # Binaries
/usr/bin/strip ${STRIP_BINARIES} "${binary}";;
esac
done
# remove unneeded architectures
rm -rf "${pkgdir}"/usr/lib/modules/${_kernver}/build/arch/{alpha,arc,arm,arm26,arm64,avr32,blackfin,c6x,cris,frv,h8300,hexagon,ia64,m32r,m68k,m68knommu,metag,mips,microblaze,mn10300,openrisc,parisc,powerpc,ppc,s390,score,sh,sh64,sparc,sparc64,tile,unicore32,um,v850,xtensa}
_package-docs() {
true && pkgdesc="Kernel hackers manual - HTML documentation that comes with the ${pkgbase/linux/Linux} kernel"
provides=("kernel26${_kernelname}-docs=${pkgver}")
conflicts=("kernel26${_kernelname}-docs")
replaces=("kernel26${_kernelname}-docs")
cd "${srcdir}/${_srcname}"
mkdir -p "${pkgdir}/usr/lib/modules/${_kernver}/build"
cp -al Documentation "${pkgdir}/usr/lib/modules/${_kernver}/build"
find "${pkgdir}" -type f -exec chmod 444 {} \;
find "${pkgdir}" -type d -exec chmod 755 {} \;
# remove a file already in linux package
rm -f "${pkgdir}/usr/lib/modules/${_kernver}/build/Documentation/DocBook/Makefile"
# true && is a workaround for AUR problem with split packages:
true && pkgname=("${pkgbase}" "${pkgbase}-headers" "${pkgbase}-docs")
for _p in ${pkgname[@]}; do
eval "package_${_p}() {
_package${_p#${pkgbase}}
done
EDIT: Here is the resulting source tarball for mkaurball.
Last edited by clfarron4 (2015-01-12 09:37:11)OK, so either I'm committing a huge stupid with both TRESOR packages or there is actually a problem with makepkg. I've done similar changes with the linux-tresor PKGBUILD and it's doing the same thing.
PKGBUILD:
# Maintainers:
# Claire Farron <[email protected]>
# Andes Ho <[email protected]> (Secondary Package Tester)
# Former Maintainer(s)
# Ido Rosen <[email protected]>
# xerc <aur[at]xerc.de>
# Contributor(s) of tresor-patch-3.6.2_i686.patch and consolidation of patches
# Seth Dickson <[email protected]>
# Contributor(s) of the linux PKGBUILD
# Tobias Powalowski <[email protected]>
# Thomas Baechler <[email protected]>
### Do not edit below this line unless you know what you're doing
pkgbase=linux-tresor # Build stock kernel with TRESOR patches
#pkgbase=linux-custom # Build kernel with a different name
_srcname=linux-3.18
pkgver=3.18.2
pkgrel=1
arch=('i686' 'x86_64')
url="http://www1.informatik.uni-erlangen.de/tresor"
license=('GPL2')
makedepends=('xmlto' 'docbook-xsl' 'kmod' 'inetutils' 'bc')
options=('!strip')
source=("https://www.kernel.org/pub/linux/kernel/v3.x/${_srcname}.tar.xz"
"https://www.kernel.org/pub/linux/kernel/v3.x/${_srcname}.tar.sign"
"https://www.kernel.org/pub/linux/kernel/v3.x/patch-${pkgver}.xz"
"https://www.kernel.org/pub/linux/kernel/v3.x/patch-${pkgver}.sign"
# the main kernel config files
'config' 'config.x86_64'
# standard config files for mkinitcpio ramdisk
"${pkgbase}.preset"
"${pkgbase}.install"
'change-default-console-loglevel.patch'
'http://www1.informatik.uni-erlangen.de/filepool/projects/tresor/tresor_sysfs.c')
source_i686+=("http://www1.informatik.uni-erlangen.de/filepool/projects/tresor/tresor-patch-3.6.2_i686"
'tresor-patch-3.6.2_i686.patch'
'tresor-patch-3.6.2_i686.patch.sig')
source_x86_64+=("http://www1.informatik.uni-erlangen.de/filepool/projects/tresor/tresor-patch-3.8.2_aesni"
'tresor-patch-3.8.2_aesni.patch'
'tresor-patch-3.8.2_aesni.patch.sig')
sha256sums=('becc413cc9e6d7f5cc52a3ce66d65c3725bc1d1cc1001f4ce6c32b69eb188cbd'
'SKIP'
'927a30c152a193d22242de21b99c9765fb0086b0aa3fabd31938ffc6e1b3f37c'
'SKIP'
'b0f867da9c07d778014c52afe2df59b86122b0d4de2ea8003303855a0750e90d'
'b76fa6691c4ab19d11e346112e8c021c88578950ed19468f115905e74cb0495e'
'e17c0209dcb887173adbb4cc69fe0799b01ed9b9b7c487d1d023daa99ee073e1'
'390c0b348c0f42ba760587e9df3098c62a3b6bd5d522eefb51c7a18f29069751'
'1256b241cd477b265a3c2d64bdc19ffe3c9bbcee82ea3994c590c2c76e767d99'
'd6fcbd0ea7a5a4c42d326286b60bbd5b1d476b8a6752046fa28133e05351c1fe')
sha256sums_i686=('9a286a85c16ca5b6a02419af1aedbfe6e8b89bcabdcb32670ead3f26c09eadfd'
'800f592847d2a20679630491b8f657cb912abc65f9f2daecf804b6dc2f3b9352'
'SKIP')
sha256sums_x86_64=('54009b369b95a77ab13f6dd7cdbe22b0785b6314cae3a6c39190b48f4c4b12ce'
'9415840fe80f4e2f2b44c0762d8c650e5119fadc3cb494c4812406f6627f26c3'
'SKIP')
validpgpkeys=(
'ABAF11C65A2970B130ABE3C479BE3E4300411886' # Linux Torvalds
'647F28654894E3BD457199BE38DBBDC86092693E' # Greg Kroah-Hartman
'5F885602C7FD0951F565E27949F67298E6366A92' # Claire Farron
[[ "$CARCH" = "i686" ]] && _tresorpatch="tresor-patch-3.6.2_i686"
[[ "$CARCH" = "x86_64" ]] && _tresorpatch="tresor-patch-3.8.2_aesni"
_kernelname=${pkgbase#linux}
prepare() {
cd "${srcdir}/${_srcname}"
# add upstream patch
patch -p1 -i "${srcdir}/patch-${pkgver}"
# add latest fixes from stable queue, if needed
# http://git.kernel.org/?p=linux/kernel/git/stable/stable-queue.git
# set DEFAULT_CONSOLE_LOGLEVEL to 4 (same value as the 'quiet' kernel param)
# remove this when a Kconfig knob is made available by upstream
# (relevant patch sent upstream: https://lkml.org/lkml/2011/7/26/227)
patch -p1 -i "${srcdir}/change-default-console-loglevel.patch"
# TRESOR Runs Encryption Securely Outside RAM
# i.e. the purpose of this package :-)
msg "Patching TRESOR for linux"
# Initialized the patched TRESOR file with the upstream patch.
cp "${srcdir}/${_tresorpatch}" "${_tresorpatch}.patched"
patch --follow-symlinks "${_tresorpatch}.patched" "${srcdir}/${_tresorpatch}.patch"
msg "Patching source with TRESOR"
patch -p1 -i "${_tresorpatch}.patched"
if [ "${CARCH}" = "x86_64" ]; then
cat "${srcdir}/config.x86_64" > ./.config
else
cat "${srcdir}/config" > ./.config
fi
if [ "${_kernelname}" != "" ]; then
sed -i "s|CONFIG_LOCALVERSION=.*|CONFIG_LOCALVERSION=\"${_kernelname}\"|g" ./.config
sed -i "s|CONFIG_LOCALVERSION_AUTO=.*|CONFIG_LOCALVERSION_AUTO=n|" ./.config
fi
# set extraversion to pkgrel
sed -ri "s|^(EXTRAVERSION =).*|\1 -${pkgrel}|" Makefile
# don't run depmod on 'make install'. We'll do this ourselves in packaging
sed -i '2iexit 0' scripts/depmod.sh
cd "${srcdir}"
cc tresor_sysfs.c -o tresor_sysfs
cd "${srcdir}/${_srcname}"
# get kernel version
make prepare
# load configuration
# Configure the kernel. Replace the line below with one of your choice.
#make menuconfig # CLI menu for configuration
#make nconfig # new CLI menu for configuration
#make xconfig # X-based configuration
#make oldconfig # using old config from previous kernel version
# ... or manually edit .config
# rewrite configuration
#yes "" | make config >/dev/null
make oldconfig
# save configuration for later reuse
# if [ "${CARCH}" = "x86_64" ]; then
# cat .config > "${startdir}/config.x86_64.last"
# else
# cat .config > "${startdir}/config.last"
# fi
build() {
cd "${srcdir}/${_srcname}"
make ${MAKEFLAGS} LOCALVERSION= bzImage modules
_package() {
pkgdesc="The ${pkgbase/linux/Linux} kernel and modules with integrated TRESOR"
[ "${pkgbase}" = "linux" ] && groups=('base')
depends=('coreutils' 'linux-firmware' 'kmod' 'mkinitcpio>=0.7')
optdepends=('crda: to set the correct wireless channels of your country')
provides=("kernel26${_kernelname}=${pkgver}")
conflicts=("kernel26${_kernelname}")
replaces=("kernel26${_kernelname}")
backup=("etc/mkinitcpio.d/${pkgbase}.preset")
install=${pkgbase}.install
# TRESOR sysfs utility - not necessary but nice to have, in case someone
# enables CONFIG_TRESOR_SYSFS in a fork of this PKGBUILD...
cd "${srcdir}"
install -D -m755 tresor_sysfs "${pkgdir}/usr/bin/tresor_sysfs"
cd "${srcdir}/${_srcname}"
KARCH=x86
# get kernel version
_kernver="$(make LOCALVERSION= kernelrelease)"
_basekernel=${_kernver%%-*}
_basekernel=${_basekernel%.*}
mkdir -p "${pkgdir}"/{lib/modules,lib/firmware,boot}
make LOCALVERSION= INSTALL_MOD_PATH="${pkgdir}" modules_install
cp arch/$KARCH/boot/bzImage "${pkgdir}/boot/vmlinuz-${pkgbase}"
# set correct depmod command for install
cp -f "${startdir}/${install}" "${startdir}/${install}.pkg"
true && install=${install}.pkg
sed \
-e "s/KERNEL_NAME=.*/KERNEL_NAME=${_kernelname}/" \
-e "s/KERNEL_VERSION=.*/KERNEL_VERSION=${_kernver}/" \
-i "${startdir}/${install}"
# install mkinitcpio preset file for kernel
install -D -m644 "${srcdir}/${pkgbase}.preset" \
"${pkgdir}/etc/mkinitcpio.d/${pkgbase}.preset"
sed \
-e "1s|'linux.*'|'${pkgbase}'|" \
-e "s|ALL_kver=.*|ALL_kver=\"/boot/vmlinuz-${pkgbase}\"|" \
-e "s|default_image=.*|default_image=\"/boot/initramfs-${pkgbase}.img\"|" \
-e "s|fallback_image=.*|fallback_image=\"/boot/initramfs-${pkgbase}-fallback.img\"|" \
-i "${pkgdir}/etc/mkinitcpio.d/${pkgbase}.preset"
# remove build and source links
rm -f "${pkgdir}"/lib/modules/${_kernver}/{source,build}
# remove the firmware
rm -rf "${pkgdir}/lib/firmware"
# gzip -9 all modules to save 100MB of space
find "${pkgdir}" -name '*.ko' -exec gzip -9 {} \;
# make room for external modules
ln -s "../extramodules-${_basekernel}${_kernelname:--ARCH}" "${pkgdir}/lib/modules/${_kernver}/extramodules"
# add real version for building modules and running depmod from post_install/upgrade
mkdir -p "${pkgdir}/lib/modules/extramodules-${_basekernel}${_kernelname:--ARCH}"
echo "${_kernver}" > "${pkgdir}/lib/modules/extramodules-${_basekernel}${_kernelname:--ARCH}/version"
# Now we call depmod...
depmod -b "${pkgdir}" -F System.map "${_kernver}"
# move module tree /lib -> /usr/lib
mkdir -p "${pkgdir}/usr"
mv "${pkgdir}/lib" "${pkgdir}/usr/"
# add vmlinux
install -D -m644 vmlinux "${pkgdir}/usr/lib/modules/${_kernver}/build/vmlinux"
_package-headers() {
pkgdesc="Header files and scripts for building modules for ${pkgbase/linux/Linux} kernel"
provides=("kernel26${_kernelname}-headers=${pkgver}")
conflicts=("kernel26${_kernelname}-headers")
replaces=("kernel26${_kernelname}-headers")
install -dm755 "${pkgdir}/usr/lib/modules/${_kernver}"
cd "${srcdir}/${_srcname}"
install -D -m644 Makefile \
"${pkgdir}/usr/lib/modules/${_kernver}/build/Makefile"
install -D -m644 kernel/Makefile \
"${pkgdir}/usr/lib/modules/${_kernver}/build/kernel/Makefile"
install -D -m644 .config \
"${pkgdir}/usr/lib/modules/${_kernver}/build/.config"
mkdir -p "${pkgdir}/usr/lib/modules/${_kernver}/build/include"
for i in acpi asm-generic config crypto drm generated keys linux math-emu \
media net pcmcia scsi sound trace uapi video xen; do
cp -a include/${i} "${pkgdir}/usr/lib/modules/${_kernver}/build/include/"
done
# copy arch includes for external modules
mkdir -p "${pkgdir}/usr/lib/modules/${_kernver}/build/arch/x86"
cp -a arch/x86/include "${pkgdir}/usr/lib/modules/${_kernver}/build/arch/x86/"
# copy files necessary for later builds, like nvidia and vmware
cp Module.symvers "${pkgdir}/usr/lib/modules/${_kernver}/build"
cp -a scripts "${pkgdir}/usr/lib/modules/${_kernver}/build"
# fix permissions on scripts dir
chmod og-w -R "${pkgdir}/usr/lib/modules/${_kernver}/build/scripts"
mkdir -p "${pkgdir}/usr/lib/modules/${_kernver}/build/.tmp_versions"
mkdir -p "${pkgdir}/usr/lib/modules/${_kernver}/build/arch/${KARCH}/kernel"
cp arch/${KARCH}/Makefile "${pkgdir}/usr/lib/modules/${_kernver}/build/arch/${KARCH}/"
if [ "${CARCH}" = "i686" ]; then
cp arch/${KARCH}/Makefile_32.cpu "${pkgdir}/usr/lib/modules/${_kernver}/build/arch/${KARCH}/"
fi
cp arch/${KARCH}/kernel/asm-offsets.s "${pkgdir}/usr/lib/modules/${_kernver}/build/arch/${KARCH}/kernel/"
# add docbook makefile
install -D -m644 Documentation/DocBook/Makefile \
"${pkgdir}/usr/lib/modules/${_kernver}/build/Documentation/DocBook/Makefile"
# add dm headers
mkdir -p "${pkgdir}/usr/lib/modules/${_kernver}/build/drivers/md"
cp drivers/md/*.h "${pkgdir}/usr/lib/modules/${_kernver}/build/drivers/md"
# add inotify.h
mkdir -p "${pkgdir}/usr/lib/modules/${_kernver}/build/include/linux"
cp include/linux/inotify.h "${pkgdir}/usr/lib/modules/${_kernver}/build/include/linux/"
# add wireless headers
mkdir -p "${pkgdir}/usr/lib/modules/${_kernver}/build/net/mac80211/"
cp net/mac80211/*.h "${pkgdir}/usr/lib/modules/${_kernver}/build/net/mac80211/"
# add dvb headers for external modules
# in reference to:
# http://bugs.archlinux.org/task/9912
mkdir -p "${pkgdir}/usr/lib/modules/${_kernver}/build/drivers/media/dvb-core"
cp drivers/media/dvb-core/*.h "${pkgdir}/usr/lib/modules/${_kernver}/build/drivers/media/dvb-core/"
# and...
# http://bugs.archlinux.org/task/11194
mkdir -p "${pkgdir}/usr/lib/modules/${_kernver}/build/include/config/dvb/"
cp include/config/dvb/*.h "${pkgdir}/usr/lib/modules/${_kernver}/build/include/config/dvb/"
# add dvb headers for http://mcentral.de/hg/~mrec/em28xx-new
# in reference to:
# http://bugs.archlinux.org/task/13146
mkdir -p "${pkgdir}/usr/lib/modules/${_kernver}/build/drivers/media/dvb-frontends/"
cp drivers/media/dvb-frontends/lgdt330x.h "${pkgdir}/usr/lib/modules/${_kernver}/build/drivers/media/dvb-frontends/"
mkdir -p "${pkgdir}/usr/lib/modules/${_kernver}/build/drivers/media/i2c/"
cp drivers/media/i2c/msp3400-driver.h "${pkgdir}/usr/lib/modules/${_kernver}/build/drivers/media/i2c/"
# add dvb headers
# in reference to:
# http://bugs.archlinux.org/task/20402
mkdir -p "${pkgdir}/usr/lib/modules/${_kernver}/build/drivers/media/usb/dvb-usb"
cp drivers/media/usb/dvb-usb/*.h "${pkgdir}/usr/lib/modules/${_kernver}/build/drivers/media/usb/dvb-usb/"
mkdir -p "${pkgdir}/usr/lib/modules/${_kernver}/build/drivers/media/dvb-frontends"
cp drivers/media/dvb-frontends/*.h "${pkgdir}/usr/lib/modules/${_kernver}/build/drivers/media/dvb-frontends/"
mkdir -p "${pkgdir}/usr/lib/modules/${_kernver}/build/drivers/media/tuners"
cp drivers/media/tuners/*.h "${pkgdir}/usr/lib/modules/${_kernver}/build/drivers/media/tuners/"
# add xfs and shmem for aufs building
mkdir -p "${pkgdir}/usr/lib/modules/${_kernver}/build/fs/xfs"
mkdir -p "${pkgdir}/usr/lib/modules/${_kernver}/build/mm"
# removed in 3.17 series
# cp fs/xfs/xfs_sb.h "${pkgdir}/usr/lib/modules/${_kernver}/build/fs/xfs/xfs_sb.h"
# copy in Kconfig files
for i in $(find . -name "Kconfig*"); do
mkdir -p "${pkgdir}"/usr/lib/modules/${_kernver}/build/`echo ${i} | sed 's|/Kconfig.*||'`
cp ${i} "${pkgdir}/usr/lib/modules/${_kernver}/build/${i}"
done
chown -R root.root "${pkgdir}/usr/lib/modules/${_kernver}/build"
find "${pkgdir}/usr/lib/modules/${_kernver}/build" -type d -exec chmod 755 {} \;
# strip scripts directory
find "${pkgdir}/usr/lib/modules/${_kernver}/build/scripts" -type f -perm -u+w 2>/dev/null | while read binary ; do
case "$(file -bi "${binary}")" in
*application/x-sharedlib*) # Libraries (.so)
/usr/bin/strip ${STRIP_SHARED} "${binary}";;
*application/x-archive*) # Libraries (.a)
/usr/bin/strip ${STRIP_STATIC} "${binary}";;
*application/x-executable*) # Binaries
/usr/bin/strip ${STRIP_BINARIES} "${binary}";;
esac
done
# remove unneeded architectures
rm -rf "${pkgdir}"/usr/lib/modules/${_kernver}/build/arch/{alpha,arc,arm,arm26,arm64,avr32,blackfin,c6x,cris,frv,h8300,hexagon,ia64,m32r,m68k,m68knommu,metag,mips,microblaze,mn10300,openrisc,parisc,powerpc,ppc,s390,score,sh,sh64,sparc,sparc64,tile,unicore32,um,v850,xtensa}
_package-docs() {
pkgdesc="Kernel hackers manual - HTML documentation that comes with the ${pkgbase/linux/Linux} kernel"
provides=("kernel26${_kernelname}-docs=${pkgver}")
conflicts=("kernel26${_kernelname}-docs")
replaces=("kernel26${_kernelname}-docs")
cd "${srcdir}/${_srcname}"
mkdir -p "${pkgdir}/usr/lib/modules/${_kernver}/build"
cp -al Documentation "${pkgdir}/usr/lib/modules/${_kernver}/build"
find "${pkgdir}" -type f -exec chmod 444 {} \;
find "${pkgdir}" -type d -exec chmod 755 {} \;
# remove a file already in linux package
rm -f "${pkgdir}/usr/lib/modules/${_kernver}/build/Documentation/DocBook/Makefile"
pkgname=("${pkgbase}" "${pkgbase}-headers" "${pkgbase}-docs")
for _p in ${pkgname[@]}; do
eval "package_${_p}() {
$(declare -f "_package${_p#${pkgbase}}")
_package${_p#${pkgbase}}
done
Running makepkg -S to build the source tarball:
claire ~/Builds/linux-tresor % makepkg -S
==> Making package: linux-tresor 3.18.2-1 (Fri 9 Jan 17:24:58 GMT 2015)
==> Retrieving sources...
-> Downloading linux-3.18.tar.xz...
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 77.1M 100 77.1M 0 0 2852k 0 0:00:27 0:00:27 --:--:-- 5975k
-> Downloading linux-3.18.tar.sign...
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 473 100 473 0 0 1079 0 --:--:-- --:--:-- --:--:-- 1082
-> Downloading patch-3.18.2.xz...
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 40932 100 40932 0 0 48079 0 --:--:-- --:--:-- --:--:-- 48042
-> Downloading patch-3.18.2.sign...
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 819 100 819 0 0 1207 0 --:--:-- --:--:-- --:--:-- 1207
-> Found config
-> Found config.x86_64
-> Found linux-tresor.preset
-> Found linux-tresor.install
-> Found change-default-console-loglevel.patch
-> Downloading tresor_sysfs.c...
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 2299 100 2299 0 0 28726 0 --:--:-- --:--:-- --:--:-- 29101
-> Downloading tresor-patch-3.6.2_i686...
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 47050 100 47050 0 0 344k 0 --:--:-- --:--:-- --:--:-- 345k
-> Found tresor-patch-3.6.2_i686.patch
-> Found tresor-patch-3.6.2_i686.patch.sig
-> Found patch-3.18.2.sign
-> Found config
-> Found config.x86_64
-> Found linux-tresor.preset
-> Found linux-tresor.install
-> Found change-default-console-loglevel.patch
-> Found tresor_sysfs.c
-> Downloading tresor-patch-3.8.2_aesni...
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 47192 100 47192 0 0 350k 0 --:--:-- --:--:-- --:--:-- 351k
-> Found tresor-patch-3.8.2_aesni.patch
-> Found tresor-patch-3.8.2_aesni.patch.sig
-> Found patch-3.18.2.sign
-> Found config
-> Found config.x86_64
-> Found linux-tresor.preset
-> Found linux-tresor.install
-> Found change-default-console-loglevel.patch
-> Found tresor_sysfs.c
==> Validating source files with sha256sums...
linux-3.18.tar.xz ... Passed
linux-3.18.tar.sign ... Skipped
patch-3.18.2.xz ... Passed
patch-3.18.2.sign ... Skipped
config ... Passed
config.x86_64 ... Passed
linux-tresor.preset ... Passed
linux-tresor.install ... Passed
change-default-console-loglevel.patch ... Passed
tresor_sysfs.c ... Passed
==> Validating source files with sha256sums...
tresor-patch-3.6.2_i686 ... Passed
tresor-patch-3.6.2_i686.patch ... Passed
tresor-patch-3.6.2_i686.patch.sig ... Skipped
==> Validating source files with sha256sums...
tresor-patch-3.8.2_aesni ... Passed
tresor-patch-3.8.2_aesni.patch ... Passed
tresor-patch-3.8.2_aesni.patch.sig ... Skipped
==> Verifying source file signatures with gpg...
linux-3.18.tar ... Passed
patch-3.18.2 ... Passed
tresor-patch-3.6.2_i686.patch ... Passed
patch-3.18.2 ... Passed
tresor-patch-3.8.2_aesni.patch ... Passed
patch-3.18.2 ... Passed
==> Entering fakeroot environment...
==> Creating source package...
-> Adding PKGBUILD...
-> Generating .SRCINFO file...
-> Adding config...
-> Adding config.x86_64...
-> Adding linux-tresor.preset...
-> Adding linux-tresor.install...
-> Adding change-default-console-loglevel.patch...
-> Adding tresor-patch-3.6.2_i686.patch...
-> Adding tresor-patch-3.6.2_i686.patch.sig...
-> Adding config...
ln: failed to create symbolic link ‘/home/claire/Builds/linux-tresor/srclinks.W5jPjydXO/linux-tresor/config’: File exists
-> Adding config.x86_64...
ln: failed to create symbolic link ‘/home/claire/Builds/linux-tresor/srclinks.W5jPjydXO/linux-tresor/config.x86_64’: File exists
-> Adding linux-tresor.preset...
ln: failed to create symbolic link ‘/home/claire/Builds/linux-tresor/srclinks.W5jPjydXO/linux-tresor/linux-tresor.preset’: File exists
-> Adding linux-tresor.install...
ln: failed to create symbolic link ‘/home/claire/Builds/linux-tresor/srclinks.W5jPjydXO/linux-tresor/linux-tresor.install’: File exists
-> Adding change-default-console-loglevel.patch...
ln: failed to create symbolic link ‘/home/claire/Builds/linux-tresor/srclinks.W5jPjydXO/linux-tresor/change-default-console-loglevel.patch’: File exists
-> Adding tresor-patch-3.8.2_aesni.patch...
-> Adding tresor-patch-3.8.2_aesni.patch.sig...
-> Adding config...
ln: failed to create symbolic link ‘/home/claire/Builds/linux-tresor/srclinks.W5jPjydXO/linux-tresor/config’: File exists
-> Adding config.x86_64...
ln: failed to create symbolic link ‘/home/claire/Builds/linux-tresor/srclinks.W5jPjydXO/linux-tresor/config.x86_64’: File exists
-> Adding linux-tresor.preset...
ln: failed to create symbolic link ‘/home/claire/Builds/linux-tresor/srclinks.W5jPjydXO/linux-tresor/linux-tresor.preset’: File exists
-> Adding linux-tresor.install...
ln: failed to create symbolic link ‘/home/claire/Builds/linux-tresor/srclinks.W5jPjydXO/linux-tresor/linux-tresor.install’: File exists
-> Adding change-default-console-loglevel.patch...
ln: failed to create symbolic link ‘/home/claire/Builds/linux-tresor/srclinks.W5jPjydXO/linux-tresor/change-default-console-loglevel.patch’: File exists
-> Compressing source package...
==> Leaving fakeroot environment.
==> Source package created: linux-tresor (Fri 9 Jan 17:25:50 GMT 2015)
makepkg -S 24.38s user 1.40s system 48% cpu 53.129 total
Here is the resulting source tarball.
As far as I can see, they should be working PKGBUILDs too which meet the standards.
EDIT: Here's the bug report
Last edited by clfarron4 (2015-01-09 17:42:34) -
Need some help with a split package
Basically, I'd like to have some code in my PKGBUILD that will append some extra info to the package name based on a file the user defined. This is for kernel26-ck and the file I speak of is the .config he/she makes. Below is the code that doesn't work and I think it doesn't work because the name of the package is the name of the package_name() {} function and both of of these have to match the pkgname array. What I want is to have the pkgname array get generated dynamically based on the code below which starts before the make command in the build section. Advise is appreciated. Is what I'm asking for possible?
# Contributor: graysky <graysky AT archlinux dot us>
# Contributor: Cray "MP2E" Elliott <MP2E { AT } archlinux.us>
# Contributor: Tobias Powalowski <[email protected]>
# Contributor: Thomas Baechler <[email protected]>
# Patch and Build Options
_BFQ_patches="n" # add BFQ patches
_makemenucfg="n" # menuconfig option
_streamline_="n" # run Steven Rostedt's streamline_config.pl script - see notes below!
_use_current="n" # use the current kernel's .config file - see notes below!
# More Details and References
## Note all kernels get the ck patch set - there is no option to enable/disable it!
## BFQ
# read, http://algo.ing.unimo.it/people/paolo/disk_sched/
## MAKEMENUCONFIG OPTION
# Allow you to select additional kernel options prior to a build via a menuconfig.
## STREAMLINE_CONFIG OPTION
# Similar to a make localmodconfig but this actually works!
# WARNING - make CERTAIN that all modules are modprobed BEFORE you begin making the pkg!
# read, https://bbs.archlinux.org/viewtopic.php?pid=830221#p830221
# to keep track of which modules are needed for your specific system/hardware, give my module_db script.
# a try: http://aur.archlinux.org/packages.php?ID=41689
# Not that if you use my script, this PKGBUILD will auto run the reload_data base for you to probe
# all the modules you have logged!
## USE CURRENT KERNEL'S .CONFIG
# Enabling this option will use the .config of the RUNNING kernel rather than the ARCH defaults.
# Useful when the package gets updated and you already went through the trouble of customizing your
# config options. NOT recommended when a new kernel is released, but again, convenient for package bumps.
pkgname='kernel26-ck'
#true && pkgname=("kernel26-ck" "kernel26-ck-headers")
_basekernel=2.6.36
pkgver=${_basekernel}.1
pkgrel=4
arch=('i686' 'x86_64')
license=('GPL2')
url="http://users.on.net/~ckolivas/kernel"
_archpatchversion=3
_ckpatchversion=2
_kernelname=-ck
_patchname="patch-${pkgver}-${_archpatchversion}-ARCH"
_ckpatchname="patch-${_basekernel}-ck${_ckpatchversion}"
_bfqpath="http://algo.ing.unimo.it/people/paolo/disk_sched/patches/2.6.36"
source=(ftp://ftp.kernel.org/pub/linux/kernel/v2.6/linux-$_basekernel.tar.bz2 # kernel source
ftp://ftp.archlinux.org/other/kernel26/${_patchname}.bz2 # arch patchset
config config.x86_64 kernel26.preset # configs
# ck patchset
http://www.kernel.org/pub/linux/kernel/people/ck/patches/2.6/${_basekernel}/${_basekernel}-ck${_ckpatchversion}/${_ckpatchname}.bz2
# BFQ patches
${_bfqpath}/0001-bfq_iosched-block-prepare_IO_context_code-v1-2.6.36.patch
${_bfqpath}/0002-bfq_iosched-block-add-cgroups-kconfig-and-build-bits-for-BFQ-v1-2.6.36.patch
${_bfqpath}/0003-bfq_iosched-block-introduce_BFQ-v1-2.6.36.patch)
build() {
# Patch source with -ARCH patches
# See http://projects.archlinux.org/linux-2.6-ARCH.git/
msg "Patching source with-ARCH patches"
cd ${srcdir}/linux-$_basekernel
patch -Np1 -i ${srcdir}/${_patchname}
# Patch source for BFQ patches
if [ ${_BFQ_patches} = "y" ]; then
msg "Patching source with BFQ patches"
for p in $(ls ${srcdir}/*-bfq_*); do
patch -Np1 -i $p
done
fi
# Patch source with ck
# Fix double name in EXTRAVERSION
sed -i -re "s/^(.EXTRAVERSION).*$/\1 = /" ${srcdir}/${_ckpatchname}
# Add -ck base patch set
msg "Patching source with ck1 patch set"
patch -Np1 -i ${srcdir}/${_ckpatchname}
msg "Running make mrproper to clean source tree"
make mrproper
if [ "$CARCH" = "x86_64" ]; then
cat ../config.x86_64 >./.config
else
cat ../config >./.config
fi
# use current kernel's config
# code originally by nous; http://aur.archlinux.org/packages.php?ID=40191
if [ ${_use_current} = "y" ]; then
if [[ -s /proc/config.gz ]]; then
msg "Extracting config from /proc/config.gz..."
modprobe configs
zcat /proc/config.gz > ./.config
else
warning "You kernel was not compiled with IKCONFIG_PROC!"
warning "You cannot read the current config!"
warning "Aborting!"
exit 0
fi
fi
if [ "${_kernelname}" != "" ]; then
sed -i "s|CONFIG_LOCALVERSION=.*|CONFIG_LOCALVERSION=\"${_kernelname}\"|g" ./.config
fi
msg "Running make prepare for you to enable patched options of your choosing"
make prepare
# If user patched to BFQ and enabled it in the prev step, set it as default io scheduler
if [ ${_BFQ_patches} = "y" ]; then
sed -i s'/CONFIG_DEFAULT_CFQ=y/# CONFIG_DEFAULT_CFQ is not set/g' ./.config
sed -i s'/# CONFIG_DEFAULT_BFQ is not set/CONFIG_DEFAULT_BFQ=y/g' ./.config
sed -i s'/CONFIG_DEFAULT_IOSCHED="cfq"/CONFIG_DEFAULT_IOSCHED="bfq"/g' ./.config
fi
if [ $_streamline_ = "y" ]; then
msg "If you have modprobe_db installed, running reload_database now"
if [ -e /usr/bin/reload_database ]; then
/usr/bin/reload_database
fi
msg "Running Steven Rostedt's streamline_config script now "
chmod +x ./scripts/kconfig/streamline_config.pl
./scripts/kconfig/streamline_config.pl > config_strip
cp config_strip .config
msg "An error about ksource in line 118 blah blah is NORMAL as are the one you will get for each"
msg "module you have probed that is not in the kernel itself like nvidia for example!"
fi
if [ $_makemenucfg = "y" ]; then
msg "Running make menuconfig"
make menuconfig
fi
# This allows building cpu-optimized packages with according package names.
# Useful for repo maintainers.
CPU=`egrep "MK8=y|MCORE2=y|MPSC=y|MATOM=y|MPENTIUMII=y|MPENTIUMIII=y|MPENTIUMM=y|MPENTIUM4=y|MK7=y|CONFIG_GENERIC_CPU=y|CONFIG_X86_GENERIC=y|M686=y" ./.config`
CPU=`sed -e "s/CONFIG_M\(.*\)=y/\1/" <<<$CPU`
case $CPU in
CORE2)
_pn="-core2"
_pd=" Intel Core2 optimized."
K8)
_pn="-k8"
_pd="AMD K8 optimized."
PSC)
_pn="-psc"
_pd="Intel Pentium4/D/Xeon optimized."
ATOM)
_pn="-atom"
_pd="Intel Atom optimized."
K7)
_pn="-k7"
_pd="AMD K7 optimized."
PENTIUMII)
_pn="-p2"
_pd="Intel Pentium2 optimized."
PENTIUMIII)
_pn="-p3"
_pd="Intel Pentium3 optimized."
PENTIUMM)
_pn="-pm"
_pd="Intel Pentium-M optimized."
PENTIUM4)
_pn="-p4"
_pd="Intel Pentium4 optimized."
default)
esac
# save to a file for reacall in subsequent sections
echo "_pn=\"${_pn}\"" > vars
echo "_pd=\"${_pd}\"" >> vars
msg "Running make bzImage and modules"
make bzImage modules
package_kernel26-ck() {
. ${srcdir}/linux-$_basekernel/vars
pkgname="kernel26-ck${_pn}"
pkgdesc="ARCH kernel with Con Kolivas' patchset using the Brain Fuck Scheduler (BFS). Budget Fair Queueing (BFQ) I/O scheduler optional.${_pd}"
backup=(etc/mkinitcpio.d/kernel26.preset)
depends=('coreutils' 'linux-firmware' 'module-init-tools' 'mkinitcpio>=0.5.20')
install=kernel26.install
optdepends=('crda: to set the correct wireless channels of your country' \
'nvidia-ck-stable: NVIDIA drivers for kernel26-ck' \
'nvidia-beta-ck: NVIDIA beta drivers for kernel26-ck' \
'modprobed_db: Keeps track of EVERY kernel module that has ever been probed - useful for those of us who make localmodconfig')
KARCH=x86
cd ${srcdir}/linux-$_basekernel
#get kernel version
_kernver="$(make kernelrelease)"
mkdir -p ${pkgdir}/{lib/modules,lib/firmware,boot}
msg "Running make modules_install"
make INSTALL_MOD_PATH=${pkgdir} modules_install
cp System.map ${pkgdir}/boot/System.map26${_kernelname}
cp arch/$KARCH/boot/bzImage ${pkgdir}/boot/vmlinuz26${_kernelname}
# add vmlinux
install -m644 -D vmlinux ${pkgdir}/usr/src/linux-${_kernver}/vmlinux
# install fallback mkinitcpio.conf file and preset file for kernel
install -m644 -D ${srcdir}/kernel26.preset ${pkgdir}/etc/mkinitcpio.d/${pkgname}.preset
# set correct depmod command for install
sed \
-e "s/KERNEL_NAME=.*/KERNEL_NAME=${_kernelname}/g" \
-e "s/KERNEL_VERSION=.*/KERNEL_VERSION=${_kernver}/g" \
-i $startdir/kernel26.install
sed \
-e "s|source .*|source /etc/mkinitcpio.d/kernel26${_kernelname}.kver|g" \
-e "s|default_image=.*|default_image=\"/boot/${pkgname}.img\"|g" \
-e "s|fallback_image=.*|fallback_image=\"/boot/${pkgname}-fallback.img\"|g" \
-i ${pkgdir}/etc/mkinitcpio.d/${pkgname}.preset
echo -e "# DO NOT EDIT THIS FILE\nALL_kver='${_kernver}'" > ${pkgdir}/etc/mkinitcpio.d/${pkgname}.kver
# remove build and source links
rm -f ${pkgdir}/lib/modules/${_kernver}/{source,build}
# remove the firmware
rm -rf ${pkgdir}/lib/firmware
package_kernel26-ck-headers () {
. ${srcdir}/linux-$_basekernel/vars
pkgname="kernel26-ck${_pn}-headers"
pkgdesc="Header files and scripts to build modules for kernel26-ck.${_pd}"
provides=("kernel26-ck${_pn}-headers=${pkgver}")
mkdir -p ${pkgdir}/lib/modules/${_kernver}
cd ${pkgdir}/lib/modules/${_kernver}
ln -sf ../../../usr/src/linux-${_kernver} build
cd ${srcdir}/linux-$_basekernel
install -D -m644 Makefile \
${pkgdir}/usr/src/linux-${_kernver}/Makefile
install -D -m644 kernel/Makefile \
${pkgdir}/usr/src/linux-${_kernver}/kernel/Makefile
install -D -m644 .config \
${pkgdir}/usr/src/linux-${_kernver}/.config
mkdir -p ${pkgdir}/usr/src/linux-${_kernver}/include
for i in acpi asm-generic config generated linux math-emu media net pcmcia scsi sound trace video; do
cp -a include/$i ${pkgdir}/usr/src/linux-${_kernver}/include/
done
# copy arch includes for external modules
mkdir -p ${pkgdir}/usr/src/linux-${_kernver}/arch/x86
cp -a arch/x86/include ${pkgdir}/usr/src/linux-${_kernver}/arch/x86/
# copy files necessary for later builds, like nvidia and vmware
cp Module.symvers ${pkgdir}/usr/src/linux-${_kernver}
cp -a scripts ${pkgdir}/usr/src/linux-${_kernver}
# fix permissions on scripts dir
chmod og-w -R ${pkgdir}/usr/src/linux-${_kernver}/scripts
mkdir -p ${pkgdir}/usr/src/linux-${_kernver}/.tmp_versions
mkdir -p ${pkgdir}/usr/src/linux-${_kernver}/arch/$KARCH/kernel
cp arch/$KARCH/Makefile ${pkgdir}/usr/src/linux-${_kernver}/arch/$KARCH/
if [ "$CARCH" = "i686" ]; then
cp arch/$KARCH/Makefile_32.cpu ${pkgdir}/usr/src/linux-${_kernver}/arch/$KARCH/
fi
cp arch/$KARCH/kernel/asm-offsets.s ${pkgdir}/usr/src/linux-${_kernver}/arch/$KARCH/kernel/
# add headers for lirc package
mkdir -p ${pkgdir}/usr/src/linux-${_kernver}/drivers/media/video
cp drivers/media/video/*.h ${pkgdir}/usr/src/linux-${_kernver}/drivers/media/video/
# need to remove zc0301 from the array with 2.26.36
for i in bt8xx cpia2 cx25840 cx88 em28xx et61x251 pwc saa7134 sn9c102 usbvideo; do
mkdir -p ${pkgdir}/usr/src/linux-${_kernver}/drivers/media/video/$i
cp -a drivers/media/video/$i/*.h ${pkgdir}/usr/src/linux-${_kernver}/drivers/media/video/$i
done
# add docbook makefile
install -D -m644 Documentation/DocBook/Makefile \
${pkgdir}/usr/src/linux-${_kernver}/Documentation/DocBook/Makefile
# add dm headers
mkdir -p ${pkgdir}/usr/src/linux-${_kernver}/drivers/md
cp drivers/md/*.h ${pkgdir}/usr/src/linux-${_kernver}/drivers/md
# add inotify.h
mkdir -p ${pkgdir}/usr/src/linux-${_kernver}/include/linux
cp include/linux/inotify.h ${pkgdir}/usr/src/linux-${_kernver}/include/linux/
# add wireless headers
mkdir -p ${pkgdir}/usr/src/linux-${_kernver}/net/mac80211/
cp net/mac80211/*.h ${pkgdir}/usr/src/linux-${_kernver}/net/mac80211/
# add dvb headers for external modules
# in reference to:
# http://bugs.archlinux.org/task/9912
mkdir -p ${pkgdir}/usr/src/linux-${_kernver}/drivers/media/dvb/dvb-core
cp drivers/media/dvb/dvb-core/*.h ${pkgdir}/usr/src/linux-${_kernver}/drivers/media/dvb/dvb-core/
# add dvb headers for external modules
# in reference to:
# http://bugs.archlinux.org/task/11194
if [ -d ${srcdir}/linux-$_basekernel/include/config/dvb ]; then
mkdir -p ${pkgdir}/usr/src/linux-${_kernver}/include/config/dvb/
cp include/config/dvb/*.h ${pkgdir}/usr/src/linux-${_kernver}/include/config/dvb/
fi
# add dvb headers for http://mcentral.de/hg/~mrec/em28xx-new
# in reference to:
# http://bugs.archlinux.org/task/13146
mkdir -p ${pkgdir}/usr/src/linux-${_kernver}/drivers/media/dvb/frontends/
cp drivers/media/dvb/frontends/lgdt330x.h ${pkgdir}/usr/src/linux-${_kernver}/drivers/media/dvb/frontends/
cp drivers/media/video/msp3400-driver.h ${pkgdir}/usr/src/linux-${_kernver}/drivers/media/dvb/frontends/
# add dvb headers
# in reference to:
# http://bugs.archlinux.org/task/20402
mkdir -p ${pkgdir}/usr/src/linux-${_kernver}/drivers/media/dvb/dvb-usb
cp drivers/media/dvb/dvb-usb/*.h ${pkgdir}/usr/src/linux-${_kernver}/drivers/media/dvb/dvb-usb/
mkdir -p ${pkgdir}/usr/src/linux-${_kernver}/drivers/media/dvb/frontends
cp drivers/media/dvb/frontends/*.h ${pkgdir}/usr/src/linux-${_kernver}/drivers/media/dvb/frontends/
mkdir -p ${pkgdir}/usr/src/linux-${_kernver}/drivers/media/common/tuners
cp drivers/media/common/tuners/*.h ${pkgdir}/usr/src/linux-${_kernver}/drivers/media/common/tuners/
# add xfs and shmem for aufs building
mkdir -p ${pkgdir}/usr/src/linux-${_kernver}/fs/xfs
mkdir -p ${pkgdir}/usr/src/linux-${_kernver}/mm
cp fs/xfs/xfs_sb.h ${pkgdir}/usr/src/linux-${_kernver}/fs/xfs/xfs_sb.h
# add headers for virtualbox
# in reference to:
# http://bugs.archlinux.org/task/14568
cp -a include/drm $pkgdir/usr/src/linux-${_kernver}/include/
# add headers for broadcom wl
# in reference to:
# http://bugs.archlinux.org/task/14568
cp -a include/trace $pkgdir/usr/src/linux-${_kernver}/include/
# copy in Kconfig files
for i in `find . -name "Kconfig*"`; do
mkdir -p ${pkgdir}/usr/src/linux-${_kernver}/`echo $i | sed 's|/Kconfig.*||'`
cp $i ${pkgdir}/usr/src/linux-${_kernver}/$i
done
chown -R root.root ${pkgdir}/usr/src/linux-${_kernver}
find ${pkgdir}/usr/src/linux-${_kernver} -type d -exec chmod 755 {} \;
# remove unneeded architectures
rm -rf ${pkgdir}/usr/src/linux-${_kernver}/arch/{alpha,arm,arm26,avr32,blackfin,cris,frv,h8300,ia64,m32r,m68k,m68knommu,mips,microblaze,mn10300,parisc,powerpc,ppc,s390,sh,sh64,sparc,sparc64,um,v850,xtensa}
# Global pkgdesc and depends are here so that they will be picked up by AUR
pkgdesc="ARCH kernel with Con Kolivas' patchset using the Brain Fuck Scheduler (BFS). Budget Fair Queueing (BFQ) I/O scheduler optional."
depends=('coreutils' 'linux-firmware' 'module-init-tools' 'mkinitcpio>=0.5.20')
sha256sums=('15a076d1a435a6bf8e92834eba4b390b4ec094ce06d47f89d071ca9e5788ce04'
'96ed15bd64ae90163f81996ee31c3db6c7433d8af156e546ca7b36bedec1728b'
'1b9abff4752d4a294716b05ae17b981e2e5aaae1b51d19613e6b4bac0aea989d'
'd1b8757e99ee6cbeacf0b4185236c654440d5d945458b94948fd2cc4af0a881d'
'7ead13bbe2fdfc5308ddc3a0484d66f8150f78bbdbc59643e0b52bb9e776b5da'
'092e17164f453bdca8bd50e4fd71c074755740252bd8ad5c3eb6d2d51e78a104'
'f5c42a2ec2869a756e53fabada51a25dcb9de13861f367463e9ec4da8bf0b86a'
'f3f52953a2ccc07af3f23c7252e08e61580ec4b165934c089351ddd719c3e41f'
'cca4eea16278e302c2f7649a145e4d5ceb5ff2ece25fea3988eca82290b0c633')
Last edited by graysky (2010-11-24 20:09:31)Got it!
Allan wrote:What about in the -headers package?
Yep, headers package is good too!
# Generated by makepkg 3.4.1
# using fakeroot version 1.14.4
# Wed Nov 24 23:06:36 UTC 2010
pkgname = kernel26-ck-headers-core2
pkgbase = kernel26-ck
pkgver = 2.6.36.1-4
pkgdesc = Header files and scripts to build modules for kernel26-ck. Intel Core2 optimized.
url = http://users.on.net/~ckolivas/kernel
builddate = 1290639996
packager = Unknown Packager
size = 31174656
arch = x86_64
license = GPL2
depend = coreutils
depend = linux-firmware
depend = module-init-tools
depend = mkinitcpio>=0.5.20
provides = kernel26-ck-headers-core2=2.6.36.1
makepkgopt = strip
makepkgopt = docs
makepkgopt = libtool
makepkgopt = emptydirs
makepkgopt = zipman
makepkgopt = purge
PKGBUILD built using the modified makepkg suggested by nous.
# Contributor: graysky <graysky AT archlinux dot us>
# Contributor: Cray "MP2E" Elliott <MP2E { AT } archlinux.us>
# Contributor: Tobias Powalowski <[email protected]>
# Contributor: Thomas Baechler <[email protected]>
# Patch and Build Options
_BFQ_patches="n" # add BFQ patches
_makemenucfg="n" # menuconfig option
_streamline_="n" # run Steven Rostedt's streamline_config.pl script - see notes below!
_use_current="n" # use the current kernel's .config file - see notes below!
# More Details and References
## Note all kernels get the ck patch set - there is no option to enable/disable it!
## BFQ
# read, http://algo.ing.unimo.it/people/paolo/disk_sched/
## MAKEMENUCONFIG OPTION
# Allow you to select additional kernel options prior to a build via a menuconfig.
## STREAMLINE_CONFIG OPTION
# Similar to a make localmodconfig but this actually works!
# WARNING - make CERTAIN that all modules are modprobed BEFORE you begin making the pkg!
# read, https://bbs.archlinux.org/viewtopic.php?pid=830221#p830221
# to keep track of which modules are needed for your specific system/hardware, give my module_db script.
# a try: http://aur.archlinux.org/packages.php?ID=41689
# Not that if you use my script, this PKGBUILD will auto run the reload_data base for you to probe
# all the modules you have logged!
## USE CURRENT KERNEL'S .CONFIG
# Enabling this option will use the .config of the RUNNING kernel rather than the ARCH defaults.
# Useful when the package gets updated and you already went through the trouble of customizing your
# config options. NOT recommended when a new kernel is released, but again, convenient for package bumps.
pkgname='kernel26-ck'
true && pkgname=("kernel26-ck" "kernel26-ck-headers")
_basekernel=2.6.36
pkgver=${_basekernel}.1
pkgrel=4
arch=('i686' 'x86_64')
license=('GPL2')
url="http://users.on.net/~ckolivas/kernel"
_archpatchversion=3
_ckpatchversion=2
_kernelname=-ck
_patchname="patch-${pkgver}-${_archpatchversion}-ARCH"
_ckpatchname="patch-${_basekernel}-ck${_ckpatchversion}"
_bfqpath="http://algo.ing.unimo.it/people/paolo/disk_sched/patches/2.6.36"
source=(ftp://ftp.kernel.org/pub/linux/kernel/v2.6/linux-$_basekernel.tar.bz2 # kernel source
ftp://ftp.archlinux.org/other/kernel26/${_patchname}.bz2 # arch patchset
config config.x86_64 kernel26.preset # configs
# ck patchset
http://www.kernel.org/pub/linux/kernel/people/ck/patches/2.6/${_basekernel}/${_basekernel}-ck${_ckpatchversion}/${_ckpatchname}.bz2
# BFQ patches
${_bfqpath}/0001-bfq_iosched-block-prepare_IO_context_code-v1-2.6.36.patch
${_bfqpath}/0002-bfq_iosched-block-add-cgroups-kconfig-and-build-bits-for-BFQ-v1-2.6.36.patch
${_bfqpath}/0003-bfq_iosched-block-introduce_BFQ-v1-2.6.36.patch)
build() {
# Patch source with -ARCH patches
# See http://projects.archlinux.org/linux-2.6-ARCH.git/
msg "Patching source with-ARCH patches"
cd ${srcdir}/linux-$_basekernel
patch -Np1 -i ${srcdir}/${_patchname}
# Patch source for BFQ patches
if [ ${_BFQ_patches} = "y" ]; then
msg "Patching source with BFQ patches"
for p in $(ls ${srcdir}/*-bfq_*); do
patch -Np1 -i $p
done
fi
# Patch source with ck
# Fix double name in EXTRAVERSION
sed -i -re "s/^(.EXTRAVERSION).*$/\1 = /" ${srcdir}/${_ckpatchname}
# Add -ck base patch set
msg "Patching source with ck1 patch set"
patch -Np1 -i ${srcdir}/${_ckpatchname}
msg "Running make mrproper to clean source tree"
make mrproper
if [ "$CARCH" = "x86_64" ]; then
cat ../config.x86_64 >./.config
else
cat ../config >./.config
fi
# use current kernel's config
# code originally by nous; http://aur.archlinux.org/packages.php?ID=40191
if [ ${_use_current} = "y" ]; then
if [[ -s /proc/config.gz ]]; then
msg "Extracting config from /proc/config.gz..."
modprobe configs
zcat /proc/config.gz > ./.config
else
warning "You kernel was not compiled with IKCONFIG_PROC!"
warning "You cannot read the current config!"
warning "Aborting!"
exit 0
fi
fi
if [ "${_kernelname}" != "" ]; then
sed -i "s|CONFIG_LOCALVERSION=.*|CONFIG_LOCALVERSION=\"${_kernelname}\"|g" ./.config
fi
msg "Running make prepare for you to enable patched options of your choosing"
make prepare
# If user patched to BFQ and enabled it in the prev step, set it as default io scheduler
if [ ${_BFQ_patches} = "y" ]; then
sed -i s'/CONFIG_DEFAULT_CFQ=y/# CONFIG_DEFAULT_CFQ is not set/g' ./.config
sed -i s'/# CONFIG_DEFAULT_BFQ is not set/CONFIG_DEFAULT_BFQ=y/g' ./.config
sed -i s'/CONFIG_DEFAULT_IOSCHED="cfq"/CONFIG_DEFAULT_IOSCHED="bfq"/g' ./.config
fi
if [ $_streamline_ = "y" ]; then
msg "If you have modprobe_db installed, running reload_database now"
if [ -e /usr/bin/reload_database ]; then
/usr/bin/reload_database
fi
msg "Running Steven Rostedt's streamline_config script now "
chmod +x ./scripts/kconfig/streamline_config.pl
./scripts/kconfig/streamline_config.pl > config_strip
cp config_strip .config
msg "An error about ksource in line 118 blah blah is NORMAL as are the one you will get for each"
msg "module you have probed that is not in the kernel itself like nvidia for example!"
fi
if [ $_makemenucfg = "y" ]; then
msg "Running make menuconfig"
make menuconfig
fi
# This allows building cpu-optimized packages with according package names.
# Useful for repo maintainers.
# Code by nous.
CPU=`egrep "MK8=y|MCORE2=y|MPSC=y|MATOM=y|MPENTIUMII=y|MPENTIUMIII=y|MPENTIUMM=y|MPENTIUM4=y|MK7=y|CONFIG_GENERIC_CPU=y|CONFIG_X86_GENERIC=y|M686=y" ./.config`
CPU=`sed -e "s/CONFIG_M\(.*\)=y/\1/" <<<$CPU`
case $CPU in
CORE2)
_pn="-core2"
_pd=" Intel Core2 optimized."
K8)
_pn="-k8"
_pd="AMD K8 optimized."
PSC)
_pn="-psc"
_pd="Intel Pentium4/D/Xeon optimized."
ATOM)
_pn="-atom"
_pd="Intel Atom optimized."
K7)
_pn="-k7"
_pd="AMD K7 optimized."
PENTIUMII)
_pn="-p2"
_pd="Intel Pentium2 optimized."
PENTIUMIII)
_pn="-p3"
_pd="Intel Pentium3 optimized."
PENTIUMM)
_pn="-pm"
_pd="Intel Pentium-M optimized."
PENTIUM4)
_pn="-p4"
_pd="Intel Pentium4 optimized."
default)
esac
# save to a file for reacall in subsequent sections
echo "_pn=\"${_pn}\"" > vars
echo "_pd=\"${_pd}\"" >> vars
msg "Running make bzImage and modules"
make bzImage modules
package_kernel26-ck() {
. ${srcdir}/linux-$_basekernel/vars
pkgname="kernel26-ck${_pn}"
pkgdesc="ARCH kernel with Con Kolivas' patchset using the Brain Fuck Scheduler (BFS). Budget Fair Queueing (BFQ) I/O scheduler optional.${_pd}"
backup=(etc/mkinitcpio.d/kernel26.preset)
depends=('coreutils' 'linux-firmware' 'module-init-tools' 'mkinitcpio>=0.5.20')
install=kernel26.install
optdepends=('crda: to set the correct wireless channels of your country' \
'nvidia-ck-stable: NVIDIA drivers for kernel26-ck' \
'nvidia-beta-ck: NVIDIA beta drivers for kernel26-ck' \
'modprobed_db: Keeps track of EVERY kernel module that has ever been probed - useful for those of us who make localmodconfig')
KARCH=x86
cd ${srcdir}/linux-$_basekernel
#get kernel version
_kernver="$(make kernelrelease)"
mkdir -p ${pkgdir}/{lib/modules,lib/firmware,boot}
msg "Running make modules_install"
make INSTALL_MOD_PATH=${pkgdir} modules_install
cp System.map ${pkgdir}/boot/System.map26${_kernelname}
cp arch/$KARCH/boot/bzImage ${pkgdir}/boot/vmlinuz26${_kernelname}
# add vmlinux
install -m644 -D vmlinux ${pkgdir}/usr/src/linux-${_kernver}/vmlinux
# install fallback mkinitcpio.conf file and preset file for kernel
install -m644 -D ${srcdir}/kernel26.preset ${pkgdir}/etc/mkinitcpio.d/${pkgname}.preset
# set correct depmod command for install
sed \
-e "s/KERNEL_NAME=.*/KERNEL_NAME=${_kernelname}/g" \
-e "s/KERNEL_VERSION=.*/KERNEL_VERSION=${_kernver}/g" \
-i $startdir/kernel26.install
sed \
-e "s|source .*|source /etc/mkinitcpio.d/kernel26${_kernelname}.kver|g" \
-e "s|default_image=.*|default_image=\"/boot/${pkgname}.img\"|g" \
-e "s|fallback_image=.*|fallback_image=\"/boot/${pkgname}-fallback.img\"|g" \
-i ${pkgdir}/etc/mkinitcpio.d/${pkgname}.preset
echo -e "# DO NOT EDIT THIS FILE\nALL_kver='${_kernver}'" > ${pkgdir}/etc/mkinitcpio.d/${pkgname}.kver
# remove build and source links
rm -f ${pkgdir}/lib/modules/${_kernver}/{source,build}
# remove the firmware
rm -rf ${pkgdir}/lib/firmware
package_kernel26-ck-headers () {
. ${srcdir}/linux-$_basekernel/vars
pkgname="kernel26-ck-headers${_pn}"
pkgdesc="Header files and scripts to build modules for kernel26-ck.${_pd}"
provides=("kernel26-ck-headers${_pn}=${pkgver}")
mkdir -p ${pkgdir}/lib/modules/${_kernver}
cd ${pkgdir}/lib/modules/${_kernver}
ln -sf ../../../usr/src/linux-${_kernver} build
cd ${srcdir}/linux-$_basekernel
install -D -m644 Makefile \
${pkgdir}/usr/src/linux-${_kernver}/Makefile
install -D -m644 kernel/Makefile \
${pkgdir}/usr/src/linux-${_kernver}/kernel/Makefile
install -D -m644 .config \
${pkgdir}/usr/src/linux-${_kernver}/.config
mkdir -p ${pkgdir}/usr/src/linux-${_kernver}/include
for i in acpi asm-generic config generated linux math-emu media net pcmcia scsi sound trace video; do
cp -a include/$i ${pkgdir}/usr/src/linux-${_kernver}/include/
done
# copy arch includes for external modules
mkdir -p ${pkgdir}/usr/src/linux-${_kernver}/arch/x86
cp -a arch/x86/include ${pkgdir}/usr/src/linux-${_kernver}/arch/x86/
# copy files necessary for later builds, like nvidia and vmware
cp Module.symvers ${pkgdir}/usr/src/linux-${_kernver}
cp -a scripts ${pkgdir}/usr/src/linux-${_kernver}
# fix permissions on scripts dir
chmod og-w -R ${pkgdir}/usr/src/linux-${_kernver}/scripts
mkdir -p ${pkgdir}/usr/src/linux-${_kernver}/.tmp_versions
mkdir -p ${pkgdir}/usr/src/linux-${_kernver}/arch/$KARCH/kernel
cp arch/$KARCH/Makefile ${pkgdir}/usr/src/linux-${_kernver}/arch/$KARCH/
if [ "$CARCH" = "i686" ]; then
cp arch/$KARCH/Makefile_32.cpu ${pkgdir}/usr/src/linux-${_kernver}/arch/$KARCH/
fi
cp arch/$KARCH/kernel/asm-offsets.s ${pkgdir}/usr/src/linux-${_kernver}/arch/$KARCH/kernel/
# add headers for lirc package
mkdir -p ${pkgdir}/usr/src/linux-${_kernver}/drivers/media/video
cp drivers/media/video/*.h ${pkgdir}/usr/src/linux-${_kernver}/drivers/media/video/
# need to remove zc0301 from the array with 2.26.36
for i in bt8xx cpia2 cx25840 cx88 em28xx et61x251 pwc saa7134 sn9c102 usbvideo; do
mkdir -p ${pkgdir}/usr/src/linux-${_kernver}/drivers/media/video/$i
cp -a drivers/media/video/$i/*.h ${pkgdir}/usr/src/linux-${_kernver}/drivers/media/video/$i
done
# add docbook makefile
install -D -m644 Documentation/DocBook/Makefile \
${pkgdir}/usr/src/linux-${_kernver}/Documentation/DocBook/Makefile
# add dm headers
mkdir -p ${pkgdir}/usr/src/linux-${_kernver}/drivers/md
cp drivers/md/*.h ${pkgdir}/usr/src/linux-${_kernver}/drivers/md
# add inotify.h
mkdir -p ${pkgdir}/usr/src/linux-${_kernver}/include/linux
cp include/linux/inotify.h ${pkgdir}/usr/src/linux-${_kernver}/include/linux/
# add wireless headers
mkdir -p ${pkgdir}/usr/src/linux-${_kernver}/net/mac80211/
cp net/mac80211/*.h ${pkgdir}/usr/src/linux-${_kernver}/net/mac80211/
# add dvb headers for external modules
# in reference to:
# http://bugs.archlinux.org/task/9912
mkdir -p ${pkgdir}/usr/src/linux-${_kernver}/drivers/media/dvb/dvb-core
cp drivers/media/dvb/dvb-core/*.h ${pkgdir}/usr/src/linux-${_kernver}/drivers/media/dvb/dvb-core/
# add dvb headers for external modules
# in reference to:
# http://bugs.archlinux.org/task/11194
if [ -d ${srcdir}/linux-$_basekernel/include/config/dvb ]; then
mkdir -p ${pkgdir}/usr/src/linux-${_kernver}/include/config/dvb/
cp include/config/dvb/*.h ${pkgdir}/usr/src/linux-${_kernver}/include/config/dvb/
fi
# add dvb headers for http://mcentral.de/hg/~mrec/em28xx-new
# in reference to:
# http://bugs.archlinux.org/task/13146
mkdir -p ${pkgdir}/usr/src/linux-${_kernver}/drivers/media/dvb/frontends/
cp drivers/media/dvb/frontends/lgdt330x.h ${pkgdir}/usr/src/linux-${_kernver}/drivers/media/dvb/frontends/
cp drivers/media/video/msp3400-driver.h ${pkgdir}/usr/src/linux-${_kernver}/drivers/media/dvb/frontends/
# add dvb headers
# in reference to:
# http://bugs.archlinux.org/task/20402
mkdir -p ${pkgdir}/usr/src/linux-${_kernver}/drivers/media/dvb/dvb-usb
cp drivers/media/dvb/dvb-usb/*.h ${pkgdir}/usr/src/linux-${_kernver}/drivers/media/dvb/dvb-usb/
mkdir -p ${pkgdir}/usr/src/linux-${_kernver}/drivers/media/dvb/frontends
cp drivers/media/dvb/frontends/*.h ${pkgdir}/usr/src/linux-${_kernver}/drivers/media/dvb/frontends/
mkdir -p ${pkgdir}/usr/src/linux-${_kernver}/drivers/media/common/tuners
cp drivers/media/common/tuners/*.h ${pkgdir}/usr/src/linux-${_kernver}/drivers/media/common/tuners/
# add xfs and shmem for aufs building
mkdir -p ${pkgdir}/usr/src/linux-${_kernver}/fs/xfs
mkdir -p ${pkgdir}/usr/src/linux-${_kernver}/mm
cp fs/xfs/xfs_sb.h ${pkgdir}/usr/src/linux-${_kernver}/fs/xfs/xfs_sb.h
# add headers for virtualbox
# in reference to:
# http://bugs.archlinux.org/task/14568
cp -a include/drm $pkgdir/usr/src/linux-${_kernver}/include/
# add headers for broadcom wl
# in reference to:
# http://bugs.archlinux.org/task/14568
cp -a include/trace $pkgdir/usr/src/linux-${_kernver}/include/
# copy in Kconfig files
for i in `find . -name "Kconfig*"`; do
mkdir -p ${pkgdir}/usr/src/linux-${_kernver}/`echo $i | sed 's|/Kconfig.*||'`
cp $i ${pkgdir}/usr/src/linux-${_kernver}/$i
done
chown -R root.root ${pkgdir}/usr/src/linux-${_kernver}
find ${pkgdir}/usr/src/linux-${_kernver} -type d -exec chmod 755 {} \;
# remove unneeded architectures
rm -rf ${pkgdir}/usr/src/linux-${_kernver}/arch/{alpha,arm,arm26,avr32,blackfin,cris,frv,h8300,ia64,m32r,m68k,m68knommu,mips,microblaze,mn10300,parisc,powerpc,ppc,s390,sh,sh64,sparc,sparc64,um,v850,xtensa}
# Global pkgdesc and depends are here so that they will be picked up by AUR
pkgdesc="ARCH kernel with Con Kolivas' patchset using the Brain Fuck Scheduler (BFS). Budget Fair Queueing (BFQ) I/O scheduler optional."
depends=('coreutils' 'linux-firmware' 'module-init-tools' 'mkinitcpio>=0.5.20')
sha256sums=('15a076d1a435a6bf8e92834eba4b390b4ec094ce06d47f89d071ca9e5788ce04'
'96ed15bd64ae90163f81996ee31c3db6c7433d8af156e546ca7b36bedec1728b'
'1b9abff4752d4a294716b05ae17b981e2e5aaae1b51d19613e6b4bac0aea989d'
'd1b8757e99ee6cbeacf0b4185236c654440d5d945458b94948fd2cc4af0a881d'
'7ead13bbe2fdfc5308ddc3a0484d66f8150f78bbdbc59643e0b52bb9e776b5da'
'092e17164f453bdca8bd50e4fd71c074755740252bd8ad5c3eb6d2d51e78a104'
'f5c42a2ec2869a756e53fabada51a25dcb9de13861f367463e9ec4da8bf0b86a'
'f3f52953a2ccc07af3f23c7252e08e61580ec4b165934c089351ddd719c3e41f'
'cca4eea16278e302c2f7649a145e4d5ceb5ff2ece25fea3988eca82290b0c633')
@Allan - can you see any other potential down sides of implementing the patch suggested by nous? What about dependency issues? For example, nvidia-ck depends on kernel26-ck, not kernel26-ck-core2. Perhaps circumvent this with a provides=('kernel26-ck-headers') for headers and provides=('kernel26-ck') for the main package?
Last edited by graysky (2010-11-24 23:08:02) -
PKGBUILD for custom kernel issue
Hi all,
Last night I was putting together a PKGBUILD for a kernel I'd like to compile that has the ck patchset, grsecurity (latest testing), and had broadcom-wl on it already so I don't have to keep reinstalling it from AUR and doing depmod each time as it keeps making me have to find an ethernet cable. I used the kerne26 Arch PKGBUILD as a base and included parts of kernel-netbook for broadcom-wl, kernel26-grsecurity, and kernel26-ck and altered name variables and links etc so it all works and all sources are downloaded. I also got the two .patch files (semaphore and something else) from the kernel-netbook tarball to build the thing with, I don't know if it would work without them.
However when I get into the build() a few patches are applied before I get messages about patches already applied or reversed, and then it says build failed because of an error, I can't tell which package is causing thins or why (it all goes by too fast, and the error says failed without reason, and the reversed patch messages are what is immediately previous to it). I have not yet gone all the way through the pkgbuild - especially towards the end, and I felt that the standard setup of init file system creation and such were ok, and if anything does need altering about it, I can deal with it once I get these first troubles solved.
Below is my pkgbuild so far. Hopefully there are people out there who can aid me with this.
Thanks,
Ben.
# Maintainer: Ben Ward <[email protected]>
pkgbase="kernel26"
# pkgname=('kernel26' 'kernel26-headers' 'kernel26-docs') # Build stock -ARCH kernel
pkgname=kernel26-custom # Build kernel with a different name
#Base kernel info
_kernelname=${pkgname#kernel26}
_basekernel=2.6.38
pkgver=${_basekernel}.3
pkgrel=1
#ARCH patch info
_archpatchver=1
_archpatchname="patch-${pkgver}-${_archpatchver}-ARCH"
#_archpatchname="patch-${pkgver}-1-ARCH"
#grsecurity info
_grsec=2.2.2
_timestamp=201104182227
#Broadcom-wl info
_broadcom_ver=5.100.82.38
_broadcom="hybrid-portsrc_x86_32-v${_broadcom_ver//./_}"
#ck-patch info
_ckpatchversion=3
_ckpatchname="patch-${_basekernel}-ck${_ckpatchversion}"
arch=(i686 x86_64)
license=('GPL2')
url="http://www.kernel.org"
options=(!strip)
source=(ftp://ftp.kernel.org/pub/linux/kernel/v2.6/linux-$_basekernel.tar.bz2
ftp://ftp.kernel.org/pub/linux/kernel/v2.6/patch-${pkgver}.bz2
ftp://ftp.archlinux.org/other/kernel26/${_archpatchname}.bz2
http://grsecurity.net/test/grsecurity-${_grsec}-${pkgver}-${_timestamp}.patch
http://www.broadcom.com/docs/linux_sta/${_broadcom}.tar.gz
http://www.kernel.org/pub/linux/kernel/people/ck/patches/2.6/${_basekernel}/${_basekernel}-ck${_ckpatchversion}/${_ckpatchname}.bz2
"semaphore.patch"
"mutex-sema.patch"
# the main kernel config files
config config.x86_64
# standard config files for mkinitcpio ramdisk
kernel26.preset)
md5sums=('7d471477bfa67546f902da62227fa976'
'b3677121c4b5efcb8128c2000788d0aa'
'5b14b6eb2cdcb074905d4974437c4df6'
'a19024797f192fe21a468de80c101d8a'
'c0074a1622c75916442e26763ddf47d0'
'88d5b3e0622f8c48dad19ab9ac3c16f0'
'aee89fe7f034aea2f2ca95322774c1b5'
'21ce3f7967d7305064bf7eb60030ffea'
'f66543886835ab8599b29cd0c48aa66d'
'd866bcc06672fee17736bd5022f700fe'
'25584700a0a679542929c4bed31433b6')
build() {
cd ${srcdir}/linux-$_basekernel
# Apply kernel.org patch to basekernel
msg "Checking basekernel is ip to date..."
if [[ "${_basekernel}" != "${pkgver}" ]]; then
msg "Patching source with upstream patch..."
patch -Np1 -i "${srcdir}/patch-${pkgver}" || return 1
fi
# Add -ARCH patches
# See http://projects.archlinux.org/linux-2.6-ARCH.git/
msg "Patching Kernel with ARCH patches..."
patch -Np1 -i ${srcdir}/${_archpatchname}
# Add ck patch
msg "Patching Kernel with ck patches..."
patch -Np1 -i ${srcdir}/${_ckpatchname}
# Add grsecurity patch
msg "Patching kernel with grsecurity testing branch..."
if [ "$CARCH" = "x86_64" ]; then
cat ../config.x86_64 >./.config
else
cat ../config >./.config
fi
if [ "${_kernelname}" != "" ]; then
sed -i "s|CONFIG_LOCALVERSION=.*|CONFIG_LOCALVERSION=\"${_kernelname}\"|g" ./.config
fi
# get kernel version
make prepare
# load configuration
# Configure the kernel. Replace the line below with one of your choice.
#make menuconfig # CLI menu for configuration
make nconfig # new CLI menu for configuration
#make xconfig # X-based configuration
#make oldconfig # using old config from previous kernel version
# ... or manually edit .config
# stop here
# this is useful to configure the kernel
#msg "Stopping build"
#return 1
yes "" | make config
# build!
make ${MAKEFLAGS} bzImage modules
package_kernel26() {
pkgdesc="The Linux Kernel and modules"
groups=('base')
backup=(etc/mkinitcpio.d/${pkgname}.preset)
depends=('coreutils' 'linux-firmware' 'module-init-tools>=3.12-2' 'mkinitcpio>=0.6.8-2')
# pwc, ieee80211 and hostap-driver26 modules are included in kernel26 now
# nforce package support was abandoned by nvidia, kernel modules should cover everything now.
# kernel24 support is dropped since glibc24
replaces=('kernel24' 'kernel24-scsi' 'kernel26-scsi'
'alsa-driver' 'ieee80211' 'hostap-driver26'
'pwc' 'nforce' 'squashfs' 'unionfs' 'ivtv'
'zd1211' 'kvm-modules' 'iwlwifi' 'rt2x00-cvs'
'gspcav1' 'atl2' 'wlan-ng26' 'rt2500' 'nouveau-drm')
install=kernel26.install
optdepends=('crda: to set the correct wireless channels of your country')
KARCH=x86
cd ${srcdir}/linux-$_basekernel
# get kernel version
_kernver="$(make kernelrelease)"
mkdir -p ${pkgdir}/{lib/modules,lib/firmware,boot}
make INSTALL_MOD_PATH=${pkgdir} modules_install
cp System.map ${pkgdir}/boot/System.map26${_kernelname}
cp arch/$KARCH/boot/bzImage ${pkgdir}/boot/vmlinuz26${_kernelname}
# # add vmlinux
install -m644 -D vmlinux ${pkgdir}/usr/src/linux-${_kernver}/vmlinux
# install fallback mkinitcpio.conf file and preset file for kernel
install -m644 -D ${srcdir}/kernel26.preset ${pkgdir}/etc/mkinitcpio.d/${pkgname}.preset
# set correct depmod command for install
sed \
-e "s/KERNEL_NAME=.*/KERNEL_NAME=${_kernelname}/g" \
-e "s/KERNEL_VERSION=.*/KERNEL_VERSION=${_kernver}/g" \
-i $startdir/kernel26.install
sed \
-e "s|source .*|source /etc/mkinitcpio.d/kernel26${_kernelname}.kver|g" \
-e "s|default_image=.*|default_image=\"/boot/${pkgname}.img\"|g" \
-e "s|fallback_image=.*|fallback_image=\"/boot/${pkgname}-fallback.img\"|g" \
-i ${pkgdir}/etc/mkinitcpio.d/${pkgname}.preset
echo -e "# DO NOT EDIT THIS FILE\nALL_kver='${_kernver}'" > ${pkgdir}/etc/mkinitcpio.d/${pkgname}.kver
# remove build and source links
rm -f ${pkgdir}/lib/modules/${_kernver}/{source,build}
# remove the firmware
rm -rf ${pkgdir}/lib/firmware
# gzip -9 all modules to safe 100MB of space
find "$pkgdir" -name '*.ko' -exec gzip -9 {} \;
##Section: Broadcom-wl
msg "Compiling broadcom-wl module:"
cd ${srcdir}/
#patching broadcom as broadcom-wl package on AUR
patch -p1 < license.patch
patch -p1 < semaphore.patch
patch -p1 < mutex-sema.patch
make -C ${srcdir}/linux-$_basekernel M=`pwd`
install -D -m 755 wl.ko ${pkgdir}/lib/modules/$_kernver/kernel/drivers/net/wireless/wl.ko
package_kernel26-headers() {
pkgdesc="Header files and scripts for building modules for kernel26"
mkdir -p ${pkgdir}/lib/modules/${_kernver}
cd ${pkgdir}/lib/modules/${_kernver}
ln -sf ../../../usr/src/linux-${_kernver} build
cd ${srcdir}/linux-$_basekernel
install -D -m644 Makefile \
${pkgdir}/usr/src/linux-${_kernver}/Makefile
install -D -m644 kernel/Makefile \
${pkgdir}/usr/src/linux-${_kernver}/kernel/Makefile
install -D -m644 .config \
${pkgdir}/usr/src/linux-${_kernver}/.config
mkdir -p ${pkgdir}/usr/src/linux-${_kernver}/include
for i in acpi asm-generic config generated linux math-emu media net pcmcia scsi sound trace video xen; do
cp -a include/$i ${pkgdir}/usr/src/linux-${_kernver}/include/
done
# copy arch includes for external modules
mkdir -p ${pkgdir}/usr/src/linux-${_kernver}/arch/x86
cp -a arch/x86/include ${pkgdir}/usr/src/linux-${_kernver}/arch/x86/
# copy files necessary for later builds, like nvidia and vmware
cp Module.symvers ${pkgdir}/usr/src/linux-${_kernver}
cp -a scripts ${pkgdir}/usr/src/linux-${_kernver}
# fix permissions on scripts dir
chmod og-w -R ${pkgdir}/usr/src/linux-${_kernver}/scripts
mkdir -p ${pkgdir}/usr/src/linux-${_kernver}/.tmp_versions
mkdir -p ${pkgdir}/usr/src/linux-${_kernver}/arch/$KARCH/kernel
cp arch/$KARCH/Makefile ${pkgdir}/usr/src/linux-${_kernver}/arch/$KARCH/
if [ "$CARCH" = "i686" ]; then
cp arch/$KARCH/Makefile_32.cpu ${pkgdir}/usr/src/linux-${_kernver}/arch/$KARCH/
fi
cp arch/$KARCH/kernel/asm-offsets.s ${pkgdir}/usr/src/linux-${_kernver}/arch/$KARCH/kernel/
# add headers for lirc package
mkdir -p ${pkgdir}/usr/src/linux-${_kernver}/drivers/media/video
cp drivers/media/video/*.h ${pkgdir}/usr/src/linux-${_kernver}/drivers/media/video/
for i in bt8xx cpia2 cx25840 cx88 em28xx et61x251 pwc saa7134 sn9c102; do
mkdir -p ${pkgdir}/usr/src/linux-${_kernver}/drivers/media/video/$i
cp -a drivers/media/video/$i/*.h ${pkgdir}/usr/src/linux-${_kernver}/drivers/media/video/$i
done
mkdir -p ${pkgdir}/usr/src/linux-${_kernver}/drivers/staging/usbvideo/
cp -a drivers/staging/usbvideo/*.h ${pkgdir}/usr/src/linux-${_kernver}/drivers/staging/usbvideo/
# add docbook makefile
install -D -m644 Documentation/DocBook/Makefile \
${pkgdir}/usr/src/linux-${_kernver}/Documentation/DocBook/Makefile
# add dm headers
mkdir -p ${pkgdir}/usr/src/linux-${_kernver}/drivers/md
cp drivers/md/*.h ${pkgdir}/usr/src/linux-${_kernver}/drivers/md
# add inotify.h
mkdir -p ${pkgdir}/usr/src/linux-${_kernver}/include/linux
cp include/linux/inotify.h ${pkgdir}/usr/src/linux-${_kernver}/include/linux/
# add wireless headers
mkdir -p ${pkgdir}/usr/src/linux-${_kernver}/net/mac80211/
cp net/mac80211/*.h ${pkgdir}/usr/src/linux-${_kernver}/net/mac80211/
# add dvb headers for external modules
# in reference to:
# http://bugs.archlinux.org/task/9912
mkdir -p ${pkgdir}/usr/src/linux-${_kernver}/drivers/media/dvb/dvb-core
cp drivers/media/dvb/dvb-core/*.h ${pkgdir}/usr/src/linux-${_kernver}/drivers/media/dvb/dvb-core/
# add dvb headers for external modules
# in reference to:
# http://bugs.archlinux.org/task/11194
mkdir -p ${pkgdir}/usr/src/linux-${_kernver}/include/config/dvb/
cp include/config/dvb/*.h ${pkgdir}/usr/src/linux-${_kernver}/include/config/dvb/
# add dvb headers for http://mcentral.de/hg/~mrec/em28xx-new
# in reference to:
# http://bugs.archlinux.org/task/13146
mkdir -p ${pkgdir}/usr/src/linux-${_kernver}/drivers/media/dvb/frontends/
cp drivers/media/dvb/frontends/lgdt330x.h ${pkgdir}/usr/src/linux-${_kernver}/drivers/media/dvb/frontends/
cp drivers/media/video/msp3400-driver.h ${pkgdir}/usr/src/linux-${_kernver}/drivers/media/dvb/frontends/
# add dvb headers
# in reference to:
# http://bugs.archlinux.org/task/20402
mkdir -p ${pkgdir}/usr/src/linux-${_kernver}/drivers/media/dvb/dvb-usb
cp drivers/media/dvb/dvb-usb/*.h ${pkgdir}/usr/src/linux-${_kernver}/drivers/media/dvb/dvb-usb/
mkdir -p ${pkgdir}/usr/src/linux-${_kernver}/drivers/media/dvb/frontends
cp drivers/media/dvb/frontends/*.h ${pkgdir}/usr/src/linux-${_kernver}/drivers/media/dvb/frontends/
mkdir -p ${pkgdir}/usr/src/linux-${_kernver}/drivers/media/common/tuners
cp drivers/media/common/tuners/*.h ${pkgdir}/usr/src/linux-${_kernver}/drivers/media/common/tuners/
# add xfs and shmem for aufs building
mkdir -p ${pkgdir}/usr/src/linux-${_kernver}/fs/xfs
mkdir -p ${pkgdir}/usr/src/linux-${_kernver}/mm
cp fs/xfs/xfs_sb.h ${pkgdir}/usr/src/linux-${_kernver}/fs/xfs/xfs_sb.h
# add headers vor virtualbox
# in reference to:
# http://bugs.archlinux.org/task/14568
cp -a include/drm $pkgdir/usr/src/linux-${_kernver}/include/
# add headers for broadcom wl
# in reference to:
# http://bugs.archlinux.org/task/14568
cp -a include/trace $pkgdir/usr/src/linux-${_kernver}/include/
# add headers for crypto modules
# in reference to:
# http://bugs.archlinux.org/task/22081
cp -a include/crypto $pkgdir/usr/src/linux-${_kernver}/include/
# copy in Kconfig files
for i in `find . -name "Kconfig*"`; do
mkdir -p ${pkgdir}/usr/src/linux-${_kernver}/`echo $i | sed 's|/Kconfig.*||'`
cp $i ${pkgdir}/usr/src/linux-${_kernver}/$i
done
chown -R root.root ${pkgdir}/usr/src/linux-${_kernver}
find ${pkgdir}/usr/src/linux-${_kernver} -type d -exec chmod 755 {} \;
# strip scripts directory
find ${pkgdir}/usr/src/linux-${_kernver}/scripts -type f -perm -u+w 2>/dev/null | while read binary ; do
case "$(file -bi "$binary")" in
*application/x-sharedlib*) # Libraries (.so)
/usr/bin/strip $STRIP_SHARED "$binary";;
*application/x-archive*) # Libraries (.a)
/usr/bin/strip $STRIP_STATIC "$binary";;
*application/x-executable*) # Binaries
/usr/bin/strip $STRIP_BINARIES "$binary";;
esac
done
# remove unneeded architectures
rm -rf ${pkgdir}/usr/src/linux-${_kernver}/arch/{alpha,arm,arm26,avr32,blackfin,cris,frv,h8300,ia64,m32r,m68k,m68knommu,mips,microblaze,mn10300,parisc,powerpc,ppc,s390,sh,sh64,sparc,sparc64,um,v850,xtensa}
package_kernel26-docs() {
pkgdesc="Kernel hackers manual - HTML documentation that comes with the Linux kernel."
cd ${srcdir}/linux-$_basekernel
mkdir -p $pkgdir/usr/src/linux-$_kernver
mv Documentation $pkgdir/usr/src/linux-$_kernver
find $pkgdir -type f -exec chmod 444 {} \;
find $pkgdir -type d -exec chmod 755 {} \;
# remove a file already in kernel26 package
rm -f $pkgdir/usr/src/linux-$_kernver/Documentation/DocBook/Makefile
I wonder if localyesconfig would take care of broadcom-wl for me...
Last edited by Ben9250 (2011-04-20 00:12:44)Thank you. I guess trying the abs method wouldn't hurt. My main issue was configuration. I've only just skimmed the PKGBUILD so I'm not aware of how it handles it. I suppose I could write my own as described in the wiki as well. Thanks again.
Edit: Further research has revealed to me that the kernel headers are merely there for when the full source tree isn't. Seeing as the full tree is present in my case, the headers are unnecessary. I may take graysky's advice though and use pacman to manage my kernel.
Last edited by smithr.michael1997 (2011-03-31 02:17:29) -
Kernel26-icc compiled with Intel's compiler instead of gcc
I'm working on kernel26-icc, it's the kernel26 but compiled with Intel's compiler. Can't seem to upload it to AUR ("Invalid name: only lowercase letters are allowed.")
http://www.linuxdna.com/
So far I've this:
PKGBUILD
# Maintainer: Mathias Burén <[email protected]>
pkgname=('kernel26-icc' 'kernel26-icc-firmware' 'kernel26-icc-headers') # Build icc kernel
_kernelname=${pkgname#kernel26-icc}
_basekernel=2.6.33
pkgver=${_basekernel}
pkgrel=1
arch=(x86_64)
license=('GPL2')
url="http://www.linuxdna.com/"
source=(ftp://ftp.kernel.org/pub/linux/kernel/v2.6/linux-$_basekernel.tar.bz2
# the main kernel config files
config.x86_64
# standard config files for mkinitcpio ramdisk
kernel26-icc.preset
http://www.linuxdna.com/dna-2.6.33-intel64.patch)
makedepends=('icc')
md5sums=('c3883760b18d50e8d78819c54d579b00'
'5c91374d56f115ba4324978d5b002711'
'a4fd3c59751194bc118c70d1348436ab'
'a307beb562eb7e68a6f3e2fb5fc216a3')
build() {
cd ${srcdir}/linux-$_basekernel
cat ../config.x86_64 >./.config
patch -p1 < ../dna-2.6.33-intel64.patch || return 1
if [ "${_kernelname}" != "" ]; then
sed -i "s|CONFIG_LOCALVERSION=.*|CONFIG_LOCALVERSION=\"${_kernelname}\"|g" ./.config
fi
# get kernel version
make prepare
# load configuration
# Configure the kernel. Replace the line below with one of your choice.
make menuconfig # CLI menu for configuration
#make xconfig # X-based configuration
#make oldconfig # using old config from previous kernel version
# ... or manually edit .config
# stop here
# this is useful to configure the kernel
#msg "Stopping build"
#return 1
yes "" | make config
# build!
make bzImage modules || return 1
package_kernel26-icc() {
pkgdesc="The Linux Kernel and modules built with ICC"
backup=(etc/mkinitcpio.d/${pkgname}.preset)
depends=('coreutils' 'kernel26-icc-firmware>=2.6.33' 'module-init-tools' 'mkinitcpio>=0.5.20')
install=kernel26-icc.install
optdepends=('crda: to set the correct wireless channels of your country')
KARCH=x86
cd ${srcdir}/linux-$_basekernel
# get kernel version
_kernver="$(make kernelrelease)"
mkdir -p ${pkgdir}/{lib/modules,boot}
make INSTALL_MOD_PATH=${pkgdir} modules_install || return 1
cp System.map ${pkgdir}/boot/System.map26${_kernelname}
cp arch/$KARCH/boot/bzImage ${pkgdir}/boot/vmlinuz26${_kernelname}
# # add vmlinux
install -m644 -D vmlinux ${pkgdir}/usr/src/linux-${_kernver}/vmlinux
# install fallback mkinitcpio.conf file and preset file for kernel
install -m644 -D ${srcdir}/kernel26.preset ${pkgdir}/etc/mkinitcpio.d/${pkgname}.preset || return 1
# set correct depmod command for install
sed \
-e "s/KERNEL_NAME=.*/KERNEL_NAME=${_kernelname}/g" \
-e "s/KERNEL_VERSION=.*/KERNEL_VERSION=${_kernver}/g" \
-i $startdir/kernel26.install
sed \
-e "s|source .*|source /etc/mkinitcpio.d/kernel26${_kernelname}.kver|g" \
-e "s|default_image=.*|default_image=\"/boot/${pkgname}.img\"|g" \
-e "s|fallback_image=.*|fallback_image=\"/boot/${pkgname}-fallback.img\"|g" \
-i ${pkgdir}/etc/mkinitcpio.d/${pkgname}.preset
echo -e "# DO NOT EDIT THIS FILE\nALL_kver='${_kernver}'" > ${pkgdir}/etc/mkinitcpio.d/${pkgname}.kver
# remove build and source links
rm -f ${pkgdir}/lib/modules/${_kernver}/{source,build}
# remove the firmware
rm -rf ${pkgdir}/lib/firmware
package_kernel26-icc-headers() {
pkgdesc="Header files and scripts for building modules for kernel26-icc"
mkdir -p ${pkgdir}/lib/modules/${_kernver}
cd ${pkgdir}/lib/modules/${_kernver}
ln -sf ../../../usr/src/linux-${_kernver} build
cd ${srcdir}/linux-$_basekernel
install -D -m644 Makefile \
${pkgdir}/usr/src/linux-${_kernver}/Makefile
install -D -m644 kernel/Makefile \
${pkgdir}/usr/src/linux-${_kernver}/kernel/Makefile
install -D -m644 .config \
${pkgdir}/usr/src/linux-${_kernver}/.config
mkdir -p ${pkgdir}/usr/src/linux-${_kernver}/include
for i in acpi asm-{generic,x86} config linux math-emu media net pcmcia scsi sound trace video; do
cp -a include/$i ${pkgdir}/usr/src/linux-${_kernver}/include/
done
# copy arch includes for external modules
mkdir -p ${pkgdir}/usr/src/linux-${_kernver}/arch/x86
cp -a arch/x86/include ${pkgdir}/usr/src/linux-${_kernver}/arch/x86/
# copy files necessary for later builds, like nvidia and vmware
cp Module.symvers ${pkgdir}/usr/src/linux-${_kernver}
cp -a scripts ${pkgdir}/usr/src/linux-${_kernver}
# fix permissions on scripts dir
chmod og-w -R ${pkgdir}/usr/src/linux-${_kernver}/scripts
mkdir -p ${pkgdir}/usr/src/linux-${_kernver}/.tmp_versions
mkdir -p ${pkgdir}/usr/src/linux-${_kernver}/arch/$KARCH/kernel
cp arch/$KARCH/Makefile ${pkgdir}/usr/src/linux-${_kernver}/arch/$KARCH/
if [ "$CARCH" = "i686" ]; then
cp arch/$KARCH/Makefile_32.cpu ${pkgdir}/usr/src/linux-${_kernver}/arch/$KARCH/
fi
cp arch/$KARCH/kernel/asm-offsets.s ${pkgdir}/usr/src/linux-${_kernver}/arch/$KARCH/kernel/
# add headers for lirc package
mkdir -p ${pkgdir}/usr/src/linux-${_kernver}/drivers/media/video
cp drivers/media/video/*.h ${pkgdir}/usr/src/linux-${_kernver}/drivers/media/video/
for i in bt8xx cpia2 cx25840 cx88 em28xx et61x251 pwc saa7134 sn9c102 usbvideo zc0301; do
mkdir -p ${pkgdir}/usr/src/linux-${_kernver}/drivers/media/video/$i
cp -a drivers/media/video/$i/*.h ${pkgdir}/usr/src/linux-${_kernver}/drivers/media/video/$i
done
# add docbook makefile
install -D -m644 Documentation/DocBook/Makefile \
${pkgdir}/usr/src/linux-${_kernver}/Documentation/DocBook/Makefile
# add dm headers
mkdir -p ${pkgdir}/usr/src/linux-${_kernver}/drivers/md
cp drivers/md/*.h ${pkgdir}/usr/src/linux-${_kernver}/drivers/md
# add inotify.h
mkdir -p ${pkgdir}/usr/src/linux-${_kernver}/include/linux
cp include/linux/inotify.h ${pkgdir}/usr/src/linux-${_kernver}/include/linux/
# add wireless headers
mkdir -p ${pkgdir}/usr/src/linux-${_kernver}/net/mac80211/
cp net/mac80211/*.h ${pkgdir}/usr/src/linux-${_kernver}/net/mac80211/
# add dvb headers for external modules
# in reference to:
# http://bugs.archlinux.org/task/9912
mkdir -p ${pkgdir}/usr/src/linux-${_kernver}/drivers/media/dvb/dvb-core
cp drivers/media/dvb/dvb-core/*.h ${pkgdir}/usr/src/linux-${_kernver}/drivers/media/dvb/dvb-core/
# add dvb headers for external modules
# in reference to:
# http://bugs.archlinux.org/task/11194
mkdir -p ${pkgdir}/usr/src/linux-${_kernver}/include/config/dvb/
cp include/config/dvb/*.h ${pkgdir}/usr/src/linux-${_kernver}/include/config/dvb/
# add dvb headers for http://mcentral.de/hg/~mrec/em28xx-new
# in reference to:
# http://bugs.archlinux.org/task/13146
mkdir -p ${pkgdir}/usr/src/linux-${_kernver}/drivers/media/dvb/frontends/
cp drivers/media/dvb/frontends/lgdt330x.h ${pkgdir}/usr/src/linux-${_kernver}/drivers/media/dvb/frontends/
cp drivers/media/video/msp3400-driver.h ${pkgdir}/usr/src/linux-${_kernver}/drivers/media/dvb/frontends/
# add xfs and shmem for aufs building
mkdir -p ${pkgdir}/usr/src/linux-${_kernver}/fs/xfs
mkdir -p ${pkgdir}/usr/src/linux-${_kernver}/mm
cp fs/xfs/xfs_sb.h ${pkgdir}/usr/src/linux-${_kernver}/fs/xfs/xfs_sb.h
# add headers vor virtualbox
# in reference to:
# http://bugs.archlinux.org/task/14568
cp -a include/drm $pkgdir/usr/src/linux-${_kernver}/include/
# add headers for broadcom wl
# in reference to:
# http://bugs.archlinux.org/task/14568
cp -a include/trace $pkgdir/usr/src/linux-${_kernver}/include/
# copy in Kconfig files
for i in `find . -name "Kconfig*"`; do
mkdir -p ${pkgdir}/usr/src/linux-${_kernver}/`echo $i | sed 's|/Kconfig.*||'`
cp $i ${pkgdir}/usr/src/linux-${_kernver}/$i
done
cd ${pkgdir}/usr/src/linux-${_kernver}/include && ln -s asm-$KARCH asm
# add header for aufs2-util
cp -a ${srcdir}/linux-$_basekernel/include/asm-generic/bitsperlong.h ${pkgdir}/usr/src/linux-${_kernver}/include/asm/
chown -R root.root ${pkgdir}/usr/src/linux-${_kernver}
find ${pkgdir}/usr/src/linux-${_kernver} -type d -exec chmod 755 {} \;
# remove unneeded architectures
rm -rf ${pkgdir}/usr/src/linux-${_kernver}/arch/{alpha,arm,arm26,avr32,blackfin,cris,frv,h8300,ia64,m32r,m68k,m68knommu,mips,microblaze,mn10300,parisc,powerpc,ppc,s390,sh,sh64,sparc,sparc64,um,v850,xtensa}
package_kernel26-icc-firmware() {
pkgdesc="The included firmware files of kernel26-icc"
cd ${srcdir}/linux-$_basekernel
make firmware || return 1
make INSTALL_MOD_PATH=${pkgdir} firmware_install || return 1
kernel26-icc.preset
# mkinitcpio preset file for kernel26-icc
# DO NOT EDIT THIS LINE:
source /etc/mkinitcpio.d/kernel26-icc.kver
ALL_config="/etc/mkinitcpio.conf"
PRESETS=('default' 'fallback')
#default_config="/etc/mkinitcpio.conf"
default_image="/boot/kernel26-icc.img"
#default_options=""
#fallback_config="/etc/mkinitcpio.conf"
fallback_image="/boot/kernel26-icc-fallback.img"
fallback_options="-S autodetect"
kernel26-icc.install
# arg 1: the new package version
# arg 2: the old package version
KERNEL_NAME=-icc
KERNEL_VERSION=2.6.33-icc
post_install () {
# updating module dependencies
echo ">>> Updating module dependencies. Please wait ..."
depmod $KERNEL_VERSION
# generate init ramdisks
echo ">>> MKINITCPIO SETUP"
echo ">>> ----------------"
echo ">>> If you use LVM2, Encrypted root or software RAID,"
echo ">>> Ensure you enable support in /etc/mkinitcpio.conf ."
echo ">>> More information about mkinitcpio setup can be found here:"
echo ">>> http://wiki.archlinux.org/index.php/Mkinitcpio"
echo ""
echo ">>> Generating initial ramdisk, using mkinitcpio. Please wait..."
/sbin/mkinitcpio -p kernel26${KERNEL_NAME}
post_upgrade() {
pacman -Q grub &>/dev/null
hasgrub=$?
pacman -Q grub2 &>/dev/null
hasgrub2=$?
pacman -Q lilo &>/dev/null
haslilo=$?
# reminder notices
if [ $haslilo -eq 0 ]; then
echo ">>>"
if [ $hasgrub -eq 0 -o $hasgrub2 -eq 0 ]; then
echo ">>> If you use the LILO bootloader, you should run 'lilo' before rebooting."
else
echo ">>> You appear to be using the LILO bootloader. You should run"
echo ">>> 'lilo' before rebooting."
fi
echo ">>>"
fi
if grep "^[^#]*/boot" /etc/fstab 2>&1 >/dev/null; then
if ! grep "/boot" /etc/mtab 2>&1 >/dev/null; then
echo "WARNING: /boot appears to be a seperate partition but is not mounted"
echo " This is most likely not what you want. Please mount your /boot"
echo " partition and reinstall the kernel unless you are sure this is OK"
fi
fi
if [ "`vercmp $2 2.6.13`" -lt 0 ]; then
# important upgrade notice
echo ">>>"
echo ">>> IMPORTANT KERNEL UPGRADE NOTICE"
echo ">>> -------------------------------"
echo ">>> As of kernel 2.6.13, DevFS is NO LONGER AVAILABLE!"
echo ">>> If you still use DevFS, please make the transition to uDev before"
echo ">>> rebooting. If you really need to stay with DevFS for some reason,"
echo ">>> then you can manually downgrade to an older version:"
echo ">>>"
echo ">>> # pacman -U http://archlinux.org/~judd/kernel/kernel26-scsi-2.6.12.2-1.pkg.tar.gz"
echo ">>>"
echo ">>> If you choose to downgrade, don't forget to add kernel26-scsi to your"
echo ">>> IgnorePkg list in /etc/pacman.conf"
echo ">>>"
echo ">>> (NOTE: The following portion applies to uDev users as well!)"
echo ">>>"
echo ">>> If you use any DevFS paths in your GRUB menu.lst, then you will not"
echo ">>> be able to boot! Change your root= parameter to use the classic"
echo ">>> naming scheme."
echo ">>>"
echo ">>> EXAMPLES:"
echo ">>> - change root=/dev/discs/disc0/part3 to root=/dev/sda3"
echo ">>> - change root=/dev/md/0 to root=/dev/md0"
echo ">>>"
fi
# generate new init ramdisk
if [ "`vercmp $2 2.6.18`" -lt 0 ]; then
echo ">>> --------------------------------------------------------------"
echo ">>> | WARNING: |"
echo ">>> |mkinitrd is not supported anymore in kernel >=2.6.18 series!|"
echo ">>> | Please change to Mkinitcpio setup. |"
echo ">>> --------------------------------------------------------------"
echo ">>>"
fi
# updating module dependencies
echo ">>> Updating module dependencies. Please wait ..."
depmod $KERNEL_VERSION
echo ">>> MKINITCPIO SETUP"
echo ">>> ----------------"
if [ "`vercmp $2 2.6.18`" -lt 0 ]; then
echo ">>> Please change your bootloader config files:"
echo ">>> Grub: /boot/grub/menu.lst | Lilo: /etc/lilo.conf"
echo "------------------------------------------------"
echo "| - initrd26.img to kernel26${KERNEL_NAME}.img |"
echo "| - initrd26-full.img to kernel26${KERNEL_NAME}-fallback.img |"
echo "------------------------------------------------"
fi
if [ "`vercmp $2 2.6.19`" -lt 0 ]; then
echo ""
echo ">>> New PATA/IDE subsystem - EXPERIMENTAL"
echo ">>> ----------"
echo ">>> To use the new pata drivers, change the 'ide' hook "
echo ">>> to 'pata' in /etc/mkinicpio.conf HOOKS="
echo ">>> The new system changes: /dev/hd? to /dev/sd?"
echo ">>> Don't forget to modify GRUB, LILO and fstab to the"
echo ">>> new naming system. "
echo ">>> eg: hda3 --> sda3, hdc8 --> sdc8"
echo ""
echo ">>> piix/ata_piix (Intel chipsets) - IMPORTANT"
echo "----------"
echo ">>> If you have enabled ide/pata/sata HOOKs in /etc/mkinitcpio.conf"
echo ">>> the 'ata_piix' module will be used."
echo ">>> This may cause your devices to shift names, eg:"
echo ">>> - IDE: devices from hd? to sd?"
echo ">>> - SATA: sda might shift to sdc if you have 2 other disks on a PIIX IDE port."
echo ">>> To check if this will affect you, check 'mkinitcpio -M' for piix/ata_piix"
echo ""
fi
echo ">>> If you use LVM2, Encrypted root or software RAID,"
echo ">>> Ensure you enable support in /etc/mkinitcpio.conf ."
echo ">>> More information about mkinitcpio setup can be found here:"
echo ">>> http://wiki.archlinux.org/index.php/Mkinitcpio"
echo ""
echo ">>> Generating initial ramdisk, using mkinitcpio. Please wait..."
if [ "`vercmp $2 2.6.19`" -lt 0 ]; then
/sbin/mkinitcpio -p kernel26${KERNEL_NAME} -m "ATTENTION:\nIf you get a kernel panic below
and are using an Intel chipset, append 'earlymodules=piix' to the
kernel commandline"
else
/sbin/mkinitcpio -p kernel26${KERNEL_NAME}
fi
if [ "`vercmp $2 2.6.21`" -lt 0 ]; then
echo ""
echo "Important ACPI Information:"
echo ">>> Since 2.6.20.7 all possible ACPI parts are modularized."
echo ">>> The modules are located at:"
echo ">>> /lib/modules/$(uname -r)/kernel/drivers/acpi"
echo ">>> For more information about ACPI modules check this wiki page:"
echo ">>> 'http://wiki.archlinux.org/index.php/ACPI_modules'"
fi
post_remove() {
rm -f /boot/kernel26${KERNEL_NAME}.img
rm -f /boot/kernel26${KERNEL_NAME}-fallback.img
Then there's of course the config, it's based on kernel26 at the moment,.
I'm building it now, to test. I had to install icc manually because the AUR package for icc didn't work for me. I had to install icc manually (run the installer), but that wasn't enough. Before makepkg, you have to add the icc to $PATH e.g.
PATH=$PATH:/opt/intel/Compiler/11.1/064/bin/intel64
and execute iccvars_intel64.sh which is in that folder.
Last edited by Fackamato (2010-02-25 23:43:38)Ashren wrote:So there is a significant performance gain with ICC? Compilation time wise or?
icc kernel compiles in similar time as gcc kernel, or if there any differences these may be negligible. To be honest I was not really interested in compiling times (was doing somethig else as it takes ~12 min on my system to finish kernel compilation), but rather with overall kernel performance. This is not the same as OS performance, but I am planning to compile firefox with icc and maybe some other stuff (if I am bored enough).
If you have 32-bit OS (I have no idea how it will work on 64-bit), try it. I can't post PKGBUILD for 32-bit icc kernel because I don't use PKGBUILD for kernels or nvidia as I have found it limiting/cumbersome/unnecessary (while PKGBUILDs work great for anything else on Arch).
The only part really annoying is intel server speed. Downloading icc sources (710MB for 32-bit only) tahes two hours. If you try to get 32/64bit sources even longer (1GB download).
32-bit icc PKGBUILD package requires only one modification related to Release Notes otherwise makepkg will fail. Once installed export icc path, edit kernel Makefile and change one line related to compiler: change gcc to icc. You can also add some compiling optimizations.
Pretty easy if you did compile kernel before.
note added:
actually combination of icc and zen seems to have nice effect on desktop responsiveness (this is 2.6.33)
Last edited by broch (2010-02-26 19:54:57) -
[Solved] Compiling a new kernel with ABS
I've made it through the whole process outlined in the wiki, up to installing with pacman. Pacman is telling me that the stock arch kernel is a conflicting package and wants to remove it. I want to hang on to it in case I've messed something up. What am I doing wrong? I know you can have two kernels installed. Using the traditional way I can get this, but I'd rather keep to doing things The Arch Way.
Last edited by Morrvick (2011-11-17 00:40:30)I double checked what I was doing, and I have done that. Here is my modified PKGBUILD:
# $Id: PKGBUILD 130991 2011-07-09 12:23:51Z thomas $
# Maintainer: Tobias Powalowski <[email protected]>
# Maintainer: Thomas Baechler <[email protected]>
pkgbase=linux
#pkgname=('linux' 'linux-headers' 'linux-docs') # Build stock -ARCH kernel
pkgname=('linux-morrvick' 'linux-headers-morrvick') # Build kernel with a different name
_kernelname=${pkgname#linux}
_basekernel=3.1
pkgver=${_basekernel}.1
pkgrel=1
arch=('i686' 'x86_64')
url="http://www.kernel.org/"
license=('GPL2')
makedepends=('xmlto' 'docbook-xsl')
options=('!strip')
source=("http://www.kernel.org/pub/linux/kernel/v3.x/linux-3.1.tar.xz"
"http://www.kernel.org/pub/linux/kernel/v3.x/patch-${pkgver}.xz"
# the main kernel config files
'config' 'config.x86_64'
# standard config files for mkinitcpio ramdisk
"${pkgname}.preset"
'change-default-console-loglevel.patch'
'i915-fix-ghost-tv-output.patch'
'i915-fix-incorrect-error-message.patch'
'usb-add-reset-resume-quirk-for-several-webcams.patch')
md5sums=('edbdc798f23ae0f8045c82f6fa22c536'
'2bf7eb28a58238e1a062fa7393bf7824'
'cbaaa923f00c1935055273ccc1630144'
'93687a4b7e1e6bcd4e7417d6e5079bc4'
'eb14dcfd80c00852ef81ded6e826826a'
'9d3c56a4b999c8bfbd4018089a62f662'
'263725f20c0b9eb9c353040792d644e5'
'a50c9076012cb2dda49952dc6ec3e9c1'
'52d41fa61e80277ace2b994412a0c856')
build() {
cd "${srcdir}/linux-${_basekernel}"
# add upstream patch
patch -p1 -i "${srcdir}/patch-${pkgver}"
# add latest fixes from stable queue, if needed
# http://git.kernel.org/?p=linux/kernel/git/stable/stable-queue.git
# Some chips detect a ghost TV output
# mailing list discussion: http://lists.freedesktop.org/archives/intel-gfx/2011-April/010371.html
# Arch Linux bug report: FS#19234
# It is unclear why this patch wasn't merged upstream, it was accepted,
# then dropped because the reasoning was unclear. However, it is clearly
# needed.
patch -Np1 -i "${srcdir}/i915-fix-ghost-tv-output.patch"
# In 3.1.1, a DRM_DEBUG message is falsely declared as DRM_ERROR. This
# worries users, as this message is displayed even at loglevel 4. Fix
# this.
patch -Np1 -i "${srcdir}/i915-fix-incorrect-error-message.patch"
# Add the USB_QUIRK_RESET_RESUME for several webcams
# FS#26528
patch -Np1 -i "${srcdir}/usb-add-reset-resume-quirk-for-several-webcams.patch"
# set DEFAULT_CONSOLE_LOGLEVEL to 4 (same value as the 'quiet' kernel param)
# remove this when a Kconfig knob is made available by upstream
# (relevant patch sent upstream: https://lkml.org/lkml/2011/7/26/227)
patch -Np1 -i "${srcdir}/change-default-console-loglevel.patch"
if [ "${CARCH}" = "x86_64" ]; then
cat "${srcdir}/config.x86_64" > ./.config
else
cat "${srcdir}/config" > ./.config
fi
if [ "${_kernelname}" != "" ]; then
sed -i "s|CONFIG_LOCALVERSION=.*|CONFIG_LOCALVERSION=\"${_kernelname}\"|g" ./.config
fi
# set extraversion to pkgrel
sed -ri "s|^(EXTRAVERSION =).*|\1 -${pkgrel}|" Makefile
# get kernel version
make prepare
# load configuration
# Configure the kernel. Replace the line below with one of your choice.
#make menuconfig # CLI menu for configuration
#make nconfig # new CLI menu for configuration
make xconfig # X-based configuration
#make oldconfig # using old config from previous kernel version
# ... or manually edit .config
# stop here
# this is useful to configure the kernel
#msg "Stopping build"
#return 1
yes "" | make config
# build!
make ${MAKEFLAGS} bzImage modules
package_linux-morrvick() {
pkgdesc="The Linux Kernel and modules"
groups=('base')
depends=('coreutils' 'linux-firmware' 'module-init-tools>=3.16' 'mkinitcpio>=0.7')
optdepends=('crda: to set the correct wireless channels of your country')
provides=('kernel26')
conflicts=('kernel26')
replaces=('kernel26')
backup=("etc/mkinitcpio.d/${pkgname}.preset")
install=${pkgname}.install
cd "${srcdir}/linux-${_basekernel}"
KARCH=x86
# get kernel version
_kernver="$(make kernelrelease)"
mkdir -p "${pkgdir}"/{lib/modules,lib/firmware,boot}
make INSTALL_MOD_PATH="${pkgdir}" modules_install
cp arch/$KARCH/boot/bzImage "${pkgdir}/boot/vmlinuz-${pkgname}"
# add vmlinux
install -D -m644 vmlinux "${pkgdir}/usr/src/linux-${_kernver}/vmlinux"
# install fallback mkinitcpio.conf file and preset file for kernel
install -D -m644 "${srcdir}/${pkgname}.preset" "${pkgdir}/etc/mkinitcpio.d/${pkgname}.preset"
# set correct depmod command for install
sed \
-e "s/KERNEL_NAME=.*/KERNEL_NAME=${_kernelname}/g" \
-e "s/KERNEL_VERSION=.*/KERNEL_VERSION=${_kernver}/g" \
-i "${startdir}/${pkgname}.install"
sed \
-e "s|ALL_kver=.*|ALL_kver=\"/boot/vmlinuz-${pkgname}\"|g" \
-e "s|default_image=.*|default_image=\"/boot/initramfs-${pkgname}.img\"|g" \
-e "s|fallback_image=.*|fallback_image=\"/boot/initramfs-${pkgname}-fallback.img\"|g" \
-i "${pkgdir}/etc/mkinitcpio.d/${pkgname}.preset"
# remove build and source links
rm -f "${pkgdir}"/lib/modules/${_kernver}/{source,build}
# remove the firmware
rm -rf "${pkgdir}/lib/firmware"
# gzip -9 all modules to save 100MB of space
find "${pkgdir}" -name '*.ko' -exec gzip -9 {} \;
# make room for external modules
ln -s "../extramodules-${_basekernel}${_kernelname:--ARCH}" "${pkgdir}/lib/modules/${_kernver}/extramodules"
# add real version for building modules and running depmod from post_install/upgrade
mkdir -p "${pkgdir}/lib/modules/extramodules-${_basekernel}${_kernelname:--ARCH}"
echo "${_kernver}" > "${pkgdir}/lib/modules/extramodules-${_basekernel}${_kernelname:--ARCH}/version"
package_linux-headers-morrvick() {
pkgdesc="Header files and scripts for building modules for linux kernel"
provides=('kernel26-headers')
conflicts=('kernel26-headers')
replaces=('kernel26-headers')
mkdir -p "${pkgdir}/lib/modules/${_kernver}"
cd "${pkgdir}/lib/modules/${_kernver}"
ln -sf ../../../usr/src/linux-${_kernver} build
cd "${srcdir}/linux-${_basekernel}"
install -D -m644 Makefile \
"${pkgdir}/usr/src/linux-${_kernver}/Makefile"
install -D -m644 kernel/Makefile \
"${pkgdir}/usr/src/linux-${_kernver}/kernel/Makefile"
install -D -m644 .config \
"${pkgdir}/usr/src/linux-${_kernver}/.config"
mkdir -p "${pkgdir}/usr/src/linux-${_kernver}/include"
for i in acpi asm-generic config crypto drm generated linux math-emu \
media net pcmcia scsi sound trace video xen; do
cp -a include/${i} "${pkgdir}/usr/src/linux-${_kernver}/include/"
done
# copy arch includes for external modules
mkdir -p "${pkgdir}/usr/src/linux-${_kernver}/arch/x86"
cp -a arch/x86/include "${pkgdir}/usr/src/linux-${_kernver}/arch/x86/"
# copy files necessary for later builds, like nvidia and vmware
cp Module.symvers "${pkgdir}/usr/src/linux-${_kernver}"
cp -a scripts "${pkgdir}/usr/src/linux-${_kernver}"
# fix permissions on scripts dir
chmod og-w -R "${pkgdir}/usr/src/linux-${_kernver}/scripts"
mkdir -p "${pkgdir}/usr/src/linux-${_kernver}/.tmp_versions"
mkdir -p "${pkgdir}/usr/src/linux-${_kernver}/arch/${KARCH}/kernel"
cp arch/${KARCH}/Makefile "${pkgdir}/usr/src/linux-${_kernver}/arch/${KARCH}/"
if [ "${CARCH}" = "i686" ]; then
cp arch/${KARCH}/Makefile_32.cpu "${pkgdir}/usr/src/linux-${_kernver}/arch/${KARCH}/"
fi
cp arch/${KARCH}/kernel/asm-offsets.s "${pkgdir}/usr/src/linux-${_kernver}/arch/${KARCH}/kernel/"
# add headers for lirc package
mkdir -p "${pkgdir}/usr/src/linux-${_kernver}/drivers/media/video"
cp drivers/media/video/*.h "${pkgdir}/usr/src/linux-${_kernver}/drivers/media/video/"
for i in bt8xx cpia2 cx25840 cx88 em28xx et61x251 pwc saa7134 sn9c102; do
mkdir -p "${pkgdir}/usr/src/linux-${_kernver}/drivers/media/video/${i}"
cp -a drivers/media/video/${i}/*.h "${pkgdir}/usr/src/linux-${_kernver}/drivers/media/video/${i}"
done
# add docbook makefile
install -D -m644 Documentation/DocBook/Makefile \
"${pkgdir}/usr/src/linux-${_kernver}/Documentation/DocBook/Makefile"
# add dm headers
mkdir -p "${pkgdir}/usr/src/linux-${_kernver}/drivers/md"
cp drivers/md/*.h "${pkgdir}/usr/src/linux-${_kernver}/drivers/md"
# add inotify.h
mkdir -p "${pkgdir}/usr/src/linux-${_kernver}/include/linux"
cp include/linux/inotify.h "${pkgdir}/usr/src/linux-${_kernver}/include/linux/"
# add wireless headers
mkdir -p "${pkgdir}/usr/src/linux-${_kernver}/net/mac80211/"
cp net/mac80211/*.h "${pkgdir}/usr/src/linux-${_kernver}/net/mac80211/"
# add dvb headers for external modules
# in reference to:
# http://bugs.archlinux.org/task/9912
mkdir -p "${pkgdir}/usr/src/linux-${_kernver}/drivers/media/dvb/dvb-core"
cp drivers/media/dvb/dvb-core/*.h "${pkgdir}/usr/src/linux-${_kernver}/drivers/media/dvb/dvb-core/"
# and...
# http://bugs.archlinux.org/task/11194
mkdir -p "${pkgdir}/usr/src/linux-${_kernver}/include/config/dvb/"
cp include/config/dvb/*.h "${pkgdir}/usr/src/linux-${_kernver}/include/config/dvb/"
# add dvb headers for http://mcentral.de/hg/~mrec/em28xx-new
# in reference to:
# http://bugs.archlinux.org/task/13146
mkdir -p "${pkgdir}/usr/src/linux-${_kernver}/drivers/media/dvb/frontends/"
cp drivers/media/dvb/frontends/lgdt330x.h "${pkgdir}/usr/src/linux-${_kernver}/drivers/media/dvb/frontends/"
cp drivers/media/video/msp3400-driver.h "${pkgdir}/usr/src/linux-${_kernver}/drivers/media/dvb/frontends/"
# add dvb headers
# in reference to:
# http://bugs.archlinux.org/task/20402
mkdir -p "${pkgdir}/usr/src/linux-${_kernver}/drivers/media/dvb/dvb-usb"
cp drivers/media/dvb/dvb-usb/*.h "${pkgdir}/usr/src/linux-${_kernver}/drivers/media/dvb/dvb-usb/"
mkdir -p "${pkgdir}/usr/src/linux-${_kernver}/drivers/media/dvb/frontends"
cp drivers/media/dvb/frontends/*.h "${pkgdir}/usr/src/linux-${_kernver}/drivers/media/dvb/frontends/"
mkdir -p "${pkgdir}/usr/src/linux-${_kernver}/drivers/media/common/tuners"
cp drivers/media/common/tuners/*.h "${pkgdir}/usr/src/linux-${_kernver}/drivers/media/common/tuners/"
# add xfs and shmem for aufs building
mkdir -p "${pkgdir}/usr/src/linux-${_kernver}/fs/xfs"
mkdir -p "${pkgdir}/usr/src/linux-${_kernver}/mm"
cp fs/xfs/xfs_sb.h "${pkgdir}/usr/src/linux-${_kernver}/fs/xfs/xfs_sb.h"
# copy in Kconfig files
for i in `find . -name "Kconfig*"`; do
mkdir -p "${pkgdir}"/usr/src/linux-${_kernver}/`echo ${i} | sed 's|/Kconfig.*||'`
cp ${i} "${pkgdir}/usr/src/linux-${_kernver}/${i}"
done
chown -R root.root "${pkgdir}/usr/src/linux-${_kernver}"
find "${pkgdir}/usr/src/linux-${_kernver}" -type d -exec chmod 755 {} \;
# strip scripts directory
find "${pkgdir}/usr/src/linux-${_kernver}/scripts" -type f -perm -u+w 2>/dev/null | while read binary ; do
case "$(file -bi "${binary}")" in
*application/x-sharedlib*) # Libraries (.so)
/usr/bin/strip ${STRIP_SHARED} "${binary}";;
*application/x-archive*) # Libraries (.a)
/usr/bin/strip ${STRIP_STATIC} "${binary}";;
*application/x-executable*) # Binaries
/usr/bin/strip ${STRIP_BINARIES} "${binary}";;
esac
done
# remove unneeded architectures
rm -rf "${pkgdir}"/usr/src/linux-${_kernver}/arch/{alpha,arm,arm26,avr32,blackfin,cris,frv,h8300,ia64,m32r,m68k,m68knommu,mips,microblaze,mn10300,parisc,powerpc,ppc,s390,sh,sh64,sparc,sparc64,um,v850,xtensa}
package_linux-docs() {
pkgdesc="Kernel hackers manual - HTML documentation that comes with the Linux kernel."
provides=('kernel26-docs')
conflicts=('kernel26-docs')
replaces=('kernel26-docs')
cd "${srcdir}/linux-${_basekernel}"
mkdir -p "${pkgdir}/usr/src/linux-${_kernver}"
cp -al Documentation "${pkgdir}/usr/src/linux-${_kernver}"
find "${pkgdir}" -type f -exec chmod 444 {} \;
find "${pkgdir}" -type d -exec chmod 755 {} \;
# remove a file already in linux package
rm -f "${pkgdir}/usr/src/linux-${_kernver}/Documentation/DocBook/Makefile"
After the compiling is finished:
sudo pacman -U linux-morrvick-3.1.1-1-x86_64.pkg.tar.xz
Password:
resolving dependencies...
looking for inter-conflicts...
:: linux-morrvick and linux are in conflict (kernel26). Remove linux? [y/N] n
error: unresolvable package conflicts detected
error: failed to prepare transaction (conflicting dependencies)
:: linux-morrvick and linux are in conflict (kernel26)
Any thoughts? -
[solved] building the kernel headers for custom kernels
well, ive been building several different kernels for my laptop, so that i can test stuff. but ive got a problem with the kernel headers.
ive mirrored the arch kernel's PKGBUILD and modified some naming to get a custom kernel. but when i try to build a custmo module, it complains the headers are broken. (example, vbox_build_module).
im pasting the pkgbuild here for future reference...if someone sees something thats plain wrong, please say so.
thanks
# $Id: PKGBUILD 60382 2009-12-04 15:31:11Z tpowa $
# Maintainer: Tobias Powalowski <[email protected]>
# Maintainer: Thomas Baechler <[email protected]>
pkgbase="kernel26"
#pkgname=('kernel26' 'kernel26-firmware' 'kernel26-headers') # Build stock -ARCH kernel
pkgname=('kernel26-git' 'kernel26-git-headers') # Build kernel with a different name
_kernelname=${pkgname#kernel26}
pkgver=2.6.34
pkgrel=1
_patchname=""
_branch="linux-2.6"
_gittag="v2.6.34-rc3"
#_gittag="origin"
arch=(i686 x86_64)
license=('GPL2')
groups=('base')
url="http://www.kernel.org"
source=(config
# standard config files for mkinitcpio ramdisk
kernel26.preset
${_patchname})
build() {
cd ${srcdir}/$_branch
msg "Fetching branch ${_branch}"
## FOR BISECT, Comment these lines
git reset --hard
git clean -d -f
git fetch
msg "Cheking out tag ${_gittag}"
git checkout $_gittag
### a patch
if [ "${_patchname}" != "" ]; then
patch -Np1 -i ${srcdir}/$_patchname || return 1
fi
# if [ "$CARCH" = "x86_64" ]; then
cat ../config.x86_64 >./.config
# else
cat ../config >./.config
# fi
if [ "${_kernelname}" != "" ]; then
sed -i "s|CONFIG_LOCALVERSION=.*|CONFIG_LOCALVERSION=\"${_kernelname}\"|g" ./.config
fi
# get kernel version
make prepare
# load configuration
# Configure the kernel. Replace the line below with one of your choice.
make menuconfig # CLI menu for configuration
#make xconfig # X-based configuration
#make oldconfig # using old config from previous kernel version
# ... or manually edit .config
# stop here
# this is useful to configure the kernel
#msg "Stopping build"
#return 1
yes "" | make config
# build!
make bzImage modules || return 1
package_kernel26-git() {
pkgdesc="The Linux Kernel and modules"
backup=(etc/mkinitcpio.d/${pkgname}.preset)
depends=('coreutils' 'kernel26-firmware>=2.6.32' 'module-init-tools' 'mkinitcpio>=0.5.20')
# pwc, ieee80211 and hostap-driver26 modules are included in kernel26 now
# nforce package support was abandoned by nvidia, kernel modules should cover everything now.
# kernel24 support is dropped since glibc24
replaces=('kernel24' 'kernel24-scsi' 'kernel26-scsi'
'alsa-driver' 'ieee80211' 'hostap-driver26'
'pwc' 'nforce' 'squashfs' 'unionfs' 'ivtv'
'zd1211' 'kvm-modules' 'iwlwifi' 'rt2x00-cvs'
'gspcav1' 'atl2' 'wlan-ng26' 'rt2500')
install=kernel26.install
optdepends=('crda: to set the correct wireless channels of your country')
KARCH=x86
cd ${srcdir}/$_branch
_kernver="$(make kernelrelease)"
mkdir -p ${pkgdir}/{lib/modules,boot}
make INSTALL_MOD_PATH=${pkgdir} modules_install || return 1
cp System.map ${pkgdir}/boot/System.map26${_kernelname}
cp arch/$KARCH/boot/bzImage ${pkgdir}/boot/vmlinuz26${_kernelname}
# # add vmlinux
install -m644 -D vmlinux ${pkgdir}/usr/src/linux-${_kernver}/vmlinux
# install fallback mkinitcpio.conf file and preset file for kernel
install -m644 -D ${srcdir}/kernel26.preset ${pkgdir}/etc/mkinitcpio.d/${pkgname}.preset || return 1
# set correct depmod command for install
sed \
-e "s/KERNEL_NAME=.*/KERNEL_NAME=${_kernelname}/g" \
-e "s/KERNEL_VERSION=.*/KERNEL_VERSION=${_kernver}/g" \
-i $startdir/kernel26.install
sed \
-e "s|source .*|source /etc/mkinitcpio.d/kernel26${_kernelname}.kver|g" \
-e "s|default_image=.*|default_image=\"/boot/${pkgname}.img\"|g" \
-e "s|fallback_image=.*|fallback_image=\"/boot/${pkgname}-fallback.img\"|g" \
-i ${pkgdir}/etc/mkinitcpio.d/${pkgname}.preset
echo -e "# DO NOT EDIT THIS FILE\nALL_kver='${_kernver}'" > ${pkgdir}/etc/mkinitcpio.d/${pkgname}.kver
# remove build and source links
rm -f ${pkgdir}/lib/modules/${_kernver}/{source,build}
# remove the firmware
rm -rf ${pkgdir}/lib/firmware
package_kernel26-git-headers() {
pkgdesc="Header files and scripts for building modules for kernel26"
mkdir -p ${pkgdir}/lib/modules/${_kernver}
cd ${pkgdir}/lib/modules/${_kernver}
ln -sf ../../../usr/src/linux-${_kernver} build
cd ${srcdir}/$_branch
install -D -m644 Makefile \
${pkgdir}/usr/src/linux-${_kernver}/Makefile
install -D -m644 kernel/Makefile \
${pkgdir}/usr/src/linux-${_kernver}/kernel/Makefile
install -D -m644 .config \
${pkgdir}/usr/src/linux-${_kernver}/.config
mkdir -p ${pkgdir}/usr/src/linux-${_kernver}/include
for i in acpi asm-{generic,x86} config linux math-emu media net pcmcia scsi sound trace video; do
cp -a include/$i ${pkgdir}/usr/src/linux-${_kernver}/include/
done
# copy arch includes for external modules
mkdir -p ${pkgdir}/usr/src/linux-${_kernver}/arch/x86
cp -a arch/x86/include ${pkgdir}/usr/src/linux-${_kernver}/arch/x86/
# copy files necessary for later builds, like nvidia and vmware
cp Module.symvers ${pkgdir}/usr/src/linux-${_kernver}
cp -a scripts ${pkgdir}/usr/src/linux-${_kernver}
# fix permissions on scripts dir
chmod og-w -R ${pkgdir}/usr/src/linux-${_kernver}/scripts
mkdir -p ${pkgdir}/usr/src/linux-${_kernver}/.tmp_versions
mkdir -p ${pkgdir}/usr/src/linux-${_kernver}/arch/$KARCH/kernel
cp arch/$KARCH/Makefile ${pkgdir}/usr/src/linux-${_kernver}/arch/$KARCH/
if [ "$CARCH" = "i686" ]; then
cp arch/$KARCH/Makefile_32.cpu ${pkgdir}/usr/src/linux-${_kernver}/arch/$KARCH/
fi
cp arch/$KARCH/kernel/asm-offsets.s ${pkgdir}/usr/src/linux-${_kernver}/arch/$KARCH/kernel/
# add headers for lirc package
mkdir -p ${pkgdir}/usr/src/linux-${_kernver}/drivers/media/video
cp drivers/media/video/*.h ${pkgdir}/usr/src/linux-${_kernver}/drivers/media/video/
for i in bt8xx cpia2 cx25840 cx88 em28xx et61x251 pwc saa7134 sn9c102 usbvideo zc0301; do
mkdir -p ${pkgdir}/usr/src/linux-${_kernver}/drivers/media/video/$i
cp -a drivers/media/video/$i/*.h ${pkgdir}/usr/src/linux-${_kernver}/drivers/media/video/$i
done
# add docbook makefile
install -D -m644 Documentation/DocBook/Makefile \
${pkgdir}/usr/src/linux-${_kernver}/Documentation/DocBook/Makefile
# add dm headers
mkdir -p ${pkgdir}/usr/src/linux-${_kernver}/drivers/md
cp drivers/md/*.h ${pkgdir}/usr/src/linux-${_kernver}/drivers/md
# add inotify.h
mkdir -p ${pkgdir}/usr/src/linux-${_kernver}/include/linux
cp include/linux/inotify.h ${pkgdir}/usr/src/linux-${_kernver}/include/linux/
# add wireless headers
mkdir -p ${pkgdir}/usr/src/linux-${_kernver}/net/mac80211/
cp net/mac80211/*.h ${pkgdir}/usr/src/linux-${_kernver}/net/mac80211/
# add dvb headers for external modules
# in reference to:
# http://bugs.archlinux.org/task/9912
mkdir -p ${pkgdir}/usr/src/linux-${_kernver}/drivers/media/dvb/dvb-core
cp drivers/media/dvb/dvb-core/*.h ${pkgdir}/usr/src/linux-${_kernver}/drivers/media/dvb/dvb-core/
# add dvb headers for external modules
# in reference to:
# http://bugs.archlinux.org/task/11194
mkdir -p ${pkgdir}/usr/src/linux-${_kernver}/include/config/dvb/
cp include/config/dvb/*.h ${pkgdir}/usr/src/linux-${_kernver}/include/config/dvb/
# add dvb headers for http://mcentral.de/hg/~mrec/em28xx-new
# in reference to:
# http://bugs.archlinux.org/task/13146
mkdir -p ${pkgdir}/usr/src/linux-${_kernver}/drivers/media/dvb/frontends/
cp drivers/media/dvb/frontends/lgdt330x.h ${pkgdir}/usr/src/linux-${_kernver}/drivers/media/dvb/frontends/
cp drivers/media/video/msp3400-driver.h ${pkgdir}/usr/src/linux-${_kernver}/drivers/media/dvb/frontends/
# add xfs and shmem for aufs building
mkdir -p ${pkgdir}/usr/src/linux-${_kernver}/fs/xfs
mkdir -p ${pkgdir}/usr/src/linux-${_kernver}/mm
cp fs/xfs/xfs_sb.h ${pkgdir}/usr/src/linux-${_kernver}/fs/xfs/xfs_sb.h
# add headers vor virtualbox
# in reference to:
# http://bugs.archlinux.org/task/14568
cp -a include/drm $pkgdir/usr/src/linux-${_kernver}/include/
# add headers for broadcom wl
# in reference to:
# http://bugs.archlinux.org/task/14568
cp -a include/trace $pkgdir/usr/src/linux-${_kernver}/include/
# copy in Kconfig files
for i in `find . -name "Kconfig*"`; do
mkdir -p ${pkgdir}/usr/src/linux-${_kernver}/`echo $i | sed 's|/Kconfig.*||'`
cp $i ${pkgdir}/usr/src/linux-${_kernver}/$i
done
cd ${pkgdir}/usr/src/linux-${_kernver}/include && ln -s asm-$KARCH asm
# add header for aufs2-util
cp -a ${srcdir}/$_branch/include/asm-generic/bitsperlong.h ${pkgdir}/usr/src/linux-${_kernver}/include/asm/
chown -R root.root ${pkgdir}/usr/src/linux-${_kernver}
find ${pkgdir}/usr/src/linux-${_kernver} -type d -exec chmod 755 {} \;
# remove unneeded architectures
rm -rf ${pkgdir}/usr/src/linux-${_kernver}/arch/{alpha,arm,arm26,avr32,blackfin,cris,frv,h8300,ia64,m32r,m68k,m68knommu,mips,microblaze,mn10300,parisc,powerpc,ppc,s390,sh,sh64,sparc,sparc64,um,v850,xtensa}
package_kernel26-firmware() {
pkgdesc="The included firmware files of the Linux Kernel"
groups=('base')
cd ${srcdir}/$_branch
make firmware || return 1
make INSTALL_MOD_PATH=${pkgdir} firmware_install || return 1
Last edited by eldragon (2010-04-04 14:58:16)ngoonee wrote:
Check out this line
for i in acpi asm-{generic,x86} config linux math-emu media net pcmcia scsi sound trace video; do
for anything that might be missing. The error message when compiling would give you more of a clue. Off-hand, you may need to add 'generated', as I recall I needed that when the kernel moved to 2.6.33.
Problem with vbox_build_module after Kernel update.
Would you care to elaborate for us less versed in "Linux Geek" skills?
Thanks.......
[root@Arch2009p2 jeff]# vbox_build_module
Building vboxdrv for Linux 2.6.33-ARCH
make[1]: Entering directory `/opt/VirtualBox/src/vboxdrv'
for f in . linux r0drv r0drv/generic r0drv/linux VBox common/err common/string common/log generic math/gcc; \
do rm -f $f/*.o $f/.*.cmd $f/.*.flags; done
rm -rf .vboxdrv* .tmp_ver* vboxdrv.* Module.symvers Modules.symvers modules.order
make[1]: Leaving directory `/opt/VirtualBox/src/vboxdrv'
make[1]: Entering directory `/opt/VirtualBox/src/vboxnetflt'
for f in . linux r0drv r0drv/linux VBox common/err common/string common/log generic math/gcc; \
do rm -f $f/*.o $f/.*.cmd $f/.*.flags; done
rm -rf .vboxnetflt* .tmp_ver* vboxnetflt.* Modules.symvers modules.order
make[1]: Leaving directory `/opt/VirtualBox/src/vboxnetflt'
make[1]: Entering directory `/opt/VirtualBox/src/vboxnetadp'
for f in . linux r0drv r0drv/linux VBox common/err common/string common/log generic math/gcc; \
do rm -f $f/*.o $f/.*.cmd $f/.*.flags; done
rm -rf .vboxnetadp* .tmp_ver* vboxnetadp.* Modules.symvers modules.order
make[1]: Leaving directory `/opt/VirtualBox/src/vboxnetadp'
rm -f vboxdrv.ko vboxnetflt.ko vboxnetadp.ko
*** Building 'vboxdrv' module ***
make[1]: Entering directory `/opt/VirtualBox/src/vboxdrv'
make KBUILD_VERBOSE= -C /lib/modules/2.6.33-ARCH/build SUBDIRS=/opt/VirtualBox/src/vboxdrv SRCROOT=/opt/VirtualBox/src/vboxdrv modules
make[2]: Entering directory `/usr/src/linux-2.6.33-ARCH'
CC [M] /opt/VirtualBox/src/vboxdrv/linux/SUPDrv-linux.o
In file included from /opt/VirtualBox/src/vboxdrv/include/VBox/types.h:34,
from /opt/VirtualBox/src/vboxdrv/linux/../SUPDrvInternal.h:39,
from /opt/VirtualBox/src/vboxdrv/linux/SUPDrv-linux.c:37:
/opt/VirtualBox/src/vboxdrv/include/iprt/types.h:100:30: error: linux/autoconf.h: No such file or directory
make[3]: *** [/opt/VirtualBox/src/vboxdrv/linux/SUPDrv-linux.o] Error 1
make[2]: *** [_module_/opt/VirtualBox/src/vboxdrv] Error 2
make[2]: Leaving directory `/usr/src/linux-2.6.33-ARCH'
make[1]: *** [vboxdrv] Error 2
make[1]: Leaving directory `/opt/VirtualBox/src/vboxdrv'
make: *** [all] Error 2 -
Hi guys,
I have a ASUS Xonar DGX PCI-E GX2.5 sound card since my onboard audio crapped out on my motherboard. I just did a first time install on my desktop and the rear portion of my card refuses to work. If I connect up my speakers to my analog output in the back I don't have any options in my sound manager for the analog output to just be a 2.0 system. I get 4.0, 4.1, 5.0, 5.1. All of which do not work obviously. Also my microphone doesn't work plugged into the actual card. If I plug them into the front panel audio, both the microphone and headphone out work. I did some searching, and it seems like a likely cause has something to do with amixer being multichannel. I tried several commands but wasn't successful in getting the audio to work through the back. Any help would be useful, I'm still trying to learn a lot about Arch while doing all this. Thanks in advance!
Solution. Using Alsamixer in terminal and selecting the analog out as stereo headphones, instead of stereo headphones (fp).
Last edited by 15goudreau (2014-08-04 21:56:36)Search for vid and pid combination, ergo 13f6:8788 in your case. This should be one of the search terms, vid and pid could be also separated, other search terms could include oxygen, sonar, dgx and so on. Simple google search should turn something up.
Edit: The point is to locate a thread/post where the support for this card was implemented/talked about. It could provide some further insight.
The simplest approach would be to download linux-rt sources from aur with yaourt, modify PKGBUILD, compile and then install.
yaourt -G linux-rt
cd linux-rt
Copy this into PKGBUILD replacing the original:
# Maintainer: Joakim Hernberg <[email protected]>
# Contributor: Ray Rashif <[email protected]>
# Contributor: timbosa <[email protected]>
# Contributor: Tobias Powalowski <[email protected]>
# Contributor: Thomas Baechler <[email protected]>
pkgbase=linux-rt
pkgname=('linux-rt' 'linux-rt-headers' 'linux-rt-docs') # Build realtime patched -rt kernel
#pkgname=linux-custom # Build kernel with a different name
_kernelname=${pkgname#linux}
_basekernel=3.14
_releasever=12
_rtpatchver=rt9
pkgrel=1
_pkgver=${_basekernel}.${_releasever}
pkgver=${_basekernel}.${_releasever}_${_rtpatchver}
arch=('i686' 'x86_64')
url="http://rt.wiki.kernel.org/"
license=('GPL2')
makedepends=('xmlto' 'docbook-xsl' 'kmod' 'inetutils' 'bc')
options=('!strip')
source=("https://www.kernel.org/pub/linux/kernel/v3.x/linux-${_basekernel}.tar.xz"
"https://www.kernel.org/pub/linux/kernel/v3.x/patch-${_pkgver}.xz"
"https://www.kernel.org/pub/linux/kernel/projects/rt/${_basekernel}/patch-${_pkgver}-${_rtpatchver}.patch.xz"
# the main kernel config files
'config' 'config.x86_64'
# standard config files for mkinitcpio ramdisk
"${pkgname}.preset"
'change-default-console-loglevel.patch'
'0001-Bluetooth-allocate-static-minor-for-vhci.patch'
'0002-module-allow-multiple-calls-to-MODULE_DEVICE_TABLE-p.patch'
'0003-module-remove-MODULE_GENERIC_TABLE.patch'
'0006-genksyms-fix-typeof-handling.patch'
'0007-asus-xonar-dgx.patch')
md5sums=('b621207b3f6ecbb67db18b13258f8ea8'
'89a5af1f3609d0c27e63fea298dd80ed'
'2aa3614e488efa939007a1c428406c30'
'a8126ad28c0a902a575397cacd099db2'
'843119a441c942efc5ec4b73c3c6ced5'
'eb14dcfd80c00852ef81ded6e826826a'
'6623d69fdc936d707990ca060dabd2ce'
'6839ddec74a5300beff1709a81b0e4f3'
'706549e8a05f33f7fc697f28c0ca71d2'
'd23fc66be93ebce698bd7da844789de1'
'16a161979f846b049e90daea907c35dd'
'SKIP')
prepare() {
cd "${srcdir}/linux-${_basekernel}"
# add upstream patch
msg "apply patch-${_pkgver}"
patch -p1 -i "${srcdir}/patch-${_pkgver}"
# add realtime patch
msg "applying patch-${_pkgver}-${_rtpatchver}.patch"
patch -p1 -i "${srcdir}/patch-${_pkgver}-${_rtpatchver}.patch"
# add latest fixes from stable queue, if needed
# http://git.kernel.org/?p=linux/kernel/git/stable/stable-queue.git
# set DEFAULT_CONSOLE_LOGLEVEL to 4 (same value as the 'quiet' kernel param)
# remove this when a Kconfig knob is made available by upstream
# (relevant patch sent upstream: https://lkml.org/lkml/2011/7/26/227)
msg "change-default-console-loglevel.patch"
patch -p1 -i "${srcdir}/change-default-console-loglevel.patch"
# Fix vhci warning in kmod (to restore every kernel maintainer's sanity)
msg "0001-Bluetooth-allocate-static-minor-for-vhci.patch"
patch -p1 -i "${srcdir}/0001-Bluetooth-allocate-static-minor-for-vhci.patch"
# Fix atkbd aliases
msg "0002-module-allow-multiple-calls-to-MODULE_DEVICE_TABLE-p.patch"
patch -p1 -i "${srcdir}/0002-module-allow-multiple-calls-to-MODULE_DEVICE_TABLE-p.patch"
msg "0003-module-remove-MODULE_GENERIC_TABLE.patch"
patch -p1 -i "${srcdir}/0003-module-remove-MODULE_GENERIC_TABLE.patch"
# Fix generation of symbol CRCs
# http://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=dc53324060f324e8af6867f57bf4891c13c6ef18
msg "0006-genksyms-fix-typeof-handling.patch"
patch -p1 -i "${srcdir}/0006-genksyms-fix-typeof-handling.patch"
msg "0007-asus-xonar-dgx.patch"
patch -p1 -i "${srcdir}/0007-asus-xonar-dgx.patch"
msg "All patches have successfully been applied"
if [ "${CARCH}" = "x86_64" ]; then
cat "${srcdir}/config.x86_64" > ./.config
else
cat "${srcdir}/config" > ./.config
fi
# if [ "${_kernelname}" != "" ]; then
# sed -i "s|CONFIG_LOCALVERSION=.*|CONFIG_LOCALVERSION=\"${_kernelname}\"|g" ./.config
# sed -i "s|CONFIG_LOCALVERSION_AUTO=.*|CONFIG_LOCALVERSION_AUTO=n|" ./.config
# fi
# set extraversion to pkgrel
#sed -ri "s|^(EXTRAVERSION =).*|\1 -${pkgrel}|" Makefile
# set localversion to pkgrel-rt
sed -i "s|CONFIG_LOCALVERSION=.*|CONFIG_LOCALVERSION=\"-${pkgrel}${_kernelname}\"|g" ./.config
# don't run depmod on 'make install'. We'll do this ourselves in packaging
sed -i '2iexit 0' scripts/depmod.sh
# get kernel version
make prepare
# load configuration
# Configure the kernel. Replace the line below with one of your choice.
#make menuconfig # CLI menu for configuration
#make nconfig # new CLI menu for configuration
#make xconfig # X-based configuration
#make oldconfig # using old config from previous kernel version
# ... or manually edit .config
# rewrite configuration
yes "" | make config >/dev/null
# stop here
# this is useful to configure the kernel
#msg "Stopping build"; return 1
build() {
cd "${srcdir}/linux-${_basekernel}"
make ${MAKEFLAGS} LOCALVERSION= bzImage modules
package_linux-rt() {
pkgdesc="The Linux Kernel and modules (with realtime preemption)."
#groups=('base')
depends=('coreutils' 'linux-firmware' 'kmod' 'mkinitcpio>=0.7')
optdepends=('crda: to set the correct wireless channels of your country')
# provides=("kernel26${_kernelname}=${pkgver}")
# conflicts=("kernel26${_kernelname}")
# replaces=("kernel26${_kernelname}")
backup=("etc/mkinitcpio.d/${pkgname}.preset")
install=${pkgname}.install
cd "${srcdir}/linux-${_basekernel}"
KARCH=x86
# get kernel version
_kernver="$(make LOCALVERSION= kernelrelease)"
# _basekernel=${_kernver%%-*}
# _basekernel=${_basekernel%.*}
mkdir -p "${pkgdir}"/{lib/modules,lib/firmware,boot}
make LOCALVERSION= INSTALL_MOD_PATH="${pkgdir}" modules_install
cp arch/$KARCH/boot/bzImage "${pkgdir}/boot/vmlinuz-${pkgname}"
# add vmlinux
install -D -m644 vmlinux "${pkgdir}/usr/src/linux-${_kernver}/vmlinux"
# set correct depmod command for install
cp -f "${startdir}/${install}" "${startdir}/${install}.pkg"
true && install=${install}.pkg
sed \
-e "s/KERNEL_NAME=.*/KERNEL_NAME=${_kernelname}/" \
-e "s/KERNEL_VERSION=.*/KERNEL_VERSION=${_kernver}/" \
-i "${startdir}/${install}"
# install mkinitcpio preset file for kernel
install -D -m644 "${srcdir}/${pkgname}.preset" "${pkgdir}/etc/mkinitcpio.d/${pkgname}.preset"
sed \
-e "1s|'linux.*'|'${pkgname}'|" \
-e "s|ALL_kver=.*|ALL_kver=\"/boot/vmlinuz-${pkgname}\"|" \
-e "s|default_image=.*|default_image=\"/boot/initramfs-${pkgname}.img\"|" \
-e "s|fallback_image=.*|fallback_image=\"/boot/initramfs-${pkgname}-fallback.img\"|" \
-i "${pkgdir}/etc/mkinitcpio.d/${pkgname}.preset"
# remove build and source links
rm -f "${pkgdir}"/lib/modules/${_kernver}/{source,build}
# remove the firmware
rm -rf "${pkgdir}/lib/firmware"
# gzip -9 all modules to save 100MB of space
find "${pkgdir}" -name '*.ko' -exec gzip -9 {} \;
# make room for external modules
ln -s "../extramodules-${_basekernel}${_kernelname:--rt}" "${pkgdir}/lib/modules/${_kernver}/extramodules"
# add real version for building modules and running depmod from post_install/upgrade
mkdir -p "${pkgdir}/lib/modules/extramodules-${_basekernel}${_kernelname:--rt}"
echo "${_kernver}" > "${pkgdir}/lib/modules/extramodules-${_basekernel}${_kernelname:--rt}/version"
# Now we call depmod...
depmod -b "$pkgdir" -F System.map "$_kernver"
# move module tree /lib -> /usr/lib
mv "$pkgdir/lib" "$pkgdir/usr"
package_linux-rt-headers() {
pkgdesc="Header files and scripts for building modules for linux kernel (with realtime preemption)."
# provides=("kernel26${_kernelname}-headers=${pkgver}")
# conflicts=("kernel26${_kernelname}-headers")
# replaces=("kernel26${_kernelname}-headers")
install -dm755 "${pkgdir}/usr/lib/modules/${_kernver}"
cd "${pkgdir}/usr/lib/modules/${_kernver}"
ln -sf ../../../src/linux-${_kernver} build
cd "${srcdir}/linux-${_basekernel}"
install -D -m644 Makefile \
"${pkgdir}/usr/src/linux-${_kernver}/Makefile"
install -D -m644 kernel/Makefile \
"${pkgdir}/usr/src/linux-${_kernver}/kernel/Makefile"
install -D -m644 .config \
"${pkgdir}/usr/src/linux-${_kernver}/.config"
mkdir -p "${pkgdir}/usr/src/linux-${_kernver}/include"
for i in acpi asm-generic config crypto drm generated keys linux math-emu \
media net pcmcia scsi sound trace uapi video xen; do
cp -a include/${i} "${pkgdir}/usr/src/linux-${_kernver}/include/"
done
# copy arch includes for external modules
mkdir -p "${pkgdir}/usr/src/linux-${_kernver}/arch/x86"
cp -a arch/x86/include "${pkgdir}/usr/src/linux-${_kernver}/arch/x86/"
# copy files necessary for later builds, like nvidia and vmware
cp Module.symvers "${pkgdir}/usr/src/linux-${_kernver}"
cp -a scripts "${pkgdir}/usr/src/linux-${_kernver}"
# fix permissions on scripts dir
chmod og-w -R "${pkgdir}/usr/src/linux-${_kernver}/scripts"
mkdir -p "${pkgdir}/usr/src/linux-${_kernver}/.tmp_versions"
mkdir -p "${pkgdir}/usr/src/linux-${_kernver}/arch/${KARCH}/kernel"
cp arch/${KARCH}/Makefile "${pkgdir}/usr/src/linux-${_kernver}/arch/${KARCH}/"
if [ "${CARCH}" = "i686" ]; then
cp arch/${KARCH}/Makefile_32.cpu "${pkgdir}/usr/src/linux-${_kernver}/arch/${KARCH}/"
fi
cp arch/${KARCH}/kernel/asm-offsets.s "${pkgdir}/usr/src/linux-${_kernver}/arch/${KARCH}/kernel/"
# add docbook makefile
install -D -m644 Documentation/DocBook/Makefile \
"${pkgdir}/usr/src/linux-${_kernver}/Documentation/DocBook/Makefile"
# add dm headers
mkdir -p "${pkgdir}/usr/src/linux-${_kernver}/drivers/md"
cp drivers/md/*.h "${pkgdir}/usr/src/linux-${_kernver}/drivers/md"
# add inotify.h
mkdir -p "${pkgdir}/usr/src/linux-${_kernver}/include/linux"
cp include/linux/inotify.h "${pkgdir}/usr/src/linux-${_kernver}/include/linux/"
# add wireless headers
mkdir -p "${pkgdir}/usr/src/linux-${_kernver}/net/mac80211/"
cp net/mac80211/*.h "${pkgdir}/usr/src/linux-${_kernver}/net/mac80211/"
# add dvb headers for external modules
# in reference to:
# http://bugs.archlinux.org/task/9912
mkdir -p "${pkgdir}/usr/src/linux-${_kernver}/drivers/media/dvb-core"
cp drivers/media/dvb-core/*.h "${pkgdir}/usr/src/linux-${_kernver}/drivers/media/dvb-core/"
# and...
# http://bugs.archlinux.org/task/11194
mkdir -p "${pkgdir}/usr/src/linux-${_kernver}/include/config/dvb/"
cp include/config/dvb/*.h "${pkgdir}/usr/src/linux-${_kernver}/include/config/dvb/"
# add dvb headers for http://mcentral.de/hg/~mrec/em28xx-new
# in reference to:
# http://bugs.archlinux.org/task/13146
mkdir -p "${pkgdir}/usr/src/linux-${_kernver}/drivers/media/dvb-frontends/"
cp drivers/media/dvb-frontends/lgdt330x.h "${pkgdir}/usr/src/linux-${_kernver}/drivers/media/dvb-frontends/"
mkdir -p "${pkgdir}/usr/src/linux-${_kernver}/drivers/media/i2c/"
cp drivers/media/i2c/msp3400-driver.h "${pkgdir}/usr/src/linux-${_kernver}/drivers/media/i2c/"
# add dvb headers
# in reference to:
# http://bugs.archlinux.org/task/20402
mkdir -p "${pkgdir}/usr/src/linux-${_kernver}/drivers/media/usb/dvb-usb"
cp drivers/media/usb/dvb-usb/*.h "${pkgdir}/usr/src/linux-${_kernver}/drivers/media/usb/dvb-usb/"
mkdir -p "${pkgdir}/usr/src/linux-${_kernver}/drivers/media/dvb-frontends"
cp drivers/media/dvb-frontends/*.h "${pkgdir}/usr/src/linux-${_kernver}/drivers/media/dvb-frontends/"
mkdir -p "${pkgdir}/usr/src/linux-${_kernver}/drivers/media/tuners"
cp drivers/media/tuners/*.h "${pkgdir}/usr/src/linux-${_kernver}/drivers/media/tuners/"
# add xfs and shmem for aufs building
mkdir -p "${pkgdir}/usr/src/linux-${_kernver}/fs/xfs"
mkdir -p "${pkgdir}/usr/src/linux-${_kernver}/mm"
cp fs/xfs/xfs_sb.h "${pkgdir}/usr/src/linux-${_kernver}/fs/xfs/xfs_sb.h"
# copy in Kconfig files
for i in `find . -name "Kconfig*"`; do
mkdir -p "${pkgdir}"/usr/src/linux-${_kernver}/`echo ${i} | sed 's|/Kconfig.*||'`
cp ${i} "${pkgdir}/usr/src/linux-${_kernver}/${i}"
done
chown -R root.root "${pkgdir}/usr/src/linux-${_kernver}"
find "${pkgdir}/usr/src/linux-${_kernver}" -type d -exec chmod 755 {} \;
# strip scripts directory
find "${pkgdir}/usr/src/linux-${_kernver}/scripts" -type f -perm -u+w 2>/dev/null | while read binary ; do
case "$(file -bi "${binary}")" in
*application/x-sharedlib*) # Libraries (.so)
/usr/bin/strip ${STRIP_SHARED} "${binary}";;
*application/x-archive*) # Libraries (.a)
/usr/bin/strip ${STRIP_STATIC} "${binary}";;
*application/x-executable*) # Binaries
/usr/bin/strip ${STRIP_BINARIES} "${binary}";;
esac
done
# remove unneeded architectures
rm -rf "${pkgdir}"/usr/src/linux-${_kernver}/arch/{alpha,arc,arm,arm26,arm64,avr32,blackfin,c6x,cris,frv,h8300,hexagon,ia64,m32r,m68k,m68knommu,metag,mips,microblaze,mn10300,openrisc,parisc,powerpc,ppc,s390,score,sh,sh64,sparc,sparc64,tile,unicore32,um,v850,xtensa}
package_linux-rt-docs() {
pkgdesc="Kernel hackers manual - HTML documentation that comes with the Linux kernel (with realtime preemption)."
# provides=("kernel26${_kernelname}-docs=${pkgver}")
# conflicts=("kernel26${_kernelname}-docs")
# replaces=("kernel26${_kernelname}-docs")
cd "${srcdir}/linux-${_basekernel}"
mkdir -p "${pkgdir}/usr/src/linux-${_kernver}"
cp -al Documentation "${pkgdir}/usr/src/linux-${_kernver}"
find "${pkgdir}" -type f -exec chmod 444 {} \;
find "${pkgdir}" -type d -exec chmod 755 {} \;
# remove a file already in linux package
rm -f "${pkgdir}/usr/src/linux-${_kernver}/Documentation/DocBook/Makefile"
# vim:set ts=8 sts=2 sw=2 et:
Then create the file '0007-asus-xonar-dgx.patch' with the following content:
--- a/sound/pci/oxygen/oxygen.c 2014-08-01 20:45:20.299191180 +0200
+++ b/sound/pci/oxygen/oxygen.c 2014-08-01 20:46:11.179947117 +0200
@@ -105,7 +105,7 @@
{ OXYGEN_PCI_SUBID(0x10b0, 0x0219), .driver_data = MODEL_CMEDIA_REF },
{ OXYGEN_PCI_SUBID(0x13f6, 0x0001), .driver_data = MODEL_CMEDIA_REF },
{ OXYGEN_PCI_SUBID(0x13f6, 0x0010), .driver_data = MODEL_CMEDIA_REF },
- { OXYGEN_PCI_SUBID(0x13f6, 0x8788), .driver_data = MODEL_CMEDIA_REF },
+ { OXYGEN_PCI_SUBID(0x13f6, 0x8788), .driver_data = MODEL_XONAR_DGX },
{ OXYGEN_PCI_SUBID(0x147a, 0xa017), .driver_data = MODEL_CMEDIA_REF },
{ OXYGEN_PCI_SUBID(0x1a58, 0x0910), .driver_data = MODEL_CMEDIA_REF },
/* Asus Xonar DG */
Finally run makepkg, should there be errors try removing the src dir first 'yes|rm -r src', then run makepkg again. Should there still be an error post here.
As for the patch, should there be no real difference there is also MODEL_XONAR_DG, might be worth trying out.
Last edited by emeres (2014-08-01 22:34:05)
Maybe you are looking for
-
Price for new validity period not updating
HI we have a contract we have updated the prices of the material for the contract item WITH A NEW VALIDTY DATE in Future. the contract is showing the correct price as the future date is passed.(Date wa 15 september) But the table ekpo is showing the
-
My iPod 3rd gen. has a very dim display. Adjust the dimmer setting has no effect.
-
Does anybody know how I can achieve the effect below with parallax scrolling in Adobe Muse? In the example below there is one illustrated image and another photograph, and when scrolling it looks like the illustration is being colored.
-
When i use dvi link everythings ok...But when i use minidisplay link macpro not shoutdown because kernel panic...But when i change display options macpro is normal shoutdown...Help me please Boot into Safe Mode - no problem Verify disk using Disk U
-
Change OWB-user password after import
Hi there, I set up a new empty 11.2 Warehousbuilder Repository instance, created a workspace and several DB-users (not in OWB) to prepare for MDL-Import. Into that I run MDL-Import from 10.2 (it creats a MDL-file for 11.2), which was successfuly impo