]> git.sur5r.net Git - bacula/rescue/commitdiff
Enhance makefiles
authorKern Sibbald <kern@sibbald.com>
Fri, 13 May 2005 21:30:04 +0000 (21:30 +0000)
committerKern Sibbald <kern@sibbald.com>
Fri, 13 May 2005 21:30:04 +0000 (21:30 +0000)
rescue/Makefile.in
rescue/autoconf/configure.in
rescue/configure
rescue/linux/cdrom/Makefile.in
rescue/linux/cdrom/README
rescue/linux/cdrom/makebinaries
rescue/linux/cdrom/makecdimage [new file with mode: 0755]
rescue/linux/cdrom/makeinitrd
rescue/linux/cdrom/makekernel
rescue/linux/cdrom/rootsbin.list
rescue/linux/cdrom/roottree/linuxrc

index 9592dc5799ce08be443dfcc500586b29e48ad6e4..e1bb125b693630883b0e6702a4345be724292672 100755 (executable)
@@ -8,8 +8,8 @@
 srcdir =       @srcdir@
 VPATH =        @srcdir@
 .PATH:         @srcdir@
-topdir = ..
-thisdir = bootstrap
+topdir = .
+thisdir = .
 
 
 first_rule: all
index 94a4619563cad8717f7366b8e7b5b92041e879b1..37fb26f47a8aa9eb5b33c0be6e00d1ee76d00c3e 100644 (file)
@@ -86,11 +86,70 @@ if test ! x$CDRECORD = x ; then
 fi
 AC_SUBST(CDSTL)
 
-
 dnl# --------------------------------------------------------------------------
 dnl# CHECKING COMMAND LINE OPTIONS
 dnl# --------------------------------------------------------------------------
 
+# -------------------------------------------
+# static-fd    (default off)
+# -------------------------------------------
+AC_ARG_ENABLE(static-fd,
+   [  --enable-static-fd      enable static File daemon [disabled]],
+   [if test x$enableval = xyes; then
+     support_static_fd=yes
+   fi])
+
+STATIC_FD=
+if test x$support_static_fd = xyes; then
+   STATIC_FD="static-bacula-fd"
+fi
+AC_SUBST(STATIC_FD)
+
+where=
+# ------------------------------------------
+# Where to get iso
+# ------------------------------------------
+AC_ARG_WITH(iso,
+   [  --with-iso=PATH   specify path to iso],
+   [
+       if test "x$withval" != "xno" ; then     
+          where=$withval
+          type=iso
+       fi
+   ]
+)
+AC_SUBST(iso)
+
+# ------------------------------------------
+# Where to get cdrom
+# ------------------------------------------
+AC_ARG_WITH(cdrom,
+   [  --with-cdrom=PATH    specify path to cdrom],
+   [
+       if test "x$withval" != "xno" ; then     
+         where=$withval
+         type=cdrom
+       fi
+   ]
+)
+
+AC_SUBST(where)
+AC_SUBST(type)
+
+# ------------------------------------------
+# Where to get Bacula source
+# ------------------------------------------
+AC_ARG_WITH(bacula,
+   [  --with-bacula=PATH    specify path to bacula],
+   [
+       if test "x$withval" != "xno" ; then     
+         bacula=$withval
+       fi
+   ]
+)
+
+AC_SUBST(bacula)
+
 
 #
 # Finally we set appropriate distribution specific
@@ -210,7 +269,9 @@ Configuration on `date`:
 
   Host:                      $host -- ${DISTNAME} ${DISTVER}
   Rescue version:            ${VERSION} (${DATE})
-  Source code location:       ${srcdir}
+  Source code location:       ${bacula}
+  Rescue disk image type:     ${type}
+  Rescue disk image location: ${where}
 
 
   " > config.out
index d04299fc15efbab58851b50859e7aa20e05ccdea..f345297ec70af5b6ef8cf2213c36b540dd85ae8d 100755 (executable)
@@ -272,7 +272,7 @@ PACKAGE_STRING=
 PACKAGE_BUGREPORT=
 
 ac_unique_file="version.h"
-ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS BUILD_DIR TRUEPRG FALSEPRG AWK VERSION DATE INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA MV RM CP ECHO AR CDRECORD build build_cpu build_vendor build_os host host_cpu host_vendor host_os HAVE_SUN_OS_TRUE HAVE_SUN_OS_FALSE HAVE_OSF1_OS_TRUE HAVE_OSF1_OS_FALSE HAVE_AIX_OS_TRUE HAVE_AIX_OS_FALSE HAVE_HPUX_OS_TRUE HAVE_HPUX_OS_FALSE HAVE_LINUX_OS_TRUE HAVE_LINUX_OS_FALSE HAVE_FREEBSD_OS_TRUE HAVE_FREEBSD_OS_FALSE HAVE_NETBSD_OS_TRUE HAVE_NETBSD_OS_FALSE HAVE_OPENBSD_OS_TRUE HAVE_OPENBSD_OS_FALSE HAVE_BSDI_OS_TRUE HAVE_BSDI_OS_FALSE HAVE_SGI_OS_TRUE HAVE_SGI_OS_FALSE HAVE_IRIX_OS_TRUE HAVE_IRIX_OS_FALSE HAVE_DARWIN_OS_TRUE HAVE_DARWIN_OS_FALSE CDSTL hostname DISTNAME DISTVER LIBOBJS LTLIBOBJS'
+ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS BUILD_DIR TRUEPRG FALSEPRG AWK VERSION DATE INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA MV RM CP ECHO AR CDRECORD build build_cpu build_vendor build_os host host_cpu host_vendor host_os HAVE_SUN_OS_TRUE HAVE_SUN_OS_FALSE HAVE_OSF1_OS_TRUE HAVE_OSF1_OS_FALSE HAVE_AIX_OS_TRUE HAVE_AIX_OS_FALSE HAVE_HPUX_OS_TRUE HAVE_HPUX_OS_FALSE HAVE_LINUX_OS_TRUE HAVE_LINUX_OS_FALSE HAVE_FREEBSD_OS_TRUE HAVE_FREEBSD_OS_FALSE HAVE_NETBSD_OS_TRUE HAVE_NETBSD_OS_FALSE HAVE_OPENBSD_OS_TRUE HAVE_OPENBSD_OS_FALSE HAVE_BSDI_OS_TRUE HAVE_BSDI_OS_FALSE HAVE_SGI_OS_TRUE HAVE_SGI_OS_FALSE HAVE_IRIX_OS_TRUE HAVE_IRIX_OS_FALSE HAVE_DARWIN_OS_TRUE HAVE_DARWIN_OS_FALSE CDSTL STATIC_FD iso where type bacula hostname DISTNAME DISTVER LIBOBJS LTLIBOBJS'
 ac_subst_files='MCOMMON'
 
 # Initialize some variables set by options.
@@ -784,6 +784,18 @@ if test -n "$ac_init_help"; then
 
   cat <<\_ACEOF
 
+Optional Features:
+  --disable-FEATURE       do not include FEATURE (same as --enable-FEATURE=no)
+  --enable-FEATURE[=ARG]  include FEATURE [ARG=yes]
+  --enable-static-fd      enable static File daemon disabled
+
+Optional Packages:
+  --with-PACKAGE[=ARG]    use PACKAGE [ARG=yes]
+  --without-PACKAGE       do not use PACKAGE (same as --with-PACKAGE=no)
+  --with-iso=PATH       specify path to iso
+  --with-cdrom=PATH    specify path to cdrom
+  --with-bacula=PATH    specify path to bacula
+
 _ACEOF
 fi
 
@@ -2255,6 +2267,76 @@ fi
 
 
 
+# -------------------------------------------
+# static-fd    (default off)
+# -------------------------------------------
+# Check whether --enable-static-fd or --disable-static-fd was given.
+if test "${enable_static_fd+set}" = set; then
+  enableval="$enable_static_fd"
+  if test x$enableval = xyes; then
+     support_static_fd=yes
+   fi
+fi;
+
+STATIC_FD=
+if test x$support_static_fd = xyes; then
+   STATIC_FD="static-bacula-fd"
+fi
+
+
+where=
+# ------------------------------------------
+# Where to get iso
+# ------------------------------------------
+
+# Check whether --with-iso or --without-iso was given.
+if test "${with_iso+set}" = set; then
+  withval="$with_iso"
+
+       if test "x$withval" != "xno" ; then
+          where=$withval
+          type=iso
+       fi
+
+
+fi;
+
+
+# ------------------------------------------
+# Where to get cdrom
+# ------------------------------------------
+
+# Check whether --with-cdrom or --without-cdrom was given.
+if test "${with_cdrom+set}" = set; then
+  withval="$with_cdrom"
+
+       if test "x$withval" != "xno" ; then
+         where=$withval
+         type=cdrom
+       fi
+
+
+fi;
+
+
+
+
+# ------------------------------------------
+# Where to get Bacula source
+# ------------------------------------------
+
+# Check whether --with-bacula or --without-bacula was given.
+if test "${with_bacula+set}" = set; then
+  withval="$with_bacula"
+
+       if test "x$withval" != "xno" ; then
+         bacula=$withval
+       fi
+
+
+fi;
+
+
 
 
 #
@@ -3053,6 +3135,11 @@ s,@HAVE_IRIX_OS_FALSE@,$HAVE_IRIX_OS_FALSE,;t t
 s,@HAVE_DARWIN_OS_TRUE@,$HAVE_DARWIN_OS_TRUE,;t t
 s,@HAVE_DARWIN_OS_FALSE@,$HAVE_DARWIN_OS_FALSE,;t t
 s,@CDSTL@,$CDSTL,;t t
+s,@STATIC_FD@,$STATIC_FD,;t t
+s,@iso@,$iso,;t t
+s,@where@,$where,;t t
+s,@type@,$type,;t t
+s,@bacula@,$bacula,;t t
 s,@hostname@,$hostname,;t t
 s,@DISTNAME@,$DISTNAME,;t t
 s,@DISTVER@,$DISTVER,;t t
@@ -3454,7 +3541,9 @@ Configuration on `date`:
 
   Host:                      $host -- ${DISTNAME} ${DISTVER}
   Rescue version:            ${VERSION} (${DATE})
-  Source code location:       ${srcdir}
+  Source code location:       ${bacula}
+  Rescue disk image type:     ${type}
+  Rescue disk image location: ${where}
 
 
   " > config.out
index 977fce97266d7bad9677ac64339faea030c10d27..8d8729431d71cbc17db783ca0465090e10ef4ae4 100644 (file)
@@ -15,6 +15,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
@@ -34,19 +45,22 @@ static-bacula: dummy
 bacula: dummy
        @(cd bacula; make)
 
-all:   kernel binaries bacula initrd iso
+copy-bacula:
+       cp -a bacula/ cdimage/
+
+all:   cdimage bacula copy-bacula remaster
 
 copy-static-fd: kernel binaries static-bacula initrd iso
 
 
 # This needs to be customized for your burner.
 burn:
-       cdrecord dev=@CDSTL@ gracetime=2 fs=4096k driveropts=burnfree -v \
+       cdrecord dev=ATA:@CDSTL@ 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=ATA:@CDSTL@ gracetime=2 -v blank=fast -useinfo speed=48
 
 scan:
        cdrecord -scanbus
index 473765cbcd3c75dd7a85f7dc92ce3fda5d4f762e..e2023e42ea36608f0c3bf42f14343241355ad2c5 100644 (file)
@@ -179,7 +179,7 @@ Reading an ISO image:
  umount mnt
  rm -rf mnt
 
-Unpacking in initrd.img:
+Unpacking an initrd.img:
  mkdir mnt
  su
  mount -o loop xxx.iso mnt
index ea638c6900d7beb69eea6c49874fb7d9b9965d4a..ed6af5e1b60be4d38248d4be963d4cf36218f5b6 100755 (executable)
@@ -42,7 +42,6 @@ for file in `cat rootsbin.list` ; do
         rm -f $file
     fi
 done
-# Special cases
 cd roottree/sbin
 ln -sf halt reboot
 cd $TOPDIR
diff --git a/rescue/linux/cdrom/makecdimage b/rescue/linux/cdrom/makecdimage
new file mode 100755 (executable)
index 0000000..7e1128d
--- /dev/null
@@ -0,0 +1,110 @@
+#! /bin/sh
+
+# This script makes a copy of an existing boot cd or iso on
+#   disk so that we can add the Bacula code to it for remastering
+#
+# When we are done if there is no error, we should have the
+#   cdrom image in cdimage
+#
+
+export LANG=C
+
+# Print Usage message
+usage () {
+   cat <<END_OF_DATA
+Usage: make_rescue_disk
+  -h, --help             print this message
+  --type=cdrom|iso       start with a cdrom or iso image
+  --where=path           the path to the device (mounted) or the iso
+END_OF_DATA
+}
+
+if [ ! `whoami` = "root" ] ; then
+  echo ""
+  echo "You need to be root to run this, otherwise"
+  echo "I cannot mount the loopback. Continuing anyway ..."
+  echo ""
+fi
+
+
+#
+# Process command line options
+#
+for option in "$@" ; do
+   case "$option" in
+   -h | --help)
+      usage
+      exit 0
+      ;;
+   --type=cdrom)
+      type=cdrom
+      ;;
+   --type=iso)
+      type=iso
+      ;;
+   --where*)
+      where=`echo "$option"|cut -c 9-`
+      ;;
+   *)
+      echo "Unknown option specified: $option"
+      usage
+      exit 1
+      ;;
+   esac
+done
+
+if [ x$type == x ] ; then
+   echo " "
+   echo "You can make the rescue disk either from a mounted CDROM or"
+   echo "from a .iso image. Please enter cdrom or iso:"
+   read type   
+   if [ $type == 'cdrom' ] ; then 
+      echo "OK want mounted CDROM"
+   elif [ $type == 'iso' ] ; then
+      echo "OK want iso image"
+   else
+      echo "Type missing"
+      exit 1
+   fi
+fi
+if [ x$where == x ] ; then
+   echo " "
+   echo "Enter location of image e.g. /mnt/cdrom or /home/src/.../rescue.iso"
+   read where
+fi
+if [ ! -e $where ]; then
+   echo "Cannot find rescue image $where"
+    exit 1
+fi
+if [ $type == iso ]; then
+  rm -rf mnt
+  mkdir mnt
+  mount -o loop $where mnt
+  if [ $? != 0 ] ; then
+    echo "Mount failed."
+    rm -rf mnt
+    exit 1;
+  fi
+  rm -rf cdimage
+  mkdir cdimage
+  cp -a mnt/* cdimage/
+  if [ $? != 0 ] ; then
+    echo "Copy from iso to cdimage failed"
+    unmount mnt
+    rm -rf mnt cdimage
+    exit 1;
+  fi
+  unmount mnt
+  rm -rf mnt
+fi
+if [ $type == cdrom ] ; then
+  rm -rf cdimage
+  mkdir cdimage
+  cp -a $where/* cdimage
+  if [ $? != 0 ] ; then
+    echo "Copy from cdrom to cdimage failed"
+    rm -rf cdimage
+    exit 1;
+  fi
+fi
+#
index e7ca4c5ee4cc25276e6db3e41e3ac872a93d3f92..e5e87dc1bab4f9f7878fba500f466eecc8b8c2fe 100755 (executable)
@@ -29,39 +29,39 @@ echo "Initial RAM disk contents will be $ISIZE KB"
 # delete the existing RAM disk image, if there is one
 rm -f root
 
-dd if=/dev/zero of=$TOPDIR/root bs=1k count=$ISIZE
+dd if=/dev/zero of=$TOPDIR/root bs=1k count=$ISIZE
 
-umount /mnt/loop2  2>/dev/null >/dev/null
-losetup -d /dev/loop2 2>/dev/null >/dev/null
+umount /mnt/loop2  2>/dev/null >/dev/null
+losetup -d /dev/loop2 2>/dev/null >/dev/null
 
-# associate it with /dev/loop2
-losetup /dev/loop2 $TOPDIR/root
+# associate it with /dev/loop2
+losetup /dev/loop2 $TOPDIR/root
 
-# make an ext2 filesystem on it. Set reserve to 0
-mke2fs -q -m 0 /dev/loop2 $ISIZE
-if [ $? != 0 ] ; then
-  echo "Build failed."
-  exit 1
-fi
+# make an ext2 filesystem on it. Set reserve to 0
+mke2fs -q -m 0 /dev/loop2 $ISIZE
+if [ $? != 0 ] ; then
+  echo "Build failed."
+  exit 1
+fi
 
-# we mount it...
-mount /dev/loop2 /mnt/loop2 
+# we mount it...
+mount /dev/loop2 /mnt/loop2 
 
-# ... and delete the lost+found directory 
-rm -rf /mnt/loop2/lost+found 
+# ... and delete the lost+found directory 
+rm -rf /mnt/loop2/lost+found 
 
-# then we copy the contents of our roottree to this filesystem
-cp -dpR roottree/* /mnt/loop2/
-if [ $? != 0 ] ; then
-  echo "RAM disk build failed."
-  exit 1
-fi
+# then we copy the contents of our roottree to this filesystem
+cp -dpR roottree/* /mnt/loop2/
+if [ $? != 0 ] ; then
+  echo "RAM disk build failed."
+  exit 1
+fi
 
-# and unmount and divorce /dev/loop2
-umount /mnt/loop2
-losetup -d /dev/loop2 
+# and unmount and divorce /dev/loop2
+umount /mnt/loop2
+losetup -d /dev/loop2 
 
-(cd roottree; find . | cpio --quiet -c -o) >root
+(cd roottree; find . | cpio --quiet -c -o) >root
 
 echo "Building initial RAM disk done"
 
index f6a5860ef41c9cff240e2737aa0410119660106d..eee2e23bf9fe753579998d3c575b11cd885b20b5 100755 (executable)
@@ -23,6 +23,13 @@ echo "Updating modules in root RAM disk"
 rm -rf roottree/lib/modules
 mkdir -p roottree/lib/modules
 cp -af /lib/modules/$KERNEL/ roottree/lib/modules/
+# clean up just a bit
+rm -rf roottree/lib/modules/build
+rm -rf roottree/lib/modules/kernel/drivers/bluetooth
+rm -rf roottree/lib/modules/kernel/drivers/pcmcia
+rm -rf roottree/lib/modules/kernel/drivers/usb
+rm -rf roottree/lib/modules/kernel/drivers/video
+rm -rf roottree/lib/modules/kernel/drivers/isdn
 
 kernel="/boot/vmlinuz-$KERNEL"
 echo "Coping $kernel to $TOPDIR/cdtree/boot/isolinux/vmlinuz"
index 035649e8a8cf89af5e202eea25861dd83c1f499a..176fe581b780c76bf4a8b5a45dbbe8b37da9d31b 100644 (file)
@@ -48,7 +48,6 @@ roottree/sbin/fsck.jfs
 roottree/sbin/fsck.msdos
 roottree/sbin/fsck.vfat
 roottree/sbin/ftp
-roottree/sbin/gdb
 roottree/sbin/getkey
 roottree/sbin/grep
 roottree/sbin/grub
@@ -110,7 +109,6 @@ roottree/sbin/more
 roottree/sbin/mount
 roottree/sbin/mt
 roottree/sbin/mv
-roottree/sbin/nash
 roottree/sbin/netstat
 roottree/sbin/nice
 roottree/sbin/nm
index 08733be54d382800668baf076cabbde637ff712c..6a5f7c16415bf5a6d4c0f31d4fa0cdf3bd15194c 100755 (executable)
@@ -1,22 +1,39 @@
-#!/bin/sh
+#!/bin/ash
 #
 # First script called by Linux when booting
 #
+echo "============ in linuxrc ============"
+export PATH=/bin:/sbin:/usr/bin:/usr/sbin:/initrd/bin
 
 trap "" 1 2 3 15
 exec >/dev/console </dev/console 2>&1
+
+echo Creating /dev
+mount -o mode=0755 -t tmpfs none /dev
+mknod /dev/console c 5 1
+mknod /dev/null c 1 3
+mknod /dev/zero c 1 5
+mkdir /dev/pts
+mkdir /dev/shm
+
+
 mount -t proc none /proc
+mount -t sysfs /sys /sys >/dev/null 2>&1
+
 
 CMDLINE=`cat /proc/cmdline`
 DEBUG=""
 case "$CMDLINE" in *debug*) DEBUG="yes"; ;; esac
 export DEBUG
 
+echo Starting udev
+echo -n "/sbin/hotplug" > /proc/sys/kernel/hotplug
+udevstart
+
 # Magic incantation for root to remain in ram 
+#ln -s /dev/ram0 /dev/root
 echo 0x0100 > /proc/sys/kernel/real-root-dev
-
 mount -o remount,rw /dev/root /
-
 # sh
-
+echo "================ exit linuxrc ============"
 exit 0