[arch-commits] Commit in syslinux/trunk (PKGBUILD syslinux-install_update)
Thomas Bächler
thomas at archlinux.org
Sun Mar 6 16:24:52 UTC 2011
Date: Sunday, March 6, 2011 @ 11:24:51
Author: thomas
Revision: 112767
syslinux 4.03-4: Update the install script
Modified:
syslinux/trunk/PKGBUILD
syslinux/trunk/syslinux-install_update
-------------------------+
PKGBUILD | 4 +--
syslinux-install_update | 51 +++++++++++++++++++++++++---------------------
2 files changed, 30 insertions(+), 25 deletions(-)
Modified: PKGBUILD
===================================================================
--- PKGBUILD 2011-03-06 16:19:49 UTC (rev 112766)
+++ PKGBUILD 2011-03-06 16:24:51 UTC (rev 112767)
@@ -4,7 +4,7 @@
pkgname=syslinux
pkgver=4.03
-pkgrel=3
+pkgrel=4
arch=('i686' 'x86_64')
pkgdesc="Collection of boot loaders that boot from FAT, ext2/3/4 and btrfs filesystems, from CDs and via PXE"
url="http://syslinux.zytor.com/"
@@ -24,7 +24,7 @@
sha256sums=('c65567e324f9d1f7f794ae8f9578a0292bbd47d7b8d895a004d2f0152d0bda38'
'7e9301e37113d8bcddadc3a7d2fd6f3f433ef20ef6fa6df9fe9e256fa8868753'
'b4ba8f9daa67ec35da6e05adb610469bc8c4facf488468c1ec3e5860ba75313d'
- '5586e2f8c27de46629ec2991a56f60dfdbf3e212169e20cf2cf1aa4f10b4d4ba')
+ '49573a3b65362326c8b1e9bfa49e83225e0bf9d3710454de4070abc9481c614c')
build() {
# Do not try to build syslinux with our default LDFLAGS, it will fail
Modified: syslinux-install_update
===================================================================
--- syslinux-install_update 2011-03-06 16:19:49 UTC (rev 112766)
+++ syslinux-install_update 2011-03-06 16:24:51 UTC (rev 112767)
@@ -151,8 +151,8 @@
# Use DATA from findmnt see rc.sysint for more info
if [[ -f /proc/self/mountinfo ]]; then
- read rootdev rootfs < <(findmnt -run -o SOURCE,FSTYPE "$CHROOT/")
- read bootdev bootfs < <(findmnt -run -o SOURCE,FSTYPE "$CHROOT/boot")
+ read rootdev rootfs < <(findmnt -run -t noautofs -o SOURCE,FSTYPE "$CHROOT/")
+ read bootdev bootfs < <(findmnt -run -t noautofs -o SOURCE,FSTYPE "$CHROOT/boot")
else
echo "Could not find /proc/self/mountinfo"
echo "Are you running a kernel greater than 2.6.24?"
@@ -294,9 +294,6 @@
}
_install() {
- # Find which device contains /boot
- get_boot_devices
-
# Copy files to /boot
for file in "${com32_files[@]}"; do
# Symlink files even if links exist
@@ -331,10 +328,6 @@
fi
touch "$CHROOT/$autoupdate_file"
-
- [[ $SET_ACTIVE ]] && set_active
-
- [[ $MBR ]] && install_mbr
}
update() {
@@ -401,7 +394,12 @@
SET_ACTIVE="True"
;;
s)
- AUTOUPDATE="True"
+ # If AUTOUPDATE_FILE does not exist exit the script
+ if [[ -f $autoupdate_file ]]; then
+ UPDATE="True"
+ else
+ exit 0
+ fi
;;
*)
usage
@@ -410,42 +408,49 @@
esac
done
+# Display Usage Information if both Install and Update are passed
if [[ $INSTALL && $UPDATE ]]; then
usage
exit 1
fi
+# If a chroot dir is path set variables to reflect chroot
if [[ "$CHROOT" ]]; then
libpath="$CHROOT$libpath"
bootpath="$CHROOT$bootpath"
extlinux="$CHROOT$extlinux"
fi
-[[ "$AUTOUPDATE" && -f $autoupdate_file ]] && UPDATE="True"
-
+# Exit if no /boot path exists
if ( f=("$bootpath"/*); (( ! ${#f[@]} )) ); then
echo "Error: $bootpath is empty!"
echo "Is /boot mounted?"
exit 1
fi
-getBoot
+# Get the boot device if any of these options are passed
+if [[ $INSTALL || $UPDATE || $SET_ACTIVE || $MBR ]]; then
+ getBoot
+fi
-#UPDATE is the only function that does not need boot_devices
-[[ $UPDATE ]] && update
+# Install or Update
+if [[ $INSTALL ]]; then
+ _install || exit
+elif [[ $UPDATE ]]; then
+ update || exit
+fi
-# Install will take care of executing get_boot_devices, set_active, and install_mbr
-# Otherwise accept other combonations
-if [[ $INSTALL ]]; then
- _install
- exit 0
-elif [[ $SET_ACTIVE ]] || [[ $MBR ]]; then
+
+# SET_ACTIVE and MBR
+if [[ $SET_ACTIVE ]] || [[ $MBR ]]; then
get_boot_devices
+
if [[ $SET_ACTIVE ]]; then
- set_active || exit $?
+ set_active || exit
fi
+
if [[ $MBR ]]; then
- install_mbr || exit $?
+ install_mbr || exit
fi
fi
More information about the arch-commits
mailing list