339 lines
8.1 KiB
Bash
339 lines
8.1 KiB
Bash
#!/usr/bin/env zsh
|
|
#
|
|
# Copyright (c) 2016 Dyne.org Foundation
|
|
# libdevuansdk is written and maintained by
|
|
# Jaromil <jaromil@dyne.org>
|
|
# KatolaZ <katolaz@freaknet.org>
|
|
# parazyd <parazyd@dyne.org>
|
|
#
|
|
# This file is part of libdevuansdk
|
|
#
|
|
# This source code is free software: you can redistribute it and/or modify
|
|
# it under the terms of the GNU General Public License as published by
|
|
# the Free Software Foundation, either version 3 of the License, or
|
|
# (at your option) any later version.
|
|
#
|
|
# This software is distributed in the hope that it will be useful,
|
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
# GNU General Public License for more details.
|
|
#
|
|
# You should have received a copy of the GNU General Public License
|
|
# along with this source code. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
## Default system configuration
|
|
|
|
conf_install_grub() {
|
|
fn conf_install_grub $@
|
|
chrootpath="$1"
|
|
req=(chrootpath)
|
|
ckreq || return 1
|
|
|
|
notice "Installing grub-pc"
|
|
sudo chroot ${chrootpath} apt-get --yes --force-yes install grub-pc
|
|
}
|
|
|
|
conf_install_kernel() {
|
|
fn conf_install_kernel $@
|
|
chrootpath="$1"
|
|
req=(arch chrootpath)
|
|
ckreq || return 1
|
|
|
|
notice "Installing stock kernel (linux-image-$arch)"
|
|
sudo chroot ${chrootpath} apt-get --yes --force-yes install linux-image-$arch
|
|
}
|
|
|
|
conf_print_debconf() {
|
|
fn conf_print_debconf
|
|
|
|
cat << EOF
|
|
console-common console-data/keymap/policy select Select keymap from full list
|
|
console-common console-data/keymap/full select en-latin1-nodeadkeys
|
|
EOF
|
|
}
|
|
|
|
conf_print_fstab() {
|
|
fn conf_print_fstab
|
|
|
|
cat << EOF
|
|
#<file system> <mount point> <type> <options> <dump> <pass>
|
|
proc /proc proc nodev,noexec,nosuid 0 0
|
|
|
|
# rootfs
|
|
/dev/sda2 / ext4 errors=remount-ro 0 1
|
|
|
|
# boot
|
|
/dev/sda1 /boot ext2 noauto 0 0
|
|
EOF
|
|
}
|
|
|
|
conf_print_hostname() {
|
|
fn conf_print_hostname
|
|
req=(os)
|
|
ckreq || return 1
|
|
|
|
print ${os}
|
|
}
|
|
|
|
conf_print_hosts() {
|
|
fn conf_print_hosts
|
|
req=(os)
|
|
ckreq || return 1
|
|
|
|
cat << EOF
|
|
127.0.0.1 ${os} localhost
|
|
::1 localhost ip6-localhost ip6-loopback
|
|
fe00::0 ip6-localnet
|
|
fe00::0 ip6-mcastprefix
|
|
fe02::1 ip6-allnodes
|
|
fe02::1 ip6-allrouters
|
|
EOF
|
|
}
|
|
|
|
conf_print_networkifaces() {
|
|
fn conf_print_networkifaces
|
|
|
|
cat << EOF
|
|
# interfaces(5) file used by ifup(8) and ifdown(8)
|
|
|
|
# Please note that this file is written to be used with dhcpcd
|
|
# For static IP, consult /etc/dhcpcd.conf and 'man dhcpcd.conf'
|
|
|
|
# Include files from /etc/network/interfaces.d:
|
|
source-directory /etc/network/interfaces.d
|
|
|
|
auto lo
|
|
iface lo inet loopback
|
|
|
|
auto eth0
|
|
iface eth0 inet dhcp
|
|
|
|
# auto eth0
|
|
# iface eth0 inet static
|
|
# address 10.0.1.10
|
|
# netmask 255.255.255.0
|
|
|
|
# allow-hotplug wlan0
|
|
# iface wlan0 inet manual
|
|
# wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf
|
|
|
|
# allow-hotplug wlan1
|
|
# iface wlan1 inet manual
|
|
# wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf
|
|
EOF
|
|
}
|
|
|
|
conf_print_resolvconf() {
|
|
fn conf_print_resolvconf
|
|
|
|
cat << EOF
|
|
nameserver 8.8.8.8
|
|
nameserver 8.8.4.4
|
|
EOF
|
|
}
|
|
|
|
conf_print_sourceslist() {
|
|
fn conf_print_sourceslist
|
|
req=(mirror release section)
|
|
ckreq || return 1
|
|
|
|
cat << EOF
|
|
deb ${mirror} ${release} ${section}
|
|
deb ${mirror} ${release}-updates ${section}
|
|
deb ${mirror} ${release}-security ${section}
|
|
|
|
deb-src ${mirror} ${release} ${section}
|
|
deb-src ${mirror} ${release}-updates ${section}
|
|
deb-src ${mirror} ${release}-security ${section}
|
|
EOF
|
|
}
|
|
|
|
conf_print_usrexcludes() {
|
|
fn conf_print_usrexcludes
|
|
cat <<EOF
|
|
# rsync excludes file for refractasnapshot and refractasnapshot-gui
|
|
# version 9.2.0
|
|
|
|
|
|
# Exclude some system files. These are required, and you probably
|
|
# shouldn't change them.
|
|
|
|
- /dev/*
|
|
- /cdrom/*
|
|
- /media/*
|
|
- /swapfile
|
|
- /mnt/*
|
|
- /sys/*
|
|
- /proc/*
|
|
- /tmp/*
|
|
- /live
|
|
- /persistence.conf
|
|
- /boot/grub/grub.cfg
|
|
- /boot/grub/menu.lst
|
|
- /boot/grub/device.map
|
|
- /boot/*.bak
|
|
- /boot/*.old-dkms
|
|
- /etc/udev/rules.d/70-persistent-cd.rules
|
|
- /etc/udev/rules.d/70-persistent-net.rules
|
|
- /etc/fstab
|
|
- /etc/fstab.d/*
|
|
- /etc/mtab
|
|
- /etc/blkid.tab
|
|
- /etc/blkid.tab.old
|
|
- /etc/apt/sources.list~
|
|
- /etc/crypttab
|
|
- /etc/initramfs-tools/conf.d/resume # see remove-cryptroot and nocrypt.sh
|
|
- /etc/initramfs-tools/conf.d/cryptroot # see remove-cryptroot and nocrypt.sh
|
|
- /home/snapshot
|
|
|
|
# Added for newer version of live-config/live-boot in wheezy
|
|
# These are only relevant here if you create a snapshot while
|
|
# you're running a live-CD or live-usb.
|
|
- /lib/live/overlay
|
|
- /lib/live/image
|
|
- /lib/live/rootfs
|
|
- /lib/live/mount
|
|
- /run/*
|
|
|
|
|
|
## Entries below are optional. They are included either for privacy
|
|
## or to reduce the size of the snapshot. If you have any large
|
|
## files or directories, you should exclude them from being copied
|
|
## by adding them to this list.
|
|
##
|
|
## Entries beginning with /home/*/ will affect all users.
|
|
|
|
|
|
# Uncomment this to exclude everything in /var/log/
|
|
#- /var/log/*
|
|
|
|
# As of version 9.2.0, current log files are truncated,
|
|
# and archived log files are excluded.
|
|
#
|
|
# The next three lines exclude everything in /var/log
|
|
# except /var/log/clamav/ (or anything else beginning with "c") and
|
|
# /var/log/gdm (or anything beginning with "g").
|
|
# If clamav log files are excluded, freshclam will give errors at boot.
|
|
- /var/log/[a-b,A-Z]*
|
|
- /var/log/[d-f]*
|
|
- /var/log/[h-z]*
|
|
- /var/log/*gz
|
|
|
|
- /var/cache/apt/archives/*.deb
|
|
- /var/cache/apt/pkgcache.bin
|
|
- /var/cache/apt/srcpkgcache.bin
|
|
- /var/cache/apt/apt-file/*
|
|
- /var/cache/debconf/*~old
|
|
- /var/lib/apt/lists/*
|
|
- /var/lib/apt/*~
|
|
- /var/lib/apt/cdroms.list
|
|
- /var/lib/aptitude/*.old
|
|
- /var/lib/dhcp/*
|
|
- /var/lib/dpkg/*~old
|
|
- /var/spool/mail/*
|
|
- /var/mail/*
|
|
- /var/backups/*.gz
|
|
#- /var/backups/*.bak
|
|
- /var/lib/dbus/machine-id
|
|
- /var/lib/live/config/*
|
|
|
|
- /usr/share/icons/*/icon-theme.cache
|
|
|
|
- /root/.aptitude
|
|
- /root/.bash_history
|
|
- /root/.disk-manager.conf
|
|
- /root/.fstab.log
|
|
- /root/.lesshst
|
|
- /root/*/.log
|
|
- /root/.local/share/*
|
|
- /root/.nano_history
|
|
- /root/.synaptic
|
|
- /root/.VirtualBox
|
|
- /root/.ICEauthority
|
|
- /root/.Xauthority
|
|
- /root/.links2
|
|
|
|
- /root/.ssh
|
|
- /root/[a-zA-Z0-9]*
|
|
|
|
- /home/*/.Trash*
|
|
- /home/*/.local/share/Trash/*
|
|
- /home/*/.mozilla/*/Cache/*
|
|
- /home/*/.mozilla/*/urlclassifier3.sqlite
|
|
- /home/*/.mozilla/*/places.sqlite
|
|
- /home/*/.mozilla/*/cookies.sqlite
|
|
- /home/*/.mozilla/*/signons.sqlite
|
|
- /home/*/.mozilla/*/formhistory.sqlite
|
|
- /home/*/.mozilla/*/downloads.sqlite
|
|
- /home/*/.adobe
|
|
- /home/*/.aptitude
|
|
- /home/*/.bash_history
|
|
- /home/*/.cache
|
|
- /home/*/.dbus
|
|
- /home/*/.gksu*
|
|
- /home/*/.gvfs
|
|
- /home/*/.lesshst
|
|
- /home/*/.log
|
|
- /home/*/.macromedia
|
|
- /home/*/.nano_history
|
|
- /home/*/.pulse*
|
|
- /home/*/.recently-used
|
|
- /home/*/.recently-used.xbel
|
|
- /home/*/.local/share/recently-used.xbel
|
|
- /home/*/.thumbnails/large/*
|
|
- /home/*/.thumbnails/normal/*
|
|
- /home/*/.thumbnails/fail/*
|
|
- /home/*/.vbox*
|
|
- /home/*/.VirtualBox
|
|
- /home/*/VirtualBox\ VMs
|
|
#- /home/*/.wine
|
|
- /home/*/.xsession-errors*
|
|
- /home/*/.ICEauthority
|
|
- /home/*/.Xauthority
|
|
|
|
# You might want to comment these out if you're making a snapshot for
|
|
# your own personal use, not to be shared with others.
|
|
- /home/*/.gnupg
|
|
- /home/*/.ssh
|
|
- /home/*/.xchat2
|
|
|
|
### ignore all non-hidden files in /home/devuan -- KatolaZ -- 2016-05-21
|
|
|
|
- /home/devuan/[a-zA-Z0-9]*
|
|
|
|
###
|
|
### ignore the symlink /initrd.img -> /boot/initrd.img-`uname -r`
|
|
### -- KatolaZ -- 2016-05-21
|
|
###
|
|
|
|
- /initrd.img
|
|
|
|
# Exclude ssh_host_keys. New ones will be generated upon live boot.
|
|
# This fixes a security hole in all versions before 9.0.9-3.
|
|
# If you really want to clone your existing ssh host keys
|
|
# in your snapshot, comment out these two lines.
|
|
#- /etc/ssh/ssh_host_*_key*
|
|
#- /etc/ssh/ssh_host_key*
|
|
|
|
# Examples of things to exclude in order to keep the image small:
|
|
#- /home/fred/Downloads/*
|
|
#- /home/*/Music/*
|
|
#- /home/user/Pictures/*
|
|
#- /home/*/Videos/*
|
|
|
|
|
|
# To exclude all hidden files and directories in your home, uncomment
|
|
# the next line. You will lose custom desktop configs if you do.
|
|
##- /home/*/.[a-z,A-Z,0-9]*
|
|
|
|
|
|
#### Exclude the large initramfs -- KatolaZ -- 2016-05-16
|
|
|
|
- /boot/initrd.img*
|
|
|
|
#### Exclude inittab backup files -- KatolaZ -- 2016-06-04
|
|
|
|
- /etc/inittab.*
|
|
EOF
|
|
}
|