diff options
Diffstat (limited to 'ship/src')
-rwxr-xr-x | ship/src/arch_autoinstall | 17 | ||||
-rw-r--r-- | ship/src/filehooker_configure_netshare | 5 | ||||
-rwxr-xr-x | ship/src/filehooker_install | 73 |
3 files changed, 62 insertions, 33 deletions
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<<EOF +cat >>/etc/cups/printers.conf<<EOT <Printer HP_LaserJet_5000_Series> Info Shack Printer HP 5000 Location lounge @@ -137,7 +136,7 @@ KLimit 0 OpPolicy default ErrorPolicy stop-printer </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 diff --git a/ship/src/filehooker_configure_netshare b/ship/src/filehooker_configure_netshare index ffd53e08..438ac133 100644 --- a/ship/src/filehooker_configure_netshare +++ b/ship/src/filehooker_configure_netshare @@ -2,5 +2,6 @@ #@info #@strict #@include filehooker - -ncdc_configure_netshare "${1?provide share folder}" +for i in $(prepare_netshares) ;do + ncdc_configure_netshare "$i" "${i##*/}" +done diff --git a/ship/src/filehooker_install b/ship/src/filehooker_install index 108f2421..eb2d5fd1 100755 --- a/ship/src/filehooker_install +++ b/ship/src/filehooker_install @@ -1,17 +1,42 @@ #/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 +# 20gig +#min_netshare_size=20000000000 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} +installer_disk(){ + find /dev/disk/by-label/ -name ARCH_\* 2>/dev/null | xargs readlink +} + +find_rootdisk(){ + for i in sd vd hd;do + for j in a b c;do + dsk="/dev/$i$j" + test ! -e "$dsk" && continue + test "$(installer_disk)" == "$dsk" && continue + test "$(get_disksize $dsk)" -gt "$min_netshare_size" && info "not using $dsk as it is too big" && continue + echo "$dsk" && return + done + done +} + +rootdisk=$(find_rootdisk) test "$rootdisk" || die "cannot find your root disk" info "Your rootdisk is $rootdisk" @@ -29,21 +54,16 @@ sleep 1 info "generating filesystem on /boot" mkfs.ext2 ${rootdisk}1 info "Done" +sleep 3 +sync +vgchange -an +info "generating filesystems" +mkfs.btrfs -f ${rootdisk}2 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 +mount ${rootdisk}2 /mnt mkdir /mnt/boot mount ${rootdisk}1 /mnt/boot @@ -59,15 +79,16 @@ if [ -n "${user_pkg:-}" ] ;then else info "No additional packages set by user (\$user_pkg unset)" fi -pacstrap /mnt base base-devel $extra_pkg ${user_pkg:-} +pacstrap /mnt base $extra_pkg ${user_pkg:-} info "installation done" sleep 1 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"; } @@ -78,9 +99,8 @@ 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 +mkinitcpio -p linux || info "setting root password" printf "${pass}\n${pass}\n" | (passwd ) info "adding user" @@ -102,17 +122,22 @@ grub-mkconfig > /boot/grub/grub.cfg 2>/dev/null useradd -m hooker exit EOF +######## END CHROOT ########## +sync 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 "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!" +curl conf.krebsco.de/filehooker_configure_ncdc | arch-chroot /mnt +info "configuring netshares" +( curl conf.krebsco.de/filehooker_configure_netshare )| arch-chroot /mnt +info "configuring tor announce" +curl conf.krebsco.de/install_tor_announce | arch-chroot /mnt +info "We're all done, rebooting!" +sync +sleep 5 +reboot |