File: 006_misc_tweaks_from_CVS.diff

package info (click to toggle)
lessdisks 0.5.3cvs.20040906-16
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 1,480 kB
  • ctags: 271
  • sloc: sh: 3,058; makefile: 92
file content (114 lines) | stat: -rw-r--r-- 3,222 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
--- lessdisks-0.5.3cvs.20040906.orig/base/init.d-scripts/lessdisks-session
+++ lessdisks-0.5.3cvs.20040906/base/init.d-scripts/lessdisks-session
@@ -3,6 +3,8 @@
 # copyright 2004 vagrant@freegeek.org, distributed under the terms of the
 # GNU General Public License version 2 or any later version.
 
+# TODO split X related configuration into sourced file?
+
 case "$1" in
   start) ;;
   stop) ;;
@@ -10,6 +12,9 @@
   force-reload) ;;
 esac
 
+# FIXME this is a crude workaround.  for some reason $runlevel is already set.
+unset runlevel
+
 if [ -r /etc/lessdisks/server.config ]; then
   . /etc/lessdisks/server.config 
 fi
@@ -18,12 +23,18 @@
   . /etc/lessdisks/x.config
 fi
 
-if [ -z "$rw" ]
-then
+if [ -z "$rw" ]; then
   rw="/var/state/lessdisks"
 fi
 
-hostname=$(cat $rw/etc/hostname)
+if [ -r "$rw/etc/config" ]; then
+  . "$rw/etc/config"
+fi
+
+if [ -z "$hostname" ]; then
+  hostname=$(cat $rw/etc/hostname)
+fi
+
 if [ -z "$hostname" ]; then
   hostname=default
 fi
@@ -44,10 +55,15 @@
   fi
 fi
 
-if [ -z "$runlevel" ]
-then
-  echo "runlevel not set, assuming runlevel 2"
-  runlevel=2
+if [ -z "$runlevel" ]; then
+  if [ "true" = "$auto_start_x" ] && [ -n "$default_x_runlevel" ]; then
+    runlevel="$default_x_runlevel"
+  elif [ -n "$default_runlevel" ]; then
+    runlevel="$default_runlevel"
+  else
+    echo "runlevel not set, assuming runlevel 2"
+    runlevel=2
+  fi
 fi
 
 case $runlevel in
--- lessdisks-0.5.3cvs.20040906.orig/base/usr-lib-lessdisks/lessdisks-terminal-install
+++ lessdisks-0.5.3cvs.20040906/base/usr-lib-lessdisks/lessdisks-terminal-install
@@ -17,8 +17,11 @@
   exit 
 fi
 
-#source config file
-. /etc/lessdisks/server.config
+if [ -r /etc/lessdisks/server.config ]; then
+  . /etc/lessdisks/server.config
+else
+  echo "WARNING: could not read /etc/lessdisks/server.config"
+fi
 
 if [ -z "$rw" ]
 then
@@ -36,23 +45,23 @@
 # TODO- include option for generating a root and lessdisks_user password
 # it's currently empty, most likely...
 
-####
-echo "making fstab"
-echo "$disk_alias:$lessdisks_path / nfs defaults,ro,nolock 0 0" > /etc/fstab
-echo "none /proc proc defaults 0 0" >> /etc/fstab
-
-if [ "yes" = "$floppy" ] || [ "true" = "$floppy" ]; then
-  echo "/dev/fd0 /floppy vfat,ext2,hfs,auto defaults,noauto,user" >> /etc/fstab
+if [ -z "$chroot_name" ]; then
+  LESSDISKS_ROOT="$lessdisks_path"
+else
+  LESSDISKS_ROOT="$lessdisks_path/$chroot_name"
 fi
 
-if [ "yes" = "$cdrom" ] || [ "true" = "$cdrom" ]; then
-  echo "/dev/cdrom /cdrom isofs,auto defaults,noauto,user" >> /etc/fstab
-fi
+echo "making fstab"
+echo "$disk_alias:$LESSDISKS_ROOT / nfs defaults,ro,nolock 0 0" > /etc/fstab
+echo "none /proc proc defaults 0 0" >> /etc/fstab
+if [ "yes" = "$floppy" ] || [ "true" = "$floppy" ]; then
+  echo "/dev/fd0 /floppy vfat,ext2,hfs,auto defaults,noauto,user 0 0" >> /etc/fstab
+fi
 
 if [ "yes" = "$group_only" ] || [ "true" = "$group_only" ]; then
    lessdisks_gid=`cut -d ":" -f 3 /etc/lessdisks/gid`
    if [ -z "$lessdisks_gid" ]; then
-     echo "WARNING: no group id found in /etc/lessdisks/gid"
+     echo "WARNING: no group id defined."
    else
      echo "chgrp -R $lessdisks_gid /etc/lessdisks"
      chgrp -R $lessdisks_gid /etc/lessdisks