ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/lmainit/boot.fac
Revision: 1.3
Committed: Mon Mar 8 22:58:16 2004 UTC (20 years, 2 months ago) by root
Branch: MAIN
CVS Tags: HEAD
Changes since 1.2: +6 -0 lines
Log Message:
*** empty log message ***

File Contents

# User Rev Content
1 root 1.1 #!/ vim, this is /bash syntax !/
2    
3     _check_fs() {
4     local msg="$1"
5     local cmd="$2"
6     local msg2="$3"
7     local prompt="$4"
8    
9     echo "$msg"
10    
11     $cmd
12     if (($?>1)); then
13     echo "$cmd returned with exit code $?"
14     fatal "$msg2"
15     fi
16     }
17    
18     def checkfs_root
19     desc "Checking root filesystem"
20     start() {
21     local C; ((SLOW_TERMINAL)) || C=C
22     _check_fs "checking root-fs..." "/sbin/fsck -${C}Ta /" "***
23     *** error while checking root-fs
24     *** root-fs still read-only!" "(root-fsck error) # "
25     }
26     end
27    
28     def "check_fs" "Checking filesystems"
29     start() {
30     local C; ((SLOW_TERMINAL)) || C=C
31     _check_fs "checking filesystems..." "/sbin/fsck -${C}TARa /" "***
32     *** error while checking file-systems
33     *** root-fs mounted read-write" "(fsck error) # "
34     }
35     end
36    
37     def "autoboot_check" "Open shell when not autobooting"
38     start() {
39     local TTY=${1:-/dev/tty3}
40     if [ "$AUTOBOOT" != "YES" ]; then
41     echo "Starting shell on $TTY"
42     $SULOGIN $TTY &
43     fi
44     }
45     end
46    
47     def cmos_clock
48     desc System clock
49     start() {
50     echo "fetching system clock value..."
51     /sbin/hwclock --hctosys --utc &
52     }
53     end
54    
55     def init_swap "Initializing swapspace..."
56     start() {
57     echo enabling swapping...
58     safe_eval /sbin/swapon -av
59     }
60     end
61    
62     def mount_root Mounting root-fs
63     start() {
64     safe_eval /bin/mount -noremount,rw / ||
65     echo "WARNING: unable to mount root-fs read-write!"
66     }
67     stop() {
68     safe_eval /bin/umount -noremount,ro / ||
69     echo "WARNING: unable to mount root-fs read-only!"
70     }
71     end
72    
73     def mount_devpts Mounting devpts-filesystem
74     start() {
75     safe_eval /bin/mount -ntdevpts -ogid=5,mode=620 none /dev/pts
76     }
77     end
78    
79     def mount_proc "Mounting proc-filesystem"
80     start() {
81     safe_eval /bin/mount -ntproc none /proc
82     }
83     end
84    
85 root 1.3 def mount_sys "Mounting sys-filesystem"
86     start() {
87     safe_eval /bin/mount -ntsysfs none /sys
88     }
89     end
90    
91 root 1.1 def check_modules "Checking/creating module dependencies"
92     start() {
93     local release=$(uname -r)
94     echo "Linux release $release"
95     rm -f /lib/modules/current
96     if [ -d /lib/modules/$release ]; then
97     ln -s $release /lib/modules/current
98     if ! [ -f /lib/modules/current/modules.dep ]; then
99     echo "Creating module dependencies"
100     safe_eval /sbin/depmod -a
101     fi
102     else
103     echo "NO MODULES FOUND!"
104     fi
105     }
106     end
107    
108     def init_mtab "Initializing /etc/mtab"
109     start() {
110     rm -f /etc/mtab.tmp /etc/mtab~ /etc/nologin
111     if [ -s /etc/mtab ]; then
112     : >/etc/mtab
113     fi
114     safe_eval /bin/mount -f /
115     }
116     end
117    
118     def "kmesg" "Saving kernel messages"
119     start() {
120     {
121     echo "-- `date` --"
122 root 1.2 dmesg -c -s131072
123 root 1.1 klogd -o -f /dev/null
124     } >/var/log/lastboot
125     }
126     end
127    
128     def "update" "Update daemon"
129     start() {
130     /sbin/update -s 20 -f 20
131     }
132     end
133    
134     def "mount_ext2" "Mounting ext2 & reiserfs filesystems"
135     start() {
136     echo "mounting ext2 & reiserfs filesystems..."
137     safe_eval /bin/mount -avtext2,reiserfs
138     }
139     end
140    
141     def "clear_misc" "Clearing volatile files"
142     start() {
143     rm -rf /var/lock/* /var/spool/locks/* /var/spool/uucp/LCK..* /tmp/.X0-lock
144     rm -f /var/{run,pid}/{*/,}*
145     }
146     end
147    
148     def "check_logs" "Checking system log files"
149     start() {
150     $rcpath/checklogs
151     }
152     end
153    
154     def "clean_temp" "Deleting various /tmp dirs"
155     start() {
156     rm -rf /tmp/{.X*-lock,.X11-unix,.iroha_unix,.ki2-unix,jd_sockV4,mysql.sock}
157     }
158     end
159    
160     def "init_utmp" "Creating utmp"
161     start() {
162     : >/var/run/utmp
163     }
164     end
165    
166     def "mount_noext2" "Mounting non-ext2 filesystems"
167     start() {
168     echo "Mounting non-ext2 filesystems..."
169     safe_eval /bin/mount -avtnoext2,noproc,noreiserfs,nodevpts
170     }
171     end
172