Import sources from 2011-03-30 iso image - sys/lib
This commit is contained in:
parent
b41b903422
commit
e463eb4036
1144 changed files with 388460 additions and 0 deletions
57
sys/lib/backup/funcs
Executable file
57
sys/lib/backup/funcs
Executable file
|
@ -0,0 +1,57 @@
|
|||
#!/bin/rc
|
||||
# funcs - rc functions and definitions common to dump scripts
|
||||
fn backupinit {
|
||||
if (! ~ $backupinitdone yes) {
|
||||
disc=1
|
||||
tracks=0
|
||||
|
||||
# tunable parameters
|
||||
set=set1
|
||||
fs=pie
|
||||
arenas=/dev/sde0/arena0 # on $fs
|
||||
rdev=/dev/sdE1 # on terminal with bd burner
|
||||
|
||||
blocksize=8192
|
||||
arenasize=1073741824 # twice the venti default, on yoshimi & pie
|
||||
# trackbytes=$arenasize
|
||||
# discbytes=`{ls -l $rdev/data | awk '{print $6}'}
|
||||
# ntracks=`{ hoc -e 'int('$discbytes/$trackbytes')' }
|
||||
ntracks=45 # for BD dual-layer
|
||||
|
||||
backupinitdone=yes
|
||||
backups=/sys/lib/backup
|
||||
path=(/bin $backups .)
|
||||
}
|
||||
}
|
||||
|
||||
# assume we're in $backups/$set
|
||||
fn updprog {
|
||||
echo 'disc='$disc 'tracks='$tracks >ndisc && mv ndisc disc
|
||||
}
|
||||
|
||||
# assumes $set is set
|
||||
fn dumpdone { # arena-part arena-name
|
||||
@ {
|
||||
cd $backups/$set
|
||||
progress=yes
|
||||
tracks = `{hoc -e $tracks+1}
|
||||
updprog
|
||||
if (~ $debug yes)
|
||||
echo $2 >>fake # pretend these are sealed
|
||||
echo $2 >>ondisc
|
||||
}
|
||||
}
|
||||
|
||||
fn quitonfailure { # exit-status
|
||||
if (! ~ $1 '' 0 '|')
|
||||
exit $1
|
||||
}
|
||||
|
||||
# caller sets arenabase first
|
||||
fn arenastart { # arena#
|
||||
bytes = `{ echo $arenabase' + ('$1' * '$arenasize')' | bc }
|
||||
blocks = `{ echo $bytes' / '$blocksize | bc }
|
||||
echo $blocks
|
||||
}
|
||||
|
||||
backupinit
|
Loading…
Add table
Add a link
Reference in a new issue