You are not logged in.

#1 2012-10-17 21:56:37

lenieco
Member
Registered: 2012-04-27
Posts: 33

[SOLVED] Remastering archlinux official iso - Disk space problem

First I posted this as a reply in [semi-FIXED]Errors with "AIF" in (daily) releng netinstall iso's ? but some user told me to create a new post for avoiding necro-bumping, so...

Basically, what is related to the above post and that I mention here, is a method for remastering an official archlinux iso. If you don't want to check the post, this is what I'm talking about:

scjet wrote:

Here is what I did to re-build the official "archlinux-2011.08.19-netinstall-x86_64.iso"...

# as root for everything:
mkdir /mnt/archiso
mkdir /mnt/root-image-tmp
mkdir /root-image
#
mount -o loop /iso/archlinux-2011.08.19-netinstall-x86_64.iso /mnt/archiso
cp -a /mnt/archiso /customiso
cd /customiso/arch/x86_64
cp root-image.fs.sfs /root-image
cd /root-image
unsquashfs root-image.fs.sfs
cd squashfs-root
mount root-image.fs /mnt/root-image-tmp
#
# "cd /mnt/root-image-tmp" and make any "static" changes only; ie: add your aif configs/files, directories,..., to /mnt/root-image-tmp ...
#
cd /
umount /mnt/root-image-tmp
cd /root-image
mv root-image.fs.sfs root-image.fs.sfs.old
mksquashfs squashfs-root root-image.fs.sfs
cp -f root-image.fs.sfs /customiso/arch/x86_64
cd /customiso
genisoimage -l -r -J -V "ARCH_201108" -b isolinux/isolinux.bin -no-emul-boot -boot-load-size 4 -boot-info-table -c isolinux/boot.cat -o ~/arch-custom.iso .

I tried it with some files for testing and it works perfect, thanks to scjet user.

But now I have a problem and wonder if you can help me.

I want to add some packages to pacman /var/cache/pacman/pkg/ for installing them offline from my remastered iso, but when I try to copy them to the mounted root-image.fs it can't copy all of my desired packages because there's no free space.

I ran df -h and get this:

/dev/loop0            701M      701M        0        100%       /mnt/root-image-tmp

It isn't the total output but clearly shows that the filesystem has a defined size of 701M and i need more space for my iso.

Please help me....

1. Can I increase this size for the mounted system?.
2. How can I increase it?
3. Can i use a DVD for my remastered iso?
4. There's another way for installing almost 400 packages offline?


Thanks for your help!!!

Last edited by lenieco (2012-10-18 00:36:13)

Offline

#2 2012-10-17 22:00:19

karol
Archivist
Registered: 2009-05-06
Posts: 25,440

Re: [SOLVED] Remastering archlinux official iso - Disk space problem

Did you do

cp -a /mnt/archiso /customiso

etc.?

Last edited by karol (2012-10-17 22:12:39)

Offline

#3 2012-10-17 22:06:18

lenieco
Member
Registered: 2012-04-27
Posts: 33

Re: [SOLVED] Remastering archlinux official iso - Disk space problem

yes, I did all those steps, first copying some txt files to the iso and it worked.

Later, i repeated the process, but after mounting root-image.fs to /mnt/root-image-tmp, I tried something like

 cp /home/user/folder_with_packages/* /mnt/root-image-tmp/var/cache/pacman/pkg

but I couldn´t copy all the packages because free space wasn't enough...

Offline

#4 2012-10-17 22:13:33

djgera
Developer
From: Buenos Aires - Argentina
Registered: 2008-12-24
Posts: 723
Website

Re: [SOLVED] Remastering archlinux official iso - Disk space problem

If you only want to added files on /var/cache/pacman/pkg/ , simply create and squashfs image with these files, then add this image to the iso, and edit aitab.. Thats all.

Offline

#5 2012-10-17 22:14:51

karol
Archivist
Registered: 2009-05-06
Posts: 25,440

Re: [SOLVED] Remastering archlinux official iso - Disk space problem

Weird.
I'm using the 32-bit image and

$ df -hT
Filesystem     Type      Size  Used Avail Use% Mounted on
...
/dev/loop0     udf       180M  180M     0 100% /mnt/archiso
/dev/loop1     ext4      504M  234M  271M  47% /mnt/root-image-tmp

so there's some free space in there.

Last edited by karol (2012-10-17 22:16:18)

Offline

#6 2012-10-17 22:25:03

lenieco
Member
Registered: 2012-04-27
Posts: 33

Re: [SOLVED] Remastering archlinux official iso - Disk space problem

Yes, initially there's free space, but as I start copying files to the mounted systen, logically the free space decrease.

And because of the available space is determined, in your case 504Mb (don't know why is differente from mine - 701M), I can't copy anymore files when it gets full....

What I want to do is increase the available space for it to be enough to my needs, if I require more than 700M, I supose the iso can be burned in to a DVD....

Offline

#7 2012-10-17 22:42:42

djgera
Developer
From: Buenos Aires - Argentina
Registered: 2008-12-24
Posts: 723
Website

Re: [SOLVED] Remastering archlinux official iso - Disk space problem

hello, do you read my post?

Offline

#8 2012-10-17 23:03:30

lenieco
Member
Registered: 2012-04-27
Posts: 33

Re: [SOLVED] Remastering archlinux official iso - Disk space problem

Sorry, I just read your answer, but right now I don't know how should I "edit aitab", it'll be very useful for me if you can give me more info about your solution...

Gracias...

Offline

#9 2012-10-17 23:06:13

karol
Archivist
Registered: 2009-05-06
Posts: 25,440

Re: [SOLVED] Remastering archlinux official iso - Disk space problem

lenieco wrote:

Sorry, I just read your answer, but right now I don't know how should I "edit aitab", it'll be very useful for me if you can give me more info about your solution...

Gracias...

Not sure what info do you need: https://wiki.archlinux.org/index.php/Archiso#aitab
Can you find the file in question?

Offline

#10 2012-10-17 23:22:02

djgera
Developer
From: Buenos Aires - Argentina
Registered: 2008-12-24
Posts: 723
Website

Re: [SOLVED] Remastering archlinux official iso - Disk space problem

mkdir /tmp/new_iso
cd /tmp/new_iso
bsdtar -x -f ~/archlinux-2012.10.06-dual.iso
echo "var-cache-pacman-pkg /var/cache/pacman/pkg any xz none 0" >> arch/aitab
mksquashfs </PATH/TO/PACKAGE/DIR> arch/any/var-cache-pacman-pkg.sfs -noappend -comp xz
xorriso -as mkisofs \
    -iso-level 3 \
    -full-iso9660-filenames \
    -volid "ARCH_201210" \
    -appid "Arch Linux Live/Rescue CD" \
    -publisher "Arch Linux <http://www.archlinux.org>" \
    -preparer "prepared by mkarchiso" \
    -eltorito-boot isolinux/isolinux.bin \
    -eltorito-catalog isolinux/boot.cat \
    -no-emul-boot -boot-load-size 4 -boot-info-table \
    --efi-boot EFI/archiso/efiboot.img \
    -isohybrid-mbr /tmp/new_iso/isolinux/isohdpfx.bin \
    -output "/tmp/archlinux-2012.10.06-dual-remastered.iso" \
    /tmp/new_iso

Por nada wink

Last edited by djgera (2012-10-18 00:01:23)

Offline

#11 2012-10-17 23:22:42

lenieco
Member
Registered: 2012-04-27
Posts: 33

Re: [SOLVED] Remastering archlinux official iso - Disk space problem

karol wrote:
lenieco wrote:

Sorry, I just read your answer, but right now I don't know how should I "edit aitab", it'll be very useful for me if you can give me more info about your solution...

Gracias...

Not sure what info do you need: https://wiki.archlinux.org/index.php/Archiso#aitab
Can you find the file in question?

yes, but i'm not sure about this field:

<sfs_comp>
SquashFS compression type { gzip | lzo | xz }. A special value of "none" denotes no usage of SquashFS.

how can I know it?

Should I make the squashfs image with something like this?

mksquashfs /home/user/folder_with_packages cache.fs.sfs

Offline

#12 2012-10-17 23:31:51

djgera
Developer
From: Buenos Aires - Argentina
Registered: 2008-12-24
Posts: 723
Website

Re: [SOLVED] Remastering archlinux official iso - Disk space problem

(updated wiki was out-of-date)
Always up-to-date docs is at https://projects.archlinux.org/archiso. … ADME.build

Clarification:
<img>, <mnt>, <arch>, <fs_type> => build time options (mkarchiso) AND runtime options (archiso hook)
<sfs_comp>, <fs_size> => build time options (mkarchiso), ignored at runtime (archiso hook)

Last edited by djgera (2012-10-17 23:33:39)

Offline

#13 2012-10-17 23:38:32

djgera
Developer
From: Buenos Aires - Argentina
Registered: 2008-12-24
Posts: 723
Website

Re: [SOLVED] Remastering archlinux official iso - Disk space problem

PS: should note that in this simple way, /var/cache/pacman/pkg will be read-only. If you want read-write location, should first create an img.fs then compress it with squashfs wink

Offline

#14 2012-10-18 00:02:59

lenieco
Member
Registered: 2012-04-27
Posts: 33

Re: [SOLVED] Remastering archlinux official iso - Disk space problem

djgera wrote:

PS: should note that in this simple way, /var/cache/pacman/pkg will be read-only. If you want read-write location, should first create an img.fs then compress it with squashfs wink

In this case, the fact that this be a read-only location it means that anything can be written to /var/cache/pacman/pkg in the iso.... am I right?

if so, there's no problem because it isn´t supposed to be written during the distro's installation.

But if i need to have a read-write location, should I make this image using something like dd and mkfs? Could you tell me how?....

Gracias por tu ayuda.

Offline

#15 2012-10-18 00:18:49

djgera
Developer
From: Buenos Aires - Argentina
Registered: 2008-12-24
Posts: 723
Website

Re: [SOLVED] Remastering archlinux official iso - Disk space problem

Well in the ISO is not posible, at all, I guess you want to say during runtime...

More steps but simple...

echo "var-cache-pacman-pkg /var/cache/pacman/pkg any xz ext4 0" >> arch/aitab
truncate -s <SIZE>M arch/any/var-cache-pacman-pkg.fs
mkfs.ext4 -O ^has_journal -m 0 -F arch/any/var-cache-pacman-pkg.fs
tune2fs -c 0 -i 0 arch/any/var-cache-pacman-pkg.fs
mkdir arch/any/var-cache-pacman-pkg
mount arch/any/var-cache-pacman-pkg.fs arch/any/var-cache-pacman-pkg
cp -aT </PATH/TO/PACKAGE/DIR>/ arch/any/var-cache-pacman-pkg/
umount arch/any/var-cache-pacman-pkg
rmdir arch/any/var-cache-pacman-pkg
mksquashfs arch/any/var-cache-pacman-pkg.fs arch/any/var-cache-pacman-pkg.fs.sfs -noappend -comp xz
rm arch/any/var-cache-pacman-pkg.fs

Where <SIZE> should be a at least 10% more of "du -sm </PATH/TO/PACKAGE/DIR>", (because filesystem overhead) + your desired free space. This is just an estimation.

Note that last field in aitab is 0, but as said before does not care for runtime purposes.

Last edited by djgera (2012-10-18 00:25:21)

Offline

#16 2012-10-18 00:28:33

lenieco
Member
Registered: 2012-04-27
Posts: 33

Re: [SOLVED] Remastering archlinux official iso - Disk space problem

djgera wrote:

Well in the ISO is not posible, at all, I guess you want to say during runtime...

More steps but simple...

echo "var-cache-pacman-pkg /var/cache/pacman/pkg any xz ext4 0" >> arch/aitab
truncate -s <SIZE>M arch/any/var-cache-pacman-pkg.fs
mkfs.ext4 -O ^has_journal -m 0 -F arch/any/var-cache-pacman-pkg.fs
tune2fs -c 0 -i 0 arch/any/var-cache-pacman-pkg.fs
mkdir arch/any/var-cache-pacman-pkg
mount arch/any/var-cache-pacman-pkg.fs arch/any/var-cache-pacman-pkg
cp -aT </PATH/TO/PACKAGE/DIR>/ arch/any/var-cache-pacman-pkg/
umount arch/any/var-cache-pacman-pkg
rmdir arch/any/var-cache-pacman-pkg
mksquashfs arch/any/var-cache-pacman-pkg.fs arch/any/var-cache-pacman-pkg.fs.sfs -noappend -comp xz
rm arch/any/var-cache-pacman-pkg.fs

Where <SIZE> should be a at least 10% more of "du -sm </PATH/TO/PACKAGE/DIR>", (because filesystem overhead) + your desired free space. This is just an estimation.

Note that last field in aitab is 0, but as said before does not care for runtime purposes.


Ok man. You are great.

Muchas gracias... suerte....

Offline

#17 2012-10-18 00:32:13

djgera
Developer
From: Buenos Aires - Argentina
Registered: 2008-12-24
Posts: 723
Website

Re: [SOLVED] Remastering archlinux official iso - Disk space problem

Genial, por nada. smile

Please mark this as [SOLVED]

Offline

Board footer

Powered by FluxBB