Modify

Opened 8 years ago

Last modified 8 years ago

#41 accepted defect

Add support for boot flag

Reported by: dmontaldo@dc.uba.ar Owned by: bas
Priority: major Milestone:
Component: sali Version: trunk
Keywords: debian Cc:

Description

Hi, for some reason if you deploy an image with Debian, it doesn't boot a partition with out the boot flag on.

Could you take a look at this patch?
At least it works for me.
Thanks.

$ svn diff initrd/functions/stubs/disks
Index: initrd/functions/stubs/disks
===================================================================
--- initrd/functions/stubs/disks        (revision 511)
+++ initrd/functions/stubs/disks        (working copy)
@@ -420,7 +426,8 @@
                        LABEL=""
                fi
 
-               ## There is an exception for grub2
+               ## There is an exception for grub2 and root with boot flag
                #
                case "$TYPE" in
 

@@ -429,8 +436,15 @@
 				parted -s -- $DISK set $NUMPARTITIONS bios_grub on || shellout
 			;;
 
 			*) 
 				create_filesystem $PARTITION $TYPE $LABEL
+				if [ $MOUNTPATH == "/" ]; then
+					# set partition flag state on /
+					logmsg "   detected mount path = / trying to set boot flag on"
+					logmsg "   parted -s -- $DISK set $NUMPARTITIONS boot on"
+					parted -s -- $DISK set $NUMPARTITIONS boot on || shellout
+				fi
 			;;
 		esac
 

Thanks

Attachments (0)

Change History (9)

comment:1 Changed 8 years ago by bas

  • Owner changed from somebody to bas
  • Status changed from new to accepted

first of all thanks for the patch. We will look into it. We also use Debian and did not encounter any problems so far. What Debian distro do you run?

comment:2 follow-up: Changed 8 years ago by bas

first of all thanks for the patch. We will look into it. We also use Debian and did not encounter any problems so far. What Debian distro do you run?

comment:3 in reply to: ↑ 2 Changed 8 years ago by anonymous

Replying to bas:

first of all thanks for the patch. We will look into it. We also use Debian and did not encounter any problems so far. What Debian distro do you run?

I tried it with stable (squeeze) and now with testing (wheezy) because I need to install nvidia drivers for tesla GPUs

comment:4 follow-up: Changed 8 years ago by bas

What is your partition layout. Do you use a separate partition for grub? or did you enabled multi-boot? Can you send your partition schema. Else we have to add a function that set the boot flag or add an extra argument to the partition function.

comment:5 follow-up: Changed 8 years ago by bas

Just another question what type of DISKLABEL do you use? MSDOS or another type?

comment:6 Changed 8 years ago by dennis

  • Priority changed from critical to major

comment:7 in reply to: ↑ 4 Changed 8 years ago by dmontaldo@dc.uba.ar

Replying to bas:

What is your partition layout.
Do you use a separate partition for grub?

The layout that I'm trying to use is this:

partition  $DISK0 1024:ext2:/boot:boot 4096:swap::swap 51200:ext3:/:root 10240:ext3:/tmp:tmp 20480:ext3:/var:var 51200:ext3:/usr:usr 102400:ext3:/opt:opt 0:ext3:/scratch:scratch

But I also I tried with only one partition too and it fails

partition $DISK0 4096:swap::swap 51200:ext3:/:root

or did you enabled multi-boot?

No, only one OS with debian.

Else we have to add a function that set the boot flag or add an extra argument to the partition function.

I started modifying the code to add a new extra argument but then I realize that the only partition that needs the boot flag on was the root or /
If you think that this is a better idea I think I still have that path somewhere.

comment:8 in reply to: ↑ 5 Changed 8 years ago by dmontaldo@dc.uba.ar

Replying to bas:

Just another question what type of DISKLABEL do you use? MSDOS or another type?

I tried with both, msdos and gpt disk fails too.

comment:9 Changed 8 years ago by dmontaldo@dc.uba.ar

Finally I use the sali binaries and wrote an ad-hoc post-install script to set the boot flag on hard coding the number of the root partition.

# Author: Damian Montaldo (dmontaldo@dc.uba.ar)
# Date  : 12 Jul 2012
# Desc. : This will set the boot flag on (see ticket #41 in SALI)

# Get the Systemimager variables
. /tmp/post-install/variables.txt

echo "setting up the boot flag on"

/sbin/parted --script -- $DISK0 set 4 boot on

The only problem was that I must install parted inside the image because I realize that the post-install script runs inside the chrooted environment.

Thanks for your help.

Add Comment

Modify Ticket

Change Properties
Action
as accepted The owner will remain bas.
as The resolution will be set. Next status will be 'closed'.
to The owner will be changed from bas to the specified user. Next status will be 'assigned'.
The owner will be changed from bas to anonymous. Next status will be 'accepted'.
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.