CRUX PPC
A lightweight GNU/Linux distribution for PowerPC!
Subversion Repository
Parent Directory
|
Revision Log
Revision 53 -
(show annotations)
Mon Oct 4 05:25:20 2010 UTC (2 years, 7 months ago) by acrux
File size: 15581 byte(s)
Mon Oct 4 05:25:20 2010 UTC (2 years, 7 months ago) by acrux
File size: 15581 byte(s)
synced with 2.7RC0
| 1 | # |
| 2 | # Makefile for CRUX PPC, based on Makefile for CRUX |
| 3 | # Copyright (c) 2003-2004 Per Liden <per@fukt.bth.se> |
| 4 | # Copyright (c) 2004 Giulivo Navigante <giulivo@linuxmail.org> |
| 5 | # Copyright (c) 2005-2010 The CRUX PPC Team - http://cruxppc.org/ |
| 6 | # |
| 7 | # CRUX PPC |
| 8 | # 32bit Release |
| 9 | # release codename is: ottobre 2010 |
| 10 | # |
| 11 | |
| 12 | CRUXPPCVERSION = 2.7 |
| 13 | COLLECTIONS = core opt xorg |
| 14 | KERNEL_MIRROR = ftp://ftp.eu.kernel.org |
| 15 | KERNEL_VERSION = 2.6.35.7 |
| 16 | KERNEL_PATCHES = cruxppc-logo.diff linux-$(KERNEL_VERSION).patch |
| 17 | PKG_EXT = pkg.tar.xz |
| 18 | PKGMK_CONF = $(PWD)/pkgmk.conf |
| 19 | PORTS_DIR = $(PWD)/ports |
| 20 | FAKE_ROOT_DIR = $(PWD)/tmp/fake_root |
| 21 | ISO_ROOT_DIR = $(PWD)/tmp/iso_root |
| 22 | SRCISO_ROOT_DIR = $(PWD)/tmp/srciso_root |
| 23 | ISO_FILENAME = $(PWD)/crux-ppc-$(CRUXPPCVERSION).iso |
| 24 | SRCISO_FILENAME = $(PWD)/crux-ppc-$(CRUXPPCVERSION)-source.iso |
| 25 | ISO_PACKAGES = filesystem bash coreutils bzip2 e2fsprogs jfsutils \ |
| 26 | xfsprogs reiserfsprogs patch findutils glibc grep gzip kbd \ |
| 27 | module-init-tools less gawk ncurses net-tools pkgutils \ |
| 28 | procps readline sed shadow sysklogd sysvinit tar \ |
| 29 | util-linux-ng vim which dialog nano mdadm pciutils libusb libusb-compat \ |
| 30 | mac-fdisk parted hfsutils nvsetenv yaboot glib mc \ |
| 31 | memtester mkimage parthenope \ |
| 32 | sysfsutils usbutils udev zlib openssl openssh \ |
| 33 | dhcpcd wget iproute2 libpcre iputils libgmp libdevmapper lvm2 \ |
| 34 | attr acl libcap tcp_wrappers btrfs-progs |
| 35 | |
| 36 | PORTS_core = $(shell /bin/ls -I README -I libstdc++-compat64 $(PORTS_DIR)/core) |
| 37 | PORTS_opt = $(shell /bin/cat packages.opt32) |
| 38 | PORTS_xorg = $(shell /bin/cat packages.xorg) |
| 39 | |
| 40 | ifeq ($(FORCE),yes) |
| 41 | PKGMK_FORCE=-f |
| 42 | else |
| 43 | PKGMK_FORCE= |
| 44 | endif |
| 45 | |
| 46 | .PHONY: help check-root check-log $(COLLECTIONS) all all-chroot bootstrap kernel kernel-clean clean iso |
| 47 | |
| 48 | help: |
| 49 | @echo "CRUX PPC Makefile" |
| 50 | @echo "Targets:" |
| 51 | @echo " <collection> build single collection" |
| 52 | @echo " all build all collections" |
| 53 | @echo " bootstrap bootstrap all collections" |
| 54 | @echo " kernel download and build kernel" |
| 55 | @echo " iso create iso image" |
| 56 | @echo " source-iso create source-iso image" |
| 57 | @echo "Collections:" |
| 58 | @echo " $(COLLECTIONS)" |
| 59 | |
| 60 | |
| 61 | check-root: |
| 62 | @if [ "$$UID" != "0" ]; then \ |
| 63 | echo "You need to be root to do this."; \ |
| 64 | exit 1; \ |
| 65 | fi |
| 66 | |
| 67 | check-log: |
| 68 | @grep "> ERROR:"; \ |
| 69 | if [ "$$?" = "0" ]; then \ |
| 70 | echo "(see log file for details)"; \ |
| 71 | exit 1; \ |
| 72 | else \ |
| 73 | exit 0; \ |
| 74 | fi |
| 75 | |
| 76 | kernel/linux-$(KERNEL_VERSION).tar.bz2: |
| 77 | cd kernel && wget --passive-ftp $(KERNEL_MIRROR)/pub/linux/kernel/v2.6/linux-$(KERNEL_VERSION).tar.bz2 |
| 78 | |
| 79 | kernel/linux-$(KERNEL_VERSION): kernel/linux-$(KERNEL_VERSION).tar.bz2 |
| 80 | tar -C kernel -xjmf kernel/linux-$(KERNEL_VERSION).tar.bz2 |
| 81 | for FILE in $(KERNEL_PATCHES); do \ |
| 82 | cd kernel/linux-$(KERNEL_VERSION) && patch -p1 < ../$$FILE && cd ../..; \ |
| 83 | done |
| 84 | cp -a kernel/linux-$(KERNEL_VERSION) kernel/linux-$(KERNEL_VERSION)-Sam440ep |
| 85 | patch -p1 -d kernel/linux-$(KERNEL_VERSION)-Sam440ep < kernel/linux-$(KERNEL_VERSION)-Sam440ep.patch |
| 86 | cp -a kernel/linux-$(KERNEL_VERSION) kernel/linux-$(KERNEL_VERSION)-Efika |
| 87 | ## patch -p1 -d kernel/linux-$(KERNEL_VERSION)-Efika < kernel/linux-$(KERNEL_VERSION)-Efika.patch |
| 88 | cp -a kernel/linux-$(KERNEL_VERSION) kernel/linux-$(KERNEL_VERSION)-Pegasos2 |
| 89 | ## patch -p1 -d kernel/linux-$(KERNEL_VERSION)-Pegasos2 < kernel/linux-$(KERNEL_VERSION)-Pegasos2.patch |
| 90 | cp -a kernel/linux-$(KERNEL_VERSION) kernel/linux-$(KERNEL_VERSION)-Chrp32 |
| 91 | |
| 92 | kernel/linux-$(KERNEL_VERSION)/vmlinux: kernel/linux-$(KERNEL_VERSION) |
| 93 | make -C kernel/linux-$(KERNEL_VERSION) mrproper |
| 94 | cp -f kernel/linux-$(KERNEL_VERSION).config kernel/linux-$(KERNEL_VERSION)/.config |
| 95 | make -C kernel/linux-$(KERNEL_VERSION) oldconfig |
| 96 | make -j8 -C kernel/linux-$(KERNEL_VERSION) all |
| 97 | touch kernel/linux-$(KERNEL_VERSION)/arch/powerpc/boot/zImage.pmac |
| 98 | |
| 99 | make -C kernel/linux-$(KERNEL_VERSION)-Sam440ep mrproper |
| 100 | cp -f kernel/linux-$(KERNEL_VERSION)-Sam440ep.config kernel/linux-$(KERNEL_VERSION)-Sam440ep/.config |
| 101 | make -C kernel/linux-$(KERNEL_VERSION)-Sam440ep oldconfig |
| 102 | make -j8 -C kernel/linux-$(KERNEL_VERSION)-Sam440ep all |
| 103 | touch kernel/linux-$(KERNEL_VERSION)-Sam440ep/arch/powerpc/boot/cuImage.sam440ep |
| 104 | |
| 105 | make -C kernel/linux-$(KERNEL_VERSION)-Efika mrproper |
| 106 | cp -f kernel/linux-$(KERNEL_VERSION)-Efika.config kernel/linux-$(KERNEL_VERSION)-Efika/.config |
| 107 | make -C kernel/linux-$(KERNEL_VERSION)-Efika oldconfig |
| 108 | make -j8 -C kernel/linux-$(KERNEL_VERSION)-Efika all |
| 109 | touch kernel/linux-$(KERNEL_VERSION)-Efika/arch/powerpc/boot/zImage.chrp |
| 110 | make -C kernel/linux-$(KERNEL_VERSION)-Pegasos2 mrproper |
| 111 | cp -f kernel/linux-$(KERNEL_VERSION)-Pegasos2.config kernel/linux-$(KERNEL_VERSION)-Pegasos2/.config |
| 112 | make -C kernel/linux-$(KERNEL_VERSION)-Pegasos2 oldconfig |
| 113 | make -j8 -C kernel/linux-$(KERNEL_VERSION)-Pegasos2 all |
| 114 | touch kernel/linux-$(KERNEL_VERSION)-Pegasos2/arch/powerpc/boot/zImage.chrp |
| 115 | |
| 116 | make -C kernel/linux-$(KERNEL_VERSION)-Chrp32 mrproper |
| 117 | cp -f kernel/linux-$(KERNEL_VERSION)-Chrp32.config kernel/linux-$(KERNEL_VERSION)-Chrp32/.config |
| 118 | make -C kernel/linux-$(KERNEL_VERSION)-Chrp32 oldconfig |
| 119 | make -j8 -C kernel/linux-$(KERNEL_VERSION)-Chrp32 all |
| 120 | touch kernel/linux-$(KERNEL_VERSION)-Chrp32/vmlinux |
| 121 | |
| 122 | kernel: kernel/linux-$(KERNEL_VERSION)/vmlinux |
| 123 | |
| 124 | kernel-clean: |
| 125 | if [ -e kernel/linux-$(KERNEL_VERSION) ]; then rm -rf kernel/linux-$(KERNEL_VERSION); fi |
| 126 | if [ -e kernel/linux-$(KERNEL_VERSION)-Sam440ep ]; then rm -rf kernel/linux-$(KERNEL_VERSION)-Sam440ep; fi |
| 127 | if [ -e kernel/linux-$(KERNEL_VERSION)-Efika ]; then rm -rf kernel/linux-$(KERNEL_VERSION)-Efika; fi |
| 128 | if [ -e kernel/linux-$(KERNEL_VERSION)-Pegasos2 ]; then rm -rf kernel/linux-$(KERNEL_VERSION)-Pegasos2; fi |
| 129 | if [ -e kernel/linux-$(KERNEL_VERSION)-Chrp32 ]; then rm -rf kernel/linux-$(KERNEL_VERSION)-Chrp32; fi |
| 130 | |
| 131 | clean: kernel-clean |
| 132 | |
| 133 | $(COLLECTIONS): check-root |
| 134 | @for p in $(PORTS_$(@)); do \ |
| 135 | echo "p: $$p"; \ |
| 136 | (cd $(PORTS_DIR)/$@/$$p; pkgmk -d $(PKGMK_FORCE)); \ |
| 137 | done |
| 138 | |
| 139 | all: $(COLLECTIONS) |
| 140 | |
| 141 | all-chroot: check-root |
| 142 | @echo "Creating chroot environment" |
| 143 | @if [ -e $(FAKE_ROOT_DIR) ]; then \ |
| 144 | umount $(FAKE_ROOT_DIR)/src; \ |
| 145 | umount $(FAKE_ROOT_DIR)/proc; \ |
| 146 | umount $(FAKE_ROOT_DIR)/dev; \ |
| 147 | rm -rf $(FAKE_ROOT_DIR); \ |
| 148 | fi |
| 149 | @mkdir -p $(FAKE_ROOT_DIR) |
| 150 | @echo "Installing packages" |
| 151 | @mkdir -p $(FAKE_ROOT_DIR)/var/lib/pkg |
| 152 | @touch $(FAKE_ROOT_DIR)/var/lib/pkg/db |
| 153 | # @for COLL in $(COLLECTIONS); do \ |
| 154 | # for PACKAGE in $(PORTS_DIR)/$$COLL/*/*.$(PKG_EXT); do \ |
| 155 | # echo " $$PACKAGE"; \ |
| 156 | # pkgadd -r $(FAKE_ROOT_DIR) $$PACKAGE; \ |
| 157 | # done; \ |
| 158 | # done |
| 159 | @for p in $(PORTS_core); do \ |
| 160 | echo " $$p"; \ |
| 161 | pkgadd -r $(FAKE_ROOT_DIR) $(PORTS_DIR)/core/$$p/$$p*.$(PKG_EXT); \ |
| 162 | done |
| 163 | @for p in $(PORTS_opt); do \ |
| 164 | echo " $$p"; \ |
| 165 | pkgadd -r $(FAKE_ROOT_DIR) $(PORTS_DIR)/opt/$$p/$$p*.$(PKG_EXT); \ |
| 166 | done |
| 167 | @for p in $(PORTS_xorg); do \ |
| 168 | echo " $$p"; \ |
| 169 | pkgadd -r $(FAKE_ROOT_DIR) $(PORTS_DIR)/xorg/$$p/$$p*.$(PKG_EXT); \ |
| 170 | done |
| 171 | @echo "Mounting /dev on $(FAKE_ROOT_DIR)/dev" |
| 172 | @mount --bind /dev $(FAKE_ROOT_DIR)/dev |
| 173 | @echo "Mounting /proc on $(FAKE_ROOT_DIR)/proc" |
| 174 | @mount --bind /proc $(FAKE_ROOT_DIR)/proc |
| 175 | @echo "Mouting $$PWD on $(FAKE_ROOT_DIR)/src" |
| 176 | @mkdir $(FAKE_ROOT_DIR)/src |
| 177 | @mount --bind $$PWD $(FAKE_ROOT_DIR)/src |
| 178 | @cp -L $(PKGMK_CONF) $(FAKE_ROOT_DIR)/etc |
| 179 | @echo "Entering chroot enrivonment" |
| 180 | @chroot $(FAKE_ROOT_DIR) /bin/bash --login -c "cd /src && $(MAKE) FORCE=yes all" |
| 181 | @echo "Exiting chroot enrivonment" |
| 182 | @echo "Unmounting $(FAKE_ROOT_DIR)/src" |
| 183 | @umount $(FAKE_ROOT_DIR)/src |
| 184 | @rmdir $(FAKE_ROOT_DIR)/src |
| 185 | @echo "Unmounting $(FAKE_ROOT_DIR)/proc" |
| 186 | @umount $(FAKE_ROOT_DIR)/proc |
| 187 | @echo "Unmounting $(FAKE_ROOT_DIR)/dev" |
| 188 | @umount $(FAKE_ROOT_DIR)/dev |
| 189 | @echo "Removing chroot environment" |
| 190 | @rm -rf $(FAKE_ROOT_DIR) |
| 191 | |
| 192 | bootstrap: check-root |
| 193 | @echo "Bootstrap started (`date +'%F %T'`)" |
| 194 | @echo "- Stage 0 (`date +'%F %T'`)" |
| 195 | @for i in $(PORTS_core) $(PORTS_opt) $(PORTS_xorg); do\ |
| 196 | rm -f $(PORTS_DIR)/*/$$i/.footprint.$(HOSTTYPE);\ |
| 197 | done |
| 198 | @$(MAKE) all &> log.stage0 |
| 199 | @$(MAKE) check-log < log.stage0 |
| 200 | @echo "- Stage 1 (`date +'%F %T'`)" |
| 201 | @for i in $(PORTS_core) $(PORTS_opt) $(PORTS_xorg); do\ |
| 202 | rm -f $(PORTS_DIR)/*/$$i/.footprint.$(HOSTTYPE);\ |
| 203 | done |
| 204 | @$(MAKE) all-chroot &> log.stage1 |
| 205 | @$(MAKE) check-log < log.stage1 |
| 206 | @echo "- Stage 2 (`date +'%F %T'`)" |
| 207 | @$(MAKE) all-chroot &> log.stage2 |
| 208 | @$(MAKE) check-log < log.stage2 |
| 209 | @echo "Bootstrap completed (`date +'%F %T'`)" |
| 210 | |
| 211 | handbook: |
| 212 | @if [ -e doc/handbook.txt ]; then rm -f doc/handbook.txt; fi |
| 213 | @(cd doc; ../scripts/get_wiki_handbook) |
| 214 | |
| 215 | releasenotes: |
| 216 | @if [ -e doc/releasenotes.txt ]; then rm -f doc/releasenotes.txt; fi |
| 217 | @(cd doc; ../scripts/get_wiki_release_notes) |
| 218 | |
| 219 | iso: check-root handbook releasenotes dependencies-check |
| 220 | @echo "Creating ISO image ($(ISO_FILENAME))" |
| 221 | @if [ -e $(ISO_ROOT_DIR) ]; then rm -rf $(ISO_ROOT_DIR); fi |
| 222 | @mkdir -p $(ISO_ROOT_DIR) |
| 223 | @echo "- Installing packages" |
| 224 | @for PACKAGE in $(ISO_PACKAGES); do \ |
| 225 | tar -C $(ISO_ROOT_DIR) -xzpf $(PORTS_DIR)/*/$$PACKAGE/$$PACKAGE\#*.$(PKG_EXT); \ |
| 226 | done |
| 227 | @echo "- Copying ISO specific files" |
| 228 | @mkdir -p $(ISO_ROOT_DIR)/etc $(ISO_ROOT_DIR)/ppc/{chrp,efika,mac,pegasos2,ppc32,sam440ep} |
| 229 | @cp iso/ppc/bootinfo.txt $(ISO_ROOT_DIR)/ppc |
| 230 | @cp iso/ppc/chrp/{yaboot.chrp,yaboot.msg} $(ISO_ROOT_DIR)/ppc/chrp |
| 231 | @cp iso/ppc/mac/{ofboot.b,yaboot} $(ISO_ROOT_DIR)/ppc/mac |
| 232 | @cp iso/ppc/ppc32/{yaboot.conf,yaboot.msg} $(ISO_ROOT_DIR)/ppc/ppc32 |
| 233 | @cp iso/ppc/sam440ep/{Parthenope,menu.lst} $(ISO_ROOT_DIR)/ppc/sam440ep |
| 234 | @cp iso/ppc/sam440ep/menu.lst $(ISO_ROOT_DIR) |
| 235 | @cp iso/etc/{fstab,hosts,inittab,issue,motd,ld.so.conf,protocols,rc,rc.shutdown,rc.single,services,shadow,yaboot.conf} $(ISO_ROOT_DIR)/etc |
| 236 | @echo "- Installing kernel" |
| 237 | @cp kernel/linux-$(KERNEL_VERSION)/System.map $(ISO_ROOT_DIR)/ppc/ppc32 |
| 238 | @cp kernel/linux-$(KERNEL_VERSION)/arch/powerpc/boot/zImage.pmac $(ISO_ROOT_DIR)/ppc/ppc32 |
| 239 | @cp kernel/linux-$(KERNEL_VERSION)-Sam440ep/System.map $(ISO_ROOT_DIR)/ppc/sam440ep |
| 240 | @cp kernel/linux-$(KERNEL_VERSION)-Sam440ep/arch/powerpc/boot/cuImage.sam440ep $(ISO_ROOT_DIR)/ppc/sam440ep/uImage |
| 241 | @cp kernel/linux-$(KERNEL_VERSION)-Efika/System.map $(ISO_ROOT_DIR)/ppc/efika |
| 242 | @cp kernel/linux-$(KERNEL_VERSION)-Efika/arch/powerpc/boot/zImage.chrp $(ISO_ROOT_DIR)/ppc/efika |
| 243 | @cp kernel/linux-$(KERNEL_VERSION)-Pegasos2/System.map $(ISO_ROOT_DIR)/ppc/pegasos2 |
| 244 | @cp kernel/linux-$(KERNEL_VERSION)-Pegasos2/arch/powerpc/boot/zImage.chrp $(ISO_ROOT_DIR)/ppc/pegasos2 |
| 245 | @cp kernel/linux-$(KERNEL_VERSION)-Chrp32/System.map $(ISO_ROOT_DIR)/ppc/chrp |
| 246 | @cp kernel/linux-$(KERNEL_VERSION)-Chrp32/vmlinux $(ISO_ROOT_DIR)/ppc/chrp |
| 247 | @echo "- Installing kernel modules (see modules_install.log)" |
| 248 | @make -C kernel/linux-$(KERNEL_VERSION) INSTALL_MOD_PATH=$(ISO_ROOT_DIR) modules_install &> modules_install.log |
| 249 | @make -C kernel/linux-$(KERNEL_VERSION)-Sam440ep INSTALL_MOD_PATH=$(ISO_ROOT_DIR) modules_install &> modules_install.log-Sam440ep |
| 250 | @make -C kernel/linux-$(KERNEL_VERSION)-Efika INSTALL_MOD_PATH=$(ISO_ROOT_DIR) modules_install &> modules_install.log-Efika |
| 251 | @make -C kernel/linux-$(KERNEL_VERSION)-Pegasos2 INSTALL_MOD_PATH=$(ISO_ROOT_DIR) modules_install &> modules_install.log-Pegasos2 |
| 252 | @make -C kernel/linux-$(KERNEL_VERSION)-Chrp32 INSTALL_MOD_PATH=$(ISO_ROOT_DIR) modules_install &> modules_install.log-Chrp32 |
| 253 | @echo "- Deleting superfluous files" |
| 254 | @cd $(ISO_ROOT_DIR) && rm -rf var opt home |
| 255 | @cd $(ISO_ROOT_DIR)/usr && rm -rf man include lib/*.a lib/*.o lib/gconv lib/locale src |
| 256 | @cd $(ISO_ROOT_DIR)/usr/share && mkdir l v; cp terminfo/l/linux l; cp terminfo/v/vt100 v; rm -rf terminfo/*; mv l v terminfo |
| 257 | @cd $(ISO_ROOT_DIR)/usr/share && rm -rf et ss vim i18n zoneinfo |
| 258 | @cd $(ISO_ROOT_DIR)/usr/bin && rm cal locale localedef rpcgen compile_et mk_cmds |
| 259 | @cd $(ISO_ROOT_DIR)/usr/sbin && rm group{add,del,mod} user{add,del,mod} grpck pwck iconvconfig rpcinfo zic zdump |
| 260 | @cd $(ISO_ROOT_DIR)/etc && rm -rf rc.d cron {resolv,sysctl,pkgadd,pkgmk}.conf securetty |
| 261 | @cd $(ISO_ROOT_DIR)/usr/lib && rm -rf pkgconfig/* |
| 262 | @cd $(ISO_ROOT_DIR)/lib/modules/$(KERNEL_VERSION) && rm -f build |
| 263 | @echo "- Creating symlinks" |
| 264 | @ln -sf /tmp/var $(ISO_ROOT_DIR)/var |
| 265 | @ln -sf /proc/mounts $(ISO_ROOT_DIR)/etc/mtab |
| 266 | @echo "- Updating library links and cache" |
| 267 | @ldconfig -r $(ISO_ROOT_DIR) |
| 268 | @echo "- Copying CRUX PPC packages" |
| 269 | @mkdir -p $(ISO_ROOT_DIR)/crux |
| 270 | @cp doc/handbook.txt $(ISO_ROOT_DIR)/crux |
| 271 | @cp doc/releasenotes.txt $(ISO_ROOT_DIR)/crux |
| 272 | @cp iso/setup.dependencies $(ISO_ROOT_DIR)/crux |
| 273 | @cp doc/gpl.txt $(ISO_ROOT_DIR)/crux |
| 274 | @cp iso/bin/{setup,setup-helper,setup-chroot,serial_console} $(ISO_ROOT_DIR)/usr/bin |
| 275 | @mkdir -p $(ISO_ROOT_DIR)/crux/kernel |
| 276 | @cp kernel/linux-$(KERNEL_VERSION).tar.bz2 $(ISO_ROOT_DIR)/crux/kernel |
| 277 | @cp kernel/linux-$(KERNEL_VERSION).config $(ISO_ROOT_DIR)/crux/kernel |
| 278 | @cp kernel/linux-$(KERNEL_VERSION)-Sam440ep.config $(ISO_ROOT_DIR)/crux/kernel |
| 279 | @cp kernel/linux-$(KERNEL_VERSION)-Sam440ep.patch $(ISO_ROOT_DIR)/crux/kernel |
| 280 | @cp kernel/linux-$(KERNEL_VERSION)-Efika.config $(ISO_ROOT_DIR)/crux/kernel |
| 281 | ## @cp kernel/linux-$(KERNEL_VERSION)-Efika.patch $(ISO_ROOT_DIR)/crux/kernel |
| 282 | @cp kernel/linux-$(KERNEL_VERSION)-Pegasos2.config $(ISO_ROOT_DIR)/crux/kernel |
| 283 | ## @cp kernel/linux-$(KERNEL_VERSION)-Pegasos2.patch $(ISO_ROOT_DIR)/crux/kernel |
| 284 | @cp kernel/linux-$(KERNEL_VERSION)-Chrp32.config $(ISO_ROOT_DIR)/crux/kernel |
| 285 | @for FILE in $(KERNEL_PATCHES); do \ |
| 286 | cp kernel/$$FILE $(ISO_ROOT_DIR)/crux/kernel; \ |
| 287 | done |
| 288 | @mkdir -p $(ISO_ROOT_DIR)/crux/core |
| 289 | @for PKG in $(PORTS_core); do \ |
| 290 | cp $(PORTS_DIR)/core/$$PKG/*.$(PKG_EXT) $(ISO_ROOT_DIR)/crux/core; \ |
| 291 | done |
| 292 | @mkdir -p $(ISO_ROOT_DIR)/crux/opt |
| 293 | @for PKG in $(PORTS_opt); do \ |
| 294 | cp $(PORTS_DIR)/opt/$$PKG/*.$(PKG_EXT) $(ISO_ROOT_DIR)/crux/opt; \ |
| 295 | done |
| 296 | @mkdir -p $(ISO_ROOT_DIR)/crux/xorg |
| 297 | @for PKG in $(PORTS_xorg); do \ |
| 298 | cp $(PORTS_DIR)/xorg/$$PKG/*.$(PKG_EXT) $(ISO_ROOT_DIR)/crux/xorg; \ |
| 299 | done |
| 300 | @echo "- Starting genisoimage" |
| 301 | @if [ -f $(ISO_FILENAME) ]; then rm -f $(ISO_FILENAME); fi |
| 302 | @genisoimage -r -V CRUX-PPC -U -chrp-boot -hfs -part -probe -no-desktop \ |
| 303 | -hfs-bless $(ISO_ROOT_DIR)/ppc/mac -map iso/boot/map.hfs \ |
| 304 | -b ppc/sam440ep/Parthenope -no-emul-boot \ |
| 305 | -hide-rr-moved -o $(ISO_FILENAME) $(ISO_ROOT_DIR) |
| 306 | @rm -rf $(ISO_ROOT_DIR) |
| 307 | @md5sum $(ISO_FILENAME) > $(ISO_FILENAME).md5 |
| 308 | @echo "Done" |
| 309 | |
| 310 | dependencies-check: |
| 311 | @if [ -e iso/setup.dependencies ]; then rm iso/setup.dependencies; fi |
| 312 | @make iso/setup.dependencies |
| 313 | @for i in `cat iso/setup.dependencies | sed -e 's|[^:]*:\ ||' -e 's|\ |\n|g' | sort | uniq`; do \ |
| 314 | ilenia -s $$i > /dev/null ; \ |
| 315 | if [ "$$?" != "0" ]; then \ |
| 316 | echo "Missing dependence $$i" ;\ |
| 317 | exit 1 ;\ |
| 318 | fi ; \ |
| 319 | done |
| 320 | |
| 321 | iso/setup.dependencies: |
| 322 | @for PORT in $(foreach c,$(COLLECTIONS),$(PORTS_$(c))); do \ |
| 323 | echo -n $$PORT": "; \ |
| 324 | ilenia -D --all $$PORT | awk '{ print $$1 }' | xargs; \ |
| 325 | done > $@ |
| 326 | |
| 327 | source-iso: |
| 328 | @echo "Creating ISO image with sources ($(SRCISO_FILENAME))" |
| 329 | @rm -rf $(SRCISO_ROOT_DIR) |
| 330 | @mkdir -p $(SRCISO_ROOT_DIR)/{ports,kernel,misc} |
| 331 | @echo "- Copying ports" |
| 332 | @for PORT in $(PORTS_core) $(PORTS_opt) $(PORTS_xorg); do \ |
| 333 | find ports -mindepth 2 -maxdepth 2 -name $$PORT -type d -exec cp -r {} $(SRCISO_ROOT_DIR)/ports \; ; \ |
| 334 | rm -f $(SRCISO_ROOT_DIR)/ports/$$PORT/{*~,build.log,.footprint*,.md5sum,*.$(PKG_EXT)}; \ |
| 335 | done |
| 336 | @echo "- Copying kernel and patches" |
| 337 | @cp kernel/linux-$(KERNEL_VERSION).tar.bz2 $(SRCISO_ROOT_DIR)/kernel |
| 338 | @for PATCH in $(KERNEL_PATCHES); do cp kernel/$$PATCH $(SRCISO_ROOT_DIR)/kernel; done |
| 339 | @echo "- Creating README" |
| 340 | @echo "- Starting genisoimage" |
| 341 | @genisoimage -R -l -J -V CRUX-PPC-$(CRUXVERSION) -A "CRUX PPC" -o $(SRCISO_FILENAME) $(SRCISO_ROOT_DIR) |
| 342 | @md5sum `basename $(SRCISO_FILENAME)` > `basename $(SRCISO_FILENAME) .iso`.md5 |
| 343 | |
| 344 | # End of file |