aboutsummaryrefslogtreecommitdiff
path: root/functions
AgeCommit message (Collapse)AuthorFiles
2012-08-27Merge branch 'kill-DAEMON_LOCALE'Tom Gundersen1
Conflicts: functions
2012-08-27move archlinux(7) and locale.sh to filesystemTom Gundersen1
The new locale.sh makes DAEMON_LOCALE redundant, so we remove that functionality. A post-upgrade notice will be added. The new functionality will apply the settings to /etc/locale.conf system-wide, and allow each user to override it in $HOME/.config/locale.conf. Signed-off-by: Tom Gundersen <teg@jklm.no>
2012-08-23add some deprecation warningsTom Gundersen1
As we are moving to systemd, alert initscripts users in case they use the legacy configuration options. The legacy options will still work in initscripts, but eventually will not work with systemd. In other words, most users will want to switch to the new settings. Signed-off-by: Tom Gundersen <teg@jklm.no>
2012-08-12cryptsetup: support the password being unsetTom Gundersen1
2012-08-11functions: support quoted UUID/PARTUUID in crypttabDave Reisner1
Abstract the unquoting logic from parse_envfile into unquote() and reuse it for our crypttab unlock logic. Signed-off-by: Dave Reisner <dreisner@archlinux.org>
2012-08-11functions: support UUID tags in /etc/crypttabDave Reisner1
As per crypttab(5), this is supported. This also adds forward looking support for PARTUUID, which is valid and should "just work" for GPT partitioned disks. Signed-off-by: Dave Reisner <dreisner@archlinux.org>
2012-08-04modprobe: pass everything to systemd-modules-load2012.08.1Tom Gundersen1
Unify this as much as possible, write out MODULES to a modules-load.d file in /run before calling systemd-modules-load, rather than using modprobe directly. This should not make any difference to the functionality. Signed-off-by: Tom Gundersen <teg@jklm.no>
2012-07-24do_unlock_systemd: use mkswap -f as beforeMatthew Monaco1
This should be safe for freshly mapped swap space, especially since we check that blkid returns 2.
2012-07-23cryptsetup: fix usage of IFS2012.07.4Tom Gundersen1
Reported-by: c <carstenmattner@gmail.com> Reported-by: Evangelos Foutras <evangelos@foutrelis.com> Signed-off-by: Tom Gundersen <teg@jklm.no>
2012-07-23mount_all should also mount sysfsSébastien Luttringer1
Signed-off-by: Sébastien Luttringer <seblu@seblu.net> [tomegun: or rather, we should not have a special-case to avoid it. mounting sysfs here is still almost certainly the wrong thing to do] Signed-off-by: Tom Gundersen <teg@jklm.no>
2012-07-21functions: re-add status -v as a NOOPDave Reisner1
Since this is technically public API, the -v flag shouldn't be removed so easily. Re-add it, but make it a NOOP to support existing uses of it. Signed-off-by: Dave Reisner <dreisner@archlinux.org>
2012-07-18USECOLOR: default to 'yes' rather than 'no'Tom Gundersen1
Signed-off-by: Tom Gundersen <teg@jklm.no>
2012-07-18DAEMON_LOCALE: default to 'yes' rather than 'no'Tom Gundersen1
Signed-off-by: Tom Gundersen <teg@jklm.no>
2012-07-17status: be verbose by defaultTom Gundersen1
Add a new option '-q' which allows status() to be shut up, should it be needed. Signed-off-by: Tom Gundersen <teg@jklm.no>
2012-07-17os-release: factor out distro name/urlTom Gundersen1
This should make the lives of our downstreams slightly simpler by not having to patch rc.sysinit, but rather just ship their own /etc/os-release. Signed-off-by: Tom Gundersen <teg@jklm.no>
2012-07-17cryptsetup: negate a wrong check2012.07.2Tom Gundersen1
blkid returns 2 when nothing is found on the device, which is exactly when we want to use it. Signed-off-by: Tom Gundersen <teg@jklm.no>
2012-07-17cryptsetup: refactor do_lockTom Gundersen1
This now uses the systemd code, and is in line with do_unlock. Signed-off-by: Tom Gundersen <teg@jklm.no>
2012-07-17cryptsetup: refactor the outputTom Gundersen1
I created a mess half-way between the legacy and the systemd outputs. Signed-off-by: Tom Gundersen <teg@jklm.no>
2012-07-16cryptsetup: fix up stray IFS assignments2012.07.1Tom Gundersen1
Signed-off-by: Tom Gundersen <teg@jklm.no>
2012-07-15cryptsetup: add blkid check for safetyTom Gundersen1
Before we create a swap partition or a filesystm, check that nothing exists on the underlying block device. Signed-off-by: Tom Gundersen <teg@jklm.no>
2012-07-12Merge branch 'spelling'Tom Gundersen1
Conflicts: rc.sysinit Had to manually fix up a conflict in some comments.
2012-07-12Correct spelling and grammar throughoutJason St. John1
This patch addresses the issues with my previous patch submission here: https://mailman.archlinux.org/pipermail/arch-projects/2012-June/002990.html The notable changes between this patch and the previous one are below: -- this patch does not rename set_timezone() -- 'filesystems' and 'bash' are left as-is -- everything is in one patch, not two -- the 'makedepends' change is no longer relevant because the duplication of it was already removed in a later commit Regarding the capitalization of "Btrfs", it seems that upstream prefers "Btrfs".[1][2] Regarding 'https://' vs. 'http://', I left this change in the patch because stating 'https://www.archlinux.org' in the start-up messages doesn't force anyone to use HTTPS over HTTP. It simply shows that HTTPS is available for use. If someone really doesn't want to use HTTPS, they don't have to. Finally, Dan McGee stated that HTTPS will be used all the time soon.[3] [1] https://oss.oracle.com/projects/btrfs/ [2] https://btrfs.wiki.kernel.org/index.php/Main_Page [3] https://bugs.archlinux.org/task/30486#comment96222 Signed-off-by: Jason St. John <jstjohn@purdue.edu>
2012-07-11cryptsetup: deprecate old syntax and default to the systemd oneTom Gundersen1
We detect if the old syntax is used, and if so print a warning and use the old parsing code. Otherwise, we pass everything on to systemd-cryptsetup. Similarly to what was done with the network syntax, we intend to keep the legacy stuff working for a long time. See crypttab(5) for the new syntax[0]. The main reason for this change, is to be closer to what other distros do. The systemd syntax is based on Debian's format, and is essentially what is being used by at least Debian, Ubuntu, Fedora and Suse. Such widespread use means that it will be better documented in non-Arch-specific documentation, and is more likely to see integration with third-party tools. It is also surely appreciated by admins who use more than one distro, that they don't have to know more than one config format for these sorts of basic things. Furthermore, by actually sharing the code with systemd we get to rely on their much more widespread testing and review compared to what we are able to do ourselves. This is particularly important for the encryption code, as it is the most obscure code in initscripts and any bugs in it would have potentially very severe consequences. Lastly, there are a few (albeit minor) issues I see with our current format: /etc/crypttab is not a plaintext file, but needs to be parsed through bash. The (deprecated) embedded passwords have been a source of problems in the past. And, there is no level of abstraction between the crypttab options and cryptsetup, we just pass them on blindly. The new format and the old one cover roughly the same usecases. To the best of my knowledge, the only use-case not (yet) supported by systemd-cryptsetup, is mounting a removable device and reading the key from a file on that device. For this, stick with the old syntax (though be careful, it is inherently racy). [0]: <http://0pointer.de/public/systemd-man/systemd.unit.html> (note that keyfile-offset support is coming in the next systemd version).
2012-06-29Remove sed from bootlog_stop()Florian Pritz1
bootlogd from our sysvinit package now removes all escape codes directly so this (incomplete) sed call is no longer needed. Signed-off-by: Florian Pritz <bluewind@xinu.at> Signed-off-by: Tom Gundersen <teg@jklm.no>
2012-06-29Revert "cryptsetup: use systemd-cryptsetup rather than rolling our own"2012.06.3Tom Gundersen1
This reverts commit 6fe21269e5d54c52c168eac40225dca12a79c355. git failure. this was not meant to be in master. nowhere near ready for that :)
2012-06-28cryptsetup: use systemd-cryptsetup rather than rolling our ownTom Gundersen1
WORK IN PROGRESS; COMPLETELY UNTESTED! In addition to supporting whatever systemd supports, we also support all our own ways of specifying passphrases. We have to look into how our "options" support differs from systemd's and what we want to do about that. Signed-off-by: Tom Gundersen <teg@jklm.no>
2012-06-24tmpfiles: actually remove old files on bootTom Gundersen1
We were not deleting old files as we forgot to add the --clean flag Signed-off-by: Tom Gundersen <teg@jklm.no>
2012-06-23Remove ck_dependsSébastien Luttringer1
ck_depends is no more used and should not be used anymore Signed-off-by: Sébastien Luttringer <seblu@seblu.net>
2012-06-08remove checks for /var/run and /var/lock as symlinksDave Reisner1
These are shipped as symlinks by filesystem 2012.06, so these checks are no longer needed. Signed-off-by: Dave Reisner <dreisner@archlinux.org>
2012-06-07module-load: silenceTom Gundersen1
We don't need to see all modules inserted on every boot. Signed-off-by: Tom Gundersen <teg@jklm.no>
2012-05-29udev: fix path so systemd can drop a symlinkTom Gundersen1
Signed-off-by: Tom Gundersen <teg@jklm.no>
2012-05-29fix another wrong pathTom Gundersen1
Signed-off-by: Tom Gundersen <teg@jklm.no>
2012-05-29systemd: correct some pathsTom Gundersen1
Signed-off-by: Tom Gundersen <teg@jklm.no>
2012-05-29add support for modules-load.d directoriesDave Reisner1
Signed-off-by: Dave Reisner <dreisner@archlinux.org>
2012-05-29vconsole: use the systemd toolTom Gundersen1
Signed-off-by: Tom Gundersen <teg@jklm.no>
2012-05-29tmpfiles,sysctl,binfmt: use the systemd toolsTom Gundersen1
No point in reinventing the wheel. These and other tools are shipped in the systemd-tools package. Functionality should be unchanged, but we no longer have to maintain the code. Signed-off-by: Tom Gundersen <teg@jklm.no>
2012-05-29fix /forcefsck logic with initcpio fsck hookSébastien Luttringer1
Currently, using "shutdown -F -r now" with fsck initcpio hook doesn't make a full fsck on reboot. Initscripts hook check if /run/initramfs/root-fsck is present to add -M option to fsck which disable check of mounted filesystem. Initcpio doesn't check /forcefsck file and create root-fsck file with a simple fsck check. Signed-off-by: Sébastien Luttringer <seblu@seblu.net>
2012-04-17functions: use a pipe for umount_all instead of a PEDave Reisner1
We don't care about the side effects of the subshell created by the pipe since everything is localized within this function. Use the more "canonical" syntax. This should stop the recurring bug reports that we seem to get from people who think they understand Bash syntax, e.g. FS#27203 FS#28331 FS#29145 FS#28582 FS#27098 FS#29496 Signed-off-by: Dave Reisner <dreisner@archlinux.org>
2012-04-01udev: change to new locationTom Gundersen1
Both the old and the new location works at the moment, but we want to remove the symlink, so change to the new location. Signed-off-by: Tom Gundersen <teg@jklm.no>
2012-03-21fsck: add return value2012.03.1Tom Gundersen1
Reported-by: Lukas Fleischer <archlinux@cryptocrack.de> Signed-off-by: Tom Gundersen <teg@jklm.no>
2012-03-17crypttab: warn if using passphrase in /etc/crypttabTom Gundersen1
There is no reason not to use a keyfile, and allowing literal passphrases in crypttab has caused issues with the parsing in the past. Furthermore, it is not supported by any other crypttab implementation (to the best of my knowledge). The use of keyfiles have been the recomendation in /etc/crypttab for as long as I can remember. We are looking at refactoring the encryption support, and I think it makes sense to drop support for this when we move to the new implementation. Cc: Thomas Bächler <thomas@archlinux.org> Cc: Matthew Monaco <matt@0x01b.net> Cc: Dave Reisner <d@falconindy.com> Signed-off-by: Tom Gundersen <teg@jklm.no>
2012-03-17crypto: move function from sysinit to functionsTom Gundersen1
No functional change, just improve readability. Signed-off-by: Tom Gundersen <teg@jklm.no>
2012-03-17sysinit: do not unconditionally modprobe any moreTom Gundersen1
dm-mod and dm-crypt will be autoloaded when needed (at least on kernels newer than 2.6.36). The rtc modules should be compiled in, as they have been in the official kernels for some time. Signed-off-by: Tom Gundersen <teg@jklm.no>
2012-03-17sysinit: remove cryptsetup compatDave Reisner1
We haven't had the static binary in nearly 2 years, so simply call this without a PATH lookup. Signed-off-by: Dave Reisner <dreisner@archlinux.org>
2012-03-17fsck: move FORCEFSCK/FASTBOOT logic to fsck_allTom Gundersen1
Avoid global variables, and make things clearer. Signed-off-by: Tom Gundersen <teg@jklm.no>
2012-03-17reorder fsck opts, explicitly set end of options markerDave Reisner1
Fixes FS#28947. Signed-off-by: Dave Reisner <dreisner@archlinux.org>
2012-03-13Merge remote-tracking branch 'seblu/master'Tom Gundersen1
Conflicts: Makefile
2012-03-13Remove NEED_ROOT crapSébastien Luttringer1
This patch revert patch 042d197b4d989ec64. NEED_ROOT was introduced to fix bug FS#24095. But in fact it doesn't solve it because nobody use it. The idea was to allow initscripts developper to have a check runned by every scripts which tell if scripts need to be run as root (most of them) or not (and the script check itself which part of him have to be run as root). All this to display a cute error message. I think this complexity is superfluous and let part of initscript will fail if rights are not enough. I must confess that we should have marked this bug as wontfix rather than do that. Signed-off-by: Sébastien Luttringer <seblu@seblu.net>
2012-03-12timezone: always symlink to zoneinfo rather than copyingTom Gundersen1
Behave as described in the manpage. This makes sure that we don't need to write to /etc unnecessarily in case of updates to zoneinfo. The reason for keeping a copy in /etc was if /usr was on a separate unmounted partition, but this is no longer supported. Reported-by: Sébastien Luttringer <seblu@seblu.net> Signed-off-by: Tom Gundersen <teg@jklm.no>
2012-03-05functions: check for length before using arrayDave Reisner1
This avoids passing an empty array to umount Signed-off-by: Dave Reisner <dreisner@archlinux.org>