diff --git a/create_arm_img_urpmi.sh b/create_arm_img_urpmi.sh index 78a81f1..8e2e17d 100644 --- a/create_arm_img_urpmi.sh +++ b/create_arm_img_urpmi.sh @@ -15,6 +15,10 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . +function WaitToContinue() +{ + read -p "Break... Press [ENTER] to continue." GARBAGE +} function title() { @@ -109,24 +113,42 @@ function clean() else 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 $(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 + 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}" - /bin/rmdir "${BOOT}" + /bin/rm -rf "${BOOT}" else warning "${BOOT} does not exists" fi if [ -d "${ROOT}" ]; then info "Removing ${ROOT}" - /bin/rmdir "${ROOT}" + /bin/rm -rf "${ROOT}" else warning "${ROOT} does not exists" fi @@ -276,8 +298,9 @@ function preparechroot() info "creation of user account" echo -e "/bin/passwd << EOF\n${ROOT_PWD}\n${ROOT_PWD}\nEOF\n /sbin/useradd ${ID_USER}\n /bin/passwd ${ID_USER} << EOF\n${PASSWORD}\n${PASSWORD}\nEOF" >>"${BUILD_PATH}/second_stage_install.sh" - info "Copying skel in root directory" - /bin/rsync -rlptH /etc/skel/ "${BUILD_PATH}/root/" +# info "Copying skel in root directory" +# /bin/rsync -rlptH "${BUILD_PATH}/etc/skel/" "${BUILD_PATH}/root/" +#This line break the default .bashrc file from the package "rootfiles" and the values as PATH (and /usr/sbin programs). postPrepareChroot if [ ${?} -ne 0 ]; then @@ -494,19 +517,21 @@ copyingsystem() fi if [ -e "${CONFIG_PATH}/extlinux.conf" ]; then + info "\tFound extlinux.conf" if [ ! -d "${BUILD_PATH}/boot/extlinux" ]; then info "making /boot/extlinux/extlinux.conf" /bin/rm -rf "${BUILD_PATH}/boot/extlinux" mkdir -p "${BUILD_PATH}/boot/extlinux" fi if [ ! -f "${BUILD_PATH}/boot/extlinux/extlinux.conf" ]; then + info "\tTuning extlinux.conf" sed -e s/\/${ROOT_UUID}/g ${CONFIG_PATH}/extlinux.conf >"${BUILD_PATH}/boot/extlinux/extlinux.conf" KERNEL_ID=$(basename ${BUILD_PATH}/usr/lib/linux-*) sed -i -e s/\/${KERNEL_ID}/g "${BUILD_PATH}/boot/extlinux/extlinux.conf" fi fi - + info "Remove second_stage_install.sh" /bin/rm -f "${BUILD_PATH}/second_stage_install.sh" if [ 1 -eq ${SEPARATE_BOOT_PARTITION} ]; then