diff options
author | Harald Hoyer <harald@redhat.com> | 2007-08-14 13:32:33 +0000 |
---|---|---|
committer | Harald Hoyer <harald@redhat.com> | 2007-08-14 13:32:33 +0000 |
commit | 34e5bec0a0a37ecbdf40923c79afaa17cdbcdfce (patch) | |
tree | 15c26a89968427a1412775407f4a2754f47dc4d0 | |
parent | 55979ee4122d9f5d5e5031f2d9b6f14535047171 (diff) | |
download | initscripts-34e5bec0a0a37ecbdf40923c79afaa17cdbcdfce.tar initscripts-34e5bec0a0a37ecbdf40923c79afaa17cdbcdfce.tar.gz initscripts-34e5bec0a0a37ecbdf40923c79afaa17cdbcdfce.tar.bz2 initscripts-34e5bec0a0a37ecbdf40923c79afaa17cdbcdfce.tar.xz initscripts-34e5bec0a0a37ecbdf40923c79afaa17cdbcdfce.zip |
- added support for cryptsetup-uuids (bug #242078)
-rw-r--r-- | ChangeLog | 16 | ||||
-rwxr-xr-x | rc.d/init.d/functions | 21 | ||||
-rwxr-xr-x | rc.d/rc.sysinit | 16 |
3 files changed, 49 insertions, 4 deletions
@@ -1,3 +1,19 @@ +2007-08-10 notting <notting@redhat.com> + + * init.d/netfs: - netfs: sort nfs mounts for unmounting (#251657) + +2007-08-07 notting <notting@redhat.com> + + * init.d/netconsole: assorted cleanups + + * init.d/netconsole: fix netconsole status() + + * init.d/netconsole: fix netconsole init script status + +2007-08-02 Harald Hoyer <harald@redhat.com> + + * rc.sysinit: - set the hwclock before start_udev is executed + 2007-07-27 Bill Nottingham <notting@redhat.com> * ChangeLog, initscripts.spec: 8.55-1 diff --git a/rc.d/init.d/functions b/rc.d/init.d/functions index 25b9d1e2..8e76c6d7 100755 --- a/rc.d/init.d/functions +++ b/rc.d/init.d/functions @@ -71,6 +71,27 @@ checkpid() { return 1 } +__basename() { + echo ${@##*/} +} +__dirname() { + f=$@ + b=$(__basename "$f") + if [ "$b" = "$f" ]; then + echo "." + return + fi + d=${f//\/$b/} + echo $d +} + +__readlink() { + f=$@ + l=$(ls -bl "$f"|(read a1 a2 a3 a4 a5 a6 a7 a8 a9 a10 link rest; echo $link)) + d=$(__dirname "$f")/./$(__dirname $l ) + (cd "$d" ;echo $(pwd -P)/$(__basename $l )); +} + # __umount_loop awk_program fstab_file first_msg retry_msg umount_args # awk_program should process fstab_file and return a list of fstab-encoded # paths; it doesn't have to handle comments in fstab_file. diff --git a/rc.d/rc.sysinit b/rc.d/rc.sysinit index 08d84653..75705747 100755 --- a/rc.d/rc.sysinit +++ b/rc.d/rc.sysinit @@ -119,10 +119,12 @@ init_crypto() { fi if [ -n "$key" -a "x$key" != "xnone" ]; then if test -e "$key" ; then - mode=$(ls -l "$key" | cut -c 5-10) - owner=$(ls -l $key | awk '{ print $3 }') - if [ "$mode" != "------" ] && ! key_is_random "$key"; then - echo $"INSECURE MODE FOR $key" + owner=$(ls -l $key | (read a b owner rest; echo $owner)) + if ! key_is_random "$key"; then + mode=$(ls -l "$key" | cut -c 5-10) + if [ "$mode" != "------" ]; then + echo $"INSECURE MODE FOR $key" + fi fi if [ "$owner" != root ]; then echo $"INSECURE OWNER FOR $key" @@ -139,6 +141,12 @@ init_crypto() { makeswap="" mke2fs="" skip="" + # Parse the src field for UUID= and convert to real device names + if [ "${src%%=*}" == "UUID" ]; then + src=`/sbin/blkid -t "$src" -o device|(read oneline;echo $oneline)` + elif [ "${src/^\/dev\/disk\/by-uuid\/}" != "$src" ]; then + src=$(__readlink $src) + fi # Parse the options field, convert to cryptsetup parameters # and contruct the command line while [ -n "$opt" ]; do |