Scripts for initial setup of OSes on my home network.
My network is a wndr3700v2 router with openwrt on it and a few pcs
-with various gnu/linux distros on them.
+with atm: arch, debian jessie and debian stretch on them.
Scripts meant to be called interactively:
if $reboot; then
ssh $host sudo bash <<'EOF' || [[ $? == 255 ]]
touch /tmp/keyscript-off
-reboot ||:
+reboot
EOF
fi
case $HOSTNAME in
demohost)
echo "DESKTOP" ;;
- tp|frodo|treetowl|x2)
+ tp)
echo "DESKTOP PARTITION_PROMPT"
- # non-portable way to see that we aren't in a pxe boot environment.
- if [[ -e /a/bin/fai/fai-wrapper ]]; then
- # We check the reverse condition in 51-multi-boot,
- # and set what os we are installing, but don't check it
- # into git since it changes regularly.
- if isdebian-stable; then
- echo "STABLE"
- fi
+ # For multi-boot system.
+ # Check that we aren't in a pxe boot environment.
+ # There is probably a better way to do this.
+ # We check the reverse condition in 51-multi-boot,
+ # and set what os we are installing, but don't check it
+ # into git since it changes regularly.
+ # It's shell looks like this:
+ # if [[ ! -e /a/bin/fai/fai-wrapper ]]; then
+ # case $HOSTNAME in
+ # tp) : ;;
+ # # add more multi-boot hostnames here
+ # esac
+ # fi
+ #
+ if [[ -e /a/bin/fai/fai-wrapper ]] && isdebian-stable; then
+ echo "STABLE"
+ fi
+ ;;
+ x2|frodo|treetowl)
+ echo "NON_FREE"
+ if [[ -e /a/bin/fai/fai-wrapper ]] && isdebian-stable; then
+ echo "STABLE STABLE_NON_FREE"
fi
;;
lj)
dir=/q/p/c/machine_specific/$HOSTNAME/.unison
$ROOTCMD mkdir -p $dir
+if ! $ROOTCMD test -L /root/.unison; then
+ $ROOTCMD rm -rf /root/.unison
+ $ROOTCMD ln -s -T $dir /root/.unison
+fi
$ROOTCMD ln -sf /q/p /
$ROOTCMD chown -R 1000:1000 $dir
--- /dev/null
+deb http://http.us.debian.org/debian jessie contrib non-free
+deb-src http://http.us.debian.org/debian jessie contrib non-free
+
+deb http://security.debian.org/ jessie/updates contrib non-free
+deb-src http://security.debian.org/ jessie/updates contrib non-free
+
+deb http://http.us.debian.org/debian jessie-updates contrib non-free
+deb-src http://http.us.debian.org/debian jessie-updates contrib non-free
+
+deb http://http.debian.net/debian jessie-backports contrib non-free
+deb-src http://http.debian.net/debian jessie-backports contrib non-free
deb http://http.us.debian.org/debian jessie-updates main
deb-src http://http.us.debian.org/debian jessie-updates main
+
+deb http://http.debian.net/debian jessie-backports main
+deb-src http://http.debian.net/debian jessie-backports main
--- /dev/null
+deb http://http.us.debian.org/debian testing contrib non-free
+deb-src http://http.us.debian.org/debian testing contrib non-free
+
+deb http://security.debian.org/ testing/updates contrib non-free
+deb-src http://security.debian.org/ testing/updates contrib non-free
+
+deb http://http.us.debian.org/debian testing-updates contrib non-free
+deb-src http://http.us.debian.org/debian testing-updates contrib non-free
--- /dev/null
+deb http://http.us.debian.org/debian unstable contrib non-free
+deb-src http://http.us.debian.org/debian unstable contrib non-free
chown root:1000 q
mkdir -p /mnt/root_$DISTRO/boot
-for x in root/a q/a; do
+for x in q/a q/i; do
mkdir -p $x
chown 1000:1000 $x
chmod 755 $x
## end create subvols ##
-
+# note, the mount point /a seems to get automatically created somewhere
cat > /tmp/fai/fstab <<EOF
$first_root_crypt / btrfs noatime,subvol=root_$DISTRO 0 0
$first_root_crypt /q btrfs noatime,subvol=q 0 0
if ifclass treetowl; then
cat >> /tmp/fai/fstab <<'EOF'
-UUID=3f7b31cd-f299-40b4-a86b-7604282e2715 /i btrfs noatime 0 2
+UUID=3f7b31cd-f299-40b4-a86b-7604282e2715 /i btrfs noatime 0 2
+EOF
+fi
+
+if ifclass frodo; then
+ cat >> /tmp/fai/fstab <<'EOF'
+/q/i /i none bind 0 0
EOF
fi