palo: place iplboot inside disk label if it's big enough
PATCH 1/1 palo: place iplboot inside disk label if it's big enough
Ever since the widespread adoption of gpt and 4k emulation disks, we've been starting the first partition at sector 2048 instead of 63. Since we only need 512 sectors for iplboot, this offers the opportunity of placing iplboot directly inside the disk label.
The way this patch works is that if no palo (F0) partition is found and the first partition starts high enough, initialise the disk with the ipl boot just below the first partition. If the disk isn't big enough, error out as previously and if an F0 partition is found, proceed as usual.
Signed-off-by James Bottomley <[email protected]>
--- ipl/ipl.c | 11 +++++++++-- palo/palo.c | 53 ++++++++++++++++++++++++++++++++++++++++++++++++----- 2 files changed, 57 insertions(+), 7 deletions(-)
ipl/ipl.c +9 -2
@@ -486,6 +486,7 @@ iplmain(int is_interactive, char *initialstackptr, int started_wide)char kern_name[128 ], rd_name[128 ];char kern_fullname[128 +10 ];int ok =1 ; +const char *str;/* BSS clear */ bzero (&_edata, &_end - &_edata);
@@ -527,8 +528,14 @@ iplmain(int is_interactive, char *initialstackptr, int started_wide)print_ptab_pretty (partition,sizeof partition /sizeof partition[0 ]); } -printf ("\n%s contains:\n" , - partitioned ?"PALO(F0) partition" :"Boot image" ); +if (partitioned && f.ipl_addr < partition[0 ].start *512 ) + str ="PALO within boot label" ; +else if (partitioned) + str ="PALO(F0) partition" ; +else + str ="Boot image" ; + +printf ("\n%s contains:\n" , str);if (partitioned && f.version >=4 && (f.flags &PFLAG_EXT2 )) {printf ("PALO is formatted EXT2/3\n" );
palo/palo.c +48 -5
76 lines not on this page · raw message
Signature · 1 line
2.16.4