update-initramfs, wubi: bad check for read-only /boot partition

Bug #183807 reported by Jonas Weinen
2
Affects Status Importance Assigned to Milestone
initramfs-tools (Ubuntu)
Fix Released
Undecided
Unassigned

Bug Description

Binary package hint: initramfs-tools

This bug appears on a gutsy wubi installation, but I think it is a general problem in update-initramfs (version 0.85eubuntu20).

EDIT: Debian already fixed this. See Debian bug #451151

update-initramfs checks whether /boot is mounted read-only with this awk line (l. 263-264):

> (awk '/boot/{if (match($4, /ro/) && $2 == "/boot") print "ro"}' /proc/mounts

However, on my machine the corresponding line in /proc/mounts says:

> /dev/disk/by-uuid/6C44DC2444DBEF38 /boot fuseblk rw,nosuid,nodev,noatime,user_id=0,group_id=0,allow_other 0 0

I'm not an expert in awk, but I think it is matching the 'ro' from 'gROup'. The result is that update-initramfs refuses to work:

> sudo update-initramfs -vu
> WARNING: /boot is ro mounted.
> update-initramfs: Not updating /boot/initrd.img-2.6.22-14-generic

An ugly fix would be to match the pattern /^ro/ because all mounts in /proc/mounts seem to have the rw/ro state in the first position, but there is probably a more elegant way.

In ver 0.85eubuntu21 = current hardy package, it is still the same.

Jonas Weinen (weinen)
description: updated
Revision history for this message
Igor Kolker (igor-kolker) wrote :

running 8.04 server and was getting same thing with

UUID=f13f0150-047b-40bc-abb9-64e8d43a5e09 /boot ext2 suid,errors=remount-ro,dev,exec 0 2

the string in /usr/sbin/update-initramfs was

boot_opts=$(awk '/boot/{if (match($4, /([^a-zA-Z0-9]|^)ro([^a-zA-Z0-9]|$)/) && $2 == "/boot") print "ro"}' /proc/mounts)

I added "\-"

boot_opts=$(awk '/boot/{if (match($4, /([^a-zA-Z0-9\-]|^)ro([^a-zA-Z0-9]|$)/) && $2 == "/boot") print "ro"}' /proc/mounts)

its it no longer picks up the "remount-ro"

Revision history for this message
Jonas Weinen (weinen) wrote :

This is fixed in Hardy and can be closed.

Daniel T Chen (crimsun)
Changed in initramfs-tools:
status: New → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.