diff options
Diffstat (limited to 'auto')
-rwxr-xr-x | auto/build | 19 | ||||
-rwxr-xr-x | auto/clean | 46 | ||||
-rwxr-xr-x | auto/config | 6 | ||||
-rwxr-xr-x | auto/kanotix | 76 |
4 files changed, 126 insertions, 21 deletions
@@ -1,6 +1,8 @@ #!/bin/bash . config/bootstrap +. config/common +. config/kanotix bit=32 [ "$LH_ARCHITECTURE" = "amd64" ] && bit=64 @@ -10,7 +12,7 @@ perl -pi -e "s%(Kanotix|Excalibur|Hellfire)(32|64)%\${1}$bit%i; s%(32|64)(bit)%$ prebuild() { # Include nvidia-driver into chroot - if [ -f config/chroot_local-includes/usr/local/bin/install-nvidia-debian.sh ]; then + if [ "$LH_KANOTIX_NVIDIA" = "true" -a -f config/chroot_local-includes/usr/local/bin/install-nvidia-debian.sh ]; then mkdir -p config/chroot_local-includes/usr/src VER="$(grep -o ^VER=.* config/chroot_local-includes/usr/local/bin/install-nvidia-debian.sh|sed s/VER=//)" ARCH=; [ "$LH_ARCHITECTURE" = "amd64" ] && ARCH="_64" @@ -23,16 +25,13 @@ prebuild() cp "cache/$(basename "$URL")" "config/chroot_local-includes/usr/src/$(basename "$URL")" fi fi + exit 1 # DEBUG } -if [ -d tmpfs ]; then +if [ "$LH_KANOTIX_TMPFS" = "true" ]; then + mkdir -p tmpfs # build using tmpfs - if [ -z "$(stat --printf "%d\n" . tmpfs | uniq -u)" ]; then - # tmpfs not mounted yet - options=defaults - [ -f tmpfs/options ] && options="$(<tmpfs/options)" - mount -t tmpfs -o "$options" tmpfs tmpfs - fi + [ -z "$(stat --printf "%d\n" . tmpfs | uniq -u)" ] && mount -t tmpfs -o "$LH_KANOTIX_TMPFS_OPTIONS" tmpfs tmpfs cd tmpfs # delete everything except cache find . -maxdepth 1 ! -name cache -exec rm -r '{}' \; 2>/dev/null @@ -42,9 +41,9 @@ if [ -d tmpfs ]; then prebuild lh build noauto ${@} 2>&1 | tee binary.log cd .. - # prevent parent lh build (the "auto" one) from building again - exit 1 else prebuild lh build noauto ${@} 2>&1 | tee binary.log fi + +exit 1 @@ -3,7 +3,11 @@ rm -f build.log # Remove generated files -rm -f config/binary config/bootstrap config/chroot config/common config/source +rm -f config/binary config/bootstrap config/chroot config/common config/source config/kanotix +if [ -f config/all ]; then + sed -i '/^. config\/kanotix/d' config/all + [ ! -s config/all ] && rm -f config/all +fi # remove kanotix-scripts grep -oe '^[^ #]*' scripts.urls | grep -oe '[^/]*$' | xargs -i rm -f config/chroot_local-includes/usr/local/bin/{} @@ -19,13 +23,35 @@ then rmdir --ignore-fail-on-non-empty config fi -# umount tmpfs -if [ -e tmpfs ]; then - case "$1" in - --tmpfs|--all) - [ "$(stat --printf "%d\n" . tmpfs | uniq -u)" ] && umount tmpfs;; - esac - [ "$1" = "--tmpfs" ] && exit 1 -fi +# handle additional kanotix parameters +while [ "$1" ] +do + case "$1" in + --help) + lh clean noauto --help + echo -e "\nAdditional Options for Kanotix:\n\t[--tmpfs]\n" + exit 1 + ;; + --all) + if [ -d tmpfs ]; then + [ "$(stat --printf "%d\n" . tmpfs | uniq -u)" ] && umount tmpfs + rmdir tmpfs + fi + lh clean noauto --all + exit 1 + ;; + --tmpfs) + if [ -d tmpfs ]; then + [ "$(stat --printf "%d\n" . tmpfs | uniq -u)" ] && umount tmpfs + rmdir tmpfs + fi + ;; + *) + lh clean noauto "$1" + ;; + esac + shift +done + +exit 1 -exit 0 diff --git a/auto/config b/auto/config index 5441557..8ae4135 100755 --- a/auto/config +++ b/auto/config @@ -1,4 +1,4 @@ -#!/bin/sh +#!/bin/bash MIRROR_CHROOT=http://ftp.de.debian.org/debian MIRROR_CHROOT_SECURITY=http://security.debian.org/ @@ -6,6 +6,8 @@ MIRROR_BINARY=http://ftp.de.debian.org/debian MIRROR_BINARY_SECURITY=http://security.debian.org/ MIRROR_BOOTSTRAP="$MIRROR_CHROOT" +. auto/kanotix + lh config noauto \ --iso-volume KANOTIX \ --iso-preparer kanotix.com \ @@ -57,3 +59,5 @@ mkdir -p config/chroot_local-includes/usr/local/bin grep -oe '^[^ #]*' scripts.urls | wget -i- -c -N -q -P config/chroot_local-includes/usr/local/bin chmod 755 config/chroot_local-includes/usr/local/bin/*.sh +exit 1 + diff --git a/auto/kanotix b/auto/kanotix new file mode 100755 index 0000000..ac6ec48 --- /dev/null +++ b/auto/kanotix @@ -0,0 +1,76 @@ +#!/bin/bash + +[ -f config/kanotix ] && . config/kanotix + +usage() +{ +cat <<eof + +Additional Options for Kanotix: + [--include-nvidia true|false] + [--tmpfs true|false] + [--tmpfs-options OPTIONS] + +eof +} + +write_kanotix_config() +{ +[ -z "${LH_KANOTIX_NVIDIA}" ] && LH_KANOTIX_NVIDIA="true" +[ -z "${LH_KANOTIX_TMPFS}" ] && [ -d tmpfs ] && LH_KANOTIX_TMPFS="true" +[ -z "${LH_KANOTIX_TMPFS}" ] && LH_KANOTIX_TMPFS="false" +[ -z "${LH_KANOTIX_TMPFS_OPTIONS}" ] && [ -f tmpfs/options ] && LH_KANOTIX_TMPFS_OPTIONS="$(<tmpfs/options)" +[ -z "${LH_KANOTIX_TMPFS_OPTIONS}" ] && LH_KANOTIX_TMPFS_OPTIONS="defaults" +cat >config/kanotix << EOF +# config/kanotix - additional options for Kanotix + +# \$LH_KANOTIX_NVIDIA: include NVidia-Drivers into chroot +# (Default: ${LH_KANOTIX_NVIDIA}) +LH_KANOTIX_NVIDIA="${LH_KANOTIX_NVIDIA}" + +# \$LH_KANOTIX_TMPFS: use tmpfs to build +# (Default: ${LH_KANOTIX_TMPFS}) +LH_KANOTIX_TMPFS="${LH_KANOTIX_TMPFS}" + +# \$LH_KANOTIX_TMPFS_OPTIONS: options for tmpfs +# (Default: ${LH_KANOTIX_TMPFS_OPTIONS}) +LH_KANOTIX_TMPFS_OPTIONS="${LH_KANOTIX_TMPFS_OPTIONS}" + +EOF +grep -q ". config/kanotix" config/all 2>/dev/null || echo ". config/kanotix" >> config/all +} + +# process Kanotix config values +unset args; i=1 +while [ "$1" ] +do + case "$1" in + --include-nvidia) + LH_KANOTIX_NVIDIA="$2" + shift + ;; + --tmpfs) + LH_KANOTIX_TMPFS="$2" + shift + ;; + --tmpfs-options) + LH_KANOTIX_TMPFS_OPTIONS="$2" + shift + ;; + --help|-h) + lh config noauto --help + usage + exit 1 + ;; + *) + args[$i]="$1" + ((i++)) + ;; + esac + shift +done + +set -- "${args[@]}" + +write_kanotix_config + |