diff --git a/Makefile b/Makefile index 24b6881..18e29b4 100644 --- a/Makefile +++ b/Makefile @@ -1,13 +1,51 @@ +PREFIX ?= /usr +BINDIR ?= $(PREFIX)/bin +LIBDIR ?= $(PREFIX)/lib +SYSCONFDIR ?= /etc +DESTDIR ?= VERSION ?= distdir = genkernel-next-$(VERSION) # Add off-Git/generated files here that need to be shipped with releases EXTRA_DIST = genkernel.8 +default: genkernel.8 + genkernel.8: doc/genkernel.8.txt doc/asciidoc.conf Makefile genkernel a2x --conf-file=doc/asciidoc.conf --attribute="genkernelversion=$(VERSION)" \ --format=manpage -D . "$<" +install: default + + install -d $(DESTDIR)/$(SYSCONFDIR) + install -m 644 genkernel.conf $(DESTDIR)/$(SYSCONFDIR)/ + + install -d $(DESTDIR)/$(BINDIR) + install -m 755 genkernel $(DESTDIR)/$(BINDIR)/ + + install -d $(DESTDIR)/$(PREFIX)/share/genkernel + install -m 755 gen_arch.sh $(DESTDIR)/$(PREFIX)/share/genkernel + install -m 755 gen_bootloader.sh $(DESTDIR)/$(PREFIX)/share/genkernel + install -m 755 gen_cmdline.sh $(DESTDIR)/$(PREFIX)/share/genkernel + install -m 755 gen_compile.sh $(DESTDIR)/$(PREFIX)/share/genkernel + install -m 755 gen_configkernel.sh $(DESTDIR)/$(PREFIX)/share/genkernel + install -m 755 gen_determineargs.sh $(DESTDIR)/$(PREFIX)/share/genkernel + install -m 755 gen_funcs.sh $(DESTDIR)/$(PREFIX)/share/genkernel + install -m 755 gen_initramfs.sh $(DESTDIR)/$(PREFIX)/share/genkernel + install -m 755 gen_moddeps.sh $(DESTDIR)/$(PREFIX)/share/genkernel + install -m 755 gen_package.sh $(DESTDIR)/$(PREFIX)/share/genkernel + + install -m 644 initramfs.mounts $(DESTDIR)/$(SYSCONFDIR)/ + + cp -rp arch $(DESTDIR)/$(PREFIX)/share/genkernel/ + cp -rp defaults $(DESTDIR)/$(PREFIX)/share/genkernel/ + cp -rp modules $(DESTDIR)/$(PREFIX)/share/genkernel/ + cp -rp netboot $(DESTDIR)/$(PREFIX)/share/genkernel/ + cp -rp patches $(DESTDIR)/$(PREFIX)/share/genkernel/ + + install -d $(DESTDIR)/var/cache/genkernel/src + install -m 644 tarballs/* $(DESTDIR)/var/cache/genkernel/src/ + clean: rm -f $(EXTRA_DIST) @@ -22,4 +60,4 @@ dist: check-git-repository $(EXTRA_DIST) xz $(distdir).tar scp $(distdir).tar.xz lxnay@dev.gentoo.org:~/public_html/genkernel-next/ -.PHONY: clean check-git-repository dist +.PHONY: clean check-git-repository dist default install diff --git a/defaults/software.sh b/defaults/software.sh index c9faa73..b6e10c3 100644 --- a/defaults/software.sh +++ b/defaults/software.sh @@ -9,7 +9,7 @@ # - This file should not override previously defined variables, as their values may # originate from user changes to /etc/genkernel.conf . -BUSYBOX_VER="${BUSYBOX_VER:-VERSION_BUSYBOX}" +BUSYBOX_VER="${BUSYBOX_VER:-1.20.2}" BUSYBOX_SRCTAR="${BUSYBOX_SRCTAR:-${DISTDIR}/busybox-${BUSYBOX_VER}.tar.bz2}" BUSYBOX_DIR="${BUSYBOX_DIR:-busybox-${BUSYBOX_VER}}" BUSYBOX_BINCACHE="${BUSYBOX_BINCACHE:-%%CACHE%%/busybox-${BUSYBOX_VER}-%%ARCH%%.tar.bz2}" diff --git a/genkernel.bash b/genkernel.bash new file mode 100644 index 0000000..ed6b1c1 --- /dev/null +++ b/genkernel.bash @@ -0,0 +1,73 @@ +# genkernel (8) completion +# Copyright 2006 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# Written by Aron Griffis + +_genkernel() +{ + declare cur prev genkernel_help actions params + COMPREPLY=() + cur=${COMP_WORDS[COMP_CWORD]} + prev=${COMP_WORDS[COMP_CWORD-1]} + + # extract initial list of params/actions from genkernel --help + genkernel_help=$(command genkernel --help) + actions=( $(<<<"$genkernel_help" sed -n \ + '/^Available Actions:/,/^$/s/^[[:space:]]\+\([^[:space:]]\+\).*/\1/p') ) + params=( $(<<<"$genkernel_help" egrep -oe '--[^[:space:]]{2,}') ) + + # attempt to complete the current parameter based on the list + COMPREPLY=($(compgen -W "${params[*]/=*/=} ${actions[*]}" -- "$cur")) + + # if we don't have a rhs to complete + if [[ ${#COMPREPLY[@]} -gt 1 ]]; then + return + elif [[ ${#COMPREPLY[@]} -eq 0 && $cur != --*=* ]]; then + return + elif [[ ${#COMPREPLY[@]} -eq 1 && $COMPREPLY != --*= ]]; then + # using nospace completion, add an explicit space + COMPREPLY="${COMPREPLY} " + return + fi + + # we have a unique lhs and need to complete the rhs + declare args lhs rhs + if [[ ${#COMPREPLY[@]} -eq 1 ]]; then + lhs=$COMPREPLY + else + lhs=${cur%%=*}= + rhs=${cur#*=} + fi + + # genkernel's help gives clues as to what belongs on the rhs. + # extract the clue for the current parameter + args=" ${params[*]} " + args="${args##* $lhs}" + args="${args%% *}" + + # generate a list of completions for the argument; this replaces args with + # an array of results + args=( $(case $args in + ('<0-5>') compgen -W "$(echo {1..5})" -- "$rhs" ;; + (''|'') compgen -A file -o plusdirs -- "$rhs" ;; + ('') compgen -A directory -S / -- "$rhs" ;; + ('') compgen -G '*.tbz2' -G '*.tar.bz2' -o plusdirs -- "$rhs" ;; + (*) compgen -o bashdefault -- "$rhs" ;; # punt + esac) ) + + # we're using nospace completion to prevent spaces after paths that aren't + # "done" yet. So do some hacking to the args to add spaces after + # non-directories. + declare slash=/ + args=( "${args[@]/%/ }" ) # add space to all + args=( "${args[@]/%$slash /$slash}" ) # remove space from dirs + + # recreate COMPREPLY + if [[ $cur == "$lhs"* ]]; then + COMPREPLY=( "${args[@]}" ) + elif [[ ${#args[@]} -gt 0 ]]; then + COMPREPLY=( "${args[@]/#/$lhs}" ) + fi +} + +complete -o nospace -F _genkernel genkernel diff --git a/initramfs.mounts b/initramfs.mounts new file mode 100644 index 0000000..b34c675 --- /dev/null +++ b/initramfs.mounts @@ -0,0 +1,23 @@ +# This specifies which mounts from your fstab should be mounted before +# switching to the real root. If this file is missing, genkernel's code will +# default to just "/usr", which will suffice on most systems with a seperate +# /usr mount. +# +# If you have a complex configuration with a bindmount or symlink at /usr, or +# need some other mountpoints at boot, you should update this file such that +# /usr and anything else needed will be available after the switch into the +# real root. +# +# The lines without comments in this file are used as exact matches against the +# second column of your /etc/fstab and the device, fstype and mount options are +# taken from that line in fstab. If no line matches, the line from this file +# will be ignored. +# + +/usr + +# If you had some need of these: +#/usr/local +#/opt +#/var +#/home diff --git a/tarballs/busybox-1.20.2.tar.bz2 b/tarballs/busybox-1.20.2.tar.bz2 new file mode 100644 index 0000000..bb0ec05 Binary files /dev/null and b/tarballs/busybox-1.20.2.tar.bz2 differ