Bug 607480

Summary: Error writing grub at end of stage 1 -> unbootable system
Product: [openSUSE] openSUSE 11.3 Reporter: Holger Sickenberg <holgi>
Component: InstallationAssignee: Ruediger Oertel <ro>
Status: RESOLVED FIXED QA Contact: Jiri Srain <jsrain>
Severity: Critical    
Priority: P5 - None CC: aschnell, duwe, hannsj_uhl, novellbmw, ro
Version: FactoryFlags: coolo: SHIP_STOPPER+
Target Milestone: ---   
Hardware: All   
OS: openSUSE 11.3   
Whiteboard:
Found By: Component Test Services Priority:
Business Priority: Blocker: Yes
Marketing QA Status: --- IT Deployment: ---
Attachments: y2logs.tgz

Description Holger Sickenberg 2010-05-20 11:39:30 UTC
Created attachment 363479 [details]
y2logs.tgz

At end of stage 1 installer is unable to install grub. Reason is that /boot/grub/ do not contain the necessary files (from /usr/lib/grub/). Maybe the necessary post install script did not run.

ls -al /boot/grub/
total 24
drwxr-xr-x 2 root root 4096 2010-05-20 13:18 .
drwxr-xr-x 3 root root 4096 2010-05-20 13:03 ..
-rw------- 1 root root  109 2010-05-20 13:18 device.map
-rw-r--r-- 1 root root  108 2010-05-20 12:46 device.map.old
-rw------- 1 root root 1129 2010-05-20 13:04 menu.lst
-rw-r--r-- 1 root root  930 2010-05-20 12:46 menu.lst.old
Comment 1 Torsten Duwe 2010-05-20 12:35:55 UTC
Rudi, could this possibly be due to the latest spec-file change that does not run %post under some circumstances?
Comment 2 Ruediger Oertel 2010-05-20 16:38:48 UTC
I don't really see how.
the line reads:
  test ! -e /.buildenv || exit 0

unless that file is present on the target machine (and who would create
such a file in / of his system), this should never exit outside of
the build environment.
Comment 3 Arvin Schnell 2010-05-20 16:41:30 UTC
grub is included in the images copied to disk. So the new check in the post
install script is the culprit if the file /.buildenv exists during creation
of those images.

Disabling installation from images circumvents the bug.
Comment 4 Stephan Kulow 2010-05-21 04:59:50 UTC
this bug also affects the live cds - they are build in build environment too ;(
Comment 5 Ruediger Oertel 2010-05-21 08:42:46 UTC
well, looks like that postinstall needs revisiting, for M7 let's live with
the previous variant.
Comment 7 Ruediger Oertel 2010-05-21 10:13:45 UTC
osc rq 40466 created:


+Fri May 21 12:07:18 CEST 2010 - ro@suse.de
+
+- fix the post-install again, can not just disable in buildenv
+  for image-building reasons
+- make sure all lines in post-install have a clean exit status,
+  "test $condition && echo" constructs should not be used,
+  replaced by if..then..fi instead
+- test if xfs_freeze is available before calling it

 %post
-test ! -e /.buildenv || exit 0
 # should anything go wrong the system will remain bootable :
-[ -e /boot/grub/stage2 ] && mv /boot/grub/stage2{,.old}
+if [ -e /boot/grub/stage2 ] ; then
+       mv /boot/grub/stage2{,.old}
+fi
 # copy especially stage2 over, because it will be modified in-place !
 cp -p /usr/lib/grub/*stage1*   /boot/grub 2>/dev/null || true
 %install_info --info-dir=%{_infodir} %{_infodir}/%{name}.info.gz
@@ -234,14 +235,19 @@
 # sync may take much longer on XFS (Bug#223773)
 bootpart=`df /boot/. | perl -ane '$F[0] =~ m,/dev/[^\s]*, && print $F[0]'`
 eval `/sbin/blkid -u filesystem -o udev $bootpart`
-if [ "X$ID_FS_TYPE" = "X" -o "t_$ID_FS_TYPE" = "t_xfs" ]; then
+XFS_FREEZE=`type -p xfs_freeze` || true
+if [ -n "$XFS_FREEZE" ] ; then
+  if [ "X$ID_FS_TYPE" = "X" -o "t_$ID_FS_TYPE" = "t_xfs" ]; then
        sync; sleep 5; sync; sleep 5; sync
        (xfs_freeze -f /; xfs_freeze -f /boot) > /dev/null 2>&1
        (xfs_freeze -u /; xfs_freeze -u /boot) > /dev/null 2>&1
+  fi
 fi
 # command sequence to update-install stage1/stage2.
 # leave everything else alone !
-[ -e /etc/grub.conf ] && /usr/sbin/grub --batch < /etc/grub.conf >/dev/null 2>&1
+if [ -e /etc/grub.conf ] ; then
+       /usr/sbin/grub --batch < /etc/grub.conf >/dev/null 2>&1
+fi
 exit 0
Comment 9 Bernhard Wiedemann 2010-05-24 04:00:14 UTC
while this was fixed/working in MS7 (Build0625), it started failing again in the next LiveCD Build0626:
http://www3.zq1.de/opensuse/video/openSUSE-KDE-LiveCD-x86_64-Build0626a.ogv
Comment 10 Bernhard Wiedemann 2010-05-24 18:53:48 UTC
tested working again in Build0629