Проект

Общее

Профиль

Pxe-livecd » История » Версия 5

Андрей Волков, 2019-02-14 16:37

1 1 Андрей Волков
h1. Pxe-livecd
2
3 2 Андрей Волков
4
h2. Настройки загрузчика:
5
6
h3. Файлы
7
8
*tftp/gentoo*
9
*tftp/initramfs.igz*
10
*tftp/pxelinux.0*
11
12
*tftp/pxelinux.cfg/default*
13
14
<pre>
15
default gentoo
16
17
label gentoo
18
 kernel gentoo
19
 append initrd=initramfs.igz root=/dev/ram0 init=/linuxrc loop=/image.squashfs looptype=squashfs cdroot=1 real_root=/
20
</pre>
21
22
h2. Исправление для image.squashfs
23
24
На примере install-amd64-minimal-20120621.iso
25
26 1 Андрей Волков
<pre>
27
<code class="diff">
28
diff -u init.orig init
29
--- init.orig	2012-08-01 12:37:57.000000000 +0600
30
+++ init	2012-08-01 12:39:08.000000000 +0600
31
@@ -372,10 +372,10 @@
32
 		[ ! -e "${NEW_ROOT}/dev/tty1" ] && mknod "${NEW_ROOT}/dev/tty1" c 4 1
33
 	fi
34
 
35
-	if [ "${REAL_ROOT}" != "/dev/nfs" ] && [ "${LOOPTYPE}" != "sgimips" ]
36
-	then
37
-		bootstrapCD
38
-	fi
39
+#	if [ "${REAL_ROOT}" != "/dev/nfs" ] && [ "${LOOPTYPE}" != "sgimips" ]
40
+#	then
41
+#		bootstrapCD
42
+#	fi
43
 
44
 	if [ "${REAL_ROOT}" = '' ]
45
 	then
46
@@ -460,7 +460,7 @@
47
 		else
48
 			bad_msg "Block device ${REAL_ROOT} is not a valid root device..."
49
 			REAL_ROOT=""
50
-			got_good_root=0
51
+			got_good_root=1
52
 		fi
53
 	done
54
 
55
@@ -524,7 +524,7 @@
56
 	[ -z "${LOOP}" ] && find_loop
57
 	[ -z "${LOOPTYPE}" ] && find_looptype
58
 
59
-	cache_cd_contents
60
+	#cache_cd_contents
61
 
62
 	# If encrypted, find key and mount, otherwise mount as usual
63
 	if [ -n "${CRYPT_ROOT}" ]
64
</code>
65
</pre>
66 3 Андрей Волков
67
h3. Исходные файлы:
68
69
<pre>
70
image.squashfs
71
isolinux/gentoo
72
isolinux/gentoo.igz
73
isolinux/isolinux.cfg
74
</pre>
75
76
h3. Приготовление
77
78
<pre>
79
mkdir unpack
80
cd unpack
81
xzcat ../gentoo.igz | cpio -mdi
82
vi init
83 4 Андрей Волков
mkdir mnt/cdrom
84
mv -v ../image.squashfs mnt/cdrom/
85 5 Андрей Волков
find | cpio -o -H newc | xz -v --check=crc32 --x86 --lzma2 > ../initramfs.ixz
86 3 Андрей Волков
</pre>