Your message dated Sat, 16 Aug 2025 15:55:37 -0400 (EDT)
with message-id <[email protected]>
and subject line Bug#1110934: Removed package(s) from unstable
has caused the Debian Bug report #461367,
regarding grub: please use ucf for managing user changes to menu.lst
to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact [email protected]
immediately.)


-- 
461367: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=461367
Debian Bug Tracking System
Contact [email protected] with problems
--- Begin Message ---
Package: grub
Version: 0.97-29
Severity: wishlist
User: [email protected]
Usertags: origin-ubuntu ubuntu-patch hardy

Hi guys,

Given bugs like #460177, I'm sure you're well aware that the current
update-grub behavior causes no small amount of consternation for users who
don't notice the magic comments and try to edit their boot configurations
directly.  At the last Ubuntu Developer Summit, it was decided that we should
do something about this for Ubuntu 8.04.[1]  Since grub2 is not yet ready to
be a default bootloader, that means finding a way to clean up update-grub's
behavior in grub.  Of the available solutions considered, we decided that
using ucf made the most sense, as a minimally-intrusive change that would at
least allow users to be notified that update-grub wanted to overwrite their
changes.

Attach is a preliminary patch that accomplishes this.  I don't consider it
final since there is still an outstanding feature enhancement request on ucf
to let us configure the debconf prompts (bug #456241), but I've tested it
with both xen and non-xen configs and it works sensibly for me so far, so at
this point I'd like to get your input on whether this is a change that could
be accepted into the Debian package as well.

Cheers,
-- 
Steve Langasek                   Give me a lever long enough and a Free OS
Debian Developer                   to set it on, and I can move the world.
Ubuntu Developer                                    http://www.debian.org/
[email protected]                                     [email protected]

[1] 
https://blueprints.launchpad.net/ubuntu/+spec/grub-configuration-improvements
A
diff -u grub-0.97/debian/update-grub grub-0.97/debian/update-grub
--- grub-0.97/debian/update-grub
+++ grub-0.97/debian/update-grub
@@ -2,6 +2,7 @@
 #
 # Insert a list of installed kernels in a grub config file
 #   Copyright 2001 Wichert Akkerman <[email protected]>
+#   Copyright 2007, 2008 Canonical Ltd.
 #
 # This file is free software; you can redistribute it and/or modify it
 # under the terms of the GNU General Public License as published by
@@ -22,6 +23,7 @@
 #	David B.Harris <[email protected]>
 #	Marc Haber <[email protected]>
 #	Crispin Flowerday <[email protected]>
+#	Steve Langasek <[email protected]>
 
 # Abort on errors
 set -e
@@ -266,6 +268,9 @@
 menu_file_basename=menu.lst
 menu_file=$grub_dir/$menu_file_basename
 
+# Full path to the menu.lst fragment used for ucf management
+ucf_menu_file=/var/run/grub/$menu_file_basename
+
 # Full path to the default file
 default_file_basename=default
 default_file=$grub_dir/$default_file_basename
@@ -410,6 +415,9 @@
 startopt="## ## Start Default Options ##"
 endopt="## ## End Default Options ##"
 
+# path to grub2
+grub2name="/boot/grub/core.img"
+
 # Extract options from config file
 ExtractMenuOpt()
 {
@@ -670,6 +678,179 @@
 	echo >> $buffer
 }
 
+## write out the kernel entries
+output_kernel_list() {
+	counter=0
+
+	# Xen entries first.
+	for kern in $xenKernels ; do
+		if test ! x"$howmany" = x"all" ; then
+			if [ $counter -gt $howmany ] ; then
+				break
+			fi
+		fi
+
+		kernelName=$(basename $kern)
+		kernelVersion=$(echo $kernelName | sed -e 's/vmlinuz//')
+
+		initrdName=$(FindInitrdName "/boot" "$kernelVersion")
+		initrd=""
+
+		kernel=$kernel_dir/$kernelName
+		if [ -n "$initrdName" ] ; then
+			initrd=$kernel_dir/$initrdName
+		fi
+
+		kernelVersion=$(echo $kernelVersion | sed -e 's/^-//')
+		currentOpt=$(get_kernel_opt $kernelVersion)
+
+		hypervisorVersions=$(FindXenHypervisorVersions "$kernelVersion")
+
+		found=
+		for hypervisorVersion in $hypervisorVersions; do
+			hypervisor="$kernel_dir/xen-$hypervisorVersion.gz"
+			if [ -e "$hypervisor" ]; then
+				found=1
+
+				echo "Found Xen hypervisor $hypervisorVersion,  kernel: $kernel" >&2
+
+				write_kernel_entry "$kernelVersion" '' '' "$grub_root_device" \
+				  "$kernel" "$currentOpt $xenkopt" '' "$initrd" true '' \
+				  Xen "$hypervisor" "$hypervisorVersion" "$xenhopt"
+		        counter=$(($counter + 1))
+			fi
+		done
+
+		if [ -z $found ]; then
+			for hypervisor in $hypervisors; do
+				hypVersion=`basename "$hypervisor" .gz | sed s%xen-%%`
+		
+				echo "Found Xen hypervisor $hypVersion,  kernel: $kernel" >&2
+
+				write_kernel_entry "$kernelVersion" '' '' "$grub_root_device" \
+				  "$kernel" "$currentOpt $xenkopt" '' "$initrd" true '' \
+				  Xen "$kernel_dir/$hypervisor" "$hypVersion" "$xenhopt"
+		        counter=$(($counter + 1))
+			done
+		fi
+	done
+
+	for kern in $sortedKernels ; do
+		counter=$(($counter + 1))
+		if test ! x"$howmany" = x"all" ; then
+			if [ $counter -gt $howmany ] ; then 
+				break
+			fi
+		fi
+		kernelName=$(basename $kern)
+		kernelVersion=$(echo $kernelName | sed -e 's/vmlinuz//')
+		initrdName=$(FindInitrdName "/boot" "$kernelVersion")
+		initrd=""
+
+		kernel=$kernel_dir/$kernelName
+		if [ -n "$initrdName" ] ; then
+			initrd=$kernel_dir/$initrdName
+		fi
+
+		echo "Found kernel: $kernel" >&2
+
+		if [ "$kernelName" = "vmlinuz" ]; then
+			if [ -L "/boot/$kernelName" ]; then
+				kernelVersion=`readlink -f "/boot/$kernelName"`
+				kernelVersion=$(echo $kernelVersion | sed -e 's/.*vmlinuz-//')
+				kernelVersion="$kernelVersion Default"
+			else
+				kernelVersion="Default"
+			fi
+		fi
+		if [ "$kernelName" = "vmlinuz.old" ]; then
+			if [ -L "/boot/$kernelName" ]; then
+				kernelVersion=`readlink -f "/boot/$kernelName"`
+				kernelVersion=$(echo $kernelVersion | sed -e 's/.*vmlinuz-//')
+				kernelVersion="$kernelVersion Previous"
+			else
+				kernelVersion="Previous"
+			fi
+		fi
+		kernelVersion=$(echo $kernelVersion | sed -e 's/^-//')
+
+		currentOpt=$(get_kernel_opt $kernelVersion)
+
+		do_lockold=$lockold
+		# do not lockold for the first entry
+		[ $counter -eq 1 ] && do_lockold=false
+
+		write_kernel_entry "$kernelVersion" "" "" "$grub_root_device" "$kernel" \
+			"$currentOpt $defoptions" "" "$initrd" true "$do_lockold"
+
+		# insert the alternative boot options
+		if test ! x"$alternative" = x"false" ; then
+			# for each altoptions line do this stuff
+			sed -ne 's/# altoptions=\(.*\)/\1/p' $buffer | while read line; do
+				descr=$(echo $line | sed -ne 's/\(([^)]*)\)[[:space:]]\(.*\)/\1/p')
+				suffix=$(echo $line | sed -ne 's/\(([^)]*)\)[[:space:]]\(.*\)/\2/p')
+
+				test x"$lockalternative" = x"true" && do_lockold=false
+				write_kernel_entry "$kernelVersion" "$descr" "$lockalternative" \
+					"$grub_root_device" "$kernel" "$currentOpt" "$suffix" "$initrd" \
+					"true" "$do_lockold"
+			done
+		fi
+	done
+
+	if test -f $grub2name ; then
+		echo "Found GRUB 2: $grub2name" >&2
+		cat >> $buffer << EOF
+title		Chainload into GRUB 2
+root		$grub_root_device
+kernel		$grub2name
+savedefault
+
+EOF
+	fi
+    
+	memtest86names="memtest86 memtest86+"
+
+	if test ! x"$memtest86" = x"false" ; then
+		for name in $memtest86names ; do
+			if test -f "/boot/$name.bin" ; then
+				kernelVersion="$name"
+				kernel="$kernel_dir/$name.bin"
+				currentOpt=
+				initrd=
+
+				echo "Found kernel: $kernel" >&2
+
+				write_kernel_entry "$kernelVersion" "" "" "$grub_root_device" \
+				"$kernel" "$currentOpt" "" "$initrd" "false" ""
+			fi
+		done
+	fi
+
+	echo $end >> $buffer
+}
+
+ucf_update_kernels() {
+	local target; target="$1"
+	local buffer; buffer="$2"
+
+	sed -ni -e"/$endopt/,/$end/p" "$buffer"
+
+	sed -n -e"/$endopt/,/$end/p" < $menu > $ucf_menu_file
+
+	ucf --debconf-ok --three-way "$buffer" $ucf_menu_file
+	rm "$buffer"
+
+	# now re-merge the ucf results with the target file
+	sed -i -e "/^$endopt/,/^$end/ {
+		/^$endopt/r $ucf_menu_file
+		d
+	}
+	" $target
+
+	rm -f $ucf_menu_file ${ucf_menu_file}.ucf-old
+}
+
 
 echo -n "Testing for an existing GRUB $menu_file_basename file ... " >&2
 
@@ -876,6 +1057,56 @@
 fi
 
 
+hypervisors=""
+for hyp in /boot/xen-*.gz; do
+    if [ ! -h "$hyp" ] && [ -f "$hyp" ]; then
+	hypervisors="$hypervisors `basename "$hyp"`"
+    fi
+done
+
+# figure out where grub looks for the kernels at boot time
+kernel_dir=/boot
+if [ -n "$boot_device" ] ; then
+	kernel_dir=
+fi
+
+
+# We need a static path to use for the ucf registration; since we're not
+# using the full menu.lst file (maybe we should, just copying it around?
+# C.f. discussion with Manoj), create a directory in a fixed location
+# even though we're not treating the file in that location as
+# persistent.
+mkdir -p /var/run/grub
+
+# The first time ucf sees the file, we can only assume any difference
+# between the magic comments and the kernel options is a result of local
+# mods, so this will result in a ucf prompt for anyone whose first
+# invocation of update-grub is as a result of updating the magic comments.
+if ! ucfq grub | grep -q $ucf_menu_file; then
+	otherbuffer=$(tempfile)
+	cat $buffer > $otherbuffer
+
+	sortedKernels=`sed -n -e "
+	/$endopt/,/$end/ {
+		s/^kernel[[:space:]]\+\([^[:space:]]\+\).*/\1/p
+	}" < $menu | grep -vE "memtest86|$grub2name|xen" | uniq`
+	xenKernels=`sed -n -e "
+	/$endopt/,/$end/ {
+		s/^module[[:space:]]\+\([^[:space:]]*vmlinuz[^[:space:]]\+\).*/\1/p
+	}" < $menu | uniq`
+
+	savebuffer="$buffer"
+	buffer="$otherbuffer"
+	output_kernel_list
+	buffer="$savebuffer"
+
+	ucf_update_kernels "$menu" "$otherbuffer"
+
+	# all done, now register it
+	ucfr grub $ucf_menu_file
+fi
+
+
 xenKernels=""
 for ver in `grep -l CONFIG_XEN_PRIVILEGED_GUEST=y /boot/config* | sed -e s%/boot/config-%%`; do
   # ver is a kernel version
@@ -942,19 +1173,6 @@
 	sortedKernels="/boot/vmlinuz $sortedKernels"
 fi
 
-hypervisors=""
-for hyp in /boot/xen-*.gz; do
-    if [ ! -h "$hyp" ] && [ -f "$hyp" ]; then
-	hypervisors="$hypervisors `basename "$hyp"`"
-    fi
-done
-
-# figure out where grub looks for the kernels at boot time
-kernel_dir=/boot
-if [ -n "$boot_device" ] ; then
-	kernel_dir=
-fi
-
 #Finding the value the default line
 use_grub_set_default="false"
 if test "$updatedefaultentry" = "true" ; then
@@ -987,157 +1205,12 @@
   ;;
 esac
 
-## heres where we start writing out the kernel entries
-counter=0
-
-# Xen entries first.
-for kern in $xenKernels ; do
-	if test ! x"$howmany" = x"all" ; then
-		if [ $counter -gt $howmany ] ; then
-			break
-		fi
-	fi
-
-	kernelName=$(basename $kern)
-	kernelVersion=$(echo $kernelName | sed -e 's/vmlinuz//')
-
-	initrdName=$(FindInitrdName "/boot" "$kernelVersion")
-	initrd=""
-
-	kernel=$kernel_dir/$kernelName
-	if [ -n "$initrdName" ] ; then
-		initrd=$kernel_dir/$initrdName
-	fi
-
-	kernelVersion=$(echo $kernelVersion | sed -e 's/^-//')
-	currentOpt=$(get_kernel_opt $kernelVersion)
-
-	hypervisorVersions=$(FindXenHypervisorVersions "$kernelVersion")
-
-	found=
-	for hypervisorVersion in $hypervisorVersions; do
-		hypervisor="$kernel_dir/xen-$hypervisorVersion.gz"
-		if [ -e "$hypervisor" ]; then
-			found=1
-
-			echo "Found Xen hypervisor $hypervisorVersion,  kernel: $kernel" >&2
+output_kernel_list
 
-			write_kernel_entry "$kernelVersion" '' '' "$grub_root_device" \
-			  "$kernel" "$currentOpt $xenkopt" '' "$initrd" true '' \
-			  Xen "$hypervisor" "$hypervisorVersion" "$xenhopt"
-	        counter=$(($counter + 1))
-		fi
-	done
-
-	if [ -z $found ]; then
-		for hypervisor in $hypervisors; do
-			hypVersion=`basename "$hypervisor" .gz | sed s%xen-%%`
-		
-			echo "Found Xen hypervisor $hypVersion,  kernel: $kernel" >&2
-
-			write_kernel_entry "$kernelVersion" '' '' "$grub_root_device" \
-			  "$kernel" "$currentOpt $xenkopt" '' "$initrd" true '' \
-			  Xen "$kernel_dir/$hypervisor" "$hypVersion" "$xenhopt"
-	        counter=$(($counter + 1))
-		done
-	fi
-done
-
-for kern in $sortedKernels ; do
-	counter=$(($counter + 1))
-	if test ! x"$howmany" = x"all" ; then
-		if [ $counter -gt $howmany ] ; then 
-			break
-		fi
-	fi
-	kernelName=$(basename $kern)
-	kernelVersion=$(echo $kernelName | sed -e 's/vmlinuz//')
-	initrdName=$(FindInitrdName "/boot" "$kernelVersion")
-	initrd=""
-
-	kernel=$kernel_dir/$kernelName
-	if [ -n "$initrdName" ] ; then
-		initrd=$kernel_dir/$initrdName
-	fi
-
-	echo "Found kernel: $kernel" >&2
-
-	if [ "$kernelName" = "vmlinuz" ]; then
-		if [ -L "/boot/$kernelName" ]; then
-			kernelVersion=`readlink -f "/boot/$kernelName"`
-			kernelVersion=$(echo $kernelVersion | sed -e 's/.*vmlinuz-//')
-			kernelVersion="$kernelVersion Default"
-		else
-			kernelVersion="Default"
-		fi
-	fi
-	if [ "$kernelName" = "vmlinuz.old" ]; then
-		if [ -L "/boot/$kernelName" ]; then
-			kernelVersion=`readlink -f "/boot/$kernelName"`
-			kernelVersion=$(echo $kernelVersion | sed -e 's/.*vmlinuz-//')
-			kernelVersion="$kernelVersion Previous"
-		else
-			kernelVersion="Previous"
-		fi
-	fi
-	kernelVersion=$(echo $kernelVersion | sed -e 's/^-//')
-	
-	currentOpt=$(get_kernel_opt $kernelVersion)
-
-	do_lockold=$lockold
-	# do not lockold for the first entry
-	[ $counter -eq 1 ] && do_lockold=false
-
-	write_kernel_entry "$kernelVersion" "" "" "$grub_root_device" "$kernel" \
-		"$currentOpt $defoptions" "" "$initrd" "true" "$do_lockold"
-
-	# insert the alternative boot options
-	if test ! x"$alternative" = x"false" ; then
-		# for each altoptions line do this stuff
-		sed -ne 's/# altoptions=\(.*\)/\1/p' $buffer | while read line; do
-			descr=$(echo $line | sed -ne 's/\(([^)]*)\)[[:space:]]\(.*\)/\1/p')
-			suffix=$(echo $line | sed -ne 's/\(([^)]*)\)[[:space:]]\(.*\)/\2/p')
-
-			test x"$lockalternative" = x"true" && do_lockold=false
-			write_kernel_entry "$kernelVersion" "$descr" "$lockalternative" \
-				"$grub_root_device" "$kernel" "$currentOpt" "$suffix" "$initrd" \
-				"true" "$do_lockold"
-
-		done
-	fi
-done
-
-grub2name="/boot/grub/core.img"
-if test -f $grub2name ; then
-	echo "Found GRUB 2: $grub2name" >&2
-	cat >> $buffer << EOF
-title		Chainload into GRUB 2
-root		$grub_root_device
-kernel		$grub2name
-savedefault
-
-EOF
-fi
-    
-memtest86names="memtest86 memtest86+"
-
-if test ! x"$memtest86" = x"false" ; then
-	for name in $memtest86names ; do
-		if test -f "/boot/$name.bin" ; then
-			kernelVersion="$name"
-			kernel="$kernel_dir/$name.bin"
-			currentOpt=
-			initrd=
-
-			echo "Found kernel: $kernel" >&2
-
-			write_kernel_entry "$kernelVersion" "" "" "$grub_root_device" \
-			"$kernel" "$currentOpt" "" "$initrd" "false" ""
-		fi
-	done
-fi
+otherbuffer=$(tempfile)
+cat $buffer > $otherbuffer
 
-echo $end >> $buffer
+ucf_update_kernels "$buffer" "$otherbuffer"
 
 echo -n "Updating $menu ... " >&2
 # Insert the new options into the menu
diff -u grub-0.97/debian/changelog grub-0.97/debian/changelog
--- grub-0.97/debian/changelog
+++ grub-0.97/debian/changelog
@@ -1,3 +1,14 @@
+grub (0.97-29.1) unstable; urgency=low
+
+  * Non-maintainer upload.
+  * debian/update-grub: use ucf to record changes to the autogenerated
+    kernel list
+  * debian/grub.postinst: run update-grub on upgrade from pre-ucf versions,
+    so that we get a registered copy of the file immediately and not just
+    the next time a kernel is installed.
+
+ -- Steve Langasek <[email protected]>  Thu, 17 Jan 2008 15:20:49 -0800
+
 grub (0.97-29) unstable; urgency=low
 
   [ Otavio Salvador ]
diff -u grub-0.97/debian/control grub-0.97/debian/control
--- grub-0.97/debian/control
+++ grub-0.97/debian/control
@@ -10,7 +10,7 @@
 
 Package: grub
 Architecture: i386 kfreebsd-i386 hurd-i386 amd64 kfreebsd-amd64
-Depends: ${shlibs:Depends}
+Depends: ${shlibs:Depends}, ucf
 Suggests: grub-doc, mdadm
 Description: GRand Unified Bootloader
  GRUB is a GPLed bootloader intended to unify bootloading across x86
only in patch2:
unchanged:
--- grub-0.97.orig/debian/grub.postinst
+++ grub-0.97/debian/grub.postinst
@@ -0,0 +1,9 @@
+#!/bin/sh
+
+if [ "$1" = "configure" ]; then
+	if dpkg --compare-versions "$2" lt-nl "0.97-29.1"; then
+		update-grub
+	fi
+fi
+
+#DEBHELPER#

--- End Message ---
--- Begin Message ---
Apologies; this wasn't sent as part of the dak rm action. I'm doing 
this by hand. Since this was manual, this opens the chance for me taking 
action by mistake.

I got the list of bugs via UDD, and am closing via -close on BCC. I spot 
checked about 10 of the bugs, and they're all src:grub. The COUNT 
matches the tracker page, so I'm sending this. 

If I have closed a bug that's not about bin:grub or src:grub, please do 
re-open the bug.

   paultag


We believe that the bug you reported is now fixed; the following
package(s) have been removed from unstable:

      grub |    0.97-84 | source
grub-legacy |    0.97-84 | amd64, i386

------------------- Reason -------------------
ROM; dead upstream, replaced by grub2
----------------------------------------------

Note that the package(s) have simply been removed from the tag
database and may (or may not) still be in the pool; this is not a bug.
The package(s) will be physically removed automatically when no suite
references them (and in the case of source, when no binary references
it).  Please also remember that the changes have been done on the
master archive and will not propagate to any mirrors until the next
dinstall run at the earliest.

Packages are usually not removed from testing by hand. Testing tracks
unstable and will automatically remove packages which were removed
from unstable when removing them from testing causes no dependency
problems. The release team can force a removal from testing if it is
really needed, please contact them if this should be the case.

We try to close bugs which have been reported against this package
automatically. But please check all old bugs, if they were closed
correctly or should have been re-assigned to another package.

Thank you for reporting the bug, which will now be closed.  If you
have further comments please address them to [email protected].

The full log for this bug can be viewed at https://bugs.debian.org/1110934

This message was generated automatically; if you believe that there is
a problem with it please contact the archive administrators by mailing
[email protected].

Debian distribution maintenance software
pp.
Paul Tagliamonte (the ftpmaster behind the curtain)

--- End Message ---

Reply via email to