Commit Graph

6 Commits

Author SHA1 Message Date
Oliver Smith 946417d314
Make --gcc6 work with fish; add 'source' to usage 2018-10-11 07:22:09 +02:00
Robert Yang a2484f2492 Add envkernel.sh argument to use gcc6 cross compiler 2018-10-10 19:02:25 -04:00
Robert Yang e27f11a705 Parse shell arguments passed to envkernel.sh 2018-10-10 19:02:25 -04:00
Robert Yang 9d198f1ea4 Clean kernel source directory before setting up make alias
When kbuild is using a separate directory for output files then it will
check if the kernel source directory is clean.
The build will throw an error when the source directory is not clean:

  .. is not clean, please run 'make mrproper'

Once envkernel.sh has aliased the make command then make mrproper will
be run in the context of .output directory. If the source directory is not
clean then user may be wondering why make mrproper doesn't clean it.

This change will ensure that the source directory is clean when envkernel
is setup.
2018-10-08 05:21:21 +00:00
ryang c9fc3d9b85 envkernel: Don't use alias commands in the script itself
The pmbootstrap alias cannot be used within the script.
The reason is that aliases are not expanded in non-interactive shells.
reference: https://unix.stackexchange.com/q/1496

To fix this replace references to the pmbootstrap alias with
the $pmbootstrap variable
2018-08-27 20:31:32 +00:00
Oliver Smith a77a0dcc32
Add envkernel.sh: instant mainlining environment (#1424)
Changes:
* `helpers/envkernel.sh`:
  * installs everything needed for kernel compilation in the native
    chroot
  * mounts the kernel source to `/mnt/linux` inside the chroot
  * creates `/mnt/linux/.output` and chowns it to the `pmos` user, that
    folder will be used for the kernel build output
  * sets up aliases for `make`, `pmbootstrap`, `pmbroot`, `kernelroot`
* new action `pmbootstrap work_migrate`: does the interactive work
  folder migration if necessary, otherwise it doesn't output anything
  * when calling this first, we can safely use all other commands
    non-interactively without showing the output

Benefits:
* Fast setup (especially for people who are new to kernel
  compilation
  * No need to figure out distribution specific package names
    (cross compilers!)
  * No need to do a test build just to verify that the right
    packages are installed
* Less error prone
  * The right dependencies are always installed
  * `ARCH` and `CROSS_COMPILE` variables always get set automatically
    and based on `deviceinfo_arch`
  * If the build environment is broken for some reason, just zap and
    start over
* Easy to reproduce problems

Notes:
* `make menuconfig` works as well
* Sourcing was tested with `zsh`, `bash` and `fish`, it should be easy to
  extend for other shells
2018-04-19 21:27:38 +00:00