You are not logged in.

#26 2011-09-19 12:50:55

fast_rizwaan
Member
Registered: 2010-04-01
Posts: 65

Re: Archiso archwiki issues

djgera wrote:

Maybe the right tool for that case is AIF wink

Thanks djgera, after looking at aif, I found a way, and that is:

1. include aif on live iso (done using archiso create)
2. add the packages to iso/src/core/pkg as aif needs core.db.tar.gz (created using repo-add core.db.tar.gz *z) there
3. with a few packages it works as expected but when many packages (like I'm just copying 454MB data to ISO image) it fails sad


4. build.sh is complaining that no space left on device, whereas my / (root) has 33G freespace.
5. Please enlighten. How do I increase the disk space for iso, or any other way to achieve archiso+aif+custom packages.

thanks.


http://paste2.org/p/1659243

snippet from above link

cp: writing `work/root-image/src/core/pkg/gnome-utils-3.0.1-2-i686.pkg.tar.xz': No space left on device
cp: failed to extend `work/root-image/src/core/pkg/gnome-utils-3.0.1-2-i686.pkg.tar.xz': No space left on device
cp: writing `work/root-image/src/core/pkg/gnome-user-docs-3.0.4-1-any.pkg.tar.xz': No space left on device
cp: failed to extend `work/root-image/src/core/pkg/gnome-user-docs-3.0.4-1-any.pkg.tar.xz': No space left on device

but df -h shows

Filesystem      Size  Used Avail Use% Mounted on
/dev/sda1        50G   15G   33G  32% /

here's my Build.sh Script file

#!/bin/bash

set -e -u

iso_name=archlinux
iso_label="ARCH_$(date +%Y%m)"
iso_version=$(date +%Y.%m.%d)
install_dir=arch
arch=$(uname -m)
work_dir=work
out_dir=out
verbose="n"

script_path=$(readlink -f ${0%/*})

# Base installation (root-image)
make_basefs() {
    mkarchiso ${verbose} -w "${work_dir}" -D "${install_dir}" -p "base" create
    mkarchiso ${verbose} -w "${work_dir}" -D "${install_dir}" -p "syslinux" create
}

# Additional packages (root-image)
make_packages() {
    mkarchiso ${verbose} -w "${work_dir}" -D "${install_dir}" -p "dialog aif net-tools rp-pppoe" create
}

# Customize installation (root-image)
make_customize_root_image() {
    if [[ ! -e ${work_dir}/build.${FUNCNAME} ]]; then
        cp -af ${script_path}/root-image ${work_dir}

	#Adding set time from hardware clock on launch
	echo "/sbin/hwclock -s" >> ${work_dir}/root-image/etc/rc.local
	#adding working mirror (australia) to mirror list
	echo  "Server = ftp://mirror.aarnet.edu.au/pub/archlinux/\$repo/os/\$arch" >> ${work_dir}/root-image/etc/pacman.d/mirrorlist
        chroot ${work_dir}/root-image  /bin/sed -i "s/#\[testing/\[testing/g" /etc/pacman.conf
        chroot ${work_dir}/root-image  /bin/sed -i "s/#\[community/\[community/g" /etc/pacman.conf
        chroot ${work_dir}/root-image  /bin/sed -i "s/#Include/Include/g" /etc/pacman.conf
        chroot ${work_dir}/root-image  /bin/sed -i "s/DAEMONS=/DAEMONS=\(hwclock syslog-ng network netfs crond dbus networkmanager bluetooth \)\n#DEMONS/g" /etc/rc.conf
 	chroot ${work_dir}/root-image /usr/sbin/locale-gen
        : > ${work_dir}/build.${FUNCNAME}
    fi
}


# Copy mkinitcpio archiso hooks (root-image)
make_setup_mkinitcpio() {
   if [[ ! -e ${work_dir}/build.${FUNCNAME} ]]; then
        cp /lib/initcpio/hooks/archiso ${work_dir}/root-image/lib/initcpio/hooks
        cp /lib/initcpio/install/archiso ${work_dir}/root-image/lib/initcpio/install
        : > ${work_dir}/build.${FUNCNAME}
   fi
}

# Prepare ${install_dir}/boot/
make_boot() {
    if [[ ! -e ${work_dir}/build.${FUNCNAME} ]]; then
        mkdir -p ${work_dir}/iso/${install_dir}/boot/${arch}
        mkinitcpio \
            -c ${script_path}/mkinitcpio.conf \
            -b ${work_dir}/root-image \
            -k /boot/vmlinuz-linux \
            -g ${work_dir}/iso/${install_dir}/boot/${arch}/archiso.img
        cp ${work_dir}/root-image/boot/vmlinuz-linux ${work_dir}/iso/${install_dir}/boot/${arch}/vmlinuz
        : > ${work_dir}/build.${FUNCNAME}
    fi
}

# Prepare /${install_dir}/boot/syslinux
make_syslinux() {
    if [[ ! -e ${work_dir}/build.${FUNCNAME} ]]; then
        mkdir -p ${work_dir}/iso/${install_dir}/boot/syslinux
        sed "s|%ARCHISO_LABEL%|${iso_label}|g;
            s|%INSTALL_DIR%|${install_dir}|g;
            s|%ARCH%|${arch}|g" ${script_path}/syslinux/syslinux.cfg > ${work_dir}/iso/${install_dir}/boot/syslinux/syslinux.cfg
        cp ${work_dir}/root-image/usr/lib/syslinux/menu.c32 ${work_dir}/iso/${install_dir}/boot/syslinux/
        : > ${work_dir}/build.${FUNCNAME}
    fi
}

# Prepare /isolinux
make_isolinux() {
    if [[ ! -e ${work_dir}/build.${FUNCNAME} ]]; then
        mkdir -p ${work_dir}/iso/isolinux
        sed "s|%INSTALL_DIR%|${install_dir}|g" ${script_path}/isolinux/isolinux.cfg > ${work_dir}/iso/isolinux/isolinux.cfg
        cp ${work_dir}/root-image/usr/lib/syslinux/isolinux.bin ${work_dir}/iso/isolinux/
        cp ${work_dir}/root-image/usr/lib/syslinux/isohdpfx.bin ${work_dir}/iso/isolinux/
        : > ${work_dir}/build.${FUNCNAME}
    fi
}

# Process aitab
make_aitab() {
    if [[ ! -e ${work_dir}/build.${FUNCNAME} ]]; then
        sed "s|%ARCH%|${arch}|g" ${script_path}/aitab > ${work_dir}/iso/${install_dir}/aitab
        : > ${work_dir}/build.${FUNCNAME}
    fi
}

# Build all filesystem images specified in aitab (.fs .fs.sfs .sfs)
make_prepare() {
    mkarchiso ${verbose} -w "${work_dir}" -D "${install_dir}" prepare
}

# Build ISO
make_iso() {
    mkarchiso ${verbose} -w "${work_dir}" -D "${install_dir}" checksum
    mkarchiso ${verbose} -w "${work_dir}" -D "${install_dir}" -L "${iso_label}" -o "${out_dir}" iso "${iso_name}-${iso_version}-${arch}.iso"
}

if [[ $verbose == "y" ]]; then
    verbose="-v"
else
    verbose=""
fi

make_basefs
make_packages
make_customize_root_image
make_setup_mkinitcpio
make_boot
make_syslinux
make_isolinux
make_aitab
make_prepare
make_iso

Last edited by fast_rizwaan (2011-09-19 13:40:53)

Offline

#27 2011-09-19 14:41:11

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

Re: Archiso archwiki issues

I guess you are working on /tmp

Offline

#28 2011-09-19 15:34:43

fast_rizwaan
Member
Registered: 2010-04-01
Posts: 65

Re: Archiso archwiki issues

djgera wrote:

I guess you are working on /tmp

yes,  these are the commands I run in shell 1 and copy build.sh and pkgs from shell2 (cp /var/cache/pacman/pkg /tmp/chroot/tmp/baseline/root-image/...

mkarchroot /tmp/chroot base
make -C archiso/archiso DESTDIR=/tmp/chroot install
mkarchroot -r bash /tmp/chroot
mknod /dev/loop0 b 7 0
pacman -S devtools libisoburn squashfs-tools --noconfirm
cp -r /usr/share/archiso/configs/baseline /tmp
cd /tmp/baseline
./build.sh

Where else should I work instead of /tmp?

Last edited by fast_rizwaan (2011-09-19 15:37:28)

Offline

#29 2011-09-19 15:38:30

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

Re: Archiso archwiki issues

and FS from / is other from /tmp ...

Offline

#30 2011-09-19 16:18:25

fast_rizwaan
Member
Registered: 2010-04-01
Posts: 65

Re: Archiso archwiki issues

djgera wrote:

and FS from / is other from /tmp ...

no, I have only one / partition, no boot, no separate tmp. So, /tmp is part of 50G / (root) partition.

And there are 2 /tmp(s) in use here,

1st is mkarchboot /tmp/...
2nd is chrooted /tmp/chroot/tmp/baseline

I'm confused. Please elaborate. Thanks.


EDIT:

OK, after changing /tmp with /opt in all the commands, I got the iso working. thanks djgera.

Your replies are like Zen masters smile

Last edited by fast_rizwaan (2011-09-19 17:25:35)

Offline

#31 2011-09-19 22:01:30

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

Re: Archiso archwiki issues

Haha tongue Good.

Are you sure that /tmp is not tmpfs? Otherwise that is weird.

Offline

#32 2011-09-20 09:34:23

fast_rizwaan
Member
Registered: 2010-04-01
Posts: 65

Re: Archiso archwiki issues

This post is for the friends who are interested in making their own custom archlinux iso installer using archiso and aif. I'm using testing repo for latest drivers and updated packages.

Requirement:
0. Archlinux
1. build5.sh (to create the custom iso, should tinker here, for adding, customizing)
2. two xterms to run the commands
3. A little patience

BUGS/ ISSUES:
0. packages are not selected by default
1. grub/syslinux fails to configure menu.lst/ syslinux.cfg during bootloader install;
though we can manually copy menu.lst to /mnt/boot/grub or /boot/syslinux/syslinux.cfg to /mnt/boot/syslinux/syslinux.cfg and edit the entries there before pressing enter to bootloader install;

(1)build5.sh (install only, no live environment) which can install packages using aif (packages are listed but not selected). some se

#!/bin/bash

set -e -u

iso_name=archlinux
iso_label="ARCH_$(date +%Y%m)"
iso_version=$(date +%Y.%m.%d)
install_dir=arch
arch=$(uname -m)
work_dir=work
out_dir=out
verbose="n"

script_path=$(readlink -f ${0%/*})

# Base installation (root-image)
make_basefs() {
    mkarchiso ${verbose} -w "${work_dir}" -D "${install_dir}" -p "base" create
    mkarchiso ${verbose} -w "${work_dir}" -D "${install_dir}" -p "memtest86+ syslinux mkinitcpio-nfs-utils nbd" create
}

# Additional packages (root-image)
make_packages() {
    mkarchiso ${verbose} -w "${work_dir}" -D "${install_dir}" -p "dialog aif net-tools rp-pppoe" create
}

# Customize installation (root-image)
make_customize_root_image() {
    if [[ ! -e ${work_dir}/build.${FUNCNAME} ]]; then
        cp -af ${script_path}/root-image ${work_dir}

        #chroot ${work_dir}/root-image /usr/sbin/useradd -c "Arch Linux User" -m -p "" -g users -G "audio,video,disk,optical,storage,uucp,wheel" arch
	

	#Adding set time from hardware clock on launch
	echo "/sbin/hwclock -s" >> ${work_dir}/root-image/etc/rc.local
	#adding working mirror (australia) to mirror list
	echo  "Server = ftp://mirror.aarnet.edu.au/pub/archlinux/\$repo/os/\$arch" >> ${work_dir}/root-image/etc/pacman.d/mirrorlist
        chroot ${work_dir}/root-image  /bin/sed -i "s/#\[testing/\[testing/g" /etc/pacman.conf
        chroot ${work_dir}/root-image  /bin/sed -i "s/#\[community/\[community/g" /etc/pacman.conf
        chroot ${work_dir}/root-image  /bin/sed -i "s/#Include/Include/g" /etc/pacman.conf
        chroot ${work_dir}/root-image  /bin/sed -i "s/DAEMONS=/DAEMONS=\(hwclock syslog-ng network netfs crond dbus networkmanager bluetooth \)\n#DEMONS/g" /etc/rc.conf
 	chroot ${work_dir}/root-image /usr/sbin/locale-gen
        #chroot ${work_dir}/root-image /bin/bash -c "echo "root:root" | chpasswd"
        #chroot ${work_dir}/root-image /bin/bash -c "echo "arch:arch" | chpasswd"
        : > ${work_dir}/build.${FUNCNAME}
    fi
}

# Copy mkinitcpio archiso hooks (root-image)
make_setup_mkinitcpio() {
   if [[ ! -e ${work_dir}/build.${FUNCNAME} ]]; then
        cp /lib/initcpio/hooks/archiso ${work_dir}/root-image/lib/initcpio/hooks
        cp /lib/initcpio/install/archiso ${work_dir}/root-image/lib/initcpio/install
        : > ${work_dir}/build.${FUNCNAME}
   fi
}

# Prepare ${install_dir}/boot/
make_boot() {
    if [[ ! -e ${work_dir}/build.${FUNCNAME} ]]; then
        mkdir -p ${work_dir}/iso/${install_dir}/boot/${arch}
        mkinitcpio \
            -c ${script_path}/mkinitcpio.conf \
            -b ${work_dir}/root-image \
            -k /boot/vmlinuz-linux \
            -g ${work_dir}/iso/${install_dir}/boot/${arch}/archiso.img
        cp ${work_dir}/root-image/boot/vmlinuz-linux ${work_dir}/iso/${install_dir}/boot/${arch}/vmlinuz
        : > ${work_dir}/build.${FUNCNAME}
    fi
}

# Prepare /${install_dir}/boot/syslinux
make_syslinux() {
    if [[ ! -e ${work_dir}/build.${FUNCNAME} ]]; then
        mkdir -p ${work_dir}/iso/${install_dir}/boot/syslinux
        sed "s|%ARCHISO_LABEL%|${iso_label}|g;
            s|%INSTALL_DIR%|${install_dir}|g;
            s|%ARCH%|${arch}|g" ${script_path}/syslinux/syslinux.cfg > ${work_dir}/iso/${install_dir}/boot/syslinux/syslinux.cfg
        cp ${work_dir}/root-image/usr/lib/syslinux/menu.c32 ${work_dir}/iso/${install_dir}/boot/syslinux/
        : > ${work_dir}/build.${FUNCNAME}
    fi
}

# Prepare /isolinux
make_isolinux() {
    if [[ ! -e ${work_dir}/build.${FUNCNAME} ]]; then
        mkdir -p ${work_dir}/iso/isolinux
        sed "s|%INSTALL_DIR%|${install_dir}|g" ${script_path}/isolinux/isolinux.cfg > ${work_dir}/iso/isolinux/isolinux.cfg
        cp ${work_dir}/root-image/usr/lib/syslinux/isolinux.bin ${work_dir}/iso/isolinux/
        cp ${work_dir}/root-image/usr/lib/syslinux/isohdpfx.bin ${work_dir}/iso/isolinux/
        : > ${work_dir}/build.${FUNCNAME}
    fi
}

# Process aitab
make_aitab() {
    if [[ ! -e ${work_dir}/build.${FUNCNAME} ]]; then
        sed "s|%ARCH%|${arch}|g" ${script_path}/aitab > ${work_dir}/iso/${install_dir}/aitab
        : > ${work_dir}/build.${FUNCNAME}
    fi
}

# Build all filesystem images specified in aitab (.fs .fs.sfs .sfs)
make_prepare() {
    mkarchiso ${verbose} -w "${work_dir}" -D "${install_dir}" prepare
}

# Build ISO
make_iso() {
    mkarchiso ${verbose} -w "${work_dir}" -D "${install_dir}" checksum
    mkarchiso ${verbose} -w "${work_dir}" -D "${install_dir}" -L "${iso_label}" -o "${out_dir}" iso "${iso_name}-${iso_version}-${arch}.iso"
}

if [[ $verbose == "y" ]]; then
    verbose="-v"
else
    verbose=""
fi

make_basefs
make_packages
make_customize_root_image
make_setup_mkinitcpio
make_boot
make_syslinux
make_isolinux
make_aitab
make_prepare
make_iso

Procedure: (all commands to be run as root user) and need 2 virtual terminals, on 1st terminal commands from archiso archwiki;

pacman -S devtools --needed
pacman -S git make --needed
mkarchroot /opt/chroot base
git clone git://projects.archlinux.org/archiso.git
make -C archiso/archiso DESTDIR=/opt/chroot install
mkarchroot -r bash /opt/chroot
mknod /dev/loop0 b 7 0
pacman -S devtools libisoburn squashfs-tools --noconfirm
cp -r /usr/share/archiso/configs/baseline /opt
cd /opt/baseline

after cd /opt/baseline, switch to 2nd terminal,

mkdir -p /opt/chroot/opt/baseline/root-image/src/core/pkg
pacman -Sw $(pacman -Sql core) --noconfirm; #getting all the core packages a must
pacman -Sw xorg xorg-xinit xterm net-tools gnome nouveau-dri intel-dri ati-dri xf86-video-nouveau xf86-video-intel xorg xorg-drivers xorg-server --noconfirm; #basic gnome xorg
cp /var/cache/pacman/pkg/* /opt/chroot/opt/baseline/root-image/src/core/pkg; #pacman/pkg should have all the packages we want in install iso
cd /opt/chroot/opt/baseline/root-image/src/core/pkg
repo-add core.db.tar.gz *z ; #creates core.db.tar.gz which also includes other repos like xorg
cp ~/build5.sh /opt/chroot/opt/baseline/build.sh; #download the above build5.sh and save to /root 
mkdir -p /opt/chroot/opt/baseline/root-image/usr/bin; 
echo "aif -p interactive" >  /opt/chroot/opt/baseline/root-image/usr/bin/setup; #creating a command script
chmod +rx /opt/chroot/opt/baseline/root-image/usr/bin/setup; #created shortcut to aif -p interactive on installer cd

All done, let's switch back to 1st terminal

./build.sh

this will result into an archlinux-[somenumbers].iso at /opt/chroot/opt/baseline/out/

to test the iso

qemu  /opt/chroot/opt/baseline/out/archlinux-*.iso;

Last edited by fast_rizwaan (2011-11-14 20:47:03)

Offline

#33 2011-09-20 10:02:51

fast_rizwaan
Member
Registered: 2010-04-01
Posts: 65

Re: Archiso archwiki issues

djgera wrote:

Haha tongue Good.

djgera, guide me for 2 small things in aif config:

1. Setting default target packages in AIF interactive procedure;

I tried putting this

TARGET_GROUPS='base gnome'
TARGET_PACKAGES_EXCLUDE='reiserfsprogs'
TARGET_PACKAGES='openssh e2fsprogs cryptsetup lvm2 xfsprogs xterm xorg-xinit nouveau-dri xf86-video-nouveau'

into

/usr/lib/aif/core/procedures/interactive

no use; aif -p interactive doesn't enable the "target packages" in package selection.

I want to enable some packages along with the dependencies by default.

2. the "install bootloader" does not show "review grub configuration file before installing grub" or "review syslinux configuration file before installing syslinux" (as in official archlinux install cd installer)

aif in the custom installer simply installs grub/syslinux without adding '/root' 'kernel' 'initrd' etc. entries to to menu.lst or syslinux.cfg

I can make a script  but I want the installer to be similar to default archlinux installer.

My wish is to make archlinux popular and accessible to non-techies. My friend has been asking, "I want to install Linux on other friends systems," but net-install (pppoe, wvdial, dhcpcd), dependencies (xorg xorg-xinit, net-tools), remember packages names, is a bit daunting for him and other non-geeks.

Learning to use/operate anything itself is time consuming spending time to learn how to install is a bit discouraging.

So, I want to make an installer which selects default funtional (packages with dependencies) gnome/xfce/kde/openbox/lxde, and installs them on his/her system without having to have a steep learning curve.

I just want a little guidance for the selected target packages, and grub/syslinux.

Thanks.

Offline

#34 2011-09-20 14:07:22

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

Re: Archiso archwiki issues

Oh sorry, I can not help in AIF, I never used it for other purpose than quick testing interactive mode before "snapshot releases".

Just open another thread or ask to Dieter. wink

Offline

#35 2011-09-20 15:07:25

fast_rizwaan
Member
Registered: 2010-04-01
Posts: 65

Re: Archiso archwiki issues

ok thanks djgera, you've been very kind.

Offline

Board footer

Powered by FluxBB