3 # Copyright (C) 2000-2017 Kern Sibbald
4 # License: BSD 2-Clause; see file LICENSE-FOSS
6 # This script will prepare a big dummy autochanger
11 adir=@working_dir@/ach
14 mkdir $adir 2> /dev/null
16 # work with $1 slots by default
19 # create the autochanger configuration file
20 cat > $adir/conf <<EOF
38 # the standard script is looking for a real sg device
39 sed -i 's/test -c /test -f/g' $bin/storage-ctl 2> /dev/null
40 sed -i 's/test -c /test -f/g' $bin/storage2-ctl 2> /dev/null
42 # create generic device for bsg_persist
43 for i in `seq 0 8`; do
47 nb_vol=`expr $nb_slot - 5`
48 # create $nb_vol volumes
49 for i in `seq 1 $nb_vol`; do
50 echo $i:vol$i >> $adir/barcodes
51 cp /dev/null $adir/slot$i
54 # make a cleaning tape
55 cln_slot=`expr $nb_vol + 1`
56 echo $cln_slot:CLN01 >> $adir/barcodes
57 cp /dev/null $adir/slot$cnl_slot
60 next_empty=`expr $cnl_slot + 1`
61 for i in `seq $next_empty $nb_slot`; do
62 echo $i: >> $adir/barcodes