Re: [lorax] how to decrease squashfs.img size, it increase more than install size

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



@Vratislav Podzimek

the difference of ks files was only 'dracut-network' package :

    # find  . -name 'anaconda-ks.cfg'|xargs ls
    ./1/root/anaconda-ks.cfg  ./2/root/anaconda-ks.cfg

    # find  . -name 'anaconda-ks.cfg'|xargs diff
    115a116
    > dracut-network


second liveos only add 'dracut-network' package to build 'livenet' module into initrd.img.

@Brian C. Lane, I have sort all installed packges at the end of %post install section:

    %post --logfile /dev/stdout
    ...
    rpm -qa|sort > /root/rpm-qa.txt
    yum clean all
    rm -f /var/lib/rpm/__db*
    rm -fr /usr/share/doc
    %end

    # find  . -name 'rpm-qa.txt'|xargs ls
    ./1/root/rpm-qa.txt  ./2/root/rpm-qa.txt

    # find  . -name 'rpm-qa.txt'|xargs diff
    65a66
    > dracut-network-033-161.el7.x86_64


Because dracut rebuild initramfs.img after post install, so I boot from this livecd,
and diff the livcos's rpm packags with %post end 'rpm -qa' sort. they are all the same.
so the dracut rebuild initramfs.img not install extra packages.

This is my ks.cfg paste :

    http://ix.io/dsS

mount rootfs.img :

    # losetup -l
    NAME       SIZELIMIT OFFSET AUTOCLEAR RO BACK-FILE
    /dev/loop0         0      0         1  0 /var/tmp/tmpc4zHMy/images/install.img
    /dev/loop1         0      0         1  1 /mnt/1/LiveOS/rootfs.img
    /dev/loop2         0      0         1  0 /var/tmp/tmp4Gzruj/images/install.img
    /dev/loop3         0      0         1  1 /mnt/2/LiveOS/rootfs.img

    # du -sh /mnt/1/LiveOS/rootfs.img /mnt/2/LiveOS/rootfs.img
    1000M   /mnt/1/LiveOS/rootfs.img
    1.1G    /mnt/2/LiveOS/rootfs.img

    # df -h
    /dev/loop0      296M  296M     0 100% /mnt/1
    /dev/loop1       21G  817M   20G   4% /media/1      <-- root size
    /dev/loop2      346M  346M     0 100% /mnt/2
    /dev/loop3       21G  828M   20G   4% /media/2      <-- root size


then I 'du -sh *' the root filesystem of rootfs.img:

    # du -sh /media/*
    813M    /media/1
    824M    /media/2

    # du -sh /media/1/*|sort -hr                 # du -sh /media/2/*|sort -hr
    748M    /media/1/usr                         748M    /media/2/usr
    31M     /media/1/boot    <-- diff size -->   42M     /media/2/boot
    22M     /media/1/var                         22M     /media/2/var
    9.6M    /media/1/etc                         9.6M    /media/2/etc
    3.2M    /media/1/opt                         3.2M    /media/2/opt
    143K    /media/1/root                        143K    /media/2/root
    12K     /media/1/lost+found                  12K     /media/2/lost+found
    11K     /media/1/tmp                         11K     /media/2/tmp
    1.0K    /media/1/sys                         1.0K    /media/2/sys
    1.0K    /media/1/srv                         1.0K    /media/2/srv
    1.0K    /media/1/run                         1.0K    /media/2/run
    1.0K    /media/1/proc                        1.0K    /media/2/proc
    1.0K    /media/1/mnt                         1.0K    /media/2/mnt
    1.0K    /media/1/media                       1.0K    /media/2/media
    1.0K    /media/1/home                        1.0K    /media/2/home
    1.0K    /media/1/dev                         1.0K    /media/2/dev
    0       /media/1/sbin                        0       /media/2/sbin
    0       /media/1/lib64                       0       /media/2/lib64
    0       /media/1/lib                         0       /media/2/lib
    0       /media/1/bin                         0       /media/2/bin


I suspect livemedia-creator can NOT release the temp space under install or dracut generate initramfs.img.
mksquashfs could NOT ignore these sparse space.



2014-07-19 1:20 GMT+08:00 Brian C. Lane <bcl@xxxxxxxxxx>:
On Fri, Jul 18, 2014 at 01:12:44PM +0800, 耳东 wrote:
> hi guys. I want to build a cutom liveos by lorax.
> my first liveos , dracut miss 'livenet' module, so it can **NOT** boot
> under PXE
> boot failed message:
>
>     dracut: FATAL: Don't Know how to handle 'root=live:http://
> ...squashfs.img'
>
> first create command:
>
>     livemedia-creator --no-virt --make-iso --ks=centos7.liveos.ks.cfg
>
> After I add 'dracut-network' package in centos7.liveos.ks.cfg '%package'
> section,
> the second create liveos with 'livenet' module can boot from PXE
> successfully:
>
>     livemedia-creator --dracut-arg="--no-hostonly" --no-virt --make-iso
> --ks=centos7.liveos.ks.cfg
>
> But squashfs.img size increased was larger than the size initramfs.img
> increased.

Adding packages changes the squashfs.img (the root filesystem). dracut
uses some of these to create the initrd. dracut-network will pull in
other packages (eg. dhclient, iputils, iproute) which may not have been
present.

The easiest way to tell is to mount both squashfs.img files and diff
their contents.

--
Brian C. Lane | Anaconda Team | IRC: bcl #anaconda | Port Orchard, WA (PST8PDT)

_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/anaconda-devel-list

_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/anaconda-devel-list

[Index of Archives]     [Kickstart]     [Fedora Users]     [Fedora Legacy List]     [Fedora Maintainers]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]
  Powered by Linux