#!/usr/bin/env zsh # # Copyright (c) 2016 Dyne.org Foundation # libdevuansdk is written and maintained by # Jaromil # KatolaZ # parazyd # # 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 . ## 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 # 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 < /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 }