From mboxrd@z Thu Jan 1 00:00:00 1970 From: Michael Tremer To: development@lists.ipfire.org Subject: [PATCH 3/4] cdrom+flash-image: Move all temporary files to /tmp Date: Tue, 10 Mar 2020 13:26:05 +0000 Message-ID: <20200310132606.21372-4-michael.tremer@ipfire.org> In-Reply-To: <20200310132606.21372-1-michael.tremer@ipfire.org> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============1915169182305655983==" List-Id: --===============1915169182305655983== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Since /tmp is now a ramdisk, we move all temporary files into it. Signed-off-by: Michael Tremer --- lfs/cdrom | 71 +++++++++++++++++++++++++----------------------- lfs/flash-images | 8 +++--- 2 files changed, 41 insertions(+), 38 deletions(-) diff --git a/lfs/cdrom b/lfs/cdrom index 836cae981..f18b80a03 100644 --- a/lfs/cdrom +++ b/lfs/cdrom @@ -150,8 +150,8 @@ $(TARGET) : $(patsubst %,$(DIR_DL)/%,$(objects)) # since stage2 has been executed.. echo "$(SYSTEM_RELEASE)" > /etc/system-release =20 - rm -rf /install/cdrom - mkdir -p /install/cdrom/doc + # Create a directory to authorise the CDROM in + rm -rf $(DIR_TMP)/cdrom && mkdir -p $(DIR_TMP)/cdrom =20 # Clear mtab (prevents .journal problems) rm -vf /etc/mtab @@ -171,40 +171,43 @@ $(TARGET) : $(patsubst %,$(DIR_DL)/%,$(objects)) -C / --files-from=3D$(DIR_TMP)/ROOTFILES | tar -x -C $(DIR_TMP)/root rm -f $(DIR_TMP)/ROOTFILES mkdir $(DIR_TMP)/root/sys - cd $(DIR_TMP)/root && tar cf - * | xz $(XZ_OPT) > /install/cdrom/distro.img + cd $(DIR_TMP)/root && tar cf - * | xz $(XZ_OPT) > $(DIR_TMP)/cdrom/distro.i= mg rm -rf $(DIR_TMP)/root =20 # Other files - touch /install/cdrom/$(SNAME)-$(VERSION)-core$(CORE).media - sed 's/VERSION/$(VERSION)/' $(DIR_SRC)/config/cdrom/README.txt > /install/c= drom/README.txt - cp $(DIR_SRC)/doc/COPYING /install/cdrom/ - cp $(DIR_SRC)/doc/{ChangeLog,packages-list.txt} /install/cdrom/doc + touch $(DIR_TMP)/cdrom/$(SNAME)-$(VERSION)-core$(CORE).media + sed 's/VERSION/$(VERSION)/' $(DIR_SRC)/config/cdrom/README.txt > $(DIR_TMP)= /cdrom/README.txt + cp $(DIR_SRC)/doc/COPYING $(DIR_TMP)/cdrom/ =20 - mkdir -p /install/cdrom/boot/isolinux + # Install documentation + -mkdir -pv $(DIR_TMP)/cdrom/doc + cp $(DIR_SRC)/doc/{ChangeLog,packages-list.txt} $(DIR_TMP)/cdrom/doc + + mkdir -p $(DIR_TMP)/cdrom/boot/isolinux =20 ifeq "$(HAS_KERNEL)" "1" - cp /boot/vmlinuz-$(KVER)-ipfire /install/cdrom/boot/isolinux/vm= linuz - dracut --force --early-microcode -a "installer" --strip --xz /install/cdrom= /boot/isolinux/instroot $(KVER)-ipfire + cp /boot/vmlinuz-$(KVER)-ipfire $(DIR_TMP)/cdrom/boot/isolinux/vmlinuz + dracut --force --early-microcode -a "installer" --strip --xz $(DIR_TMP)/cdr= om/boot/isolinux/instroot $(KVER)-ipfire endif =20 ifeq "$(HAS_ISOLINUX)" "1" - dd if=3D/dev/zero bs=3D1k count=3D2 > /install/cdrom/boot/isoli= nux/boot.catalog - cp $(DIR_SRC)/config/syslinux/boot.png /install/cdrom/boot/isolinux/bo= ot.png - cp /usr/share/syslinux/isolinux.bin /install/cdrom/boot/isolinux/is= olinux.bin - cp /usr/share/hwdata/pci.ids /install/cdrom/boot/isolinux/pc= i.ids - cp -vf /usr/share/syslinux/*.c32 /install/cdrom/boot/isolinux/ + dd if=3D/dev/zero bs=3D1k count=3D2 > $(DIR_TMP)/cdrom/boot/iso= linux/boot.catalog + cp $(DIR_SRC)/config/syslinux/boot.png $(DIR_TMP)/cdrom/boot/isolinux/= boot.png + cp /usr/share/syslinux/isolinux.bin $(DIR_TMP)/cdrom/boot/isolinux/= isolinux.bin + cp /usr/share/hwdata/pci.ids $(DIR_TMP)/cdrom/boot/isolinux/= pci.ids + cp -vf /usr/share/syslinux/*.c32 $(DIR_TMP)/cdrom/boot/isolinux/ sed -e "s/VERSION/$(VERSION) - Core $(CORE)/g" \ $(DIR_SRC)/config/syslinux/syslinux.cfg \ - > /install/cdrom/boot/isolinux/isolinux.cfg + > $(DIR_TMP)/cdrom/boot/isolinux/isolinux.cfg endif =20 ifeq "$(HAS_MEMTEST)" "1" # Install memtest - cp /usr/lib/memtest86+/memtest.bin /install/cdrom/boot/isolinux/me= mtest + cp /usr/lib/memtest86+/memtest.bin $(DIR_TMP)/cdrom/boot/isolinux/memtest endif =20 ifeq "$(HAS_IPXE)" "1" - cp /usr/share/ipfire-netboot/ipxe.lkrn /install/cdrom/boot/isolinux/ne= tboot + cp /usr/share/ipfire-netboot/ipxe.lkrn $(DIR_TMP)/cdrom/boot/isolinux/netbo= ot endif =20 ifeq "$(EFI)" "1" @@ -213,43 +216,43 @@ ifeq "$(EFI)" "1" $(DIR_SRC)/config/cdrom/grub-efi.cfg > /tmp/grub-efi.cfg =20 # Build a GRUB EFI image - mkdir -pv /install/cdrom/EFI/BOOT + mkdir -pv $(DIR_TMP)/cdrom/EFI/BOOT grub-mkimage \ --format=3D$(GRUB_ARCH)-efi \ - --output=3D/install/cdrom/EFI/BOOT/boot$(EFI_ARCH).efi \ - --config=3D/tmp/grub-efi.cfg \ + --output=3D$(DIR_TMP)/cdrom/EFI/BOOT/boot$(EFI_ARCH).efi \ + --config=3D$(DIR_TMP)/grub-efi.cfg \ --compression=3Dxz \ --prefix=3D/EFI/BOOT \ $$(for mod in $(GRUB_EFI_MODULES); do [ -f "/usr/lib/grub/$(GRUB_ARCH)-efi= /$${mod}.mod" ] && echo "$${mod}"; done) =20 # Install GRUB configuration - mkdir -pv /install/cdrom/EFI/BOOT + mkdir -pv $(DIR_TMP)/cdrom/EFI/BOOT sed -e "s/NAME/$(NAME)/g" -e "s/VERSION/$(VERSION)/g" -e "s/ARCH/$(BUILD_AR= CH)/g" \ - < $(DIR_SRC)/config/cdrom/grub.cfg > /install/cdrom/EFI/BOOT/grub.cfg + < $(DIR_SRC)/config/cdrom/grub.cfg > $(DIR_TMP)/cdrom/EFI/BOOT/grub.cfg =20 # Create the EFI Eltorito image - dd if=3D/dev/zero of=3D/install/cdrom/boot/isolinux/efiboot.img bs=3D1k cou= nt=3D1440 - mkdosfs -F 12 -n "IPFIRE_EFI" /install/cdrom/boot/isolinux/efiboot.img + dd if=3D/dev/zero of=3D$(DIR_TMP)/cdrom/boot/isolinux/efiboot.img bs=3D1k c= ount=3D1440 + mkdosfs -F 12 -n "IPFIRE_EFI" $(DIR_TMP)/cdrom/boot/isolinux/efiboot.img =20 # Mount the EFI image - mkdir -pv /install/efiboot.img - mount -o loop /install/cdrom/boot/isolinux/efiboot.img /install/efiboot.img + mkdir -pv $(DIR_TMP)/efiboot.img + mount -o loop $(DIR_TMP)/cdrom/boot/isolinux/efiboot.img $(DIR_TMP)/efiboot= .img =20 # Copy the bootloader into the image - mkdir -pv /install/efiboot.img/EFI/BOOT - cp -a /install/cdrom/EFI/BOOT/boot$(EFI_ARCH).efi \ - /install/efiboot.img/EFI/BOOT/boot$(EFI_ARCH).efi + mkdir -p $(DIR_TMP)/efiboot.img/EFI/BOOT + cp -a $(DIR_TMP)/cdrom/EFI/BOOT/boot$(EFI_ARCH).efi \ + $(DIR_TMP)/efiboot.img/EFI/BOOT/boot$(EFI_ARCH).efi =20 # Cleanup - umount /install/efiboot.img - rm -rf /install/efiboot.img /tmp/grub-efi.cfg + umount $(DIR_TMP)/efiboot.img + rm -rf $(DIR_TMP)/efiboot.img $(DIR_TMP)/grub-efi.cfg endif =20 - cd /install/cdrom && find -type f ! -name md5sum.txt | grep -v "./boot" | \ + cd $(DIR_TMP)/cdrom && find -type f ! -name md5sum.txt | grep -v "./boot" |= \ xargs md5sum > md5sum.txt =20 mkdir -p /install/images - cd /install/cdrom && mkisofs $(ISO_ARGS) \ + cd $(DIR_TMP)/cdrom && mkisofs $(ISO_ARGS) \ -o /install/images/$(SNAME)-$(VERSION).$(BUILD_ARCH)-full-core$(CORE).iso . =20 ifeq "$(HAS_ISOLINUX)" "1" diff --git a/lfs/flash-images b/lfs/flash-images index e4af896f1..422acac22 100644 --- a/lfs/flash-images +++ b/lfs/flash-images @@ -55,8 +55,8 @@ md5 : ############################################################################= ### # Installation Details ############################################################################= ### -MNThdd :=3D /install/harddisk -IMG :=3D /install/images/image.img +MNThdd :=3D $(DIR_TMP)/harddisk +IMG :=3D $(DIR_TMP)/image.img =20 # All sizes in blocks ifeq "$(BUILD_PLATFORM)" "arm" @@ -152,9 +152,9 @@ endif =20 # Install IPFire ifneq "$(BUILD_PLATFORM)" "arm" - tar -x --xz -C $(MNThdd)/ -f /install/cdrom/distro.img + tar -x --xz -C $(MNThdd)/ -f $(DIR_TMP)/cdrom/distro.img else - tar -x -C $(MNThdd)/ -f /install/cdrom/distro.img + tar -x -C $(MNThdd)/ -f $(DIR_TMP)/cdrom/distro.img endif -touch $(MNThdd)/lib/modules/$(KVER)-ipfire/modules.dep mkdir $(MNThdd)/proc --=20 2.20.1 --===============1915169182305655983==--