Skip to content
Snippets Groups Projects

Add optional gcc6 argument to envkernel.sh

Merged Imported Administrator requested to merge envkernel-gcc6 into master

Add simple argument parsing:

$ source ~/pmbootstrap/helpers/envkernel.sh --help
usage: envkernel.sh
optional arguments:
    --fish        Print fish alias syntax
    --gcc6        Use GCC6 cross compiler
    --help        Show this help message

Optionally using GCC6:

$ source ~/pmbootstrap/helpers/envkernel.sh
pmbootstrap envkernel.sh activated successfully.
 * kernel source:  /home/r/git/android_kernel_samsung_p4
 * output folder:  /home/r/git/android_kernel_samsung_p4/.output
 * architecture:   arm (samsung-i9100 is armhf)
 * cross compile:  armv6-alpine-linux-muslgnueabihf-gcc (Alpine 8.2.0)
 * aliases: make, kernelroot, pmbootstrap, pmbroot (see 'type make' etc.)
$ source ~/pmbootstrap/helpers/envkernel.sh --gcc6
Initializing Alpine chroot (details: 'pmbootstrap log')
pmbootstrap envkernel.sh activated successfully.
 * kernel source:  /home/r/git/android_kernel_samsung_p4
 * output folder:  /home/r/git/android_kernel_samsung_p4/.output
 * architecture:   arm (samsung-i9100 is armhf)
 * cross compile:  gcc6-armv6-alpine-linux-muslgnueabihf-gcc (postmarketOS 6.4.0)
 * aliases: make, kernelroot, pmbootstrap, pmbroot (see 'type make' etc.)

Merge request reports

Approval is optional

Merged by AdministratorAdministrator 6 years ago (Oct 11, 2018 5:28am UTC)

Merge details

  • Changes merged into master with 946417d3.
  • Deleted the source branch.

Pipeline #189040 passed

Pipeline passed for 946417d3 on master

Deployed to dep‎loy‎ 6 months ago

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
  • Administrator added 6 commits · Imported

    added 6 commits

    • 4f33e42b...9d198f1e - 4 commits from branch postmarketOS:master
    • fb3a2bf0 - Parse shell arguments passed to envkernel.sh
    • 72013ac1 - Add envkernel.sh argument to use gcc6 cross compiler

    Compare with previous version

    By Oliver Smith on 2018-10-08T06:26:43

  • Author Owner

    Code is looking good. Two things:

    • when running envkernel.sh without --gcc6, then with --gcc6, it will skip initializing the chroot and then you'll only have the non-gcc6 cross compiler in the chroot. How about we add the gcc package name to the "flag" variable?
    	initialize_chroot() {
    		# Don't initialize twice
    		flag="$chroot/tmp/envkernel/setup_done"
    		[ -e "$flag" ] && return
    • awk prints a warning in my installation:
    $ source ~/code/pmbootstrap/helpers/envkernel.sh
    pmbootstrap envkernel.sh activated successfully.
     * kernel source:  /home/user/code/linux
     * output folder:  /home/user/code/linux/.output
     * architecture:   arm (lg-mako is armhf)
    awk: warning: escape sequence `\(' treated as plain `('
    awk: warning: escape sequence `\)' treated as plain `)'
     * cross compile:  armv6-alpine-linux-muslgnueabihf-gcc (Alpine 8.2.0)
     * aliases: make, kernelroot, pmbootstrap, pmbroot (see 'type make' etc.)
    $ awk --version
    GNU Awk 4.2.1, API: 2.0 (GNU MPFR 3.1.6-p2, GNU MP 6.1.2)

    Could you fix these two things? Thank you very much for the merge request @ryang2678! :tada: :thumbsup:

    By Oliver Smith on 2018-10-09T04:29:46

  • Administrator added 2 commits · Imported

    added 2 commits

    • b58a16b6 - Parse shell arguments passed to envkernel.sh
    • e843a916 - Add envkernel.sh argument to use gcc6 cross compiler

    Compare with previous version

    By ryang on 2018-10-10T23:01:33

  • Administrator added 8 commits · Imported

    added 8 commits

    • e843a916...1e495baa - 6 commits from branch postmarketOS:master
    • e27f11a7 - Parse shell arguments passed to envkernel.sh
    • a2484f24 - Add envkernel.sh argument to use gcc6 cross compiler

    Compare with previous version

    By ryang on 2018-10-10T23:15:59

  • Author Owner

    Could you fix these two things? Thank you very much for the merge request @ryang2678!

    Both of these should be fixed now.

    By ryang on 2018-10-10T23:21:47

  • Administrator added 1 commit · Imported

    added 1 commit

    • 946417d3 - Make --gcc6 work with fish; add 'source' to usage

    Compare with previous version

    By Oliver Smith on 2018-10-11T05:23:29

  • Author Owner

    Thanks for the update! While testing I've noticed that using --gcc6 didn't work with fish. With the commit I've added it does now, and also it says "source envkernel.sh" in the usage information. Other than that, the code looks good to me and I can confirm that it is working as expected.

    Let's ship this! :ship:

    By Oliver Smith on 2018-10-11T05:26:03

  • Administrator enabled an automatic merge when the pipeline for 946417d3 succeeds · Imported

    enabled an automatic merge when the pipeline for 946417d3 succeeds

    By Oliver Smith on 2018-10-11T05:26:10

  • Administrator merged · Imported

    merged

    By Oliver Smith on 2018-10-11T05:28:41

Please register or sign in to reply
Loading