srcdir = @srcdir@
VPATH = @srcdir@
.PATH: @srcdir@
-topdir = ..
-thisdir = bootstrap
+topdir = .
+thisdir = .
first_rule: all
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
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
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.
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
+# -------------------------------------------
+# 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;
+
+
#
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
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
-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
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
umount mnt
rm -rf mnt
-Unpacking in initrd.img:
+Unpacking an initrd.img:
mkdir mnt
su
mount -o loop xxx.iso mnt
rm -f $file
fi
done
-# Special cases
cd roottree/sbin
ln -sf halt reboot
cd $TOPDIR
--- /dev/null
+#! /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
+#
# 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"
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"
roottree/sbin/fsck.msdos
roottree/sbin/fsck.vfat
roottree/sbin/ftp
-roottree/sbin/gdb
roottree/sbin/getkey
roottree/sbin/grep
roottree/sbin/grub
roottree/sbin/mount
roottree/sbin/mt
roottree/sbin/mv
-roottree/sbin/nash
roottree/sbin/netstat
roottree/sbin/nice
roottree/sbin/nm
-#!/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