# mk-basefile, create basefiles for some distributions
#
-# Thomas Lange, Uni Koeln, 2011-2017
+# Thomas Lange, Uni Koeln, 2011-2018
# based on the Makefile implementation of Michael Goetze
#
# Usage example: mk-basefile -J STRETCH64
MIRROR_UBUNTU=http://mirror.netcologne.de/ubuntu/
MIRROR_CENTOS=http://mirror.netcologne.de/
-EXCLUDE_SQUEEZE=isc-dhcp-client,isc-dhcp-common,info,tasksel,tasksel-data
-EXCLUDE_WHEEZY=info,tasksel,tasksel-data
-EXCLUDE_JESSIE=info,tasksel,tasksel-data
-EXCLUDE_STRETCH=info,tasksel,tasksel-data
-EXCLUDE_BUSTER=tasksel,tasksel-data
+EXCLUDE_SQUEEZE=isc-dhcp-client,isc-dhcp-common,info
+EXCLUDE_WHEEZY=info
+EXCLUDE_JESSIE=info
+EXCLUDE_STRETCH=info
+EXCLUDE_BUSTER=
+EXCLUDE_SID=
EXCLUDE_TRUSTY=dhcp3-client,dhcp3-common,info
-EXCLUDE_XENIAL=udhcpc,dibbler-client,info,tasksel,tasksel-data
+EXCLUDE_XENIAL=udhcpc,dibbler-client,info
+EXCLUDE_BIONIC=udhcpc,dibbler-client,info
-# we need aptitude in the base file, since users may want to use it for installing packages
-INCLUDE_DEBIAN=aptitude
+# here you can add packages, that are needed very early
+INCLUDE_DEBIAN=
setarch() {
dist=${dist,,}
check
+ if [ -n "$INCLUDE_DEBIAN" ]; then
+ local inc="--include=$INCLUDE_DEBIAN"
+ fi
+
if [ -n "$arch" ]; then
- qemu-debootstrap --arch $arch --exclude=${!exc} --include=${INCLUDE_DEBIAN} $dist $xtmp $mirror
+ qemu-debootstrap --arch $arch --exclude=${!exc} $inc $dist $xtmp $mirror
target="${target}_${arch^^}"
else
if [[ $DIST =~ 64 ]]; then
else
arch=i386
fi
- debootstrap --arch $arch --exclude=${!exc} --include=${INCLUDE_DEBIAN} $dist $xtmp $mirror
+ debootstrap --arch $arch --exclude=${!exc} $inc $dist $xtmp $mirror
fi
cleanup-deb
tarit
SLC7_64
TRUSTY32 TRUSTY64
XENIAL32 XENIAL64
+ BIONIC64
SQUEEZE32 SQUEEZE64
WHEEZY32 WHEEZY64
JESSIE32 JESSIE64
STRETCH32 STRETCH64
BUSTER32 BUSTER64
+ SID32 SID64
"
}
cat <<EOF
mk-basefile, create minimal base files for a Linux distritubtion
- Copyright (C) 2011-2017 by Thomas Lange
+ Copyright (C) 2011-2018 by Thomas Lange
Usage: mk-basefile [OPTION] ... DISTRIBUTION
-s Show list of supported linux distributions
- -a Add xtattrs, acl and selinux properties to the tar file.
-f ARCH Build for foreign architecture ARCH.
-d DIR Use DIR for creating the temporary subtree structure.
-z Use gzip for compressing the tar file.
zip=cat
attributes=
cleanup=1
+attributes="--xattrs --selinux --acls"
while getopts ashzJd:kf: opt ; do
case "$opt" in
- a) attributes="--xattrs --selinux --acl" ;;
+ a) echo "$0: Warning. -a is ignored, because xtattrs, acls and selinux are always added." ;;
d) export TMPDIR=$OPTARG ;;
f) export ARCH=$OPTARG ;;
z) zip="gzip -9"; ext=tar.gz ;;
SLC6_32) slc i386 6 ;;
SLC6_64) slc amd64 6 ;;
SLC7_64) slc amd64 7 ;;
- TRUSTY*|XENIAL*)
+ TRUSTY*|XENIAL*|BIONIC*)
debgeneric $target $MIRROR_UBUNTU ;;
- SQUEEZE*|WHEEZY*|JESSIE*|STRETCH*|BUSTER*)
+ SQUEEZE*|WHEEZY*|JESSIE*|STRETCH*|BUSTER*|SID*)
debgeneric $target $MIRROR_DEBIAN $ARCH;;
*) echo "Unknown distribution. Aborting."
prtdists
[ "$flag_menu" ] || return 0
out=$(tty)
+red=$(mktemp)
+echo 'screen_color = (CYAN,RED,ON)' > $red
-dialog --colors --clear --aspect 6 --title "FAI - Fully Automatic Installation" --trim \
+DIALOGRC=$red dialog --colors --clear --aspect 6 --title "FAI - Fully Automatic Installation" --trim \
--msgbox "\n\n If you continue, \n all your data on the disk \n \n|\Zr\Z1 WILL BE DESTROYED \Z0\Zn|\n\n" 0 0 1>$out
+
+# stop on any error, or if ESC was hit
+if [ $? -ne 0 ]; then
+ task_error 999
+fi
+
+rm $red
+unset red
+++ /dev/null
-#! /bin/bash
-
-ifclass GCE && echo AMD64 CLOUD
-exit 0
+release=stretch
+apt_cdn=http://deb.debian.org
+security_cdn=http://security.debian.org
+
CONSOLEFONT=
KEYMAP=us-latin1
# if you want to use the faiserver as APT proxy
#APTPROXY=http://faiserver:3142
-
-apt_cdn=http://deb.debian.org
# set parameter for install_packges(8)
MAXPACKAGES=800
+
+# a user account will be created
+username=demo
+USERPW='$1$kBnWcO.E$djxB128U7dMkrltJHPf6d1'
+++ /dev/null
-release=stretch
-TIMEZONE=UTC
-NTPSRVS='metadata.google.internal'
-NIC1=eth0
# Linux command line:
-grub-pc grub2/linux_cmdline_default string quiet elevator=noop
+grub-pc grub2/linux_cmdline_default string elevator=noop quiet
+++ /dev/null
-# Linux command line:
-grub-pc grub2/linux_cmdline_default string quiet elevator=noop console=ttyS0,38400n8
-# GRUB timeout; for internal use
-grub-pc grub-pc/timeout string 0
#primary / 350 ext3 rw,noatime,errors=remount-ro createopts="-L ROOT -I 128"
# use following line for CentOS 7
-primary / 4G-10G ext4 rw,noatime,errors=remount-ro createopts="-L ROOT"
+primary / 4G-50G ext4 rw,noatime,errors=remount-ro createopts="-L ROOT"
-logical swap 200-1000 swap sw createopts="-L SWAP"
-logical /tmp 100-1G ext4 rw,noatime,nosuid,nodev createopts="-L TMP -m 0" tuneopts="-c 0 -i 0"
-logical /home 100-50% ext4 rw,noatime,nosuid,nodev createopts="-L HOME -m 1" tuneopts="-c 0 -i 0"
+logical swap 200-10G swap sw createopts="-L SWAP"
+logical /tmp 100-5G ext4 rw,noatime,nosuid,nodev createopts="-L TMP -m 0" tuneopts="-c 0 -i 0"
+logical /home 100- ext4 rw,noatime,nosuid,nodev createopts="-L HOME -m 1" tuneopts="-c 0 -i 0"
disk_config disk1 disklabel:msdos bootable:1 fstabkey:uuid align-at:1M
-primary / 300- ext4 rw,barrier=0,noatime,errors=remount-ro tuneopts="-c 0 -i 0"
+primary / 300- ext4 rw,discard,barrier=0,noatime,errors=remount-ro tuneopts="-c 0 -i 0"
disk_config disk1 disklabel:msdos bootable:1 fstabkey:uuid
-primary / 2G-15G ext4 rw,noatime,errors=remount-ro
-logical swap 200-1G swap sw
-logical /tmp 100-1G ext4 rw,noatime,nosuid,nodev createopts="-L tmp -m 0" tuneopts="-c 0 -i 0"
-logical /home 100-50% ext4 rw,noatime,nosuid,nodev createopts="-L home -m 1" tuneopts="-c 0 -i 0"
+primary / 2G-50G ext4 rw,noatime,errors=remount-ro
+logical swap 200-10G swap sw
+logical /home 100- ext4 rw,noatime,nosuid,nodev createopts="-L home -m 1" tuneopts="-c 0 -i 0"
disk_config lvm
vg vg1 disk1.2
-vg1-root / 3G-15G ext4 noatime,rw
+vg1-root / 3G-50G ext4 noatime,rw
vg1-swap swap 200-4G swap sw
vg1-home /home 600- ext4 noatime,nosuid,nodev,rw
disk_config disk1 disklabel:msdos bootable:1 fstabkey:uuid
-primary / 2G-15G ext4 rw,noatime,errors=remount-ro createopts="-O ^metadata_csum"
+primary / 2G-50G ext4 rw,noatime,errors=remount-ro createopts="-O ^metadata_csum"
logical swap 200-1G swap sw
-logical /tmp 100-1G ext4 rw,noatime,nosuid,nodev createopts="-L tmp -m 0 -O ^metadata_csum" tuneopts="-c 0 -i 0"
-logical /home 100-50% ext4 rw,noatime,nosuid,nodev createopts="-L home -m 1 -O ^metadata_csum" tuneopts="-c 0 -i 0"
+logical /home 100- ext4 rw,noatime,nosuid,nodev createopts="-L home -m 1 -O ^metadata_csum" tuneopts="-c 0 -i 0"
+++ /dev/null
-deb {apt_cdn}/debian {release} main contrib non-free
-deb {apt_cdn}/debian {release}-backports main
-deb {apt_cdn}/debian-security {release}/updates main contrib non-free
-
-deb http://packages.cloud.google.com/apt cloud-sdk-{release} main
-deb http://packages.cloud.google.com/apt google-cloud-packages-archive-keyring-{release} main
-deb http://packages.cloud.google.com/apt google-cloud-compute-{release} main
-deb {apt_cdn}/debian stretch main contrib non-free
-deb {apt_cdn}/debian-security stretch/updates main contrib non-free
+deb {%apt_cdn%}/debian {%release%} main
+deb {%security_cdn%}/debian-security {%release%}/updates main
+deb {%apt_cdn%}/debian {%release%}-updates main
+++ /dev/null
-#! /bin/bash
-
-# replace {release} in a sources.list template with the value of $release
-# replace {apt_cdn} with the value of $apt_cdn
-
-# $1 is the class name used
-# $2 is the path to the file copied
-
-# check if a variable of the form {varname} was used at all
-grep -q '{' $2 || exit 0
-
-if [ -z "$release" ]; then
- echo "\$release is undefined. No substitution performed in $2."
-else
- sed -i -e "s/{release}/$release/g" $2
-fi
-
-if [ -z "$apt_cdn" ]; then
- echo "\$apt_cdn not defined. not substituting in $2."
-else
- sed -i -e "s#{apt_cdn}#$apt_cdn#g" $2
-fi
-
+++ /dev/null
-deb http://deb.debian.org/debian stretch main contrib non-free
-deb http://deb.debian.org/debian-security stretch/updates main contrib non-free
-
-# repository that may contain newer fai packages for stretch
-deb [trusted=yes] http://fai-project.org/download stretch koeln
NFSROOT=/srv/fai/nfsroot
TFTPROOT=/srv/tftp/fai
NFSROOT_HOOKS=/etc/fai/nfsroot-hooks/
-FAI_DEBOOTSTRAP_OPTS="--exclude=info --include=aptitude"
+FAI_DEBOOTSTRAP_OPTS="--exclude=info"
# Configuration space
FAI_CONFIGDIR=/srv/fai/config
+++ /dev/null
-#!/bin/bash
-### BEGIN INIT INFO
-# Provides: expand-root
-# Required-Start:
-# Required-Stop:
-# Should-Start:
-# Should-Stop:
-# Default-Start: 2 3 4 5
-# Default-Stop:
-# Description: Expand the filesystem of the mounted root volume/partition to its maximum possible size
-### END INIT INFO
-
-prog=$(basename $0)
-logger="logger -t $prog"
-
-growpart="growpart"
-
-hash $growpart 2> /dev/null || {
- $logger "$growpart was not found on PATH. Unable to expand size."
- exit 1
-}
-
-root_device_path="/dev/sda"
-root_index="1"
-
-# Growpart can fail if the partition is already resized.
-$growpart $root_device_path $root_index || {
- $logger "growpart failed. Unable to expand size."
-}
-
-device_path="${root_device_path}${root_index}"
-filesystem=$(blkid -s TYPE -o value ${device_path})
-
-case $filesystem in
- xfs) xfs_growfs / ;;
- ext2) resize2fs $device_path ;;
- ext3) resize2fs $device_path ;;
- ext4) resize2fs $device_path ;;
- *) $logger "The filesystem $filesystem was not recognized. Unable to expand size." ;;
-esac
fai-chboot -o default
# create a template for booting the installation
-fai-chboot -Iv -f verbose,sshd,createvt,menu -u nfs://faiserver/srv/fai/config jessie.tmpl
+fai-chboot -Iv -f verbose,sshd,createvt,menu -u nfs://faiserver/srv/fai/config stretch.tmpl
# Since we do not know the MAC address, our DHCP cannot provide the hostname.
# Therefore we do explicitly set the hostname
# I use this tar command to create the image of an already running and configured machine
# tar -cf /tmp/IMAGE.tar --exclude /tmp/\* --exclude /run/\* --exclude /proc/\* --exclude /sys/\* --exclude /dev/\* /
-# add --xattrs --selinux --acl if needed (for CentOS 7)
+# add --xattrs --selinux --acls if needed (for CentOS 7)
# Then copy this image to /srv/fai/config/basefiles/IMAGE.tar and make sure your client belongs to the class IMAGE
skiptask extrbase debconf repository updatebase instsoft
--- /dev/null
+#! /bin/bash
+
+# stop resync of soft raid
+if [ $do_init_tasks -eq 1 ]; then
+ if grep -q active /proc/mdstat 2>/dev/null; then
+ echo "frozen" | tee /sys/block/md*/md/sync_action >/dev/null
+ fi
+fi
+exit 0
kernel-patch-badram
kolab-webadmin
kolabadmin
-gstreamer0.10-plugins-really-bad
+gstreamer.\+-plugins-really-bad
liberrors.so
liberrors-samba
gsambad
(floppy), sector 0
mount version older than kernel
Can't locate module
-Warning only 896MB will be used.
+Warning only .\+MB will be used.
hostname: Host name lookup failure
I can't tell the difference.
warning, not much extra random data, consider using the -rand option
can't initialize ip6tables table
Authentication warning overridden
41-warning.sh
+PCCT header not found
Download is performed unsandboxed as root as file
update-alternatives: warning: skip creation of
loop: module verification failed: signature
Warning: apt-key output should not be parsed
WARNING: Failed to connect to lvmetad. Falling back to device scanning
+Warning: The home dir /var/lib/usbmux you specified
+diff: /var/lib/apparmor/profiles/.apparmor.md5sums: No such file or directory
update-rc.d: warning: start and stop actions are no longer supported"
# add pattern on some conditions
-PACKAGES install
+PACKAGES install-norec
+apt-transport-https # is only needed for stretch
+debconf-utils
+file
+less
+linuxlogo
+rsync
+openssh-client openssh-server
+time
+procinfo
+nullmailer
+eject
+locales
+console-setup kbd
+pciutils usbutils
+unattended-upgrades
+
+PACKAGES install NONFREE
# you may want these non-free kernel drivers
-#firmware-bnx2 firmware-bnx2x firmware-realtek
-#firmware-linux
+firmware-bnx2 firmware-bnx2x firmware-realtek
+firmware-linux-nonfree
PACKAGES install I386
-linux-image-686-pae initramfs-tools
+linux-image-686-pae
memtest86+
PACKAGES install CHROOT
linux-image-amd64-
PACKAGES install AMD64
-linux-image-amd64 initramfs-tools
+linux-image-amd64
memtest86+
PACKAGES install ARM64
grub-efi-arm64
linux-image-arm64
-PACKAGES install DHCPC
-isc-dhcp-client
-
PACKAGES install GRUB_PC
grub-pc
lvm2
PACKAGES install CLOUD
-locales-all
unattended-upgrades
# some packages we need on a demo machine
PACKAGES install-norec
-fortune-mod fortunes
-rstat-client #rstatd
+htop iotop nmon
# only when also class XORG is defined
PACKAGES install-norec XORG
+++ /dev/null
-PACKAGES install-norec DEBIAN
-apt-transport-https
-fai-client
-debconf-utils
-file
-less
-linuxlogo
-rdate
-rsync
-openssh-client openssh-server
-time
-procinfo
-nullmailer
-eject
-locales
-console-setup kbd
-pciutils usbutils
-unattended-upgrades
PACKAGES install-norec
fai-quickstart
-isc-dhcp-client
debmirror tcpdump
xorriso grub-pc
lftp curl
nscd psmisc
bind9 dnsutils
iptables-persistent
-emacs24-nox
+emacs25-nox
+++ /dev/null
-PACKAGES install
-google-cloud-packages-archive-keyring
-cloud-initramfs-growroot
-cloud-utils
-google-cloud-sdk
-google-compute-engine-$release
-google-compute-engine-init-$release
-google-config-$release
-python-crcmod
-screen
-vim
-
-acpi-support-base
-busybox
-ca-certificates
-curl
-ethtool
-gdisk
-kpartx
-isc-dhcp-client
-lsb-release
-ntp
-parted
-python
-openssh-client
-openssh-server
-sudo
-uuid-runtime
+++ /dev/null
-# pub 2048R/A7317B0F 2015-04-03 Google Cloud Packages Automatic Signing Key <gc-team@google.com>
-
------BEGIN PGP PUBLIC KEY BLOCK-----
-Version: GnuPG v1
-
-mQENBFUd6rIBCAD6mhKRHDn3UrCeLDp7U5IE7AhhrOCPpqGF7mfTemZYHf/5Jdjx
-cOxoSFlK7zwmFr3lVqJ+tJ9L1wd1K6P7RrtaNwCiZyeNPf/Y86AJ5NJwBe0VD0xH
-TXzPNTqRSByVYtdN94NoltXUYFAAPZYQls0x0nUD1hLMlOlC2HdTPrD1PMCnYq/N
-uL/Vk8sWrcUt4DIS+0RDQ8tKKe5PSV0+PnmaJvdF5CKawhh0qGTklS2MXTyKFoqj
-XgYDfY2EodI9ogT/LGr9Lm/+u4OFPvmN9VN6UG+s0DgJjWvpbmuHL/ZIRwMEn/tp
-uneaLTO7h1dCrXC849PiJ8wSkGzBnuJQUbXnABEBAAG0QEdvb2dsZSBDbG91ZCBQ
-YWNrYWdlcyBBdXRvbWF0aWMgU2lnbmluZyBLZXkgPGdjLXRlYW1AZ29vZ2xlLmNv
-bT6JAT4EEwECACgFAlUd6rICGy8FCQWjmoAGCwkIBwMCBhUIAgkKCwQWAgMBAh4B
-AheAAAoJEDdGwginMXsPcLcIAKi2yNhJMbu4zWQ2tM/rJFovazcY28MF2rDWGOnc
-9giHXOH0/BoMBcd8rw0lgjmOosBdM2JT0HWZIxC/Gdt7NSRA0WOlJe04u82/o3OH
-WDgTdm9MS42noSP0mvNzNALBbQnlZHU0kvt3sV1YsnrxljoIuvxKWLLwren/GVsh
-FLPwONjw3f9Fan6GWxJyn/dkX3OSUGaduzcygw51vksBQiUZLCD2Tlxyr9NvkZYT
-qiaWW78L6regvATsLc9L/dQUiSMQZIK6NglmHE+cuSaoK0H4ruNKeTiQUw/EGFaL
-ecay6Qy/s3Hk7K0QLd+gl0hZ1w1VzIeXLo2BRlqnjOYFX4A=
-=HVTm
------END PGP PUBLIC KEY BLOCK-----
task-german
PACKAGES install GNOME
-iceweasel-l10n-de icedove-l10n-de
+firefox-esr-l10n-de thunderbird-l10n-de
--- /dev/null
+PACKAGES install-norec
+
+# the list of standard packages, without any libs and a few packages removed
+apt-listchanges
+bash-completion
+bind9-host
+dbus
+dnsutils
+doc-debian
+file
+gettext-base
+groff-base
+hdparm
+less
+locales
+lsof
+man-db
+manpages
+mime-support
+ncurses-term
+netcat-traditional
+openssh-client
+pciutils
+perl
+python
+python-minimal
+reportbug
+telnet
+traceroute
+ucf
+xz-utils
PACKAGES install I386
-linux-image-generic initramfs-tools
+linux-image-generic
memtest86+
PACKAGES install CHROOT
linux-image-generic-
PACKAGES install AMD64
-linux-image-generic initramfs-tools
+linux-image-generic
memtest86+
-PACKAGES install DHCPC
-isc-dhcp-client
-
PACKAGES install GRUB_PC
grub-pc
PACKAGES install-norec DEBIAN
xorg xserver-xorg-video-all xserver-xorg-input-all
-ttf-freefont
+fonts-freefont-ttf
xscreensaver
xscreensaver-gl
xterm
error=0 ; trap "error=$((error|1))" ERR
-# add a demo user account
-if ! $ROOTCMD getent passwd demo ; then
- $ROOTCMD adduser -c "fai demo user" demo
- $ROOTCMD usermod -p "$ROOTPW" demo
+# add a $username user account
+if [ -n "$username" ]; then
+ if ! $ROOTCMD getent passwd $username ; then
+ $ROOTCMD adduser -c "$username user" $username
+ $ROOTCMD usermod -p "$USERPW" $username
+ fi
fi
# enable graphical login screen, make run level 5 as default
error=0; trap 'error=$(($?>$error?$?:$error))' ERR # save maximum error code
# set root password
-$ROOTCMD usermod -p "$ROOTPW" root
+if [ -n "$ROOTPW" ]; then
+ $ROOTCMD usermod -p "$ROOTPW" root
+else
+ $ROOTCMD usermod -L root
+fi
exit $error
return
fi
- [ -z $NIC1 ] && return
+ [ -z "$NIC1" ] && return
fields="ID_NET_NAME_FROM_DATABASE ID_NET_NAME_ONBOARD ID_NET_NAME_SLOT ID_NET_NAME_PATH"
for field in $fields; do
fi
}
+if [ -z "$NIC1" ]; then
+ echo "ERROR: \$NIC1 is not defined. Cannot configure /etc/network/interfaces properly."
+fi
newnicnames
CIDR=$(ip -o -f inet addr show $NIC1 | awk '{print $4}')
if ifclass DHCPC && [ $FAI_ACTION = "install" -o $FAI_ACTION = "dirinstall" ]; then
rm -f $target/etc/dpkg/dpkg.cfg.d/fai $target/etc/dpkg/dpkg.cfg.d/unsafe-io
-if [ $FAI_ACTION = "install" -o $FAI_ACTION = "dirinstall" ] ; then
- [ -f /etc/fai/fai.conf ] && cp /etc/fai/fai.conf $target/etc/fai/fai.conf
+if [ -d /etc/fai ]; then
+ ainsl -a /etc/fai/fai.conf "FAI_CONFIG_SRC=$FAI_CONFIG_SRC"
+ fcopy -Miv /etc/fai/fai.conf
fi
-
-ainsl -a /etc/fai/fai.conf "FAI_CONFIG_SRC=$FAI_CONFIG_SRC"
-
-fcopy -Miv /etc/fai/fai.conf
fcopy -iv /etc/rc.local
exit $error
#! /bin/bash
-# (c) Thomas Lange, 2001-2013, lange@debian.org
+# (c) Thomas Lange, 2001-2017, lange@debian.org
error=0; trap 'error=$(($?>$error?$?:$error))' ERR # save maximum error code
$ROOTCMD addgroup --system sambashare || true
fi
-# add a demo user account
-if ! $ROOTCMD getent passwd demo ; then
- $ROOTCMD adduser --disabled-login --gecos "fai demo user" demo
- $ROOTCMD usermod -p "$ROOTPW" demo
- for g in $groups; do
- $ROOTCMD adduser demo $g
- done
+# add additional user account
+if [ -n "$username" ]; then
+ if ! $ROOTCMD getent passwd $username ; then
+ $ROOTCMD adduser --disabled-login --gecos "$username user" $username
+ $ROOTCMD usermod -p "$USERPW" $username
+ userdir=$($ROOTCMD getent passwd "$username" | cut -d: -f6 )
+
+ # disable xfce question about default or empty panel
+ if [ -f $target/etc/xdg/xfce4/panel/default.xml ]; then
+ xfdir=$userdir/.config/xfce4/xfconf/xfce-perchannel-xml
+ if [ ! -d $target/xfdir ]; then
+ $ROOTCMD mkdir -p $xfdir
+ $ROOTCMD cp /etc/xdg/xfce4/panel/default.xml $xfdir/xfce4-panel.xml
+ # group name is the same as user name
+ $ROOTCMD chown -R $username.$username $userdir/.config
+ fi
+ fi
+
+ for g in $groups; do
+ $ROOTCMD adduser $username $g
+ done
+ fi
fi
# copy default dotfiles for root account
fcopy -ir /root
+# use tmpfs for /tmp
+ainsl /etc/fstab "tmpfs /tmp tmpfs nodev,nosuid,size=50%,mode=1777 0 0"
chmod -c 1777 ${target}/tmp
chown -c 0:0 ${target}/tmp
#! /bin/bash
-fcopy -Bvr /etc/fai
-fcopy -Bv /etc/fai/apt/sources.list /etc/dhcp/dhcpd.conf
+fcopy -BvrS /etc/fai
+fcopy -BvS /etc/dhcp/dhcpd.conf
if [ $FAI_ACTION = "install" -o $FAI_ACTION = "dirinstall" ] ; then
+++ /dev/null
-#! /bin/bash
-
-error=0; trap 'error=$(($?>$error?$?:$error))' ERR # save maximum error code
-
-# currently missing from bootstrap-vz:
-# init.d/generate-ssh-hostkeys (currently done in rc.local/CLOUD)
-
-ainsl -av /etc/sysctl.d/70-disable-ipv6.conf 'net.ipv6.conf.all.disable_ipv6 = 1'
-ainsl -av /etc/sysctl.d/70-disable-ipv6.conf 'net.ipv6.conf.lo.disable_ipv6 = 0'
-$ROOTCMD shadowconfig on
-sed -i -e 's/^#PasswordAuthentication yes/PasswordAuthentication no/' $target/etc/ssh/sshd_config
-sed -i -e 's/^PermitRootLogin .*/PermitRootLogin no/' $target/etc/ssh/sshd_config
-ainsl $target/etc/ssh/sshd_config 'ClientAliveInterval 420'
-
-rm -f $target/var/lib/apt/lists/*
-rm -f $target/etc/resolv.conf
+++ /dev/null
-#! /bin/bash
-
-if ifclass GCE; then
- ainsl /etc/default/grub 'GRUB_TERMINAL="serial"'
- ainsl /etc/default/grub 'GRUB_SERIAL_COMMAND="serial --speed 38400 --unit=0 --word=0 --parity=no --stop=1"'
-fi
fi
# copy sources.list
-fcopy -iM /etc/apt/sources.list
+fcopy -iSM /etc/apt/sources.list
setrel() {
grep -q 'file generated by fai-cd' $target/etc/apt/sources.list && cat <<EOF > $target/etc/apt/sources.list
deb $apt_cdn/debian $release main contrib non-free
deb $apt_cdn/debian-security $release/updates main contrib non-free
-deb [trusted=yes] http://fai-project.org/download $release koeln
+#deb [trusted=yes] http://fai-project.org/download $release koeln
EOF
+ # if the package fai-server was installed, enable the project's repository
+ if [ -f $target/var/lib/dpkg/info/fai-server.list ]; then
+ sed -i -e '/fai-project.org/s/^#//' $target/etc/apt/sources.list
+ fi
fi
# for ARM architecture, we may need the kernel and initrd to boot or flash the device
if ifclass ARM64; then
- cp -pv $target/boot/vmlinuz* $target/boot/initrd* $LOGDIR
+ cp -pv $target/boot/vmlinuz* $target/boot/initrd* $FAI_RUNDIR
fi
exit $error