Changeset 541 in MondoRescue for branches/stable/mindi
- Timestamp:
- May 13, 2006, 8:47:23 PM (19 years ago)
- Location:
- branches/stable/mindi
- Files:
-
- 5 deleted
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/stable/mindi/deplist.txt
r454 r541 1 # Mindi-Linux's dependency list 1 # Mindi-Linux's dependency list 07/10/2004 2 2 # 3 3 # NB: … … 5 5 # 2. If you put 'libncurses' (w/o quotation marks) on an uncommented line then 6 6 # Mindi will find /lib/libncurses* and include all matching files. 7 # 3. You have to give an absolute path 7 # 3. You may give an absolute path if you think Mindi will have trouble finding 8 # the file on its own. 8 9 # 4. If you want to add something, just add it on its own line. K.I.S.S. 9 10 # 5. You must _not_ put a semicolon & comment after an entry. e.g. 'foo; #bar'. 10 # 6. you can add also entries in a file inside the deplist.d subdirectory11 # 6. All these worlds are yours except Europa. Attempt no landing there. 11 12 12 #----- Kept for compatibility ----- 13 mkswapfs mkfs.swap mkfs.dos mkvfatfs mkfatfs mkfs.reiser mke3fs mkxfs mkjfs mkxfsfs mkjfsfs logdump logredo xchkdmp xchklog xpeek e2fsadm fsck.reiser 13 #------------------------- STUFF ADDED BY THE USER ---------------------------- 14 #---vvvv vvvv vvvv list your stuff here! vvvv vvvv vvvv 15 # 16 # bar 17 # foo 18 # 19 #---^^^^ ^^^^ ^^^^ list your stuff here! ^^^^ ^^^^ ^^^^ 20 #------------------------------------------------------------------------------ 21 22 #----- Covers a multitude of sins, including XFS, JFS, ReiserFS, and RAID ----- 23 mkfs mkswap mkswapfs mkfs.swap mkfs.ext2 mke2fs mkfs.vfat mkfs.dos mkdosfs mkvfatfs mkfatfs mkreiserfs mkfs.reiserfs mkfs.reiser mkfs.ext3 mke3fs mkfs.jfs mkfs.xfs mkxfs mkjfs mkxfsfs mkjfsfs logdump logredo xchkdmp xchklog xpeek mkpv mkraid raid0run raidhotadd raidhotremove raidsetfaulty raidstart raidstop e2label tune2fs e2fsadm mdadm 24 fsck fsck.ext2 fsck.reiserfs fsck.reiser fsck.xfs fsck.ext3 fsck.jfs badblocks 14 25 15 26 #-------------------------------- ESSENTIAL ----------------------------------- 16 conf.modules modules.conf.local ms-sys 17 less.bin less.dummy less.dupe less.hot.weather.in.texas.please 18 burnBX burnK6 burnK7 burnMMX burnP5 burnP6 lucifer tiobench tiotest bonnie++ mprime ide-smart 27 fstab raidtab modules.conf conf.modules mondorestore mt modules.conf.local 28 afio star ntfsclone parted ms-sys file getfattr setfattr getfacl setfacl 29 buffer 30 awk gawk 31 bzip2 bunzip2 lzop 32 date ctrlaltdel 33 dd 34 eject 35 grep ld-linux.so.2 ld-2.3.4.so 36 hosts host.conf resolv.conf hosts.allow hosts.deny 37 wc 38 xargs 39 gzip gunzip 40 klogd sysklogd 41 fdisk hdparm parted arch 42 less less.bin less.dummy less.dupe less.hot.weather.in.texas.please 43 loadkeys 44 mount 45 ping devfsd burnBX burnK6 burnK7 burnMMX burnP5 burnP6 lucifer tiobench tiotest bonnie++ mprime ide-smart 19 46 20 insmod.static insmod.static.old 47 # ------------------------------- for X (Hugo) -------------------------------- 48 #tar 49 #ldd lddlibc4 50 #libXmu 51 #libz 52 #X 53 #startx 54 #xinitrc 55 #xinit 56 #/etc/X11/XF86Config 57 #xauth 58 #libXext 59 # --- end of X stuff --- 60 61 insmod insmod.static insmod.static.old lsmod 62 63 #-------------------------- For mounting NFS volumes -------------------------- 64 ifconfig route /sbin/start-nfs 65 #ifconfig host.conf resolv.conf ping ip portmap rpc.statd 66 #rpc.lockd rpc.statd nfsstat rpc.nfsd rpc.mountd rpc.exportfs exportfs hosts exports hosts.allow hosts.deny showmount /etc/sysconfig/network /etc/sysconfig/network-scripts service usernetctl services protocols inetd inetd.conf /etc/rc.d ifup ifdown 67 68 21 69 22 70 #------------------------ Added for Stuart D. Gathman ------------------------- 23 71 #lc l lf netstat inetd tcpd in.telnetd route ldconfig ldd telnet rsh rcp services protocols rpc inetd.conf nsswitch.conf localtime security libresolv libutil libcrypt lbnss_compat libnss_files libnss_dns libpwdb libncurses 24 72 73 74 75 #------------------------- Part of the Cuckoo Project ------------------------- 76 #mkisofs 77 #cdrecord 78 #losetup 79 #fdformat 80 #lilo grub 81 #/usr/local/share/mondo 82 #mondoarchive 83 #mindi 84 #/usr/local/share/mindi 85 25 86 #----------------- For all you LVM users out there, much love ----------------- 26 87 LVMFILES: 27 lvmiopversion lvmcreate_initrd pvdata88 lvmiopversion lvchange lvcreate lvdisplay lvextend lvmchange lvmcreate_initrd lvmdiskscan lvmsadc lvmsar lvreduce lvremove lvrename lvscan pvchange pvcreate pvdata pvdisplay pvmove pvscan vgcfgbackup vgcfgrestore vgchange vgck vgcreate vgdisplay vgexport vgextend vgimport vgmerge vgmknodes vgreduce vgremove vgrename vgscan vgsplit liblvm lvm lvm-10 /etc/lvm/lvm.conf 28 89 #------------------------------------------------------------------------------ -
branches/stable/mindi/distributions/gentoo/mindi.ebuild
r530 r541 1 1 # Copyright 1999-2005 Gentoo Foundation 2 2 # Distributed under the terms of the GNU General Public License v2 3 # $ Id$3 # $Header: /var/cvsroot/gentoo-x86/sys-apps/mindi/mindi-1.04.ebuild,v 1.1 2005/01/22 10:29:25 wschlich Exp $ 4 4 5 5 DESCRIPTION="A program that creates emergency boot disks/CDs using your kernel, tools and modules." 6 6 HOMEPAGE="http://www.mondorescue.org" 7 SRC_URI="ftp://ftp. mondorescue.org/src/${P}.tgz"7 SRC_URI="ftp://ftp.berlios.de/pub/mondorescue/src/${P}.tgz" 8 8 9 9 LICENSE="GPL-2" … … 15 15 RDEPEND=">=app-arch/bzip2-0.9 16 16 >=sys-apps/mindi-kernel-1.0-r1 17 app-cdr/cdrtools 17 18 sys-libs/ncurses 18 19 sys-devel/binutils … … 22 23 src_unpack() { 23 24 unpack ${A} || die "Failed to unpack ${A}" 25 cd ${S}/rootfs || die 26 tar xzf symlinks.tgz || die "Failed to unpack symlinks.tgz" 27 28 # This will need to change when IA64 is tested. Obviously. 29 rm -f bin/busybox-ia64 sbin/parted2fdisk-ia64 30 mv bin/busybox-i386 bin/busybox 24 31 } 25 32 26 33 src_install() { 27 export PREFIX="/usr"28 export CONFDIR="/etc"29 export RPMBUILDMINDI="true"30 34 ./install.sh 31 35 } -
branches/stable/mindi/distributions/redhat/spec.m4
r494 r541 2 2 dnl 3 3 dnl SSS is replaced by the source package format 4 define(`SSS', ftp://ftp.mondorescue.org/src/%{name}-%{version}.tgz)dnl4 define(`SSS', %{name}-%{version}.tgz)dnl 5 5 dnl DDD is replaced by the list of dependencies specific to that distro 6 6 define(`DDD', %{addreqb}, which, grep >= 2.5)dnl 7 7 dnl GRP is replaced by the RPM group of apps 8 define(`GRP', A pplications/Archiving)dnl8 define(`GRP', Archiving/Archiving)dnl -
branches/stable/mindi/distributions/rpm/mindi.spec
r494 r541 17 17 License: GPL 18 18 Group: %{grp} 19 Url: http:// www.mondorescue.org19 Url: http://mondorescue.berlios.de 20 20 Source: %{src} 21 BuildRoot: %{_tmppath}/%{name}-%{version} -%{release}-root-%(id -u -n)21 BuildRoot: %{_tmppath}/%{name}-%{version} 22 22 Requires: %{addreq} 23 Epoch: %(echo EEE | cut -d- -f1 | sed "s~M~~")24 23 # Not on all systems 25 24 #Conflicts: bonnie++ … … 32 31 33 32 %prep 33 %{__rm} -rf $RPM_BUILD_ROOT 34 34 %setup -n %name-%{version} 35 35 … … 41 41 42 42 %install 43 %{__rm} -rf $RPM_BUILD_ROOT44 43 export DONT_RELINK=1 45 44 45 %{__rm} -rf $RPM_BUILD_ROOT 46 46 export PREFIX=${RPM_BUILD_ROOT}%{_exec_prefix} 47 47 export CONFDIR=${RPM_BUILD_ROOT}%{_sysconfdir} … … 60 60 %files 61 61 %defattr(644,root,root,755) 62 %config(noreplace) %{_sysconfdir}/mindi 63 %config(noreplace) %{_sysconfdir}/mindi/deplist.txt 64 %config(noreplace) %{_sysconfdir}/mindi/deplist.d/* 65 %config(noreplace) %{_sysconfdir}/mindi/mindi.conf 62 %config(noreplace) %{_sysconfdir}/mindi/deplist.txt 66 63 %doc ChangeLog INSTALL COPYING README TODO README.ia64 README.pxe README.busybox svn.log 67 64 %{_mandir}/man8/* 68 65 %{_libdir}/mindi 69 %attr(755,root,root) %{_sysconfdir}/mindi/mindi.conf70 66 %attr(755,root,root) %{_sbindir}/* 71 67 %attr(755,root,root) %{_libdir}/mindi/aux-tools/sbin/* -
branches/stable/mindi/install.sh
r488 r541 41 41 42 42 echo "Creating target directories ..." 43 install -m 755 -d $conf $ conf/deplist.d $locallib/mindi $MANDIR $local/sbin $DOCDIR43 install -m 755 -d $conf $locallib/mindi $MANDIR $local/sbin $DOCDIR 44 44 45 45 echo "Copying files ..." 46 46 install -m 644 isolinux.cfg msg-txt sys-disk.raw.gz isolinux-H.cfg syslinux.cfg syslinux-H.cfg dev.tgz $locallib/mindi 47 47 install -m 644 deplist.txt $conf 48 install -m 644 distributions/conf/deplist.d/* $conf/deplist.d49 install -m 755 distributions/conf/mindi.conf $conf50 48 51 49 cp -af rootfs aux-tools $locallib/mindi … … 53 51 chmod 755 $locallib/mindi/rootfs/sbin/* 54 52 chmod 755 $locallib/mindi/aux-tools/sbin/* 55 chmod 755 $conf/mindi.conf56 53 57 54 if [ "$RPMBUILDMINDI" = "true" ]; then … … 61 58 fi 62 59 chmod 755 $local/sbin/mindi 63 install -m 755 parted2fdisk.pl $local/sbin 64 install -m 755 analyze-my-lvm $locallib/mindi 60 install -m 755 analyze-my-lvm parted2fdisk.pl $local/sbin 65 61 66 62 install -m 644 mindi.8 $MANDIR … … 107 103 if [ "$RPMBUILDMINDI" != "true" ]; then 108 104 chown -R root:root $locallib/mindi $conf $DOCDIR 109 chown root:root $local/sbin/mindi $MANDIR/mindi.8 $local lib/mindi/analyze-my-lvm $local/sbin/parted2fdisk.pl105 chown root:root $local/sbin/mindi $MANDIR/mindi.8 $local/sbin/analyze-my-lvm $local/sbin/parted2fdisk.pl 110 106 if [ "$ARCH" = "ia64" ] ; then 111 107 chown root:root $local/sbin/parted2fdisk … … 113 109 fi 114 110 115 # Special case for SuSE family where doc is put elsewhere in the RPM116 if [ _"$dfam" = _"suse" ]; then117 rm -rf $DOCDIR118 fi119 120 111 exit 0 -
branches/stable/mindi/mindi
r538 r541 16 16 export ARCH=`/bin/arch` 17 17 18 ADDITIONAL_BOOT_PARAMS="acpi=off apm=off devfs=nomount exec-shield=0 noresume selinux=0 barrier=off" 19 18 20 RUN_AFTER_INITIAL_BOOT_PHASE="echo \"Who lives in a pineapple under the sea?\" > /tmp/spongebob.squarepants.txt" 19 21 # after booting from floppy/CD image but before … … 33 35 MINDI_CONF=YYY 34 36 MINDI_SBIN=${MINDI_PREFIX}/sbin 37 35 38 36 39 if [ "$ARCH" = "x86_64" ] ; then … … 40 43 fi 41 44 42 MINDI_CONFIG="$MINDI_CONF/mindi.conf" 43 if [ ! -f $MINDI_CONFIG ]; then 44 echo "No $MINDI_CONFIG file found using sensible values" 45 else 46 . $MINDI_CONFIG 47 fi 48 49 # 50 # Manages defaults coming from conf files 51 # 52 if [ "$mindi_extra_space" == "" ]; then 53 EXTRA_SPACE=24576 54 else 55 EXTRA_SPACE=$mindi_extra_space 56 fi 57 if [ "$mindi_ia64_boot_size" == "" ]; then 58 IA64_BOOT_SIZE=8192 59 else 60 IA64_BOOT_SIZE=$mindi_ia64_boot_size 61 fi 62 if [ "$mindi_deplist_dir" == "" ]; then 63 DEPLIST_DIR="$MINDI_CONF/deplist.d" 64 else 65 DEPLIST_DIR="$mindi_deplist_dir" 66 fi 67 # TBC 68 if [ "$mindi_write_boot_floppy" == "" ]; then 69 WRITE_BOOT_FLOPPIES="yes" 70 else 71 WRITE_BOOT_FLOPPIES="$mindi_write_boot_floppy" 72 fi 73 # TBC 74 if [ "$mindi_write_cd" == "" ]; then 75 WRITE_MINDI_CD="yes" 76 else 77 WRITE_MINDI_CD="$mindi_write_cd" 78 fi 79 # TBC 80 if [ "$mindi_images_dir" == "" ]; then 81 CACHEDIR="/var/cache/mindi" 82 else 83 CACHEDIR="$mindi_images_dir" 84 fi 85 if [ "$mindi_dual_floppies" == "" ]; then 86 FORCE_DUAL_FLOPPIES="/var/cache/mindi" 87 else 88 FORCE_DUAL_FLOPPIES="$mindi_dual_floppies" 89 fi 90 if [ "$mindi_tmp_dir" == "" ]; then 91 TMP_ROOT="/tmp" 92 else 93 TMP_ROOT="$mindi_tmp_dir" 94 fi 95 if [ "$mindi_fd_device" == "" ]; then 96 FDDEVICE="/dev/fd0" 97 else 98 FDDEVICE="$mindi_fd_device" 99 fi 100 if [ "mindi_boot_params" == "" ]; then 101 ADDITIONAL_BOOT_PARAMS="acpi=off apm=off devfs=nomount exec-shield=0 noresume selinux=0 barrier=off" 102 else 103 ADDITIONAL_BOOT_PARAMS="$mindi_boot_params" 104 fi 105 106 107 # Other parameters 108 # Useless ?? 45 EXTRA_SPACE=24576 ; # increase if you run out of ramdisk space 46 IA64_BOOT_SIZE=8192 ; # size of the ia64 boot disk 47 TMP_ROOT=/tmp 48 WRITE_BOOT_FLOPPIES="yes" ; # do you want to be propted to write floppy images 109 49 PROMPT_WRITE_BOOT_FLOPPIES="yes" 110 50 # do you want to be prompted to write … … 120 60 # you want to use your own kernel, or the supplied default. 121 61 # If "yes" mindi will automatically use your own kernel. 122 62 MINDI_CONFIG="$MINDI_CONF/mindi.conf" 63 if [ -f $MINDI_CONFIG ]; then 64 . $MINDI_CONFIG 65 fi 123 66 MY_FSTAB=/etc/fstab 124 67 FLOPPY_MODS="ide-floppy floppy" 125 68 TAPE_MODS="ht st osst ide-tape ide_tape" 126 SCSI_MODS="3 w-xxxx 53c7,8xx a100u2w a320raid aacraid advansys aha152x aha1542 aha1740 aic79xx aic79xx_mod aic7xxx aic7xxx_mod aic7xxx_old AM53C974 atp870u BusLogic cciss cpqfc dmx3191d dpt_i2o dtc eata eata_dma eata_pio fdomain gdth g_NCR5380 ide-scsi ieee1394 imm in2000 initio ips iscsi isp megaraid mptbase mptscsih NCR53c406a ncr53c8xx nsp32 pas16 pci2000 pci2220i pcmcia ppa psi240i qla1280 qlogicfas qlogicfc qlogicisp raw1394 scsi_debug scsi_mod sd_mod seagate sg sim710 sr_mod sym53c416 sym53c8xx sym53c8xx_2 t128 tmscsim u14-34f ultrastor wd7000 vmhgfs"69 SCSI_MODS="3c59x 3w-xxxx 53c7,8xx a100u2w a320raid aacraid advansys aha152x aha1542 aha1740 aic79xx aic79xx_mod aic7xxx aic7xxx_mod aic7xxx_old AM53C974 atp870u BusLogic cciss cpqfc dmx3191d dpt_i2o dtc eata eata_dma eata_pio fdomain gdth g_NCR5380 ide-scsi ieee1394 imm in2000 initio ips iscsi isp megaraid mptbase mptscsih NCR53c406a ncr53c8xx nsp32 pas16 pci2000 pci2220i pcmcia ppa psi240i qla1280 qlogicfas qlogicfc qlogicisp raw1394 scsi_debug scsi_mod sd_mod seagate sg sim710 sr_mod sym53c416 sym53c8xx sym53c8xx_2 t128 tmscsim u14-34f ultrastor wd7000 vmhgfs" 127 70 128 71 # ide-probe-mod … … 131 74 USB_MODS="usb-storage usb-ohci usb-uhci usbcore usb_storage hid uhci_hcd ehci_hcd uhci-hcd ehci-hcd usbkbd" 132 75 CDROM_MODS="$TAPE_MODS $FLOPPY_MODS $IDE_MODS af_packet cdrom isocd isofs inflate_fs nls_iso8859-1 nls_cp437 sg sr_mod zlib_inflate $USB_MODS $PCMCIA_MODS" 133 NET_MODS="sunrpc nfs nfs_acl lockd loop mii 3c59x e100 bcm5700 e1000 eepro100 ne2k-pci tg3 pcnet32 8139cp 8139too 8390vmxnet"134 EXTRA_MODS="$CDROM_MODS vfat fat loop md-mod linear raid0 raid1 xorraid5 lvm-mod dm-mod jfs xfs xfs_support pagebuf reiserfs ext2 ext3 minix nfs nfs_acl nfsd lockd sunrpc jbd"76 NET_MODS="sunrpc nfs nfs_acl lockd loop mii e100 bcm5700 e1000 eepro100 tg3 pcnet32 vmxnet" 77 EXTRA_MODS="$CDROM_MODS vfat fat loop linear raid0 raid1 raid5 lvm-mod dm-mod jfs xfs xfs_support pagebuf reiserfs ext2 ext3 minix nfs nfs_acl nfsd lockd sunrpc jbd" 135 78 LOGFILE=/var/log/mindi.log 79 FDDEVICE=/dev/fd0 ; # 1.44MB floppy #0 80 CACHE_LOC=/var/cache/mondo-archive 81 FORCE_DUAL_FLOPPIES=no 136 82 137 83 BOOT_MEDIA_MESSAGE="\ … … 219 165 Aborted() { 220 166 trap SIGHUP SIGTERM SIGTRAP SIGINT 221 rm -f $CACHEDIR/mindi*img $CACHEDIR/*gz $CACHEDIR/mindi.iso167 [ "$imagesdir" != "" ] && rm -f $imagesdir/mindi*img $imagesdir/*gz $imagesdir/mindi.iso 222 168 [ "$minidir_root" != "" ] && rm -Rf $minidir_root/* 223 169 Die "User abort." … … 334 280 biggienumber=$4 335 281 336 [ -d "$filename" ] && Die "Cannot chop up $filename: it's a directory. Please amend deplist fileaccordingly."282 [ -d "$filename" ] && Die "Cannot chop up $filename: it's a directory. Please amend deplist.txt accordingly." 337 283 mkdir -p $outdir 338 284 … … 506 452 [ "$?" -ne "0" ] && cat /tmp/mke2fs.$$ 507 453 rm -f /tmp/mke2fs.$$ 508 mount -t ext2 -o loop $imagefile $mountpoint || Die "Can't loopmount $ imagefile to $mountpoint! The reason may be missing support for loopfs or ext2 (or both) in the running kernel."454 mount -t ext2 -o loop $imagefile $mountpoint || Die "Can't loopmount $mountpoint; does your kernel support loopfs? If not, please recompile your kernel. Your Linux distro is broken." 509 455 mv $tarball $mountpoint/ 510 456 if [ "$?" -ne "0" ] ; then 511 457 umount $mountpoint 512 Die "Tarball $tarball is too big for disk! (CODI)\nTell dev teamto adjust MAX_COMPRESSED_SIZE"458 Die "Tarball $tarball is too big for disk! (CODI)\nTell Hugo to adjust MAX_COMPRESSED_SIZE" 513 459 fi 514 460 [ "$diskno" -eq "$noof_disks" ] && echo "This is the last disk ($diskno=$noof_disks)" >> $mountpoint/LAST-DISK … … 544 490 my_partitions=`mount | fgrep $$ | cut -f1 -d' '` 545 491 [ "$my_partitions" != "" ] && umount $my_partitions 546 # BCO : Too Dangerous !!! 547 #[ "$TMP_ROOT" != "/tmp" ] && rm -Rf $TMP_ROOT 492 [ "$TMP_ROOT" != "/tmp" ] && rm -Rf $TMP_ROOT 548 493 cd /tmp 549 494 mkdir -p mindi.err … … 684 629 echo "MINDI_CONF = $MINDI_CONF" >> $LOGFILE 685 630 echo "MONDO_SHARE = $MONDO_SHARE" >> $LOGFILE 686 mkdir -p $CACHE DIR631 mkdir -p $CACHE_LOC 687 632 } 688 633 … … 881 826 echo "$fname" >> $outfile.pre 882 827 cat $tempdepfile >> $outfile.pre 828 # echo "$fname ----> dependencies:-" >> $LOGFILE 829 # cat $tempdepfile | tr -s '/' '/' | sort -u >> $LOGFILE 830 # echo -en "(end of deplist of $fname)\n\n" >> $LOGFILE 883 831 rm -f $tempdepfile 884 832 progress=$(($progress+1)) … … 1306 1254 if [ $tmpmodprobe_flag == "Y" ] ; then 1307 1255 infile="/tmp/modprobe.conf.mindi.$$" 1308 find /etc/modprobe.d -maxdepth 1 -name "*" -xtype f -print0 | xargs -0 cat> $infile1256 find /etc/modprobe.d -maxdepth 1 -name "*" -xtype f > $infile 1309 1257 else 1310 1258 infile="/etc/modules.conf" … … 1382 1330 [ "`echo "$c_p" | grep -x "/dev/cdroms.*"`" ] && continue 1383 1331 if [ -h "$c_p" ] && [ "`echo "$c_p" | fgrep "/dev/hd"`" = "" ] && [ "`echo "$c_p" | fgrep "/dev/sd"`" = "" ] && [ "`echo "$c_p" | fgrep "/dev/md"`" = "" ] ; then 1384 current_partition=`ResolveSoftlink $c_p`1332 current_partition=`ResolveSoftlink $c_p` 1385 1333 [ "`echo "$current_partition" | fgrep "/dev/mapper"`" != "" ] && current_partition="$c_p" 1386 [ "`echo "/dev/scd0 /dev/scd1 /dev/sr0 /dev/sr1 /dev/cdrom /dev/cdrom1" | fgrep "$current_partition"`" ] && continue1334 [ "`echo "/dev/scd0 /dev/scd1 /dev/sr0 /dev/sr1 /dev/cdrom /dev/cdrom1" | fgrep "$current_partition"`" ] && continue 1387 1335 else 1388 1336 current_partition="$c_p" 1389 1337 fi 1390 1338 [ "$c_p" = "none" ] && continue 1391 absolute_partition=`ResolveSoftlink $c_p` 1392 partition_mountpt=`tr -s '\t' ' ' < $MY_FSTAB | /bin/grep -w "$current_partition" | /bin/grep -vx " *#.*" | $AWK '{print $2}' | head -n1` 1393 1394 # This part tries to retrieve the correct device from a LABEL line in /etc/fstab 1395 # current_partition contains only first column of /etc/fstab 1396 if [ "`echo "$current_partition" | /bin/grep -f -i "LABEL="`" != "" ] ; then 1339 absolute_partition=`ResolveSoftlink $c_p` 1340 partition_mountpt=`tr -s '\t' ' ' < $MY_FSTAB | grep -w "$current_partition" | grep -vx " *#.*" | $AWK '{print $2}' | head -n1` 1341 redhat_label="" 1342 if [ "`echo "$current_partition" | fgrep -i "LABEL="`" != "" ] ; then 1397 1343 str_to_find_fmt_with=$current_partition 1398 redhat_label=`echo "$current_partition" | /bin/cut -d'=' -f2` 1399 actual_dev="" 1400 1401 # 1st try : blkid, the good way 1402 if [ -x "/sbin/blkid" ] ; then 1403 actual_dev=`/sbin/blkid | /bin/grep "$current_partition" | /bin/cut -d':' -f1` 1404 fi 1405 1406 # 2nd try, which works on a standard partition (ext2/3), but not on swap 1407 if [ "x$actual_dev" = "x" ] ; then 1408 actual_dev=`/bin/mount -l | /bin/grep " [$redhat_label]" | /bin/cut -d' ' -f1` 1409 fi 1410 1411 # 3rd try, with vol_id (which works with swap) 1412 if [ "x$actual_dev" = "x" -a -x "/sbin/vol_id" ] ; then 1413 list_swaps=`cat /proc/swaps | /bin/grep "/dev/" | /bin/awk '{ print $1 }' ` 1414 for dev_swap in $list_swaps ; do 1415 dev_exists=`/sbin/vol_id $dev_swap | /bin/grep "$redhat_label"` 1416 if [ "x$dev_exists" != "x" ] ; then 1417 actual_dev=$dev_swap 1418 break; 1419 fi 1420 done 1421 fi 1422 1423 # 4th try : pre-formated LABEL. Format is : LABEL=SWAP-mydevice. e.g. : LABEL=SWAP-hda5 1424 if [ "x$actual_dev" = "x" -a "`echo "$current_partition" | /bin/grep -i "LABEL=SWAP"`" != ""] ; then 1425 try_dev="`echo "$redhat_label" | /bin/cut -d '-' -f2`" 1426 present_dev="`/bin/cat /proc/swaps | /bin/grep -w /dev/$try_dev`" 1427 if [ "x$present_dev" != "x" ] ; then 1428 actual_dev="/dev/$try_dev" 1429 fi 1430 fi 1431 1432 # Check if one of all those tries has known success 1433 if [ "x$actual_dev" != "x" ] ; then 1434 current_partition=$actual_dev 1435 else 1436 Die "Your system uses a labelled swap partition, but you lack the tool to support it.\nPlease replace swap labels with their correct devices in /etc/fstab\n" 1437 fi 1344 redhat_label=`echo "$current_partition" | cut -d'=' -f2` 1345 actual_dev=`mount -l | fgrep " [$redhat_label]" | cut -d' ' -f1` 1346 # partition_mountpt=$redhat_label 1347 current_partition=$actual_dev 1438 1348 else 1439 1349 str_to_find_fmt_with=$current_partition 1440 1350 fi 1441 1442 1351 partition_format=`$AWK '$1 == "'"$str_to_find_fmt_with"'" {print $3}' $MY_FSTAB` 1443 1352 if [ -d "/proc/lvm" ] && [ "`lvdisplay $current_partition 2> /dev/null`" ] ; then … … 1626 1535 1627 1536 1537 OfferToCopyImagesToDisks() { 1538 local imagesdir i imagename dev count boot_dev data_dev 1539 imagesdir=$1 1540 boot_dev=$2 1541 data_dev=$3 1542 echo -en "Would you like to create boot+data floppy disks now (y/n) ?" 1543 read i 1544 [ "$i" != "y" ] && [ "$i" != "Y" ] && return 1545 mount | fgrep /dev/fd > /dev/null && Die "Please unmount your floppies first." 1546 echo "WARNING! THIS WILL ERASE YOUR FLOPPY DISKS." 1547 [ ! -e "$boot_dev" ] && Die "Cannot find $boot_dev - is your Linux distro broken?" 1548 [ ! -e "$data_dev" ] && Die "Cannot find $data_dev - is your Linux distro broken?" 1549 i=`find $imagesdir -type f | fgrep "/mindi-root.1" 2> /dev/null` 1550 j=`find $imagesdir -type f | fgrep "/mindi-boot" | egrep -v '2880|5760'` 1551 # echo "i=$i" 1552 # echo "j=$j" 1553 if [ "$i" ] ; then 1554 CopyImageToDisk $j $data_dev "boot disk" 1555 CopyImageToDisk $i $data_dev "root disk" 1556 else 1557 CopyImageToDisk $j $boot_dev "boot/root disk" 1558 fi 1559 count=1 1560 for i in `find $imagesdir | fgrep mindi-data` ; do 1561 CopyImageToDisk $i $data_dev "data disk #$count" 1562 count=$(($count+1)) 1563 done 1564 } 1565 1628 1566 1629 1567 … … 1659 1597 cp $kernelpath $TMP_ROOT/iso/isolinux/vmlinuz || Die "Cannot copy vmlinuz ($kernelpath) to mondo root ($MONDO_ROOT/isolinux/vmlinuz). Did you run out of disk space?" 1660 1598 cp $TMP_ROOT/mindi.rdz $TMP_ROOT/iso/isolinux/initrd.img 1661 cp $TMP_ROOT/mindi.rdz $ CACHEDIR/initrd.img1599 cp $TMP_ROOT/mindi.rdz $imagesdir/initrd.img 1662 1600 [ -e "$iso_cfg_file" ] || Die "FIXME - unable to find $iso_cfg_file - this should never occur" 1663 1601 cd $TMP_ROOT/iso/isolinux … … 1680 1618 fi 1681 1619 if [ "$ARCH" != "ia64" ] ; then 1682 mkisofs -U -J -r -o $ CACHEDIR/mindi.iso -b isolinux/isolinux.bin -c isolinux/boot.cat -no-emul-boot -boot-load-size 4 -boot-info-table . > /dev/null 2> /tmp/$$.mk1683 else 1684 mkisofs -J -r -o $ CACHEDIR/mindi.iso -b images/mindi-bootroot.$IA64_BOOT_SIZE.img -c isolinux/boot.cat -no-emul-boot . > /dev/null 2> /tmp/$$.mk1620 mkisofs -U -J -r -o $imagesdir/mindi.iso -b isolinux/isolinux.bin -c isolinux/boot.cat -no-emul-boot -boot-load-size 4 -boot-info-table . > /dev/null 2> /tmp/$$.mk 1621 else 1622 mkisofs -J -r -o $imagesdir/mindi.iso -b images/mindi-bootroot.$IA64_BOOT_SIZE.img -c isolinux/boot.cat -no-emul-boot . > /dev/null 2> /tmp/$$.mk 1685 1623 fi 1686 1624 if [ "$?" -ne "0" ] ; then … … 1691 1629 LogIt "Failed to create ISO image.\n" 1692 1630 else 1693 echo "Created bootable ISO image at $ CACHEDIR/mindi.iso" >> $LOGFILE1631 echo "Created bootable ISO image at $imagesdir/mindi.iso" >> $LOGFILE 1694 1632 fi 1695 1633 rm -f /tmp/$$.mk … … 1796 1734 return $res 1797 1735 1736 # --- the kernel-only method NO LONGER WORKS. Not since Apr 2002. 1737 # It should work, according to the Boot Disk HOWTO, but it doesn't. 1738 # It works for my failsafe kernel & for RH7.2 but not RH7.3, 8.0, etc. 1739 # -Hugo, Apr 19th 2004 1740 # dd if=$1 of=$2 bs=1k &> /dev/null || Die "Cannot dd blank file" 1741 # dd if=/dev/zero bs=1k count=$3 >> $2 2> /dev/null || Die "Cannot dd blank file" 1742 # mv -f $2 $2.old 1743 # dd if=$2.old bs=1k count=$3 of=$2 &> /dev/null || Die "Cannot dd blank file" 1744 # rm -f $2.old 1745 # if [ "$3" = "1440" ] ; then 1746 # rdev $2 "/dev/fd0H"$3 1747 # else 1748 # rdev $2 "/dev/fd0u"$3 1749 # fi 1750 # rdev -R $2 0 1751 # rdev -r $2 49152 1798 1752 } 1799 1753 … … 2145 2099 [ "$retval" -ne "0" ] && LogIt "PrepareBootDiskImage() is returning nonzero\n" 2146 2100 return $retval 2101 } 2102 2103 2104 2105 2106 PrepareDataDiskImages() { 2107 local needlist bigdir minidir_root tardir diskdir imagesdir res i j k old_pwd lines 2108 2109 imagesdir=$1 2110 rm -f $imagesdir/mindi-*.img $imagesdir/[0-9]*.tar.gz $imagesdir/mindi.iso 2111 needlist=$TMP_ROOT/what-we-need.txt 2112 bigdir=$TMP_ROOT/bigdir 2113 minidir_root=$TMP_ROOT/minidir 2114 mkdir -p $minidir_root 2115 mkdir -p $bigdir/usr/bin 2116 tardir=$TMP_ROOT/tardir 2117 2118 lines=`grep -vx " *#.*" $MINDI_CONF/deplist.txt | grep -vx "" | wc -l` 2119 cat $MINDI_CONF/deplist.txt | GenerateGiantDependencyList $needlist $lines 2120 res=$? 2121 if [ "$YOUR_KERNEL_SUCKS" ]; then 2122 pwd=`pwd` 2123 cd $TMP_ROOT 2124 for i in `ListKernelModulePaths | HackPathsToFailsafe` ; do 2125 cp --parents -pRdf ./$i $bigdir || Die "PDDI can't cp $i->$bigdir" 2126 if [ "`du -sk $i | cut -f1`" -lt "$(($CHOPSIZE*2))" ] ; then 2127 cp --parents -pRdf $i $bigdir 2128 else 2129 ChopUpAndCopyFile $i $bigdir $CHOPSIZE $BIGNO 2130 BIGNO=$(($BIGNO+1)) 2131 fi 2132 done 2133 for i in $EXTRA_MODS ; do 2134 j=`find lib/modules/$FAILSAFE_KVER -name $i.*o 2> /dev/null` 2135 [ ! "$j" ] && echo "Warning - cannot find failsafe module $i.o" >> $LOGFILE 2136 for k in $j ; do 2137 if [ "`du -sk $k | cut -f1`" -lt "$CHOPSIZE" ] ; then 2138 cp --parents -pRdf $k $bigdir 2139 else 2140 ChopUpAndCopyFile $k $bigdir $CHOPSIZE $BIGNO 2141 BIGNO=$(($BIGNO+1)) 2142 fi 2143 echo "Added failsafe module $k to ramdisk" >> $LOGFILE 2144 done 2145 done 2146 cd $pwd 2147 else 2148 ListKernelModulePaths >> $needlist 2149 fi 2150 if [ "$res" -ne "0" ] ; then 2151 Die "You have $res file`PluralOrNot $res` present in dependency list\nbut absent from filesystem." 2152 fi 2153 FindAndAddUserKeyboardMappingFile 2154 mkdir -p $bigdir/tmp 2155 if [ "`DidMondoCallMe`" ] ; then 2156 MakeMondoConfigFile $TMP_ROOT/mondo-restore.cfg 2157 cp -f $TMP_ROOT/mondo-restore.cfg $bigdir/tmp &> /dev/null 2158 cp -f $TMP_ROOT/mondo-restore.cfg $CACHE_LOC &> /dev/null 2159 fi 2160 [ -d "/mnt/.boot.d" ] && echo "Oh Jebus" > $bigdir/tmp/DUMBASS-GENTOO 2161 DropOptimizedLibraries $needlist $bigdir 2162 echo -en "Assembling dependency files" 2163 CopyDependenciesToDirectory < $needlist $bigdir 2164 2165 # also copy io.sys and msdos.sys, if we can find them 2166 for i in `mount | cut -d' ' -f3` ; do 2167 for j in io.sys msdos.sys ; do 2168 [ -e "$i/$j" ] && cp -f $i/$j $bigdir 2169 done 2170 done 2171 2172 # master boot record, too 2173 i=`cat $MONDO_TMP/BOOTLOADER.DEVICE 2> /dev/null` 2174 if [ "$i" ] ; then 2175 LogIt "Backing up $i's MBR\n" 2176 dd if=$i of=$bigdir/BOOTLOADER.MBR bs=446 count=1 >> $LOGFILE 2>> $LOGFILE 2177 # < < E O F 2178 sleep 1 2179 sync 2180 # [ "$?" -ne "0" ] && echo "Failed to save $i's MBR to bigdir" >> $LOGFILE 2181 j=$i 2182 [ -h "$j" ] && j=`ResolveSoftlink $j` 2183 LogIt "Creating /dev/boot_device ($j)\n" 2184 mkdir -p $bigdir/dev 2185 cp -pRdf $j $bigdir/dev/boot_device || Die "Unable to create /dev/boot_device on ramdisk" 2186 fi 2187 2188 # more stuff 2189 # cp -f $MINDI_LIB/embleer* $bigdir 2190 old_pwd=`pwd` 2191 cd $bigdir 2192 2193 [ -e "$MINDI_LIB/aux-tools" ] || Die "aux-tools not found in Mindi's home dir. Do you have multiple copies of Mindi lying around? Please delete them. No, don't e-mail me and ask how. ;) Use 'rm'." 2194 cp -Rdf $MINDI_LIB/aux-tools/* . 2>> $LOGFILE || LogIt "Warning - error occurred while unzipping aux-tools\n" 2195 if [ -e "$MINDI_LIB/x11-tools.tgz" ] ; then 2196 tar -zxf $MINDI_LIB/x11-tools.tgz 2>> $LOGFILE || LogIt "Warning - error occurred while unzipping x11-tools.tgz\n" 2197 fi 2198 if [ -e "$MONDO_SHARE/restore-scripts" ] ; then 2199 cp -Rdf $MONDO_SHARE/restore-scripts/* . 2>> $LOGFILE 2200 [ "$?" -ne "0" ] && [ "`DidMondoCallMe`" ] && Die "Cannot find/install $MONDO_SHARE/restore-scripts" 2201 fi 2202 [ -d "/lib/dev-state" ] && cp --parents -pRdf /lib/dev-state . 2203 cd $old_pwd 2204 echo -e "$DONE" 2205 TOTAL_BIGDIR_SIZE=`du -sk $bigdir | cut -f1` 2206 SplitDirectoryIntoMinidirs $bigdir $minidir_root 2207 noof_disks=$? 2208 [ "$noof_disks" -eq "0" ] && Die "Too much stuff!" 2209 # if [ "$noof_disks" -ge "8" ] ; then 2210 # LogIt "You are putting a ludicrously large amount of data on these disks." 2211 # LogIt "I shall therefore double EXTRA_SPACE, just in case your ramdisk is too small." 2212 # EXTRA_SPACE=$(($EXTRA_SPACE*2)) 2213 # fi 2214 MakeMountlist $TMP_ROOT/mountlist.txt 2215 mkdir -p $minidir_root/$noof_disks/tmp 2216 cp -f $TMP_ROOT/mountlist.txt $minidir_root/$noof_disks/tmp/mountlist.txt || Die "Cannot copy mountlist.txt from $TMP_ROOT to data disk" 2217 cp -f $TMP_ROOT/mountlist.txt $CACHE_LOC 2218 [ "`DidMondoCallMe`" ] && cp -f $minidir_root/$noof_disks/tmp/mountlist.txt $MONDO_TMP/. 2219 [ -d "/proc/lvm" ] && $MINDI_LIB/analyze-my-lvm > $minidir_root/$noof_disks/tmp/i-want-my-lvm 2220 [ -d "/dev/mapper" ] && $MINDI_LIB/analyze-my-lvm > $minidir_root/$noof_disks/tmp/i-want-my-lvm 2221 cat $minidir_root/$noof_disks/tmp/mountlist.txt >> $LOGFILE 2222 ZipMinidirsIntoTarballs $minidir_root $tardir $noof_disks 2223 CreateDataDiskImagesFromTarballs $tardir $imagesdir $noof_disks 2224 FRIENDLY_OUTSTRING="Boot and data disk images were created." 2225 # One 1.72MB boot disk, one 2.88MB boot disk and $noof_disks data disk images 2226 rmdir $tardir $bigdir 2227 rm -f $needlist 2228 return $noof_disks 2147 2229 } 2148 2230 … … 2453 2535 root="/" 2454 2536 fi 2455 for fname in `find $root -maxdepth 2 -type f | fgrep lin | egrep -v '^/proc/|^/net/'` ; do2537 for fname in `find $root -maxdepth 2 -type f | fgrep lin | fgrep -v /proc/` ; do 2456 2538 [ ! -e "$fname" ] && continue 2457 2539 [ "$fname" = "/boot/vmlinuz.shipped" ] && [ -f "/boot/vmlinuz" ] && continue; # ignore SuSE's extra kernel … … 2613 2695 echo -en "..." 2614 2696 mkdir -p $mountpoint 2615 mount -t ext2 -o loop $tempfile $mountpoint || Die "Cannot loopmount $tempfile to $mountpoint ! The reason may be missing support for loopfs or ext2 (or both) in the running kernel."2697 mount -t ext2 -o loop $tempfile $mountpoint || Die "Cannot loopmount $tempfile to $mountpoint" 2616 2698 echo -en "..." 2617 2699 old_pwd=`pwd` … … 2773 2855 while [ "$diskno" -le "$noof_disks" ] ; do 2774 2856 cd $minidir_root/$diskno || LogIt "Warning - cannot cd to $minidir_root/$diskno\n" 2775 tar -cf - . 2>> $LOGFILE | gzip -9 > $tardir/$diskno.tar.gz || Die "Can't tar/gzip disk#$diskno; please tell dev team-exactly- what the errors where."2857 tar -cf - . 2>> $LOGFILE | gzip -9 > $tardir/$diskno.tar.gz || Die "Can't tar/gzip disk#$diskno; please tell Hugo -exactly- what the errors where." 2776 2858 diskno=$(($diskno+1)) 2777 2859 echo -n "..." … … 2821 2903 2822 2904 2905 #AWK=`which gawk` 2906 #LocateDeps $1 2907 #MakeModuleLoadingScript /tmp/load-modules.sh 2908 #exit 0 2909 2910 2911 #cat /etc/mindi/deplist.txt | GenerateGiantDependencyList /tmp/deplist.old 200 2912 #exit 0 2913 2914 2915 2823 2916 if [ "$1" = "-V" ] || [ "$1" = "-v" ] || [ "$1" = "--version" ] || [ "$1" = "-version" ] ; then 2824 2917 echo "mindi v$MINDI_VERSION" 2825 exit 02826 fi2827 2828 if [ "$1" = "-printvar" ] ; then2829 shift2830 if [ _"$1" != _"" ] ; then2831 set | egrep "^$1" | cut -d= -f22832 fi2833 2918 exit 0 2834 2919 fi … … 2882 2967 BIGNO=0 2883 2968 MAX_COMPRESSED_SIZE=1300 2884 imagesdir=$CACHEDIR 2969 imagesdir=/root/images/mindi 2970 mkdir -p $imagesdir 2885 2971 kernelpath="" 2886 2972 MONDO_ROOT=/tmp/mindilinux/mondo-root … … 2917 3003 exit $? 2918 3004 elif [ "$1" = " --version" ] || [ "$1" = "-v" ] ; then 2919 3005 echo "Mindi v$MINDI_VERSION" 2920 3006 exit 0 2921 3007 elif [ "$#" -ge "9" ] && [ "$1" = "--custom" ] ; then 2922 2923 2924 2925 3008 TMP_ROOT=$2 3009 MONDO_TMP=$2 3010 imagesdir=$3 3011 kernelpath=$4; [ "$kernelpath" = "(null)" ] && kernelpath="" 2926 3012 ### 2927 3013 ### Sq-Modification... … … 2930 3016 ### 2931 3017 kernelname=`echo $kernelpath | cut -d'-' -f2-` 2932 2933 3018 LogIt "kernelname = $kernelname\n" 3019 LogIt "kernelpath = $kernelpath\n" 2934 3020 if [ ! -d "/lib/modules/$kernelname" ] && [ "$kernelpath" != "FAILSAFE" ] 2935 3021 then … … 2943 3029 ### end of Sq-Modification 2944 3030 ### 2945 2946 2947 2948 2949 3031 TAPEDEV=$5 3032 TAPESIZE=$6 3033 FILES_IN_FILELIST=$7 3034 USE_LZO=$8 3035 CDRECOVERY=$9 2950 3036 if [ "${10}" = "(null)" ] || [ "${10}" = "" ] ; then 2951 3037 IMAGE_DEVS="" … … 2953 3039 IMAGE_DEVS="`echo "${10}" | tr '|' ' '`" 2954 3040 fi 2955 2956 3041 if [ "${11}" ] ; then 3042 LILO_OPTIONS="" 2957 3043 # LogIt "LILO will use conservative settings, to be compatible with older BIOSes." 2958 2959 3044 fi 3045 LAST_FILELIST_NUMBER=${12} 2960 3046 ESTIMATED_TOTAL_NOOF_SLICES=${13} 2961 3047 EXCLUDE_DEVS="${14}" 2962 3048 USE_COMP="${15}" 2963 3049 USE_LILO="${16}" 2964 2965 3050 USE_STAR="${17}" 3051 INTERNAL_TAPE_BLOCK_SIZE="${18}" 2966 3052 DIFFERENTIAL="${19}" 2967 3053 NOT_BOOT="${20}" 2968 3054 [ "$USE_COMP" = "" ] && USE_COMP=yes 2969 3055 [ "$NOT_BOOT" = "" ] && NOT_BOOT=no 2970 2971 3056 [ "$TAPEDEV" ] && LogIt "This is a tape-based backup. Fine.\n" 3057 [ "$kernelpath" = "" ] && kernelpath=`TryToFindKernelPath` 2972 3058 kernelname=`echo $kernelpath | cut -d'-' -f2-` 2973 3059 if [ ! -d "/lib/modules/$kernelname" ] && [ "$kernelpath" != "FAILSAFE" ] … … 2979 3065 LogIt "Using modules for kernel: ${kernelname}\n" 2980 3066 fi 2981 3067 [ "$CDRECOVERY" = "yes" ] && [ "$TAPEDEV" != "" ] && Die "Sorry, you can't use --cd-recovery and --write-tapes at the same time" 2982 3068 MONDO_ROOT=`echo $imagesdir | sed 's/\(.*\)\/.*/\1/'` 2983 2984 else 2985 2986 3069 [ "$MONDO_ROOT" = "" ] && Die "MONDO_ROOT is undefined" 3070 else 3071 echo "Syntax: mindi (--custom ....)" >> /dev/stderr 3072 exit 1 2987 3073 fi 2988 3074 fi … … 2998 3084 2999 3085 3086 3087 3088 #ReplaceIndividualLine /tmp/init `grep -n "#WHOLIVESINAPINEAPPLEUNDERTHESEA#" /tmp/init | cut -d':' -f1` "$RUN_AFTER_INITIAL_BOOT_PHASE" 3089 #exit 0 3090 3091 3092 #ListKernelModules 3093 #exit 0 3094 3095 3096 3097 3000 3098 [ -e "$iso_cfg_file" ] || Die "Cannot find $iso_cfg_file" 3001 3099 rm -Rf $TMP_ROOT/mindilinux/* 3002 3100 TMP_ROOT=$TMP_ROOT/mindilinux/$$ 3003 3101 mkdir -p $TMP_ROOT 3102 mkdir -p $imagesdir 3004 3103 if [ ! "`DidMondoCallMe`" ] ; then 3005 3104 LogIt "Mindi Linux mini-distro generator v$MINDI_VERSION\n" 3006 LogIt "Latest Mindi is available from http:// www.mondorescue.org\n"3105 LogIt "Latest Mindi is available from http://mondorescue.berlios.de\n" 3007 3106 LogIt "BusyBox sources are available from http://www.busybox.net\n" 3008 3107 LogIt "------------------------------------------------------------------------------" … … 3046 3145 fi 3047 3146 if [ "$USE_OWN_KERNEL" = "yes" ]; then 3048 3049 3050 3051 3052 3053 3054 else 3055 3147 YOUR_KERNEL_SUCKS="" 3148 kernelpath=`TryToFindKernelPath` 3149 if [ "$kernelpath" = "" ] ; then 3150 echo -n "Please enter kernel path : " 3151 read kernelpath 3152 fi 3153 else 3154 YOUR_KERNEL_SUCKS="That's why you're using mine, dude. :-)" 3056 3155 fi 3057 3156 fi … … 3082 3181 [ "$YOUR_KERNEL_SUCKS" ] && [ ! "$FAILSAFE_KVER" ] && Die "Please install mindi-kernel package. You need it. Go to http://www.mondorescue.org and download it, then install it." 3083 3182 3084 rm -f $CACHEDIR/{*img,*gz,*iso} 3085 3086 rm -f $imagesdir/mindi-*.img $imagesdir/[0-9]*.tar.gz $imagesdir/mindi.iso 3087 needlist=$TMP_ROOT/what-we-need.txt 3088 bigdir=$TMP_ROOT/bigdir 3089 minidir_root=$TMP_ROOT/minidir 3090 mkdir -p $minidir_root 3091 mkdir -p $bigdir/usr/bin 3092 tardir=$TMP_ROOT/tardir 3093 3094 lines=`grep -vx " *#.*" $MINDI_CONF/deplist.txt $DEPLIST_DIR/* | grep -vx "" | wc -l` 3095 cat $MINDI_CONF/deplist.txt $DEPLIST_DIR/* | GenerateGiantDependencyList $needlist $lines 3096 res=$? 3097 if [ "$YOUR_KERNEL_SUCKS" ]; then 3098 pwd=`pwd` 3099 cd $TMP_ROOT 3100 for i in `ListKernelModulePaths | HackPathsToFailsafe` ; do 3101 cp --parents -pRdf ./$i $bigdir || Die "PDDI can't cp $i->$bigdir" 3102 if [ "`du -sk $i | cut -f1`" -lt "$(($CHOPSIZE*2))" ] ; then 3103 cp --parents -pRdf $i $bigdir 3104 else 3105 ChopUpAndCopyFile $i $bigdir $CHOPSIZE $BIGNO 3106 BIGNO=$(($BIGNO+1)) 3107 fi 3108 done 3109 for i in $EXTRA_MODS ; do 3110 j=`find lib/modules/$FAILSAFE_KVER -name $i.*o 2> /dev/null` 3111 [ ! "$j" ] && echo "Warning - cannot find failsafe module $i.o" >> $LOGFILE 3112 for k in $j ; do 3113 if [ "`du -sk $k | cut -f1`" -lt "$CHOPSIZE" ] ; then 3114 cp --parents -pRdf $k $bigdir 3115 else 3116 ChopUpAndCopyFile $k $bigdir $CHOPSIZE $BIGNO 3117 BIGNO=$(($BIGNO+1)) 3118 fi 3119 echo "Added failsafe module $k to ramdisk" >> $LOGFILE 3120 done 3121 done 3122 cd $pwd 3123 else 3124 ListKernelModulePaths >> $needlist 3125 fi 3126 if [ "$res" -ne "0" ] ; then 3127 Die "You have $res file`PluralOrNot $res` present in dependency list\nbut absent from filesystem." 3128 fi 3129 FindAndAddUserKeyboardMappingFile 3130 mkdir -p $bigdir/tmp 3131 if [ "`DidMondoCallMe`" ] ; then 3132 MakeMondoConfigFile $TMP_ROOT/mondo-restore.cfg 3133 cp -f $TMP_ROOT/mondo-restore.cfg $bigdir/tmp &> /dev/null 3134 cp -f $TMP_ROOT/mondo-restore.cfg $CACHEDIR &> /dev/null 3135 fi 3136 [ -d "/mnt/.boot.d" ] && echo "Oh Jebus" > $bigdir/tmp/DUMBASS-GENTOO 3137 DropOptimizedLibraries $needlist $bigdir 3138 echo -en "Assembling dependency files" 3139 CopyDependenciesToDirectory < $needlist $bigdir 3140 3141 # also copy io.sys and msdos.sys, if we can find them 3142 for i in `mount | cut -d' ' -f3` ; do 3143 for j in io.sys msdos.sys ; do 3144 [ -e "$i/$j" ] && cp -f $i/$j $bigdir 3145 done 3146 done 3147 3148 # master boot record, too 3149 i=`cat $MONDO_TMP/BOOTLOADER.DEVICE 2> /dev/null` 3150 if [ "$i" ] ; then 3151 LogIt "Backing up $i's MBR\n" 3152 dd if=$i of=$bigdir/BOOTLOADER.MBR bs=446 count=1 >> $LOGFILE 2>> $LOGFILE 3153 # < < E O F 3154 sleep 1 3155 sync 3156 # [ "$?" -ne "0" ] && echo "Failed to save $i's MBR to bigdir" >> $LOGFILE 3157 j=$i 3158 [ -h "$j" ] && j=`ResolveSoftlink $j` 3159 LogIt "Creating /dev/boot_device ($j)\n" 3160 mkdir -p $bigdir/dev 3161 cp -pRdf $j $bigdir/dev/boot_device || Die "Unable to create /dev/boot_device on ramdisk" 3162 fi 3163 3164 # more stuff 3165 # cp -f $MINDI_LIB/embleer* $bigdir 3166 old_pwd=`pwd` 3167 cd $bigdir 3168 3169 [ -e "$MINDI_LIB/aux-tools" ] || Die "aux-tools not found in Mindi's home dir. Do you have multiple copies of Mindi lying around? Please delete them. No, don't e-mail me and ask how. ;) Use 'rm'." 3170 cp -Rdf $MINDI_LIB/aux-tools/* . 2>> $LOGFILE || LogIt "Warning - error occurred while unzipping aux-tools\n" 3171 if [ -e "$MINDI_LIB/x11-tools.tgz" ] ; then 3172 tar -zxf $MINDI_LIB/x11-tools.tgz 2>> $LOGFILE || LogIt "Warning - error occurred while unzipping x11-tools.tgz\n" 3173 fi 3174 if [ -e "$MONDO_SHARE/restore-scripts" ] ; then 3175 cp -Rdf $MONDO_SHARE/restore-scripts/* . 2>> $LOGFILE 3176 [ "$?" -ne "0" ] && [ "`DidMondoCallMe`" ] && Die "Cannot find/install $MONDO_SHARE/restore-scripts" 3177 fi 3178 [ -d "/lib/dev-state" ] && cp --parents -pRdf /lib/dev-state . 3179 cd $old_pwd 3180 echo -e "$DONE" 3181 TOTAL_BIGDIR_SIZE=`du -sk $bigdir | cut -f1` 3182 SplitDirectoryIntoMinidirs $bigdir $minidir_root 3183 rm -f /root/images/mindi/{*img,*gz,*iso} 3184 3185 PrepareDataDiskImages $imagesdir 3183 3186 noof_disks=$? 3184 [ "$noof_disks" -eq "0" ] && Die "Too much stuff!"3185 MakeMountlist $TMP_ROOT/mountlist.txt3186 mkdir -p $minidir_root/$noof_disks/tmp3187 cp -f $TMP_ROOT/mountlist.txt $minidir_root/$noof_disks/tmp/mountlist.txt || Die "Cannot copy mountlist.txt from $TMP_ROOT to data disk"3188 cp -f $TMP_ROOT/mountlist.txt $CACHEDIR3189 [ "`DidMondoCallMe`" ] && cp -f $minidir_root/$noof_disks/tmp/mountlist.txt $MONDO_TMP/.3190 [ -d "/proc/lvm" ] && $MINDI_SBIN/analyze-my-lvm > $minidir_root/$noof_disks/tmp/i-want-my-lvm3191 [ -d "/dev/mapper" ] && $MINDI_SBIN/analyze-my-lvm > $minidir_root/$noof_disks/tmp/i-want-my-lvm3192 cat $minidir_root/$noof_disks/tmp/mountlist.txt >> $LOGFILE3193 ZipMinidirsIntoTarballs $minidir_root $tardir $noof_disks3194 CreateDataDiskImagesFromTarballs $tardir $imagesdir $noof_disks3195 FRIENDLY_OUTSTRING="Boot and data disk images were created."3196 # One 1.72MB boot disk, one 2.88MB boot disk and $noof_disks data disk images3197 rmdir $tardir $bigdir3198 rm -f $needlist3199 #return $noof_disks3200 3201 3187 ramdisk_size=$(($size_of_all_tools+$EXTRA_SPACE)) 3202 3188 rds=$(($ramdisk_size-$((ramdisk_size%4096)))) … … 3209 3195 else 3210 3196 if ! PrepareBootDiskImage_LILO $imagesdir 1722 $kernelpath $ramdisk_size ; then 3211 LogIt "Warning - failed to create 1.72MB boot image. Please reduce your kernel's size\n" 3212 LogIt "if you want to make a 1.72MB floppy disk.\n" 3213 fi 3214 if ! PrepareBootDiskImage_LILO $imagesdir 2880 $kernelpath $ramdisk_size ; then 3215 LogIt "Warning - failed to create 2.88MB floppy disk image.\n" 3216 LogIt "Please reduce your kernel's size\n" 3217 LogIt "if you want to make a 2.88MB floppy disk.\n" 3218 PrepareBootDiskImage_LILO $imagesdir 5760 $kernelpath $ramdisk_size || Die "Failed to create 2.88MB floppy disk image." 3219 fi 3197 LogIt "Warning - failed to create 1.72MB boot image. Please reduce your kernel's size\n" 3198 LogIt "if you want to make a 1.72MB floppy disk.\n" 3199 fi 3200 PrepareBootDiskImage_LILO $imagesdir 2880 $kernelpath $ramdisk_size || Die "Failed to create 2.88MB floppy disk image." 3220 3201 fi 3221 3202 else … … 3243 3224 [ ! -e "$boot_dev" ] && mknod $boot_dev b 2 60 3244 3225 [ ! -e "$boot_dev" ] && boot_dev=/dev/fd0H1722 3245 [ ! -e "$boot_dev" ] && Die " Will you PLEASE tell your distribution maker to create the 1.72MB devices in /dev?"3226 [ ! -e "$boot_dev" ] && Die "Oh Lord, will you PLEASE tell the vendor to create the 1.72MB devices in /dev?" 3246 3227 if [ "$PROMPT_WRITE_BOOT_FLOPPIES" = "yes" ]; then 3247 echo -en "Would you like to create boot+data floppy disks now (y/n) ?" 3248 read i 3249 [ "$i" != "y" ] && [ "$i" != "Y" ] && return 3250 mount | fgrep /dev/fd > /dev/null && Die "Please unmount your floppies first." 3251 echo "WARNING! THIS WILL ERASE YOUR FLOPPY DISKS." 3252 [ ! -e "$boot_dev" ] && Die "Cannot find $boot_dev - is your Linux distro broken?" 3253 [ ! -e "$FDDEVICE" ] && Die "Cannot find $FDDEVICE - is your Linux distro broken?" 3254 i=`find $imagesdir -type f | fgrep "/mindi-root.1" 2> /dev/null` 3255 j=`find $imagesdir -type f | fgrep "/mindi-boot" | egrep -v '2880|5760'` 3256 if [ "$i" ] ; then 3257 CopyImageToDisk $j $FDDEVICE "boot disk" 3258 CopyImageToDisk $i $FDDEVICE "root disk" 3259 else 3260 CopyImageToDisk $j $boot_dev "boot/root disk" 3261 fi 3262 count=1 3263 for i in `find $imagesdir | fgrep mindi-data` ; do 3264 CopyImageToDisk $i $FDDEVICE "data disk #$count" 3265 count=$(($count+1)) 3266 done 3228 OfferToCopyImagesToDisks $imagesdir $boot_dev $FDDEVICE 3267 3229 fi 3268 3230 OfferToMakeBootableISO $imagesdir 3269 3231 LogIt "Finished.\n" 3270 3232 elif [ "$TAPEDEV" ] ; then 3271 rm -f $CACHEDIR/{*img,*gz,*iso} 3233 mkdir -p /root/images/mindi 3234 rm -f /root/images/mindi/{*img,*gz,*iso} 3272 3235 OfferToMakeBootableISO $imagesdir 3273 3236 if [ -e "$imagesdir/all.tar.gz" ] ; then … … 3278 3241 else 3279 3242 OfferToMakeBootableISO $imagesdir 3243 fi 3244 if [ "$imagesdir" != "/root/images/mindi" ] ; then 3245 for i in `find $imagesdir -maxdepth 1 -name "*.iso" -o -name "*.img"` ; do 3246 cp -f $i /root/images/mindi || LogIt "[line 3260] Cannot copy $i to /root/images/mindi\n" 3247 done 3280 3248 fi 3281 3249 [ "$TMP_ROOT" != "/tmp" ] && rm -Rf $TMP_ROOT
Note:
See TracChangeset
for help on using the changeset viewer.