/[fai]/trunk/bin/make-fai-nfsroot
ViewVC logotype

Contents of /trunk/bin/make-fai-nfsroot

Parent Directory Parent Directory | Revision Log Revision Log


Revision 5725 - (show annotations) (download)
Wed Feb 17 12:33:29 2010 UTC (3 years, 2 months ago) by lange
File size: 18672 byte(s)
make-fai-nfsroot: fix matching of hook names
1 #! /bin/bash
2
3 # $Id$
4 #*********************************************************************
5 #
6 # make-fai-nfsroot -- create nfsroot directory and add additional packages
7 #
8 # This script is part of FAI (Fully Automatic Installation)
9 # (c) 2000-2010 by Thomas Lange, lange@informatik.uni-koeln.de
10 # Universitaet zu Koeln
11 # (c) 2004 by Henning Glawe, glaweh@physik.fu-berlin.de
12 # Freie Universitaet Berlin
13 #
14 #*********************************************************************
15 # This program is free software; you can redistribute it and/or modify
16 # it under the terms of the GNU General Public License as published by
17 # the Free Software Foundation; either version 2 of the License, or
18 # (at your option) any later version.
19 #
20 # This program is distributed in the hope that it will be useful, but
21 # WITHOUT ANY WARRANTY; without even the implied warranty of
22 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
23 # General Public License for more details.
24 #
25 # A copy of the GNU General Public License is available as
26 # `/usr/share/common-licences/GPL' in the Debian GNU/Linux distribution
27 # or on the World Wide Web at http://www.gnu.org/copyleft/gpl.html. You
28 # can also obtain it by writing to the Free Software Foundation, Inc.,
29 # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
30 #*********************************************************************
31
32 # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
33 usage() {
34
35 cat <<-EOF
36 Copyright (C) 1999-2010 Thomas Lange
37 Report bugs to <fai@informatik.uni-koeln.de>.
38
39 Usage: make-fai-nfsroot [OPTIONS]
40 Create an NFSROOT for FAI.
41 Read the man pages pages make-fai-nfsroot(8).
42 EOF
43 exit 0
44 }
45 # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
46 die() {
47
48 echo "ERROR: $@"
49 echo "Log file written to /var/log/fai/make-fai-nfsroot.log"
50 exit 99
51 }
52
53 # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
54 check_nfsroot() {
55
56 set +e
57 # simple test, to see if important thing are available inside the nfsroot
58 [ -d $NFSROOT/usr/share/live-initramfs ] || die "live-initramfs was not installed inside the nfsroot."
59 local files=$(ls $NFSROOT/boot/initrd* 2>/dev/null)
60 [ -z "$files" ] && die "No initrd installed."
61 egrep -q "^ERROR: " /var/log/fai/make-fai-nfsroot.log && bad_exit
62 return 0
63 }
64 # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
65 badupdateto32() {
66
67 cat <<-EOF
68 It seems that you have updated an older FAI version without checking files in /etc/fai/
69 Please check the NEWS file for changes in variable names and if you have a linux-image package
70 defined in /etc/fai/NFSROOT.
71 EOF
72 die $@
73 }
74 # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
75
76 PATH=/usr/local/bin:/usr/local/sbin:/bin:/sbin:/usr/bin:/usr/sbin
77
78 merror="properly"
79 sshpreserve=0
80 divert=1
81
82 if [ -f /etc/lsb-release ]; then
83 . /etc/lsb-release
84 case "$DISTRIB_ID" in
85 Ubuntu) divert=0 ;;
86 esac
87 fi
88
89 # option e currently does nothing
90 while getopts hervC:f:kKpU opt ; do
91 case "$opt" in
92 C) cfdir=$OPTARG ;;
93 v) verbose=1 ; v=-v ;;
94 r) recover=1 ;;
95 f) die "Option -f is not supported any more. Use option -C instead" ;;
96 k) kinstall=1 ;;
97 K) kremove=1;;
98 h) usage ;;
99 e) expert=1 ;; # a dummy option, that only fai-setup uses
100 p) sshpreserve=1 ;;
101 U) divert=0 ;;
102 ?) exit 5 ;; # error in option parsing
103 esac
104 done
105
106 if [ $(id -u) != "0" ]; then
107 echo "Run this program as root."
108 exit 9
109 fi
110
111 set -e
112
113 # use FAI_ETC_DIR from environment variable
114 if [ -n "$FAI_ETC_DIR" -a -z "$cfdir" ]; then
115 echo "Using environment variable \$FAI_ETC_DIR."
116 fi
117 [ -z "$cfdir" ] && cfdir=${FAI_ETC_DIR:=/etc/fai}
118 cfdir=$(readlink -f $cfdir) # canonicalize path
119 if [ ! -d "$cfdir" ]; then
120 echo "$cfdir is not a directory"
121 exit 6
122 fi
123 [ "$verbose" ] && echo "Using configuration files from $cfdir"
124 . $cfdir/fai.conf
125
126 # read config file for this tool
127 if [ -f "$cfdir/make-fai-nfsroot.conf" ]; then
128 . $cfdir/make-fai-nfsroot.conf
129 else
130 echo "Can't read $cfdir/make-fai-nfsroot.conf"
131 exit 8
132 fi
133
134 # IMO this may be removed, since all information should be included into sources.list
135 [ -n "$FAI_LOCAL_REPOSITORY" ] && die "The use of \$FAI_LOCAL_REPOSITORY is now deprecated. Please include this information into sources.list."
136 [ -n "$packages" ] && badupdateto32 "The use of \$packages in make-fai-nfsroot.conf is now deprecated. Please include this information into $cfdir/NFSROOT."
137 [ -n "$NFSROOT_PACKAGES" ] && die "The use of \$NFSROOT_PACKAGES in make-fai-nfsroot.conf is now deprecated. Please include this information into $cfdir/NFSROOT."
138 [ -n "$FAI_SOURCES_LIST" ] && die "The use of \$FAI_SOURCES_LIST is deprecated. Please use sources.list now."
139
140 [ -z "$NFSROOT" ] && die "\$NFSROOT is not set. Please check your settings in $cfdir/make-fai-nfsroot.conf."
141 [ -z "$TFTPROOT" ] && badupdateto32 "\$TFTPROOT is not set. Please check your settings in $cfdir/make-fai-nfsroot.conf."
142 [ -n "$KERNELPACKAGE" ] && badupdateto32 "The use of \$KERNELPACKAGE is deprecated. Please use $cfdir/NFSROOT now."
143 [ ! -d "$cfdir/apt" ] && die "$cfdir/apt/ does not exists. Can't continue."
144
145 oldnfsroot=$NFSROOT
146 NFSROOT="$NFSROOT/live/filesystem.dir"
147 ROOTCMD="chroot $NFSROOT"
148
149 RUNDIR=/var/run/fai/make-fai-nfsroot
150 mkdir -p $RUNDIR
151 export DEBIAN_FRONTEND=noninteractive
152 [ "$recover" ] || rm -rf $RUNDIR/*
153 # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
154 bad_exit() {
155
156 merror="with errors"
157 echo "An error occured during make-fai-nfsroot."
158 echo "Please fix the error or try make-fai-nfsroot -v"
159 }
160 # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
161 call_with_stamp() {
162
163 local func=$1
164 local stamp=$RUNDIR/$func
165 # call subroutine
166 [ "$recover" -a -f $stamp ] && return 0
167 # make a stamp only on success.
168 "$@" && : > $stamp
169 }
170 # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
171 call_verbose() {
172
173 if [ "$verbose" ]; then
174 "$@"
175 return $?
176 else
177 "$@" > /dev/null
178 return $?
179 fi
180 }
181 # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
182 install_kernel_nfsroot() {
183
184 if [ $divert = 1 ]; then
185 rm $NFSROOT/usr/sbin/update-initramfs
186 LC_ALL=C $ROOTCMD dpkg-divert --rename --remove /usr/sbin/update-initramfs
187 $ROOTCMD update-initramfs -k all -t -u
188 fi
189 }
190 # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
191 setup_ssh() {
192
193 # nothing to do if no ssh is available in nfsroot
194 [ -f $NFSROOT/usr/bin/ssh ] || return 0
195 if [ $sshpreserve = 1 ]; then
196 tar -C $NFSROOT -xf $tmptar
197 rm $tmptar
198 return 0
199 fi
200
201 mkdir -p -m 700 $NFSROOT/root/.ssh
202 if [ -n "$LOGUSER" ] ; then
203 loguserhome=$(eval "cd ~$LOGUSER 2>/dev/null && pwd;true")
204 [ -f $loguserhome/.ssh/known_hosts ] && cp $loguserhome/.ssh/known_hosts $NFSROOT/root/.ssh/known_hosts
205 [ -d $loguserhome/.ssh ] && {
206 [ -f $loguserhome/.ssh/id_dsa ] &&
207 cp -p $loguserhome/.ssh/id_dsa* $NFSROOT/root/.ssh/
208 [ -f $loguserhome/.ssh/id_rsa ] &&
209 cp -p $loguserhome/.ssh/id_rsa* $NFSROOT/root/.ssh/
210 }
211 fi
212
213 # enable root login
214 perl -pi -e 's/PermitRootLogin no/PermitRootLogin yes/' $NFSROOT/etc/ssh/sshd_config
215 if [ -f "$SSH_IDENTITY" ]; then
216 cp $SSH_IDENTITY $NFSROOT/root/.ssh/authorized_keys
217 chmod 0644 $NFSROOT/root/.ssh/authorized_keys
218 echo You can log into install clients without password using $SSH_IDENTITY
219 fi
220 }
221 # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
222 copy_fai_files() {
223
224 # copy to nfsroot
225 # echo "root:$FAI_ROOTPW" | $ROOTCMD chpasswd --encrypted
226 $ROOTCMD usermod -p $FAI_ROOTPW root
227 cp -RLpv $cfdir/* $NFSROOT/etc/fai
228 # append additional variables to fai.conf for the install clients
229 [ -z "$FAI_CONFIG_SRC" ] && echo "FAI_CONFIG_SRC=nfs://`hostname`$FAI_CONFIGDIR" >> $NFSROOT/etc/fai/fai.conf
230
231 # remove some files that should not be copied
232 rm -f $NFSROOT/etc/fai/make-fai-nfsroot.conf
233 [ -f $cfdir/.cvspass ] && cp -p $v $cfdir/.cvspass $NFSROOT/.cvspass
234 $ROOTCMD shadowconfig on
235 }
236 # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
237 call_debootstrap() {
238
239 # check if NFSROOT directory is mounted with bad options
240 fs=$(df $NFSROOT | tail -1 | awk '{print $6}')
241 if mount | grep "on $fs " | awk '{print $6}' | egrep -q "nosuid|nodev"; then
242 die "NFSROOT directory $NFSROOT is mounted using nosuid or nodev. Aborting"
243 fi
244 local dversion=$(dpkg -l debootstrap | awk '/debootstrap/ {print $3}')
245 echo "Creating base system using debootstrap version $dversion"
246 echo "Calling debootstrap $1 $NFSROOT $2"
247 LC_ALL=C call_verbose debootstrap $FAI_DEBOOTSTRAP_OPTS $1 $NFSROOT $2
248 if [ $? -ne 0 ]; then
249 echo "ERROR: debootstrap did not complete successfully."
250 echo "This is mostly caused by a broken mirror."
251 echo "Please check your mirror or use an official mirror."
252 [ "$verbose" ] || echo "Call make-fai-nfsroot -v for better debugging."
253 exit 10
254 fi
255
256 if [ ! -f $NFSROOT/usr/bin/apt-get ]; then
257 echo "No apt-get executable available inside the NFSROOT."
258 echo "Maybe debootstrap did not finish successfully. Aborting."
259 [ "$verbose" ] || echo "Call make-fai-nfsroot -v for better debugging."
260 exit 11
261 fi
262 }
263 # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
264 add_all_host_entries() {
265
266 local ips=$(ip addr show up| grep -w inet | cut -d t -f 2 | cut -d ' ' -f 2 | cut -d / -f 1 | grep -v 127.0.0.1)
267 for eth in $ips; do
268 getent hosts $eth >> etc/hosts || true
269 done
270 }
271 # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
272 create_base() {
273
274 if [ "$FAI_DEBOOTSTRAP" ]; then
275 call_with_stamp call_debootstrap $FAI_DEBOOTSTRAP
276 $ROOTCMD apt-get clean
277 rm -f $NFSROOT/etc/resolv.conf
278 echo "Creating base.tgz"
279 tar --one-file-system -C $NFSROOT -cf - --exclude var/tmp/base.tgz --exclude 'var/lib/apt/lists/*_*' . | gzip > $NFSROOT/var/tmp/base.tgz
280 touch $NFSROOT/.THIS_IS_THE_FAI_NFSROOT
281 else
282 die "\$FAI_DEBOOTSTRAP not defined."
283 fi
284 }
285 # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
286 create_nfsroot() {
287
288 mkdir -p $NFSROOT/$FAI
289 cd $NFSROOT || die "Can't cd to $NFSROOT"
290
291 call_with_stamp create_base
292 # save the list of all packages in the base.tgz
293 $ROOTCMD dpkg --get-selections | awk '/install$/ {print $1}' > var/tmp/base-pkgs.lis
294
295 if [ "$FAI_DEBMIRROR" ]; then
296 [ "$verbose" ] && echo "Mounting $FAI_DEBMIRROR to $NFSROOT/$MNTPOINT."
297 mkdir -p $NFSROOT/$MNTPOINT
298 mount -o ro,noatime,rsize=8192 $FAI_DEBMIRROR $NFSROOT/$MNTPOINT || \
299 die "Can't mount $FAI_DEBMIRROR to $NFSROOT/$MNTPOINT."
300 fi
301
302 # hoaks some packages
303 # liloconfig, dump and raidtool2 needs these files
304 echo "# UNCONFIGURED FSTAB FOR BASE SYSTEM" > etc/fstab
305 > etc/raidtab
306 echo 'NTPSERVERS=""' > etc/default/ntp-servers
307
308 cp -La $cfdir/apt $NFSROOT/etc
309
310 ainsl -as $NFSROOT/etc/hosts "127.0.0.1 localhost"
311 ainsl $NFSROOT/etc/hosts "$NFSROOT_ETC_HOSTS"
312 add_all_host_entries
313
314 # we need these option before installing the first package. So we
315 # can't put this into fai-nfsroot /etc/apt/apt.conf.d/90fai
316 cat <<EOF >$NFSROOT/etc/apt/apt.conf.d/10fai
317 APT::Get::AllowUnauthenticated "true";
318 Aptitude::CmdLine::Ignore-Trust-Violations yes;
319 EOF
320 echo "Upgrading $NFSROOT"
321 LC_ALL=C call_verbose call_with_stamp upgrade_nfsroot
322
323 # overwrite default live.conf
324 if [ -f $cfdir/live.conf ]; then
325 cp -Lp $cfdir/live.conf etc/live.conf
326 else
327 cat > etc/live.conf <<EOF
328 # UNIONTYPE=aufs # if unionfs is broken
329 NOUSER="Yes"
330 NOHOSTS="Yes"
331 export UNIONTYPE NOHOSTS NOUSER
332 EOF
333 fi
334
335 LC_ALL=C call_with_stamp add_packages_nfsroot
336 call_with_stamp copy_fai_files
337
338 # set timezone in nfsroot
339 timezone=$(readlink /etc/localtime | sed 's%^/usr/share/zoneinfo/%%')
340 echo $timezone > etc/timezone
341 ln -sf /usr/share/zoneinfo/$timezone etc/localtime
342 ln -sf /proc/mounts etc/mtab
343 [ -f etc/init/tty1.conf ] || ln -s /usr/sbin/fai etc/init.d/rcS
344 find etc/init ! -type d | egrep -v "fai|udev|hostname|mountall|mounted" | xargs -r rm
345
346 rm -f etc/udev/rules.d/70-persistent-net.rules
347 # definition for loopback device
348 echo "iface lo inet loopback" > etc/network/interfaces
349
350 cat >> root/.profile <<-EOF
351 PATH=/usr/local/sbin:/usr/local/bin:/usr/lib/fai:/bin:/sbin:/usr/bin:/usr/sbin:
352 export PATH
353 . /usr/lib/fai/subroutines
354 set -a
355 . /tmp/fai/variables.log 2>/dev/null
356 EOF
357
358 call_verbose call_with_stamp setup_ssh
359 }
360 # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
361 upgrade_nfsroot() {
362
363 if [ -f /etc/resolv.conf ]; then
364 cp -Lp $v /etc/resolv.conf $NFSROOT/etc/resolv.conf-installserver
365 cp -Lp $v /etc/resolv.conf $NFSROOT/etc/resolv.conf # this is needed during make-fai-nfsroot
366 fi
367 mount -t proc /proc $NFSROOT/proc
368 mount -t sysfs /sys $NFSROOT/sys
369 mount -t devpts devpts $NFSROOT/dev/pts
370 $ROOTCMD apt-get update
371 $ROOTCMD aptitude -Rfy install fai-nfsroot
372 $ROOTCMD apt-get check
373 rm -rf $NFSROOT/etc/apm
374
375 if [ $divert = 1 ]; then
376 fdivert /usr/sbin/update-initramfs
377 ln -s /bin/true $NFSROOT/usr/sbin/update-initramfs
378 fi
379 fdivert /sbin/start-stop-daemon /sbin/discover-modprobe
380 cp -p /sbin/fai-start-stop-daemon $NFSROOT/sbin
381 cp -p /sbin/fai-start-stop-daemon $NFSROOT/sbin/start-stop-daemon
382 $ROOTCMD apt-get -y dist-upgrade
383 }
384 # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
385 add_packages_nfsroot() {
386
387 local iarch=$($ROOTCMD dpkg --print-architecture|tr /a-z/ /A-Z/)
388 export FAI_ROOT=$NFSROOT
389 export classes="NFSROOT $iarch"
390 cat > $NFSROOT/etc/kernel-img.conf << EOF
391 do_bootloader = No
392 do_initrd = No
393 warn_initrd = No
394 EOF
395 install_packages -l -p$cfdir > $NFSROOT/var/tmp/packages.nfsroot
396 echo "Adding additional packages to $NFSROOT:"
397 cat $NFSROOT/var/tmp/packages.nfsroot
398 call_verbose install_packages -N $v -p$cfdir
399 echo "install_packages exit code: $?"
400 }
401 # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
402 umount_dirs() {
403
404 [ -f $NFSROOT/usr/sbin/dpkg-divert ] &&
405 LC_ALL=C $ROOTCMD dpkg-divert --rename --remove /sbin/discover-modprobe
406 cd /
407 [ -d $NFSROOT/proc/self ] && umount $NFSROOT/proc
408 [ -d $NFSROOT/sys/class ] && umount $NFSROOT/sys
409 [ -d $NFSROOT/proc/self ] && die "/proc still mounted inside the nfsroot."
410 umount $NFSROOT/dev/pts 2> /dev/null || true
411
412 if [ "$FAI_DEBMIRROR" ]; then
413 test -d $NFSROOT/$MNTPOINT && umount $NFSROOT/$MNTPOINT || true
414 fi
415 # show directories still mounted on nfsroot
416 mount | grep " on $NFSROOT " || true
417 }
418 # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
419 setup_dhcp(){
420
421 # pxe and dhcp environment
422 local pxebin=/usr/lib/syslinux/pxelinux.0
423 rm -f $NFSROOT/boot/*.bak
424 mkdir -p $TFTPROOT/pxelinux.cfg
425 cp -pv $NFSROOT/boot/vmlinu?-* $NFSROOT/boot/initrd.img-* $TFTPROOT
426 [ -f $pxebin ] && cp $pxebin $TFTPROOT
427 echo "DHCP environment prepared. If you want to use it, you have to enable the dhcpd and the tftp-hpa daemon."
428 }
429 # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
430 fdivert() {
431
432 local item
433 for item in "$@"; do
434 LC_ALL=C $ROOTCMD dpkg-divert --quiet --add --rename $item
435 done
436 }
437 # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
438 kernel_install() {
439
440 # Install the kernel package
441
442 # create tftp boot images
443 call_with_stamp install_kernel_nfsroot
444
445 # setup for DHCP, BOOTP or both
446 [ "x$FAI_BOOT" = "x" ] && FAI_BOOT="dhcp"
447
448 for bootopt in $FAI_BOOT; do
449 case $bootopt in
450 dhcp|DHCP)
451 call_with_stamp setup_dhcp ;;
452 bootp|BOOTP)
453 echo "You have to setup BOOTP support manually." ;;
454 *)
455 echo "Unknown boot option" ;;
456 esac
457 done
458 }
459 # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
460 run_hooks() {
461
462 local file
463 if [ -z "$NFSROOT_HOOKS" ]; then
464 return
465 fi
466 if [ -d "$NFSROOT_HOOKS" ]; then
467 echo "Running hooks..."
468 for file in $(cd $NFSROOT_HOOKS ;ls 2>/dev/null | egrep '^[[:alnum:]_.-]+$'); do
469 . $NFSROOT_HOOKS/$file
470 done
471 fi
472 }
473 # - - - - - - - - - - - - - - - - - - - - - - - - - -
474 # main routine
475
476 trap 'echo "Aborting";umount_dirs' EXIT
477 trap "bad_exit" ERR
478 {
479
480 # remove all kernels from nfsroot
481 [ -n "$kremove" ] && {
482 echo "Removing all kernels from NFSROOT."
483 $ROOTCMD aptitude -y purge ~nlinux-image
484 exit
485 }
486
487 # just install a new kernel to the nfsroot
488 [ -n "$kinstall" ] && {
489 trap "true" EXIT
490 echo "Upgrading nfsroot and installing new packages into the nfsroot."
491 if [ $divert = 1 ]; then
492 fdivert /usr/sbin/update-initramfs
493 ln -s /bin/true $NFSROOT/usr/sbin/fai
494 fi
495 $ROOTCMD apt-get update
496 $ROOTCMD apt-get -y dist-upgrade
497 LC_ALL=C add_packages_nfsroot
498 kernel_install
499 run_hooks
500 umount_dirs
501 trap "true" EXIT
502 echo "make-fai-nfsroot finished $merror."
503 exit 0
504 }
505
506 echo "Creating FAI nfsroot in $NFSROOT."
507 echo "By default it needs more than 380 MBytes disk space."
508 echo "This may take a long time."
509
510 if [ $sshpreserve = 1 ]; then
511 [ "$verbose" ] && echo "Preserving root/.ssh directory from inside the nfroot."
512 # save old .ssh directory
513 tmptar=$(mktemp) || exit 12
514 # should we set the umask before? Does it influence the other parts?
515 tar -C $NFSROOT -cf $tmptar root/.ssh
516 fi
517
518 # Kill the directory if not in recover mode
519 if [ -d $NFSROOT/proc -a ! "$recover" ]
520 then
521 echo $NFSROOT already exists. Removing $NFSROOT
522 umount $NFSROOT/dev/pts 1>/dev/null 2>&1 || true
523 [ -L $NFSROOT/proc/self ] && umount $NFSROOT/proc || true
524 [ -L $NFSROOT/proc/self ] && die "/proc is still mounted inside the nfsroot."
525 umount $NFSROOT/$MNTPOINT 2>/dev/null || true # it's safer to try to umount
526 rm -rf $oldnfsroot/.??* $oldnfsroot/*
527 # also remove files $NFSROOT/.? but not . and ..
528 find $oldnfsroot -xdev -maxdepth 1 ! -type d | xargs -r rm -f
529 fi
530
531 # Create a new nfsroot
532 if [ ! -x "$(which debootstrap)" ]; then
533 die "Can't find debootstrap command. Aborting."
534 fi
535 call_with_stamp create_nfsroot
536
537 kernel_install
538 run_hooks
539 check_nfsroot
540 umount_dirs
541 echo "make-fai-nfsroot finished $merror."
542 exit 0
543 } 2>&1 | tee /var/log/fai/make-fai-nfsroot.log
544 umount_dirs
545 trap "true" EXIT
546 echo "Log file written to /var/log/fai/make-fai-nfsroot.log"

Properties

Name Value
svn:eol-style native
svn:executable *
svn:keywords Author Date Id Revision

  ViewVC Help
Powered by ViewVC 1.1.5