Differenciations de build pour différentes plateformes
This commit is contained in:
parent
01714b8d71
commit
b20ee547c6
@ -103,7 +103,7 @@ function clean()
|
|||||||
warning "${BUILD_PATH} does not exists"
|
warning "${BUILD_PATH} does not exists"
|
||||||
fi
|
fi
|
||||||
# removing old image
|
# removing old image
|
||||||
if [ -e "${IMAGE}" ]; then
|
if [ -e "${INSTALL_PATH}/${IMAGE}" ]; then
|
||||||
info "Removing ${IMAGE}"
|
info "Removing ${IMAGE}"
|
||||||
/bin/rm -f "${INSTALL_PATH}/${IMAGE}"
|
/bin/rm -f "${INSTALL_PATH}/${IMAGE}"
|
||||||
else
|
else
|
||||||
@ -476,9 +476,11 @@ copyingsystem()
|
|||||||
#echo -e "proc /proc proc defaults 0 0\nUUID=${BOOT_UUID} /mnt/arm_boot vfat defaults 0 0\nUUID=${ROOT_UUID} / ext4 defaults 0 0" > "${BUILD_PATH}/etc/fstab"
|
#echo -e "proc /proc proc defaults 0 0\nUUID=${BOOT_UUID} /mnt/arm_boot vfat defaults 0 0\nUUID=${ROOT_UUID} / ext4 defaults 0 0" > "${BUILD_PATH}/etc/fstab"
|
||||||
echo -e "proc\t/proc\tproc\tdefaults\t0\t0\nUUID=${BOOT_UUID}\t/mnt/arm_boot\t${BOOTFS}\tdefaults\t0\t0\nUUID=${ROOT_UUID}\t/\text4\tdefaults\t0\t0" > "${BUILD_PATH}/etc/fstab"
|
echo -e "proc\t/proc\tproc\tdefaults\t0\t0\nUUID=${BOOT_UUID}\t/mnt/arm_boot\t${BOOTFS}\tdefaults\t0\t0\nUUID=${ROOT_UUID}\t/\text4\tdefaults\t0\t0" > "${BUILD_PATH}/etc/fstab"
|
||||||
|
|
||||||
|
|
||||||
|
if [ -e "${CONFIG_PATH}/extlinux.conf" ]; then
|
||||||
if [ ! -d "${BUILD_PATH}/boot/extlinux" ]; then
|
if [ ! -d "${BUILD_PATH}/boot/extlinux" ]; then
|
||||||
info "making /boot/extlinux/extlinux.conf"
|
info "making /boot/extlinux/extlinux.conf"
|
||||||
rm -rf "${BUILD_PATH}/boot/extlinux"
|
/bin/rm -rf "${BUILD_PATH}/boot/extlinux"
|
||||||
mkdir -p "${BUILD_PATH}/boot/extlinux"
|
mkdir -p "${BUILD_PATH}/boot/extlinux"
|
||||||
fi
|
fi
|
||||||
if [ ! -f "${BUILD_PATH}/boot/extlinux/extlinux.conf" ]; then
|
if [ ! -f "${BUILD_PATH}/boot/extlinux/extlinux.conf" ]; then
|
||||||
@ -486,8 +488,20 @@ copyingsystem()
|
|||||||
KERNEL_ID=$(basename ${BUILD_PATH}/usr/lib/linux-*)
|
KERNEL_ID=$(basename ${BUILD_PATH}/usr/lib/linux-*)
|
||||||
sed -i -e s/\<FDTDIR\>/${KERNEL_ID}/g "${BUILD_PATH}/boot/extlinux/extlinux.conf"
|
sed -i -e s/\<FDTDIR\>/${KERNEL_ID}/g "${BUILD_PATH}/boot/extlinux/extlinux.conf"
|
||||||
fi
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
|
||||||
|
/bin/rm -f "${BUILD_PATH}/second_stage_install.sh"
|
||||||
|
|
||||||
|
ARM_BOOT="${BUILD_PATH}/mnt/arm_boot"
|
||||||
|
if ! [ -d "${ARM_BOOT}" ]; then
|
||||||
|
mkdir -p "${ARM_BOOT}"
|
||||||
|
fi
|
||||||
|
info "copying Mageia image to root partition"
|
||||||
|
/bin/rsync -rlptogDH --exclude "${ARM_BOOT}/" --exclude "qemu-arm-static*" "${BUILD_PATH}/" "${ROOT}/"
|
||||||
|
/bin/rsync -rlptogDH "${ARM_BOOT}/" "${BOOT}/"
|
||||||
|
/bin/rsync -rlptogDH "${BUILD_PATH}/boot/" "${BOOT}/"
|
||||||
|
|
||||||
copyingCustomSystem
|
copyingCustomSystem
|
||||||
if [ ${?} -ne 0 ]; then
|
if [ ${?} -ne 0 ]; then
|
||||||
error "line ${LINENO} error in the process ${CONFIG_PATH}/specialFunctions.sh ."
|
error "line ${LINENO} error in the process ${CONFIG_PATH}/specialFunctions.sh ."
|
||||||
@ -505,6 +519,10 @@ copyingsystem()
|
|||||||
copyingcommon
|
copyingcommon
|
||||||
# Syncing devices before unmounting
|
# Syncing devices before unmounting
|
||||||
/usr/bin/sync
|
/usr/bin/sync
|
||||||
|
|
||||||
|
# warning "Inspect files and press a touch to continue."
|
||||||
|
# read -n1 GARBAGE
|
||||||
|
|
||||||
/usr/bin/umount "${BOOT}" "${ROOT}"
|
/usr/bin/umount "${BOOT}" "${ROOT}"
|
||||||
if [ ${?} -eq 0 ]; then
|
if [ ${?} -eq 0 ]; then
|
||||||
/bin/rmdir "${BOOT}" "${ROOT}"
|
/bin/rmdir "${BOOT}" "${ROOT}"
|
||||||
@ -518,6 +536,16 @@ copyingsystem()
|
|||||||
error "line ${LINENO} warning : error unmounting ${DEVICE} "
|
error "line ${LINENO} warning : error unmounting ${DEVICE} "
|
||||||
exit ${ERR_1}
|
exit ${ERR_1}
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
#Add : seems that there is still the looped device attached.
|
||||||
|
#warning "try to detach looped device"
|
||||||
|
#Previous device
|
||||||
|
#info "${DEVICE}"
|
||||||
|
#Retrieve the new device number :
|
||||||
|
#DEVICE=$(/sbin/losetup -f --show "${INSTALL_PATH}/${IMAGE}")
|
||||||
|
#info "device to detach ${DEVICE}"
|
||||||
|
#/sbin/losetup -d "${DEVICE}"
|
||||||
|
|
||||||
warning "You can now burn the image ( ${INSTALL_PATH}/${IMAGE} ) on SD card"
|
warning "You can now burn the image ( ${INSTALL_PATH}/${IMAGE} ) on SD card"
|
||||||
return 0
|
return 0
|
||||||
}
|
}
|
||||||
@ -764,7 +792,7 @@ info "Option: "${OPT}
|
|||||||
IMAGE="Mageia-${MAGEIA_VERSION}-${TARGET}${TARGET_VERSION}.img"
|
IMAGE="Mageia-${MAGEIA_VERSION}-${TARGET}${TARGET_VERSION}.img"
|
||||||
BOOT="/mnt/boot"
|
BOOT="/mnt/boot"
|
||||||
ROOT="/mnt/root"
|
ROOT="/mnt/root"
|
||||||
BUILD_PATH="${INSTALL_PATH}/build"
|
BUILD_PATH="${INSTALL_PATH}/build-${TARGET}${TARGET_VERSION}"
|
||||||
ARM_VERSION="armv7hl"
|
ARM_VERSION="armv7hl"
|
||||||
|
|
||||||
# Assigne a script for creating a particular target image (rpi, odroid, ...)
|
# Assigne a script for creating a particular target image (rpi, odroid, ...)
|
||||||
@ -782,7 +810,7 @@ info "Firmware path : ${FIRMWARE_PATH}"
|
|||||||
info "Firmware dir : ${FIRMWARE_DIR}"
|
info "Firmware dir : ${FIRMWARE_DIR}"
|
||||||
|
|
||||||
# Defining default image size to 7 go
|
# Defining default image size to 7 go
|
||||||
if [[ "${IMAGE_SIZE}" -lt 7 ]] || [[ "${IMAGE_SIZE}" -gt 128 ]]; then
|
if [[ "${IMAGE_SIZE}" -lt 2 ]] || [[ "${IMAGE_SIZE}" -gt 128 ]]; then
|
||||||
IMAGE_SIZE=7
|
IMAGE_SIZE=7
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@ -816,7 +844,7 @@ case ${OPT} in
|
|||||||
;;
|
;;
|
||||||
"all")
|
"all")
|
||||||
verify_disk_space
|
verify_disk_space
|
||||||
if [ ${?} -eq 1 ]; then
|
if [ ${?} -ne 0 ]; then
|
||||||
echo -e "Not enough space on disk\nDo you want to continue anyway ? [Y,n]"
|
echo -e "Not enough space on disk\nDo you want to continue anyway ? [Y,n]"
|
||||||
read yn
|
read yn
|
||||||
if [ ${yn} = "n" ]; then
|
if [ ${yn} = "n" ]; then
|
||||||
@ -845,7 +873,7 @@ case ${OPT} in
|
|||||||
;;
|
;;
|
||||||
"createimage")
|
"createimage")
|
||||||
verify_disk_space
|
verify_disk_space
|
||||||
if [ ${?} -eq 1 ]; then
|
if [ ${?} -ne 0 ]; then
|
||||||
warning "Not enough space on disk"
|
warning "Not enough space on disk"
|
||||||
exit ${ERR_NO_SPACE}
|
exit ${ERR_NO_SPACE}
|
||||||
fi
|
fi
|
||||||
@ -857,7 +885,7 @@ case ${OPT} in
|
|||||||
esac
|
esac
|
||||||
|
|
||||||
|
|
||||||
if ! [ -z ${ERRORN} ]; then
|
if [ ${ERRORN} -ne 0 ]; then
|
||||||
warning "Some errors occurs : ${ERRORN} errors"
|
warning "Some errors occurs : ${ERRORN} errors"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user