Commit Graph

21 Commits

Author SHA1 Message Date
Oliver Smith f82e4fd66b
envkernel: support spaces in path (!1770)
Fixes the following error, when running envkernel.sh from a pmbootstrap
path with spaces:

bash: /home/lofenyy/Root/Cabinet/Projects/Phone: No such file or directory
See also: <https://postmarketos.org/troubleshooting>
2019-04-06 01:20:20 +02:00
Robert Yang 43326b551a
envkernel: Add run-script alias to run local scripts within the chroot (!1747)
Example usage:
For kernels that need to run dtbTool after make.
Create a script named post-make.sh in the kernel source directory:

  #!/bin/sh
  dtbTool -s 2048 -p "${srcdir}/scripts/dtc/" -o \
    "${builddir}/arch/arm/boot/dt.img" \
    "${builddir}/arch/arm/boot"

To run this script inside the chroot:
$ source ~/pmbootstrap/helpers/envkernel.sh
$ make lineageos_bacon_defconfig
$ make
$ run-script post-make.sh
2019-02-15 16:24:19 +01:00
Konrad Dybcio cf2e28d3c2 Switch helpers/envkernel.sh to openssl (!1742) 2019-01-22 08:03:06 +01:00
Oliver Smith f16bdaf0ca
Update copyright to 2019
Happy new year \o/
2019-01-02 09:31:20 +01:00
Robert Yang 101a396c90 envkernel: Add x86 architectures (!1733) 2018-12-29 14:33:27 -05:00
Robert Yang 4d6cd2270f envkernel: Support native compiles (!1733)
The cross compile environment variable only needs to be set when the
kernel is being built for a different architecture than the host system.
2018-12-29 14:33:25 -05:00
Robert Yang ce57fae12d envkernel: Set CC and HOSTCC (!1733)
It is necessary to override these environment variables to use an alternate
compiler such as gcc6.
2018-12-29 14:33:15 -05:00
Robert Yang 70126570a4 envkernel: Fix switching envkernel to different source path (!1733)
When there is already another kernel source path mounted then the old mount
should be removed. Otherwise the mount source will still be pointed at the
old kernel source.
2018-12-29 14:33:12 -05:00
Robert Yang 3e845e1edf envkernel: Run make command as user (!1733) 2018-12-29 13:53:56 -05:00
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
Grant Miller 7eaf9de000 Implement bash tab completion 2018-08-27 21:35:05 +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
Daniil Yarancev f45c87eadc zsh autocompletion: fix filename in comment (#1564) 2018-06-14 20:19:58 +00:00
steamport 30df0725ca menuconfig: add gconfig/xconfig support (#1509)
* change "pmbootstrap kconfig_check" to "pmbootstrap kconfig check"
* change "pmbootstrap menuconfig" to "pmbootstrap kconfig edit [-x|-g]"
  (with legacy alias, because the first syntax was referenced to a lot)
* enable X11 interfaces: -x: xconfig, -g: gconfig
* new function to copy the xauthority file:
  pmb.chroot.other.copy_xauthority()
* remove menufconfig() function from the kernel template and all kernel
  aports ([skip ci] because it would rebuild all kernels and run out of
  time). Alpine has dropped this as well, and it wouldn't work with the
  new code anyway.
2018-06-09 06:52:24 +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
BK d79e13d226 Add helpers/envsetup.sh (#1390)
Usage:
$ source helpers/envsetup.sh
It sets up the aliases `pmbootstrap` and `pmbroot`.
The latter changes the directory to the pmbootstrap folder.
2018-04-08 12:58:10 +00:00
Oliver Smith 6bb8444fef
"...flasher flash_rootfs" instead of "..._system" (#1373)
* Change `pmbootstrap flasher flash_system` command to
  `pmbootstrap flasher flash_rootfs`
* The old command still works, but all references have been changed to
  the new command
* Remove obsolete `pmbootstrap flasher export` (that was changed to
  `pmbootstrap export` a few months ago)
* Update `README.md` and ZSH auto completion
* Change the description of the generated rootfs image (not talking
  about a system image anymore, mention that it has subpartitions)
* Better description of `pmbootstrap flasher flash_rootfs --partition`
2018-03-30 01:11:20 +00:00
Alex Dills 50a5d36cbb Rudimentary ZSH autocompletion helper (#1232) 2018-02-17 22:46:20 +00:00