summaryrefslogtreecommitdiff
path: root/sys-boot/systemrescuecd-x86-grub
diff options
context:
space:
mode:
authorV3n3RiX <venerix@redcorelinux.org>2019-07-10 23:40:16 +0100
committerV3n3RiX <venerix@redcorelinux.org>2019-07-10 23:40:16 +0100
commit51af5f0eb4cddbe6aa7953717873691d77aae9ff (patch)
tree1541525274162b033ebbc3ed38abaf335fbbd49a /sys-boot/systemrescuecd-x86-grub
parent7014a5a3ea0feffab9701fdd6b64cc7667a985af (diff)
gentoo resync : 11.07.2019
Diffstat (limited to 'sys-boot/systemrescuecd-x86-grub')
-rw-r--r--sys-boot/systemrescuecd-x86-grub/Manifest3
-rw-r--r--sys-boot/systemrescuecd-x86-grub/files/systemrescuecd.default-233
-rwxr-xr-xsys-boot/systemrescuecd-x86-grub/files/systemrescuecd.grub-2146
-rw-r--r--sys-boot/systemrescuecd-x86-grub/systemrescuecd-x86-grub-0.2.ebuild31
4 files changed, 213 insertions, 0 deletions
diff --git a/sys-boot/systemrescuecd-x86-grub/Manifest b/sys-boot/systemrescuecd-x86-grub/Manifest
index 1bda1f14830e..18ba13ebaf1f 100644
--- a/sys-boot/systemrescuecd-x86-grub/Manifest
+++ b/sys-boot/systemrescuecd-x86-grub/Manifest
@@ -1,4 +1,7 @@
AUX systemrescuecd.default 845 BLAKE2B 85c0685cc80caa52874ebe61476beea84f06a83d5410db2b05f61dc30adc4a18a26790120a135988d6ff613672eff5e4ece89b20fc7185144317d8be325a5853 SHA512 81aebf9999cfe82696fc72f520fc88355fc8d3077a1c76858175f3367d33119db96c6cb639935b01d32ab1f1d0aaa1c41b7ea3b12e1c732e474de519cb50b2d6
+AUX systemrescuecd.default-2 1179 BLAKE2B 72d44c21da40190a6d199dd115dcc7eae89d991ca0ba0f088c8bd722ac25ad202cd8e47525fd7c47cda905b132d2803df821c5b7dc036eb338b0271ac815e782 SHA512 da7c5347a5c588184d6877f3625d8d3247a6706afd13451fb125294beb82a2249be6e6380f9c5fa6e677d7b2c672a4162275411296db34a263ed985b8f149fa8
AUX systemrescuecd.grub 1910 BLAKE2B 46a3bf8c61e47e1f6eb3223ae44a2ac2e668603cb3ab1ab1fef7ee8626b365b8ac4a5f03f37b871f4b45952c33f7c940c1d20a317b759a1a90950a77eb54e21d SHA512 955a0fb35a034e60f005cbff27fc95e77622a0481d8111b3ee9981dbf0df4a6aa01f0e65307f98acee754dfe050b5e2cf2529b74a6f22f16e4f9164de359a915
+AUX systemrescuecd.grub-2 4562 BLAKE2B ab3122022c8cdb12839b8001e50ab118743f35a37f5a6a6f4e8c863ecc54fb0198938f3acebfed73b944dc0d99a8d978412013615999dd23af99c31d0960e563 SHA512 50869b8ffb58085fac7450a9c730d36c517711a47e9a2d16c6092bd43e5eb791b06663a22b1d0e13edb9aef65fa37f0901477e444d8749a902ebd107ea87dd2a
EBUILD systemrescuecd-x86-grub-0.1-r1.ebuild 751 BLAKE2B e6d0ec0b5efc360a33a1ae9a89d4636d6d180a62deee0473ac45095f21cf9df9071c11b43dcb3e8efd895c0ea358d857438e25da04abb0fede9c774bd13ed43f SHA512 bd7e7b3aba56c64d3d624f6b1f1108452f79836a3fdcee6b782272647025108218b71fc6c980c1482613cb23234107b2674bc73d57272e200ac4b161d7091911
+EBUILD systemrescuecd-x86-grub-0.2.ebuild 754 BLAKE2B bcf0631c14f71fd8394247c760efe600533adc96dd35419682eb5c2a00dc58d2127b739e5e719fd99cc18cb5f3b87444295e67738106f45ca1f72bc908b95622 SHA512 04d222cbd7ff19d5f79bcda4fcbeea67dcff113aa4f8bd349d57039f57fd541dc4508fd0abd52fa3f4dc53b2905a43c889122a428df33ef31702955fa9e79000
MISC metadata.xml 610 BLAKE2B 2551878a7515db26498bab29653547aeef039e47292780ad7725606a618ca71384195e5b1e70e65e17085bae3651ee2602aef1e1479f47495f7efb783ac73816 SHA512 84101ca441d24894df8063a2d82ecf7f516bb6c3255d6b147b1448e27874f2ff634c5822f925a6648010fa83c6e75d60159237a44b99cd5a031e19174a17295d
diff --git a/sys-boot/systemrescuecd-x86-grub/files/systemrescuecd.default-2 b/sys-boot/systemrescuecd-x86-grub/files/systemrescuecd.default-2
new file mode 100644
index 000000000000..941622bfc3ba
--- /dev/null
+++ b/sys-boot/systemrescuecd-x86-grub/files/systemrescuecd.default-2
@@ -0,0 +1,33 @@
+# Here you can set custom bootoptions for the SystemRescueCD
+#
+# For SystemRescueCD version 6.x:
+#
+# You can add in a space separated list:
+# setkmap=xx: set keyboard layout for terminal
+# copytoram: load the ISO fully in memory
+# requires 2GB of memory to cache the system
+#
+# For SystemRescueCD version 5.x:
+#
+# You can add for example in a space separated list:
+# setkmap=xx: which defines the keymap to load (example: setkmap=de)
+# dostartx: load the X.Org graphical environment and launch Xfce
+# docache: causes the iso file to be fully loaded into memory
+# this requires 400MB of memory to cache everything
+# doload=xxx: loads needed kernel modules (example: doload=3c59x,e1000)
+# noload=xxx: prevents loading kernel modules
+# nomodeset: do not load the Kernel-Mode-Setting video driver
+#
+# Example:
+# SRCD_BOOTOPTIONS="setkmap=de docache dostartx"
+#
+# For all available bootoptions see:
+# http://www.sysresccd.org/Sysresccd-manual-en_Booting_the_CD-ROM
+#
+# Note:
+# After changing this, you must update your grub configuration file, to take effect
+
+SRCD_BOOTOPTIONS=""
+
+# Copy ISO to /boot if there is enough space
+#COPY_SRCD_TO_BOOT="yes"
diff --git a/sys-boot/systemrescuecd-x86-grub/files/systemrescuecd.grub-2 b/sys-boot/systemrescuecd-x86-grub/files/systemrescuecd.grub-2
new file mode 100755
index 000000000000..332a7c37fce0
--- /dev/null
+++ b/sys-boot/systemrescuecd-x86-grub/files/systemrescuecd.grub-2
@@ -0,0 +1,146 @@
+#!/bin/sh
+# Copyright 1999-2019 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+. /usr/share/grub/grub-mkconfig_lib
+
+if [ -r /etc/default/systemrescuecd ] ; then
+ . /etc/default/systemrescuecd
+fi
+
+COPY_SRCD_TO_BOOT=${COPY_SRCD_TO_BOOT:-no}
+
+bootdir="/boot"
+installdir="/usr/share/systemrescuecd"
+
+isorex='^(/.*/)?systemrescuecd-.*[.]iso$'
+
+# Path of the link to the newest ISO, created by ebuild
+srcd="${installdir}/systemrescuecd-x86-newest.iso"
+
+# Extract ISO version
+isovsed() {
+ sed -E 's|^.*systemrescuecd(-x86)?-||;s|.iso$||'
+}
+
+# Find ISOs in a given directory
+isofind() {
+ find "${1}" -maxdepth 1 -type f -regextype egrep -regex ${isorex}
+}
+
+# Copy ISO to boot partition
+copy_srcd_iso() {
+ if [ ! -f "${bootdir}/"$(basename "${1}") ]; then
+ if [ $(df -k --output=avail "${bootdir}" | tail -1) -gt $(du -k "${1}" | cut -f 1) ]; then
+ cp "${1}" "${bootdir}/"
+ else
+ # Before complaining, check if the installed ISO is actually newer
+ if $(printf '%s\n' $(isofind "${bootdir}" | isovsed | sort -V) $(echo "${1}" | isovsed) | sort -VC); then
+ gettext_printf "Error: Not enough free disk space on ${bootdir}!\n" >&2
+ gettext_printf "Error: Failed to copy the new iso!\n" >&2
+ fi
+ fi
+ fi
+}
+
+write_srcd() {
+ cat <<EOF
+ menuentry "${longname} [${1}] (Copy to RAM${bootops}" --class rescue {
+${grub_string}
+ set gfxpayload=keep
+ set isofile=${path}
+ loopback loop \${isofile}
+ linux (loop)/sysresccd/boot/x86_64/vmlinuz archisobasedir=sysresccd img_loop=\${isofile} img_dev=${diskuuid} copytoram ${SRCD_BOOTOPTIONS}
+ initrd (loop)/sysresccd/boot/intel_ucode.img (loop)/sysresccd/boot/amd_ucode.img (loop)/sysresccd/boot/x86_64/sysresccd.img
+ }
+ menuentry "${longname} [${1}] (Copy to RAM with persistence${bootops}" --class rescue {
+${grub_string}
+ set gfxpayload=keep
+ set isofile=${path}
+ loopback loop \${isofile}
+ linux (loop)/sysresccd/boot/x86_64/vmlinuz archisobasedir=sysresccd img_loop=\${isofile} img_dev=${diskuuid} cow_device=${diskuuid} cow_directory=/persistent_sysresccd-${1}/x86_64 copytoram ${SRCD_BOOTOPTIONS}
+ initrd (loop)/sysresccd/boot/intel_ucode.img (loop)/sysresccd/boot/amd_ucode.img (loop)/sysresccd/boot/x86_64/sysresccd.img
+ }
+ menuentry "${longname} [${1}] (Minimal${bootops}" --class rescue {
+${grub_string}
+ set gfxpayload=keep
+ set isofile=${path}
+ loopback loop \${isofile}
+ linux (loop)/sysresccd/boot/x86_64/vmlinuz archisobasedir=sysresccd img_loop=\${isofile} img_dev=${diskuuid} ${SRCD_BOOTOPTIONS}
+ initrd (loop)/sysresccd/boot/intel_ucode.img (loop)/sysresccd/boot/amd_ucode.img (loop)/sysresccd/boot/x86_64/sysresccd.img
+ }
+EOF
+}
+
+write_srcd_5() {
+ cat <<EOF
+ menuentry "${longname} [${1}] (64bit${bootops}" --class rescue {
+${grub_string}
+ set isofile=${path}
+ loopback loop \${isofile}
+ linux (loop)/isolinux/rescue64 ${SRCD_BOOTOPTIONS} isoloop=\${isofile}
+ initrd (loop)/isolinux/initram.igz
+ }
+ menuentry "${longname} [${1}] (32bit${bootops}" --class rescue {
+${grub_string}
+ set isofile=${path}
+ loopback loop \${isofile}
+ linux (loop)/isolinux/rescue32 ${SRCD_BOOTOPTIONS} isoloop=\${isofile}
+ initrd (loop)/isolinux/initram.igz
+ }
+EOF
+}
+
+# Get v5 ISOs
+# Use: isogrep5 [-v]
+# -v invert match
+isogrep5() {
+ ls -rv "${isopref}"/systemrescuecd-*.iso | grep ${1} -e '-x86-5'
+}
+
+write_srcd_submenu() {
+ # Start submenu
+ echo "submenu \"${longname}\" --class submenu {"
+
+ # Make sure to reverse-sort by version
+ for iso in $(isogrep5 -v; isogrep5); do
+ path=$(make_system_path_relative_to_its_root "${iso}")
+ gettext_printf " image: ${iso}\n" >&2
+ if $(printf '%s\n' "6.0.0" $(echo ${iso} | isovsed) | sort -VC); then
+ write_srcd $(echo ${iso} | isovsed)
+ else
+ write_srcd_5 $(echo ${iso} | isovsed)
+ fi
+ done
+
+ # End submenu
+ echo "}"
+}
+
+bootops=")"
+
+if [ ! -z "${SRCD_BOOTOPTIONS}" ]; then
+ bootops=" with bootoptions)"
+fi
+
+if [ "${COPY_SRCD_TO_BOOT}" = yes ]; then
+ srcd=$(realpath "${srcd}")
+ copy_srcd_iso "${srcd}"
+fi
+
+# Build menu entries
+for isopref in "${bootdir}" "${installdir}"; do
+ # Make sure there are any ISOs
+ ls "${isopref}" | grep -E -q -e "${isorex}" || continue
+
+ diskuuid=/dev/disk/by-uuid/$(${grub_probe} --target=fs_uuid "${isopref}")
+ device=$(${grub_probe} --target=device "${isopref}")
+ label=$(${grub_probe} --target=fs_label "${isopref}")
+ [ "${label}" = "(null)" ] && label=${device}
+ grub_string=$(prepare_grub_to_access_device "${device}" | grub_add_tab | grub_add_tab)
+ longname="SystemRescueCD on ${label}"
+
+ gettext_printf "Found %s on %s\n" "${longname}" "${device}" >&2
+
+ write_srcd_submenu
+done
diff --git a/sys-boot/systemrescuecd-x86-grub/systemrescuecd-x86-grub-0.2.ebuild b/sys-boot/systemrescuecd-x86-grub/systemrescuecd-x86-grub-0.2.ebuild
new file mode 100644
index 000000000000..76daeb7ece15
--- /dev/null
+++ b/sys-boot/systemrescuecd-x86-grub/systemrescuecd-x86-grub-0.2.ebuild
@@ -0,0 +1,31 @@
+# Copyright 1999-2019 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+DESCRIPTION="Grub menu entries for the .iso image of systemrescuecd-x86"
+HOMEPAGE="http://www.sysresccd.org/"
+SRC_URI=""
+
+LICENSE="GPL-2"
+SLOT=0
+KEYWORDS="~amd64 ~x86"
+
+S="${WORKDIR}"
+
+RDEPEND="app-admin/systemrescuecd-x86
+ sys-boot/grub"
+
+src_install() {
+ exeinto /etc/grub.d
+ newexe "${FILESDIR}"/systemrescuecd.grub-2 39_systemrescuecd
+
+ insinto /etc/default
+ newins "${FILESDIR}"/systemrescuecd.default-2 systemrescuecd
+}
+
+pkg_postinst() {
+ elog "To add the menu entries for systemrescuecd to grub, you should now run"
+ elog " grub-mkconfig -o /boot/grub/grub.cfg"
+ elog "You can set custom bootoptions in /etc/default/systemrescuecd"
+}