📜 ⬆️ ⬇️

How to add packages to Gentoo LiveCD. HOWTO

How to add packages to Gentoo LiveCD. HOWTO
Necessary:
- Gentoo LiveCD (install-minimal)
- working Gentoo system
- Packages:
- sys-fs / squashfs-tools
- app-cdr / cdrkit


First you need to unpack the image (iso) of the finished LiveCD somewhere in / tmp / newlivecd / cd
This can be done either in MC "stepping on" the file (as he does, I did not understand),
either mount it with -o loop and copy files from it.

# mkdir -p / tmp / newlivecd / cd
# mount -o loop ~ / install-x86-minimal-2008.0.iso / mnt / cdrom
# cp -R / mnt / cdrom / * / tmp / newlivecd / cd /
# umount / mnt / cdrom
')
# cd / tmp / newlivecd

now you need to unpack the root filesystem from the livecd, it is in it that the chroot initrd will be loaded when loading
# unsquashfs ./cd/image.squashfs
created 11102 files
created 872 directories
created 1685 symlinks
created 5138 devices
created 0 fifos
# ls
cd squashfs-root

we don't need the archive anymore
# rm ./cd/image.squashfs

Now you can install packages.
CFLAGS - used those with which the software on install-x86-minimal-2008.0.iso was built
USE - flags are not needed, the smaller the better. (of course you can add it to CFLAGS -Os)
ROOT - specifies where exactly portage will install packages after compilation

# CFLAGS = "- O2 -march = i686 -pipe" USE = "- *" ROOT =. / Squashfs-root / emerge mc
...

Create squashfs back.
# mksquashfs ./squashfs-root/ ./cd/image.squashfs -le
Parallel mksquashfs: Using 2 processors
Creating little endian 3.1 filesystem on image.sauashfs, block size 131072.
[================================================ ===] 11658/11658 100%
Exportable little endian filesystem, data block size 131072, compressed data, compressed metadata, compressed fragments, duplicates are removed
Filesystem size 56128.78 Kbytes (54.81 Mbytes)
37.91% of uncompressed filesystem size (148057.62 Kbytes)
Inode table size 149825 bytes (146.31 Kbytes)
27.58% of uncompressed inode table size (543231 bytes)
Directory table size 144473 bytes (141.09 Kbytes)
54.29% of uncompressed directory table size (266093 bytes)
Number of duplicate files found 2151
Number of inodes 19010
Number of files 11297
Number of fragments 695
Number of symbolic links 1689
Number of device nodes 5138
Number of fifo nodes 0
Number of socket nodes 0
Number of directories 886
Number of uids 3
root (0)
nobody (65534)
ntp (123)
Number of gids 16
disk (6)
audio (18)
cdrom (19)
tty (5)
video (27)
floppy (11)
dialout (20)
kmem (9)
lp (7)
tape (26)
unknown (407)
wheel (10)
utmp (406)
portage (250)
root (0)
uucp (14)

Now you can push it all back into the iso-image and boot from it.
# mkisofs -J -r -R -o newlivecd.iso -b isolinux / isolinux.bin -c isolinux / boot.cat -no-emul-boot-boot-load-size 4-boot-info-table ./cd/

install-x86-minimal-2008.0-with-mc-and-stage3.iso

Article written by BuriK666 . I publish it because he now has negative karma.

Source: https://habr.com/ru/post/29304/


All Articles