Commit 8fa4f8de authored by Gerardo Exequiel Pozzi's avatar Gerardo Exequiel Pozzi
Browse files

[archiso] Update for mkinitcpio >= 0.7


Signed-off-by: default avatarGerardo Exequiel Pozzi <vmlinuz386@yahoo.com.ar>
parent 3101e8d9
......@@ -185,7 +185,7 @@ Note: These steps should be done with 64 bits support.
[host64] # linux32 mkarchroot /tmp/chroot32 base
[host64] # linux32 mkarchroot -r bash /tmp/chroot32
[chroot32] # echo 'Server = MIRROR/archlinux/$repo/os/$arch' >> /etc/pacman.d/mirrorlist
[chroot32] # pacman -S devtools squashfs-tools syslinux cdrkit mkinitcpio-nfs-utils nbd
[chroot32] # pacman -S devtools squashfs-tools syslinux cdrkit
[chroot32] # exit
* Prepare a 64 bits chroot enviroment.
......@@ -193,7 +193,7 @@ Note: These steps should be done with 64 bits support.
[host64] # mkarchroot /tmp/chroot64 base
[host64] # mkarchroot -r bash /tmp/chroot64
[chroot64] # echo 'Server = MIRROR/archlinux/$repo/os/$arch' >> /etc/pacman.d/mirrorlist
[chroot64] # pacman -S devtools squashfs-tools syslinux cdrkit mkinitcpio-nfs-utils nbd
[chroot64] # pacman -S devtools squashfs-tools syslinux cdrkit
[chroot64] # exit
* Install archiso on both chroots.
......
install ()
build ()
{
MODULES="cdrom ide-cd_mod ide-core ide-generic loop dm-mod dm-snapshot squashfs isofs $(all_modules '/kernel/fs' | grep -v "nls")"
MODULES="${MODULES} $(checked_modules "/usb/host" | grep -ve "_cs" -e "sl811_hcd" -e "isp116x_hcd")"
......
# vim: set ft=sh:
install ()
build ()
{
MODULES=""
......
# vim: set ft=sh:
install ()
build ()
{
MODULES="nbd"
MODULES="${MODULES} $(comm -2 -3 <(checked_modules "/drivers/net/" | sort) \
......
......@@ -10,13 +10,6 @@ arch=$(uname -m)
work_dir=work
verbose="n"
# This function can be called after make_basefs()
get_linux_ver() {
local ALL_kver
eval $(grep ^ALL_kver ${work_dir}/root-image/etc/mkinitcpio.d/kernel26.kver)
echo ${ALL_kver}
}
# Base installation (root-image)
make_basefs() {
mkarchiso ${verbose} -D "${install_dir}" -p "base" create "${work_dir}"
......@@ -31,12 +24,25 @@ make_customize_root_image() {
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 ./mkinitcpio.conf \
-b ${work_dir}/root-image \
-k /boot/vmlinuz26 \
-g ${work_dir}/iso/${install_dir}/boot/${arch}/archiso.img
cp ${work_dir}/root-image/boot/vmlinuz26 ${work_dir}/iso/${install_dir}/boot/${arch}
mkinitcpio -c ./mkinitcpio.conf -b ${work_dir}/root-image -k $(get_linux_ver) -g ${work_dir}/iso/${install_dir}/boot/${arch}/archiso.img
: > ${work_dir}/build.${FUNCNAME}
fi
}
......@@ -89,6 +95,7 @@ fi
make_basefs
make_customize_root_image
make_setup_mkinitcpio
make_boot
make_syslinux
make_isolinux
......
......@@ -10,17 +10,10 @@ arch=$(uname -m)
work_dir=work
verbose="n"
# This function can be called after make_basefs()
get_linux_ver() {
local ALL_kver
eval $(grep ^ALL_kver ${work_dir}/root-image/etc/mkinitcpio.d/kernel26.kver)
echo ${ALL_kver}
}
# Base installation (root-image)
make_basefs() {
mkarchiso ${verbose} -D "${install_dir}" -p "base" create "${work_dir}"
mkarchiso ${verbose} -D "${install_dir}" -p "memtest86+ syslinux" create "${work_dir}"
mkarchiso ${verbose} -D "${install_dir}" -p "memtest86+ syslinux mkinitcpio-nfs-utils nbd" create "${work_dir}"
}
# Additional packages (root-image)
......@@ -41,14 +34,30 @@ make_customize_root_image() {
fi
}
# Copy mkinitcpio archiso hooks (root-image)
make_setup_mkinitcpio() {
if [[ ! -e ${work_dir}/build.${FUNCNAME} ]]; then
local _hook
for _hook in archiso archiso_pxe_nbd archiso_loop_mnt; do
cp /lib/initcpio/hooks/${_hook} ${work_dir}/root-image/lib/initcpio/hooks
cp /lib/initcpio/install/${_hook} ${work_dir}/root-image/lib/initcpio/install
done
: > ${work_dir}/build.${FUNCNAME}
fi
}
# Prepare ${install_dir}/boot/
make_boot() {
if [[ ! -e ${work_dir}/build.${FUNCNAME} ]]; then
local _src=${work_dir}/root-image
local _dst_boot=${work_dir}/iso/${install_dir}/boot
mkdir -p ${_dst_boot}/${arch}
cp ${_src}/boot/vmlinuz26 ${_dst_boot}/${arch}
mkinitcpio -c ./mkinitcpio.conf -b ${_src} -k $(get_linux_ver) -g ${_dst_boot}/${arch}/archiso.img
mkinitcpio \
-c ./mkinitcpio.conf \
-b ${_src} \
-k /boot/vmlinuz26 \
-g ${_dst_boot}/${arch}/archiso.img
mv ${_src}/boot/vmlinuz26 ${_dst_boot}/${arch}
cp ${_src}/boot/memtest86+/memtest.bin ${_dst_boot}/memtest
cp ${_src}/usr/share/licenses/common/GPL2/license.txt ${_dst_boot}/memtest.COPYING
: > ${work_dir}/build.${FUNCNAME}
......@@ -71,7 +80,7 @@ make_syslinux() {
cp ${_src_syslinux}/memdisk ${_dst_syslinux}
mkdir -p ${_dst_syslinux}/hdt
wget -O - http://pciids.sourceforge.net/v2.2/pci.ids | gzip -9 > ${_dst_syslinux}/hdt/pciids.gz
cat ${work_dir}/root-image/lib/modules/$(get_linux_ver)/modules.alias | gzip -9 > ${_dst_syslinux}/hdt/modalias.gz
cat ${work_dir}/root-image/lib/modules/*-ARCH/modules.alias | gzip -9 > ${_dst_syslinux}/hdt/modalias.gz
: > ${work_dir}/build.${FUNCNAME}
fi
}
......@@ -233,6 +242,7 @@ make_common_single() {
make_basefs
make_packages
make_customize_root_image
make_setup_mkinitcpio
make_boot
make_syslinux
make_isolinux
......
......@@ -17,7 +17,6 @@ ipw2100-fw
ipw2200-fw
lftp
lilo
nbd
netcfg
nfs-utils
nilfs-utils
......
......@@ -17,7 +17,6 @@ ipw2100-fw
ipw2200-fw
lftp
lilo
nbd
netcfg
nfs-utils
nilfs-utils
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment