From 8dcda0e05b0109e12280c446070b1fa94d0a6b4b Mon Sep 17 00:00:00 2001 From: Kim Hagen Date: Mon, 12 Nov 2018 10:07:52 +0100 Subject: Add uefi to vyos-build --- .../bootloaders/grub-pc/dejavu-bold-14.pf2 | Bin 0 -> 191158 bytes .../bootloaders/grub-pc/dejavu-bold-16.pf2 | Bin 0 -> 212142 bytes .../live-build-config/bootloaders/grub-pc/grub.cfg | 59 +++++++ .../bootloaders/grub-pc/live-theme/theme.txt | 51 ++++++ .../bootloaders/grub-pc/splash.png | Bin 0 -> 19557 bytes data/live-build-config/hooks/00-manifest.binary | 4 - data/live-build-config/hooks/00-mk_buildid.chroot | 22 --- data/live-build-config/hooks/01-interfaces.chroot | 12 -- data/live-build-config/hooks/02-issue.chroot | 10 -- .../hooks/03-root_bash_completion.chroot | 10 -- data/live-build-config/hooks/04-locale.chroot | 9 - data/live-build-config/hooks/05-event_tty.chroot | 34 ---- data/live-build-config/hooks/07-apt.chroot | 8 - data/live-build-config/hooks/08-sysconf.chroot | 45 ----- data/live-build-config/hooks/09-live.chroot | 11 -- data/live-build-config/hooks/10-unmountfs.chroot | 12 -- data/live-build-config/hooks/11-busybox.chroot | 183 --------------------- .../hooks/12-udev-initramfs.chroot | 9 - .../live-build-config/hooks/13-vyos_replace.chroot | 3 - .../hooks/14-firmware-linux-nonfree.chroot | 12 -- .../live-build-config/hooks/15-sources_list.chroot | 4 - data/live-build-config/hooks/16-fuse.chroot | 4 - .../hooks/17-gen_initramfs.chroot | 4 - .../hooks/18-enable-disable_services.chroot | 40 ----- .../hooks/19-kernel_symlinks.chroot | 6 - .../hooks/20-rm_ddclient_hook.chroot | 3 - .../hooks/21-pam_mkhomedir.chroot | 16 -- data/live-build-config/hooks/30-frr-configs.chroot | 66 -------- .../hooks/30-strongswan-configs.chroot | 38 ----- .../hooks/99-cleanup-packages.chroot | 14 -- .../hooks/live/00-manifest.binary | 4 + .../hooks/live/00-mk_buildid.chroot | 22 +++ .../hooks/live/01-interfaces.chroot | 12 ++ data/live-build-config/hooks/live/02-issue.chroot | 10 ++ .../hooks/live/03-root_bash_completion.chroot | 10 ++ data/live-build-config/hooks/live/04-locale.chroot | 9 + .../hooks/live/05-event_tty.chroot | 34 ++++ data/live-build-config/hooks/live/07-apt.chroot | 8 + .../live-build-config/hooks/live/08-sysconf.chroot | 45 +++++ data/live-build-config/hooks/live/09-live.chroot | 11 ++ .../hooks/live/10-unmountfs.chroot | 12 ++ .../live-build-config/hooks/live/11-busybox.chroot | 183 +++++++++++++++++++++ .../hooks/live/12-udev-initramfs.chroot | 9 + .../hooks/live/13-vyos_replace.chroot | 3 + .../hooks/live/14-firmware-linux-nonfree.chroot | 12 ++ .../hooks/live/15-sources_list.chroot | 4 + data/live-build-config/hooks/live/16-fuse.chroot | 4 + .../hooks/live/17-gen_initramfs.chroot | 4 + .../hooks/live/18-enable-disable_services.chroot | 40 +++++ .../hooks/live/19-kernel_symlinks.chroot | 6 + .../hooks/live/20-rm_ddclient_hook.chroot | 3 + .../hooks/live/21-pam_mkhomedir.chroot | 16 ++ .../hooks/live/24-efi_packages.chroot | 8 + .../hooks/live/30-frr-configs.chroot | 66 ++++++++ .../hooks/live/30-strongswan-configs.chroot | 38 +++++ .../hooks/live/99-cleanup-packages.chroot | 14 ++ .../includes.binary/isolinux/splash.png | Bin 234763 -> 10061 bytes 57 files changed, 697 insertions(+), 579 deletions(-) create mode 100644 data/live-build-config/bootloaders/grub-pc/dejavu-bold-14.pf2 create mode 100644 data/live-build-config/bootloaders/grub-pc/dejavu-bold-16.pf2 create mode 100644 data/live-build-config/bootloaders/grub-pc/grub.cfg create mode 100644 data/live-build-config/bootloaders/grub-pc/live-theme/theme.txt create mode 100644 data/live-build-config/bootloaders/grub-pc/splash.png delete mode 100755 data/live-build-config/hooks/00-manifest.binary delete mode 100755 data/live-build-config/hooks/00-mk_buildid.chroot delete mode 100755 data/live-build-config/hooks/01-interfaces.chroot delete mode 100755 data/live-build-config/hooks/02-issue.chroot delete mode 100755 data/live-build-config/hooks/03-root_bash_completion.chroot delete mode 100755 data/live-build-config/hooks/04-locale.chroot delete mode 100755 data/live-build-config/hooks/05-event_tty.chroot delete mode 100755 data/live-build-config/hooks/07-apt.chroot delete mode 100755 data/live-build-config/hooks/08-sysconf.chroot delete mode 100755 data/live-build-config/hooks/09-live.chroot delete mode 100755 data/live-build-config/hooks/10-unmountfs.chroot delete mode 100755 data/live-build-config/hooks/11-busybox.chroot delete mode 100755 data/live-build-config/hooks/12-udev-initramfs.chroot delete mode 100755 data/live-build-config/hooks/13-vyos_replace.chroot delete mode 100755 data/live-build-config/hooks/14-firmware-linux-nonfree.chroot delete mode 100755 data/live-build-config/hooks/15-sources_list.chroot delete mode 100755 data/live-build-config/hooks/16-fuse.chroot delete mode 100755 data/live-build-config/hooks/17-gen_initramfs.chroot delete mode 100755 data/live-build-config/hooks/18-enable-disable_services.chroot delete mode 100755 data/live-build-config/hooks/19-kernel_symlinks.chroot delete mode 100755 data/live-build-config/hooks/20-rm_ddclient_hook.chroot delete mode 100755 data/live-build-config/hooks/21-pam_mkhomedir.chroot delete mode 100755 data/live-build-config/hooks/30-frr-configs.chroot delete mode 100755 data/live-build-config/hooks/30-strongswan-configs.chroot delete mode 100755 data/live-build-config/hooks/99-cleanup-packages.chroot create mode 100755 data/live-build-config/hooks/live/00-manifest.binary create mode 100755 data/live-build-config/hooks/live/00-mk_buildid.chroot create mode 100755 data/live-build-config/hooks/live/01-interfaces.chroot create mode 100755 data/live-build-config/hooks/live/02-issue.chroot create mode 100755 data/live-build-config/hooks/live/03-root_bash_completion.chroot create mode 100755 data/live-build-config/hooks/live/04-locale.chroot create mode 100755 data/live-build-config/hooks/live/05-event_tty.chroot create mode 100755 data/live-build-config/hooks/live/07-apt.chroot create mode 100755 data/live-build-config/hooks/live/08-sysconf.chroot create mode 100755 data/live-build-config/hooks/live/09-live.chroot create mode 100755 data/live-build-config/hooks/live/10-unmountfs.chroot create mode 100755 data/live-build-config/hooks/live/11-busybox.chroot create mode 100755 data/live-build-config/hooks/live/12-udev-initramfs.chroot create mode 100755 data/live-build-config/hooks/live/13-vyos_replace.chroot create mode 100755 data/live-build-config/hooks/live/14-firmware-linux-nonfree.chroot create mode 100755 data/live-build-config/hooks/live/15-sources_list.chroot create mode 100755 data/live-build-config/hooks/live/16-fuse.chroot create mode 100755 data/live-build-config/hooks/live/17-gen_initramfs.chroot create mode 100755 data/live-build-config/hooks/live/18-enable-disable_services.chroot create mode 100755 data/live-build-config/hooks/live/19-kernel_symlinks.chroot create mode 100755 data/live-build-config/hooks/live/20-rm_ddclient_hook.chroot create mode 100755 data/live-build-config/hooks/live/21-pam_mkhomedir.chroot create mode 100755 data/live-build-config/hooks/live/24-efi_packages.chroot create mode 100755 data/live-build-config/hooks/live/30-frr-configs.chroot create mode 100755 data/live-build-config/hooks/live/30-strongswan-configs.chroot create mode 100755 data/live-build-config/hooks/live/99-cleanup-packages.chroot (limited to 'data') diff --git a/data/live-build-config/bootloaders/grub-pc/dejavu-bold-14.pf2 b/data/live-build-config/bootloaders/grub-pc/dejavu-bold-14.pf2 new file mode 100644 index 00000000..9b093b20 Binary files /dev/null and b/data/live-build-config/bootloaders/grub-pc/dejavu-bold-14.pf2 differ diff --git a/data/live-build-config/bootloaders/grub-pc/dejavu-bold-16.pf2 b/data/live-build-config/bootloaders/grub-pc/dejavu-bold-16.pf2 new file mode 100644 index 00000000..11e7f7ab Binary files /dev/null and b/data/live-build-config/bootloaders/grub-pc/dejavu-bold-16.pf2 differ diff --git a/data/live-build-config/bootloaders/grub-pc/grub.cfg b/data/live-build-config/bootloaders/grub-pc/grub.cfg new file mode 100644 index 00000000..edf2a823 --- /dev/null +++ b/data/live-build-config/bootloaders/grub-pc/grub.cfg @@ -0,0 +1,59 @@ +set default=0 +set timeout=10 + +loadfont $prefix/dejavu-bold-16.pf2 +loadfont $prefix/dejavu-bold-14.pf2 +loadfont $prefix/unicode.pf2 +set gfxmode=auto +insmod all_video +insmod gfxterm +insmod png + +set color_normal=light-gray/black +set color_highlight=white/black + +if [ -e /isolinux/splash.png ]; then + # binary_syslinux modifies the theme file to point to the correct + # background picture + set theme=/boot/grub/live-theme/theme.txt +elif [ -e /boot/grub/splash.png ]; then + set theme=/boot/grub/live-theme/theme.txt +else + set menu_color_normal=cyan/blue + set menu_color_highlight=white/blue +fi + +terminal_output gfxterm + +insmod play +play 960 440 1 0 4 440 1 + +# Live boot +LINUX_LIVE + +# You can add more entries like this +# menuentry "Alternate live boot" { +# linux KERNEL_LIVE APPEND_LIVE custom options here +# initrd INITRD_LIVE +# } +# menuentry "Alternate graphical installer" { +# linux KERNEL_GI APPEND_GI custom options here +# initrd INITRD_GI +# } +# menuentry "Alternate textual installer" { +# linux KERNEL_DI APPEND_DI custom options here +# initrd INITRD_DI +# } + +# Installer (if any) +LINUX_INSTALL + +submenu 'Advanced options...' { + +# More installer entries (if any) +LINUX_ADVANCED_INSTALL + +# Memtest (if any) +MEMTEST + +} diff --git a/data/live-build-config/bootloaders/grub-pc/live-theme/theme.txt b/data/live-build-config/bootloaders/grub-pc/live-theme/theme.txt new file mode 100644 index 00000000..4ceef4b2 --- /dev/null +++ b/data/live-build-config/bootloaders/grub-pc/live-theme/theme.txt @@ -0,0 +1,51 @@ +desktop-image: "../splash.png" +title-color: "#ffffff" +title-font: "DejaVu Sans Bold 16" +title-text: "Live Boot Menu with GRUB" +message-font: "Unifont Regular 16" +terminal-font: "Unifont Regular 16" + +#help bar at the bottom ++ label { + top = 100%-50 + left = 0 + width = 100% + height = 20 + text = "@KEYMAP_SHORT@" + align = "center" + color = "#ffffff" + font = "DejaVu Sans Bold 14" +} + +#boot menu ++ boot_menu { + left = 10% + width = 80% + top = 52% + height = 48%-80 + item_color = "#a8a8a8" + item_font = "DejaVu Sans Bold 14" + selected_item_color= "#ffffff" + selected_item_font = "DejaVu Sans Bold 14" + item_height = 16 + item_padding = 0 + item_spacing = 4 + icon_width = 0 + icon_heigh = 0 + item_icon_space = 0 +} + +#progress bar ++ progress_bar { + id = "__timeout__" + left = 15% + top = 100%-80 + height = 16 + width = 70% + font = "DejaVu Sans Regular 14" + text_color = "#000000" + fg_color = "#ffffff" + bg_color = "#a8a8a8" + border_color = "#ffffff" + text = "@TIMEOUT_NOTIFICATION_LONG@" +} diff --git a/data/live-build-config/bootloaders/grub-pc/splash.png b/data/live-build-config/bootloaders/grub-pc/splash.png new file mode 100644 index 00000000..96e538a4 Binary files /dev/null and b/data/live-build-config/bootloaders/grub-pc/splash.png differ diff --git a/data/live-build-config/hooks/00-manifest.binary b/data/live-build-config/hooks/00-manifest.binary deleted file mode 100755 index 6db8b6f3..00000000 --- a/data/live-build-config/hooks/00-manifest.binary +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/sh - -echo I: Backwards compat packages.txt -echo "ii vyatta-version " > binary/live/packages.txt diff --git a/data/live-build-config/hooks/00-mk_buildid.chroot b/data/live-build-config/hooks/00-mk_buildid.chroot deleted file mode 100755 index 087addad..00000000 --- a/data/live-build-config/hooks/00-mk_buildid.chroot +++ /dev/null @@ -1,22 +0,0 @@ -#!/bin/sh -# create the buildid file - -etcdir=/opt/vyatta/etc - -[ -d $etcdir ] || mkdir -p -m 0755 $etcdir -rm -f $etcdir/build.txt $etcdir/iso-build.txt $etc/iso-submodules.txt - -## NOTE: on live image build, these files are in the chroot/root -## however, during install, these are in /cdrom -for f in iso-build.txt iso-submodules.txt ; do - if [ -f /cdrom/$f ] ; then - cp /cdrom/$f $etcdir - elif [ -f /$f ] ; then - cp /$f $etcdir - else - >$etcdir/$f - fi -done - -# backwards compatible symlink -ln -s iso-build.txt $etcdir/build.txt diff --git a/data/live-build-config/hooks/01-interfaces.chroot b/data/live-build-config/hooks/01-interfaces.chroot deleted file mode 100755 index 8d218ea4..00000000 --- a/data/live-build-config/hooks/01-interfaces.chroot +++ /dev/null @@ -1,12 +0,0 @@ -#!/bin/sh - -if ! grep '^auto lo' /etc/network/interfaces &> /dev/null ; then - mkdir -p -m 0755 /etc/network - cat >> /etc/network/interfaces <<-EOF - - # The loopback network interface - auto lo - iface lo inet loopback - - EOF -fi diff --git a/data/live-build-config/hooks/02-issue.chroot b/data/live-build-config/hooks/02-issue.chroot deleted file mode 100755 index 732ebeb0..00000000 --- a/data/live-build-config/hooks/02-issue.chroot +++ /dev/null @@ -1,10 +0,0 @@ -#!/bin/sh - -echo I: Rewriting /etc/issue and /etc/issue.net -cat < etc/issue -Welcome to VyOS - \n \l - -EOF -cat < etc/issue.net -Welcome to VyOS -EOF diff --git a/data/live-build-config/hooks/03-root_bash_completion.chroot b/data/live-build-config/hooks/03-root_bash_completion.chroot deleted file mode 100755 index b7ea8f52..00000000 --- a/data/live-build-config/hooks/03-root_bash_completion.chroot +++ /dev/null @@ -1,10 +0,0 @@ -#!/bin/sh - -grep -q '\(^[^#]*\)\(\.\|source\) /etc/bash_completion' root/.bashrc || \ - cat <<-EOF >> root/.bashrc - - source /etc/bash_completion - EOF - -sed -i 's/set $BASH_COMPLETION_ORIGINAL_V_VALUE/builtin set $BASH_COMPLETION_ORIGINAL_V_VALUE/g' /usr/share/bash-completion/bash_completion - diff --git a/data/live-build-config/hooks/04-locale.chroot b/data/live-build-config/hooks/04-locale.chroot deleted file mode 100755 index 89a5f954..00000000 --- a/data/live-build-config/hooks/04-locale.chroot +++ /dev/null @@ -1,9 +0,0 @@ -#!/bin/sh - -echo I: Set default locale -cat <etc/default/locale -LANG=en_US.UTF-8 -LC_ALL=C -EOF - -sed -i 's/AcceptEnv LANG LC_\*/# AcceptEnv LANG LC_\*/g' /etc/ssh/sshd_config diff --git a/data/live-build-config/hooks/05-event_tty.chroot b/data/live-build-config/hooks/05-event_tty.chroot deleted file mode 100755 index a00167f7..00000000 --- a/data/live-build-config/hooks/05-event_tty.chroot +++ /dev/null @@ -1,34 +0,0 @@ -#!/bin/sh - -if [ -r etc/event.d/tty1 ] ; then - echo I: Delay getty until rcX completes - sed -i 's/start on runlevel /start on stopped rc/' \ - etc/event.d/tty[1-6] - if [ ! -r etc/event.d/ttyS0 ] && [ -c dev/ttyS0 ] ; then - echo I: Enable serial console login - cat <<-EOF > etc/event.d/ttyS0 - # ttyS0 - getty - # - # This service maintains a getty on ttyS0 from the point the system is - # started until it is shut down again. - - start on stopped rc2 - start on stopped rc3 - start on stopped rc4 - start on stopped rc5 - - stop on runlevel 0 - stop on runlevel 1 - stop on runlevel 6 - - respawn - exec /sbin/getty 9600 ttyS0 vt100 - - EOF - fi -fi - -if [ -r etc/inittab ] && [ -c dev/ttyS0 ] && grep -q '^#T0:.*getty.*ttyS0' etc/inittab ; then - echo I: Enable serial console login - sed -i '/^#T0:/s|^#.*$|T0:23:respawn:/sbin/getty -L ttyS0 9600 vt100|' etc/inittab -fi diff --git a/data/live-build-config/hooks/07-apt.chroot b/data/live-build-config/hooks/07-apt.chroot deleted file mode 100755 index 8db33a78..00000000 --- a/data/live-build-config/hooks/07-apt.chroot +++ /dev/null @@ -1,8 +0,0 @@ -#!/bin/sh - -if [ -e /cdrom/vyatta-pubkey.gpg ] ; then - apt-key add /cdrom/vyatta-pubkey.gpg -elif [ -e /vyatta-pubkey.gpg ] ; then - apt-key add /vyatta-pubkey.gpg - rm -f /vyatta-pubkey.gpg -fi diff --git a/data/live-build-config/hooks/08-sysconf.chroot b/data/live-build-config/hooks/08-sysconf.chroot deleted file mode 100755 index 8d1616c0..00000000 --- a/data/live-build-config/hooks/08-sysconf.chroot +++ /dev/null @@ -1,45 +0,0 @@ -#!/bin/sh - -for conf in motd.tail syslog.conf; do - cp -f /opt/vyatta/etc/$conf /etc/$conf -done - -cp -f /opt/vyatta/etc/default_ssh /etc/default/ssh ->/etc/pam_radius_auth.conf - -update_sysctl_conf () -{ - var=$1 - val=$2 - comment=$3 - sysctl_conf=/etc/sysctl.conf - - if grep -q "^${var}[[:space:]]*=" $sysctl_conf ; then - sed -i "/^${var}[[:space:]]*=/ s,=.*,= ${val}," $sysctl_conf - elif grep -q "^#[[:space:]]*${var}[[:space:]]*=" $sysctl_conf ; then - sed -i "/^#[[:space:]]*${var}[[:space:]]*=/ { s,^#[[:space:]]*,, ; s,[[:space:]]*=.*, = ${val},} " $sysctl_conf - else - cat <<-EOF >> $sysctl_conf - - # $comment - $var = $val - EOF - fi -} - -update_sysctl_conf kernel.printk "4 4 1 7" \ - "the following stops low-level messages on console" -update_sysctl_conf net.ipv4.conf.all.promote_secondaries 1 \ - "promote secondaries with removal of primary address" -update_sysctl_conf net.ipv4.ip_forward 1 \ - "enable ipv4 forwarding" -# FIXME! need to load or staticly link ipv6 module before adding this. -# update_sysctl_conf net.ipv6.conf.all.forwarding 1 \ -# "enable ipv6 forwarding" -update_sysctl_conf net.core.rmem_max 223232 \ - "maximize netlink buffers" - -# Local Variables: -# mode: shell-script -# sh-indentation: 4 -# End: diff --git a/data/live-build-config/hooks/09-live.chroot b/data/live-build-config/hooks/09-live.chroot deleted file mode 100755 index f19f0ae6..00000000 --- a/data/live-build-config/hooks/09-live.chroot +++ /dev/null @@ -1,11 +0,0 @@ -#!/bin/sh - -# hack live script that tries to mount ext[23] floppies as root -# remove user settings live config scripts - -sed -e '/ln -s "${devname}"/,/return 0/ s/^/: FIXME/' \ - -i /usr/share/initramfs-tools/scripts/live - -rm -rf /lib/live/config/0030-live-debconfig_passwd -rm -rf /lib/live/config/0030-user-setup -rm -rf /lib/live/config/0040-sudo diff --git a/data/live-build-config/hooks/10-unmountfs.chroot b/data/live-build-config/hooks/10-unmountfs.chroot deleted file mode 100755 index 7992a4d2..00000000 --- a/data/live-build-config/hooks/10-unmountfs.chroot +++ /dev/null @@ -1,12 +0,0 @@ -#!/bin/sh - -# hack umountfs script to cleanly unmount live systems - -sed \ - -e '/proc|procfs|linprocfs/ s/)/|squashfs|iso9660)/' \ - -e '/tmpfs)/ a\ - [ "$MTPT" != "/media" ] && \ - [ "$MTPT" != "/live" ] && \ - [ "$MTPT" != "/live/cow" ] && -' \ - -i /etc/init.d/umountfs diff --git a/data/live-build-config/hooks/11-busybox.chroot b/data/live-build-config/hooks/11-busybox.chroot deleted file mode 100755 index fecce616..00000000 --- a/data/live-build-config/hooks/11-busybox.chroot +++ /dev/null @@ -1,183 +0,0 @@ -#!/bin/sh - -# create busybox alternatives - -bb=`which busybox` -applets=$(busybox | sed '1,/^Currently defined functions:/d; s/[\[,]//g; s/ / /g; s/$/ /g') - -bb_alternative () -{ - full=$1 - full_bb=${full}.bb - app=${full##*/} - if [ ! -x $full ] && (echo -n "$applets" | grep -q " $app "); then - ln -s $bb $full_bb - update-alternatives --install $full $app $full_bb 10 - fi -} - -bb_alternative /bin/bunzip2 -bb_alternative /bin/bzcat -bb_alternative /bin/cat -bb_alternative /bin/chgrp -bb_alternative /bin/chmod -bb_alternative /bin/chown -bb_alternative /bin/cp -bb_alternative /bin/cpio -bb_alternative /bin/date -bb_alternative /bin/dd -bb_alternative /bin/df -bb_alternative /bin/dmesg -bb_alternative /bin/echo -bb_alternative /bin/egrep -bb_alternative /bin/false -bb_alternative /bin/fgrep -bb_alternative /bin/grep -bb_alternative /bin/gunzip -bb_alternative /bin/gzip -bb_alternative /bin/hostname -bb_alternative /bin/ip -bb_alternative /bin/kill -bb_alternative /bin/ln -bb_alternative /bin/login -bb_alternative /bin/ls -bb_alternative /bin/mkdir -bb_alternative /bin/mknod -bb_alternative /bin/mktemp -bb_alternative /bin/more -bb_alternative /bin/mount -bb_alternative /bin/mt -bb_alternative /bin/mv -bb_alternative /bin/nc -bb_alternative /bin/netstat -bb_alternative /bin/pidof -bb_alternative /bin/ping -bb_alternative /bin/ping6 -bb_alternative /bin/ps -bb_alternative /bin/pwd -bb_alternative /bin/readlink -bb_alternative /bin/rm -bb_alternative /bin/rmdir -bb_alternative /bin/run-parts -bb_alternative /bin/sed -bb_alternative /bin/sh -bb_alternative /bin/sleep -bb_alternative /bin/stty -bb_alternative /bin/sync -bb_alternative /bin/tar -bb_alternative /bin/touch -bb_alternative /bin/true -bb_alternative /bin/umount -bb_alternative /bin/uname -bb_alternative /bin/uncompress -bb_alternative /bin/which -bb_alternative /bin/zcat - -bb_alternative /sbin/ifconfig -bb_alternative /sbin/ip -bb_alternative /sbin/iptunnel -bb_alternative /sbin/klogd -bb_alternative /sbin/losetup -bb_alternative /sbin/nameif -bb_alternative /sbin/route -bb_alternative /sbin/start-stop-daemon -bb_alternative /sbin/swapoff -bb_alternative /sbin/swapon -bb_alternative /sbin/syslogd - -bb_alternative /usr/bin/adjtimex -bb_alternative /usr/bin/ar -bb_alternative /usr/bin/arping -bb_alternative /usr/bin/awk -bb_alternative /usr/bin/basename -bb_alternative /usr/bin/cal -bb_alternative /usr/bin/chvt -bb_alternative /usr/bin/clear -bb_alternative /usr/bin/cmp -bb_alternative /usr/bin/cut -bb_alternative /usr/bin/dc -bb_alternative /usr/bin/deallocvt -bb_alternative /usr/bin/dirname -bb_alternative /usr/bin/dos2unix -bb_alternative /usr/bin/dumpkmap -bb_alternative /usr/bin/du -bb_alternative /usr/bin/env -bb_alternative /usr/bin/expr -bb_alternative /usr/bin/find -bb_alternative /usr/bin/fold -bb_alternative /usr/bin/free -bb_alternative /usr/bin/ftpget -bb_alternative /usr/bin/ftpput -bb_alternative /usr/bin/getopt -bb_alternative /usr/bin/head -bb_alternative /usr/bin/hexdump -bb_alternative /usr/bin/hostid -bb_alternative /usr/bin/id -bb_alternative /usr/bin/ipaddr -bb_alternative /usr/bin/ipcalc -bb_alternative /usr/bin/iplink -bb_alternative /usr/bin/iproute -bb_alternative /usr/bin/killall -bb_alternative /usr/bin/last -bb_alternative /usr/bin/loadfont -bb_alternative /usr/bin/loadkmap -bb_alternative /usr/bin/logger -bb_alternative /usr/bin/logname -bb_alternative /usr/bin/logread -bb_alternative /usr/bin/md5sum -bb_alternative /usr/bin/mkfifo -bb_alternative /usr/bin/nslookup -bb_alternative /usr/bin/od -bb_alternative /usr/bin/openvt -bb_alternative /usr/bin/patch -bb_alternative /usr/bin/printf -bb_alternative /usr/bin/rdate -bb_alternative /usr/bin/realpath -bb_alternative /usr/bin/rpm -bb_alternative /usr/bin/rpm2cpio -bb_alternative /usr/bin/renice -bb_alternative /usr/bin/reset -bb_alternative /usr/bin/setkeycodes -bb_alternative /usr/bin/sha1sum -bb_alternative /usr/bin/sort -bb_alternative /usr/bin/strings -bb_alternative /usr/bin/tail -bb_alternative /usr/bin/tee -bb_alternative /usr/bin/test -bb_alternative /usr/bin/tftp -bb_alternative /usr/bin/time -bb_alternative /usr/bin/top -bb_alternative /usr/bin/touch -bb_alternative /usr/bin/tr -bb_alternative /usr/bin/traceroute -bb_alternative /usr/bin/tty -bb_alternative /usr/bin/uniq -bb_alternative /usr/bin/unix2dos -bb_alternative /usr/bin/unzip -bb_alternative /usr/bin/uptime -bb_alternative /usr/bin/usleep -bb_alternative /usr/bin/uudecode -bb_alternative /usr/bin/uuencode -bb_alternative /usr/bin/vi -bb_alternative /usr/bin/watch -bb_alternative /usr/bin/wc -bb_alternative /usr/bin/wget -bb_alternative /usr/bin/which -bb_alternative /usr/bin/who -bb_alternative /usr/bin/whoami -bb_alternative /usr/bin/xargs -bb_alternative /usr/bin/yes - -bb_alternative /usr/sbin/chroot -bb_alternative /usr/sbin/dumpleases -bb_alternative /usr/sbin/httpd -bb_alternative /usr/sbin/telnetd -bb_alternative /usr/sbin/traceroute -bb_alternative /usr/sbin/udhcpc -bb_alternative /usr/sbin/udhcpd -bb_alternative /usr/sbin/watchdog - -# Local Variables: -# mode: shell-script -# sh-indentation: 4 -# End: diff --git a/data/live-build-config/hooks/12-udev-initramfs.chroot b/data/live-build-config/hooks/12-udev-initramfs.chroot deleted file mode 100755 index 13bdfb89..00000000 --- a/data/live-build-config/hooks/12-udev-initramfs.chroot +++ /dev/null @@ -1,9 +0,0 @@ -#!/bin/sh - -# this was a "local patch" but patch generates a .orig file if it doesn't -# apply cleanly, which is not good when all files in the hook directory are -# executed. just use sed to hack the udev hook here. - -sed -i 's/^\(mount -n -o move \/dev .*\/dev\)$/\1 2>\/dev\/null/' \ - /usr/share/initramfs-tools/scripts/init-bottom/udev - diff --git a/data/live-build-config/hooks/13-vyos_replace.chroot b/data/live-build-config/hooks/13-vyos_replace.chroot deleted file mode 100755 index dcb00ff6..00000000 --- a/data/live-build-config/hooks/13-vyos_replace.chroot +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/sh - -apt-get -y install vyos-replace diff --git a/data/live-build-config/hooks/14-firmware-linux-nonfree.chroot b/data/live-build-config/hooks/14-firmware-linux-nonfree.chroot deleted file mode 100755 index 887831cc..00000000 --- a/data/live-build-config/hooks/14-firmware-linux-nonfree.chroot +++ /dev/null @@ -1,12 +0,0 @@ -#!/bin/sh - -cp /etc/apt/sources.list /etc/apt/sources.list.d/non-free.list -sed -i 's/main/non-free/g' /etc/apt/sources.list.d/non-free.list - -if [ -e /etc/apt/sources.list.d/zz-sources.list ] ; then - cp /etc/apt/sources.list /etc/apt/sources.list.d/zz-non-free.list - sed -i 's/main/non-free/g' /etc/apt/sources.list.d/zz-non-free.list -fi - -apt-get update -apt-get -y install firmware-linux-nonfree diff --git a/data/live-build-config/hooks/15-sources_list.chroot b/data/live-build-config/hooks/15-sources_list.chroot deleted file mode 100755 index 956f9bba..00000000 --- a/data/live-build-config/hooks/15-sources_list.chroot +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/sh - -rm -f /etc/apt/sources.list.d/*.list >/dev/null 2>&1 || true - diff --git a/data/live-build-config/hooks/16-fuse.chroot b/data/live-build-config/hooks/16-fuse.chroot deleted file mode 100755 index 126dc626..00000000 --- a/data/live-build-config/hooks/16-fuse.chroot +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/sh - -sed -i 's/#user_allow_other/user_allow_other/g' /etc/fuse.conf -chmod a+r /etc/fuse.conf diff --git a/data/live-build-config/hooks/17-gen_initramfs.chroot b/data/live-build-config/hooks/17-gen_initramfs.chroot deleted file mode 100755 index aced728a..00000000 --- a/data/live-build-config/hooks/17-gen_initramfs.chroot +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/sh - -echo I: Create initramfs if it does not exist. -update-initramfs -c -k `ls /boot | grep vmlinuz- | sed 's/vmlinuz-//g'` diff --git a/data/live-build-config/hooks/18-enable-disable_services.chroot b/data/live-build-config/hooks/18-enable-disable_services.chroot deleted file mode 100755 index d4d89ba8..00000000 --- a/data/live-build-config/hooks/18-enable-disable_services.chroot +++ /dev/null @@ -1,40 +0,0 @@ -#!/bin/sh - -echo I: Enabling/Disabling services. -systemctl disable exim4 -/usr/sbin/update-rc.d -f exim4 remove -systemctl disable isc-dhcp-server -/usr/sbin/update-rc.d -f isc-dhcp-server remove -systemctl disable isc-dhcp-relay -/usr/sbin/update-rc.d -f isc-dhcp-relay remove -systemctl disable nfacctd -/usr/sbin/update-rc.d -f nfacctd remove -systemctl disable pmacctd -/usr/sbin/update-rc.d -f pmacctd remove -systemctl disable sfacctd -/usr/sbin/update-rc.d -f sfacctd remove -systemctl disable uacctd -/usr/sbin/update-rc.d -f uacctd remove -systemctl disable lighttpd -/usr/sbin/update-rc.d -f lighttpd remove -systemctl disable ssh -/usr/sbin/update-rc.d -f ssh remove -systemctl disable openvpn -/usr/sbin/update-rc.d -f openvpn remove -systemctl disable lldpd -/usr/sbin/update-rc.d -f lldpd remove -systemctl enable ssh-session-cleanup -systemctl disable conntrackd -/usr/sbin/update-rc.d -f conntrackd remove -systemctl disable mdns-repeater -/usr/sbin/update-rc.d -f mdns-repeater remove -systemctl disable udp-broadcast-relay{1.99} -/usr/sbin/update-rc.d -f udp-broadcast-relay remove -systemctl disable pdns-recursor -/usr/sbin/update-rc.d -f pdns-recursor remove -systemctl disable tftpd-hpa.service -/usr/sbin/update-rc.d -f tftpd-hpa.service remove - -systemctl disable strongswan.service -systemctl disable frr.service -systemctl disable salt-minion.service diff --git a/data/live-build-config/hooks/19-kernel_symlinks.chroot b/data/live-build-config/hooks/19-kernel_symlinks.chroot deleted file mode 100755 index e63ca263..00000000 --- a/data/live-build-config/hooks/19-kernel_symlinks.chroot +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -echo I: Creating kernel symlinks. -cd /boot -ln -s initrd.img-* initrd.img -ln -s vmlinuz-* vmlinuz diff --git a/data/live-build-config/hooks/20-rm_ddclient_hook.chroot b/data/live-build-config/hooks/20-rm_ddclient_hook.chroot deleted file mode 100755 index 173b4e5c..00000000 --- a/data/live-build-config/hooks/20-rm_ddclient_hook.chroot +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/sh - -rm -f /etc/dhcp/dhclient-exit-hooks.d/ddclient diff --git a/data/live-build-config/hooks/21-pam_mkhomedir.chroot b/data/live-build-config/hooks/21-pam_mkhomedir.chroot deleted file mode 100755 index af155ba4..00000000 --- a/data/live-build-config/hooks/21-pam_mkhomedir.chroot +++ /dev/null @@ -1,16 +0,0 @@ -#!/bin/sh - -echo I: Create home directory on login. - -cat > /usr/share/pam-configs/mkhomedir < binary/live/packages.txt diff --git a/data/live-build-config/hooks/live/00-mk_buildid.chroot b/data/live-build-config/hooks/live/00-mk_buildid.chroot new file mode 100755 index 00000000..087addad --- /dev/null +++ b/data/live-build-config/hooks/live/00-mk_buildid.chroot @@ -0,0 +1,22 @@ +#!/bin/sh +# create the buildid file + +etcdir=/opt/vyatta/etc + +[ -d $etcdir ] || mkdir -p -m 0755 $etcdir +rm -f $etcdir/build.txt $etcdir/iso-build.txt $etc/iso-submodules.txt + +## NOTE: on live image build, these files are in the chroot/root +## however, during install, these are in /cdrom +for f in iso-build.txt iso-submodules.txt ; do + if [ -f /cdrom/$f ] ; then + cp /cdrom/$f $etcdir + elif [ -f /$f ] ; then + cp /$f $etcdir + else + >$etcdir/$f + fi +done + +# backwards compatible symlink +ln -s iso-build.txt $etcdir/build.txt diff --git a/data/live-build-config/hooks/live/01-interfaces.chroot b/data/live-build-config/hooks/live/01-interfaces.chroot new file mode 100755 index 00000000..8d218ea4 --- /dev/null +++ b/data/live-build-config/hooks/live/01-interfaces.chroot @@ -0,0 +1,12 @@ +#!/bin/sh + +if ! grep '^auto lo' /etc/network/interfaces &> /dev/null ; then + mkdir -p -m 0755 /etc/network + cat >> /etc/network/interfaces <<-EOF + + # The loopback network interface + auto lo + iface lo inet loopback + + EOF +fi diff --git a/data/live-build-config/hooks/live/02-issue.chroot b/data/live-build-config/hooks/live/02-issue.chroot new file mode 100755 index 00000000..732ebeb0 --- /dev/null +++ b/data/live-build-config/hooks/live/02-issue.chroot @@ -0,0 +1,10 @@ +#!/bin/sh + +echo I: Rewriting /etc/issue and /etc/issue.net +cat < etc/issue +Welcome to VyOS - \n \l + +EOF +cat < etc/issue.net +Welcome to VyOS +EOF diff --git a/data/live-build-config/hooks/live/03-root_bash_completion.chroot b/data/live-build-config/hooks/live/03-root_bash_completion.chroot new file mode 100755 index 00000000..b7ea8f52 --- /dev/null +++ b/data/live-build-config/hooks/live/03-root_bash_completion.chroot @@ -0,0 +1,10 @@ +#!/bin/sh + +grep -q '\(^[^#]*\)\(\.\|source\) /etc/bash_completion' root/.bashrc || \ + cat <<-EOF >> root/.bashrc + + source /etc/bash_completion + EOF + +sed -i 's/set $BASH_COMPLETION_ORIGINAL_V_VALUE/builtin set $BASH_COMPLETION_ORIGINAL_V_VALUE/g' /usr/share/bash-completion/bash_completion + diff --git a/data/live-build-config/hooks/live/04-locale.chroot b/data/live-build-config/hooks/live/04-locale.chroot new file mode 100755 index 00000000..89a5f954 --- /dev/null +++ b/data/live-build-config/hooks/live/04-locale.chroot @@ -0,0 +1,9 @@ +#!/bin/sh + +echo I: Set default locale +cat <etc/default/locale +LANG=en_US.UTF-8 +LC_ALL=C +EOF + +sed -i 's/AcceptEnv LANG LC_\*/# AcceptEnv LANG LC_\*/g' /etc/ssh/sshd_config diff --git a/data/live-build-config/hooks/live/05-event_tty.chroot b/data/live-build-config/hooks/live/05-event_tty.chroot new file mode 100755 index 00000000..a00167f7 --- /dev/null +++ b/data/live-build-config/hooks/live/05-event_tty.chroot @@ -0,0 +1,34 @@ +#!/bin/sh + +if [ -r etc/event.d/tty1 ] ; then + echo I: Delay getty until rcX completes + sed -i 's/start on runlevel /start on stopped rc/' \ + etc/event.d/tty[1-6] + if [ ! -r etc/event.d/ttyS0 ] && [ -c dev/ttyS0 ] ; then + echo I: Enable serial console login + cat <<-EOF > etc/event.d/ttyS0 + # ttyS0 - getty + # + # This service maintains a getty on ttyS0 from the point the system is + # started until it is shut down again. + + start on stopped rc2 + start on stopped rc3 + start on stopped rc4 + start on stopped rc5 + + stop on runlevel 0 + stop on runlevel 1 + stop on runlevel 6 + + respawn + exec /sbin/getty 9600 ttyS0 vt100 + + EOF + fi +fi + +if [ -r etc/inittab ] && [ -c dev/ttyS0 ] && grep -q '^#T0:.*getty.*ttyS0' etc/inittab ; then + echo I: Enable serial console login + sed -i '/^#T0:/s|^#.*$|T0:23:respawn:/sbin/getty -L ttyS0 9600 vt100|' etc/inittab +fi diff --git a/data/live-build-config/hooks/live/07-apt.chroot b/data/live-build-config/hooks/live/07-apt.chroot new file mode 100755 index 00000000..8db33a78 --- /dev/null +++ b/data/live-build-config/hooks/live/07-apt.chroot @@ -0,0 +1,8 @@ +#!/bin/sh + +if [ -e /cdrom/vyatta-pubkey.gpg ] ; then + apt-key add /cdrom/vyatta-pubkey.gpg +elif [ -e /vyatta-pubkey.gpg ] ; then + apt-key add /vyatta-pubkey.gpg + rm -f /vyatta-pubkey.gpg +fi diff --git a/data/live-build-config/hooks/live/08-sysconf.chroot b/data/live-build-config/hooks/live/08-sysconf.chroot new file mode 100755 index 00000000..8d1616c0 --- /dev/null +++ b/data/live-build-config/hooks/live/08-sysconf.chroot @@ -0,0 +1,45 @@ +#!/bin/sh + +for conf in motd.tail syslog.conf; do + cp -f /opt/vyatta/etc/$conf /etc/$conf +done + +cp -f /opt/vyatta/etc/default_ssh /etc/default/ssh +>/etc/pam_radius_auth.conf + +update_sysctl_conf () +{ + var=$1 + val=$2 + comment=$3 + sysctl_conf=/etc/sysctl.conf + + if grep -q "^${var}[[:space:]]*=" $sysctl_conf ; then + sed -i "/^${var}[[:space:]]*=/ s,=.*,= ${val}," $sysctl_conf + elif grep -q "^#[[:space:]]*${var}[[:space:]]*=" $sysctl_conf ; then + sed -i "/^#[[:space:]]*${var}[[:space:]]*=/ { s,^#[[:space:]]*,, ; s,[[:space:]]*=.*, = ${val},} " $sysctl_conf + else + cat <<-EOF >> $sysctl_conf + + # $comment + $var = $val + EOF + fi +} + +update_sysctl_conf kernel.printk "4 4 1 7" \ + "the following stops low-level messages on console" +update_sysctl_conf net.ipv4.conf.all.promote_secondaries 1 \ + "promote secondaries with removal of primary address" +update_sysctl_conf net.ipv4.ip_forward 1 \ + "enable ipv4 forwarding" +# FIXME! need to load or staticly link ipv6 module before adding this. +# update_sysctl_conf net.ipv6.conf.all.forwarding 1 \ +# "enable ipv6 forwarding" +update_sysctl_conf net.core.rmem_max 223232 \ + "maximize netlink buffers" + +# Local Variables: +# mode: shell-script +# sh-indentation: 4 +# End: diff --git a/data/live-build-config/hooks/live/09-live.chroot b/data/live-build-config/hooks/live/09-live.chroot new file mode 100755 index 00000000..f19f0ae6 --- /dev/null +++ b/data/live-build-config/hooks/live/09-live.chroot @@ -0,0 +1,11 @@ +#!/bin/sh + +# hack live script that tries to mount ext[23] floppies as root +# remove user settings live config scripts + +sed -e '/ln -s "${devname}"/,/return 0/ s/^/: FIXME/' \ + -i /usr/share/initramfs-tools/scripts/live + +rm -rf /lib/live/config/0030-live-debconfig_passwd +rm -rf /lib/live/config/0030-user-setup +rm -rf /lib/live/config/0040-sudo diff --git a/data/live-build-config/hooks/live/10-unmountfs.chroot b/data/live-build-config/hooks/live/10-unmountfs.chroot new file mode 100755 index 00000000..7992a4d2 --- /dev/null +++ b/data/live-build-config/hooks/live/10-unmountfs.chroot @@ -0,0 +1,12 @@ +#!/bin/sh + +# hack umountfs script to cleanly unmount live systems + +sed \ + -e '/proc|procfs|linprocfs/ s/)/|squashfs|iso9660)/' \ + -e '/tmpfs)/ a\ + [ "$MTPT" != "/media" ] && \ + [ "$MTPT" != "/live" ] && \ + [ "$MTPT" != "/live/cow" ] && +' \ + -i /etc/init.d/umountfs diff --git a/data/live-build-config/hooks/live/11-busybox.chroot b/data/live-build-config/hooks/live/11-busybox.chroot new file mode 100755 index 00000000..fecce616 --- /dev/null +++ b/data/live-build-config/hooks/live/11-busybox.chroot @@ -0,0 +1,183 @@ +#!/bin/sh + +# create busybox alternatives + +bb=`which busybox` +applets=$(busybox | sed '1,/^Currently defined functions:/d; s/[\[,]//g; s/ / /g; s/$/ /g') + +bb_alternative () +{ + full=$1 + full_bb=${full}.bb + app=${full##*/} + if [ ! -x $full ] && (echo -n "$applets" | grep -q " $app "); then + ln -s $bb $full_bb + update-alternatives --install $full $app $full_bb 10 + fi +} + +bb_alternative /bin/bunzip2 +bb_alternative /bin/bzcat +bb_alternative /bin/cat +bb_alternative /bin/chgrp +bb_alternative /bin/chmod +bb_alternative /bin/chown +bb_alternative /bin/cp +bb_alternative /bin/cpio +bb_alternative /bin/date +bb_alternative /bin/dd +bb_alternative /bin/df +bb_alternative /bin/dmesg +bb_alternative /bin/echo +bb_alternative /bin/egrep +bb_alternative /bin/false +bb_alternative /bin/fgrep +bb_alternative /bin/grep +bb_alternative /bin/gunzip +bb_alternative /bin/gzip +bb_alternative /bin/hostname +bb_alternative /bin/ip +bb_alternative /bin/kill +bb_alternative /bin/ln +bb_alternative /bin/login +bb_alternative /bin/ls +bb_alternative /bin/mkdir +bb_alternative /bin/mknod +bb_alternative /bin/mktemp +bb_alternative /bin/more +bb_alternative /bin/mount +bb_alternative /bin/mt +bb_alternative /bin/mv +bb_alternative /bin/nc +bb_alternative /bin/netstat +bb_alternative /bin/pidof +bb_alternative /bin/ping +bb_alternative /bin/ping6 +bb_alternative /bin/ps +bb_alternative /bin/pwd +bb_alternative /bin/readlink +bb_alternative /bin/rm +bb_alternative /bin/rmdir +bb_alternative /bin/run-parts +bb_alternative /bin/sed +bb_alternative /bin/sh +bb_alternative /bin/sleep +bb_alternative /bin/stty +bb_alternative /bin/sync +bb_alternative /bin/tar +bb_alternative /bin/touch +bb_alternative /bin/true +bb_alternative /bin/umount +bb_alternative /bin/uname +bb_alternative /bin/uncompress +bb_alternative /bin/which +bb_alternative /bin/zcat + +bb_alternative /sbin/ifconfig +bb_alternative /sbin/ip +bb_alternative /sbin/iptunnel +bb_alternative /sbin/klogd +bb_alternative /sbin/losetup +bb_alternative /sbin/nameif +bb_alternative /sbin/route +bb_alternative /sbin/start-stop-daemon +bb_alternative /sbin/swapoff +bb_alternative /sbin/swapon +bb_alternative /sbin/syslogd + +bb_alternative /usr/bin/adjtimex +bb_alternative /usr/bin/ar +bb_alternative /usr/bin/arping +bb_alternative /usr/bin/awk +bb_alternative /usr/bin/basename +bb_alternative /usr/bin/cal +bb_alternative /usr/bin/chvt +bb_alternative /usr/bin/clear +bb_alternative /usr/bin/cmp +bb_alternative /usr/bin/cut +bb_alternative /usr/bin/dc +bb_alternative /usr/bin/deallocvt +bb_alternative /usr/bin/dirname +bb_alternative /usr/bin/dos2unix +bb_alternative /usr/bin/dumpkmap +bb_alternative /usr/bin/du +bb_alternative /usr/bin/env +bb_alternative /usr/bin/expr +bb_alternative /usr/bin/find +bb_alternative /usr/bin/fold +bb_alternative /usr/bin/free +bb_alternative /usr/bin/ftpget +bb_alternative /usr/bin/ftpput +bb_alternative /usr/bin/getopt +bb_alternative /usr/bin/head +bb_alternative /usr/bin/hexdump +bb_alternative /usr/bin/hostid +bb_alternative /usr/bin/id +bb_alternative /usr/bin/ipaddr +bb_alternative /usr/bin/ipcalc +bb_alternative /usr/bin/iplink +bb_alternative /usr/bin/iproute +bb_alternative /usr/bin/killall +bb_alternative /usr/bin/last +bb_alternative /usr/bin/loadfont +bb_alternative /usr/bin/loadkmap +bb_alternative /usr/bin/logger +bb_alternative /usr/bin/logname +bb_alternative /usr/bin/logread +bb_alternative /usr/bin/md5sum +bb_alternative /usr/bin/mkfifo +bb_alternative /usr/bin/nslookup +bb_alternative /usr/bin/od +bb_alternative /usr/bin/openvt +bb_alternative /usr/bin/patch +bb_alternative /usr/bin/printf +bb_alternative /usr/bin/rdate +bb_alternative /usr/bin/realpath +bb_alternative /usr/bin/rpm +bb_alternative /usr/bin/rpm2cpio +bb_alternative /usr/bin/renice +bb_alternative /usr/bin/reset +bb_alternative /usr/bin/setkeycodes +bb_alternative /usr/bin/sha1sum +bb_alternative /usr/bin/sort +bb_alternative /usr/bin/strings +bb_alternative /usr/bin/tail +bb_alternative /usr/bin/tee +bb_alternative /usr/bin/test +bb_alternative /usr/bin/tftp +bb_alternative /usr/bin/time +bb_alternative /usr/bin/top +bb_alternative /usr/bin/touch +bb_alternative /usr/bin/tr +bb_alternative /usr/bin/traceroute +bb_alternative /usr/bin/tty +bb_alternative /usr/bin/uniq +bb_alternative /usr/bin/unix2dos +bb_alternative /usr/bin/unzip +bb_alternative /usr/bin/uptime +bb_alternative /usr/bin/usleep +bb_alternative /usr/bin/uudecode +bb_alternative /usr/bin/uuencode +bb_alternative /usr/bin/vi +bb_alternative /usr/bin/watch +bb_alternative /usr/bin/wc +bb_alternative /usr/bin/wget +bb_alternative /usr/bin/which +bb_alternative /usr/bin/who +bb_alternative /usr/bin/whoami +bb_alternative /usr/bin/xargs +bb_alternative /usr/bin/yes + +bb_alternative /usr/sbin/chroot +bb_alternative /usr/sbin/dumpleases +bb_alternative /usr/sbin/httpd +bb_alternative /usr/sbin/telnetd +bb_alternative /usr/sbin/traceroute +bb_alternative /usr/sbin/udhcpc +bb_alternative /usr/sbin/udhcpd +bb_alternative /usr/sbin/watchdog + +# Local Variables: +# mode: shell-script +# sh-indentation: 4 +# End: diff --git a/data/live-build-config/hooks/live/12-udev-initramfs.chroot b/data/live-build-config/hooks/live/12-udev-initramfs.chroot new file mode 100755 index 00000000..13bdfb89 --- /dev/null +++ b/data/live-build-config/hooks/live/12-udev-initramfs.chroot @@ -0,0 +1,9 @@ +#!/bin/sh + +# this was a "local patch" but patch generates a .orig file if it doesn't +# apply cleanly, which is not good when all files in the hook directory are +# executed. just use sed to hack the udev hook here. + +sed -i 's/^\(mount -n -o move \/dev .*\/dev\)$/\1 2>\/dev\/null/' \ + /usr/share/initramfs-tools/scripts/init-bottom/udev + diff --git a/data/live-build-config/hooks/live/13-vyos_replace.chroot b/data/live-build-config/hooks/live/13-vyos_replace.chroot new file mode 100755 index 00000000..dcb00ff6 --- /dev/null +++ b/data/live-build-config/hooks/live/13-vyos_replace.chroot @@ -0,0 +1,3 @@ +#!/bin/sh + +apt-get -y install vyos-replace diff --git a/data/live-build-config/hooks/live/14-firmware-linux-nonfree.chroot b/data/live-build-config/hooks/live/14-firmware-linux-nonfree.chroot new file mode 100755 index 00000000..887831cc --- /dev/null +++ b/data/live-build-config/hooks/live/14-firmware-linux-nonfree.chroot @@ -0,0 +1,12 @@ +#!/bin/sh + +cp /etc/apt/sources.list /etc/apt/sources.list.d/non-free.list +sed -i 's/main/non-free/g' /etc/apt/sources.list.d/non-free.list + +if [ -e /etc/apt/sources.list.d/zz-sources.list ] ; then + cp /etc/apt/sources.list /etc/apt/sources.list.d/zz-non-free.list + sed -i 's/main/non-free/g' /etc/apt/sources.list.d/zz-non-free.list +fi + +apt-get update +apt-get -y install firmware-linux-nonfree diff --git a/data/live-build-config/hooks/live/15-sources_list.chroot b/data/live-build-config/hooks/live/15-sources_list.chroot new file mode 100755 index 00000000..956f9bba --- /dev/null +++ b/data/live-build-config/hooks/live/15-sources_list.chroot @@ -0,0 +1,4 @@ +#!/bin/sh + +rm -f /etc/apt/sources.list.d/*.list >/dev/null 2>&1 || true + diff --git a/data/live-build-config/hooks/live/16-fuse.chroot b/data/live-build-config/hooks/live/16-fuse.chroot new file mode 100755 index 00000000..126dc626 --- /dev/null +++ b/data/live-build-config/hooks/live/16-fuse.chroot @@ -0,0 +1,4 @@ +#!/bin/sh + +sed -i 's/#user_allow_other/user_allow_other/g' /etc/fuse.conf +chmod a+r /etc/fuse.conf diff --git a/data/live-build-config/hooks/live/17-gen_initramfs.chroot b/data/live-build-config/hooks/live/17-gen_initramfs.chroot new file mode 100755 index 00000000..aced728a --- /dev/null +++ b/data/live-build-config/hooks/live/17-gen_initramfs.chroot @@ -0,0 +1,4 @@ +#!/bin/sh + +echo I: Create initramfs if it does not exist. +update-initramfs -c -k `ls /boot | grep vmlinuz- | sed 's/vmlinuz-//g'` diff --git a/data/live-build-config/hooks/live/18-enable-disable_services.chroot b/data/live-build-config/hooks/live/18-enable-disable_services.chroot new file mode 100755 index 00000000..d4d89ba8 --- /dev/null +++ b/data/live-build-config/hooks/live/18-enable-disable_services.chroot @@ -0,0 +1,40 @@ +#!/bin/sh + +echo I: Enabling/Disabling services. +systemctl disable exim4 +/usr/sbin/update-rc.d -f exim4 remove +systemctl disable isc-dhcp-server +/usr/sbin/update-rc.d -f isc-dhcp-server remove +systemctl disable isc-dhcp-relay +/usr/sbin/update-rc.d -f isc-dhcp-relay remove +systemctl disable nfacctd +/usr/sbin/update-rc.d -f nfacctd remove +systemctl disable pmacctd +/usr/sbin/update-rc.d -f pmacctd remove +systemctl disable sfacctd +/usr/sbin/update-rc.d -f sfacctd remove +systemctl disable uacctd +/usr/sbin/update-rc.d -f uacctd remove +systemctl disable lighttpd +/usr/sbin/update-rc.d -f lighttpd remove +systemctl disable ssh +/usr/sbin/update-rc.d -f ssh remove +systemctl disable openvpn +/usr/sbin/update-rc.d -f openvpn remove +systemctl disable lldpd +/usr/sbin/update-rc.d -f lldpd remove +systemctl enable ssh-session-cleanup +systemctl disable conntrackd +/usr/sbin/update-rc.d -f conntrackd remove +systemctl disable mdns-repeater +/usr/sbin/update-rc.d -f mdns-repeater remove +systemctl disable udp-broadcast-relay{1.99} +/usr/sbin/update-rc.d -f udp-broadcast-relay remove +systemctl disable pdns-recursor +/usr/sbin/update-rc.d -f pdns-recursor remove +systemctl disable tftpd-hpa.service +/usr/sbin/update-rc.d -f tftpd-hpa.service remove + +systemctl disable strongswan.service +systemctl disable frr.service +systemctl disable salt-minion.service diff --git a/data/live-build-config/hooks/live/19-kernel_symlinks.chroot b/data/live-build-config/hooks/live/19-kernel_symlinks.chroot new file mode 100755 index 00000000..e63ca263 --- /dev/null +++ b/data/live-build-config/hooks/live/19-kernel_symlinks.chroot @@ -0,0 +1,6 @@ +#!/bin/sh + +echo I: Creating kernel symlinks. +cd /boot +ln -s initrd.img-* initrd.img +ln -s vmlinuz-* vmlinuz diff --git a/data/live-build-config/hooks/live/20-rm_ddclient_hook.chroot b/data/live-build-config/hooks/live/20-rm_ddclient_hook.chroot new file mode 100755 index 00000000..173b4e5c --- /dev/null +++ b/data/live-build-config/hooks/live/20-rm_ddclient_hook.chroot @@ -0,0 +1,3 @@ +#!/bin/sh + +rm -f /etc/dhcp/dhclient-exit-hooks.d/ddclient diff --git a/data/live-build-config/hooks/live/21-pam_mkhomedir.chroot b/data/live-build-config/hooks/live/21-pam_mkhomedir.chroot new file mode 100755 index 00000000..af155ba4 --- /dev/null +++ b/data/live-build-config/hooks/live/21-pam_mkhomedir.chroot @@ -0,0 +1,16 @@ +#!/bin/sh + +echo I: Create home directory on login. + +cat > /usr/share/pam-configs/mkhomedir <