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