From 07d518a1eeeaaf9fc11db63c12806c96c1c2c469 Mon Sep 17 00:00:00 2001 From: Kern Sibbald Date: Fri, 2 Jan 2009 10:13:26 +0000 Subject: [PATCH] Start USB rescue --- rescue/autoconf/Make.common.in | 1 + rescue/autoconf/configure.in | 6 +- rescue/configure | 168 ++++++++++-------- .../cdrom/cdtree/boot/isolinux/isolinux.bin | Bin 9856 -> 9856 bytes rescue/linux/usb/Makefile | 159 +++++++++++++++++ rescue/linux/usb/Makefile.in | 159 +++++++++++++++++ rescue/linux/usb/mountiso | 12 ++ rescue/linux/usb/packinitrd | 12 ++ rescue/linux/usb/unmountiso | 7 + rescue/linux/usb/unpackinitrd | 7 + rescue/linux/usb/unpacksqfs | 22 +++ rescue/version.h | 6 +- 12 files changed, 484 insertions(+), 75 deletions(-) create mode 100644 rescue/linux/usb/Makefile create mode 100644 rescue/linux/usb/Makefile.in create mode 100755 rescue/linux/usb/mountiso create mode 100755 rescue/linux/usb/packinitrd create mode 100755 rescue/linux/usb/unmountiso create mode 100755 rescue/linux/usb/unpackinitrd create mode 100755 rescue/linux/usb/unpacksqfs diff --git a/rescue/autoconf/Make.common.in b/rescue/autoconf/Make.common.in index dfd552b..0844518 100644 --- a/rescue/autoconf/Make.common.in +++ b/rescue/autoconf/Make.common.in @@ -15,6 +15,7 @@ prefix = @prefix@ exec_prefix = @exec_prefix@ binprefix = manprefix = +datarootdir = sbindir = @sbindir@ sysconfdir = @sysconfdir@ scriptdir = @scriptdir@ diff --git a/rescue/autoconf/configure.in b/rescue/autoconf/configure.in index 43ac020..400b282 100644 --- a/rescue/autoconf/configure.in +++ b/rescue/autoconf/configure.in @@ -112,7 +112,7 @@ where= # Where to get iso # ------------------------------------------ AC_ARG_WITH(iso, - [ --with-iso=PATH specify path to iso (not implemented)], + [ --with-iso=PATH specify path to iso image], [ if test "x$withval" != "xno" ; then where=$withval @@ -120,7 +120,8 @@ AC_ARG_WITH(iso, fi ] ) -AC_SUBST(iso) +AC_SUBST(where) +AC_SUBST(type) # ------------------------------------------ # Where to get cdrom @@ -317,6 +318,7 @@ AC_OUTPUT([ \ autoconf/Make.common \ Makefile \ linux/Makefile \ + linux/usb/Makefile \ linux/cdrom/Makefile \ linux/cdrom/bacula/Makefile \ linux/cdrom/cdtree/boot/isolinux/boot.msg \ diff --git a/rescue/configure b/rescue/configure index bc32375..2bcb392 100755 --- a/rescue/configure +++ b/rescue/configure @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.60. +# Generated by GNU Autoconf 2.61. # # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, # 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. @@ -10,7 +10,8 @@ ## M4sh Initialization. ## ## --------------------- ## -# Be Bourne compatible +# Be more Bourne compatible +DUALCASE=1; export DUALCASE # for MKS sh if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: @@ -19,10 +20,13 @@ if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else - case `(set -o) 2>/dev/null` in *posix*) set -o posix;; esac + case `(set -o) 2>/dev/null` in + *posix*) set -o posix ;; +esac + fi -BIN_SH=xpg4; export BIN_SH # for Tru64 -DUALCASE=1; export DUALCASE # for MKS sh + + # PATH needs CR @@ -215,7 +219,7 @@ test \$exitcode = 0) || { (exit 1); exit 1; } else as_candidate_shells= as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in /usr/bin/posix$PATH_SEPARATOR/bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH +for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. @@ -233,7 +237,6 @@ IFS=$as_save_IFS # Try only shells that exist, to save several forks. if { test -f "$as_shell" || test -f "$as_shell.exe"; } && { ("$as_shell") 2> /dev/null <<\_ASEOF -# Be Bourne compatible if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: @@ -242,10 +245,12 @@ if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else - case `(set -o) 2>/dev/null` in *posix*) set -o posix;; esac + case `(set -o) 2>/dev/null` in + *posix*) set -o posix ;; +esac + fi -BIN_SH=xpg4; export BIN_SH # for Tru64 -DUALCASE=1; export DUALCASE # for MKS sh + : _ASEOF @@ -253,7 +258,6 @@ _ASEOF CONFIG_SHELL=$as_shell as_have_required=yes if { "$as_shell" 2> /dev/null <<\_ASEOF -# Be Bourne compatible if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: @@ -262,10 +266,12 @@ if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else - case `(set -o) 2>/dev/null` in *posix*) set -o posix;; esac + case `(set -o) 2>/dev/null` in + *posix*) set -o posix ;; +esac + fi -BIN_SH=xpg4; export BIN_SH # for Tru64 -DUALCASE=1; export DUALCASE # for MKS sh + : (as_func_return () { @@ -512,19 +518,28 @@ else as_mkdir_p=false fi -# Find out whether ``test -x'' works. Don't use a zero-byte file, as -# systems may use methods other than mode bits to determine executability. -cat >conf$$.file <<_ASEOF -#! /bin/sh -exit 0 -_ASEOF -chmod +x conf$$.file -if test -x conf$$.file >/dev/null 2>&1; then - as_executable_p="test -x" +if test -x / >/dev/null 2>&1; then + as_test_x='test -x' else - as_executable_p=: + if ls -dL / >/dev/null 2>&1; then + as_ls_L_option=L + else + as_ls_L_option= + fi + as_test_x=' + eval sh -c '\'' + if test -d "$1"; then + test -d "$1/."; + else + case $1 in + -*)set "./$1";; + esac; + case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in + ???[sx]*):;;*)false;;esac;fi + '\'' sh + ' fi -rm -f conf$$.file +as_executable_p=$as_test_x # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" @@ -647,7 +662,6 @@ HAVE_IRIX_OS_FALSE HAVE_DARWIN_OS_TRUE HAVE_DARWIN_OS_FALSE DEV -iso where type KERNEL @@ -769,10 +783,10 @@ do -disable-* | --disable-*) ac_feature=`expr "x$ac_option" : 'x-*disable-\(.*\)'` # Reject names that are not valid shell variable names. - expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null && + expr "x$ac_feature" : ".*[^-._$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid feature name: $ac_feature" >&2 { (exit 1); exit 1; }; } - ac_feature=`echo $ac_feature | sed 's/-/_/g'` + ac_feature=`echo $ac_feature | sed 's/[-.]/_/g'` eval enable_$ac_feature=no ;; -docdir | --docdir | --docdi | --doc | --do) @@ -788,10 +802,10 @@ do -enable-* | --enable-*) ac_feature=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` # Reject names that are not valid shell variable names. - expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null && + expr "x$ac_feature" : ".*[^-._$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid feature name: $ac_feature" >&2 { (exit 1); exit 1; }; } - ac_feature=`echo $ac_feature | sed 's/-/_/g'` + ac_feature=`echo $ac_feature | sed 's/[-.]/_/g'` eval enable_$ac_feature=\$ac_optarg ;; -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ @@ -985,19 +999,19 @@ do -with-* | --with-*) ac_package=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` # Reject names that are not valid shell variable names. - expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null && + expr "x$ac_package" : ".*[^-._$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid package name: $ac_package" >&2 { (exit 1); exit 1; }; } - ac_package=`echo $ac_package| sed 's/-/_/g'` + ac_package=`echo $ac_package | sed 's/[-.]/_/g'` eval with_$ac_package=\$ac_optarg ;; -without-* | --without-*) ac_package=`expr "x$ac_option" : 'x-*without-\(.*\)'` # Reject names that are not valid shell variable names. - expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null && + expr "x$ac_package" : ".*[^-._$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid package name: $ac_package" >&2 { (exit 1); exit 1; }; } - ac_package=`echo $ac_package | sed 's/-/_/g'` + ac_package=`echo $ac_package | sed 's/[-.]/_/g'` eval with_$ac_package=no ;; --x) @@ -1237,7 +1251,7 @@ Optional Packages: --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) --with-dev=DEVICE specify device (e.g. /dev/hdc) - --with-iso=PATH specify path to iso (not implemented) + --with-iso=PATH specify path to iso image --with-cdrom=PATH specify path to cdrom --with-kernel=version specify complete kernel version (e.g. 2.6.14-2) --with-bacula=PATH specify path to Bacula source @@ -1306,7 +1320,7 @@ test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF configure -generated by GNU Autoconf 2.60 +generated by GNU Autoconf 2.61 Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. @@ -1320,7 +1334,7 @@ This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. It was created by $as_me, which was -generated by GNU Autoconf 2.60. Invocation command line was +generated by GNU Autoconf 2.61. Invocation command line was $ $0 $@ @@ -1724,7 +1738,7 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_TRUEPRG="$as_dir/$ac_word$ac_exec_ext" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -1770,7 +1784,7 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_FALSEPRG="$as_dir/$ac_word$ac_exec_ext" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -1815,7 +1829,7 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_AWK="$ac_prog" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -1874,7 +1888,7 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_AWK="$as_dir/$ac_word$ac_exec_ext" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -1940,7 +1954,7 @@ case $as_dir/ in # by default. for ac_prog in ginstall scoinst install; do for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_executable_p "$as_dir/$ac_prog$ac_exec_ext"; }; then + if { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$ac_prog$ac_exec_ext"; }; then if test $ac_prog = install && grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then # AIX install. It has an incompatible calling convention. @@ -2002,7 +2016,7 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_MV="$as_dir/$ac_word$ac_exec_ext" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -2043,7 +2057,7 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_RM="$as_dir/$ac_word$ac_exec_ext" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -2084,7 +2098,7 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_CP="$as_dir/$ac_word$ac_exec_ext" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -2125,7 +2139,7 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_ECHO="$as_dir/$ac_word$ac_exec_ext" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -2166,7 +2180,7 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_AR="$as_dir/$ac_word$ac_exec_ext" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -2207,7 +2221,7 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_CDRECORD="$as_dir/$ac_word$ac_exec_ext" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -2785,6 +2799,7 @@ fi + # ------------------------------------------ # Where to get cdrom # ------------------------------------------ @@ -2995,7 +3010,7 @@ MCOMMON=./autoconf/Make.common -ac_config_files="$ac_config_files autoconf/Make.common Makefile linux/Makefile linux/cdrom/Makefile linux/cdrom/bacula/Makefile linux/cdrom/cdtree/boot/isolinux/boot.msg knoppix/cdrom/Makefile knoppix/cdrom/bacula/Makefile freebsd/Makefile solaris/Makefile $PFILES" +ac_config_files="$ac_config_files autoconf/Make.common Makefile linux/Makefile linux/usb/Makefile linux/cdrom/Makefile linux/cdrom/bacula/Makefile linux/cdrom/cdtree/boot/isolinux/boot.msg knoppix/cdrom/Makefile knoppix/cdrom/bacula/Makefile freebsd/Makefile solaris/Makefile $PFILES" ac_config_commands="$ac_config_commands default" @@ -3149,7 +3164,8 @@ cat >>$CONFIG_STATUS <<\_ACEOF ## M4sh Initialization. ## ## --------------------- ## -# Be Bourne compatible +# Be more Bourne compatible +DUALCASE=1; export DUALCASE # for MKS sh if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: @@ -3158,10 +3174,13 @@ if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else - case `(set -o) 2>/dev/null` in *posix*) set -o posix;; esac + case `(set -o) 2>/dev/null` in + *posix*) set -o posix ;; +esac + fi -BIN_SH=xpg4; export BIN_SH # for Tru64 -DUALCASE=1; export DUALCASE # for MKS sh + + # PATH needs CR @@ -3385,19 +3404,28 @@ else as_mkdir_p=false fi -# Find out whether ``test -x'' works. Don't use a zero-byte file, as -# systems may use methods other than mode bits to determine executability. -cat >conf$$.file <<_ASEOF -#! /bin/sh -exit 0 -_ASEOF -chmod +x conf$$.file -if test -x conf$$.file >/dev/null 2>&1; then - as_executable_p="test -x" +if test -x / >/dev/null 2>&1; then + as_test_x='test -x' else - as_executable_p=: + if ls -dL / >/dev/null 2>&1; then + as_ls_L_option=L + else + as_ls_L_option= + fi + as_test_x=' + eval sh -c '\'' + if test -d "$1"; then + test -d "$1/."; + else + case $1 in + -*)set "./$1";; + esac; + case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in + ???[sx]*):;;*)false;;esac;fi + '\'' sh + ' fi -rm -f conf$$.file +as_executable_p=$as_test_x # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" @@ -3413,7 +3441,7 @@ exec 6>&1 # values after options handling. ac_log=" This file was extended by $as_me, which was -generated by GNU Autoconf 2.60. Invocation command line was +generated by GNU Autoconf 2.61. Invocation command line was CONFIG_FILES = $CONFIG_FILES CONFIG_HEADERS = $CONFIG_HEADERS @@ -3441,7 +3469,7 @@ current configuration. Usage: $0 [OPTIONS] [FILE]... -h, --help print this help, then exit - -V, --version print version number, then exit + -V, --version print version number and configuration settings, then exit -q, --quiet do not print progress messages -d, --debug don't remove temporary files --recheck update $as_me by reconfiguring in the same conditions @@ -3460,7 +3488,7 @@ _ACEOF cat >>$CONFIG_STATUS <<_ACEOF ac_cs_version="\\ config.status -configured by $0, generated by GNU Autoconf 2.60, +configured by $0, generated by GNU Autoconf 2.61, with options \\"`echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\" Copyright (C) 2006 Free Software Foundation, Inc. @@ -3561,6 +3589,7 @@ do "autoconf/Make.common") CONFIG_FILES="$CONFIG_FILES autoconf/Make.common" ;; "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; "linux/Makefile") CONFIG_FILES="$CONFIG_FILES linux/Makefile" ;; + "linux/usb/Makefile") CONFIG_FILES="$CONFIG_FILES linux/usb/Makefile" ;; "linux/cdrom/Makefile") CONFIG_FILES="$CONFIG_FILES linux/cdrom/Makefile" ;; "linux/cdrom/bacula/Makefile") CONFIG_FILES="$CONFIG_FILES linux/cdrom/bacula/Makefile" ;; "linux/cdrom/cdtree/boot/isolinux/boot.msg") CONFIG_FILES="$CONFIG_FILES linux/cdrom/cdtree/boot/isolinux/boot.msg" ;; @@ -3721,7 +3750,6 @@ HAVE_IRIX_OS_FALSE!$HAVE_IRIX_OS_FALSE$ac_delim HAVE_DARWIN_OS_TRUE!$HAVE_DARWIN_OS_TRUE$ac_delim HAVE_DARWIN_OS_FALSE!$HAVE_DARWIN_OS_FALSE$ac_delim DEV!$DEV$ac_delim -iso!$iso$ac_delim where!$where$ac_delim type!$type$ac_delim KERNEL!$KERNEL$ac_delim @@ -3730,6 +3758,7 @@ STATIC_FD!$STATIC_FD$ac_delim BACULA_BIN!$BACULA_BIN$ac_delim BACULA_SCRIPTS!$BACULA_SCRIPTS$ac_delim hostname!$hostname$ac_delim +DISTNAME!$DISTNAME$ac_delim _ACEOF if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 94; then @@ -3775,13 +3804,12 @@ _ACEOF ac_delim='%!_!# ' for ac_last_try in false false false false false :; do cat >conf$$subs.sed <<_ACEOF -DISTNAME!$DISTNAME$ac_delim DISTVER!$DISTVER$ac_delim LIBOBJS!$LIBOBJS$ac_delim LTLIBOBJS!$LTLIBOBJS$ac_delim _ACEOF - if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 4; then + if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 3; then break elif $ac_last_try; then { { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5 diff --git a/rescue/linux/cdrom/cdtree/boot/isolinux/isolinux.bin b/rescue/linux/cdrom/cdtree/boot/isolinux/isolinux.bin index bf4867004414dcbc362cdf8e6bc2af8fb31ddaa3..ee3f4564b89819b8f6b747dfdd6078dc9314828d 100644 GIT binary patch delta 22 dcmZqhZSdv&^~#}!fnmY~0R{$!(2cysY5-lz2P6Oh delta 22 dcmZqhZSdv&^~#}!fnmY~0R{$!(v7^uY5-np2Sfk> diff --git a/rescue/linux/usb/Makefile b/rescue/linux/usb/Makefile new file mode 100644 index 0000000..deb928d --- /dev/null +++ b/rescue/linux/usb/Makefile @@ -0,0 +1,159 @@ +# +# Makefile for building a Bacula Rescue USB remastered Ubuntu LiveCD +# + +.PATH: . + +CWD=/home/kern/bacula/rescue/linux/usb + +ISOIMAGE=/home/src/kubuntu/kubuntu-8.04.1-desktop-i386.iso + +first_rule: all +dummy: + +#------------------------------------------------------------------------- + +# Make an iso boot image +iso: + rm -f bootcd.iso + mkisofs -A "Bacula Rescue Disk" -V "Bacula Rescue Disk" \ + -J -R -T -o bootcd.iso \ + -b boot/isolinux/isolinux.bin -c boot/isolinux/boot.cat \ + -no-emul-boot -boot-load-size 4 -boot-info-table cdtree + +mountiso: + ./mountiso $ISOIMAGE + +unmountiso: + ./unmountiso + +mountsquashfs: + ./mountsqfs + +unpacksquashfs: + ./unpacksqfs + +unpackinitrd: + ./unpackinitrd + + +# try booting it with qemu emulator +boot: + qemu -cdrom bootcd.iso + +packinitrd: + ./packinitrd + +binaries: + ./makebinaries + +static-bacula: dummy + @(cd bacula; make copy-static-fd) + +bacula: dummy + @(cd bacula; make) + +copy-bacula: + cp -a bacula/ cdimage/ + + + +# This will build the Bacula rescue +all: + + +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/ (e.g. hdc) +burn: + cdrecord dev=ATA:3,0,0 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=ATA:3,0,0 gracetime=2 -v blank=fast -useinfo speed=48 + +scan: + cdrecord -scanbus + +distclean: +clean: +# +# Clean out files that are rebuilt +# + @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 roottree/usr + @rm -rf roottree/initrd roottree/cdrom roottree/mnt + @rm -rf roottree/tmp roottree/var + @rm -f roottree/etc/services roottree/etc/exports + @rm -f roottree/etc/gshadow roottree/etc/shadow + @rm -f roottree/etc/passwd roottree/etc/group + @rm -f roottree/etc/hosts roottree/etc/bashrc + @rm -f roottree/etc/filesystems roottree/etc/fstab + @rm -f roottree/etc/protocols roottree/etc/localtime + @rm -f roottree/etc/ld.so.cache + @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/rc.d + @rm -rf roottree/etc/udev roottree/etc/modprobe.conf + @rm -rf roottree/etc/dev.d roottre/etc/hotplug roottree/etc/modprobe.d + @rm -rf roottree/etc/modprobe.conf.local roottree/etc/hotplug + @rm -rf roottree/etc/sysconfig roottree/etc/syslog-ng + @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) + + +# +# This was the integration with mkcdrec, but I could never +# get it to work reliably. +# +MKCDREC=/home/kern/bacula/rescue/mkcdrec +mkcdrec: kernel binaries bacula pre-mkcdrec main-mkcdrec post-mkcdrec +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-fd bacula/bin + @cp -f /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 diff --git a/rescue/linux/usb/Makefile.in b/rescue/linux/usb/Makefile.in new file mode 100644 index 0000000..0e19152 --- /dev/null +++ b/rescue/linux/usb/Makefile.in @@ -0,0 +1,159 @@ +# +# Makefile for building a Bacula Rescue USB remastered Ubuntu LiveCD +# + +.PATH: . + +CWD=@BUILD_DIR@/linux/usb + +ISOIMAGE=@where@ + +first_rule: all +dummy: + +#------------------------------------------------------------------------- + +# Make an iso boot image +iso: + rm -f bootcd.iso + mkisofs -A "Bacula Rescue Disk" -V "Bacula Rescue Disk" \ + -J -R -T -o bootcd.iso \ + -b boot/isolinux/isolinux.bin -c boot/isolinux/boot.cat \ + -no-emul-boot -boot-load-size 4 -boot-info-table cdtree + +mountiso: + ./mountiso $ISOIMAGE + +unmountiso: + ./unmountiso + +mountsquashfs: + ./mountsqfs + +unpacksquashfs: + ./unpacksqfs + +unpackinitrd: + ./unpackinitrd + + +# try booting it with qemu emulator +boot: + qemu -cdrom bootcd.iso + +packinitrd: + ./packinitrd + +binaries: + ./makebinaries + +static-bacula: dummy + @(cd bacula; make copy-static-fd) + +bacula: dummy + @(cd bacula; make) + +copy-bacula: + cp -a bacula/ cdimage/ + + + +# This will build the Bacula rescue +all: + + +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/ (e.g. hdc) +burn: + 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=@DEV@ gracetime=2 -v blank=fast -useinfo speed=48 + +scan: + cdrecord -scanbus + +distclean: +clean: +# +# Clean out files that are rebuilt +# + @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 roottree/usr + @rm -rf roottree/initrd roottree/cdrom roottree/mnt + @rm -rf roottree/tmp roottree/var + @rm -f roottree/etc/services roottree/etc/exports + @rm -f roottree/etc/gshadow roottree/etc/shadow + @rm -f roottree/etc/passwd roottree/etc/group + @rm -f roottree/etc/hosts roottree/etc/bashrc + @rm -f roottree/etc/filesystems roottree/etc/fstab + @rm -f roottree/etc/protocols roottree/etc/localtime + @rm -f roottree/etc/ld.so.cache + @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/rc.d + @rm -rf roottree/etc/udev roottree/etc/modprobe.conf + @rm -rf roottree/etc/dev.d roottre/etc/hotplug roottree/etc/modprobe.d + @rm -rf roottree/etc/modprobe.conf.local roottree/etc/hotplug + @rm -rf roottree/etc/sysconfig roottree/etc/syslog-ng + @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) + + +# +# This was the integration with mkcdrec, but I could never +# get it to work reliably. +# +MKCDREC=@BUILD_DIR@/mkcdrec +mkcdrec: kernel binaries bacula pre-mkcdrec main-mkcdrec post-mkcdrec +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 diff --git a/rescue/linux/usb/mountiso b/rescue/linux/usb/mountiso new file mode 100755 index 0000000..e886530 --- /dev/null +++ b/rescue/linux/usb/mountiso @@ -0,0 +1,12 @@ +#!/bin/sh +# + +if [ "x$1" != "x" ] ; then +ISOIMAGE=$1 +elif [ "x$ISOIMAGE" = "x" ] ; then + echo "Please specify the ISO on the command line or set the enviornment variable ISOIMAGE to point to your ISO" + exit 1 +fi + +mkdir -p cdrom +mount -o loop -t iso9660 $ISOIMAGE cdrom diff --git a/rescue/linux/usb/packinitrd b/rescue/linux/usb/packinitrd new file mode 100755 index 0000000..f3a1e67 --- /dev/null +++ b/rescue/linux/usb/packinitrd @@ -0,0 +1,12 @@ +#!/bin/sh +# +cd initrd +echo "Packing initrd to initrd.gz ..." +find . | cpio -o -H newc | gzip -9 > ../initrd.gz +if [ "x$SUID_UID" != "x" ] ; then + if [ "x$SUID_GID" = "x" ] ; then + chown $SUID_UID ../initrd.gz + else + chown $SUID_UID:$SUID_GID ../initrd.gz + fi +fi diff --git a/rescue/linux/usb/unmountiso b/rescue/linux/usb/unmountiso new file mode 100755 index 0000000..18686f7 --- /dev/null +++ b/rescue/linux/usb/unmountiso @@ -0,0 +1,7 @@ +#!/bin/sh +# + +umount cdrom +if [ $? -eq 0 ] ; then + rmdir cdrom +fi diff --git a/rescue/linux/usb/unpackinitrd b/rescue/linux/usb/unpackinitrd new file mode 100755 index 0000000..4874fa3 --- /dev/null +++ b/rescue/linux/usb/unpackinitrd @@ -0,0 +1,7 @@ +#!/bin/sh +# +rm -rf initrd +mkdir -p initrd +cd initrd +echo "Unpacking initrd.gz into initrd ..." +gzip -dc ../cdrom/casper/initrd.gz | cpio -i diff --git a/rescue/linux/usb/unpacksqfs b/rescue/linux/usb/unpacksqfs new file mode 100755 index 0000000..458f7f7 --- /dev/null +++ b/rescue/linux/usb/unpacksqfs @@ -0,0 +1,22 @@ +#!/bin/sh +# +mkdir -p sqfs +mkdir cdsqfs +mount -o loop -t squashfs cdrom/casper/filesystem.squashfs cdsqfs +if [ $? -ne 0 ] ; then + echo "Error mounting squashfs ..." + rm -rf cdsqfs + exit 1 +fi +echo "Copying ISO squashfs to sqfs ..." +rsync -avx -P cdsqfs/. sqfs/. +# +umount cdsqfs/ +if [ $? -ne 0 ] ; then + umount cdsqfs/ + if [ $? -ne 0 ] ; then + echo "Could not umount cdsqfs ..." + exit 1 + fi +fi +rmdir cdsqfs diff --git a/rescue/version.h b/rescue/version.h index 4b1cc80..a88b624 100644 --- a/rescue/version.h +++ b/rescue/version.h @@ -1,5 +1,5 @@ /* */ #undef VERSION -#define VERSION "2.2.7" -#define BDATE "24 December 2007" -#define LSMDATE "24Dec07" +#define VERSION "2.4.4" +#define BDATE "2 January 2009" +#define LSMDATE "02Jan09" -- 2.39.5