############################ # # initrd, building the initrd.sq file. # # this is a bit special than most other .mk files since it will always # build the file, regardeless the exsistence of a initrd.sq file. # # The reasons are that we don't know which type of initrd.sq file we have, # we do make two of'em here already (IDE and basic) and since the building # of the images, initrd.sq and add.bz2 are separate from the rest, you never # really know when to build or not. # # So, this is being on the safe side. # ########################## TMP_MNT=$(TMP_DIR)/mnt TMP_INITRD=$(TMP_DIR)/initrd initrd-base: $(INITRD_MASTER) -[ -d $(TMP_MNT) ] && $(RM) -r $(TMP_MNT) -[ -f $(TMP_INITRD) ] && $(RM) $(TMP_INITRD) mkdir $(TMP_MNT) # mount -t minix -o loop $(TMP_INITRD) $(TMP_MNT) cp -a $(INITRD_MASTER)/* $(TMP_MNT)/. cp -a $(SCRIPTS_DIR)/linuxrc $(TMP_MNT)/. $(SED) 's/FLOPPYFW_VERSION/$(FLOPPYFW_VERSION)/' $(TMP_MNT)/linuxrc cp -a $(SCRIPTS_DIR)/rc.initrd $(TMP_MNT)/etc/. cp -a $(SCRIPTS_DIR)/functions.inc $(TMP_MNT)/etc/. cp -a $(SCRIPTS_DIR)/inittab $(TMP_MNT)/etc/. cp -a $(SCRIPTS_DIR)/inittab.serial $(TMP_MNT)/etc/. chown -R root.root $(TMP_MNT) (cd $(TMP_MNT)/dev ; \ mknod -m 600 console c 5 1; \ mknod -m 600 tty0 c 4 0; \ mknod -m 600 tty1 c 4 1; \ mknod -m 660 ram0 b 1 0; \ ); mksquashfs-lzma $(TMP_MNT) $(TMP_INITRD).sq -all-root -noappend -nopad mv $(TMP_INITRD).sq $(INITRD_DIR)/initrd.sq # I wish I didn't have to repeat the whole thing here: # This has a dependancy of idemods (which could trigger quite alot) but # idemods.ffw are the whole point of this. initrd-ide: $(INITRD_MASTER) $(MODULES_BASE_DIR)/idemods.ffw $(MODULES_BASE_DIR)/usbmods.ffw -[ -d $(TMP_MNT) ] && $(RM) -r $(TMP_MNT) -[ -f $(TMP_INITRD) ] && $(RM) $(TMP_INITRD) mkdir $(TMP_MNT) cp -a $(INITRD_MASTER)/* $(TMP_MNT)/. cp -a $(SCRIPTS_DIR)/linuxrc $(TMP_MNT)/. $(SED) 's/FLOPPYFW_VERSION/$(FLOPPYFW_VERSION)/' $(TMP_MNT)/linuxrc cp -a $(SCRIPTS_DIR)/rc.initrd $(TMP_MNT)/etc/. cp -a $(SCRIPTS_DIR)/functions.inc $(TMP_MNT)/etc/. cp -a $(SCRIPTS_DIR)/inittab $(TMP_MNT)/etc/. cp -a $(SCRIPTS_DIR)/inittab.serial $(TMP_MNT)/etc/. $(LZMAD) $(MODULES_BASE_DIR)/idemods.ffw | \ tar -C $(TMP_MNT) $(TAR_VERBOSE) -xf - $(LZMAD) $(MODULES_BASE_DIR)/usbmods.ffw | \ tar -C $(TMP_MNT) $(TAR_VERBOSE) -xf - (cd $(TMP_MNT)/dev ; \ mknod -m 600 console c 5 1; \ mknod -m 600 tty0 c 4 0; \ mknod -m 600 tty1 c 4 1; \ mknod -m 660 ram0 b 1 0; \ ); mksquashfs-lzma $(TMP_MNT) $(TMP_INITRD).sq -all-root -noappend -nopad mv $(TMP_INITRD).sq $(INITRD_DIR)/initrd.sq initrd-livekit: $(INITRD_MASTER) -[ -d $(TMP_MNT) ] && $(RM) -r $(TMP_MNT) -[ -f $(TMP_INITRD) ] && $(RM) $(TMP_INITRD) mkdir $(TMP_MNT) cp -a $(INITRD_MASTER)/* $(TMP_MNT)/. cp -a $(BASE_DIR)/devkitstuff/linuxrc $(TMP_MNT)/. $(SED) 's/FLOPPYFW_VERSION/$(FLOPPYFW_VERSION)/' $(TMP_MNT)/linuxrc # I probably don't need these. # $(LZMAD) $(MODULES_BASE_DIR)/idemods.ffw | \ # tar -C $(TMP_MNT) $(TAR_VERBOSE) -xf - # $(LZMAD) $(MODULES_BASE_DIR)/usbmods.ffw | \ # tar -C $(TMP_MNT) $(TAR_VERBOSE) -xf - cp -a /dev/* $(TMP_MNT)/dev/. # Since I don't use squashfs on the devkit kernel, I'll do this the # old fashioned way. $(BASE_DIR)/devkitstuff/mkinitrd $(TMP_MNT) initrd-clean: -$(RM) $(INITRD_DIR)/initrd.sq -$(RM) $(BASE_DIR)/floppy/initrd.sq initrd-dirclean: -$(RM) $(INITRD_DIR)/initrd.sq -$(RM) -r $(INITRD_MASTER)