1 Reply Latest reply on Jun 17, 2020 1:21 AM by Deepak Patnaik

    Building Gentoo boot image on CentOS 8

    Lionel ARISTOTE
      Share This:

      Based on this documention page: Creating a Gentoo Linux image file - Documentation for TrueSight Server Automation 20.02 - BMC Documentation

      I didn't find any specific information related to CentOS 8, so here is my experience.

       

      Running mkgen2img.sh on CentOS8

      Gentoo ISO: install-amd64-minimal-20200419T214502Z.iso

       

       

      > Install missing packages:

      [root@ linux]# dnf --enablerepo=PowerTools install xz-lzma-compat

      ...

      Installed:

        xz-lzma-compat-5.2.4-3.el8.x86_64

       

       

      [root@ linux]# dnf install glibc

      ...

      Upgraded:

        glibc-2.28-72.el8_1.1.x86_64                        glibc-common-2.28-72.el8_1.1.x86_64                        glibc-langpack-en-2.28-72.el8_1.1.x86_64

       

      > The script is looking for /lib/libgcc_s.so.1. Creating a link to lib64:

      [root@ linux]# ln -s /lib64/libgcc_s.so.1 /lib/libgcc_s.so.1

      [root@ linux]# ll /lib*/libgcc_s*

      -rwxr-xr-x. 1 root root 104256 Nov  6 05:38 /lib64/libgcc_s-8-20190507.so.1

      lrwxrwxrwx. 1 root root     24 Nov  6 05:36 /lib64/libgcc_s.so.1 -> libgcc_s-8-20190507.so.1

      lrwxrwxrwx. 1 root root     20 Apr 28 10:30 /lib/libgcc_s.so.1 -> /lib64/libgcc_s.so.1

       

       

       

       

      > Edit mkgen2img.sh:

      Add arch=x86_64 in function checkRPM

      for arch in i686 i586 i386 x86_64

       

       

      Replace "isolinux" by "boot"

      #copy the gentoo initrd to outdir

      cp $TMPDIR/boot/gentoo.igz "$OUTDIR"  || fail "Cannot find gentoo.igz. ISO image is corrupt"

      ...

      cp $TMPDIR/boot/gentoo "$OUTDIR"/

       

       

      Add /usr/sbin path to use local unsquashfs and mksquashfs. (provided unsquashfs and mksquashfs don't start)

      /usr/sbin/unsquashfs image.squashfs

      ...

      /usr/sbin/mksquashfs squashfs-root image.squashfs || fail "Cannot create image.squashfs"

       

       

      > Result:

      [root@ linux]# cd /tmp/bmc_bl/linux

      [root@ linux]# ./mkgen2img.sh /tmp/bmc_bl/linux/amd64/bmi64 /tmp/bmc_bl/install-amd64-minimal-20200419T214502Z.iso /tmp/tftproot/x86pc/pxelinux

      64bits

      /tmp/bmc_bl/install-amd64-minimal-20200419T214502Z.iso

      mount: /tmp/bl48KlE59zx: WARNING: device write-protected, mounted read-only.

      Bladelogic : Wiring gentoo with bladelogic

      Bladelogic : gentoo image : extracting gentoo image

      Bladelogic : gentoo image : extracting done

      Bladelogic : gentoo image : wiring linuxrc

      Bladelogic : gentoo image : linuxrc done

      Bladelogic : gentoo image : wiring squashfs with bmi

      /tmp/tftproot/x86pc/pxelinux/gen2-oXQgol2sG/mnt/cdrom /tmp/tftproot/x86pc/pxelinux/gen2-oXQgol2sG /tmp/bmc_bl/linux

      Parallel unsquashfs: Using 4 processors

      26973 inodes (32079 blocks) to write

       

       

      [===================================================================================================-] 32079/32079 100%

       

       

      created 24581 files

      created 2421 directories

      created 2121 symlinks

      created 271 devices

      created 0 fifos

       

       

      Bladelogic : gentoo image : bmi done

      Bladelogic : gentoo image : lshw-static done

      Bladelogic : gentoo image : wiring squashfs bashrc

      Bladelogic : gentoo image : bashrc done

      Bladelogic : gentoo image : generating squashfs setup.sh

      Bladelogic : gentoo image : setup.sh done

      Bladelogic : gentoo image : recreating squashfs

      Parallel mksquashfs: Using 4 processors

      Creating 4.0 filesystem on image.squashfs, block size 131072.

      [===================================================================================================|] 29736/29736 100%

       

       

      Exportable Squashfs 4.0 filesystem, gzip compressed, data block size 131072

              compressed data, compressed metadata, compressed fragments, compressed xattrs

              duplicates are removed

      Filesystem size 324131.72 Kbytes (316.53 Mbytes)

              34.09% of uncompressed filesystem size (950762.83 Kbytes)

      Inode table size 325666 bytes (318.03 Kbytes)

              20.27% of uncompressed inode table size (1606633 bytes)

      Directory table size 251417 bytes (245.52 Kbytes)

              43.94% of uncompressed directory table size (572200 bytes)

      Xattr table size 74 bytes (0.07 Kbytes)

              69.16% of uncompressed xattr table size (107 bytes)

      Number of duplicate files found 4591

      Number of inodes 29401

      Number of files 24587

      Number of fragments 1969

      Number of symbolic links  2121

      Number of device nodes 271

      Number of fifo nodes 0

      Number of socket nodes 0

      Number of directories 2422

      Number of ids (unique uids + gids) 10

      Number of uids 4

              root (0)

              nobody (65534)

              unknown (123)

              unknown (91)

      Number of gids 8

              root (0)

              disk (6)

              kmem (9)

              tty (5)

              wheel (10)

              unknown (406)

              unknown (250)

              unknown (123)

      Bladelogic : gentoo image : squashfs done

      Bladelogic : gentoo image : recreating gentoo image

      Bladelogic : gentoo image : re-creating done

      Bladelogic : gentoo image : Please find 'gentoo' and 'gentoord.gz' in /tmp/tftproot/x86pc/pxelinux