summaryrefslogtreecommitdiff
path: root/configs/releng/build.sh
diff options
context:
space:
mode:
authorGerardo Exequiel Pozzi <vmlinuz386@yahoo.com.ar>2011-11-28 10:35:05 -0300
committerGerardo Exequiel Pozzi <vmlinuz386@yahoo.com.ar>2011-11-28 10:35:05 -0300
commit40965461a4a730881a153432e66521734b1b965c (patch)
tree094cd480e1fae939d70482566ea659df1eceb0b5 /configs/releng/build.sh
parent334db092b52e78a68d012ce2fa453ec243943c64 (diff)
downloadarchiso32-40965461a4a730881a153432e66521734b1b965c.tar.xz
[configs/*] chroot to root-image for initramfs build
Avoid issues with -b BASEDIR (*). We became independent of the mkinitcpio version of the build environment. (*) For example of a recent issue: http://mailman.archlinux.org/pipermail/arch-projects/2011-November/002202.html http://mailman.archlinux.org/pipermail/arch-projects/2011-November/002205.html Signed-off-by: Gerardo Exequiel Pozzi <vmlinuz386@yahoo.com.ar>
Diffstat (limited to 'configs/releng/build.sh')
-rwxr-xr-xconfigs/releng/build.sh41
1 files changed, 20 insertions, 21 deletions
diff --git a/configs/releng/build.sh b/configs/releng/build.sh
index ba5cd2a..0859a17 100755
--- a/configs/releng/build.sh
+++ b/configs/releng/build.sh
@@ -24,21 +24,6 @@ make_packages() {
mkarchiso ${verbose} -w "${work_dir}" -D "${install_dir}" -p "$(grep -v ^# ${script_path}/packages.${arch})" create
}
-# Customize installation (root-image)
-make_customize_root_image() {
- if [[ ! -e ${work_dir}/build.${FUNCNAME} ]]; then
- cp -af ${script_path}/root-image ${work_dir}
- chmod 750 ${work_dir}/root-image/etc/sudoers.d
- chmod 440 ${work_dir}/root-image/etc/sudoers.d/g_wheel
- mkdir -p ${work_dir}/root-image/etc/pacman.d
- wget -O ${work_dir}/root-image/etc/pacman.d/mirrorlist http://www.archlinux.org/mirrorlist/all/
- sed -i "s/#Server/Server/g" ${work_dir}/root-image/etc/pacman.d/mirrorlist
- chroot ${work_dir}/root-image /usr/sbin/locale-gen
- chroot ${work_dir}/root-image /usr/sbin/useradd -m -p "" -g users -G "audio,disk,optical,wheel" arch
- : > ${work_dir}/build.${FUNCNAME}
- fi
-}
-
# Copy mkinitcpio archiso hooks (root-image)
make_setup_mkinitcpio() {
if [[ ! -e ${work_dir}/build.${FUNCNAME} ]]; then
@@ -49,6 +34,7 @@ make_setup_mkinitcpio() {
done
cp /lib/initcpio/archiso_shutdown ${work_dir}/root-image/lib/initcpio
cp /lib/initcpio/archiso_pxe_nbd ${work_dir}/root-image/lib/initcpio
+ cp ${script_path}/mkinitcpio.conf ${work_dir}/root-image/etc/mkinitcpio-archiso.conf
: > ${work_dir}/build.${FUNCNAME}
fi
}
@@ -59,11 +45,8 @@ make_boot() {
local _src=${work_dir}/root-image
local _dst_boot=${work_dir}/iso/${install_dir}/boot
mkdir -p ${_dst_boot}/${arch}
- mkinitcpio \
- -c ${script_path}/mkinitcpio.conf \
- -b ${_src} \
- -k /boot/vmlinuz-linux \
- -g ${_dst_boot}/${arch}/archiso.img
+ mkarchroot -n -r "mkinitcpio -c /etc/mkinitcpio-archiso.conf -k /boot/vmlinuz-linux -g /boot/archiso.img" ${_src}
+ mv ${_src}/boot/archiso.img ${_dst_boot}/${arch}/archiso.img
mv ${_src}/boot/vmlinuz-linux ${_dst_boot}/${arch}/vmlinuz
cp ${_src}/boot/memtest86+/memtest.bin ${_dst_boot}/memtest
cp ${_src}/usr/share/licenses/common/GPL2/license.txt ${_dst_boot}/memtest.COPYING
@@ -103,6 +86,22 @@ make_isolinux() {
fi
}
+# Customize installation (root-image)
+# NOTE: mkarchroot should not be executed after this function is executed, otherwise will overwrites some custom files.
+make_customize_root_image() {
+ if [[ ! -e ${work_dir}/build.${FUNCNAME} ]]; then
+ cp -af ${script_path}/root-image ${work_dir}
+ chmod 750 ${work_dir}/root-image/etc/sudoers.d
+ chmod 440 ${work_dir}/root-image/etc/sudoers.d/g_wheel
+ mkdir -p ${work_dir}/root-image/etc/pacman.d
+ wget -O ${work_dir}/root-image/etc/pacman.d/mirrorlist http://www.archlinux.org/mirrorlist/all/
+ sed -i "s/#Server/Server/g" ${work_dir}/root-image/etc/pacman.d/mirrorlist
+ chroot ${work_dir}/root-image /usr/sbin/locale-gen
+ chroot ${work_dir}/root-image /usr/sbin/useradd -m -p "" -g users -G "audio,disk,optical,wheel" arch
+ : > ${work_dir}/build.${FUNCNAME}
+ fi
+}
+
# Split out /lib/modules from root-image (makes more "dual-iso" friendly)
make_lib_modules() {
if [[ ! -e ${work_dir}/build.${FUNCNAME} ]]; then
@@ -247,11 +246,11 @@ clean_dual ()
make_common_single() {
make_basefs
make_packages
- make_customize_root_image
make_setup_mkinitcpio
make_boot
make_syslinux
make_isolinux
+ make_customize_root_image
make_lib_modules
make_usr_share
make_aitab $1