# use a list of classes for our demo machine
case $HOSTNAME in
demohost)
- echo "FAIBASE DEBIAN DESKTOP TWO_DISK STABLE" ;;
+ echo "FAIBASE DEBIAN DESKTOP STABLE" ;;
x2)
- echo "FAIBASE DEBIAN DESKTOP ONE_DISK STABLE" ;;
+ echo "FAIBASE DEBIAN DESKTOP STABLE" ;;
tp)
- echo "FAIBASE DEBIAN DESKTOP TWO_DISK" ;;
+ echo "FAIBASE DEBIAN DESKTOP" ;;
# faiserver)
# echo "FAIBASE DEBIAN DEMO FAISERVER" ;;
# xfcehost)
--- /dev/null
+Explanation: https://debian-handbook.info/browse/stable/sect.apt-get.html#sect.apt.priorities
+Explanation: And man apt_preferences
+Explanation: Installed packages get 100 priority, so this won't upgrade testing
+Explanation: packages unless explicitly asked to.
+Explanation: Install with apt-get install package/testing. But if dependencies are
+Explanation: needed, or need upgrading,
+Explanation: apt-get -t testing package, setting testing to priority
+Explanation: 990 just for that command.
+Explanation: Use apt-cache policy to verify these settings.
+Package: *
+Pin: release a=testing
+Pin-Priority: 50
+
+Package: *
+Pin: release a=testing-updates
+Pin-Priority: 50
+
+Explanation: Allow this testing package to automatically upgrade.
+Package: unison
+Pin-Piority: 100
# jessie-updates, previously known as 'volatile'
deb http://http.us.debian.org/debian jessie-updates main
deb-src http://http.us.debian.org/debian jessie-updates main
+
+
+deb http://http.us.debian.org/debian testing main
+deb-src http://http.us.debian.org/debian testing main
+
+deb http://security.debian.org/ testing/updates main
+deb-src http://security.debian.org/ testing/updates main
+
+# jessie-updates, previously known as 'volatile'
+deb http://http.us.debian.org/debian testing-updates main
+deb-src http://http.us.debian.org/debian testing-updates main
#### begin configuration
-partition=false # change to true to force a full wipe
+partition=true # change to true to force a full wipe
bootn=3
rootn=1
swapn=2
bios_grubn=4
boot_mib=1500
+
+
+##### end configuration
+
lastn=$bios_grubn
-if ifclass VM; then
- d=vd
-else
- d=sd
-fi
-letters=()
-if ifclass TWO_DISK; then
- letters=(a b)
-elif ifclass ONE_DISK; then
- letters=(a)
-elif ifclass MANY_DISK; then
- for dev in /dev/${d}?; do letters+=(${dev#/dev/${d}}); done
+hds=()
+ssds=()
+cd /sys/block
+for disk in [sv]d[a-z]; do
+ case $(cat $disk/queue/rotational) in
+ 0) ssds+=(/dev/$disk) ;;
+ 1) hds+=(/dev/$disk) ;;
+ *) echo "$0: error: unknown /sys/block/$disk/queue/rotational: \
+$(cat $disk/queue/rotational)"; exit 1 ;;
+ esac
+done
+
+# install all ssds, or if there are none, all hdds
+if (( ${#ssds[@]} > 0 )); then
+ devs=( ${ssds[@]} )
else
- exit 1
+ devs=( ${hds[@]} )
fi
+
if [[ ! $DISTRO ]]; then
if ifclass STABLE; then
DISTRO=debianjessie
fi
fi
-##### end configuration
bpart() { # btrfs a partition
esac
}
-devs=(${letters[@]/#//dev/${d}})
-crypt_devs=(${letters[@]/#//dev/mapper/crypt_dev_${d}})
first_boot_dev=${devs[0]}$bootn
-
+crypt_devs=()
# somewhat crude detection of whether to partition
for dev in ${devs[@]}; do
+ crypt_devs+=( /dev/mapper/crypt_dev_${dev#/dev/} )
x=($dev[0-9])
[[ ${#x[@]} == ${lastn} ]] || partition=true
for (( i=1; i <= $lastn; i++ )); do
fi
-crypt=/dev/mapper/crypt_dev_${d##/dev/}a$rootn
+crypt=${crypt_devs[0]}$rootn
bios_grub_end=4
# 1.5 x based on https://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Linux/7/html/Installation_Guide/sect-disk-partitioning-setup-x86.html#sect-custom-partitioning-x86
done
# could set default like this, but no reason to.
# btrfs subvolume set-default \
-# $(btrfs subvolume list . | grep "root_$DISTRO$" | awk '{print $2}') .
+ # $(btrfs subvolume list . | grep "root_$DISTRO$" | awk '{print $2}') .
chattr -Rf +C root_$DISTRO
cd /
umount /mnt
+++ /dev/null
-# unison version compat:
-# deb/ubuntu, it depends what version they have.
-# arch and fedora have unison240 and unison-240-compat respectively,
-# but that failed to sync with an ubuntu 12.04 which had unson 2.40,
-# so I installed latest stable manualy
-
-# wget http://caml.inria.fr/pub/distrib/ocaml-4.02/ocaml-4.02.3.tar.gz
-# ./configure
-# make world opt
-# s make install
-
-# wget http://www.seas.upenn.edu/~bcpierce/unison//download/releases/stable/unison-2.48.3.tar.gz
-# make
-# s cp unison /usr/local/bin
-PACKAGES install
-unison
$ROOTCMD adduser --disabled-password --gecos ian ian
$ROOTCMD usermod -p "$ROOTPW" ian
+if ifclass STABLE; then
+ fcopy -M /etc/apt/preferences
+fi
-fcopy -rM -i /home/ian/.ssh
+
+# -i, ignore nonmatching class error, always return 0.
+fcopy -r -M -i /home/ian/.ssh
/var/lib/fai/config/distro-install-common/end
+
+# could also use: chroot /target script-file
$ROOTCMD chown -R 1000:1000 /home/ian/.ssh
$ROOTCMD chmod -R u=Xrw,og= /home/ian/.ssh
$ROOTCMD cp -ar /home/ian/.ssh /root
# default jessie groups + kvm & systemd-journal
$ROOTCMD usermod -aG cdrom,floppy,sudo,audio,dip,video,plugdev,netdev,kvm,systemd-journal ian
+
+
+$ROOTCMD apt-get -y install unison/testing