]> git.sur5r.net Git - bacula/rescue/blobdiff - rescue/linux/cdrom/Makefile.in
Get it booting again
[bacula/rescue] / rescue / linux / cdrom / Makefile.in
index 977fce97266d7bad9677ac64339faea030c10d27..83a0627dad8bb82b576ea4001de4fbc77d23ba14 100644 (file)
@@ -1,6 +1,12 @@
+#
+# Makefile for building a Bacula Rescue CDROM or remastering
+#   a CDROM or ISO image adding the Bacula files.
+#
 
 .PATH:         .
 
+MKCDREC=@BUILD_DIR@/mkcdrec
+CWD=@BUILD_DIR@/linux/cdrom
 
 first_rule: all
 dummy:
@@ -15,6 +21,17 @@ iso:
          -b boot/isolinux/isolinux.bin -c boot/isolinux/boot.cat \
          -no-emul-boot -boot-load-size 4 -boot-info-table cdtree
 
+remaster:
+       rm -f bootcd.iso
+       mkisofs -A "Bacula Rescue Disk" -V "Bacula Rescue Disk" \
+         -J -R -T -o bootcd.iso \
+         -b isolinux/isolinux.bin -c isolinux/boot.cat \
+         -no-emul-boot -boot-load-size 4 -boot-info-table cdimage
+
+cdimage:
+       makecdimage --type=@type@ --where=@where@
+
+
 # try booting it with qemu emulator
 boot:
        qemu -cdrom bootcd.iso
@@ -23,7 +40,7 @@ initrd:
        ./makeinitrd
 
 kernel:
-       ./makekernel
+       ./makekernel @KERNEL@
 
 binaries:
        ./makebinaries
@@ -34,19 +51,62 @@ static-bacula: dummy
 bacula: dummy
        @(cd bacula; make)
 
+copy-bacula:
+       cp -a bacula/ cdimage/
+
+pre-mkcdrec:               
+       @echo
+       ./mkcdrec_rd    
+       @echo "Patching mkcdrec Config.sh for Bacula"
+       @mkdir -p tmp
+       @rm -f tmp/1 tmp/2 tmp/1
+       @cp ${MKCDREC}/Config.sh tmp/2
+       @echo "s%^BACULA_DIR.*$$%BACULA_DIR=${CWD}/bacula%g" >tmp/1
+       @sed -f tmp/1 tmp/2 >tmp/3
+       @echo "s%^BACULA_RESTORE.*$$%BACULA_RESTORE=\"y\"%g" >tmp/1
+       @sed -f tmp/1 tmp/3 >tmp/4
+       @echo "s%^DVD_Drive.*$$%DVD_Drive=0%g" >tmp/1
+       @sed -f tmp/1 tmp/4 >tmp/5
+       @echo "s%^USECOLOR.*$$%USECOLOR=n%g" >tmp/1
+       @sed -f tmp/1 tmp/5 >${MKCDREC}/Config.sh
+       @rm -rf tmp
+       @cp -f @BACULA_BIN@/bacula-fd bacula/bin
+       @cp -f @BACULA_SCRIPTS@/bacula-fd.conf bacula/bin
+
+main-mkcdrec: dummy
+       @echo " "
+       @echo "Doing make in mkcdrec directory. This may take some time and"
+       @echo "  produce a good amount of output"
+       @echo " "
+       @echo             
+       (cd ${MKCDREC}; make rescue)
+
+post-mkcdrec:
+       @echo "Cleaning up"
+       cp /tmp/CDrec.iso bootcd.iso
+       chmod 644 bootcd.iso
+       rm -f /tmp/CDrec.iso
+       rm -f custom-rd.img.bz2
+
+
+# This will build the old Bacula rescue
 all:   kernel binaries bacula initrd iso
 
+mkcdrec: kernel binaries bacula pre-mkcdrec main-mkcdrec post-mkcdrec
+
 copy-static-fd: kernel binaries static-bacula initrd iso
 
 
 # This needs to be customized for your burner.
+# Use either dev=ATA:x,y,z  (as reported by cdrecord -scanbus)
+#        or dev=/dev/<device> (e.g. hdc)
 burn:
-       cdrecord dev=@CDSTL@ gracetime=2 fs=4096k driveropts=burnfree -v \
+       cdrecord dev=@DEV@ gracetime=2 fs=4096k driveropts=burnfree -v \
         -useinfo speed=48 -dao -eject -pad -data "bootcd.iso"
 
 # Blank the CDROM assuming it is +rw
 blank:
-       cdrecord dev=@CDSTL@ gracetime=2 -v blank=fast -useinfo speed=48
+       cdrecord dev=@DEV@ gracetime=2 -v blank=fast -useinfo speed=48
 
 scan:
        cdrecord -scanbus
@@ -56,13 +116,13 @@ clean:
 #
 # Clean out files that are rebuilt
 #
-       @rm -f bootcd.iso   
+       @rm -f bootcd.iso custom-rd.img.bz2
        @rm -f 1 2 3 4
        @rm -rf mnt
        @rm -rf roottree/bin roottree/proc roottree/boot
        @rm -rf roottree/lib roottree/sbin roottree/dev
        @rm -rf roottree/dev roottree/sys roottree/sysroot
-       @rm -rf roottree/sys              
+       @rm -rf roottree/sys roottree/usr 
        @rm -rf roottree/initrd roottree/cdrom roottree/mnt
        @rm -rf roottree/tmp roottree/var          
        @rm -f roottree/etc/services roottree/etc/exports
@@ -75,9 +135,12 @@ clean:
        @rm -f roottree/etc/modules.conf roottree/etc/syslog.conf
        @rm -rf roottree/etc/pam.d roottree/etc/ssh
        @rm -rf roottree/etc/security roottree/etc/init.d
+       @rm -rf roottree/etc/udev roottree/etc/modprobe.conf
        @rm -rf roottree/bacula-*
        @rm -f cdtree/boot/isolinux/initrd.img
        @rm -f cdtree/boot/isolinux/isolinux.cfg
        @rm -f cdtree/boot/isolinux/vmlinuz
        @rm -f cdtree/boot/isolinux/map
        @(cd bacula; make distclean)
+       @(cd ${MKCDREC}; make clean)
+       @(cd ${MKCDREC}/busybox; make distclean)