Skip to content

Commit

Permalink
gen_loader.py: make the secondary partition table optional
Browse files Browse the repository at this point in the history
If --img_prm_ptable and --img_sec_ptable options are passed, primary
and secondary ptable are generated.

If only --img_prm_ptable option is passed, only the primary ptable is
generated.

Signed-off-by: Haojian Zhuang <[email protected]>
  • Loading branch information
hzhuang1 authored and fboudra committed Jun 28, 2015
1 parent 5f9a3a0 commit 09a7f00
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions gen_loader.py
Original file line number Diff line number Diff line change
Expand Up @@ -213,11 +213,17 @@ def create_stage2(self, img_prm_ptable, img_sec_ptable, output_img):
self.stage = 2
self.parse(img_prm_ptable)
self.add(self.ptable_lba, img_prm_ptable)
self.add(self.stable_lba, img_sec_ptable)
if (cmp(img_sec_ptable, 'secondary partition table')):
# Doesn't match. It means that secondary ptable is specified.
self.add(self.stable_lba, img_sec_ptable)
else:
print 'Don\'t need secondary partition table'

def main(argv):
stage1 = 0
stage2 = 0
img_prm_ptable = "primary partition table"
img_sec_ptable = "secondary partition table"
try:
opts, args = getopt.getopt(argv,"ho:",["img_loader=","img_bl1=","img_prm_ptable=","img_sec_ptable="])
except getopt.GetoptError:
Expand All @@ -240,7 +246,6 @@ def main(argv):
stage2 = 1
elif opt in ("--img_sec_ptable"):
img_sec_ptable = arg
stage2 = 1

loader = generator(output_img)
loader.idx = 0
Expand Down

0 comments on commit 09a7f00

Please sign in to comment.