Browse Source

Use df to verify that we are not booted from the altboot before doing

the / -> /altroot copy.  OK deraadt@
OPENBSD_3_7
millert 20 years ago
parent
commit
5947d351eb
1 changed files with 3 additions and 5 deletions
  1. +3
    -5
      src/etc/daily

+ 3
- 5
src/etc/daily View File

@ -1,6 +1,6 @@
#!/bin/sh - #!/bin/sh -
# #
# $OpenBSD: daily,v 1.47 2004/11/15 18:10:48 nick Exp $
# $OpenBSD: daily,v 1.48 2004/12/07 19:08:15 millert Exp $
# From: @(#)daily 8.2 (Berkeley) 1/25/94 # From: @(#)daily 8.2 (Berkeley) 1/25/94
# #
PATH=/bin:/usr/bin:/sbin:/usr/sbin:/usr/local/bin PATH=/bin:/usr/bin:/sbin:/usr/sbin:/usr/local/bin
@ -91,13 +91,11 @@ fi
# if filesystem named /altroot is type ffs, on /dev/* and mounted "xx", # if filesystem named /altroot is type ffs, on /dev/* and mounted "xx",
# use it as a backup root filesystem to be updated daily. # use it as a backup root filesystem to be updated daily.
[ "X$ROOTBACKUP" = X1 ] && { [ "X$ROOTBACKUP" = X1 ] && {
rootdev=`awk '$2 == "/" && $1 ~ /^\/dev\// && $3 == "ffs" && \
$4 ~ /rw/ \
{ print substr($1, 6) }' < /etc/fstab`
rootdev=`df -n / | awk '/^\/dev\// { print substr($1, 6) }'`
rootbak=`awk '$2 == "/altroot" && $1 ~ /^\/dev\// && $3 == "ffs" && \ rootbak=`awk '$2 == "/altroot" && $1 ~ /^\/dev\// && $3 == "ffs" && \
$4 ~ /xx/ \ $4 ~ /xx/ \
{ print substr($1, 6) }' < /etc/fstab` { print substr($1, 6) }' < /etc/fstab`
[ X$rootdev != X -a X$rootbak != X ] && {
[ X$rootdev != X -a X$rootbak != X -a X$rootdev != X$rootbak ] && {
sync sync
echo "" echo ""
echo "Backing up root filesystem:" echo "Backing up root filesystem:"


Loading…
Cancel
Save