aboutsummaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
...
* gen_funcs.sh: gkbuild(): Export $TMPDIRThomas Deutschmann2019-07-211-1/+2
| | | | | | | Some portage programs like eltpatch depend on $TMPDIR. Bug: https://bugs.gentoo.org/690264 Signed-off-by: Thomas Deutschmann <whissi@gentoo.org>
* gen_funcs.sh: gen_die(): Don't advertise $LOGFILE until ↵Thomas Deutschmann2019-07-211-3/+8
| | | | | | | | | determine_real_args() was called Before determine_real_args() was called, $LOGFILE will probably contain content from a previous run. Signed-off-by: Thomas Deutschmann <whissi@gentoo.org>
* gen_funcs.sh: dump_debugcache(): Echo DEBUGCACHE when $LOGFILE isn't writableThomas Deutschmann2019-07-211-1/+9
| | | | | | This can happen until determine_real_args() was called. Signed-off-by: Thomas Deutschmann <whissi@gentoo.org>
* genkernel: Move $LOGFILE initialization to determine_real_args()Thomas Deutschmann2019-07-211-9/+0
| | | | Signed-off-by: Thomas Deutschmann <whissi@gentoo.org>
* gen_funcs.sh: set_color_vars(): Define NORMAL as last colorThomas Deutschmann2019-07-211-4/+4
| | | | | | This will fix output when running with "set -x" very early. Signed-off-by: Thomas Deutschmann <whissi@gentoo.org>
* gen_funcs.sh: is_valid_triplet(): Relax regexThomas Deutschmann2019-07-201-1/+1
| | | | | Bug: https://bugs.gentoo.org/690262 Signed-off-by: Thomas Deutschmann <whissi@gentoo.org>
* gen_funcs.sh: restore_boot_mount_state(): Delete .bootdir.no_boot_partition ↵Thomas Deutschmann2019-07-181-3/+3
| | | | | | | only when present Fixes 8458d98a ("Rework --mountboot handling") Signed-off-by: Thomas Deutschmann <whissi@gentoo.org>
* Rework --mountboot handlingThomas Deutschmann2019-07-181-4/+165
| | | | | | | | | | - Move code to own function. - Use same logic like mount-boot.eclass. - Ensure to restore state of boot partition on exit/error. Signed-off-by: Thomas Deutschmann <whissi@gentoo.org>
* Adjust LOGLEVELThomas Deutschmann2019-07-161-3/+3
| | | | Signed-off-by: Thomas Deutschmann <whissi@gentoo.org>
* gen_funcs.sh: trap_cleanup(): Log received signalThomas Deutschmann2019-07-151-2/+19
| | | | Signed-off-by: Thomas Deutschmann <whissi@gentoo.org>
* Rework --ssh supportThomas Deutschmann2019-07-141-0/+131
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - To enable sshd in initramfs user MUST now set "dosshd" kernel command-line parameter. - "gk.sshd.wait" kernel command-line parameter was added to interrupt boot process for X seconds to allow for remote login (can be used like an remote rescue shell). - For remote unlock of LUKS-encrypted root or swap device, user can still send unencrypted keyfile via SSH like $ cat ~/root.unencrypted.key | ssh root@<remote-host> -C post root or user can now just SSH into the remote host and call "unlock-luks" like remote rescueshell ~ # unlock-luks root to get a cryptsetup prompt. NOTE: When manually unlocking the encrypted LUKS device, user must call "resume-boot" afterwards to resume booting. - "--ssh-authorized-keys-file" parameter added which can be used to specify a different file than default "/etc/dropbear/authorized_keys" file. - "--ssh-host-keys" parameter added to control if in initramfs embedded sshd should create its own pair of hosts keys (which will be stored in "/etc/dropbear for re-use, default), use host keys from host system or should generate host keys at runtime on each boot. - "ip" kernel command-line parameter will now default to DHCP usage but does also support addr/CIDR notation to specify a static address. - "gk.net.iface" kernel command-line parameter was added to use a different interface than "eth0". You can either use an interface name or use a MAC address. - "gk.net.gw" kernel command-line parameter was added which will allow user to set specific gateway when DHCP isn't used. - "gk.net.routes" kernel command-line parameter was added which will allow user to set additional routes when DHCP isn't used. Please read manpage for additional parameters and more details. Signed-off-by: Thomas Deutschmann <whissi@gentoo.org>
* gen_funcs.sh: Refactor trap_cleanup()Thomas Deutschmann2019-07-141-0/+11
| | | | | | | - Restore output to make sure error message will be visible in case trap was triggered while we were redirecting output to $LOGFILE. Signed-off-by: Thomas Deutschmann <whissi@gentoo.org>
* gen_funcs.sh: Refactor check_distfiles()Thomas Deutschmann2019-07-141-14/+17
| | | | | | Check dynamical for any "registered" distfile. Signed-off-by: Thomas Deutschmann <whissi@gentoo.org>
* Add genkernel worker module "unpack"Thomas Deutschmann2019-07-141-0/+51
| | | | | | This commit will add support for "unpack" task. Signed-off-by: Thomas Deutschmann <whissi@gentoo.org>
* Add genkernel worker module "gkbuild"Thomas Deutschmann2019-07-141-0/+217
| | | | | | | | | | | | | | In the future, genkernel will try to compile all programs used in genkernel's initramfs on its own instead of copying from host system. This commit will add support for gkbuilds. A "gkbuild" is like an ebuild but with reduced functionality. Using an ebuild-like system will make it easier to maintain those programs in a standardized way, especially with reworked cross-compile support. Signed-off-by: Thomas Deutschmann <whissi@gentoo.org>
* Add code for genkernel workerThomas Deutschmann2019-07-141-0/+1
| | | | | | | | | | | | In the future, genkernel will perform tasks such as compilation or unpack in a separated process, primarily to allow for sandbox usage, similar how portage executes ebuilds. Each task will have its own "worker" script. This commit will add the code required to run such a worker. Signed-off-by: Thomas Deutschmann <whissi@gentoo.org>
* Rework cross-compile supportThomas Deutschmann2019-07-141-1/+227
| | | | | | | | | | | | | - Add new "--cross-compile" parameter which will accept a target triplet and replaces "--arch-override", "--utils-arch", "--utils-cross-compile" and "--kernel-cross-compile" parameter. - Add "--utils-cflags" to allow user to overwrite CFLAGS used for compiling programs for initramfs. - Add tc-* functions. Signed-off-by: Thomas Deutschmann <whissi@gentoo.org>
* gen_funcs.sh: Refactor setColorVars()Thomas Deutschmann2019-07-141-3/+3
| | | | | | | | - Renamed to set_color_vars() - Use NOCOLOR variable Signed-off-by: Thomas Deutschmann <whissi@gentoo.org>
* gen_funcs.sh: Refactor setup_cache_dir()Thomas Deutschmann2019-07-141-4/+7
| | | | | | | | - Define and make use of GK_V_CACHEDIR. - Add support for XZ archives. Signed-off-by: Thomas Deutschmann <whissi@gentoo.org>
* gen_funcs.sh: gen_die() refactoredThomas Deutschmann2019-07-141-17/+7
| | | | | | | | | - End trace, just in case. - Don't try to be smart and grep $LOGFILE for errors: Results are often misleading. Signed-off-by: Thomas Deutschmann <whissi@gentoo.org>
* gen_package.sh: Refactor gen_kerncache()Thomas Deutschmann2019-07-141-0/+41
| | | | | | | | | | - Make use of tar's auto-compress feature, i.e. use archive suffix to determine the compression program. - get_tar_cmd() function added which will try to return tar command utilizing pbzip2, pxz or pigz when possible. Signed-off-by: Thomas Deutschmann <whissi@gentoo.org>
* gen_funcs.sh: Rename clear_log() function to start_log() and refactorThomas Deutschmann2019-07-141-2/+4
| | | | | | | | - Quote $LOGFILE. - Call dump_debugcache(). Signed-off-by: Thomas Deutschmann <whissi@gentoo.org>
* gen_funcs.sh: Refactor kconfig_set_opt()Thomas Deutschmann2019-07-141-12/+20
| | | | | | | | | | | - Make use of get_useful_function_stack(). - Add 4th optional parameter to control output indent level. - Create a marker file (KCONFIG_MODIFIED_MARKER) when we have modified configuration. Signed-off-by: Thomas Deutschmann <whissi@gentoo.org>
* gen_funcs.sh: Refactor kconfig_get_opt()Thomas Deutschmann2019-07-141-2/+5
| | | | Signed-off-by: Thomas Deutschmann <whissi@gentoo.org>
* gen_funcs.sh: Store $IFS in $GK_DEFAULT_IFSThomas Deutschmann2019-07-141-0/+3
| | | | | | | | Some functions will change IFS so we must be able to restore the original value. Instead of saving IFS all the time, do it only once. Signed-off-by: Thomas Deutschmann <whissi@gentoo.org>
* gen_funcs.sh: Refactor find_kernel_binary()Thomas Deutschmann2019-07-141-6/+3
| | | | Signed-off-by: Thomas Deutschmann <whissi@gentoo.org>
* gen_funs.sh: Refactor expand_file()Thomas Deutschmann2019-07-141-1/+5
| | | | Signed-off-by: Thomas Deutschmann <whissi@gentoo.org>
* gen_funs.sh: Refactor clear_tmpdir()Thomas Deutschmann2019-07-141-3/+3
| | | | | | | | - Adjust loglevel. - Quote $TMPDIR. Signed-off-by: Thomas Deutschmann <whissi@gentoo.org>
* gen_funcs.sh: Refactor copy_image_with_preserve()Thomas Deutschmann2019-07-141-68/+81
| | | | Signed-off-by: Thomas Deutschmann <whissi@gentoo.org>
* gen_funcs.sh: cache_replace(): Make use of get_useful_function_stack()Thomas Deutschmann2019-07-141-1/+4
| | | | Signed-off-by: Thomas Deutschmann <whissi@gentoo.org>
* gen_funcs.sh: arch_replace(): Make use of get_useful_function_stack()Thomas Deutschmann2019-07-141-0/+3
| | | | Signed-off-by: Thomas Deutschmann <whissi@gentoo.org>
* gen_funcs.sh: var_replace(): Make use of get_useful_function_stack()Thomas Deutschmann2019-07-141-0/+3
| | | | Signed-off-by: Thomas Deutschmann <whissi@gentoo.org>
* gen_funcs.sh: Refactor getIndent()Thomas Deutschmann2019-07-141-4/+11
| | | | | | | | - Renamed to get_indent(). - Make use of get_useful_function_stack(). Signed-off-by: Thomas Deutschmann <whissi@gentoo.org>
* gen_funcs.sh: Refactor print_info()Thomas Deutschmann2019-07-141-25/+42
| | | | | | | | | | | | | - Use proper bash expressions. - Make use of get_useful_function_stack(). - When xtrace option (set -x) is set, disable during print_info to avoid cluttering the output. - By default write everything to $LOGFILE despite $LOGLEVEL. Signed-off-by: Thomas Deutschmann <whissi@gentoo.org>
* gen_funcs.sh: dump_debugcache(): Clear $DEBUGCACHE after content was dumpedThomas Deutschmann2019-07-141-0/+1
| | | | | | | Function can be called multiple times. So we have to ensure that we clear already dumped content. Signed-off-by: Thomas Deutschmann <whissi@gentoo.org>
* gen_funcs.sh: Add get_useful_function_stack() functionThomas Deutschmann2019-07-141-0/+32
| | | | | | | | "Useful" because it will not return the complete stack. Only all functions till calling or specified function while filtering common functions like "main". Signed-off-by: Thomas Deutschmann <whissi@gentoo.org>
* gen_funcs.sh: Rename isBootRO() function to is_boot_ro()Thomas Deutschmann2019-07-141-1/+1
| | | | Signed-off-by: Thomas Deutschmann <whissi@gentoo.org>
* gen_funcs.sh: Add set_default_gk_trap() functionThomas Deutschmann2019-07-141-0/+4
| | | | | | | We will have to reset trap from time to time so create a function for that. Signed-off-by: Thomas Deutschmann <whissi@gentoo.org>
* "--debug-cleanup" parameter renamed to "--cleanup"Thomas Deutschmann2019-07-141-10/+9
| | | | | | --cleanup or --no-cleanup should be clearer. Signed-off-by: Thomas Deutschmann <whissi@gentoo.org>
* gen_funcs.sh: Add debug_breakpoint() functionThomas Deutschmann2019-07-141-0/+28
| | | | | | | Internal helper function which can be used during development to act like a breakpoint. Signed-off-by: Thomas Deutschmann <whissi@gentoo.org>
* genkernel: Move cleanup() to gen_funcs.shThomas Deutschmann2019-07-141-0/+27
| | | | Signed-off-by: Thomas Deutschmann <whissi@gentoo.org>
* genkernel: Move trap_cleanup() to gen_funcs.shThomas Deutschmann2019-07-141-0/+6
| | | | Signed-off-by: Thomas Deutschmann <whissi@gentoo.org>
* Normalize "..." outputThomas Deutschmann2019-07-141-2/+2
| | | | | | | When "..." is used to indicate that genkernel will be doing something, use " ..." notation. Signed-off-by: Thomas Deutschmann <whissi@gentoo.org>
* Replace backticksThomas Deutschmann2019-07-141-4/+8
| | | | Signed-off-by: Thomas Deutschmann <whissi@gentoo.org>
* gen_funcs.sh: Strip 'function' keyword to match code styleThomas Deutschmann2019-07-141-2/+2
| | | | Signed-off-by: Thomas Deutschmann <whissi@gentoo.org>
* Fix code styleThomas Deutschmann2019-07-141-4/+6
| | | | Signed-off-by: Thomas Deutschmann <whissi@gentoo.org>
* Add new function expand_file() to allow file path expansionThomas Deutschmann2019-03-291-0/+19
| | | | | | | Relies on Python os.path.expanduser and realpath from coreutils. Bug: https://bugs.gentoo.org/412321 Signed-off-by: Thomas Deutschmann <whissi@gentoo.org>
* kconfig_set_opt(): add possibility to add new kernel optionsThomas Deutschmann2019-03-261-3/+20
| | | | | Bug: https://bugs.gentoo.org/669412 Signed-off-by: Thomas Deutschmann <whissi@gentoo.org>
* Fix iSCSI supportThomas Deutschmann2019-03-251-0/+1
| | | | | | Bump to open-scsi-2.0.875 & open-isns-0.99. Signed-off-by: Thomas Deutschmann <whissi@gentoo.org>
* check_distfiles(): Add missing distfilesThomas Deutschmann2019-03-231-1/+11
| | | | Signed-off-by: Thomas Deutschmann <whissi@gentoo.org>