[inari] unable to build B2G from source. Lost boot.img & recovery.img

NEW
Assigned to

Status

Firefox OS
General
3 years ago
2 years ago

People

(Reporter: pazos, Assigned: pazos)

Tracking

(Blocks: 4 bugs)

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment, 1 obsolete attachment)

(Assignee)

Description

3 years ago
User Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/31.0.1650.63 Safari/537.36

Steps to reproduce:

I tried to build B2G for ZTE Open (as inari) but it can't generate needed boot.img & recovery.img


Actual results:

No recovery.img or boot.img are generated


Expected results:

boot.img & recovery.img are generated from B2G build
(Assignee)

Comment 1

3 years ago
Created attachment 8377847 [details] [diff] [review]
build boot.img & recovery.img from B2G sources

a simple (and hackish) way to pull relevant files from boot.img (kernel, some init scripts and binaries for things like charger animation when phone is off).

this contains a folder called prebuilt/ with two patches: one for modifying init.b2g.rc (disable rilproxy, which is built in the kernel) the other one for modifying init.rc (give executable permissions to binaries under /system/b2g/)

Worked ok for my builds in both v1.3 & master. patching init.b2g.rc in v1.2 branch fails because the patch was made against v1.3 file and service nfcd was
added too)
(Assignee)

Updated

3 years ago
Blocks: 945124
(Assignee)

Updated

3 years ago
Blocks: 925502, 942278
(Assignee)

Updated

3 years ago
Blocks: 965180
(Assignee)

Comment 2

3 years ago
Created attachment 8380830 [details] [diff] [review]
enable boot.img  generation from  B2G sources (pulling blobs from device)

make it compatible with builds from 1.0.1 boot.img
Attachment #8377847 - Attachment is obsolete: true
Comment on attachment 8380830 [details] [diff] [review]
enable boot.img  generation from  B2G sources (pulling blobs from device)

Review of attachment 8380830 [details] [diff] [review]:
-----------------------------------------------------------------

Just doing some comments.

::: inari-original/prebuilt/fix_permissions.patch
@@ +8,5 @@
> ++    chmod 0755 /system/b2g/updater
> ++    chmod 0755 /system/b2g/plugin-container
> +     mount yaffs2 mtd@system /system ro remount
> +     mount yaffs2 mtd@userdata /data nosuid nodev
> +     mount yaffs2 mtd@persist /persist nosuid nodev

We should stop setting permissions in init.rc, and rather use the correct fs_config binary. See the hamachi tree, it does it correctly.
Without using the correct fs_config binary, we will produce broken OTA/FOTA packages (permissions will not be set correctly on binaries).
(Assignee)

Comment 4

3 years ago
sorry but looking at hamachi tree in https://github.com/mozilla-b2g/android-device-hamachi I can't find any command related to fs_config. I understand that fs_config binary is used to give right permissions to binaries and libraries after the build and before images were created.

One question: Does "FOTA updates" upgrade the boot partition (boot.img)?
Flags: needinfo?(lissyx+mozillians)
Woo, looks like my reply to this comment has been lost in the cyberspace.

So, fs_config is part of system/core code [https://github.com/mozilla-b2g/platform_system_core/], and we have the correct configuration tracked on the b2g branch: https://github.com/mozilla-b2g/platform_system_core/blob/b2g/include/private/android_filesystem_config.h#L177

So if you look into the hamachi's manifest, you should see we use this repo for system/core rather than AOSP :)
Flags: needinfo?(lissyx+mozillians)
Using the correct system/core repository is documented in bug 952535

Meanwhile, pazos, you probably want a review from Michael Wu :)
Flags: needinfo?(paziusss)
(Assignee)

Comment 7

3 years ago
Hi Alexandre, thanks for your support, we can also avoid patching init.b2g.rc (needed cause rilproxy is integrated on kernel for inari devices) if we change gonk-misc/b2g.mk in order to build rilproxy if the build is not for zte open.

attached patch works for me, but it relays on abootimg binary to extract boot.img files, I'm cleaning the extract-files.sh to make the patch a little less hackish :) and use out/host/linux-x86/bin tools instead.
Flags: needinfo?(paziusss)
(In reply to pazos from comment #7)
> Hi Alexandre, thanks for your support, we can also avoid patching
> init.b2g.rc (needed cause rilproxy is integrated on kernel for inari
> devices) if we change gonk-misc/b2g.mk in order to build rilproxy if the
> build is not for zte open.

I'm not 100% sure of what happens in this case.

> 
> attached patch works for me, but it relays on abootimg binary to extract
> boot.img files, I'm cleaning the extract-files.sh to make the patch a little
> less hackish :) and use out/host/linux-x86/bin tools instead.

That would be awesome
Pazos, you should open a pull request for your fix, and set the review flag, asking someone to check this. I would suggest putting Michael Wu (:mwu) in review.
Status: UNCONFIRMED → NEW
Ever confirmed: true
Flags: needinfo?(paziusss)
Assignee: nobody → paziusss
Flags: needinfo?(paziusss)
You need to log in before you can comment on or make changes to this bug.