Changeset 1570 in MondoRescue


Ignore:
Timestamp:
Jul 26, 2007, 1:35:59 AM (17 years ago)
Author:
Bruno Cornec
Message:
  • Add support of Debian ia64 in mondo
  • Fix mindi iso build for ia64 (test was reversed)
  • Add support for gzip compressed kernel in mindi (ia64 SLES 10 is in that category)
  • arch => uname -m everywhere
  • parted2fdisk adapted for parted differences on SLES 10 ia64
  • reiserfs support added for parted2fdisk
  • decode_Bsuf function added for parted2fdisk
  • README.ia64 improved for SLES 10

(merge -r 1563:1567 $SVN_M/branches/2.2.5)

Also begin to remove floppy support from mindi

Location:
branches/stable
Files:
12 edited

Legend:

Unmodified
Added
Removed
  • branches/stable/mindi-busybox/TAG

    r1447 r1570  
    1 stable
     11
  • branches/stable/mindi/Makefile.parted2fdisk

    r235 r1570  
    1 ARCH=$(shell /bin/arch | sed 's/686/386/')
     1ARCH=$(shell /bin/uname -m | sed 's/686/386/')
    22PRG=parted2fdisk
    33PERLV=$(shell perl -v | grep 'perl,' | awk '{print $$4}' | cut -c2-)
  • branches/stable/mindi/README.ia64

    r569 r1570  
    1919Note that parted2fdisk.pl supports currently only the -l and -s options as well as the commands p,n,d,w,t,a,q
    2020
     21On Itanium systems you won't generally find an installed isolinux.bin file which is required by mindi to create the bootable images. You'll generally have to take an i386 package for your distribution and install it on your itanium system so that you provide the required missing file.
     22
     23On SLES 10, fdisk is nor provided anymore. You'll have to rebuild the util-linux package by desactivating fdisk removal in the spec file.
     24
    2125Please report any problem around that tool to bruno@mondorescue.org
    2226Bruno.
  • branches/stable/mindi/aux-tools/sbin/format-and-kludge-vfat

    r305 r1570  
    9494    exit 1
    9595fi
    96 if [ "`arch`" != "ia64" ] ; then
     96if [ "`uname -m`" != "ia64" ] ; then
    9797    LogIt "Fixing the boot block of $device with ms-sys" 2
    9898    ms-sys -w $device 2> /tmp/fakv.log > /dev/null
  • branches/stable/mindi/deplist.txt

    r1047 r1570  
    2323hosts host.conf resolv.conf hosts.allow hosts.deny
    2424klogd sysklogd
    25 fdisk hdparm parted arch
     25fdisk hdparm parted uname
    2626loadkeys
    2727mount
  • branches/stable/mindi/install.sh

    r1513 r1570  
    4040MINDIVER=`cat VERSION`
    4141MINDIREV=`cat REVISION`
     42ARCH=`/bin/uname -m`
    4243echo "mindi ${MINDIVER}-r${MINDIREV} will be installed under $local"
    4344
     
    5859fi
    5960if [ _"$LIBDIR" = _"" ]; then
    60     ARCH=`/bin/arch`
    6161    echo $ARCH | grep -E '^i[0-9]86$' &> /dev/null && ARCH=i386 && locallib=$local/lib
    6262    echo $ARCH | grep -E '^x86_64$' &> /dev/null && locallib=$local/lib64
  • branches/stable/mindi/mindi

    r1544 r1570  
    1414
    1515### Which arch are we on (useful for ia64 port)
    16 ARCH=`/bin/arch`
     16ARCH=`/bin/uname -m`
    1717
    1818#RUN_AFTER_INITIAL_BOOT_PHASE="echo \"Who lives in a pineapple under the sea?\" > /tmp/spongebob.squarepants.txt"
     
    880880    [ ! -f $lvKernelImage ] && Die "File $lvKernelImage not found. Terminating."
    881881
    882     # get offet of gzip magic "1f8b0800" in file
    883     lvOffset=`od -vA n -t x1 $lvKernelImage | tr -d '[:space:]' | awk '{ print match($0, "1f8b0800")}'`
    884     [ $lvOffset -eq 0 ] && Die "gzip magic not found in file $lvKernelImage. Terminating."
    885     lvOffset=`expr $lvOffset / 2`
    886     echo "  GetInitrdFilesystemToUse(): gzip magic found at lvOffset $lvOffset.\n" >> $LOGFILE
    887 
    888     # scan kernel image for initrd filessystem support
    889     lvScanRes=`dd ibs=1 skip=$lvOffset if=$lvKernelImage obs=1M 2>/dev/null | gunzip -c 2> /dev/null | strings | grep -e "$lcMagicCramfs" -e "$lcMagicExt2fs" -e "$lcMagicInitfs"`
     882    # Kernel may be gzip compressed
     883    file $lvKernelImage 2>&1 | grep -q  gzip
     884    if [ $? -eq 0 ]; then
     885        lvScanRes=`gzip -cd $lvKernelImage | strings | grep -e "$lcMagicCramfs" -e "$lcMagicExt2fs" -e "$lcMagicInitfs"`
     886    else
     887        # get offet of gzip magic "1f8b0800" in file
     888        lvOffset=`od -vA n -t x1 $lvKernelImage | tr -d '[:space:]' | awk '{ print match($0, "1f8b0800")}'`
     889        [ $lvOffset -eq 0 ] && Die "gzip magic not found in file $lvKernelImage. Terminating."
     890        lvOffset=`expr $lvOffset / 2`
     891        echo "  GetInitrdFilesystemToUse(): gzip magic found at lvOffset $lvOffset.\n" >> $LOGFILE
     892
     893        # scan kernel image for initrd filessystem support
     894        lvScanRes=`dd ibs=1 skip=$lvOffset if=$lvKernelImage obs=1M 2>/dev/null | gunzip -c 2> /dev/null | strings | grep -e "$lcMagicCramfs" -e "$lcMagicExt2fs" -e "$lcMagicInitfs"`
     895    fi
    890896
    891897    # determine which filesystem to use for initrd image: ext2fs, gzip'ed cpio (initramfs ) or cramfs
     
    33413347
    33423348echo "Ramdisk will be $ramdisk_size KB" >> $LOGFILE
    3343 if [ "$USE_LILO" = "yes" ] ; then
    3344     if [ "$ARCH" = "ia64" ] ; then
    3345         PrepareBootDiskImage_LILO $MINDI_CACHE $BOOT_SIZE $kernelpath $ramdisk_size || Die "Failed to create ia64 floppy disk image."
    3346     else
    3347         if ! PrepareBootDiskImage_LILO $MINDI_CACHE 2880 $kernelpath $ramdisk_size ;  then
    3348             LogIt "WARNING - failed to create 2.88MB floppy disk image."
    3349             LogIt "Please reduce your kernel's size if you want to make a 2.88MB floppy disk."
    3350             PrepareBootDiskImage_LILO $MINDI_CACHE $BOOT_SIZE $kernelpath $ramdisk_size || Die "Failed to create 2.88MB floppy disk image."
    3351         fi
    3352     fi
     3349if [ "$ARCH" = "ia64" ] ; then
     3350    PrepareBootDiskImage_LILO $MINDI_CACHE $BOOT_SIZE $kernelpath $ramdisk_size || Die "Failed to create ia64 floppy disk image."
    33533351else
    3354     if ! PrepareBootDiskImage_SYSLINUX $MINDI_CACHE 2880 $kernelpath $ramdisk_size ; then
    3355         LogIt "WARNING - failed to create 2.88MB floppy disk image."
    3356         LogIt "Please reduce your kernel's size if you want to make a 2.88MB floppy disk."
    3357         PrepareBootDiskImage_SYSLINUX $MINDI_CACHE $BOOT_SIZE $kernelpath $ramdisk_size || Die "Failed to create 5.76MB floppy disk image."
     3352    if [ "$USE_LILO" = "yes" ] ; then
     3353        PrepareBootDiskImage_LILO $MINDI_CACHE $BOOT_SIZE $kernelpath $ramdisk_size || Die "Failed to create $BOOT_SIZE MB disk image."
     3354        fi
     3355    else
     3356        PrepareBootDiskImage_SYSLINUX $MINDI_CACHE $BOOT_SIZE $kernelpath $ramdisk_size || Die "Failed to create $BOOT_SIZE MB disk image."
    33583357    fi
    33593358fi
  • branches/stable/mindi/parted2fdisk.pl

    r725 r1570  
    77#
    88# Aims to be architecture independant (i386/ia64)
    9 # Tested on RHAS 2.1 ia64 - Mandrake 9.0 ia64 - RHAS 3.0 ia64
     9# Tested on RHAS 2.1 ia64 - Mandrake 9.0 ia64 - RHAS 3.0 ia64 - SLES 10
    1010#
    1111# (c) Bruno Cornec <Bruno.Cornec@hp.com>
     
    3636my %end;
    3737my %type;
    38 my %flags;
    3938my $arch;
    4039my $fake = 0;
     
    7473        "ext2" => "83",
    7574        "ext3" => "83",
     75        "reiserfs" => "83",
    7676        "linux-swap" => "82",
    7777        "LVM" => "8e",
     
    194194                    if ($cylend =~ /^\+/) {
    195195                        $cylend =~ s/^\+//;
    196                         if ($cylend =~ /K$/) {
    197                             $cylend =~ s/K$//;
    198                             $cylend *= 1024;
    199                         } elsif ($cylend =~ /M$/) {
    200                             $cylend =~ s/M$//;
    201                             $cylend *= 1048576;
    202                         } elsif ($cylend =~ /G$/) {
    203                             $cylend =~ s/G$//;
    204                             $cylend *= 1073741824;
    205                         }
     196                        # Handles suffixes; return bytes
     197                        $cylend = decode_Bsuf($cylend,1);
    206198                        # This gives the number of cyl
    207199                        $cylend /= $un;
     
    342334        "ext2" => "Linux",
    343335        "ext3" => "Linux",
     336        "reiserfs" => "Linux",
    344337        "linux-swap" => "Linux swap",
    345338        "LVM" => "Linux LVM",
     
    356349my $cmt;
    357350format FLOG1 =
    358 @<<<<<<<<<<<< @>>>>>>>> @>>>>>>>> @>>>>>>>> @>>>  @<<<<<<<<<<<<<<<<<<<<<<<<<<<<
     351@<<<<<<<<<<<< @>>>>>>>>>> @>>>>>>>>>> @>>>>>>>>>> @>>>  @<<<<<<<<<<<<<<<<<<<<<<<<<<<<
    359352$part,        $mstart,   $mend,   $length,  $pid, $cmt
    360353.
     
    362355@<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
    363356$part,
    364               @>>>>>>>> @>>>>>>>> @>>>>>>>> @>>>  @<<<<<<<<<<<<<<<<<<<<<<<<<<<<
     357              @>>>>>>>>>> @>>>>>>>>>> @>>>>>>>>>> @>>>  @<<<<<<<<<<<<<<<<<<<<<<<<<<<<
    365358              $mstart,   $mend,   $length,  $pid, $cmt
    366359.
    367360format STDOUT1 =
    368 @<<<<<<<<<<<< @>>>>>>>> @>>>>>>>> @>>>>>>>> @>>>  @<<<<<<<<<<<<<<<<<<<<<<<<<<<<
     361@<<<<<<<<<<<< @>>>>>>>>>> @>>>>>>>>>> @>>>>>>>>>> @>>>  @<<<<<<<<<<<<<<<<<<<<<<<<<<<<
    369362$part,        $mstart,   $mend,   $length,  $pid, $cmt
    370363.
     
    372365@<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
    373366$part,
    374               @>>>>>>>> @>>>>>>>> @>>>>>>>> @>>>  @<<<<<<<<<<<<<<<<<<<<<<<<<<<<
     367              @>>>>>>>>>> @>>>>>>>>>> @>>>>>>>>>> @>>>  @<<<<<<<<<<<<<<<<<<<<<<<<<<<<
    375368              $mstart,   $mend,   $length,  $pid, $cmt
    376369.
    377 #/dev/hda1             1     77579  39099374+  ee  EFI GPT
     370#   Device Boot      Start         End      Blocks   Id  System
     371#/dev/hda1               1       77579    39099374+  ee  EFI GPT
     372
    378373
    379374#
     
    386381
    387382# This will return MB
    388 get_parted ($device,$start,$end,\%type,\%flags);
     383get_parted ($device,$start,$end,\%type);
    389384
    390385while (($n,$d) = each %type) {
     
    395390    $mstart = sprintf("%d",$$start{$n}*1048576/$un);
    396391    $mstart = 1 if ($mstart < 1);
     392    $mstart = $endmax if ($mstart > $endmax);
    397393    $mend = sprintf("%d",$$end{$n}*1048576/$un - 1);
    398394    $mend = $endmax if ($mend > $endmax);
     395    $mend = 1 if ($mend < 1);
    399396    # length is in 1K blocks
    400397    $length = sprintf("%d",($mend-$mstart+1)*$un/1024);
     
    486483#
    487484# Parted gives info in MB
     485# (depending on versions - 1.6.25.1 provides suffixes)
    488486#
    489487sub get_parted {
     
    493491my $end = shift;
    494492my $type = shift;
    495 my $flags = shift;
     493my $void;
    496494my $d;
    497495my $n;
     496my $ret;
     497my $mode;
     498my $size;
     499
     500open (PARTED, "$parted -v |") || die "Unable to read from $parted";
     501$d = <PARTED>;
     502print FLOG "$d";
     503close(PARTED);
    498504
    499505open (PARTED, "$parted -s $device print |") || die "Unable to read from $parted";
     
    502508$d = <PARTED>;
    503509$d = <PARTED>;
     510
     511# depending on parted version, information given change:
     512if ($d =~ /\bSize\b/) {
     513    # SLES 10 parted >= 1.6.25
     514    $mode=1;
     515} else {
     516    # RHEL 3 parted <= 1.6.3
     517    $mode=0;
     518}
     519print FLOG "mode: $mode\n";
    504520print FLOG "Got from parted: \n";
    505 print FLOG "Minor    Start       End     Filesystem                        Flags\n";
     521print FLOG "Minor    Start       End     Filesystem\n";
    506522# Get info from each partition line
    507523while (($n,$d) = split(/\s/, <PARTED>,2)) {
     
    510526    $d =~ s/^\s*//;
    511527    $d =~ s/\s+/ /g;
    512     ($$start{$n},$$end{$n},$$type{$n},$$flags{$n}) = split(/ /,$d);
     528    if ($mode == 0) {
     529        ($$start{$n},$$end{$n},$$type{$n},$void) = split(/ /,$d);
     530    } elsif ($mode == 1) {
     531        ($$start{$n},$$end{$n},$size,$$type{$n},$void) = split(/ /,$d);
     532    } else {
     533        die "Undefined mode $mode";
     534    }
    513535    $$start{$n} = "" if (not defined $$start{$n});
    514536    $$end{$n} = "" if (not defined $$end{$n});
    515537    $$type{$n} = "" if (not defined $$type{$n});
    516     $$flags{$n} = "" if (not defined $$flags{$n});
    517     print FLOG "$n      $$start{$n}      $$end{$n}     $$type{$n}  $$flags{$n}\n";
     538    # Handles potential suffixes in latest parted version. Return MB
     539    $ret = decode_Bsuf($$start{$n},1048576);
     540    $$start{$n} = $ret;
     541    $ret = decode_Bsuf($$end{$n},1048576);
     542    $$end{$n} = $ret;
     543    print FLOG "$n      $$start{$n}      $$end{$n}     $$type{$n}\n";
    518544}
    519545close(PARTED);
    520546}
     547
     548sub decode_Bsuf {
     549
     550my $size  = shift;
     551my $unit  = shift;
     552my $ret = 0;
     553
     554#print FLOG "decode_Bsuf input: $size / $unit ";
     555if ($size =~ /KB$/i) {
     556    $size =~ s/KB$//i;
     557    $size *= 1024;
     558} elsif ($size =~ /MB$/i) {
     559    $size =~ s/MB$//i;
     560    $size *= 1048576;
     561} elsif ($size =~ /GB$/i) {
     562    $size =~ s/GB$//i;
     563    $size *= 1073741824;
     564} elsif ($size =~ /TB$/i) {
     565    $size =~ s/TB$//i;
     566    $size *= 1099511627776;
     567} else {
     568    # Nothing to do
     569}
     570$ret = $size / $unit;
     571#print FLOG " - output : $size => $ret\n";
     572return($ret);
     573}
     574
    521575
    522576# Based on Version 2.4  27-Sep-1996  Charles Bailey  bailey@genetics.upenn.edu
  • branches/stable/mondo/src/common/libmondo-archive.c

    r1564 r1570  
    745745            run_program_and_log_output
    746746                ("ln -sf /boot/efi/efi/SuSE/elilo.conf /etc/elilo.conf",
     747                 5);
     748        }
     749        if (!does_file_exist("/etc/elilo.conf")
     750            && does_file_exist("/boot/efi/efi/debian/elilo.conf")) {
     751            run_program_and_log_output
     752                ("ln -sf /boot/efi/efi/debian/elilo.conf /etc/elilo.conf",
     753                 5);
     754        if (!does_file_exist("/etc/elilo.conf")
     755            && does_file_exist("/boot//efi/debian/elilo.conf")) {
     756            run_program_and_log_output
     757                ("ln -sf /boot/efi/debian/elilo.conf /etc/elilo.conf",
    747758                 5);
    748759        }
  • branches/stable/mondo/src/restore-scripts/mondo/stabelilo-me

    r1564 r1570  
    2929        LogIt "elilo.conf found at /mnt/RESTORING/boot/efi/efi/SuSE/elilo.conf" 2
    3030        old_eliloconf="/mnt/RESTORING/boot/efi/efi/SuSE/elilo.conf"
     31        return 0
     32    elif [ -f "/mnt/RESTORING/boot/efi/efi/debian/elilo.conf" ] ; then
     33        LogIt "elilo.conf found at /mnt/RESTORING/boot/efi/efi/debian/elilo.conf" 2
     34        old_eliloconf="/mnt/RESTORING/boot/efi/efi/debian/elilo.conf"
     35        return 0
     36    elif [ -f "/mnt/RESTORING/boot/efi/debian/elilo.conf" ] ; then
     37        LogIt "elilo.conf found at /mnt/RESTORING/boot/efi/debian/elilo.conf" 2
     38        old_eliloconf="/mnt/RESTORING/boot/efi/debian/elilo.conf"
    3139        return 0
    3240    else
  • branches/stable/tools/build2pkg

    r1513 r1570  
    179179        fi
    180180        cd $TOPBUILDDIR/build-${p}
    181         ar=`arch`
     181        ar=`uname -m`
    182182        pkg1=$p-${PVER}-${ar}-${TAG}mr.tgz
    183183        echo "Running sudo /sbin/makepkg -p -l y -c y $pkg1"
  • branches/stable/tools/qemu-env

    r1467 r1570  
    1414export iph=10.0.2.2
    1515
    16 ARCH=`/bin/arch`
     16ARCH=`/bin/uname -m`
    1717if [ $ARCH = "x86_64" ]; then
    1818    qemucmd32=/usr/bin/qemu-system-i386
Note: See TracChangeset for help on using the changeset viewer.