]> git.sur5r.net Git - bacula/rescue/blob - rescue/linux/cdrom/Makefile.in
Final changes
[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/rc.d
106         @rm -rf roottree/etc/udev roottree/etc/modprobe.conf
107         @rm -rf roottree/etc/dev.d roottre/etc/hotplug roottree/etc/modprobe.d
108         @rm -rf roottree/etc/modprobe.conf.local roottree/etc/hotplug
109         @rm -rf roottree/etc/sysconfig roottree/etc/syslog-ng
110         @rm -rf roottree/bacula-*
111         @rm -f cdtree/boot/isolinux/initrd.img
112         @rm -f cdtree/boot/isolinux/isolinux.cfg
113         @rm -f cdtree/boot/isolinux/vmlinuz
114         @rm -f cdtree/boot/isolinux/map
115         @(cd bacula; make distclean)
116 #       @(cd ${MKCDREC}; make clean)
117 #       @(cd ${MKCDREC}/busybox; make distclean)
118
119
120 #
121 # This was the integration with mkcdrec, but I could never
122 #  get it to work reliably.
123 #
124 MKCDREC=@BUILD_DIR@/mkcdrec
125 mkcdrec: kernel binaries bacula pre-mkcdrec main-mkcdrec post-mkcdrec
126 pre-mkcdrec:                
127         @echo
128         ./mkcdrec_rd    
129         @echo "Patching mkcdrec Config.sh for Bacula"
130         @mkdir -p tmp
131         @rm -f tmp/1 tmp/2 tmp/1
132         @cp ${MKCDREC}/Config.sh tmp/2
133         @echo "s%^BACULA_DIR.*$$%BACULA_DIR=${CWD}/bacula%g" >tmp/1
134         @sed -f tmp/1 tmp/2 >tmp/3
135         @echo "s%^BACULA_RESTORE.*$$%BACULA_RESTORE=\"y\"%g" >tmp/1
136         @sed -f tmp/1 tmp/3 >tmp/4
137         @echo "s%^DVD_Drive.*$$%DVD_Drive=0%g" >tmp/1
138         @sed -f tmp/1 tmp/4 >tmp/5
139         @echo "s%^USECOLOR.*$$%USECOLOR=n%g" >tmp/1
140         @sed -f tmp/1 tmp/5 >${MKCDREC}/Config.sh
141         @rm -rf tmp
142         @cp -f @BACULA_BIN@/bacula-fd bacula/bin
143         @cp -f @BACULA_SCRIPTS@/bacula-fd.conf bacula/bin
144
145 main-mkcdrec: dummy
146         @echo " "
147         @echo "Doing make in mkcdrec directory. This may take some time and"
148         @echo "  produce a good amount of output"
149         @echo " "
150         @echo             
151         (cd ${MKCDREC}; make rescue)
152
153 post-mkcdrec:
154         @echo "Cleaning up"
155         cp /tmp/CDrec.iso bootcd.iso
156         chmod 644 bootcd.iso
157         rm -f /tmp/CDrec.iso
158         rm -f custom-rd.img.bz2