2008-07-29 Christian Franke <franke@computer.org>
* util/update-grub.in: Add a check for admin group on Cygwin. Remove old `grub.cfg.new' before creation. Add `-f' to `mv' to handle the different filesystem semantics of Windows.
This commit is contained in:
parent
e93e4679ce
commit
b609876d15
2 changed files with 24 additions and 3 deletions
|
@ -1,3 +1,11 @@
|
||||||
|
2008-07-29 Christian Franke <franke@computer.org>
|
||||||
|
|
||||||
|
* util/update-grub.in: Add a check for admin
|
||||||
|
group on Cygwin.
|
||||||
|
Remove old `grub.cfg.new' before creation.
|
||||||
|
Add `-f' to `mv' to handle the different filesystem
|
||||||
|
semantics of Windows.
|
||||||
|
|
||||||
2008-07-29 Bean <bean123ch@gmail.com>
|
2008-07-29 Bean <bean123ch@gmail.com>
|
||||||
|
|
||||||
* normal/main.c (get_line): Fix buffer overflow bug.
|
* normal/main.c (get_line): Fix buffer overflow bug.
|
||||||
|
|
|
@ -73,8 +73,20 @@ if [ "x$EUID" = "x" ] ; then
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ "$EUID" != 0 ] ; then
|
if [ "$EUID" != 0 ] ; then
|
||||||
echo "$0: You must run this as root" >&2
|
root=f
|
||||||
exit 1
|
case "`uname 2>/dev/null`" in
|
||||||
|
CYGWIN*)
|
||||||
|
# Cygwin: Assume root if member of admin group
|
||||||
|
for g in `id -G 2>/dev/null` ; do
|
||||||
|
case $g in
|
||||||
|
0|544) root=t ;;
|
||||||
|
esac
|
||||||
|
done ;;
|
||||||
|
esac
|
||||||
|
if [ $root != t ] ; then
|
||||||
|
echo "$0: You must run this as root" >&2
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
set $grub_mkdevicemap dummy
|
set $grub_mkdevicemap dummy
|
||||||
|
@ -154,6 +166,7 @@ export GRUB_DEVICE GRUB_DEVICE_UUID GRUB_DEVICE_BOOT GRUB_DEVICE_BOOT_UUID GRUB_
|
||||||
# These are optional, user-defined variables.
|
# These are optional, user-defined variables.
|
||||||
export GRUB_DEFAULT GRUB_TIMEOUT GRUB_DISTRIBUTOR GRUB_CMDLINE_LINUX GRUB_CMDLINE_LINUX_DEFAULT GRUB_TERMINAL GRUB_SERIAL_COMMAND GRUB_DISABLE_LINUX_UUID
|
export GRUB_DEFAULT GRUB_TIMEOUT GRUB_DISTRIBUTOR GRUB_CMDLINE_LINUX GRUB_CMDLINE_LINUX_DEFAULT GRUB_TERMINAL GRUB_SERIAL_COMMAND GRUB_DISABLE_LINUX_UUID
|
||||||
|
|
||||||
|
rm -f ${grub_cfg}.new
|
||||||
exec > ${grub_cfg}.new
|
exec > ${grub_cfg}.new
|
||||||
|
|
||||||
# Allow this to fail, since /boot/grub/ might need to be fatfs to support some
|
# Allow this to fail, since /boot/grub/ might need to be fatfs to support some
|
||||||
|
@ -187,6 +200,6 @@ for i in ${update_grub_dir}/* ; do
|
||||||
done
|
done
|
||||||
|
|
||||||
# none of the children aborted with error, install the new grub.cfg
|
# none of the children aborted with error, install the new grub.cfg
|
||||||
mv ${grub_cfg}.new ${grub_cfg}
|
mv -f ${grub_cfg}.new ${grub_cfg}
|
||||||
|
|
||||||
echo "done" >&2
|
echo "done" >&2
|
||||||
|
|
Loading…
Reference in a new issue