Bug#614927: grub-install writes in /boot even with --root-directory

Nicolas George nicolas.george at normalesup.org
Thu Feb 24 09:46:55 UTC 2011


Package: grub-pc
Version: 1.98+20100804-14
Severity: normal
Tags: patch

When calling grub-install with --root-directory, to install Grub on an USB
stick for example, the following lines are executed at the end:

# If vestiges of GRUB Legacy still exist, tell the Debian packaging that
# they can ignore them.
if test -e /boot/grub/stage2 && test -e /boot/grub/menu.lst; then
    touch /boot/grub/grub2-installed
fi

(report-bugs shows version 1.98+20100804-14, but these lines are identical
in version 1.99~rc1-3)

If grub-install was started without root privileges, this causes a harmless
warning.

If grub-install was started with root privileges, it may cause the
/boot/grub/grub2-installed file to be created although Grub2 has not
actually been installed on the system.

The attached patch probably fixes it. The system information below is
probably irrelevant for this bug.

Regards,

-- 
  Nicolas George


-- Package-specific info:

*********************** BEGIN /proc/mounts
/dev/root / ext3 rw,relatime,errors=remount-ro,barrier=0,data=writeback 0 0
/dev/mapper/ssecem-var /var ext3 rw,relatime,errors=remount-ro,barrier=0,data=writeback 0 0
/dev/mapper/ssecem-home /home ext3 rw,relatime,errors=remount-ro,barrier=0,data=writeback 0 0
/dev/mapper/ssecem-d32 /mnt/32 ext3 rw,relatime,errors=remount-ro,barrier=0,data=writeback 0 0
/dev/mapper/ssecem-data /data ext3 rw,relatime,errors=remount-ro,barrier=0,data=writeback 0 0
/dev/sdb1 /cosmic ext3 rw,relatime,errors=remount-ro,barrier=0,data=writeback 0 0
*********************** END /proc/mounts

*********************** BEGIN /boot/grub/device.map
(hd0)	/dev/disk/by-id/ata-SAMSUNG_HD753LJ_S13UJDWQ719199
(hd1)	/dev/disk/by-id/ata-WDC_WD5000AADS-00L4B1_WD-WCAUH1229617
*********************** END /boot/grub/device.map

*********************** BEGIN /boot/grub/grub.cfg
#
# DO NOT EDIT THIS FILE
#
# It is automatically generated by grub-mkconfig using templates
# from /etc/grub.d and settings from /etc/default/grub
#

### BEGIN /etc/grub.d/00_header ###
if [ -s $prefix/grubenv ]; then
  load_env
fi
set default="0"
if [ "${prev_saved_entry}" ]; then
  set saved_entry="${prev_saved_entry}"
  save_env saved_entry
  set prev_saved_entry=
  save_env prev_saved_entry
  set boot_once=true
fi

function savedefault {
  if [ -z "${boot_once}" ]; then
    saved_entry="${chosen}"
    save_env saved_entry
  fi
}

function load_video {
}

set timeout=5
### END /etc/grub.d/00_header ###

### BEGIN /etc/grub.d/05_debian_theme ###
set menu_color_normal=cyan/blue
set menu_color_highlight=white/blue
### END /etc/grub.d/05_debian_theme ###

### BEGIN /etc/grub.d/10_linux ###
menuentry 'Debian GNU/Linux, with Linux 2.6.35.5-ssecem' --class debian --class gnu-linux --class gnu --class os {
	insmod part_msdos
	insmod ext2
	set root='(hd0,msdos1)'
	search --no-floppy --fs-uuid --set 8500d4d8-9c84-4671-a149-9b40846ed984
	echo	'Loading Linux 2.6.35.5-ssecem ...'
	linux	/boot/vmlinuz-2.6.35.5-ssecem root=/dev/sda1 ro  
}
menuentry 'Debian GNU/Linux, with Linux 2.6.35.5-ssecem (recovery mode)' --class debian --class gnu-linux --class gnu --class os {
	insmod part_msdos
	insmod ext2
	set root='(hd0,msdos1)'
	search --no-floppy --fs-uuid --set 8500d4d8-9c84-4671-a149-9b40846ed984
	echo	'Loading Linux 2.6.35.5-ssecem ...'
	linux	/boot/vmlinuz-2.6.35.5-ssecem root=/dev/sda1 ro single 
}
menuentry 'Debian GNU/Linux, with Linux 2.6.33.3-ssecem' --class debian --class gnu-linux --class gnu --class os {
	insmod part_msdos
	insmod ext2
	set root='(hd0,msdos1)'
	search --no-floppy --fs-uuid --set 8500d4d8-9c84-4671-a149-9b40846ed984
	echo	'Loading Linux 2.6.33.3-ssecem ...'
	linux	/boot/vmlinuz-2.6.33.3-ssecem root=/dev/sda1 ro  
}
menuentry 'Debian GNU/Linux, with Linux 2.6.33.3-ssecem (recovery mode)' --class debian --class gnu-linux --class gnu --class os {
	insmod part_msdos
	insmod ext2
	set root='(hd0,msdos1)'
	search --no-floppy --fs-uuid --set 8500d4d8-9c84-4671-a149-9b40846ed984
	echo	'Loading Linux 2.6.33.3-ssecem ...'
	linux	/boot/vmlinuz-2.6.33.3-ssecem root=/dev/sda1 ro single 
}
menuentry 'Debian GNU/Linux, with Linux 2.6.30.5-ssecem' --class debian --class gnu-linux --class gnu --class os {
	insmod part_msdos
	insmod ext2
	set root='(hd0,msdos1)'
	search --no-floppy --fs-uuid --set 8500d4d8-9c84-4671-a149-9b40846ed984
	echo	'Loading Linux 2.6.30.5-ssecem ...'
	linux	/boot/vmlinuz-2.6.30.5-ssecem root=/dev/sda1 ro  
}
menuentry 'Debian GNU/Linux, with Linux 2.6.30.5-ssecem (recovery mode)' --class debian --class gnu-linux --class gnu --class os {
	insmod part_msdos
	insmod ext2
	set root='(hd0,msdos1)'
	search --no-floppy --fs-uuid --set 8500d4d8-9c84-4671-a149-9b40846ed984
	echo	'Loading Linux 2.6.30.5-ssecem ...'
	linux	/boot/vmlinuz-2.6.30.5-ssecem root=/dev/sda1 ro single 
}
menuentry 'Debian GNU/Linux, with Linux 2.6.29.5-ssecem' --class debian --class gnu-linux --class gnu --class os {
	insmod part_msdos
	insmod ext2
	set root='(hd0,msdos1)'
	search --no-floppy --fs-uuid --set 8500d4d8-9c84-4671-a149-9b40846ed984
	echo	'Loading Linux 2.6.29.5-ssecem ...'
	linux	/boot/vmlinuz-2.6.29.5-ssecem root=/dev/sda1 ro  
}
menuentry 'Debian GNU/Linux, with Linux 2.6.29.5-ssecem (recovery mode)' --class debian --class gnu-linux --class gnu --class os {
	insmod part_msdos
	insmod ext2
	set root='(hd0,msdos1)'
	search --no-floppy --fs-uuid --set 8500d4d8-9c84-4671-a149-9b40846ed984
	echo	'Loading Linux 2.6.29.5-ssecem ...'
	linux	/boot/vmlinuz-2.6.29.5-ssecem root=/dev/sda1 ro single 
}
menuentry 'Debian GNU/Linux, with Linux 2.6.29.1-ssecem' --class debian --class gnu-linux --class gnu --class os {
	insmod part_msdos
	insmod ext2
	set root='(hd0,msdos1)'
	search --no-floppy --fs-uuid --set 8500d4d8-9c84-4671-a149-9b40846ed984
	echo	'Loading Linux 2.6.29.1-ssecem ...'
	linux	/boot/vmlinuz-2.6.29.1-ssecem root=/dev/sda1 ro  
}
menuentry 'Debian GNU/Linux, with Linux 2.6.29.1-ssecem (recovery mode)' --class debian --class gnu-linux --class gnu --class os {
	insmod part_msdos
	insmod ext2
	set root='(hd0,msdos1)'
	search --no-floppy --fs-uuid --set 8500d4d8-9c84-4671-a149-9b40846ed984
	echo	'Loading Linux 2.6.29.1-ssecem ...'
	linux	/boot/vmlinuz-2.6.29.1-ssecem root=/dev/sda1 ro single 
}
menuentry 'Debian GNU/Linux, with Linux 2.6.24.2' --class debian --class gnu-linux --class gnu --class os {
	insmod part_msdos
	insmod ext2
	set root='(hd0,msdos1)'
	search --no-floppy --fs-uuid --set 8500d4d8-9c84-4671-a149-9b40846ed984
	echo	'Loading Linux 2.6.24.2 ...'
	linux	/boot/vmlinuz-2.6.24.2 root=/dev/sda1 ro  
}
menuentry 'Debian GNU/Linux, with Linux 2.6.24.2 (recovery mode)' --class debian --class gnu-linux --class gnu --class os {
	insmod part_msdos
	insmod ext2
	set root='(hd0,msdos1)'
	search --no-floppy --fs-uuid --set 8500d4d8-9c84-4671-a149-9b40846ed984
	echo	'Loading Linux 2.6.24.2 ...'
	linux	/boot/vmlinuz-2.6.24.2 root=/dev/sda1 ro single 
}
menuentry 'Debian GNU/Linux, with Linux 2.6.23.12' --class debian --class gnu-linux --class gnu --class os {
	insmod part_msdos
	insmod ext2
	set root='(hd0,msdos1)'
	search --no-floppy --fs-uuid --set 8500d4d8-9c84-4671-a149-9b40846ed984
	echo	'Loading Linux 2.6.23.12 ...'
	linux	/boot/vmlinuz-2.6.23.12 root=/dev/sda1 ro  
}
menuentry 'Debian GNU/Linux, with Linux 2.6.23.12 (recovery mode)' --class debian --class gnu-linux --class gnu --class os {
	insmod part_msdos
	insmod ext2
	set root='(hd0,msdos1)'
	search --no-floppy --fs-uuid --set 8500d4d8-9c84-4671-a149-9b40846ed984
	echo	'Loading Linux 2.6.23.12 ...'
	linux	/boot/vmlinuz-2.6.23.12 root=/dev/sda1 ro single 
}
menuentry 'Debian GNU/Linux, with Linux 2.6.21.5' --class debian --class gnu-linux --class gnu --class os {
	insmod part_msdos
	insmod ext2
	set root='(hd0,msdos1)'
	search --no-floppy --fs-uuid --set 8500d4d8-9c84-4671-a149-9b40846ed984
	echo	'Loading Linux 2.6.21.5 ...'
	linux	/boot/vmlinuz-2.6.21.5 root=/dev/sda1 ro  
}
menuentry 'Debian GNU/Linux, with Linux 2.6.21.5 (recovery mode)' --class debian --class gnu-linux --class gnu --class os {
	insmod part_msdos
	insmod ext2
	set root='(hd0,msdos1)'
	search --no-floppy --fs-uuid --set 8500d4d8-9c84-4671-a149-9b40846ed984
	echo	'Loading Linux 2.6.21.5 ...'
	linux	/boot/vmlinuz-2.6.21.5 root=/dev/sda1 ro single 
}
menuentry 'Debian GNU/Linux, with Linux 2.6.21.5-old' --class debian --class gnu-linux --class gnu --class os {
	insmod part_msdos
	insmod ext2
	set root='(hd0,msdos1)'
	search --no-floppy --fs-uuid --set 8500d4d8-9c84-4671-a149-9b40846ed984
	echo	'Loading Linux 2.6.21.5-old ...'
	linux	/boot/vmlinuz-2.6.21.5-old root=/dev/sda1 ro  
}
menuentry 'Debian GNU/Linux, with Linux 2.6.21.5-old (recovery mode)' --class debian --class gnu-linux --class gnu --class os {
	insmod part_msdos
	insmod ext2
	set root='(hd0,msdos1)'
	search --no-floppy --fs-uuid --set 8500d4d8-9c84-4671-a149-9b40846ed984
	echo	'Loading Linux 2.6.21.5-old ...'
	linux	/boot/vmlinuz-2.6.21.5-old root=/dev/sda1 ro single 
}
### END /etc/grub.d/10_linux ###

### BEGIN /etc/grub.d/20_linux_xen ###
### END /etc/grub.d/20_linux_xen ###

### BEGIN /etc/grub.d/30_os-prober ###
### END /etc/grub.d/30_os-prober ###

### BEGIN /etc/grub.d/40_custom ###
# This file provides an easy way to add custom menu entries.  Simply type the
# menu entries you want to add after this comment.  Be careful not to change
# the 'exec tail' line above.
### END /etc/grub.d/40_custom ###

### BEGIN /etc/grub.d/41_custom ###
if [ -f  $prefix/custom.cfg ]; then
  source $prefix/custom.cfg;
fi
### END /etc/grub.d/41_custom ###
*********************** END /boot/grub/grub.cfg

-- System Information:
Debian Release: wheezy/sid
  APT prefers testing
  APT policy: (500, 'testing'), (500, 'stable'), (50, 'unstable')
Architecture: amd64 (x86_64)

Kernel: Linux 2.6.35.5-ssecem (SMP w/2 CPU cores; PREEMPT)
Locale: LANG=C, LC_CTYPE=fr_FR (charmap=ISO-8859-1)
Shell: /bin/sh linked to /bin/dash

Versions of packages grub-pc depends on:
ii  debconf [debconf-2.0]   1.5.38           Debian configuration management sy
ii  grub-common             1.98+20100804-14 GRand Unified Bootloader, version 
ii  libc6                   2.11.2-11        Embedded GNU C Library: Shared lib
ii  libdevmapper1.02.1      2:1.02.48-5      The Linux Kernel Device Mapper use
ii  ucf                     3.0025+nmu1      Update Configuration File: preserv

grub-pc recommends no packages.

Versions of packages grub-pc suggests:
ii  desktop-base                  6.0.5      common files for the Debian Deskto

-- debconf information:
  grub2/kfreebsd_cmdline:
  grub2/device_map_regenerated:
* grub2/linux_cmdline:
  grub-pc/install_devices_failed: false
* grub-pc/chainload_from_menu.lst: false
  grub-pc/kopt_extracted: true
  grub-pc/postrm_purge_boot_grub: false
  grub-pc/disk_description:
  grub2/kfreebsd_cmdline_default: quiet
* grub2/linux_cmdline_default:
  grub-pc/install_devices_empty: false
  grub-pc/install_devices:
  grub-pc/install_devices_failed_upgrade: true
  grub-pc/partition_description:
  grub-pc/install_devices_disks_changed:
  grub-pc/mixed_legacy_and_grub2: true
-------------- next part --------------
A non-text attachment was scrubbed...
Name: grub-install.diff
Type: text/x-diff
Size: 432 bytes
Desc: not available
URL: <http://lists.alioth.debian.org/pipermail/pkg-grub-devel/attachments/20110224/8107e839/attachment.diff>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://lists.alioth.debian.org/pipermail/pkg-grub-devel/attachments/20110224/8107e839/attachment.pgp>


More information about the Pkg-grub-devel mailing list