Now that x-loader on OMAP can boot from ext2, let's also teach kiwi about that
awesome new capability. This gets rid of the vfat dependency and makes the
whole bootstrap a lot cleaner.
Signed-off-by: Alexander Graf
---
modules/KIWIBoot.pm | 51 +++++++++++++++++++++++++++++++++++++++--------
modules/KIWILinuxRC.sh | 4 +-
2 files changed, 44 insertions(+), 11 deletions(-)
diff --git a/modules/KIWIBoot.pm b/modules/KIWIBoot.pm
index 88d8d41..21b623c 100644
--- a/modules/KIWIBoot.pm
+++ b/modules/KIWIBoot.pm
@@ -1711,7 +1711,7 @@ sub setupBootDisk {
# setup boot partition type
#------------------------------------------
my $partid = 83;
- if ($bootloader =~ /syslinux|uboot/) {
+ if ($bootloader =~ /syslinux/) {
$partid = "c";
} elsif ($bootloader eq "yaboot") {
$partid = "41";
@@ -2224,7 +2224,7 @@ sub setupBootDisk {
if ($lvm) {
$boot = $deviceMap{0};
}
- if ($bootloader =~ /syslinux|uboot|yaboot/) {
+ if ($bootloader =~ /syslinux|yaboot/) {
$kiwi -> info ("Creating DOS boot filesystem");
if ($bootloader eq "yaboot") {
$status = qxx ("/sbin/mkdosfs -F 16 $boot 2>&1");
@@ -3904,8 +3904,8 @@ sub setupBootLoaderConfiguration {
print FD 'setenv initrd_high "0xffffffff";'."\n";
print FD 'setenv fdt_high "0xffffffff";'."\n";
print FD 'setenv bootcmd "';
- print FD 'fatload mmc 0:1 0x80000000 boot/linux.vmx; ';
- print FD 'fatload mmc 0:1 0x81600000 boot/initrd.uboot; ';
+ print FD 'ext2load mmc 0:1 0x80000000 boot/linux.vmx; ';
+ print FD 'ext2load mmc 0:1 0x81600000 boot/initrd.uboot; ';
print FD 'bootm 0x80000000 0x81600000";'."\n";
if ($type =~ /^KIWI CD/) {
$kiwi -> failed ();
@@ -4464,7 +4464,44 @@ sub installBootLoader {
# install uboot
#------------------------------------------
if ($loader eq "uboot") {
- # uboot loader doesn't get installed
+ if (! $deviceMap) {
+ $kiwi -> failed ();
+ $kiwi -> error ("No device map available");
+ $kiwi -> failed ();
+ return;
+ }
+ my %deviceMap = %{$deviceMap};
+ my $device = $deviceMap{$bootpart+1};
+
+ #==========================================
+ # mount boot device...
+ #------------------------------------------
+ $status = qxx ("mount $device /mnt 2>&1");
+ $result = $? >> 8;
+ if ($result != 0) {
+ $kiwi -> failed ();
+ $kiwi -> error ("Can't mount boot partition: $status");
+ $kiwi -> failed ();
+ $this -> cleanLoop ();
+ return;
+ }
+ #==========================================
+ # install MLO as raw
+ #------------------------------------------
+ if (-f "/mnt/boot/MLO") {
+ $kiwi -> info ("Installing MLO on device: $diskname");
+ $status = qxx ("dd if=/mnt/boot/MLO of=$diskname bs=128k count=1 seek=1 conv=notrunc 2>&1");
+ $result = $? >> 8;
+ if ($result != 0) {
+ $kiwi -> failed ();
+ $kiwi -> error ("Couldn't install MLO on $diskname: $status");
+ $kiwi -> failed ();
+ qxx ("umount /mnt 2>&1");
+ $this -> cleanLoop ();
+ return;
+ }
+ }
+ qxx ("umount /mnt 2>&1");
}
#==========================================
# more boot managers to come...
@@ -5496,10 +5533,6 @@ sub __getBootSize {
if ($gotMB < $minMB) {
$gotMB = $minMB;
}
- # on arm it's required to have a maximum of 64MB for the boot part
- if ($arch =~ /arm/) {
- $gotMB = 64;
- }
$kiwi -> loginfo ("Set boot space to: ".$gotMB."M\n");
return $gotMB;
}
diff --git a/modules/KIWILinuxRC.sh b/modules/KIWILinuxRC.sh
index 70e2688..6f37c6f 100644
--- a/modules/KIWILinuxRC.sh
+++ b/modules/KIWILinuxRC.sh
@@ -1544,8 +1544,8 @@ function setupBootLoaderUBoot {
echo "setenv initrd_high \"0xffffffff\";" >> $conf
echo "setenv fdt_high \"0xffffffff\";" >> $conf
echo -n "setenv bootcmd \"" >> $conf
- echo -n "fatload mmc 0:1 0x80000000 $kernel; " >> $conf
- echo -n "fatload mmc 0:1 0x81600000 $initrd; " >> $conf
+ echo -n "ext2load mmc 0:1 0x80000000 $kernel; " >> $conf
+ echo -n "ext2load mmc 0:1 0x81600000 $initrd; " >> $conf
echo "bootm 0x80000000 0x81600000\""
echo -n "setenv bootargs root=$diskByID loader=$loader" >> $conf
if [ ! -z "$imageDiskDevice" ];then
--
1.6.0.2
--
To unsubscribe, e-mail: opensuse-arm+unsubscribe@opensuse.org
To contact the owner, e-mail: opensuse-arm+owner@opensuse.org