public inbox for gentoo-soc@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-soc] Application for Google Summer of Code 2018-Mishal Roy
@ 2018-03-21 17:51 Mishal Roy
  2018-03-22  4:07 ` Benda Xu
  0 siblings, 1 reply; 10+ messages in thread
From: Mishal Roy @ 2018-03-21 17:51 UTC (permalink / raw
  To: gentoo-soc, heroxbd


[-- Attachment #1.1: Type: text/plain, Size: 272 bytes --]

Hi,

As a proof of my proposed concept I have written a kernel ebuild which
successfully builds x86 linux kernel from source code present in
/usr/src/linux directory of Gentoo liveDVD. I have attached the ebuild and
images related to it.


Thanks and Regards,
Mishal Roy.

[-- Attachment #1.2: Type: text/html, Size: 370 bytes --]

[-- Attachment #2: x86kernelbuild-1.0.ebuild --]
[-- Type: application/octet-stream, Size: 300 bytes --]

# Copyright 1999-2015 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2

EAPI=0

DESCRIPTION="This is an ebuild that compiles x86 linux kernel"

SLOT="0"
KEYWORDS="~x86"

pkg_preinst()
{
cd /usr/src/linux
make ARCH=x86 i386_defconfig
make && make modules_install
}

[-- Attachment #3: ebuild.png --]
[-- Type: image/png, Size: 145063 bytes --]

[-- Attachment #4: ebuild2.png --]
[-- Type: image/png, Size: 698115 bytes --]

[-- Attachment #5: ebuild3.png --]
[-- Type: image/png, Size: 619964 bytes --]

[-- Attachment #6: ebuild4.png --]
[-- Type: image/png, Size: 646940 bytes --]

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [gentoo-soc] Application for Google Summer of Code 2018-Mishal Roy
  2018-03-21 17:51 [gentoo-soc] Application for Google Summer of Code 2018-Mishal Roy Mishal Roy
@ 2018-03-22  4:07 ` Benda Xu
  2018-03-22 15:16   ` Mishal Roy
  2018-03-22 15:25   ` Rich Freeman
  0 siblings, 2 replies; 10+ messages in thread
From: Benda Xu @ 2018-03-22  4:07 UTC (permalink / raw
  To: Mishal Roy; +Cc: gentoo-soc

Hi Mishal,

Mishal Roy <roymishal210@gmail.com> writes:

> As a proof of my proposed concept I have written a kernel ebuild which
> successfully builds x86 linux kernel from source code present in
> /usr/src/linux directory of Gentoo liveDVD. I have attached the ebuild
> and images related to it.

Thank you for trying this out.  

You still have a lot to learn about the basics of ebuild.  Alice is on
the Kernel Team.  She might have more to comment.

> x86kernelbuild-1.0.ebuild

The version number should be the same as upstream.  No
architecture-specific name, like 'x86, should be used in the name.

> EAPI=0

EAPI=0 is no longer encourage in Gentoo.  Check out EAPI-6

> DESCRIPTION="This is an ebuild that compiles x86 linux kernel"

> SLOT="0"

> KEYWORDS="~x86"

> pkg_preinst()

pkg_preinst is not used like this.  Check out src_compile.

> 
> {
> cd /usr/src/linux
> make ARCH=x86 i386_defconfig
> make && make modules_install
> }

> builds x86 linux kernel from source code present in /usr/src/linux
> directory of Gentoo liveDVD

This is not how Gentoo ebuild works, the build should prepare the source
code.


Kernel is a specific piece of software.  Traditionally users take care
of the final installation.  But there is a genkernel helper to automate
the process.  Please check out

  https://wiki.gentoo.org/wiki/Genkernel

for inspirations.


Cheers,
Benda


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [gentoo-soc] Application for Google Summer of Code 2018-Mishal Roy
  2018-03-22  4:07 ` Benda Xu
@ 2018-03-22 15:16   ` Mishal Roy
  2018-03-23  0:47     ` Benda Xu
  2018-03-22 15:25   ` Rich Freeman
  1 sibling, 1 reply; 10+ messages in thread
From: Mishal Roy @ 2018-03-22 15:16 UTC (permalink / raw
  To: Benda Xu; +Cc: gentoo-soc

[-- Attachment #1: Type: text/plain, Size: 3250 bytes --]

Hi,

Yes I will download the Xiaomi boot image by ebuild.

I had proposed this small project so that it can be successfully completed
within the time frame of three months.
Eliminating the concept of boot image is feasible.
If you recommend, I would like to extend my proposal by adding it.
Aboot the application bootloader of Redmi Note 4 reads boot image and loads
kernel+ramdisk into RAM.
On the other hand, bootloader on computer reads kernel and ramdisk ,and
loads those into RAM.
We can make Aboot function like a computer bootloader by editing its source
code [1].
However we will require Xiaomi's permission  to allow us install the newly
built Aboot because Aboot gets checked by SBL(Secondary boot loader) [2].

I recently got familiar with basics of Gentoo.
I have been using Ubuntu since 2 years.
I have Ubuntu on my desktop computer and laptop.
I use Ubuntu for compiling ASM, C and MATLAB codes.
I also use it for running Guitarix,Rakarrack ( virtual guitar amplifiers)
and Audacity sound recorder.
Through Ubuntu I got to know about initramfs as well as list of services
that are started by sysvinit and upstart.
i.e. udev, pulseaudio , x-sever, lightdm, dbus, cron etc.
I have experimented with these sevices by starting and stopping.
I have not contributed to any community or solved bugs so far.
I have Dell Venue 7 3740 which is an Intel powered Android device.This
device is my main device for Android development.
https://opensource.dell.com/releases/Venue_7_3740_Merrifield/developer-edition/A195/

1. https://www.tldp.org/HOWTO/SRM-HOWTO/aboot.html
2.
https://forum.xda-developers.com/android/general/info-android-device-partitions-basic-t3586565/amp/

Thanks and Regards,
Mishal Roy.

On Thu, Mar 22, 2018 at 9:37 AM, Benda Xu <heroxbd@gentoo.org> wrote:

> Hi Mishal,
>
> Mishal Roy <roymishal210@gmail.com> writes:
>
> > As a proof of my proposed concept I have written a kernel ebuild which
> > successfully builds x86 linux kernel from source code present in
> > /usr/src/linux directory of Gentoo liveDVD. I have attached the ebuild
> > and images related to it.
>
> Thank you for trying this out.
>
> You still have a lot to learn about the basics of ebuild.  Alice is on
> the Kernel Team.  She might have more to comment.
>
> > x86kernelbuild-1.0.ebuild
>
> The version number should be the same as upstream.  No
> architecture-specific name, like 'x86, should be used in the name.
>
> > EAPI=0
>
> EAPI=0 is no longer encourage in Gentoo.  Check out EAPI-6
>
> > DESCRIPTION="This is an ebuild that compiles x86 linux kernel"
>
> > SLOT="0"
>
> > KEYWORDS="~x86"
>
> > pkg_preinst()
>
> pkg_preinst is not used like this.  Check out src_compile.
>
> >
> > {
> > cd /usr/src/linux
> > make ARCH=x86 i386_defconfig
> > make && make modules_install
> > }
>
> > builds x86 linux kernel from source code present in /usr/src/linux
> > directory of Gentoo liveDVD
>
> This is not how Gentoo ebuild works, the build should prepare the source
> code.
>
>
> Kernel is a specific piece of software.  Traditionally users take care
> of the final installation.  But there is a genkernel helper to automate
> the process.  Please check out
>
>   https://wiki.gentoo.org/wiki/Genkernel
>
> for inspirations.
>
>
> Cheers,
> Benda
>

[-- Attachment #2: Type: text/html, Size: 4769 bytes --]

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [gentoo-soc] Application for Google Summer of Code 2018-Mishal Roy
  2018-03-22  4:07 ` Benda Xu
  2018-03-22 15:16   ` Mishal Roy
@ 2018-03-22 15:25   ` Rich Freeman
  2018-03-22 16:06     ` Mishal Roy
                       ` (2 more replies)
  1 sibling, 3 replies; 10+ messages in thread
From: Rich Freeman @ 2018-03-22 15:25 UTC (permalink / raw
  To: gentoo-soc; +Cc: Mishal Roy

On Thu, Mar 22, 2018 at 12:07 AM, Benda Xu <heroxbd@gentoo.org> wrote:
>
>> builds x86 linux kernel from source code present in /usr/src/linux
>> directory of Gentoo liveDVD
>
> This is not how Gentoo ebuild works, the build should prepare the source
> code.
>

I don't want to derail whatever your goals are here, but IMO an ebuild
that actually builds a kernel would be useful.

However, such an ebuild shouldn't touch /usr/src.  If I were doing a
kernel build ebuild I'd have it fetch kernel sources like any other
package, then build it in the normal location, with configuration
options provided via USE flags or some default config, and then
install the final kernel in /boot.

I realize that isn't how Gentoo has done it for the last 20 years, but
I've always thought that it would make sense to have a way to actually
maintain up-do-date kernels in the same manner as any other package,
with the /usr/src approach being an also-supported alternative.

That said, there are complications.  Some kernel modules want prepared
(or even built) sources and this approach would clean those after
install.  Also, we'd probably need to use subslots for initramfs
rebuilds or something like that.  I suspect this is why it hasn't been
done yet.

Again, I don't want to derail SoC with this unless there was an intent
to actually build a kernel this way...

-- 
Rich


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [gentoo-soc] Application for Google Summer of Code 2018-Mishal Roy
  2018-03-22 15:25   ` Rich Freeman
@ 2018-03-22 16:06     ` Mishal Roy
  2018-03-23  3:33     ` [gentoo-soc] kernel ebuild (Was: Application for Google Summer of Code 2018-Mishal Roy) Benda Xu
  2018-03-23  6:50     ` [gentoo-soc] Application for Google Summer of Code 2018-Mishal Roy Patrick Lauer
  2 siblings, 0 replies; 10+ messages in thread
From: Mishal Roy @ 2018-03-22 16:06 UTC (permalink / raw
  To: Rich Freeman; +Cc: gentoo-soc


[-- Attachment #1.1: Type: text/plain, Size: 1774 bytes --]

Hi,

I agree with you. That was  not the right way of writing an ebuild. I had
posted it as a proof of concept. I don't intend to do so while writing an
ebuild for soc. The way I want to do has been given in my proposal. Please
go through it.

Thanks and Regards,
Mishal Roy.

On Thu, Mar 22, 2018, 8:55 PM Rich Freeman <rich0@gentoo.org> wrote:

> On Thu, Mar 22, 2018 at 12:07 AM, Benda Xu <heroxbd@gentoo.org> wrote:
> >
> >> builds x86 linux kernel from source code present in /usr/src/linux
> >> directory of Gentoo liveDVD
> >
> > This is not how Gentoo ebuild works, the build should prepare the source
> > code.
> >
>
> I don't want to derail whatever your goals are here, but IMO an ebuild
> that actually builds a kernel would be useful.
>
> However, such an ebuild shouldn't touch /usr/src.  If I were doing a
> kernel build ebuild I'd have it fetch kernel sources like any other
> package, then build it in the normal location, with configuration
> options provided via USE flags or some default config, and then
> install the final kernel in /boot.
>
> I realize that isn't how Gentoo has done it for the last 20 years, but
> I've always thought that it would make sense to have a way to actually
> maintain up-do-date kernels in the same manner as any other package,
> with the /usr/src approach being an also-supported alternative.
>
> That said, there are complications.  Some kernel modules want prepared
> (or even built) sources and this approach would clean those after
> install.  Also, we'd probably need to use subslots for initramfs
> rebuilds or something like that.  I suspect this is why it hasn't been
> done yet.
>
> Again, I don't want to derail SoC with this unless there was an intent
> to actually build a kernel this way...
>
> --
> Rich
>

[-- Attachment #1.2: Type: text/html, Size: 2379 bytes --]

[-- Attachment #2: gsoc.pdf --]
[-- Type: application/pdf, Size: 57460 bytes --]

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [gentoo-soc] Application for Google Summer of Code 2018-Mishal Roy
  2018-03-22 15:16   ` Mishal Roy
@ 2018-03-23  0:47     ` Benda Xu
  0 siblings, 0 replies; 10+ messages in thread
From: Benda Xu @ 2018-03-23  0:47 UTC (permalink / raw
  To: gentoo-soc

Hi Mishal,

Mishal Roy <roymishal210@gmail.com> writes:

> Yes I will download the Xiaomi boot image by ebuild.
>
> I had proposed this small project so that it can be successfully
> completed within the time frame of three months.

> Eliminating the concept of boot image is feasible.

> If you recommend, I would like to extend my proposal by adding it.

Yes, it is my recommendation to extend the reach of this project. I
understand your position to play it safe to guarantee success.  But a
single ebuild is not of much interest to me personally for 3 months
work.

You have the final word, as this is your project application.

> Aboot the application bootloader of Redmi Note 4 reads boot image and
> loads kernel+ramdisk into RAM.

> On the other hand, bootloader on computer reads kernel and ramdisk
> ,and loads those into RAM.

> We can make Aboot function like a computer bootloader by editing its
> source code [1].

> However we will require Xiaomi's permission to allow us install the
> newly built Aboot because Aboot gets checked by SBL(Secondary boot
> loader) [2].

By "boot image" I think you mean the Android userland image for /system.
I don't see the need to modify application bootloader if we build our
own "boot image" and application bootloader is unlocked to accept
unsigned "boot image".

Did I miss something?


> I recently got familiar with basics of Gentoo.
> I have been using Ubuntu since 2 years.
> I have Ubuntu on my desktop computer and laptop.
> I use Ubuntu for compiling ASM, C and MATLAB codes.
> I also use it for running Guitarix,Rakarrack ( virtual guitar amplifiers) and Audacity sound recorder.
> Through Ubuntu I got to know about initramfs as well as list of services that are started by sysvinit and upstart.
> i.e. udev, pulseaudio , x-sever, lightdm, dbus, cron etc.
> I have experimented with these sevices by starting and stopping.
> I have not contributed to any community or solved bugs so far.
> I have Dell Venue 7 3740 which is an Intel powered Android device.This device is my main device for Android development.
> https://opensource.dell.com/releases/Venue_7_3740_Merrifield/developer-edition/A195/

Very impressive, I see your experience and potential.  It would help if
you summarize your strong points into the application in the Biography
section, after sorting out the major target of your project.

> 1. https://www.tldp.org/HOWTO/SRM-HOWTO/aboot.html
> 2. https://forum.xda-developers.com/android/general/info-android-device-partitions-basic-t3586565/amp/

Thank you for sharing,
Benda


^ permalink raw reply	[flat|nested] 10+ messages in thread

* [gentoo-soc] kernel ebuild (Was: Application for Google Summer of Code 2018-Mishal Roy)
  2018-03-22 15:25   ` Rich Freeman
  2018-03-22 16:06     ` Mishal Roy
@ 2018-03-23  3:33     ` Benda Xu
  2018-03-23  6:50     ` [gentoo-soc] Application for Google Summer of Code 2018-Mishal Roy Patrick Lauer
  2 siblings, 0 replies; 10+ messages in thread
From: Benda Xu @ 2018-03-23  3:33 UTC (permalink / raw
  To: gentoo-soc

Hi Rich,

Thank you for the input.  I had the same puzzle, too.

Rich Freeman <rich0@gentoo.org> writes:

> On Thu, Mar 22, 2018 at 12:07 AM, Benda Xu <heroxbd@gentoo.org> wrote:
>>
>>> builds x86 linux kernel from source code present in /usr/src/linux
>>> directory of Gentoo liveDVD
>>
>> This is not how Gentoo ebuild works, the build should prepare the source
>> code.
>
> I don't want to derail whatever your goals are here, but IMO an ebuild
> that actually builds a kernel would be useful.
>
> However, such an ebuild shouldn't touch /usr/src.  If I were doing a
> kernel build ebuild I'd have it fetch kernel sources like any other
> package, then build it in the normal location, with configuration
> options provided via USE flags or some default config, and then
> install the final kernel in /boot.

+1

> I realize that isn't how Gentoo has done it for the last 20 years, but
> I've always thought that it would make sense to have a way to actually
> maintain up-do-date kernels in the same manner as any other package,
> with the /usr/src approach being an also-supported alternative.

It's worth to know why we made such a choice.  I took the status quo as
is and have never thought carefully about it.

> That said, there are complications.  Some kernel modules want prepared
> (or even built) sources and this approach would clean those after
> install.

We can have a USE flag to control whether the source should be installed
along with the image.  And those kernel module can claim their
dependence on the USE flag.

> Also, we'd probably need to use subslots for initramfs rebuilds or
> something like that.  I suspect this is why it hasn't been done yet.

@Alice, any hints from the kernel team?

> Again, I don't want to derail SoC with this unless there was an intent
> to actually build a kernel this way...

Well, thank you!  That's why I wanted to keep the technical discussions
related to GSOC public.  It's always good to have our students to
communicate with and learn from experts of Gentoo.  Ultimately, the
projects should be useful to the Gentoo community.

Yours,
Benda


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [gentoo-soc] Application for Google Summer of Code 2018-Mishal Roy
  2018-03-22 15:25   ` Rich Freeman
  2018-03-22 16:06     ` Mishal Roy
  2018-03-23  3:33     ` [gentoo-soc] kernel ebuild (Was: Application for Google Summer of Code 2018-Mishal Roy) Benda Xu
@ 2018-03-23  6:50     ` Patrick Lauer
  2018-03-23 13:37       ` Rich Freeman
  2 siblings, 1 reply; 10+ messages in thread
From: Patrick Lauer @ 2018-03-23  6:50 UTC (permalink / raw
  To: gentoo-soc

On 03/22/2018 04:25 PM, Rich Freeman wrote:
> On Thu, Mar 22, 2018 at 12:07 AM, Benda Xu <heroxbd@gentoo.org> wrote:
>>
>>> builds x86 linux kernel from source code present in /usr/src/linux
>>> directory of Gentoo liveDVD
>>
>> This is not how Gentoo ebuild works, the build should prepare the source
>> code.
>>
> 
> I don't want to derail whatever your goals are here, but IMO an ebuild
> that actually builds a kernel would be useful.
> 

https://github.com/adjust/gentoo-overlay/tree/master/sys-kernel

This just needs to be cleaned up a bit to be upstreamed, and so far I've
not had the time for it.

It's a solved problem (I'm aware of at least two other ebuilds to do the
same) :)

> However, such an ebuild shouldn't touch /usr/src.  If I were doing a
> kernel build ebuild I'd have it fetch kernel sources like any other
> package, then build it in the normal location, with configuration
> options provided via USE flags or some default config, and then
> install the final kernel in /boot.
> 
> I realize that isn't how Gentoo has done it for the last 20 years, but
> I've always thought that it would make sense to have a way to actually
> maintain up-do-date kernels in the same manner as any other package,
> with the /usr/src approach being an also-supported alternative.
> 
> That said, there are complications.  Some kernel modules want prepared
> (or even built) sources and this approach would clean those after
> install.  Also, we'd probably need to use subslots for initramfs
> rebuilds or something like that.  I suspect this is why it hasn't been
> done yet.
> 
> Again, I don't want to derail SoC with this unless there was an intent
> to actually build a kernel this way...
> 



^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [gentoo-soc] Application for Google Summer of Code 2018-Mishal Roy
  2018-03-23  6:50     ` [gentoo-soc] Application for Google Summer of Code 2018-Mishal Roy Patrick Lauer
@ 2018-03-23 13:37       ` Rich Freeman
  2018-03-23 13:49         ` EBo
  0 siblings, 1 reply; 10+ messages in thread
From: Rich Freeman @ 2018-03-23 13:37 UTC (permalink / raw
  To: gentoo-soc

On Fri, Mar 23, 2018 at 2:50 AM, Patrick Lauer <patrick@gentoo.org> wrote:
>
> https://github.com/adjust/gentoo-overlay/tree/master/sys-kernel
>
> This just needs to be cleaned up a bit to be upstreamed, and so far I've
> not had the time for it.
>
> It's a solved problem (I'm aware of at least two other ebuilds to do the
> same) :)
>

Yeah, that is certainly one approach.  Part of me thinks that
modularizing the initramfs portion would be ideal, and as Benda
suggested making it possible to install the built sources might be
useful (if doing so one would need to patch the file that points to
the build location so that future module builds can find them).  This
particular ebuild uses sources in /usr/src but I think it would be
cleaner to just fetch these into the build directory.

The package I find most frustrating is zfs-kmod, because it needs
fully-built sources and not just prepared sources.  I build to a
tmpfs, and re-creating prepared sources using that approach is
trivial, but doing a full rebuild just to update zfs modules is a bit
painful (granted, less so now that I have 12 cores).  I've been too
lazy to figure out why zfs needs them...

-- 
Rich


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [gentoo-soc] Application for Google Summer of Code 2018-Mishal  Roy
  2018-03-23 13:37       ` Rich Freeman
@ 2018-03-23 13:49         ` EBo
  0 siblings, 0 replies; 10+ messages in thread
From: EBo @ 2018-03-23 13:49 UTC (permalink / raw
  To: gentoo-soc

On Mar 23 2018 7:37 AM, Rich Freeman wrote:
> On Fri, Mar 23, 2018 at 2:50 AM, Patrick Lauer <patrick@gentoo.org> 
> wrote:
>>
>> https://github.com/adjust/gentoo-overlay/tree/master/sys-kernel
>>
>> This just needs to be cleaned up a bit to be upstreamed, and so far 
>> I've
>> not had the time for it.
>>
>> It's a solved problem (I'm aware of at least two other ebuilds to do 
>> the
>> same) :)
>>
>
> Yeah, that is certainly one approach.  Part of me thinks that
> modularizing the initramfs portion would be ideal, and as Benda
> suggested making it possible to install the built sources might be
> useful (if doing so one would need to patch the file that points to
> the build location so that future module builds can find them).  This
> particular ebuild uses sources in /usr/src but I think it would be
> cleaner to just fetch these into the build directory.
>
> The package I find most frustrating is zfs-kmod, because it needs
> fully-built sources and not just prepared sources.  I build to a
> tmpfs, and re-creating prepared sources using that approach is
> trivial, but doing a full rebuild just to update zfs modules is a bit
> painful (granted, less so now that I have 12 cores).  I've been too
> lazy to figure out why zfs needs them...

In the past I have had zfs-kmod seriously break my kernel builds.  
Cleaning that up to be consistent would probably be useful to the 
general community as a whole IMNSHO.  Isn't there a way to set the build 
and install directories from some env variable?  If so, maybe verifying 
that the core emuilds are consistent would be helpful.  Hmmm... in the 
past I have written utility scripts to check for things like this.  
Would it be reasonable to add those checks to repoman (or whatever it is 
called today)?

Hope I am not out of line asking this on this forum.

   EBo --


^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2018-03-23 13:48 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-03-21 17:51 [gentoo-soc] Application for Google Summer of Code 2018-Mishal Roy Mishal Roy
2018-03-22  4:07 ` Benda Xu
2018-03-22 15:16   ` Mishal Roy
2018-03-23  0:47     ` Benda Xu
2018-03-22 15:25   ` Rich Freeman
2018-03-22 16:06     ` Mishal Roy
2018-03-23  3:33     ` [gentoo-soc] kernel ebuild (Was: Application for Google Summer of Code 2018-Mishal Roy) Benda Xu
2018-03-23  6:50     ` [gentoo-soc] Application for Google Summer of Code 2018-Mishal Roy Patrick Lauer
2018-03-23 13:37       ` Rich Freeman
2018-03-23 13:49         ` EBo

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox