From 7baee36853d0fae399a951918c2b8ebe4e6da6a8 Mon Sep 17 00:00:00 2001 From: makefu Date: Mon, 20 Jan 2014 22:43:12 +0100 Subject: refactor vim configuration --- ship/lib/vim | 37 +++++++++++++++++++++++++++++++++++++ ship/src/vim_sane_defaults | 11 +++++++++++ 2 files changed, 48 insertions(+) create mode 100644 ship/lib/vim create mode 100644 ship/src/vim_sane_defaults (limited to 'ship') diff --git a/ship/lib/vim b/ship/lib/vim new file mode 100644 index 00000000..de1ec5b0 --- /dev/null +++ b/ship/lib/vim @@ -0,0 +1,37 @@ +# configure vim + +vimrc=$HOME/.vimrc + +vim_conf_sane_defaults(){ + cat >>$vimrc< +nnoremap +vnoremap +set wildignore=*.o,*.obj,*.bak,*.exe,*.os +colorscheme darkblue +set background=dark +set number +set mouse= +set shiftwidth=2 +set tabstop=2 +set et +set sw=2 +set smarttab +set autoindent +set backspace=indent,eol,start +set nocp +EOF +} diff --git a/ship/src/vim_sane_defaults b/ship/src/vim_sane_defaults new file mode 100644 index 00000000..eb8c4c5d --- /dev/null +++ b/ship/src/vim_sane_defaults @@ -0,0 +1,11 @@ +#!/bin/sh +#@strict +#@include core +#@include vim +#@punani +#@mainifyme +info "installing punani" +punani install vim +touch $vimrc +info "configuring vim" +vim_conf_sane_defaults -- cgit v1.2.3 From a774db6b3d89a106689fb1365f65b4a49c2dedec Mon Sep 17 00:00:00 2001 From: makefu Date: Mon, 20 Jan 2014 22:45:54 +0100 Subject: ship fix typo --- ship/lib/vim | 2 ++ ship/src/vim_sane_defaults | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) (limited to 'ship') diff --git a/ship/lib/vim b/ship/lib/vim index de1ec5b0..43173585 100644 --- a/ship/lib/vim +++ b/ship/lib/vim @@ -3,6 +3,7 @@ vimrc=$HOME/.vimrc vim_conf_sane_defaults(){ + # TODO - make stuff more modular? cat >>$vimrc< Date: Wed, 22 Jan 2014 16:00:49 +0100 Subject: fix broken 'strict' in ship/build --- ship/build | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'ship') diff --git a/ship/build b/ship/build index 3f96cfe1..730f72ee 100755 --- a/ship/build +++ b/ship/build @@ -43,8 +43,7 @@ EOF ## usage: #@strict -> build_strict_mode \1 build_strict_mode() { cat< Date: Tue, 4 Feb 2014 23:35:53 +0100 Subject: ship build: refix broken 'strict' --- ship/build | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'ship') diff --git a/ship/build b/ship/build index 730f72ee..bcb1f504 100755 --- a/ship/build +++ b/ship/build @@ -43,7 +43,8 @@ EOF ## usage: #@strict -> build_strict_mode \1 build_strict_mode() { cat</dev/null) && set -o posix EOF } -- cgit v1.2.3 From c34e9d3f15a12fb52cfa691c6cb8fd9062a36580 Mon Sep 17 00:00:00 2001 From: tv Date: Tue, 4 Feb 2014 23:38:21 +0100 Subject: ship build: refix harder --- ship/build | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'ship') diff --git a/ship/build b/ship/build index bcb1f504..0e8e1013 100755 --- a/ship/build +++ b/ship/build @@ -44,7 +44,7 @@ EOF build_strict_mode() { cat</dev/null) && set -o posix +(set -o posix 2>/dev/null) && set -o posix || : EOF } -- cgit v1.2.3 From f46851de1af7c044471523c40e0fe88579b8a997 Mon Sep 17 00:00:00 2001 From: makefu Date: Thu, 20 Feb 2014 18:50:20 +0100 Subject: add proposal for find-supers this script may be used when bootstrapping new retiolum nodes --- ship/lib/retiolum | 76 +++++++++++++++++++++++++++++++++++++++++++++++ ship/src/find-supers-tinc | 6 ++++ 2 files changed, 82 insertions(+) create mode 100644 ship/lib/retiolum create mode 100644 ship/src/find-supers-tinc (limited to 'ship') diff --git a/ship/lib/retiolum b/ship/lib/retiolum new file mode 100644 index 00000000..015537bd --- /dev/null +++ b/ship/lib/retiolum @@ -0,0 +1,76 @@ +#!/bin/sh +# retiolum host functions +#@include core +netname=${netname:-retiolum} + + +check_free_v4(){ + myipv4=${1-10.243.0.-1} + v4num=${myipv4##*.} + printf "Retard check: " + if [ "$v4num" -gt 0 -a "$v4num" -lt "256" ]; + then + info "No retard detected\n" + cd /etc/tinc/$netname/hosts + info "Check if ip is still free: " + for i in `ls -1`; do + if grep -q -e $myipv4\$ $i ;then + warn "Host IP already taken by $i! " + return 1 + fi + done + info "Passed\n" + return 0 + else + error "you are made of stupid. bailing out\n" + return 1 + fi + cd - >/dev/null +} + +find_active_nodes(){ + # TODO this function currently only supports a single address for a host + cd /etc/tinc/retiolum/hosts + # posix grep does not support [[:space:]] + for name in ` + grep '^[ ]*Address[ ]*=' * | + cut -d: -f1 | sort | uniq + `; do + if eval "`sed -n ' + s/[ ]\+//g + s/^\(Address\|Port\)=\(.*\)/\1="\${\1+\$\1\n}\2"/p + ' $name`"; then + port=${Port-655} + for host in $Address; do + if nc -zw 2 $host $port 2>/dev/null; then + echo "$name [('$host', $port)]" + fi & + done + wait + fi & + done + wait + cd - >/dev/null +} +find_supernodes(){ + cd /etc/tinc/retiolum/hosts + for name in ` + grep '^[ ]*Address[ ]*=' * | + cut -d: -f1 | sort | uniq + `; do + if eval "`sed -n ' + s/[ ]\+//g + s/^\(Address\|Port\)=\(.*\)/\1="\${\1+\$\1\n}\2"/p + ' $name`"; then + port=${Port-655} + for host in $Address; do + if nc -zw 2 $host $port 2>/dev/null; then + echo "$name [('$host', $port)]" + fi & + done + wait + fi & + done + wait + cd - >/dev/null +} diff --git a/ship/src/find-supers-tinc b/ship/src/find-supers-tinc new file mode 100644 index 00000000..edbb5a7b --- /dev/null +++ b/ship/src/find-supers-tinc @@ -0,0 +1,6 @@ +#!/bin/sh +#@include core +#@include retiolum + +find_supernodes | cut -d\ -f 1 | shuf | head -n 5 \ + | xargs -n1 printf "ConnectTo=%s\n" -- cgit v1.2.3 From 1046da40ddc283cdec9d3156ecd6a37117c083cf Mon Sep 17 00:00:00 2001 From: makefu Date: Fri, 21 Feb 2014 13:23:05 +0100 Subject: add //ship/src/refresh-supers this script updates the currently configured supernodes in /etc/tinc/retiolum/tinc.conf with 5 random working supernodes in the retiolum darknet. The tinc.conf file can be given via environment. the hosts should be up-to-date in order to find all available supernodes. --- ship/lib/retiolum | 11 +++++++---- ship/src/find-supers-tinc | 4 ++-- ship/src/refresh-supers | 26 ++++++++++++++++++++++++++ 3 files changed, 35 insertions(+), 6 deletions(-) create mode 100644 ship/src/refresh-supers (limited to 'ship') diff --git a/ship/lib/retiolum b/ship/lib/retiolum index 015537bd..2a5c7338 100644 --- a/ship/lib/retiolum +++ b/ship/lib/retiolum @@ -1,8 +1,9 @@ #!/bin/sh # retiolum host functions #@include core +tinc_path=${tinc_path:-/etc/tinc} netname=${netname:-retiolum} - +hosts_dir=${hosts_dir:-$tinc_path/$netname/hosts} check_free_v4(){ myipv4=${1-10.243.0.-1} @@ -11,7 +12,7 @@ check_free_v4(){ if [ "$v4num" -gt 0 -a "$v4num" -lt "256" ]; then info "No retard detected\n" - cd /etc/tinc/$netname/hosts + cd $hosts_dir info "Check if ip is still free: " for i in `ls -1`; do if grep -q -e $myipv4\$ $i ;then @@ -30,8 +31,9 @@ check_free_v4(){ find_active_nodes(){ # TODO this function currently only supports a single address for a host - cd /etc/tinc/retiolum/hosts + cd $hosts_dir # posix grep does not support [[:space:]] + set +f for name in ` grep '^[ ]*Address[ ]*=' * | cut -d: -f1 | sort | uniq @@ -53,7 +55,8 @@ find_active_nodes(){ cd - >/dev/null } find_supernodes(){ - cd /etc/tinc/retiolum/hosts + cd $hosts_dir + set +f for name in ` grep '^[ ]*Address[ ]*=' * | cut -d: -f1 | sort | uniq diff --git a/ship/src/find-supers-tinc b/ship/src/find-supers-tinc index edbb5a7b..3ea53d35 100644 --- a/ship/src/find-supers-tinc +++ b/ship/src/find-supers-tinc @@ -1,6 +1,6 @@ #!/bin/sh +#@info #@include core #@include retiolum -find_supernodes | cut -d\ -f 1 | shuf | head -n 5 \ - | xargs -n1 printf "ConnectTo=%s\n" +find_supernodes diff --git a/ship/src/refresh-supers b/ship/src/refresh-supers new file mode 100644 index 00000000..26909a94 --- /dev/null +++ b/ship/src/refresh-supers @@ -0,0 +1,26 @@ +#!/bin/sh +#@info +# usage: [DEBUG=1] [tincconf=/not/tinc/retiolum/tinc.conf] $0 +#@include core +#@include retiolum + # using find_supernodes + # tinc_path + # netname + +#@strict +#@mainifyme + +max_connect_to=${max_connect_to:-5} +tincconf=${tincconf:-$tinc_path/$netname/tinc.conf} +tmp_tincconf=$(mktemp) +defer "rm -f $tmp_tincconf" + +sed '/[ ]*ConnectTo=/d' "$tincconf" > "$tmp_tincconf" + +find_supernodes | cut -d\ -f 1 | shuf \ + | head -n "${max_connect_to}" \ + | xargs -n1 printf "ConnectTo=%s\n" >> "$tmp_tincconf" + +info "replacing old tinc.conf with one" +test "${DEBUG:-}" && diff "$tincconf" "$tmp_tincconf" +mv "$tmp_tincconf" "$tincconf" -- cgit v1.2.3 From 823bb86ca91da435ce631e9c17ffdcf9f803e6ae Mon Sep 17 00:00:00 2001 From: makefu Date: Fri, 21 Feb 2014 13:26:30 +0100 Subject: update TODO --- ship/TODO | 2 ++ 1 file changed, 2 insertions(+) (limited to 'ship') diff --git a/ship/TODO b/ship/TODO index e69de29b..7c2fe73f 100644 --- a/ship/TODO +++ b/ship/TODO @@ -0,0 +1,2 @@ +- refresh-supers: somehow test if a real tinc connection is possible to new + given supernodes -- cgit v1.2.3 From be4d573b21895449e57a8263a5a9ca292500a74b Mon Sep 17 00:00:00 2001 From: makefu Date: Wed, 26 Feb 2014 17:04:54 +0100 Subject: sort //ship/lib/retiolum --- ship/lib/retiolum | 56 ++++++++++++++++++++++++++++--------------------------- 1 file changed, 29 insertions(+), 27 deletions(-) (limited to 'ship') diff --git a/ship/lib/retiolum b/ship/lib/retiolum index 2a5c7338..3956a200 100644 --- a/ship/lib/retiolum +++ b/ship/lib/retiolum @@ -5,34 +5,9 @@ tinc_path=${tinc_path:-/etc/tinc} netname=${netname:-retiolum} hosts_dir=${hosts_dir:-$tinc_path/$netname/hosts} -check_free_v4(){ - myipv4=${1-10.243.0.-1} - v4num=${myipv4##*.} - printf "Retard check: " - if [ "$v4num" -gt 0 -a "$v4num" -lt "256" ]; - then - info "No retard detected\n" - cd $hosts_dir - info "Check if ip is still free: " - for i in `ls -1`; do - if grep -q -e $myipv4\$ $i ;then - warn "Host IP already taken by $i! " - return 1 - fi - done - info "Passed\n" - return 0 - else - error "you are made of stupid. bailing out\n" - return 1 - fi - cd - >/dev/null -} -find_active_nodes(){ - # TODO this function currently only supports a single address for a host +find_supernodes(){ cd $hosts_dir - # posix grep does not support [[:space:]] set +f for name in ` grep '^[ ]*Address[ ]*=' * | @@ -54,8 +29,11 @@ find_active_nodes(){ wait cd - >/dev/null } -find_supernodes(){ + +find_active_nodes(){ + # TODO this function currently only supports a single address for a host cd $hosts_dir + # posix grep does not support [[:space:]] set +f for name in ` grep '^[ ]*Address[ ]*=' * | @@ -77,3 +55,27 @@ find_supernodes(){ wait cd - >/dev/null } + +check_free_v4(){ + myipv4=${1-10.243.0.-1} + v4num=${myipv4##*.} + printf "Retard check: " + if [ "$v4num" -gt 0 -a "$v4num" -lt "256" ]; + then + info "No retard detected\n" + cd $hosts_dir + info "Check if ip is still free: " + for i in `ls -1`; do + if grep -q -e $myipv4\$ $i ;then + warn "Host IP already taken by $i! " + return 1 + fi + done + info "Passed\n" + return 0 + else + error "you are made of stupid. bailing out\n" + return 1 + fi + cd - >/dev/null +} -- cgit v1.2.3 From d818d26256380d1be91cb3d449271da96adb2105 Mon Sep 17 00:00:00 2001 From: makefu Date: Wed, 26 Feb 2014 22:53:35 +0100 Subject: implement IRC proposal to refresh supernodes //ship/src/refresh-supers is the script which will update your tinc config and choose 5 working supernodes for you to connect to. This proposal may become part of the tinc.krebsco.de install script --- ship/lib/retiolum | 20 +++++++++++++++++++- ship/src/refresh-super-keys | 5 +++++ ship/src/refresh-supers | 9 ++++++++- 3 files changed, 32 insertions(+), 2 deletions(-) create mode 100644 ship/src/refresh-super-keys (limited to 'ship') diff --git a/ship/lib/retiolum b/ship/lib/retiolum index 3956a200..1e55041c 100644 --- a/ship/lib/retiolum +++ b/ship/lib/retiolum @@ -1,10 +1,28 @@ #!/bin/sh # retiolum host functions #@include core +#@include network tinc_path=${tinc_path:-/etc/tinc} netname=${netname:-retiolum} hosts_dir=${hosts_dir:-$tinc_path/$netname/hosts} +supernode_urls="http://euer.krebsco.de/retiolum/supernodes.tar.gz" +reload_tinc(){ + info "reloading tinc configuration" + pkill -HUP tincd || tinc -n $netname reload; +} +refresh_supernode_keys(){ + for url in $supernode_urls;do + info "Trying $url to retrieve supernodes" + if http_get "$url" \ + | tar xvz -C $hosts_dir | xargs -n1 echo "refreshed:" ;then + info "refreshed supernode keys" + return 0 + else + error "$url unusable for retrieving supernode host files" + fi + done && return 1 +} find_supernodes(){ cd $hosts_dir @@ -67,7 +85,7 @@ check_free_v4(){ info "Check if ip is still free: " for i in `ls -1`; do if grep -q -e $myipv4\$ $i ;then - warn "Host IP already taken by $i! " + error "Host IP already taken by $i! " return 1 fi done diff --git a/ship/src/refresh-super-keys b/ship/src/refresh-super-keys new file mode 100644 index 00000000..dddbe846 --- /dev/null +++ b/ship/src/refresh-super-keys @@ -0,0 +1,5 @@ +#!/bin/sh +#@info +#@include retiolum +#@mainifyme +refresh_supernode_keys diff --git a/ship/src/refresh-supers b/ship/src/refresh-supers index 26909a94..af31a5df 100644 --- a/ship/src/refresh-supers +++ b/ship/src/refresh-supers @@ -1,6 +1,9 @@ #!/bin/sh #@info # usage: [DEBUG=1] [tincconf=/not/tinc/retiolum/tinc.conf] $0 +# This is the implementation of the proposal how to update tinc supernode +# connections + #@include core #@include retiolum # using find_supernodes @@ -10,12 +13,14 @@ #@strict #@mainifyme +refresh_supernode_keys + max_connect_to=${max_connect_to:-5} tincconf=${tincconf:-$tinc_path/$netname/tinc.conf} tmp_tincconf=$(mktemp) defer "rm -f $tmp_tincconf" -sed '/[ ]*ConnectTo=/d' "$tincconf" > "$tmp_tincconf" +sed '/^[ ]*ConnectTo/d' "$tincconf" > "$tmp_tincconf" find_supernodes | cut -d\ -f 1 | shuf \ | head -n "${max_connect_to}" \ @@ -24,3 +29,5 @@ find_supernodes | cut -d\ -f 1 | shuf \ info "replacing old tinc.conf with one" test "${DEBUG:-}" && diff "$tincconf" "$tmp_tincconf" mv "$tmp_tincconf" "$tincconf" + +tinc_reload -- cgit v1.2.3 From 43fb2f1208c45ae97002d61e131b40161709fbcf Mon Sep 17 00:00:00 2001 From: makefu Date: Wed, 26 Feb 2014 23:21:10 +0100 Subject: fix typo in //ship/src/refresh-supers --- ship/src/refresh-supers | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'ship') diff --git a/ship/src/refresh-supers b/ship/src/refresh-supers index af31a5df..a35e2229 100644 --- a/ship/src/refresh-supers +++ b/ship/src/refresh-supers @@ -30,4 +30,4 @@ info "replacing old tinc.conf with one" test "${DEBUG:-}" && diff "$tincconf" "$tmp_tincconf" mv "$tmp_tincconf" "$tincconf" -tinc_reload +reload_tinc -- cgit v1.2.3 From 3bf91dd3f4569f17c0077938bef65f8df1050d72 Mon Sep 17 00:00:00 2001 From: makefu Date: Fri, 28 Feb 2014 01:51:55 +0100 Subject: add zsh to punani db --- ship/lib/_punani_db | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'ship') diff --git a/ship/lib/_punani_db b/ship/lib/_punani_db index 721b5fa2..609baf07 100644 --- a/ship/lib/_punani_db +++ b/ship/lib/_punani_db @@ -39,6 +39,10 @@ _punanidb_pacman_tinc=tinc _punanidb_yum_tinc=tinc _punanidb_aptget_tinc=tinc +_punanidb_pacman_zsh=zsh +_punanidb_yum_zsh=zsh +_punanidb_aptget_zsh=zsh + _punanidb_pacman_tor=tor _punanidb_yum_tor=tor _punanidb_aptget_tor=tor -- cgit v1.2.3 From b201fb5074cb38ce713fce42b97cf6e23b5c7e79 Mon Sep 17 00:00:00 2001 From: makefu Date: Fri, 28 Feb 2014 01:58:48 +0100 Subject: update makefu env bootstrapping --- ship/src/bootstrap_env_makefu | 51 +++++-------------------------------------- 1 file changed, 6 insertions(+), 45 deletions(-) (limited to 'ship') diff --git a/ship/src/bootstrap_env_makefu b/ship/src/bootstrap_env_makefu index 7ec59a79..44148665 100755 --- a/ship/src/bootstrap_env_makefu +++ b/ship/src/bootstrap_env_makefu @@ -4,6 +4,9 @@ #@strict #@include core #@include punani +#@include vim +#@mainifyme + info "Configuring environment for $(id -un)" cd $(readlink -f $(dirname $0)) info "Using punani to install git vim and zsh" @@ -68,43 +71,22 @@ mkdir -p $HOME/.vim # TODO modilarize vimconfig cat > $HOME/.vim/vimrc < -nnoremap -vnoremap " pasting nnoremap :set invpaste paste? set pastetoggle= @@ -114,34 +96,13 @@ set showmode au FocusLost * :wa set spelllang=en -" use set spell to enable spelling - -" press ttt to rot16 the whole file -nmap ttt ggg?G - -colorscheme darkblue -set background=dark -set number -set mouse= set textwidth=9001 -set ignorecase -set incsearch -set wildignore=*.o,*.obj,*.bak,*.exe,*.os - -set shiftwidth=2 -set tabstop=2 -set et -set sw=2 -set smarttab -set autoindent -" end tabstop -set backspace=indent,eol,start -set nocp autocmd BufRead *.json set filetype=json EOF ln -vs $HOME/.vim/vimrc $HOME/.vimrc +vim_conf_sane_defaults #install all the vim stuff with the help of vundle cd $HOME/.vim -- cgit v1.2.3 From fb75532f8ac05761955ea25ed0d00ce66a6567db Mon Sep 17 00:00:00 2001 From: makefu Date: Fri, 7 Mar 2014 14:25:40 +0100 Subject: update env-bootstrapping --- ship/lib/vim | 1 + ship/src/bootstrap_env_makefu | 27 +++++++++++++++++++++++---- 2 files changed, 24 insertions(+), 4 deletions(-) (limited to 'ship') diff --git a/ship/lib/vim b/ship/lib/vim index 43173585..f75f3d0e 100644 --- a/ship/lib/vim +++ b/ship/lib/vim @@ -22,6 +22,7 @@ inoremap nnoremap vnoremap set wildignore=*.o,*.obj,*.bak,*.exe,*.os +cmap w!! w !sudo tee > /dev/null % colorscheme darkblue set background=dark set number diff --git a/ship/src/bootstrap_env_makefu b/ship/src/bootstrap_env_makefu index 44148665..6c75cd57 100755 --- a/ship/src/bootstrap_env_makefu +++ b/ship/src/bootstrap_env_makefu @@ -5,12 +5,23 @@ #@include core #@include punani #@include vim + +# vim +python +_punanidb_pacman_vim_python=gvim +_punanidb_yum_vim_python=vim-enhanced +_punanidb_aptget_vim_python=vim + +# TODO pull out youcompleteme into a vim function +# cmake ,make,g++,python-dev for youcompleteme +_punanidb_pacman_cmake=cmake +_punanidb_yum_cmake=cmake +_punanidb_aptget_cmake=cmake #@mainifyme info "Configuring environment for $(id -un)" cd $(readlink -f $(dirname $0)) info "Using punani to install git vim and zsh" -punani install git vim zsh || error "cannot install some shit" +punani install git vim_python zsh gpp cmake make python2_dev || die "cannot install some shit" info "writing dotfiles" # deploying zshrc @@ -100,19 +111,27 @@ set spelllang=en set textwidth=9001 autocmd BufRead *.json set filetype=json EOF - +if [ -e $HOME/.vimrc ] ; then + oldvim=$HOME/.vimrc.`date +%Y%M%d` + info "Backing up old vimrc file to $oldvim" + mv -v $HOME/.vimrc $oldvim +fi +info "Symlinking .vimrc to .vim/vimrc" ln -vs $HOME/.vim/vimrc $HOME/.vimrc vim_conf_sane_defaults #install all the vim stuff with the help of vundle cd $HOME/.vim -mkdir bundle -mkdir backup +mkdir -p bundle info "Fetching vim-vundle" git clone https://github.com/gmarik/vundle.git bundle/vundle > /dev/null && \ info "Vim Vundle deployed" info "Installing Vundle Bundles" vim "+:BundleInstall" "+:qall" + +info "building youcompleteme libs" +cd $HOME/.vim/bundle/YouCompleteMe +./install.sh cd - info "configuring zsh" -- cgit v1.2.3 From c6b10ba46ea17f4ff0bc2f666dc1237fbb643b9d Mon Sep 17 00:00:00 2001 From: makefu Date: Fri, 7 Mar 2014 14:26:52 +0100 Subject: whatweb is now up-to-date --- ship/lib/_punani_db | 1 + 1 file changed, 1 insertion(+) (limited to 'ship') diff --git a/ship/lib/_punani_db b/ship/lib/_punani_db index 609baf07..e5bf15b1 100644 --- a/ship/lib/_punani_db +++ b/ship/lib/_punani_db @@ -54,3 +54,4 @@ _punanidb_aptget_nano=nano _punanidb_pacman_vim=vim _punanidb_yum_vim=vim-enhanced _punanidb_aptget_vim=vim + -- cgit v1.2.3 From f91c15a6ac8e94dae54f4cdaa93defd3f7006226 Mon Sep 17 00:00:00 2001 From: makefu Date: Fri, 7 Mar 2014 15:51:25 +0100 Subject: update docker to remove itself after completion --- ship/t/docker/docker_remote_punani.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'ship') diff --git a/ship/t/docker/docker_remote_punani.sh b/ship/t/docker/docker_remote_punani.sh index 1eab1a42..c006f013 100755 --- a/ship/t/docker/docker_remote_punani.sh +++ b/ship/t/docker/docker_remote_punani.sh @@ -1,5 +1,5 @@ #!/bin/sh cd $(dirname $(readlink -f $0)) -docker_id=$(docker run -d -v $PWD/punani/:/test ubuntu /bin/sh /test/remote_punani) +docker_id=$(docker run -rm=true -d -v $PWD/punani/:/test ubuntu /bin/sh /test/remote_punani) trap "docker rm $docker_id" INT TERM EXIT QUIT docker wait $docker_id -- cgit v1.2.3 From e0a6751890271e073f756cabdf1b9bcdb068712e Mon Sep 17 00:00:00 2001 From: makefu Date: Fri, 7 Mar 2014 16:04:34 +0100 Subject: unfix all the docker tests, sorry :( --- ship/src/refresh-supers | 2 ++ ship/t/docker/docker_remote_punani.sh | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) (limited to 'ship') diff --git a/ship/src/refresh-supers b/ship/src/refresh-supers index a35e2229..6dc6e8ab 100644 --- a/ship/src/refresh-supers +++ b/ship/src/refresh-supers @@ -22,6 +22,8 @@ defer "rm -f $tmp_tincconf" sed '/^[ ]*ConnectTo/d' "$tincconf" > "$tmp_tincconf" + +# TODO find_supernodes requires netcat find_supernodes | cut -d\ -f 1 | shuf \ | head -n "${max_connect_to}" \ | xargs -n1 printf "ConnectTo=%s\n" >> "$tmp_tincconf" diff --git a/ship/t/docker/docker_remote_punani.sh b/ship/t/docker/docker_remote_punani.sh index c006f013..1eab1a42 100755 --- a/ship/t/docker/docker_remote_punani.sh +++ b/ship/t/docker/docker_remote_punani.sh @@ -1,5 +1,5 @@ #!/bin/sh cd $(dirname $(readlink -f $0)) -docker_id=$(docker run -rm=true -d -v $PWD/punani/:/test ubuntu /bin/sh /test/remote_punani) +docker_id=$(docker run -d -v $PWD/punani/:/test ubuntu /bin/sh /test/remote_punani) trap "docker rm $docker_id" INT TERM EXIT QUIT docker wait $docker_id -- cgit v1.2.3 From 2c7569f73fc49f0ba0279d6db877bdfcfdee9bb7 Mon Sep 17 00:00:00 2001 From: makefu Date: Sun, 9 Mar 2014 12:44:49 +0100 Subject: make irc send verbose again --- ship/lib/network | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'ship') diff --git a/ship/lib/network b/ship/lib/network index 974fb282..bc4d1047 100644 --- a/ship/lib/network +++ b/ship/lib/network @@ -95,5 +95,5 @@ send_irc(){ echo "JOIN $IRCCHANNEL"; sleep 23; while read line; do echo "PRIVMSG $IRCCHANNEL :$line";sleep 1;done - sleep 5; ) | run_telnet $IRCSERVER $IRCPORT 2>/dev/null | line_to_dot + sleep 5; ) | run_telnet $IRCSERVER $IRCPORT 2>/dev/null } -- cgit v1.2.3 From 5c9d8118729c2e5524324bc340da45405ce69505 Mon Sep 17 00:00:00 2001 From: makefu Date: Sun, 9 Mar 2014 12:45:23 +0100 Subject: add filehooker ncdc pseudocode --- ship/lib/filehooker | 56 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 56 insertions(+) create mode 100644 ship/lib/filehooker (limited to 'ship') diff --git a/ship/lib/filehooker b/ship/lib/filehooker new file mode 100644 index 00000000..fac84b93 --- /dev/null +++ b/ship/lib/filehooker @@ -0,0 +1,56 @@ +#@include core +#@include tmux +# +netshare= +dc_hub=${dc_hub:-adcs://localhost:2781} +ncdc_user=hooker +ncdc_install(){ +curl http://dev.yorhel.nl/download/ncdc-linux-x86_64-1.19.tar.gz | tar xz -C /usr/bin/ +} + + + +ncdc_configure(){ + # maybe we want to use the running ncdc process and communicate via tmux send-keys ? + (sleep 1;cat;printf "/quit\n") | sudo -u $ncdc_user +# not implemented yet +# /set active +# /share $random $netshare +: +} +ncdc_configure_netshare(){ + :${1?provide path to share} + rnd=`hexdump -n 2 -e '/2 "%u"' /dev/urandom` + rnd_name="share_$rnd" + info "setting active as true" + info "adding share" + (echo "/set active true" ; + echo "/share $rnd_name $1") | ncdc_configure + +} +ncdc_configure_hub(){ + info "configuring DC Hub: $dc_hub, activating autconnect" + (echo "/open c1 $dc_hub" ; + echo "/hset autoconnect true") | ncdc_configure +} +ncdc_autostart(){ +# only systemd +# punani install tmux +cat > /etc/systemd/system/ncdc@.service < Date: Sun, 9 Mar 2014 12:45:40 +0100 Subject: add lib to deploy pubkeys for user --- ship/lib/krebs | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 ship/lib/krebs (limited to 'ship') diff --git a/ship/lib/krebs b/ship/lib/krebs new file mode 100644 index 00000000..e47031d6 --- /dev/null +++ b/ship/lib/krebs @@ -0,0 +1,16 @@ +#@include core +krebs_pubkeys="ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQC7YrLdnXDRU2XEdZDu1BmgiT0Vaxplf3bfvSm+5o3g4AcR2yCv7h2D633c9uA0gq52EJ3V5m8B1ZcxqA0zqDptKwx+ZTMUGDls7StH5xpJyk9j5gf8DzyDLQPQG2IYszCH+8esKjo3BOFxfey8NaX+k6gvQsG3lyV0PjLvvIy4gDuMn6dPZfVAlwNYFOUNgwpku3W3A0d+UFyVjt3/sgZxM+8C3y6QE1gwT5/NfBbHM5vaEqjHcVq1ui+7a4iOXFGKkZDcd7EX6cQZSbCzZL7sZ0OmB1WpAsDCvIXfzX1YfNA0sso7ldSF6ZUGNgwEk1LootnQlCK/dfbM+i62SZ+1 tv@iiso +ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCv9TTt4FkzT3jlQ0VS2tX/GpQO9Ef0wIQ+g96foe4qSniBwR667T1gIhURrod/p7N9oQcWRrNohjgmSBZRYA0kW6ZyqYJkLvRv54nXv6j/8Xq2nG/KVfDqL0kp8if+JGeFlQElpWJiAbGifYkopFy69QiLYU2ndR7aPbx+5qm/dcwPJ7K+n6dyePynCZadtcabm3PuBFUxGLdT9ImDXMOPfXxPMlN/3eb78byuEuHnhCIvIGLMBGx+8QTXvu7kHpZObvkbsF1xjVs9fDpwVLjh7GWdwf3BZ/agFlI24ffyqCPFnuaxUVyfUZeqf4twRsIZkTTB47lHDhYiVkyGe8gd root@pigstarter.de +ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCl3RTOHd5DLiVeUbUr/GSiKoRWknXQnbkIf+uNiFO+XxiqZVojPlumQUVhasY8UzDzj9tSDruUKXpjut50FhIO5UFAgsBeMJyoZbgY/+R+QKU00Q19+IiUtxeFol/9dCO+F4o937MC0OpAC10LbOXN/9SYIXueYk3pJxIycXwUqhYmyEqtDdVh9Rx32LBVqlBoXRHpNGPLiswV2qNe0b5p919IGcslzf1XoUzfE3a3yjk/XbWh/59xnl4V7Oe7+iQheFxOT6rFA30WYwEygs5As//ZYtxvnn0gA02gOnXJsNjOW9irlxOUeP7IOU6Ye3WRKFRR0+7PS+w8IJLag2xb makefu@pornocauster +ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQC7df1RfMGNHPJe0iF6rD9DBs/4VujN6nNr7RbRCFk7HF/JzLXSn9Vcwk+3JefP4/d/bUo0h03rhQaRohDhBScrJidj2YacF6gmZOuTf3AMWprdz9D/1dDkN/ytwzGhADhqbHEWeomIllsa8Up4PvEeDcIHJGzYvuc0BbGqRk0XgxwqIrLAhdpTfEKaTbt7IzmUqEofxThTZ/4k020PKn2WDBWKQYGZJ9Ba2WzlKUXWx842ncW29oxC2faRz4M3eMPy0JMpBLkK9U3dccE75dgT/89/4ofVjM7+J3FOP3dgXzrtk+A5aN5a/veJUViQ9xdGxXvoa++iCr5q/BVRv0Bb sammy@muhbaasu.de +ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDOIRWLC4ESCDxjyoJUqaUNC8ZDiE4UICZk3cbDptdtendTQvjSXz0RW6MWhJ+F6wWZntL1EibKn8djax1tzgcvNASCUEtGey/850IzBIrETs+WQDRjV2QqBKWxVaQPIFjw2V3vFSKKNxq01qznVBY510DIf4+0WR8b1ZPD/XbuyQLGYM3N7dP4JQSnnNAgtyutBKdomWfT18hW1lLjkP8h1IOiC03HxXTYX+nMUiLDff3D5GT5u3Ke2+VigXjz4Ue8rVsOg/zgqrwEAfx8o1q83uSB23oqUqWkqlxOC/4QY5kpdNqW/Iz89zHibp5ZceHd2ZSoGefv7UZM0lRIDHjJ retiolum@ire +ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQC3+2vSwiJoIpHpnkw4SslPrlR6/z43nZ7s1tGXkkNnVDB2uzxMaISNRjSk0GgXpDx4hLEi6074hSvv5JWbUuMyKr9n6GVVeYNCjsiPcRkL3d7zDwFwqyndhVeWgmpuylYx4XKIbTvpBVyG3CRT1+D4apVUgiDa9lVfjBk7/ESxBzt0dXtlJEzQBBoCo0C8jeeIpvZKbq1zeM9wvLsgFaT7fsSxrg5BEb/tQl6pbkykWFXbzzd91liEQaSqai7Ux2355ZXGANQBCTglKhdTcir0RuHNtQGrZHBxL9qVfJjJJNZg1b6UAhDanqE/HyOI3sp6LGBvpW5afLKOdj9ppQQN retiolum@nomic +ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAp83zynhIueJJsWlSEykVSBrrgBFKq38+vT8bRfa+csqyjZBl2SQFuCPo+Qbh49mwchpZRshBa9jQEIGqmXxv/PYdfBFQuOFgyUq9ZcTZUXqeynicg/SyOYFW86iiqYralIAkuGPfQ4howLPVyjTZtWeEeeEttom6p6LMY5Aumjz2em0FG0n9rRFY2fBzrdYAgk9C0N6ojCs/Gzknk9SGntA96MDqHJ1HXWFMfmwOLCnxtE5TY30MqSmkrJb7Fsejwjoqoe9Y/mCaR0LpG2cStC1+37GbHJNH0caCMaQCX8qdfgMVbWTVeFWtV6aWOaRgwLrPDYn4cHWQJqTfhtPrNQ== death@uriel" + +authorized_keys_file="${authorized_keys:-$HOME/.ssh/authorized_keys}" +deploy_krebs_pubkeys(){ +info "deploying pubkeys in $authorized_keys_file" +mkdir -p "$(dirname "$authorized_keys_file")" +printf "$krebs_pubkeys\n" >> "$authorized_keys_file" + +} -- cgit v1.2.3 From fc166354da369e4a9e3e635d5026ecf4f8ee11f4 Mon Sep 17 00:00:00 2001 From: makefu Date: Sun, 9 Mar 2014 21:44:17 +0100 Subject: ship:/lib/filehooker set nick --- ship/lib/filehooker | 36 ++++++++------ ship/src/filehooker_install | 118 ++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 138 insertions(+), 16 deletions(-) create mode 100755 ship/src/filehooker_install (limited to 'ship') diff --git a/ship/lib/filehooker b/ship/lib/filehooker index fac84b93..bd658c42 100644 --- a/ship/lib/filehooker +++ b/ship/lib/filehooker @@ -1,22 +1,13 @@ #@include core -#@include tmux -# + netshare= dc_hub=${dc_hub:-adcs://localhost:2781} -ncdc_user=hooker -ncdc_install(){ -curl http://dev.yorhel.nl/download/ncdc-linux-x86_64-1.19.tar.gz | tar xz -C /usr/bin/ -} - +ncdc_user=${ncdc_user:-hooker} -ncdc_configure(){ +ncdc_config(){ # maybe we want to use the running ncdc process and communicate via tmux send-keys ? (sleep 1;cat;printf "/quit\n") | sudo -u $ncdc_user -# not implemented yet -# /set active -# /share $random $netshare -: } ncdc_configure_netshare(){ :${1?provide path to share} @@ -25,14 +16,27 @@ ncdc_configure_netshare(){ info "setting active as true" info "adding share" (echo "/set active true" ; - echo "/share $rnd_name $1") | ncdc_configure + echo "/share $rnd_name $1") | ncdc_config +} +ncdc_configure_nick(){ + nick=${1?nick must be provided} + info "configuring DC Nick: $nick" + echo "/nick $nick" | ncdc_config } ncdc_configure_hub(){ - info "configuring DC Hub: $dc_hub, activating autconnect" - (echo "/open c1 $dc_hub" ; - echo "/hset autoconnect true") | ncdc_configure + hub=${1:-$dc_hub} + info "configuring DC Hub: $hub, activating autconnect" + (echo "/open c1 ${hub}" ; + echo "/hset autoconnect true") | ncdc_config } + + +ncdc_install(){ +curl http://dev.yorhel.nl/download/ncdc-linux-x86_64-1.19.tar.gz | tar xz -C /usr/bin/ +useradd -m $ncdc_user ||: +} + ncdc_autostart(){ # only systemd # punani install tmux diff --git a/ship/src/filehooker_install b/ship/src/filehooker_install new file mode 100755 index 00000000..108f2421 --- /dev/null +++ b/ship/src/filehooker_install @@ -0,0 +1,118 @@ +#/bin/sh +#@strict +#@include core +#@include color +#@include network +#@include filehooker +pass=lolwut.aidsballs +admin=pimp +extra_pkg="vim sudo grub-bios ntp tor openssh btrfs-progs tmux" + +info "writing stdout to /tmp/install.log" + + +rootdisk=${1?please provide the root disk via \$1} +test "$rootdisk" || die "cannot find your root disk" + +info "Your rootdisk is $rootdisk" +sleep 3 + +umount /mnt/boot ||: +umount /mnt ||: +info "overwriting partitioning" +dd if=/dev/zero of=$rootdisk bs=2k count=10 +info "starting partitioning" +(printf "o\nn\np\n\n\n+128M\n\a\nn\np\n\n\n\nw\n\n") |fdisk $rootdisk ||: +partprobe $rootdisk +info "done partitioning" +sleep 1 +info "generating filesystem on /boot" +mkfs.ext2 ${rootdisk}1 +info "Done" +sleep 1 +info "starting LVM magic" +vgchange -an ||: +vgremove -f pool0 ||: +pvcreate ${rootdisk}2 +vgcreate -ff pool0 ${rootdisk}2 +lvcreate -l 100%free -n root pool0 +info "finished creating LVM" +sleep 1 +info "generating filesystems on the LVM" +mkfs.ext4 /dev/mapper/pool0-root +info "finished generating filesystems" +sleep 1 +info "mounting" +mount /dev/mapper/pool0-root /mnt +mkdir /mnt/boot +mount ${rootdisk}1 /mnt/boot + +info "finished mounting!" +sleep 1 +info "installing!" + +info "Setting http proxy" + +info "Installing the following packages: $extra_pkg" +if [ -n "${user_pkg:-}" ] ;then + info "User chooses additional packages: $user_pkg" +else + info "No additional packages set by user (\$user_pkg unset)" +fi +pacstrap /mnt base base-devel $extra_pkg ${user_pkg:-} +info "installation done" +sleep 1 +info "generating configs" +genfstab -U -p /mnt > /mnt/etc/fstab + +info "beginning chroot!" +arch-chroot /mnt << EOF + +msg() { printf "\$*\n" >&2; } +info() { msg "$green\$*$nc"; } +error() { msg "$green\$*$nc"; } + +info "generating locales" +ln -s /usr/share/zoneinfo/Europe/Berlin /etc/localtime +echo "LANG=en_US.UTF-8" >> /etc/locale.conf +echo "en_US.UTF-8 UTF-8" >> /etc/locale.gen +locale-gen +echo "filehooker$RANDOM" > /etc/hostname +sed -i 's/block/& lvm2/g' /etc/mkinitcpio.conf +info "Done! " +mkinitcpio -p linux +info "setting root password" +printf "${pass}\n${pass}\n" | (passwd ) +info "adding user" +useradd -m -G audio,video,wheel $admin +printf "${pass}\n${pass}\n" | (passwd $admin) + +info "editing sudoers" +printf "root ALL=(ALL) ALL\n%s ALL=(ALL)NOPASSWD: ALL\n" %wheel >> /etc/sudoers +for i in dhcpcd ntpd tor sshd ; do + info "enabling \$i" + systemctl enable \$i +done + +info "installing grub" +grub-install ${rootdisk} 2>/dev/null +#echo "GRUB_DISABLE_LINUX_UUID=true" >> /etc/default/grub +grub-mkconfig > /boot/grub/grub.cfg 2>/dev/null +# prepare ncdc +useradd -m hooker +exit +EOF + +info "configuring tor" +torrc=/mnt/etc/tor/torrc +hidden_service_dir=/var/lib/tor/hidden_service/ +#@include tor +configure_hidden_service +info "publishing hidden service address" +cat $hidden_service_dir/hostname | send_irc +info "configure ncdc" +ncdc_install +netshare= +dc_hub=adcs://elch.nsupdate.info:2781 +configure_ncdc +info "We're all done, simply reboot!" -- cgit v1.2.3 From d352ce6c3d6d8f7d4588dbf51ea479f2af89a7b2 Mon Sep 17 00:00:00 2001 From: makefu Date: Sun, 9 Mar 2014 22:31:18 +0100 Subject: ship:rename remaster_arch --- ship/src/remaster_arch_iso | 109 ------------------------------ ship/src/remaster_arch_shack_installstick | 109 ++++++++++++++++++++++++++++++ 2 files changed, 109 insertions(+), 109 deletions(-) delete mode 100755 ship/src/remaster_arch_iso create mode 100755 ship/src/remaster_arch_shack_installstick (limited to 'ship') diff --git a/ship/src/remaster_arch_iso b/ship/src/remaster_arch_iso deleted file mode 100755 index 94a750c1..00000000 --- a/ship/src/remaster_arch_iso +++ /dev/null @@ -1,109 +0,0 @@ -#!/bin/sh -#@include core -#@mainifyme - -## TODO: provide a parameter which defines what to be done in the new iso root -set -efu -isofile=${1:-archlinux-2013.06.01-dual.iso} -outfile=$(basename ${isofile%.iso}.krebs.iso) -info "outfile will be at $outfile" -bdir=${bdir:-$HOME/build/arch} -isodir=$bdir/iso -isomnt=$bdir/isomount -rootdir=$bdir/root -outdir=$bdir/out -auto_url=euer.krebsco.de/autoinstall -info "bdir is at $bdir" -[ ! -e "$isofile" ] && die "$isofile does not exist." -esudo "$@" - - -#punani install genisoimage - - -info "cleanup root dir" -rm -rf $bdir -mkdir -p $isomnt $rootdir -info "mounting isofile ($isofile)" -if is_root;then - mount -t iso9660 -o loop,ro $isofile $isomnt -else - die 'we are not root enough to mount the iso.' -fi -defer "info 'unmounting $isomnt';umount $isomnt" - -info "copying from '$isomnt' to '$isodir'" -cp -a "$isomnt" "$isodir" -defer "info 'removing $isodir';rm -rf $isodir" -info "extracting root-image squashfs" -# we will not touch the kernel ... yet - -for arch in x86_64 i686;do - info "unpacking $isomnt/arch/$arch/root-image.fs.sfs" - mkdir -p "$outdir/$arch" - defer "info 'removing $outdir/$arch';rm -rf $outdir/$arch" - mkdir -p "$rootdir/$arch" - defer "info 'removing $rootdir/$arch';rm -rf $rootdir/$arch" - unsquashfs -f -d "$outdir/$arch" "$isodir/arch/$arch/root-image.fs.sfs" - - mount "$outdir/$arch/root-image.fs" "$rootdir/$arch" - defer "info 'unmounting $rootdir/$arch';umount $rootdir/$arch||info 'not mounted'" - - info "Starting of the rootdir verkrepelung" - # do the magic here - arch-chroot $rootdir/$arch <> /root/.zshrc< /krebs/autoinstall </dev/null 2>&1; } -while ! internet;do - echo "no Internet yet, waiting ..." - sleep 3 -done - -echo "Grabbing current version of install-script from $auto_url" -echo -echo "AGENTS ARE GOOOOOOOOOOO!" -curl $auto_url 2>/dev/null | sh -EOL -chmod 755 /krebs/autoinstall -EOF - info "deleting old squashfs" - rm "$isodir/arch/$arch/root-image.fs.sfs" - info "creating squashfs at $isodir/arch/$arch/root-image.fs.sfs" - umount "$rootdir/$arch" - mksquashfs "$outdir/$arch/root-image.fs" "$isodir/arch/$arch/root-image.fs.sfs" -done - -info "creating Iso Image" -#genisoimage -l -r -J -V "ARCH_$(date +%Y%m)" \ -# -b isolinux/isolinux.bin -no-emul-boot \ -# -boot-load-size 4 -boot-info-table -c isolinux/boot.cat \ -# -o "$outdir/$outfile" "$isodir" -rm -f "${outdir}/${outfile}" -xorriso -as mkisofs \ - -iso-level 3 \ - -full-iso9660-filenames \ - -volid "ARCH_201311" \ - -appid "Shackspace Krebs Installer" \ - -publisher "Shackspace/Krebs" \ - -preparer "prepared by krebs" \ - -eltorito-boot isolinux/isolinux.bin \ - -eltorito-catalog isolinux/boot.cat \ - -no-emul-boot -boot-load-size 4 -boot-info-table \ - -isohybrid-mbr ${isomnt}/isolinux/isohdpfx.bin \ - -output "${outdir}/${outfile}" \ - "$isodir" - diff --git a/ship/src/remaster_arch_shack_installstick b/ship/src/remaster_arch_shack_installstick new file mode 100755 index 00000000..5ac29473 --- /dev/null +++ b/ship/src/remaster_arch_shack_installstick @@ -0,0 +1,109 @@ +#!/bin/sh +#@include core +#@mainifyme + +## TODO: provide a parameter which defines what to be done in the new iso root +set -efu +isofile=${1:-archlinux-2013.06.01-dual.iso} +outfile=$(basename ${isofile%.iso}.krebs.iso) +info "outfile will be at $outfile" +bdir=${bdir:-$HOME/build/arch} +isodir=$bdir/iso +isomnt=$bdir/isomount +rootdir=$bdir/root +outdir=$bdir/out +auto_url=euer.krebsco.de/filepimp_installer +info "bdir is at $bdir" +[ ! -e "$isofile" ] && die "$isofile does not exist." +esudo "$@" + + +#punani install genisoimage + + +info "cleanup root dir" +rm -rf $bdir +mkdir -p $isomnt $rootdir +info "mounting isofile ($isofile)" +if is_root;then + mount -t iso9660 -o loop,ro $isofile $isomnt +else + die 'we are not root enough to mount the iso.' +fi +defer "info 'unmounting $isomnt';umount $isomnt" + +info "copying from '$isomnt' to '$isodir'" +cp -a "$isomnt" "$isodir" +defer "info 'removing $isodir';rm -rf $isodir" +info "extracting root-image squashfs" +# we will not touch the kernel ... yet + +for arch in x86_64 i686;do + info "unpacking $isomnt/arch/$arch/root-image.fs.sfs" + mkdir -p "$outdir/$arch" + defer "info 'removing $outdir/$arch';rm -rf $outdir/$arch" + mkdir -p "$rootdir/$arch" + defer "info 'removing $rootdir/$arch';rm -rf $rootdir/$arch" + unsquashfs -f -d "$outdir/$arch" "$isodir/arch/$arch/root-image.fs.sfs" + + mount "$outdir/$arch/root-image.fs" "$rootdir/$arch" + defer "info 'unmounting $rootdir/$arch';umount $rootdir/$arch||info 'not mounted'" + + info "Starting of the rootdir verkrepelung" + # do the magic here + arch-chroot $rootdir/$arch <> /root/.zshrc< /krebs/autoinstall </dev/null 2>&1; } +while ! internet;do + echo "no Internet yet, waiting ..." + sleep 3 +done + +echo "Grabbing current version of install-script from $auto_url" +echo +echo "AGENTS ARE GOOOOOOOOOOO!" +curl $auto_url 2>/dev/null | sh +EOL +chmod 755 /krebs/autoinstall +EOF + info "deleting old squashfs" + rm "$isodir/arch/$arch/root-image.fs.sfs" + info "creating squashfs at $isodir/arch/$arch/root-image.fs.sfs" + umount "$rootdir/$arch" + mksquashfs "$outdir/$arch/root-image.fs" "$isodir/arch/$arch/root-image.fs.sfs" +done + +info "creating Iso Image" +#genisoimage -l -r -J -V "ARCH_$(date +%Y%m)" \ +# -b isolinux/isolinux.bin -no-emul-boot \ +# -boot-load-size 4 -boot-info-table -c isolinux/boot.cat \ +# -o "$outdir/$outfile" "$isodir" +rm -f "${outdir}/${outfile}" +xorriso -as mkisofs \ + -iso-level 3 \ + -full-iso9660-filenames \ + -volid "ARCH_201311" \ + -appid "Shackspace Krebs Installer" \ + -publisher "Shackspace/Krebs" \ + -preparer "prepared by krebs" \ + -eltorito-boot isolinux/isolinux.bin \ + -eltorito-catalog isolinux/boot.cat \ + -no-emul-boot -boot-load-size 4 -boot-info-table \ + -isohybrid-mbr ${isomnt}/isolinux/isohdpfx.bin \ + -output "${outdir}/${outfile}" \ + "$isodir" + -- cgit v1.2.3 From 0970f673456cf8bef932aef048bb89f6178eb104 Mon Sep 17 00:00:00 2001 From: makefu Date: Sun, 9 Mar 2014 22:32:48 +0100 Subject: ship:implement ncdc configuration --- ship/lib/filehooker | 18 ++++++++++-------- ship/src/filehooker_configure_ncdc | 15 +++++++++++++++ ship/src/filehooker_configure_netshare | 6 ++++++ 3 files changed, 31 insertions(+), 8 deletions(-) create mode 100644 ship/src/filehooker_configure_ncdc create mode 100644 ship/src/filehooker_configure_netshare (limited to 'ship') diff --git a/ship/lib/filehooker b/ship/lib/filehooker index bd658c42..a6987733 100644 --- a/ship/lib/filehooker +++ b/ship/lib/filehooker @@ -1,14 +1,12 @@ #@include core - -netshare= -dc_hub=${dc_hub:-adcs://localhost:2781} ncdc_user=${ncdc_user:-hooker} - +ncdc_bin=${ncdc_bin:-/usr/bin/ncdc} ncdc_config(){ # maybe we want to use the running ncdc process and communicate via tmux send-keys ? - (sleep 1;cat;printf "/quit\n") | sudo -u $ncdc_user + (sleep 1;cat;printf "/quit\n") | sudo -u $ncdc_user "$ncdc_bin" } + ncdc_configure_netshare(){ :${1?provide path to share} rnd=`hexdump -n 2 -e '/2 "%u"' /dev/urandom` @@ -25,15 +23,19 @@ ncdc_configure_nick(){ echo "/nick $nick" | ncdc_config } ncdc_configure_hub(){ - hub=${1:-$dc_hub} + rnd=`hexdump -n 2 -e '/2 "%u"' /dev/urandom` + hubname="hub_$rnd" + hub=${1?adcs://localhost:2781} info "configuring DC Hub: $hub, activating autconnect" - (echo "/open c1 ${hub}" ; + (echo "/open ${hubname} ${hub}" ; echo "/hset autoconnect true") | ncdc_config } ncdc_install(){ -curl http://dev.yorhel.nl/download/ncdc-linux-x86_64-1.19.tar.gz | tar xz -C /usr/bin/ +install_dir="$(dirname "${ncdc_bin}")" +info "installing ncdc to $install_dir" +curl http://dev.yorhel.nl/download/ncdc-linux-x86_64-1.19.tar.gz | tar xz -C "$install_dir" useradd -m $ncdc_user ||: } diff --git a/ship/src/filehooker_configure_ncdc b/ship/src/filehooker_configure_ncdc new file mode 100644 index 00000000..c980ebf2 --- /dev/null +++ b/ship/src/filehooker_configure_ncdc @@ -0,0 +1,15 @@ +#!/bin/sh +#@info +#@strict +#@include filehooker + +dc_hub="adcs://elch.nsupdate.info:2781" +rnd=`hexdump -n 2 -e '/2 "%u"' /dev/urandom` +nick="filehooker_$rnd" + + +ncdc_install +ncdc_autostart + +ncdc_configure_nick "$nick" +ncdc_configure_hub "$dc_hub" diff --git a/ship/src/filehooker_configure_netshare b/ship/src/filehooker_configure_netshare new file mode 100644 index 00000000..ffd53e08 --- /dev/null +++ b/ship/src/filehooker_configure_netshare @@ -0,0 +1,6 @@ +#!/bin/sh +#@info +#@strict +#@include filehooker + +ncdc_configure_netshare "${1?provide share folder}" -- cgit v1.2.3 From 0f58a42f4442afc84534c866bf765bab2735173f Mon Sep 17 00:00:00 2001 From: makefu Date: Sun, 9 Mar 2014 23:07:05 +0100 Subject: ship: update filehooker install --- ship/src/filehooker_install | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) (limited to 'ship') diff --git a/ship/src/filehooker_install b/ship/src/filehooker_install index 108f2421..1b9717f1 100755 --- a/ship/src/filehooker_install +++ b/ship/src/filehooker_install @@ -1,8 +1,15 @@ #/bin/sh +#@info #@strict #@include core +## colored logging #@include color #@include network + +## for tor hidden service +#@include tor + +## for ncdc #@include filehooker pass=lolwut.aidsballs admin=pimp @@ -66,8 +73,9 @@ info "generating configs" genfstab -U -p /mnt > /mnt/etc/fstab info "beginning chroot!" +########### BEGIN CHROOT ##### arch-chroot /mnt << EOF - +#@strict msg() { printf "\$*\n" >&2; } info() { msg "$green\$*$nc"; } error() { msg "$green\$*$nc"; } @@ -102,17 +110,14 @@ grub-mkconfig > /boot/grub/grub.cfg 2>/dev/null useradd -m hooker exit EOF +######## END CHROOT ########## info "configuring tor" torrc=/mnt/etc/tor/torrc hidden_service_dir=/var/lib/tor/hidden_service/ -#@include tor configure_hidden_service info "publishing hidden service address" cat $hidden_service_dir/hostname | send_irc info "configure ncdc" -ncdc_install -netshare= -dc_hub=adcs://elch.nsupdate.info:2781 -configure_ncdc +curl conf.krebsco.de/filehooker_configure_ncdc | arch-chroot /mnt info "We're all done, simply reboot!" -- cgit v1.2.3 From ee63a28d029408a9a3012917a5169df5addd239a Mon Sep 17 00:00:00 2001 From: makefu Date: Mon, 10 Mar 2014 23:06:50 +0100 Subject: add volid finder for remastering scripts --- ship/lib/iso | 7 ++ ship/src/remaster_arch_filehooker | 106 ++++++++++++++++++++++++++++++ ship/src/remaster_arch_shack_installstick | 34 +++++----- 3 files changed, 132 insertions(+), 15 deletions(-) create mode 100644 ship/lib/iso create mode 100755 ship/src/remaster_arch_filehooker (limited to 'ship') diff --git a/ship/lib/iso b/ship/lib/iso new file mode 100644 index 00000000..0776d796 --- /dev/null +++ b/ship/lib/iso @@ -0,0 +1,7 @@ +get_volid(){ + #returns the volume id of the iso given + # is needed for remastering the archlinux iso + + #punani install genisoimage + isoinfo -d -i "${1?path to iso must be given}" | grep "^Volume id:" | cut -d: -f 2 |xargs +} diff --git a/ship/src/remaster_arch_filehooker b/ship/src/remaster_arch_filehooker new file mode 100755 index 00000000..54f0b082 --- /dev/null +++ b/ship/src/remaster_arch_filehooker @@ -0,0 +1,106 @@ +#!/bin/sh +#@include core +#@include iso +#@mainifyme + +## TODO: provide a parameter which defines what to be done in the new iso root +set -efu +isofile=${1:-archlinux-2013.06.01-dual.iso} +outfile=$(basename ${isofile%.iso}.krebs.iso) +info "outfile will be at $outfile" +bdir=${bdir:-$HOME/build/arch} +isodir=$bdir/iso +isomnt=$bdir/isomount +rootdir=$bdir/root +outdir=$bdir/out +auto_url=conf.krebsco.de/filehooker_install +info "bdir is at $bdir" +[ ! -e "$isofile" ] && die "$isofile does not exist." +esudo "$@" +arch_label="$(get_volid "$isofile")" +info "Arch iso label is ${arch_label}" + + +info "cleanup root dir" +rm -rf $bdir +mkdir -p $isomnt $rootdir +info "mounting isofile ($isofile)" +if is_root;then + mount -t iso9660 -o loop,ro $isofile $isomnt +else + die 'we are not root enough to mount the iso.' +fi +defer "info 'unmounting $isomnt';umount $isomnt" + +info "copying from '$isomnt' to '$isodir'" +cp -a "$isomnt" "$isodir" +defer "info 'removing $isodir';rm -rf $isodir" +info "extracting root-image squashfs" +# we will not touch the kernel ... yet + +for arch in x86_64 i686;do + info "unpacking $isomnt/arch/$arch/root-image.fs.sfs" + mkdir -p "$outdir/$arch" + defer "info 'removing $outdir/$arch';rm -rf $outdir/$arch" + mkdir -p "$rootdir/$arch" + defer "info 'removing $rootdir/$arch';rm -rf $rootdir/$arch" + unsquashfs -f -d "$outdir/$arch" "$isodir/arch/$arch/root-image.fs.sfs" + + mount "$outdir/$arch/root-image.fs" "$rootdir/$arch" + defer "info 'unmounting $rootdir/$arch';umount $rootdir/$arch||info 'not mounted'" + + info "Starting of the rootdir verkrepelung" + # do the magic here + arch-chroot $rootdir/$arch <> /root/.zshrc< +EOD +# /krebs/autoinstall +EOL + + : \${1?\$0 } + mkdir /krebs + cat > /krebs/autoinstall </dev/null 2>&1; } +while ! internet;do + echo "no Internet yet, waiting ..." + sleep 3 +done + +echo "Grabbing current version of install-script from $auto_url" +echo +echo "AGENTS ARE GOOOOOOOOOOO!" +curl $auto_url 2>/dev/null | sh -s "\\\$@" +EOL +chmod 755 /krebs/autoinstall +EOF + info "deleting old squashfs" + rm "$isodir/arch/$arch/root-image.fs.sfs" + info "creating squashfs at $isodir/arch/$arch/root-image.fs.sfs" + umount "$rootdir/$arch" + mksquashfs "$outdir/$arch/root-image.fs" "$isodir/arch/$arch/root-image.fs.sfs" +done + +info "creating Iso Image" +rm -f "${outdir}/${outfile}" +xorriso -as mkisofs \ + -iso-level 3 \ + -full-iso9660-filenames \ + -volid "ARCH_201311" \ + -appid "Shackspace Krebs Installer" \ + -publisher "Shackspace/Krebs" \ + -preparer "prepared by krebs" \ + -eltorito-boot isolinux/isolinux.bin \ + -eltorito-catalog isolinux/boot.cat \ + -no-emul-boot -boot-load-size 4 -boot-info-table \ + -isohybrid-mbr ${isomnt}/isolinux/isohdpfx.bin \ + -output "${outdir}/${outfile}" \ + "$isodir" + diff --git a/ship/src/remaster_arch_shack_installstick b/ship/src/remaster_arch_shack_installstick index 5ac29473..364e1958 100755 --- a/ship/src/remaster_arch_shack_installstick +++ b/ship/src/remaster_arch_shack_installstick @@ -1,23 +1,26 @@ #!/bin/sh #@include core +#@include iso #@mainifyme ## TODO: provide a parameter which defines what to be done in the new iso root set -efu -isofile=${1:-archlinux-2013.06.01-dual.iso} -outfile=$(basename ${isofile%.iso}.krebs.iso) +isofile="${1:-archlinux-2013.06.01-dual.iso}" +outfile="$(basename "${isofile%.iso}".krebs.iso)" info "outfile will be at $outfile" -bdir=${bdir:-$HOME/build/arch} -isodir=$bdir/iso -isomnt=$bdir/isomount -rootdir=$bdir/root -outdir=$bdir/out -auto_url=euer.krebsco.de/filepimp_installer +bdir="${bdir:-$HOME/build/arch}" +isodir="$bdir/iso" +isomnt="$bdir/isomount" +rootdir="$bdir/root" +outdir="$bdir/out" +echo "$outdir/$outfile" +auto_url=euer.krebsco.de/arch_autoinstall info "bdir is at $bdir" [ ! -e "$isofile" ] && die "$isofile does not exist." +arch_label="$(get_volid "$isofile")" +info "Arch iso label is ${arch_label}" esudo "$@" - #punani install genisoimage @@ -26,17 +29,18 @@ rm -rf $bdir mkdir -p $isomnt $rootdir info "mounting isofile ($isofile)" if is_root;then - mount -t iso9660 -o loop,ro $isofile $isomnt + mount -t iso9660 -o loop,ro "$isofile" "$isomnt" else die 'we are not root enough to mount the iso.' fi -defer "info 'unmounting $isomnt';umount $isomnt" +defer "info 'unmounting $isomnt';umount \"$isomnt\"" info "copying from '$isomnt' to '$isodir'" cp -a "$isomnt" "$isodir" defer "info 'removing $isodir';rm -rf $isodir" + info "extracting root-image squashfs" -# we will not touch the kernel ... yet + for arch in x86_64 i686;do info "unpacking $isomnt/arch/$arch/root-image.fs.sfs" @@ -51,7 +55,7 @@ for arch in x86_64 i686;do info "Starting of the rootdir verkrepelung" # do the magic here - arch-chroot $rootdir/$arch <> /root/.zshrc< Date: Wed, 12 Mar 2014 10:29:32 +0100 Subject: update arch autoinstaller --- ship/src/arch_autoinstall | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) (limited to 'ship') diff --git a/ship/src/arch_autoinstall b/ship/src/arch_autoinstall index baa9e2a0..c9b6c4d4 100755 --- a/ship/src/arch_autoinstall +++ b/ship/src/arch_autoinstall @@ -3,13 +3,12 @@ #@include core #@include color #@include network +#@include tor pass=shackit shack_printer_ip=10.42.0.135 extra_pkg="xorg vim xfce4 feh chromium zsh sudo git flashplugin alsa-oss alsa-lib alsa-utils grub-bios slim ntp tor network-manager-applet networkmanager openssh cups cups-filters" info "writing stdout to /tmp/install.log" -exec >> /tmp/install.log -tail -f /tmp/install.log& defer 'pkill tail' installer_disk(){ @@ -35,7 +34,7 @@ sleep 3 umount /mnt/boot ||: umount /mnt ||: info "starting partitioning" -(printf "o\nn\np\n\n\n+256M\n\a\nn\np\n\n\n\nw\n\n") |fdisk $rootdisk +(printf "o\nn\np\n\n\n+256M\n\a\nn\np\n\n\n\nw\n\n") |fdisk $rootdisk||: info "done partitioning" sleep 1 info "generating filesystem on /boot" @@ -84,7 +83,7 @@ info "generating configs" genfstab -U -p /mnt > /mnt/etc/fstab info "beginning chroot!" -arch-chroot /mnt | tee -a /tmp/install.log << EOF +arch-chroot /mnt << EOF msg() { printf "\$*\n" >&2; } info() { msg "$green\$*$nc"; } @@ -119,7 +118,7 @@ done ### CUPS mkdir -p /etc/cups -cat >>/etc/cups/printers.conf<>/etc/cups/printers.conf< Info Shack Printer HP 5000 Location lounge @@ -137,7 +136,7 @@ KLimit 0 OpPolicy default ErrorPolicy stop-printer -EOF +EOT info "installing grub" grub-install ${rootdisk} 2>/dev/null @@ -155,7 +154,11 @@ EOF info "configuring tor" torrc=/mnt/etc/tor/torrc hidden_service_dir=/var/lib/tor/hidden_service/ -#@include tor configure_hidden_service +#TODO publish tor address after reboot +#info "publishing hidden service address" +#cat $hidden_service_dir/hostname | send_irc + info "We're all done, simply reboot!" +reboot -- cgit v1.2.3 From b61b596741a1ae3be0c188a648efd9ad619407bb Mon Sep 17 00:00:00 2001 From: makefu Date: Thu, 13 Mar 2014 21:05:45 +0100 Subject: generalize install stick remastering --- ship/src/fix_dircolors | 2 +- ship/src/remaster_arch_filehooker | 106 ------------------------------ ship/src/remaster_arch_shack_installstick | 47 ++++++------- 3 files changed, 20 insertions(+), 135 deletions(-) delete mode 100755 ship/src/remaster_arch_filehooker (limited to 'ship') diff --git a/ship/src/fix_dircolors b/ship/src/fix_dircolors index b2e2ffdb..d427563f 100755 --- a/ship/src/fix_dircolors +++ b/ship/src/fix_dircolors @@ -6,7 +6,7 @@ exists dircolors || die "no dircolors in PATH, bailing out" info "fixing dircolors for $(id -un)" dircolors -p > $HOME/.dircolors -sed -i 's/\(DIR \).*/\101;35/' $HOME/.dircolors +sed -i 's/\(DIR \).*/\101;36/' $HOME/.dircolors ! grep -q 'dircolors' $HOME/.profile && \ info "adding dircolors line to $HOME/.profile" && \ echo 'eval `dircolors -b $HOME/.dircolors`' >> $HOME/.profile diff --git a/ship/src/remaster_arch_filehooker b/ship/src/remaster_arch_filehooker deleted file mode 100755 index 54f0b082..00000000 --- a/ship/src/remaster_arch_filehooker +++ /dev/null @@ -1,106 +0,0 @@ -#!/bin/sh -#@include core -#@include iso -#@mainifyme - -## TODO: provide a parameter which defines what to be done in the new iso root -set -efu -isofile=${1:-archlinux-2013.06.01-dual.iso} -outfile=$(basename ${isofile%.iso}.krebs.iso) -info "outfile will be at $outfile" -bdir=${bdir:-$HOME/build/arch} -isodir=$bdir/iso -isomnt=$bdir/isomount -rootdir=$bdir/root -outdir=$bdir/out -auto_url=conf.krebsco.de/filehooker_install -info "bdir is at $bdir" -[ ! -e "$isofile" ] && die "$isofile does not exist." -esudo "$@" -arch_label="$(get_volid "$isofile")" -info "Arch iso label is ${arch_label}" - - -info "cleanup root dir" -rm -rf $bdir -mkdir -p $isomnt $rootdir -info "mounting isofile ($isofile)" -if is_root;then - mount -t iso9660 -o loop,ro $isofile $isomnt -else - die 'we are not root enough to mount the iso.' -fi -defer "info 'unmounting $isomnt';umount $isomnt" - -info "copying from '$isomnt' to '$isodir'" -cp -a "$isomnt" "$isodir" -defer "info 'removing $isodir';rm -rf $isodir" -info "extracting root-image squashfs" -# we will not touch the kernel ... yet - -for arch in x86_64 i686;do - info "unpacking $isomnt/arch/$arch/root-image.fs.sfs" - mkdir -p "$outdir/$arch" - defer "info 'removing $outdir/$arch';rm -rf $outdir/$arch" - mkdir -p "$rootdir/$arch" - defer "info 'removing $rootdir/$arch';rm -rf $rootdir/$arch" - unsquashfs -f -d "$outdir/$arch" "$isodir/arch/$arch/root-image.fs.sfs" - - mount "$outdir/$arch/root-image.fs" "$rootdir/$arch" - defer "info 'unmounting $rootdir/$arch';umount $rootdir/$arch||info 'not mounted'" - - info "Starting of the rootdir verkrepelung" - # do the magic here - arch-chroot $rootdir/$arch <> /root/.zshrc< -EOD -# /krebs/autoinstall -EOL - - : \${1?\$0 } - mkdir /krebs - cat > /krebs/autoinstall </dev/null 2>&1; } -while ! internet;do - echo "no Internet yet, waiting ..." - sleep 3 -done - -echo "Grabbing current version of install-script from $auto_url" -echo -echo "AGENTS ARE GOOOOOOOOOOO!" -curl $auto_url 2>/dev/null | sh -s "\\\$@" -EOL -chmod 755 /krebs/autoinstall -EOF - info "deleting old squashfs" - rm "$isodir/arch/$arch/root-image.fs.sfs" - info "creating squashfs at $isodir/arch/$arch/root-image.fs.sfs" - umount "$rootdir/$arch" - mksquashfs "$outdir/$arch/root-image.fs" "$isodir/arch/$arch/root-image.fs.sfs" -done - -info "creating Iso Image" -rm -f "${outdir}/${outfile}" -xorriso -as mkisofs \ - -iso-level 3 \ - -full-iso9660-filenames \ - -volid "ARCH_201311" \ - -appid "Shackspace Krebs Installer" \ - -publisher "Shackspace/Krebs" \ - -preparer "prepared by krebs" \ - -eltorito-boot isolinux/isolinux.bin \ - -eltorito-catalog isolinux/boot.cat \ - -no-emul-boot -boot-load-size 4 -boot-info-table \ - -isohybrid-mbr ${isomnt}/isolinux/isohdpfx.bin \ - -output "${outdir}/${outfile}" \ - "$isodir" - diff --git a/ship/src/remaster_arch_shack_installstick b/ship/src/remaster_arch_shack_installstick index 364e1958..ea594fb2 100755 --- a/ship/src/remaster_arch_shack_installstick +++ b/ship/src/remaster_arch_shack_installstick @@ -5,23 +5,20 @@ ## TODO: provide a parameter which defines what to be done in the new iso root set -efu -isofile="${1:-archlinux-2013.06.01-dual.iso}" -outfile="$(basename "${isofile%.iso}".krebs.iso)" +isofile=${1:-archlinux-2013.06.01-dual.iso} +outfile=$(basename ${isofile%.iso}.krebs.iso) info "outfile will be at $outfile" -bdir="${bdir:-$HOME/build/arch}" -isodir="$bdir/iso" -isomnt="$bdir/isomount" -rootdir="$bdir/root" -outdir="$bdir/out" -echo "$outdir/$outfile" -auto_url=euer.krebsco.de/arch_autoinstall +bdir=${bdir:-$HOME/build/arch} +isodir=$bdir/iso +isomnt=$bdir/isomount +rootdir=$bdir/root +outdir=$bdir/out +auto_url=${2:conf.krebsco.de/arch_autoinstall} info "bdir is at $bdir" [ ! -e "$isofile" ] && die "$isofile does not exist." +esudo "$@" arch_label="$(get_volid "$isofile")" info "Arch iso label is ${arch_label}" -esudo "$@" - -#punani install genisoimage info "cleanup root dir" @@ -29,18 +26,17 @@ rm -rf $bdir mkdir -p $isomnt $rootdir info "mounting isofile ($isofile)" if is_root;then - mount -t iso9660 -o loop,ro "$isofile" "$isomnt" + mount -t iso9660 -o loop,ro $isofile $isomnt else die 'we are not root enough to mount the iso.' fi -defer "info 'unmounting $isomnt';umount \"$isomnt\"" +defer "info 'unmounting $isomnt';umount $isomnt" info "copying from '$isomnt' to '$isodir'" cp -a "$isomnt" "$isodir" defer "info 'removing $isodir';rm -rf $isodir" - info "extracting root-image squashfs" - +# we will not touch the kernel ... yet for arch in x86_64 i686;do info "unpacking $isomnt/arch/$arch/root-image.fs.sfs" @@ -55,7 +51,7 @@ for arch in x86_64 i686;do info "Starting of the rootdir verkrepelung" # do the magic here - arch-chroot "$rootdir/$arch" <> /root/.zshrc< EOD /krebs/autoinstall EOL + mkdir /krebs cat > /krebs/autoinstall </dev/null 2>&1; } @@ -80,7 +75,7 @@ done echo "Grabbing current version of install-script from $auto_url" echo echo "AGENTS ARE GOOOOOOOOOOO!" -curl $auto_url 2>/dev/null | sh +cu