nixpkgs/pkgs/os-specific/linux
aszlig 639edcb829
manual-kernel: Fix handling spaces in readConfig.
The previos version did a for loop over the output of set, which spits out _all_
defined variables and their contents. This not only is dangerous if there is a
variable starting with CONFIG_ but also can't handle whitespace, as the IFS is
set to any (horizontal _and_ vertical) whitespace by default.

So, imagine (actually don't imagine, something like this is the case in a lot of
kernel configuration files) you have the following variable:

CONFIG_ARCH_HWEIGHT_CFLAGS="-fcall-saved-rdi -fcall-saved-rsi ..."

A loop with for and the default IFS would result in the following variable
pieces:

0: CONFIG_ARCH_HWEIGHT_CFLAGS="-fcall-saved-rdi
1: -fcall-saved-rsi
2: ..."

This obviously leads to the problem that this config variable is being cut off
at the first whitespace.

Another downside of this approach is that set not only returns variables but
functions as well. This could lead to quite a lot of unexpected behaviour and
confusion.

So the new approach doesn't source the kernel configuration anymore but uses
`read` to parse the file line-by line, setting IFS to '=', thus splitting all
configuration lines into key/value pairs.

Using parameter expansion, we ensure that we only read lines starting with
"CONFIG_". This particularily has the advantage of not being bash-specific,
should we choose to change to a different default shell someday.

Now, after we got a correct "CONFIG_" line, we're using a temporary variable to
split off the first quote from the result. Particularily the reason behind this
is shell compatibility again, as ${${foo#"}%"} only works in Bash, Zsh and
whatnot but not in plain SH.

And within the next line we obviously insert the no_firstquote variable without
it's last quote removed.

But, what about escaping?

First of all, if we'd just eval the $val variable, we would correctly unescape
the value, but this has the downside that variables within the content would be
expanded, for example look at this:

CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"

Well, obviously this is a bad example at the Nix sense, but just to show that
variables within kernel configuration entries aren't impossible.

And second, which would have been a show stopper if \" would be within $val: It
simply would end up being an invalid Nix expression, because \" would end up as
a ploin " within a double quoted string.

Signed-off-by: aszlig <aszlig@redmoonstudios.org>
2012-12-13 22:54:57 +01:00
..
915resolution * "ensureDir" -> "mkdir -p". "ensureDir" is a rather pointless 2012-01-18 20:16:00 +00:00
acpi acpi: 0.09 -> 1.5 (picked from debian) 2011-02-24 22:19:27 +00:00
acpi-call acpi-call: force example script to be executable 2012-08-03 16:49:57 +04:00
acpid acpid: Update to version 2.0.17. 2012-11-02 23:56:13 +01:00
acpitool acpitool-0.5.1 2010-05-27 19:33:37 +00:00
afuse * Get rid of many instances of "args: with args;", and other coding 2010-07-28 11:55:54 +00:00
alsa-lib alsalib: update + more urls. 2012-10-20 10:53:21 +02:00
alsa-plugins alsa-plugins: Update to upstream version 1.0.26. 2012-12-03 11:10:17 +01:00
alsa-utils alsa-utils: Fix the path to alsactl in the udev rule 2012-10-02 11:09:28 -04:00
apparmor Apparmor: packaged 2012-02-29 13:30:10 +00:00
atheros Remove a bunch of unreferenced files 2012-11-29 13:43:37 +01:00
ati-drivers making ati dirvers compile again 2012-10-07 18:03:06 +02:00
atop Atop: add package (atop is one more load monitor) 2012-08-25 21:24:17 +04:00
aufs Remove a bunch of unreferenced files 2012-11-29 13:43:37 +01:00
aufs-util Remove a bunch of unreferenced files 2012-11-29 13:43:37 +01:00
autofs Updating autofs5. Using the upstream distribution system of tarball+patches, 2010-06-12 10:22:09 +00:00
bbswitch bbswitch: upgraded to 0.4.2 2012-05-09 10:01:38 +00:00
blcr BLCR fix arsert to include kernel versions 2.6.38.x 2012-05-16 08:44:20 +00:00
bluez Update Bluez/Obex 2012-10-29 23:56:26 +04:00
bridge-utils bridge-utils: updated to version 1.5 2011-12-01 11:26:49 +00:00
broadcom-sta Fix broadcom_sta for linux-3.4 and clean nix source. 2012-07-19 11:42:40 +02:00
busybox busybox: Update to 1.20.2 2012-08-13 15:56:09 -04:00
checkpolicy checkpolicy: packaged 2011-03-27 04:45:46 +00:00
cifs-utils cifs-utils: upgrade to 5.6 2012-08-30 18:25:49 +02:00
conky conky: Enable weather plugins. 2012-09-10 23:54:00 +02:00
consoletools linuxconsoletools: New package, version 1.4.3. 2012-10-02 03:46:41 +02:00
cpufrequtils * Add cpufrequtils to the channel. 2011-12-21 16:24:40 +00:00
cramfsswap * "ensureDir" -> "mkdir -p". "ensureDir" is a rather pointless 2012-01-18 20:16:00 +00:00
cryopid New version of cryopid. 2009-11-08 10:38:07 +00:00
cryptodev Mark some packages as low priority and disambiguate some others 2012-11-29 15:26:13 +01:00
cryptsetup cryptsetup: Update to 1.5.0 2012-08-10 18:54:10 -04:00
dietlibc * Got rid of a lot of "postInstall=postInstall" and similar lines in 2009-04-23 13:31:10 +00:00
directvnc Add directvnc. Not sure whether it works - for me it hangs, but I have known Radeon issues, it seems 2009-11-05 21:10:51 +00:00
dmidecode * dmidecode updated to 2.11. 2012-03-16 01:46:39 +00:00
dmraid Fix dmraid build 2012-07-18 09:25:58 -04:00
dmtcp * Update dmtcp to version 1.2.0. 2011-02-22 19:00:45 +00:00
drbd * Apply a patch to propagate the --force flag in the legacy drbdadm to 2011-11-02 18:54:49 +00:00
dstat add package dstat 2012-08-05 15:10:26 +02:00
e3cfsprogs New Ext3cow version with some bugs resolved. Updated ext3cow kernel-patch, e3cfsprogs and ext3cow-tools 2008-03-09 20:06:42 +00:00
e1000e * Include the kernel version in kernel-specific packages so that they 2012-02-17 14:32:28 +00:00
ebtables * Added ebtables. 2011-03-31 12:20:22 +00:00
eject
exmap svn merge ^/nixpkgs/trunk 2012-02-19 11:16:24 +00:00
fbterm Upstream tracking files for asymptote and fbterm 2012-12-04 14:55:19 +04:00
ffado Disable the debug option for FFADO 2012-10-07 22:33:50 +02:00
firmware iwlwifi-6000g2a-ucode: update to version 18.168.6.1 2012-11-18 13:20:46 +01:00
frandom fixed download urls after kernel-depending packages had their names changed 2012-02-22 20:29:22 +00:00
fuse * FUSE updated to 2.8.7. 2012-05-12 19:46:07 +00:00
fxload * "ensureDir" -> "mkdir -p". "ensureDir" is a rather pointless 2012-01-18 20:16:00 +00:00
gogoclient gogoclient: fix url and lower default metric 2012-09-02 11:57:49 +02:00
hdparm * hdparm updated to 9.39. 2012-03-09 19:24:54 +00:00
hibernate hibernate: Fix impurities. 2008-04-01 17:31:31 +00:00
hostapd hostapd: upgrade to 1.0 2012-09-09 13:04:14 +02:00
htop * Updated htop to 1.0.1. 2012-04-04 14:46:17 +00:00
hwdata
i7z i7z: better cpu frequency/turbo boost checker for intel core i{3,5,7} 2012-02-06 19:09:04 +00:00
i810switch * Get rid of many instances of "args: with args;", and other coding 2010-07-28 11:55:54 +00:00
ifplugd
iotop * buildPythonPackage: added an argument `pythonPath' to specify Python 2011-03-28 15:30:48 +00:00
iproute iproute: Update to 3.6.0 2012-10-11 15:38:54 -04:00
ipsec-tools ipsec-tools: add version 0.8.0 2012-10-20 13:06:09 +02:00
iptables iptables: upgrade to 1.4.16.2 2012-10-13 12:22:47 +02:00
iputils * Updated iputils (though perhaps we should just use GNU inetutils). 2011-02-02 16:05:18 +00:00
iscsitarget * Include the kernel version in kernel-specific packages so that they 2012-02-17 14:32:28 +00:00
iw Adding linux iw. 2012-08-11 20:22:45 +02:00
iwlwifi * Put all packages that depend on a specific kernel (notably kernel 2008-05-22 12:01:24 +00:00
jujuutils The jujuutils are meant for a recent kernel, more recent than our linuxHeaders. 2012-05-08 16:38:21 +00:00
kbd kbd: Update to 1.15.3 2012-07-24 22:33:39 -04:00
kernel manual-kernel: Fix handling spaces in readConfig. 2012-12-13 22:54:57 +01:00
kernel-headers The jujuutils are meant for a recent kernel, more recent than our linuxHeaders. 2012-05-08 16:38:21 +00:00
kernel-headers-cross * Got rid of a lot of "postInstall=postInstall" and similar lines in 2009-04-23 13:31:10 +00:00
kexectools Adding kexectools. 2012-03-16 21:17:13 +00:00
keyutils Adding ecryptfs, and one of its dependencies: keyutils. 2010-01-25 10:34:47 +00:00
klibc klibc: Fix URL 2012-06-22 12:02:12 -04:00
kmod kmod: Bump to version 9 2012-07-29 03:57:50 -04:00
kqemu * Include the kernel version in kernel-specific packages so that they 2012-02-17 14:32:28 +00:00
latencytop Adding latencytop. 2012-03-18 11:45:53 +00:00
libaio * Added libaio. 2011-04-06 14:21:48 +00:00
libatasmart * Added udisks, the replacement of the disk management bits of HAL 2011-07-23 01:29:51 +00:00
libcap libcap: Update to 2.22 2012-07-19 10:26:44 -04:00
libcgroup libcgroup: Update to 0.38 2012-07-30 13:48:19 -04:00
libnl Remove a bunch of unreferenced files 2012-11-29 13:43:37 +01:00
libnscd
libselinux libselinux: version bump 2011-03-27 04:45:38 +00:00
libsemanage libsemanage: packaged 2011-03-27 04:46:12 +00:00
libsepol remove useless builder 2011-03-27 04:45:33 +00:00
libsmbios synchronize with trunk 2011-10-06 10:27:33 +00:00
libvolume_id * HAL 0.5.10. 2008-03-06 13:06:32 +00:00
lm-sensors * lm_sensors -> lm-sensors. 2011-12-21 10:28:51 +00:00
lsiutil * "ensureDir" -> "mkdir -p". "ensureDir" is a rather pointless 2012-01-18 20:16:00 +00:00
lsscsi Add lsscsi 2011-02-22 20:57:17 +00:00
lvm2 Work around some crazy race condition in devicemapper device creation 2012-10-15 14:46:15 -04:00
lxc Move lxc from "applications/virtualization" to "os-specific/linux". 2012-10-20 12:36:44 +02:00
mcelog mcelog: a tool to access the machine check exceptions logged by the kernel. 2012-02-24 20:20:59 +00:00
mdadm synchronize with trunk 2011-10-06 13:16:47 +00:00
microcode provides a better download url for the intel-microcode2ucode sources. 2012-08-17 19:25:05 +02:00
mingetty * "ensureDir" -> "mkdir -p". "ensureDir" is a rather pointless 2012-01-18 20:16:00 +00:00
module-init-tools synchronize with trunk 2011-11-02 10:28:32 +00:00
modutils
mountall Merge remote-tracking branch 'upstream/master' into x-updates 2012-07-14 14:24:27 -04:00
multipath-tools udev-173, patch 2011-08-18 13:04:55 +00:00
ndiswrapper * Include the kernel version in kernel-specific packages so that they 2012-02-17 14:32:28 +00:00
net-tools * Fix broken meta attributes. 2009-10-13 09:39:27 +00:00
nfs-utils Remove duplicate tcp-wrappers package 2012-11-29 15:26:13 +01:00
nss_ldap * "ensureDir" -> "mkdir -p". "ensureDir" is a rather pointless 2012-01-18 20:16:00 +00:00
numactl * "ensureDir" -> "mkdir -p". "ensureDir" is a rather pointless 2012-01-18 20:16:00 +00:00
nvidia-x11 Add legacy version 304.64 of the Nvidia driver 2012-12-11 11:33:40 +01:00
open-iscsi * Include the kernel version in kernel-specific packages so that they 2012-02-17 14:32:28 +00:00
opengl/xorg-sys * "ensureDir" -> "mkdir -p". "ensureDir" is a rather pointless 2012-01-18 20:16:00 +00:00
ov511 Mark some packages as low priority and disambiguate some others 2012-11-29 15:26:13 +01:00
pam * Fix PAM. It accidentally lost xcrypt support in r33798. 2012-04-19 15:15:39 +00:00
pam_ccreds pam_ccreds: to locally authenticate using an enterprise identity when the network is unavailable. 2010-08-06 08:50:58 +00:00
pam_console * Got rid of all --disable-static flags; they're redundant now. 2009-04-21 23:18:09 +00:00
pam_devperm
pam_krb5 pam_krb5: added version 2.3.11-1. 2010-08-06 08:49:05 +00:00
pam_ldap More metadata 2010-08-13 23:09:53 +00:00
pam_login pam_login: Really apply `sys-stat-h.patch'. 2010-04-28 12:37:06 +00:00
pam_ssh_agent_auth * Added pam_ssh_agent_auth, a PAM module for authentication through 2012-06-11 16:45:54 +00:00
pam_unix2 Add armv7l support. 2012-04-15 23:41:25 +00:00
pam_usb pam_usb: drop hal dependency 2012-03-29 18:02:10 +00:00
pcmciautils * "ensureDir" -> "mkdir -p". "ensureDir" is a rather pointless 2012-01-18 20:16:00 +00:00
pm-utils pmutils: PATH+=${dbus_tools}/bin, fix /sbin/hwclock 2011-09-14 04:06:43 +00:00
pmount svn merge ^/nixpkgs/trunk 2012-01-08 16:01:12 +00:00
pmtools pmtools: add version 20071116 2012-09-13 20:00:17 +02:00
policycoreutils policycoreutils: fix compilation 2011-03-28 07:38:16 +00:00
pommed Pommed: find the 'eject' command in /var/setuid-wrappers:/home/shlevy/.nix-profile/bin:/home/shlevy/.nix-profile/sbin:/home/shlevy/.nix-profile/lib/kde4/libexec:/nix/var/nix/profiles/default/bin:/nix/var/nix/profiles/default/sbin:/nix/var/nix/profiles/default/lib/kde4/libexec:/var/run/current-system/sw/bin:/var/run/current-system/sw/sbin:/var/run/current-system/sw/lib/kde4/libexec 2012-03-20 18:28:32 +00:00
powertop powertop: upgrade to 2.1 2012-09-09 13:04:13 +02:00
procps Making procps crossbuild. 2012-01-01 20:01:02 +00:00
psmisc psmisc: update to version 22.19 2012-07-02 16:53:52 +02:00
pwdutils * `--exec-prefix=$out/bin' causes programs to be installed in 2010-04-27 10:46:41 +00:00
qemu-kvm qemu-kvm: Update to 1.2.0 2012-09-25 17:30:43 -04:00
radeontools * "ensureDir" -> "mkdir -p". "ensureDir" is a rather pointless 2012-01-18 20:16:00 +00:00
regionset * Added regionset, a tool for changing the region code setting of DVD 2011-10-21 00:43:56 +00:00
reptyr Update/fix MuPDF 2012-10-04 10:37:54 +04:00
rfkill rfkill udev package. 2012-02-24 01:35:59 +00:00
rtkit * Add rtkit to the channel. 2011-08-01 13:26:00 +00:00
sdparm * sdparm: the previous URL was broken. 2009-04-16 12:23:53 +00:00
shadow Apply patch to shadow which allows dots (.) in user names. 2012-09-18 23:56:51 +02:00
spl Mark some packages as low priority and disambiguate some others 2012-11-29 15:26:13 +01:00
splashutils * splashutils: use Glibc instead of klibc. 2010-06-01 16:36:07 +00:00
statifier Adding statifier, a tool to make pseudostatic binaries. Unfortunately, statified NixOS-built binaries segfault on Ubuntu.. 2009-07-09 21:34:29 +00:00
sysfsutils sysfsutils: Use SourceForge mirror instead of static URL. 2012-10-02 08:50:42 +02:00
sysklogd sysklogd: Support systemd socket-based activation 2012-07-19 12:46:39 -04:00
syslinux Advance syslinux version to 4.03. 2011-02-10 01:14:13 +00:00
sysstat Use /var/log/sa for statedir of sysstat, in stead of $out/var/lib/sa. This path cannot be overriden at runtime, so choosing a 'sane' default. 2012-08-14 14:14:55 +02:00
systemd systemd: Update to 196 2012-11-29 18:50:07 +01:00
sysvinit sysvinit: Don't install mountpoint and wall 2012-07-25 23:18:40 -04:00
tcp-wrappers Remove duplicate tcp-wrappers package 2012-11-29 15:26:13 +01:00
tp_smapi Adding tp_smapi. 2012-03-31 13:40:34 +00:00
tunctl * "ensureDir" -> "mkdir -p". "ensureDir" is a rather pointless 2012-01-18 20:16:00 +00:00
uclibc Fixing the paths of uclibc libpthread 2012-05-24 21:44:34 +00:00
udev Add armv7l support. 2012-04-15 23:41:25 +00:00
udisks udisks: avoid autoreconf 2012-03-01 15:09:53 +00:00
untie Adding untie - a tool for manipulating namespaces 2010-11-23 07:52:57 +00:00
upower upower: Update to 0.9.18 and enable systemd support 2012-08-21 08:42:44 -04:00
upstart Remove a bunch of unreferenced files 2012-11-29 13:43:37 +01:00
usbutils usbutils: Update to 006 2012-09-28 23:20:59 -04:00
util-linux Allowing mount to call /var/setuid-wrappers in preference. mount.cifs may require this, 2012-03-10 19:02:07 +00:00
v4l-utils Updating libv4l (part of v4l-utils). I moved v4l-utils to stdenv.mkDerivation style, 2012-05-22 14:30:12 +00:00
v86d * Include the kernel version in kernel-specific packages so that they 2012-02-17 14:32:28 +00:00
wireless-tools update to 29 2009-12-25 19:30:56 +00:00
wis-go7007 * "ensureDir" -> "mkdir -p". "ensureDir" is a rather pointless 2012-01-18 20:16:00 +00:00
wpa_supplicant wpa_supplicant: upgrade to 1.0 2012-09-09 13:04:13 +02:00
wvdial * Get rid of many instances of "args: with args;", and other coding 2010-07-28 11:55:54 +00:00
xf86-input-mtrack xf86-input-mtrack: Update, use pixman 2012-07-14 16:32:20 -04:00
xf86-input-multitouch * "ensureDir" -> "mkdir -p". "ensureDir" is a rather pointless 2012-01-18 20:16:00 +00:00
xf86-input-wacom xf86-input-wacom-0.16.0 2012-08-26 22:38:15 +04:00
xf86-video-nested Update xf86-video-nested to work on current NixOS Xorg 2012-11-17 20:03:34 +01:00
xf86-video-nouveau Add nouveau xorg video driver 2012-03-20 16:29:22 +00:00
zfs ztest: fix hardcoded paths 2012-12-04 14:08:34 -08:00