Add optional gcc6 argument to envkernel.sh
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
Activity
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
By Oliver Smith on 2018-10-08T06:26:43
-
4f33e42b...9d198f1e - 4 commits from branch
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!
By Oliver Smith on 2018-10-09T04:29:46
- when running envkernel.sh without
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
By ryang on 2018-10-10T23:15:59
-
e843a916...1e495baa - 6 commits from branch
added 1 commit
- 946417d3 - Make --gcc6 work with fish; add 'source' to usage
By Oliver Smith on 2018-10-11T05:23:29
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!
By Oliver Smith on 2018-10-11T05:26:03
enabled an automatic merge when the pipeline for 946417d3 succeeds
By Oliver Smith on 2018-10-11T05:26:10