1 |
commit: 39ac902251b2984330f84e81af76aaf6d93171fc |
2 |
Author: Andrea Postiglione <andrea.postiglione <AT> gmail <DOT> com> |
3 |
AuthorDate: Sat Aug 15 11:13:58 2020 +0000 |
4 |
Commit: Andrew Ammerlaan <andrewammerlaan <AT> riseup <DOT> net> |
5 |
CommitDate: Sat Aug 15 11:13:58 2020 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/proj/guru.git/commit/?id=39ac9022 |
7 |
|
8 |
sys-boot/customrescuecd-x86-grub : initial ebuild |
9 |
|
10 |
Signed-off-by: Andrea Postiglione <andrea.postiglione <AT> gmail.com> |
11 |
|
12 |
.../customrescuecd-x86-grub-0.1.ebuild | 31 ++++++++++++++++ |
13 |
.../files/customrescuecd.default | 7 ++++ |
14 |
.../files/customrescuecd.grub | 43 ++++++++++++++++++++++ |
15 |
sys-boot/customrescuecd-x86-grub/metadata.xml | 17 +++++++++ |
16 |
4 files changed, 98 insertions(+) |
17 |
|
18 |
diff --git a/sys-boot/customrescuecd-x86-grub/customrescuecd-x86-grub-0.1.ebuild b/sys-boot/customrescuecd-x86-grub/customrescuecd-x86-grub-0.1.ebuild |
19 |
new file mode 100644 |
20 |
index 0000000..7c07616 |
21 |
--- /dev/null |
22 |
+++ b/sys-boot/customrescuecd-x86-grub/customrescuecd-x86-grub-0.1.ebuild |
23 |
@@ -0,0 +1,31 @@ |
24 |
+# Copyright 1999-2018 Gentoo Foundation |
25 |
+# Distributed under the terms of the GNU General Public License v2 |
26 |
+ |
27 |
+EAPI=7 |
28 |
+ |
29 |
+DESCRIPTION="Grub menu entries for the .iso image of customrescuecd" |
30 |
+HOMEPAGE="https://sourceforge.net/projects/customrescuecd/" |
31 |
+SRC_URI="" |
32 |
+ |
33 |
+LICENSE="GPL-2" |
34 |
+SLOT=0 |
35 |
+KEYWORDS="~x86" |
36 |
+ |
37 |
+S=${WORKDIR} |
38 |
+ |
39 |
+RDEPEND="app-admin/customrescuecd-x86 |
40 |
+ sys-boot/grub" |
41 |
+ |
42 |
+src_install() { |
43 |
+ exeinto /etc/grub.d |
44 |
+ newexe "${FILESDIR}"/customrescuecd.grub 39_customrescuecd |
45 |
+ |
46 |
+ insinto /etc/default |
47 |
+ newins "${FILESDIR}"/customrescuecd.default customrescuecd |
48 |
+} |
49 |
+ |
50 |
+pkg_postinst() { |
51 |
+ elog "To add the menu entries for customrescuecd to grub, you should now run" |
52 |
+ elog " grub-mkconfig -o /boot/grub/grub.cfg" |
53 |
+ elog "You can set custom bootoptions in /etc/default/customrescuecd" |
54 |
+} |
55 |
|
56 |
diff --git a/sys-boot/customrescuecd-x86-grub/files/customrescuecd.default b/sys-boot/customrescuecd-x86-grub/files/customrescuecd.default |
57 |
new file mode 100644 |
58 |
index 0000000..ce093e3 |
59 |
--- /dev/null |
60 |
+++ b/sys-boot/customrescuecd-x86-grub/files/customrescuecd.default |
61 |
@@ -0,0 +1,7 @@ |
62 |
+Here you can set custom bootoptions for the CustomRescueCD |
63 |
+# |
64 |
+# You can add for example in a space separated list: |
65 |
+# copytoram: causes the iso file to be fully loaded into memory |
66 |
+# this requires 1.5G of memory to cache everything |
67 |
+# |
68 |
+CRCD_BOOTOPTIONS="" |
69 |
|
70 |
diff --git a/sys-boot/customrescuecd-x86-grub/files/customrescuecd.grub b/sys-boot/customrescuecd-x86-grub/files/customrescuecd.grub |
71 |
new file mode 100644 |
72 |
index 0000000..7c5965d |
73 |
--- /dev/null |
74 |
+++ b/sys-boot/customrescuecd-x86-grub/files/customrescuecd.grub |
75 |
@@ -0,0 +1,43 @@ |
76 |
+#!/bin/sh |
77 |
+# Copyright 1999-2018 Gentoo Foundation |
78 |
+# Distributed under the terms of the GNU General Public License v2 |
79 |
+ |
80 |
+. /usr/share/grub/grub-mkconfig_lib |
81 |
+ |
82 |
+if [ -r /etc/default/customrescuecd ] ; then |
83 |
+ . /etc/default/customrescuecd |
84 |
+fi |
85 |
+ |
86 |
+# srcd = path of newest link to iso of customrescuecd, created by the ebuild |
87 |
+# of customrescuecd-x86 |
88 |
+ |
89 |
+crcd="/usr/share/systemrescuecd/systemrescuecd-x86-newest.iso" |
90 |
+ |
91 |
+longname="CustomRescueCD" |
92 |
+bootops=")" |
93 |
+ |
94 |
+if [ ! -z "${CRCD_BOOTOPTIONS}" ]; then |
95 |
+ bootops=" with bootoptions)" |
96 |
+fi |
97 |
+ |
98 |
+if [ -f "${crcd}" ]; then |
99 |
+ |
100 |
+ device=$(${grub_probe} --target=device "${crcd}") |
101 |
+ path=$(make_system_path_relative_to_its_root "${crcd}") |
102 |
+ grub_string=$(prepare_grub_to_access_device "${device}" | grub_add_tab | grub_add_tab) |
103 |
+ |
104 |
+ gettext_printf "Found %s on %s\n" "${longname}" "${device}" >&2 |
105 |
+ onstr=$(gettext_printf "(on %s)" "${device}") |
106 |
+ |
107 |
+ cat << EOF |
108 |
+submenu "${longname}" --class submenu { |
109 |
+ menuentry "${longname} (32bit standard${bootops}" --class rescue { |
110 |
+${grub_string} |
111 |
+ set isofile=${path} |
112 |
+ loopback loop \${isofile} |
113 |
+ linux (loop)/boot/x86/customrescue32 ${CRCD_BOOTOPTIONS} customisobasedir=customresccd customisolabel=CRC32 vga=791 net.ifnames=0 |
114 |
+ } |
115 |
+} |
116 |
+EOF |
117 |
+ |
118 |
+fi |
119 |
|
120 |
diff --git a/sys-boot/customrescuecd-x86-grub/metadata.xml b/sys-boot/customrescuecd-x86-grub/metadata.xml |
121 |
new file mode 100644 |
122 |
index 0000000..2e146c3 |
123 |
--- /dev/null |
124 |
+++ b/sys-boot/customrescuecd-x86-grub/metadata.xml |
125 |
@@ -0,0 +1,17 @@ |
126 |
+<?xml version="1.0" encoding="UTF-8"?> |
127 |
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd"> |
128 |
+<pkgmetadata> |
129 |
+ <maintainer type="person"> |
130 |
+ <email>gentoobugs@×××××.biz</email> |
131 |
+ <name>Michael Lange</name> |
132 |
+ <description>Accepts only mails from Gentoo's Bugzilla</description> |
133 |
+ </maintainer> |
134 |
+ <maintainer type="person"> |
135 |
+ <email>mgorny@g.o</email> |
136 |
+ <name>Michał Górny</name> |
137 |
+ </maintainer> |
138 |
+ <longdescription> |
139 |
+ This package adds menu entries in GRUB for the SystemRescueCD. You can |
140 |
+ add custom bootoptions for SystemRescueCD in a special config file. |
141 |
+ </longdescription> |
142 |
+</pkgmetadata> |