[rear-users] SF.net SVN: rear:[832] trunk/usr/share/rear

gdha at users.sourceforge.net gdha at users.sourceforge.net
Thu May 10 12:53:10 CEST 2012


Revision: 832
          http://rear.svn.sourceforge.net/rear/?rev=832&view=rev
Author:   gdha
Date:     2012-05-10 10:53:09 +0000 (Thu, 10 May 2012)
Log Message:
-----------
bringing SVN in sync with github

Modified Paths:
--------------
    trunk/usr/share/rear/contrib/mkvendorrpm

Added Paths:
-----------
    trunk/usr/share/rear/finalize/Linux-i386/
    trunk/usr/share/rear/finalize/Linux-i386/20_install_grub.sh
    trunk/usr/share/rear/finalize/Linux-i386/21_install_grub2.sh

Removed Paths:
-------------
    trunk/usr/share/rear/finalize/Arch/i386/20_install_grub.sh
    trunk/usr/share/rear/finalize/Debian/i386/20_install_grub.sh
    trunk/usr/share/rear/finalize/Fedora/i386/20_install_grub.sh
    trunk/usr/share/rear/finalize/Fedora/i386/21_install_grub2.sh
    trunk/usr/share/rear/finalize/Gentoo/i386/20_install_grub.sh

Modified: trunk/usr/share/rear/contrib/mkvendorrpm
===================================================================
--- trunk/usr/share/rear/contrib/mkvendorrpm	2012-05-07 10:02:41 UTC (rev 831)
+++ trunk/usr/share/rear/contrib/mkvendorrpm	2012-05-10 10:53:09 UTC (rev 832)
@@ -74,8 +74,8 @@
 echo "Creating archive '$distarchive'"
 # use tar to copy the current rear while excluding development and obsolete files
 cd $rear_root
-tar --exclude=hpasmcliOutput.txt --exclude=\*~ --exclude=\*.rpmsave\* \
-		--exclude=\*.rpmnew\* --exclude=.\*.swp --exclude .svn -c \
+tar --exclude=hpasmcliOutput.txt --exclude=\*~ --exclude=\*.rpmsave\* --exclude=.gitignore \
+		--exclude=\*.rpmnew\* --exclude=.\*.swp --exclude-vcs -c \
 		. | tar -C $BUILD_DIR/$prod_ver -x
 
 cd -

Deleted: trunk/usr/share/rear/finalize/Arch/i386/20_install_grub.sh
===================================================================
--- trunk/usr/share/rear/finalize/Arch/i386/20_install_grub.sh	2012-05-07 10:02:41 UTC (rev 831)
+++ trunk/usr/share/rear/finalize/Arch/i386/20_install_grub.sh	2012-05-10 10:53:09 UTC (rev 832)
@@ -1 +0,0 @@
-link ../../Fedora/i386/20_install_grub.sh
\ No newline at end of file

Deleted: trunk/usr/share/rear/finalize/Debian/i386/20_install_grub.sh
===================================================================
--- trunk/usr/share/rear/finalize/Debian/i386/20_install_grub.sh	2012-05-07 10:02:41 UTC (rev 831)
+++ trunk/usr/share/rear/finalize/Debian/i386/20_install_grub.sh	2012-05-10 10:53:09 UTC (rev 832)
@@ -1,20 +0,0 @@
-#
-# Debian >3 uses grub by default. There is no information stored in the system about the boot
-# loader installation, so we can only guess and try to install grub.
-#
-# The same is true for Ubuntu ...
-#
-
-LogPrint "Installing boot loader (I hope you used grub and it works ...)"
-mount -t proc none /mnt/local/proc
-if chroot /mnt/local /bin/bash --login -c "grub-install '(hd0)'" >&2 ; then
-	NOBOOTLOADER=
-else
-	LogPrint "WARNING !!!
-	grub installation failed, please check '$LOGFILE' to see the error
-	message and decide yourself, wether the system will boot or not.
-
-	You also might consider to improve this script so that this won't happen again:
-	$SHARE_DIR/finalize/Debian/i386/20_install_grub.sh"
-fi
-umount /mnt/local/proc

Deleted: trunk/usr/share/rear/finalize/Fedora/i386/20_install_grub.sh
===================================================================
--- trunk/usr/share/rear/finalize/Fedora/i386/20_install_grub.sh	2012-05-07 10:02:41 UTC (rev 831)
+++ trunk/usr/share/rear/finalize/Fedora/i386/20_install_grub.sh	2012-05-10 10:53:09 UTC (rev 832)
@@ -1,96 +0,0 @@
-# This script is an improvement over the default grub-install '(hd0)'
-#
-# However the following issues still exist:
-#
-#  * We don't know what the first disk will be, so we cannot be sure the MBR
-#    is written to the correct disk(s). That's why we make all disks bootable.
-#
-#  * There is no guarantee that GRUB was the boot loader used originally. One
-#    solution is to save and restore the MBR for each disk, but this does not
-#    guarantee a correct boot-order, or even a working boot-lader config (eg.
-#    GRUB stage2 might not be at the exact same location)
-
-# Only for GRUB Legacy - GRUB2 will be handled by its own script
-[[ $(type -p grub) ]] || return
-
-LogPrint "Installing GRUB boot loader"
-mount -t proc none /mnt/local/proc
-
-if [[ -r "$LAYOUT_FILE" && -r "$LAYOUT_DEPS" ]]; then
-
-    # Check if we find GRUB stage 2 where we expect it
-    [[ -d "/mnt/local/boot" ]]
-    StopIfError "Could not find directory /boot"
-    [[ -d "/mnt/local/boot/grub" ]]
-    StopIfError "Could not find directory /boot/grub"
-    [[ -r "/mnt/local/boot/grub/stage2" ]]
-    StopIfError "Unable to find /boot/grub/stage2."
-
-    # Find exclusive partitions belonging to /boot (subtract root partitions from deps)
-    bootparts=$( (find_partition fs:/boot; find_partition fs:/) | sort | uniq -u )
-    grub_prefix=/grub
-    if [[ -z "$bootparts" ]]; then
-        bootparts=$(find_partition fs:/)
-        grub_prefix=/boot/grub
-    fi
-    # Should never happen
-    [[ "$bootparts" ]]
-    BugIfError "Unable to find any /boot partitions"
-
-    # Find the disks that need a new GRUB MBR
-    disks=$(grep '^disk ' $LAYOUT_FILE | cut -d' ' -f2)
-    [[ "$disks" ]]
-    StopIfError "Unable to find any disks"
-
-    for disk in $disks; do
-        # Use first boot partition by default
-        part=$(echo $bootparts | cut -d' ' -f1)
-
-        # Use boot partition that matches with this disk, if any
-        for bootpart in $bootparts; do
-            bootdisk=$(find_disk "$bootpart")
-            if [[ "$disk" == "$bootdisk" ]]; then
-                part=$bootpart
-                break
-            fi
-        done
-
-        # Find boot-disk and partition number
-        bootdisk=$(find_disk "$part")
-        partnr=${part#$bootdisk}
-        partnr=${partnr#p}
-        partnr=$((partnr - 1))
-
-        if [[ "$bootdisk" == "$disk" ]]; then
-            # Best case scenario is to have /boot on disk with MBR booted
-            chroot /mnt/local grub --batch --no-floppy >&2 <<EOF
-device (hd0) $disk
-root (hd0,$partnr)
-setup --stage2=/boot/grub/stage2 --prefix=$grub_prefix (hd0)
-quit
-EOF
-        else
-            # hd1 is a best effort guess, we cannot predict how numbering
-            # changes when a disk fails.
-            chroot /mnt/local grub --batch --no-floppy >&2 <<EOF
-device (hd0) $disk
-device (hd1) $bootdisk
-root (hd1,$partnr)
-setup --stage2=/boot/grub/stage2 --prefix=$grub_prefix (hd0)
-quit
-EOF
-        fi
-
-        if (( $? == 0 )); then
-            NOBOOTLOADER=
-        fi
-    done
-fi
-
-if [[ "$NOBOOTLOADER" ]]; then
-    if chroot /mnt/local grub-install '(hd0)' >&2 ; then
-        NOBOOTLOADER=
-    fi
-fi
-
-umount /mnt/local/proc

Deleted: trunk/usr/share/rear/finalize/Fedora/i386/21_install_grub2.sh
===================================================================
--- trunk/usr/share/rear/finalize/Fedora/i386/21_install_grub2.sh	2012-05-07 10:02:41 UTC (rev 831)
+++ trunk/usr/share/rear/finalize/Fedora/i386/21_install_grub2.sh	2012-05-10 10:53:09 UTC (rev 832)
@@ -1,88 +0,0 @@
-#  This  script is an improvement over the default grub-install '(hd0)'
-#
-# However the following issues still exist:
-#
-#  * We don't know what the first disk will be, so we cannot be sure the MBR
-#    is written to the correct disk(s). That's why we make all disks bootable.
-#
-#  * There is no guarantee that GRUB was the boot loader used originally. One
-#    solution is to save and restore the MBR for each disk, but this does not
-#    guarantee a correct boot-order, or even a working boot-lader config (eg.
-#    GRUB stage2 might not be at the exact same location)
-
-# Only for GRUB2 - GRUB Legacy will be handled by its own script
-[[ $(type -p grub-probe) || $(type -p grub2-probe) ]] || return
-
-LogPrint "Installing GRUB2 boot loader"
-mount -t proc none /mnt/local/proc
-#for i in /dev /dev/pts /proc /sys; do mount -B $i /mnt/local${i} ; done
-
-if [[ -r "$LAYOUT_FILE" && -r "$LAYOUT_DEPS" ]]; then
-
-    # Check if we find GRUB where we expect it
-    [[ -d "/mnt/local/boot" ]]
-    StopIfError "Could not find directory /boot"
-    [[ -d "/mnt/local/boot/grub2" ]]
-    StopIfError "Could not find directory /boot/grub2"
-    [[ -r "/mnt/local/boot/grub2/grub.cfg" ]]
-    LogIfError "Unable to find /boot/grub2/grub.cfg."
-
-    # Find exclusive partitions belonging to /boot (subtract root partitions from deps)
-    bootparts=$( (find_partition fs:/boot; find_partition fs:/) | sort | uniq -u )
-    grub_prefix=/grub
-    if [[ -z "$bootparts" ]]; then
-        bootparts=$(find_partition fs:/)
-        grub_prefix=/boot/grub2
-    fi
-    # Should never happen
-    [[ "$bootparts" ]]
-    BugIfError "Unable to find any /boot partitions"
-
-    # Find the disks that need a new GRUB MBR
-    disks=$(grep '^disk ' $LAYOUT_FILE | cut -d' ' -f2)
-    [[ "$disks" ]]
-    StopIfError "Unable to find any disks"
-
-    for disk in $disks; do
-        # Use first boot partition by default
-        part=$(echo $bootparts | cut -d' ' -f1)
-
-        # Use boot partition that matches with this disk, if any
-        for bootpart in $bootparts; do
-            bootdisk=$(find_disk "$bootpart")
-            if [[ "$disk" == "$bootdisk" ]]; then
-                part=$bootpart
-                break
-            fi
-        done
-
-        # Find boot-disk and partition number
-        bootdisk=$(find_disk "$part")
-        partnr=${part#$bootdisk}
-        partnr=${partnr#p}
-        partnr=$((partnr - 1))
-
-        if [[ "$bootdisk" == "$disk" ]]; then
-            #chroot /mnt/local grub2-mkconfig -o /boot/grub2/grub.cfg
-	    #chroot /mnt/local grub2-install "$bootdisk"
-	    grub2-install --root-directory=/mnt/local/ $bootdisk
-        else
-            chroot /mnt/local grub2-mkconfig -o /boot/grub2/grub.cfg
-	    #chroot /mnt/local grub2-install "$bootdisk"
-	    grub2-install --root-directory=/mnt/local/ $bootdisk
-        fi
-
-        if (( $? == 0 )); then
-            NOBOOTLOADER=
-        fi
-    done
-fi
-
-if [[ "$NOBOOTLOADER" ]]; then
-    if chroot /mnt/local grub2-install "$disk" >&2 ; then
-        NOBOOTLOADER=
-    fi
-fi
-
-#for i in /dev /dev/pts /proc /sys; do umount  /mnt/local${i} ; done
-umount /mnt/local/proc

Deleted: trunk/usr/share/rear/finalize/Gentoo/i386/20_install_grub.sh
===================================================================
--- trunk/usr/share/rear/finalize/Gentoo/i386/20_install_grub.sh	2012-05-07 10:02:41 UTC (rev 831)
+++ trunk/usr/share/rear/finalize/Gentoo/i386/20_install_grub.sh	2012-05-10 10:53:09 UTC (rev 832)
@@ -1,16 +0,0 @@
-#
-# Gentoo uses grub by default. There is no information stored in the system about the boot
-# loader installation, so we can only guess and try to install grub.
-LogPrint "Installing boot loader (I hope you used grub and it works ...)"
-mount -t proc none /mnt/local/proc
-if chroot /mnt/local /bin/bash --login -c "grub-install '(hd0)'" >&2 ; then
-	NOBOOTLOADER=
-else
-	LogPrint "WARNING !!!
-	grub installation failed, please check '$LOGFILE' to see the error
-	message and decide yourself, wether the system will boot or not.
-
-	You also might consider to improve this script so that this won't happen again:
-	$SHARE_DIR/finalize/Gentoo/i386/20_install_grub.sh"
-fi
-umount /mnt/local/proc

Copied: trunk/usr/share/rear/finalize/Linux-i386/20_install_grub.sh (from rev 831, trunk/usr/share/rear/finalize/Fedora/i386/20_install_grub.sh)
===================================================================
--- trunk/usr/share/rear/finalize/Linux-i386/20_install_grub.sh	                        (rev 0)
+++ trunk/usr/share/rear/finalize/Linux-i386/20_install_grub.sh	2012-05-10 10:53:09 UTC (rev 832)
@@ -0,0 +1,96 @@
+# This script is an improvement over the default grub-install '(hd0)'
+#
+# However the following issues still exist:
+#
+#  * We don't know what the first disk will be, so we cannot be sure the MBR
+#    is written to the correct disk(s). That's why we make all disks bootable.
+#
+#  * There is no guarantee that GRUB was the boot loader used originally. One
+#    solution is to save and restore the MBR for each disk, but this does not
+#    guarantee a correct boot-order, or even a working boot-lader config (eg.
+#    GRUB stage2 might not be at the exact same location)
+
+# Only for GRUB Legacy - GRUB2 will be handled by its own script
+[[ $(type -p grub) ]] || return
+
+LogPrint "Installing GRUB boot loader"
+mount -t proc none /mnt/local/proc
+
+if [[ -r "$LAYOUT_FILE" && -r "$LAYOUT_DEPS" ]]; then
+
+    # Check if we find GRUB stage 2 where we expect it
+    [[ -d "/mnt/local/boot" ]]
+    StopIfError "Could not find directory /boot"
+    [[ -d "/mnt/local/boot/grub" ]]
+    StopIfError "Could not find directory /boot/grub"
+    [[ -r "/mnt/local/boot/grub/stage2" ]]
+    StopIfError "Unable to find /boot/grub/stage2."
+
+    # Find exclusive partitions belonging to /boot (subtract root partitions from deps)
+    bootparts=$( (find_partition fs:/boot; find_partition fs:/) | sort | uniq -u )
+    grub_prefix=/grub
+    if [[ -z "$bootparts" ]]; then
+        bootparts=$(find_partition fs:/)
+        grub_prefix=/boot/grub
+    fi
+    # Should never happen
+    [[ "$bootparts" ]]
+    BugIfError "Unable to find any /boot partitions"
+
+    # Find the disks that need a new GRUB MBR
+    disks=$(grep '^disk ' $LAYOUT_FILE | cut -d' ' -f2)
+    [[ "$disks" ]]
+    StopIfError "Unable to find any disks"
+
+    for disk in $disks; do
+        # Use first boot partition by default
+        part=$(echo $bootparts | cut -d' ' -f1)
+
+        # Use boot partition that matches with this disk, if any
+        for bootpart in $bootparts; do
+            bootdisk=$(find_disk "$bootpart")
+            if [[ "$disk" == "$bootdisk" ]]; then
+                part=$bootpart
+                break
+            fi
+        done
+
+        # Find boot-disk and partition number
+        bootdisk=$(find_disk "$part")
+        partnr=${part#$bootdisk}
+        partnr=${partnr#p}
+        partnr=$((partnr - 1))
+
+        if [[ "$bootdisk" == "$disk" ]]; then
+            # Best case scenario is to have /boot on disk with MBR booted
+            chroot /mnt/local grub --batch --no-floppy >&2 <<EOF
+device (hd0) $disk
+root (hd0,$partnr)
+setup --stage2=/boot/grub/stage2 --prefix=$grub_prefix (hd0)
+quit
+EOF
+        else
+            # hd1 is a best effort guess, we cannot predict how numbering
+            # changes when a disk fails.
+            chroot /mnt/local grub --batch --no-floppy >&2 <<EOF
+device (hd0) $disk
+device (hd1) $bootdisk
+root (hd1,$partnr)
+setup --stage2=/boot/grub/stage2 --prefix=$grub_prefix (hd0)
+quit
+EOF
+        fi
+
+        if (( $? == 0 )); then
+            NOBOOTLOADER=
+        fi
+    done
+fi
+
+if [[ "$NOBOOTLOADER" ]]; then
+    if chroot /mnt/local grub-install '(hd0)' >&2 ; then
+        NOBOOTLOADER=
+    fi
+fi
+
+umount /mnt/local/proc

Copied: trunk/usr/share/rear/finalize/Linux-i386/21_install_grub2.sh (from rev 831, trunk/usr/share/rear/finalize/Fedora/i386/21_install_grub2.sh)
===================================================================
--- trunk/usr/share/rear/finalize/Linux-i386/21_install_grub2.sh	                        (rev 0)
+++ trunk/usr/share/rear/finalize/Linux-i386/21_install_grub2.sh	2012-05-10 10:53:09 UTC (rev 832)
@@ -0,0 +1,88 @@
+#  This  script is an improvement over the default grub-install '(hd0)'
+#
+# However the following issues still exist:
+#
+#  * We don't know what the first disk will be, so we cannot be sure the MBR
+#    is written to the correct disk(s). That's why we make all disks bootable.
+#
+#  * There is no guarantee that GRUB was the boot loader used originally. One
+#    solution is to save and restore the MBR for each disk, but this does not
+#    guarantee a correct boot-order, or even a working boot-lader config (eg.
+#    GRUB stage2 might not be at the exact same location)
+
+# Only for GRUB2 - GRUB Legacy will be handled by its own script
+[[ $(type -p grub-probe) || $(type -p grub2-probe) ]] || return
+
+LogPrint "Installing GRUB2 boot loader"
+mount -t proc none /mnt/local/proc
+#for i in /dev /dev/pts /proc /sys; do mount -B $i /mnt/local${i} ; done
+
+if [[ -r "$LAYOUT_FILE" && -r "$LAYOUT_DEPS" ]]; then
+
+    # Check if we find GRUB where we expect it
+    [[ -d "/mnt/local/boot" ]]
+    StopIfError "Could not find directory /boot"
+    [[ -d "/mnt/local/boot/grub2" ]]
+    StopIfError "Could not find directory /boot/grub2"
+    [[ -r "/mnt/local/boot/grub2/grub.cfg" ]]
+    LogIfError "Unable to find /boot/grub2/grub.cfg."
+
+    # Find exclusive partitions belonging to /boot (subtract root partitions from deps)
+    bootparts=$( (find_partition fs:/boot; find_partition fs:/) | sort | uniq -u )
+    grub_prefix=/grub
+    if [[ -z "$bootparts" ]]; then
+        bootparts=$(find_partition fs:/)
+        grub_prefix=/boot/grub2
+    fi
+    # Should never happen
+    [[ "$bootparts" ]]
+    BugIfError "Unable to find any /boot partitions"
+
+    # Find the disks that need a new GRUB MBR
+    disks=$(grep '^disk ' $LAYOUT_FILE | cut -d' ' -f2)
+    [[ "$disks" ]]
+    StopIfError "Unable to find any disks"
+
+    for disk in $disks; do
+        # Use first boot partition by default
+        part=$(echo $bootparts | cut -d' ' -f1)
+
+        # Use boot partition that matches with this disk, if any
+        for bootpart in $bootparts; do
+            bootdisk=$(find_disk "$bootpart")
+            if [[ "$disk" == "$bootdisk" ]]; then
+                part=$bootpart
+                break
+            fi
+        done
+
+        # Find boot-disk and partition number
+        bootdisk=$(find_disk "$part")
+        partnr=${part#$bootdisk}
+        partnr=${partnr#p}
+        partnr=$((partnr - 1))
+
+        if [[ "$bootdisk" == "$disk" ]]; then
+            #chroot /mnt/local grub2-mkconfig -o /boot/grub2/grub.cfg
+	    #chroot /mnt/local grub2-install "$bootdisk"
+	    grub2-install --root-directory=/mnt/local/ $bootdisk
+        else
+            chroot /mnt/local grub2-mkconfig -o /boot/grub2/grub.cfg
+	    #chroot /mnt/local grub2-install "$bootdisk"
+	    grub2-install --root-directory=/mnt/local/ $bootdisk
+        fi
+
+        if (( $? == 0 )); then
+            NOBOOTLOADER=
+        fi
+    done
+fi
+
+if [[ "$NOBOOTLOADER" ]]; then
+    if chroot /mnt/local grub2-install "$disk" >&2 ; then
+        NOBOOTLOADER=
+    fi
+fi
+
+#for i in /dev /dev/pts /proc /sys; do umount  /mnt/local${i} ; done
+umount /mnt/local/proc

This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.





More information about the rear-users mailing list