sector_size = info->blksz;
hdr_sectors = DIV_ROUND_UP(sizeof(struct andr_img_hdr), sector_size);
if (hdr_sectors == 0) {
- pr_err("invalid number of boot sectors: 0");
+ pr_err("invalid number of boot sectors: 0\n");
fastboot_fail("invalid number of boot sectors: 0", response);
return 0;
}
/* Read the boot image header */
res = blk_dread(dev_desc, info->start, hdr_sectors, (void *)hdr);
if (res != hdr_sectors) {
- pr_err("cannot read header from boot partition");
+ pr_err("cannot read header from boot partition\n");
fastboot_fail("cannot read header from boot partition",
response);
return 0;
/* Check boot header magic string */
res = android_image_check_header(hdr);
if (res != 0) {
- pr_err("bad boot image magic");
+ pr_err("bad boot image magic\n");
fastboot_fail("boot partition not initialized", response);
return 0;
}
/* Get boot partition info */
res = part_get_info_by_name(dev_desc, BOOT_PARTITION_NAME, &info);
if (res < 0) {
- pr_err("cannot find boot partition");
+ pr_err("cannot find boot partition\n");
fastboot_fail("cannot find boot partition", response);
return -1;
}
/* Read boot image header */
hdr_sectors = fb_mmc_get_boot_header(dev_desc, &info, hdr, response);
if (hdr_sectors == 0) {
- pr_err("unable to read boot image header");
+ pr_err("unable to read boot image header\n");
fastboot_fail("unable to read boot image header", response);
return -1;
}
/* Check if boot image has second stage in it (we don't support it) */
if (hdr->second_size > 0) {
- pr_err("moving second stage is not supported yet");
+ pr_err("moving second stage is not supported yet\n");
fastboot_fail("moving second stage is not supported yet",
response);
return -1;
res = blk_dread(dev_desc, ramdisk_sector_start, ramdisk_sectors,
ramdisk_buffer);
if (res != ramdisk_sectors) {
- pr_err("cannot read ramdisk from boot partition");
+ pr_err("cannot read ramdisk from boot partition\n");
fastboot_fail("cannot read ramdisk from boot partition",
response);
return -1;
hdr->kernel_size = download_bytes;
res = blk_dwrite(dev_desc, info.start, hdr_sectors, (void *)hdr);
if (res == 0) {
- pr_err("cannot writeback boot image header");
+ pr_err("cannot writeback boot image header\n");
fastboot_fail("cannot write back boot image header", response);
return -1;
}
res = blk_dwrite(dev_desc, kernel_sector_start, kernel_sectors,
download_buffer);
if (res == 0) {
- pr_err("cannot write new kernel");
+ pr_err("cannot write new kernel\n");
fastboot_fail("cannot write new kernel", response);
return -1;
}
res = blk_dwrite(dev_desc, ramdisk_sector_start, ramdisk_sectors,
ramdisk_buffer);
if (res == 0) {
- pr_err("cannot write back original ramdisk");
+ pr_err("cannot write back original ramdisk\n");
fastboot_fail("cannot write back original ramdisk", response);
return -1;
}
struct mmc *mmc = find_mmc_device(CONFIG_FASTBOOT_FLASH_MMC_DEV);
if (mmc == NULL) {
- pr_err("invalid mmc device");
+ pr_err("invalid mmc device\n");
fastboot_fail("invalid mmc device", response);
return;
}
dev_desc = blk_get_dev("mmc", CONFIG_FASTBOOT_FLASH_MMC_DEV);
if (!dev_desc || dev_desc->type == DEV_TYPE_UNKNOWN) {
- pr_err("invalid mmc device");
+ pr_err("invalid mmc device\n");
fastboot_fail("invalid mmc device", response);
return;
}
ret = part_get_info_by_name_or_alias(dev_desc, cmd, &info);
if (ret < 0) {
- pr_err("cannot find partition: '%s'", cmd);
+ pr_err("cannot find partition: '%s'\n", cmd);
fastboot_fail("cannot find partition", response);
return;
}
blks = blk_derase(dev_desc, blks_start, blks_size);
if (blks != blks_size) {
- pr_err("failed erasing from device %d", dev_desc->devnum);
+ pr_err("failed erasing from device %d\n", dev_desc->devnum);
fastboot_fail("failed erasing from device", response);
return;
}