Gentoo Archives: gentoo-ppc-dev

From: "Christian Müller" <cmue81@×××.de>
To: gentoo-ppc-user@l.g.o, gentoo-ppc-dev@l.g.o, debian-powerpc@××××××××××××.org
Subject: [gentoo-ppc-dev] Re: May it be of some use for the oldworld plagued, specifically Beige G3 (REVISED)
Date: Tue, 09 Jan 2007 23:10:07
Message-Id: 20070109223848.57760@gmx.net
1 Hello,
2
3
4 here is a revised version of my previous post. Due to gnu make's inability to handle spaces in paths there is a showstopper in my previous Makefile. Since BootX expects the kernels in "Linux Kernels" this is kind of severe. Please use this revised version. Best is to put it in an empty dir and type make or "make cd" if you want the image burned right afterwards. You have to modify the variables BOOTABLE_MAC_CD and CDBURNER to reflect your setup.
5
6
7
8 cat > Makefile <<EOF
9 # This is a convenience Makefile to add SystemDisk, BootX and
10 # a couple of current linux kernels to a bootable Mac OS CD.
11 # It tries to do the right thing (tm) ;-)
12 #
13 #
14 # $name: Makefile$
15 # $author: Christian Mueller <cmue81 at gmx dot de>$
16 # $copyright: Copyright (C) 2007 by Christian Mueller$
17 # $license: http://www.gnu.org/licenses/gpl.html$
18 # $license-version: GNU GPL version 2$
19 # $date: 2007-01-09$
20 #
21 #
22 # Dependencies: hfsutils, cdr-tools
23 #
24 # Usage: The only thing you should need to adjust is the
25 # BOOTABLE_MAC_CD variable or *URL if the URLs listed
26 # deliver a "404 not found". If you have a rewritable
27 # cd handy, adjust CDBURNER and try make cdrw.
28 #
29 # Motivation: Even in the lucky case you get bootloaders for
30 # a Beige G3 working (miboot, quik, etc.) you
31 # would still need a booting Mac OS System to
32 # apply the System Disk patches in case they
33 # get screwed up. So if you're the owner of a
34 # proprietary Mac OS CD let this Makefile convert
35 # it to a useful utility CD in case you get stuck
36 # with stand-alone-linux on your Mac-Box.
37 #
38 # WARNING: The image given with BOOTABLE_MAC_CD will get
39 # modified! It might not work, so do backups !!
40 #
41 # NOTE: You cannot compress your kernels if you want to use
42 # them with BootX ;-(
43 #
44 # Tested on a Beige G3 with OpenFirmware 2.4, might work on
45 # other models. Hopefully we will not need this anymore
46 # some day, when support for Apple's oldworld machines has
47 # grown up ;-) Ciao ..
48 #
49 BOOTABLE_MAC_CD = /media/hdb1/macos8.iso
50 CDBURNER = ATA:1,0,0
51
52
53 SELF = Makefile
54
55 SYSDISK = SystemDisk2.3.1.smi.bin
56
57 STUFFIT = stuffit520.611linux-i386.tar.gz
58 UNSTUFF = bin/unstuff
59
60 BOOTX = BootX_1.2.2.sit
61 BOOTX_DIR = BootX_1.2.2
62 BOOTX_DIR_KRNL = $(BOOTX_DIR)/Linux_Kernels
63
64 GEN_IMG = install-ppc-minimal-2006.1.iso
65
66
67 SYSDISKURL = ftp://ftp.apple.com/developer/macosxserver/utilities/$(SYSDISK)
68 STUFFITURL = http://www.allume.com/downloads/files/$(STUFFIT)
69 BOOTXURL = http://penguinppc.org/historical/benh/$(BOOTX)
70 DEBURL = http://people.debian.org/~wouter/d-i/powerpc/daily/powerpc
71 GENMIRROR = ftp://ftp.wh2.tu-dresden.de/pub/mirrors/gentoo
72 GENURL = $(GENMIRROR)/releases/ppc/current/ppc32/installcd/$(GEN_IMG)
73
74
75
76
77 modimage: hfsmount \
78 $(SELF).treecopy \
79 $(SYSDISK).treecopy \
80 debianstuff \
81 gentoostuff \
82 $(BOOTX_DIR).treecopy \
83 hfsumount
84
85 cd: modimage
86 cdrecord -dao dev=$(CDBURNER) $(BOOTABLE_MAC_CD)
87
88 cdclean:
89 cdrecord dev=$(CDBURNER) blank=fast
90
91 cdrw: cdclean cd
92
93 clean:
94 umount -d genloop || exit 0
95 rm -rf bin/ genloop/ "$(BOOTX_DIR)" \
96 *.dirs *.files *irdbuild *irdmerge .*irdmerge
97
98 distclean: clean
99 rm $(SYSDISK) $(STUFFIT) $(BOOTX) $(GEN_IMG)
100
101
102
103
104 hfsumount:
105 humount
106
107 hfsmount:
108 hmount $(BOOTABLE_MAC_CD)
109
110 TCSPEC1 = s|hcopy -m\(.*$(BOOTX_DIR_KRNL)\)|hcopy -r\1|
111 TCSPEC2 = s|hcopy -m\(.*$(SELF)\)|hcopy -t\1|
112 TREECOPYSPECIALS = $(TCSPEC1);$(TCSPEC2);
113 CPLSED = h;s|/|:|g;s|_| |g;s|^ '\(.*:\)\?.*| ':\1'|;H;g;s/\n//;s/^/hcopy -m/;
114 %.treecopy: hfsmount %
115 echo "#!/bin/sh" > "$*.dirs" && chmod +x "$*.dirs"
116 echo "#!/bin/sh" > "$*.files" && chmod +x "$*.files"
117 find "$*" -type d -printf "hmkdir '/%p'\n" | \
118 sed -e "s|/|:|g;s|_| |g;$(TREECOPYSPECIALS)" >> "$*.dirs"
119 find "$*" -not -type d -printf " '%p'\n" | \
120 sed -ne "$(CPLSED)$(TREECOPYSPECIALS);p" >> "$*.files"
121 "./$*.dirs" 2>/dev/null || exit 0
122 "./$*.files" || exit 0
123
124 %.irdmerge:
125 mkdir -p "$(suffix $*).irdmerge" && \
126 cd "$(suffix $*).irdmerge" && \
127 gunzip -c "../$(BOOTX_DIR_KRNL)/$(subst .,,$(suffix $*))$(patsubst \
128 %$(suffix $*),%,$*)ird.gz" > "initrd.tmp" && \
129 cpio -i < "initrd.tmp" 2> /dev/null && \
130 rm "initrd.tmp" && \
131 cd .. && \
132 touch "$@"
133
134 %.irdbuild:
135 test -e "$(patsubst %$(suffix $*),%,$*).gz" || { \
136 cd $(suffix $*).irdmerge && \
137 find > ../files$(suffix $*).irdmerge && \
138 cpio -o < ../files$(suffix $*).irdmerge > "../$(patsubst \
139 %$(suffix $*),%,$*)" && \
140 cd .. ; }
141
142 %.gz: %
143 test -e "$@" || gzip -9 "$*"
144
145
146
147
148 $(STUFFIT):
149 wget $(STUFFITURL)
150
151 $(UNSTUFF): $(STUFFIT)
152 tar xzf $(STUFFIT) $(UNSTUFF)
153 touch $(UNSTUFF)
154
155 $(BOOTX):
156 wget $(BOOTXURL)
157
158 $(BOOTX_DIR): $(UNSTUFF) $(BOOTX)
159 $(UNSTUFF) -m=on $(BOOTX)
160 mv "$(subst _, ,$@)" "$@"
161
162 $(BOOTX_DIR_KRNL): $(BOOTX_DIR)
163 mv "$(subst Linux_,Linux ,$@)" "$@"
164
165
166
167
168 $(GEN_IMG):
169 wget $(GENURL)
170
171 $(GEN_IMG).mount: $(GEN_IMG)
172 mkdir -p genloop && \
173 mount -o loop $(GEN_IMG) genloop
174
175 $(BOOTX_DIR_KRNL)/genliveird.gz: genloop/boot/apple.igz
176 cp "genloop/boot/apple.igz" "$@"
177
178 .gen.irdmerge/image.squashfs: genloop/image.squashfs
179 cp "genloop/image.squashfs" "$@"
180
181 $(BOOTX_DIR_KRNL)/genallinitrd: $(BOOTX_DIR_KRNL)/genliveird.gz \
182 live.gen.irdmerge \
183 .gen.irdmerge/image.squashfs \
184 $(BOOTX_DIR_KRNL)/genallinitrd.gen.irdbuild
185
186 $(BOOTX_DIR_KRNL)/genvmlinux: genloop/boot/apple
187 test -e "$@.gz" || cp "genloop/boot/apple" "$@"
188
189 gentoostuff: $(GEN_IMG).mount \
190 $(BOOTX_DIR_KRNL) \
191 $(BOOTX_DIR_KRNL)/genliveird.gz \
192 $(BOOTX_DIR_KRNL)/genallinitrd.gz \
193 $(BOOTX_DIR_KRNL)/genvmlinux
194 umount -d genloop
195
196
197
198
199 $(BOOTX_DIR_KRNL)/deb%ird.gz:
200 wget -O "$@" $(DEBURL)/$*/initrd.gz
201
202 $(BOOTX_DIR_KRNL)/deballinitrd: $(BOOTX_DIR_KRNL)/debnetbootird.gz \
203 $(BOOTX_DIR_KRNL)/debcdromird.gz \
204 $(BOOTX_DIR_KRNL)/debhd-mediaird.gz \
205 netboot.deb.irdmerge \
206 cdrom.deb.irdmerge \
207 hd-media.deb.irdmerge \
208 $(BOOTX_DIR_KRNL)/deballinitrd.deb.irdbuild
209
210 $(BOOTX_DIR_KRNL)/debvmlinux:
211 test -e "$@.gz" || wget -O "$@" $(DEBURL)/cdrom/vmlinux
212
213 debianstuff: $(BOOTX_DIR_KRNL) \
214 $(BOOTX_DIR_KRNL)/debnetbootird.gz \
215 $(BOOTX_DIR_KRNL)/debcdromird.gz \
216 $(BOOTX_DIR_KRNL)/debhd-mediaird.gz \
217 $(BOOTX_DIR_KRNL)/deballinitrd.gz \
218 $(BOOTX_DIR_KRNL)/debvmlinux
219
220
221
222
223 $(SYSDISK):
224 wget $(SYSDISKURL)
225
226
227 EOF
228
229
230 Live well,
231 cmuelle8
232
233 --
234 Der GMX SmartSurfer hilft bis zu 70% Ihrer Onlinekosten zu sparen!
235 Ideal für Modem und ISDN: http://www.gmx.net/de/go/smartsurfer

Attachments

File name MIME type
Makefile application/octet-stream