Création d'une fonction de démontage, désactive le split-length (DL tout)
This commit is contained in:
parent
4057597197
commit
8c2190b598
@ -69,12 +69,11 @@ function help()
|
||||
echo -e "\nFor image size, make sure it fit on physical support. (Default size is 7 Go)"
|
||||
}
|
||||
|
||||
|
||||
# cleaning build space
|
||||
function clean()
|
||||
function unmounting()
|
||||
{
|
||||
title "Unmounting..."
|
||||
|
||||
# Unmounting /dev /proc /sys in chroot
|
||||
title "Cleaning"
|
||||
if ! [ -z "$(mountpoint -qd "${BUILD_PATH}/dev")" ]; then # mountpoint - see if a directory or file is a mountpoint ; -d Show the major/minor numbers of the device that is mounted on the given directory.
|
||||
info "Unmounting ${BUILD_PATH}/dev"
|
||||
umount "${BUILD_PATH}/dev"
|
||||
@ -99,6 +98,45 @@ function clean()
|
||||
#exit ${ERR_1}
|
||||
fi
|
||||
fi
|
||||
|
||||
# [root@jabztop mageia4arm (master)]# losetup -l -O NAME,BACK-FILE -n
|
||||
# /dev/loop0 /home/jibz/workspaces/mageia4arm/build/Mageia-7-bananaPro1.img (deleted)
|
||||
|
||||
# # removing loop devices
|
||||
# for LOOP in $(ls /dev/loop*[0-9]p1); do
|
||||
# X=${LOOP:0:10}
|
||||
# if [ -e "${X}" ]; then
|
||||
# info "removing ${X}"
|
||||
# partx -d "${X}" # Tell the kernel about the presence and numbering of partitions.
|
||||
# fi
|
||||
# done
|
||||
|
||||
# info "Supposed image name : ${IMAGE}"
|
||||
# info "Looped devices : $(losetup -l -O NAME,BACK-FILE -n)"
|
||||
# info "Looped devices with this image : $(losetup -l -O NAME,BACK-FILE -n | grep "${IMAGE}" )"
|
||||
info "Looped devices to unmount : $(losetup -l -O NAME,BACK-FILE -n | grep "${IMAGE}" | cut -d ' ' -f 1 )"
|
||||
|
||||
# removing loop devices
|
||||
# for LOOP in $(losetup -l -O NAME -n); do
|
||||
# info "removing ${LOOP}"
|
||||
# losetup -d "${LOOP}" # Tell the kernel about the presence and numbering of partitions.
|
||||
# done
|
||||
|
||||
for LOOP in $(losetup -l -O NAME,BACK-FILE -n | grep "${IMAGE}" | cut -d ' ' -f 1 ); do
|
||||
info "removing ${LOOP}"
|
||||
losetup -d "${LOOP}"
|
||||
done
|
||||
|
||||
return 0
|
||||
}
|
||||
|
||||
# cleaning build space
|
||||
function clean()
|
||||
{
|
||||
title "Cleaning"
|
||||
|
||||
unmounting
|
||||
|
||||
# Removing old Build directory
|
||||
if [ -d "${BUILD_PATH}" ]; then
|
||||
info "Removing ${BUILD_PATH}"
|
||||
@ -114,31 +152,6 @@ function clean()
|
||||
warning "${IMAGE} does not exists"
|
||||
fi
|
||||
|
||||
|
||||
# [root@jabztop mageia4arm (master)]# losetup -l -O NAME,BACK-FILE -n
|
||||
# /dev/loop0 /home/jibz/workspaces/mageia4arm/build/Mageia-7-bananaPro1.img (deleted)
|
||||
|
||||
# # removing loop devices
|
||||
# for LOOP in $(ls /dev/loop*[0-9]p1); do
|
||||
# X=${LOOP:0:10}
|
||||
# if [ -e "${X}" ]; then
|
||||
# info "removing ${X}"
|
||||
# partx -d "${X}" # Tell the kernel about the presence and numbering of partitions.
|
||||
# fi
|
||||
# done
|
||||
|
||||
info "Supposed image name : ${IMAGE}"
|
||||
info "Looped devices : $(losetup -l -O NAME -n)"
|
||||
info "Looped devices with this image : $(losetup -l -O NAME -n | grep ${IMAGE})"
|
||||
|
||||
# removing loop devices
|
||||
for LOOP in $(losetup -l -O NAME -n); do
|
||||
info "removing ${LOOP}"
|
||||
losetup -d "${LOOP}" # Tell the kernel about the presence and numbering of partitions.
|
||||
done
|
||||
|
||||
|
||||
|
||||
# Removing boot and root directory
|
||||
if [ -d "${BOOT}" ]; then
|
||||
info "Removing ${BOOT}"
|
||||
@ -247,17 +260,17 @@ function installbasesystem()
|
||||
fi
|
||||
|
||||
title "installing basesystem"
|
||||
/sbin/urpmi --urpmi-root "${BUILD_PATH}" --ignorearch --no-verify-rpm --auto --split-level 200 --split-length 200 shadow-utils basesystem-minimal
|
||||
/sbin/urpmi --urpmi-root "${BUILD_PATH}" --ignorearch --no-verify-rpm --auto --split-level 200 --split-length 0 shadow-utils basesystem-minimal
|
||||
if [ ${?} -ne 0 ]; then
|
||||
error "line ${LINENO} error installing shadow-utils or basesystem-minimal : exiting"
|
||||
exit ${ERR_1}
|
||||
fi
|
||||
#/sbin/urpmi --urpmi-root "${BUILD_PATH}" --ignorearch --no-verify-rpm --auto --split-level 200 --split-length 200 basesystem-minimal
|
||||
#/sbin/urpmi --urpmi-root "${BUILD_PATH}" --ignorearch --no-verify-rpm --auto --split-level 200 --split-length 0 basesystem-minimal
|
||||
#if [ ${?} -ne 0 ]; then
|
||||
# error "line ${LINENO} error installing basesystem-minimal : exiting"
|
||||
# exit ${ERR_1}
|
||||
#fi
|
||||
/sbin/urpmi --urpmi-root "${BUILD_PATH}" --ignorearch --no-verify-rpm --auto --split-level 200 --split-length 200 urpmi locales-fr systemd u-boot
|
||||
/sbin/urpmi --urpmi-root "${BUILD_PATH}" --ignorearch --no-verify-rpm --auto --split-level 200 --split-length 0 urpmi locales-fr systemd u-boot
|
||||
if [ ${?} -ne 0 ]; then
|
||||
error "line ${LINENO} error installing urpmi or locales.fr : exiting"
|
||||
exit ${ERR_1}
|
||||
@ -915,6 +928,7 @@ case ${OPT} in
|
||||
preparechroot
|
||||
jumpchroot
|
||||
createImageWrap
|
||||
unmounting
|
||||
;;
|
||||
"createchroot")
|
||||
createchroot
|
||||
|
Reference in New Issue
Block a user