summaryrefslogtreecommitdiffstats
path: root/system-boot/backend
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2019-02-02 10:00:00 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2019-02-02 10:00:00 +0000
commit32322960234c8ec91e0d42835a3ec5ee63305070 (patch)
tree71d79574de0193778ad6cc6c96dfd4f74fa6bbbb /system-boot/backend
parentInitial commit. (diff)
downloadopen-infrastructure-system-tools-32322960234c8ec91e0d42835a3ec5ee63305070.tar.xz
open-infrastructure-system-tools-32322960234c8ec91e0d42835a3ec5ee63305070.zip
Adding upstream version 20190202.upstream/20190202
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to '')
-rwxr-xr-xsystem-boot/backend/dracut/live.script11
-rw-r--r--system-boot/backend/initramfs-tools/kms.hook25
-rwxr-xr-xsystem-boot/backend/initramfs-tools/live.hook254
-rwxr-xr-xsystem-boot/backend/initramfs-tools/live.script59
4 files changed, 349 insertions, 0 deletions
diff --git a/system-boot/backend/dracut/live.script b/system-boot/backend/dracut/live.script
new file mode 100755
index 0000000..0774bfb
--- /dev/null
+++ b/system-boot/backend/dracut/live.script
@@ -0,0 +1,11 @@
+#!/bin/sh
+
+#set -e
+
+. /bin/live-boot
+
+DRACUT_FIXME ()
+{
+ # dracut entry point for live-boot is FIXME(); function
+ Live
+}
diff --git a/system-boot/backend/initramfs-tools/kms.hook b/system-boot/backend/initramfs-tools/kms.hook
new file mode 100644
index 0000000..7302c12
--- /dev/null
+++ b/system-boot/backend/initramfs-tools/kms.hook
@@ -0,0 +1,25 @@
+#!/bin/sh
+# hook for adding kms modules
+
+set -e
+
+# initramfs-tools header
+
+PREREQ=""
+prereqs()
+{
+ echo "${PREREQ}"
+}
+
+case "${1}" in
+ prereqs)
+ prereqs
+ exit 0
+ ;;
+esac
+
+. /usr/share/initramfs-tools/hook-functions
+
+for module in i915 radeon nouveau ; do
+ manual_add_modules $module
+done
diff --git a/system-boot/backend/initramfs-tools/live.hook b/system-boot/backend/initramfs-tools/live.hook
new file mode 100755
index 0000000..a5444c5
--- /dev/null
+++ b/system-boot/backend/initramfs-tools/live.hook
@@ -0,0 +1,254 @@
+#!/bin/sh
+
+set -e
+
+. /usr/share/initramfs-tools/hook-functions
+
+[ "${QUIET}" ] || echo -n "live-boot:"
+
+# Reading configuration file from filesystem and live-media
+for _FILE in /etc/live/boot.conf /etc/live/boot/* \
+ /run/live/medium/live/boot.conf /run/live/medium/live/boot/*
+do
+ if [ -e "${_FILE}" ]
+ then
+ . "${_FILE}"
+ fi
+done
+
+# Checking live-boot
+if [ ! -e /bin/live-boot ]
+then
+ echo
+ echo "W: live-boot-initramfs-tools (backend) installed without live-boot,"
+ echo "W: this initramfs will *NOT* have live support."
+ exit 0
+fi
+
+[ "${QUIET}" ] || echo -n " core"
+
+mkdir -p "${DESTDIR}/bin"
+cp -a /bin/live-boot "${DESTDIR}/bin"
+
+mkdir -p "${DESTDIR}/lib/live"
+cp -a /lib/live/boot "${DESTDIR}/lib/live"
+
+mkdir -p "${DESTDIR}/etc/live"
+if [ -e /etc/live/boot.conf ]
+then
+ cp -a /etc/live/boot.conf "${DESTDIR}/etc/live"
+fi
+if [ -e /etc/live/boot ]
+then
+ cp -a /etc/live/boot "${DESTDIR}/etc/live"
+fi
+
+# klibc dependencies
+for FILE in /lib/libacl* /lib/libblkid* /lib/libuuid* /lib/libdevmapper* /lib/libattr*
+do
+ if [ ! -e "${DESTDIR}/${FILE}" ] && ls "${FILE}" > /dev/null 2>&1
+ then
+ cp -a "${FILE}" "${DESTDIR}/${FILE}"
+ fi
+done
+
+# udev dependencies
+if [ "${MINIMAL:-}" != "true" ] && [ "${MINIMAL:-}" != "yes" ]
+then
+ for FILE in /lib/udev/*_id
+ do
+ copy_exec "${FILE}"
+ done
+fi
+
+if [ -e /lib/udev/rules.d/60-cdrom_id.rules ] && [ "${DISABLE_CDROM:-}" != "true" ] && \
+ [ "${DISABLE_CDROM:-}" != "yes" ]
+then
+ mkdir -p "${DESTDIR}/lib/udev/rules.d"
+ cp -p /lib/udev/rules.d/60-cdrom_id.rules "${DESTDIR}/lib/udev/rules.d"
+fi
+
+[ "${QUIET}" ] || echo -n " filesystems"
+
+# Configuration: keymap (usefull when using encryption)
+if [ -x /bin/loadkeys ] && [ -r /etc/console/boottime.kmap.gz ]
+then
+ copy_exec /bin/loadkeys
+
+ mkdir -p "${DESTDIR}/etc"
+ cp /etc/console/boottime.kmap.gz "${DESTDIR}/etc"
+fi
+
+# Configuration: Unique ID
+if [ -r /etc/live/uuid.conf ]
+then
+ mkdir -p "${DESTDIR}/conf"
+ cp /etc/live/uuid.conf ${DESTDIR}/conf
+fi
+
+# Filesystem: btrfs
+manual_add_modules btrfs
+
+# Filesystem: cifs
+if [ -x /sbin/mount.cifs ]
+then
+ copy_exec /sbin/mount.cifs
+ manual_add_modules cifs
+fi
+
+# Filesystem: ext3/ext4
+manual_add_modules ext3
+manual_add_modules ext4
+
+# Filesystem: hfs/hfsplus
+manual_add_modules hfs
+manual_add_modules hfsplus
+
+# Filesystem: jffs2
+manual_add_modules jffs2
+
+if [ -x /usr/bin/rsync ] && [ "${MINIMAL:-}" != "true" ] && [ "${MINIMAL:-}" != "yes" ]
+then
+ copy_exec /usr/bin/rsync /bin
+fi
+
+# Filesystem: squashfs
+copy_exec /sbin/losetup
+manual_add_modules loop
+manual_add_modules squashfs
+manual_add_modules sqlzma
+manual_add_modules unlzma
+
+# Filesystem: aufs/overlay
+manual_add_modules aufs
+manual_add_modules overlay
+
+# Filesystem: vfat
+if [ "${DISABLE_FAT:-}" != "true" ] && [ "${DISABLE_FAT:-}" != "yes" ]
+then
+ manual_add_modules nls_cp437
+ manual_add_modules nls_iso8859-1
+ manual_add_modules nls_utf8
+ manual_add_modules nls_ascii
+ manual_add_modules vfat
+fi
+
+# Filesystem: ntfs
+if [ "${DISABLE_NTFS:-}" != "true" ] && [ "${DISABLE_NTFS:-}" != "yes" ]
+then
+ manual_add_modules ntfs
+fi
+
+[ "${QUIET}" ] || echo -n " devices"
+# Hardware: cdrom
+if [ "${DISABLE_CDROM:-}" != "true" ] && [ "${DISABLE_CDROM:-}" != "yes" ]
+then
+ manual_add_modules ide-cd
+ manual_add_modules ide-generic
+ manual_add_modules ohci1394
+ manual_add_modules sbp2
+ manual_add_modules sr_mod
+fi
+
+# Hardware: usb
+if [ "${DISABLE_USB:-}" != "true" ] && [ "${DISABLE_USB:-}" != "yes" ]
+then
+ manual_add_modules sd_mod
+fi
+
+# Hardware: network
+auto_add_modules net
+
+# Program: eject
+if [ -x /usr/bin/eject ]
+then
+ copy_exec /usr/bin/eject /bin
+fi
+
+[ "${QUIET}" ] || echo -n " utils"
+
+# Feature: Verify Checksums
+if [ -e /etc/progress-linux_version ]
+then
+ copy_exec /usr/bin/sha256sum /bin
+else
+ copy_exec /usr/bin/md5sum /bin
+fi
+
+# Program: memdisk
+if [ -x /usr/bin/memdiskfind ]
+then
+[ "${QUIET}" ] || echo -n " memdisk"
+ copy_exec /usr/bin/memdiskfind
+ manual_add_modules phram
+ manual_add_modules mtdblock
+fi
+
+# Program: udev
+if [ -x /sbin/udevadm ]
+then
+ [ "${QUIET}" ] || echo -n " udev"
+ copy_exec /sbin/udevadm
+fi
+
+# Program: blockdev
+if [ -x /sbin/blockdev ]
+then
+ [ "${QUIET}" ] || echo -n " blockdev"
+ copy_exec /sbin/blockdev
+fi
+
+# FUSE kernel module
+if [ "${DISABLE_FUSE:-n}" != "true" ] && [ "${DISABLE_FUSE:-n}" != "yes" ]
+then
+ manual_add_modules fuse
+
+ # FUSE filesystem: httpfs2
+ if [ -x /usr/bin/httpfs2_ssl ]
+ then
+ [ "${QUIET}" ] || echo -n " httpfs:ssl"
+ copy_exec /usr/bin/httpfs2_ssl /bin/httpfs
+ elif [ -x /usr/bin/httpfs2 ]
+ then
+ [ "${QUIET}" ] || echo -n " httpfs"
+ copy_exec /usr/bin/httpfs2 /bin/httpfs
+ fi
+
+ # FUSE filesystem: curlftpfs
+ if [ -x /usr/bin/curlftpfs ]
+ then
+ [ "${QUIET}" ] || echo -n " ftpfs"
+ copy_exec /usr/bin/curlftpfs /bin
+ fi
+fi
+
+# iSCSI
+if [ -x /usr/sbin/iscsistart ]
+then
+ [ "${QUIET}" ] || echo -n " iscsi"
+ copy_exec /usr/sbin/iscsistart /bin
+ #manual_add_modules ib_iser
+ manual_add_modules iscsi_tcp
+ manual_add_modules crc32c
+fi
+
+# Some experimental stuff
+
+[ "${QUIET}" ] || echo -n " dns"
+
+# /lib/libnss_dns.so.*:a DNS
+# /lib/libnss_files.so.*: /etc/hosts and /etc/passwd
+# /lib/libnss_compat.so.*: /etc/passwd
+
+for _SHLIB in $(find /lib -name 'libnss_dns.so.*' -o -name 'libnss_files.so.*')
+do
+ copy_exec "${_SHLIB}"
+done
+
+if [ ! -e "${DESTDIR}/etc/nsswitch.conf" ]
+then
+ # Needed to make "hostname -f" honor the domainname provided by DHCP
+ echo "hosts: files dns" > "${DESTDIR}/etc/nsswitch.conf"
+fi
+
+[ "${QUIET}" ] || echo .
diff --git a/system-boot/backend/initramfs-tools/live.script b/system-boot/backend/initramfs-tools/live.script
new file mode 100755
index 0000000..5bec741
--- /dev/null
+++ b/system-boot/backend/initramfs-tools/live.script
@@ -0,0 +1,59 @@
+# Live system filesystem mounting -*- shell-script -*-
+
+. /bin/live-boot
+
+live_top()
+{
+ if [ "${live_top_used}" != "yes" ]; then
+ [ "$quiet" != "y" ] && log_begin_msg "Running /scripts/live-top"
+ run_scripts /scripts/live-top
+ [ "$quiet" != "y" ] && log_end_msg
+ fi
+ live_top_used=yes
+}
+
+live_premount()
+{
+ if [ "${live_premount_used}" != "yes" ]; then
+ [ "$quiet" != "y" ] && log_begin_msg "Running /scripts/live-premount"
+ run_scripts /scripts/live-premount
+ [ "$quiet" != "y" ] && log_end_msg
+ fi
+ live_premount_used=yes
+}
+
+live_bottom()
+{
+ if [ "${live_premount_used}" = "yes" ] || [ "${live_top_used}" = "yes" ]; then
+ [ "$quiet" != "y" ] && log_begin_msg "Running /scripts/live-bottom"
+ run_scripts /scripts/live-bottom
+ [ "$quiet" != "y" ] && log_end_msg
+ fi
+ live_premount_used=no
+ live_top_used=no
+}
+
+
+mountroot()
+{
+ # initramfs-tools entry point for live-boot is mountroot(); function
+ Live
+}
+
+mount_top()
+{
+ # Note, also called directly in case it's overridden.
+ live_top
+}
+
+mount_premount()
+{
+ # Note, also called directly in case it's overridden.
+ live_premount
+}
+
+mount_bottom()
+{
+ # Note, also called directly in case it's overridden.
+ live_bottom
+}