]> git.sur5r.net Git - bacula/rescue/blob - rescue/linux/cdrom/Makefile.in
7bf13494e7a14b35ca439a5dcb51fea5dd19e6fe
[bacula/rescue] / rescue / linux / cdrom / Makefile.in
1 #
2 # Makefile for building a Bacula Rescue CDROM or remastering
3 #   a CDROM or ISO image adding the Bacula files.
4 #
5
6 .PATH:          .
7
8 CWD=@BUILD_DIR@/linux/cdrom
9
10 first_rule: all
11 dummy:
12
13 #-------------------------------------------------------------------------
14
15 # Make an iso boot image
16 iso:
17         rm -f bootcd.iso
18         mkisofs -A "Bacula Rescue Disk" -V "Bacula Rescue Disk" \
19           -J -R -T -o bootcd.iso \
20           -b boot/isolinux/isolinux.bin -c boot/isolinux/boot.cat \
21           -no-emul-boot -boot-load-size 4 -boot-info-table cdtree
22
23 # not used
24 remaster:
25         rm -f bootcd.iso
26         mkisofs -A "Bacula Rescue Disk" -V "Bacula Rescue Disk" \
27           -J -R -T -o bootcd.iso \
28           -b isolinux/isolinux.bin -c isolinux/boot.cat \
29           -no-emul-boot -boot-load-size 4 -boot-info-table cdimage
30
31 # not used
32 cdimage:
33         makecdimage --type=@type@ --where=@where@
34
35
36 # try booting it with qemu emulator
37 boot:
38         qemu -cdrom bootcd.iso
39
40 initrd:
41         ./makeinitrd
42
43 kernel:
44         ./makekernel @KERNEL@
45
46 binaries:
47         ./makebinaries
48
49 static-bacula: dummy
50         @(cd bacula; make copy-static-fd)
51
52 bacula: dummy
53         @(cd bacula; make)
54
55 copy-bacula:
56         cp -a bacula/ cdimage/
57
58
59
60 # This will build the Bacula rescue
61 all:    kernel binaries bacula initrd iso
62
63
64 copy-static-fd: kernel binaries static-bacula initrd iso
65
66
67 # This needs to be customized for your burner.
68 # Use either dev=ATA:x,y,z  (as reported by cdrecord -scanbus)
69 #         or dev=/dev/<device> (e.g. hdc)
70 burn:
71         cdrecord dev=@DEV@ gracetime=2 fs=4096k driveropts=burnfree -v \
72          -useinfo speed=48 -dao -eject -pad -data "bootcd.iso"
73
74 # Blank the CDROM assuming it is +rw
75 blank:
76         cdrecord dev=@DEV@ gracetime=2 -v blank=fast -useinfo speed=48
77
78 scan:
79         cdrecord -scanbus
80
81 distclean:
82 clean:
83 #
84 # Clean out files that are rebuilt
85 #
86         @rm -f bootcd.iso custom-rd.img.bz2
87         @rm -f 1 2 3 4
88         @rm -rf mnt
89         @rm -rf roottree/bin roottree/proc roottree/boot
90         @rm -rf roottree/lib roottree/sbin roottree/dev
91         @rm -rf roottree/dev roottree/sys roottree/sysroot
92         @rm -rf roottree/sys roottree/usr 
93         @rm -rf roottree/initrd roottree/cdrom roottree/mnt
94         @rm -rf roottree/tmp roottree/var          
95         @rm -f roottree/etc/services roottree/etc/exports
96         @rm -f roottree/etc/gshadow roottree/etc/shadow 
97         @rm -f roottree/etc/passwd  roottree/etc/group
98         @rm -f roottree/etc/hosts roottree/etc/bashrc
99         @rm -f roottree/etc/filesystems roottree/etc/fstab 
100         @rm -f roottree/etc/protocols roottree/etc/localtime
101         @rm -f roottree/etc/ld.so.cache
102         @rm -f roottree/etc/modules.conf roottree/etc/syslog.conf
103         @rm -rf roottree/etc/pam.d roottree/etc/ssh
104         @rm -rf roottree/etc/security roottree/etc/init.d
105         @rm -rf roottree/etc/udev roottree/etc/modprobe.conf
106         @rm -rf roottree/etc/dev.d roottre/etc/hotplug roottree/etc/modeprob.d
107         @rm -rf roottree/etc/sysconfig roottre/etc/syslog-ng
108         @rm -rf roottree/bacula-*
109         @rm -f cdtree/boot/isolinux/initrd.img
110         @rm -f cdtree/boot/isolinux/isolinux.cfg
111         @rm -f cdtree/boot/isolinux/vmlinuz
112         @rm -f cdtree/boot/isolinux/map
113         @(cd bacula; make distclean)
114 #       @(cd ${MKCDREC}; make clean)
115 #       @(cd ${MKCDREC}/busybox; make distclean)
116
117
118 #
119 # This was the integration with mkcdrec, but I could never
120 #  get it to work reliably.
121 #
122 MKCDREC=@BUILD_DIR@/mkcdrec
123 mkcdrec: kernel binaries bacula pre-mkcdrec main-mkcdrec post-mkcdrec
124 pre-mkcdrec:                
125         @echo
126         ./mkcdrec_rd    
127         @echo "Patching mkcdrec Config.sh for Bacula"
128         @mkdir -p tmp
129         @rm -f tmp/1 tmp/2 tmp/1
130         @cp ${MKCDREC}/Config.sh tmp/2
131         @echo "s%^BACULA_DIR.*$$%BACULA_DIR=${CWD}/bacula%g" >tmp/1
132         @sed -f tmp/1 tmp/2 >tmp/3
133         @echo "s%^BACULA_RESTORE.*$$%BACULA_RESTORE=\"y\"%g" >tmp/1
134         @sed -f tmp/1 tmp/3 >tmp/4
135         @echo "s%^DVD_Drive.*$$%DVD_Drive=0%g" >tmp/1
136         @sed -f tmp/1 tmp/4 >tmp/5
137         @echo "s%^USECOLOR.*$$%USECOLOR=n%g" >tmp/1
138         @sed -f tmp/1 tmp/5 >${MKCDREC}/Config.sh
139         @rm -rf tmp
140         @cp -f @BACULA_BIN@/bacula-fd bacula/bin
141         @cp -f @BACULA_SCRIPTS@/bacula-fd.conf bacula/bin
142
143 main-mkcdrec: dummy
144         @echo " "
145         @echo "Doing make in mkcdrec directory. This may take some time and"
146         @echo "  produce a good amount of output"
147         @echo " "
148         @echo             
149         (cd ${MKCDREC}; make rescue)
150
151 post-mkcdrec:
152         @echo "Cleaning up"
153         cp /tmp/CDrec.iso bootcd.iso
154         chmod 644 bootcd.iso
155         rm -f /tmp/CDrec.iso
156         rm -f custom-rd.img.bz2