From a18c6bb409ddaf247633e061b1fa7c32f51de329 Mon Sep 17 00:00:00 2001 From: Jybz Date: Thu, 5 Dec 2019 08:03:01 +0100 Subject: sync7 --- platforms/bananaPro/specialFunctions.sh | 70 +++++++++++++++++ platforms/bananaPro/specialFunctions.sh~ | 70 ----------------- platforms/rpi1/specialFunctions.sh | 130 +++++++++++++++++++++++++++++++ platforms/rpi1/specialFunctions.sh~ | 130 ------------------------------- platforms/rpi2/specialFunctions.sh | 129 ++++++++++++++++++++++++++++++ platforms/rpi2/specialFunctions.sh~ | 129 ------------------------------ platforms/rpi3/specialFunctions.sh | 129 ++++++++++++++++++++++++++++++ platforms/rpi3/specialFunctions.sh~ | 129 ------------------------------ tools/resize_root.sh | 32 ++++++++ tools/resize_root.sh~ | 32 -------- 10 files changed, 490 insertions(+), 490 deletions(-) create mode 100755 platforms/bananaPro/specialFunctions.sh delete mode 100755 platforms/bananaPro/specialFunctions.sh~ create mode 100755 platforms/rpi1/specialFunctions.sh delete mode 100755 platforms/rpi1/specialFunctions.sh~ create mode 100755 platforms/rpi2/specialFunctions.sh delete mode 100755 platforms/rpi2/specialFunctions.sh~ create mode 100755 platforms/rpi3/specialFunctions.sh delete mode 100755 platforms/rpi3/specialFunctions.sh~ create mode 100755 tools/resize_root.sh delete mode 100755 tools/resize_root.sh~ diff --git a/platforms/bananaPro/specialFunctions.sh b/platforms/bananaPro/specialFunctions.sh new file mode 100755 index 0000000..dfa67c9 --- /dev/null +++ b/platforms/bananaPro/specialFunctions.sh @@ -0,0 +1,70 @@ +#!/bin/bash + +#Fdisk partitionment commands : +DEFAULT="" +NEW_DOSTAB="o" +NEW_PART="n" +PRIMARY="p" +CHANGE_TYPE="t" +TYPE_FAT32LBA="c" +CHANGE_BOOTFLAG="a" +APPLY="w" + +# PART_BOOT=1 +# PART_BOOT_FIRST_SECTOR=${DEFAULT} +# PART_BOOT_SIZE="+128M" +# +# PART_ROOT=2 +# PART_ROOT_FIRST_SECTOR=${DEFAULT} +# PART_ROOT_SIZE=${DEFAULT} + +PART_BOOTandROOT="1" +PART_BOOTandROOT_FIRST_SECTOR="${DEFAULT}" +PART_BOOTandROOT_SIZE="${DEFAULT}" + + +FDISK_SCRIPT="${NEW_PART}\n${PRIMARY}\n${PART_BOOTandROOT}\n${PART_BOOT_FIRST_SECTOR}\n${PART_BOOTandROOT_SIZE}\n${CHANGE_BOOTFLAG}\n${APPLY}\n" +# FDISK_SCRIPT="${NEW_PART}\n${PRIMARY}\n${PART_BOOT}\n${PART_BOOT_FIRST_SECTOR}\n${PART_BOOT_SIZE}\n${CHANGE_TYPE}\n${TYPE_FAT32LBA}\n${NEW_PART}\n${PRIMARY}\n${PART_ROOT}\n${PART_ROOT_FIRST_SECTOR}\n${PART_ROOT_SIZE}\n${CHANGE_BOOTFLAG}\n${PART_BOOT}\n${CHANGE_BOOTFLAG}\n${PART_ROOT}\n${APPLY}\n" + + +function preImgCreation() +{ + title "Creating Banana Pro image" + #Nothing to download. + return 0 +} + + +function postPrepareChroot() +{ +# info "copying kernel-desktop, dtb, boot.scr and vmlinuz symlink in ${BUILD_PATH}/boot" + info "copying dtb and boot.scr in ${BUILD_PATH}/boot" + #Generating uboot autoboot script : + mkimage -C none -A arm -T script -d "${CONFIG_PATH}/boot.cmd" "${BUILD_PATH}/boot/boot.scr" + /usr/bin/cp --preserve=mode "${CONFIG_PATH}/u-boot.dtb" "${BUILD_PATH}/boot/" +# /usr/bin/cp --preserve=mode "${CONFIG_PATH}/sun7i-a20-bananapro.dtb" "${BUILD_PATH}/boot/" +# /usr/bin/cp --preserve=mode -d "${CONFIG_PATH}/vmlinuz" "${BUILD_PATH}/boot/" +# /usr/bin/cp --preserve=mode -r "${CONFIG_PATH}/lib" "${BUILD_PATH}/" + return 0 +} + +function bunrningBootloader() +{ + # DEVICE is set just before this function and looped. + title "Burning the bootloader..." + dd if=${CONFIG_PATH}/u-boot-sunxi-with-spl.bin of=${DEVICE} bs=1024 seek=8 + return 0 +} + +function copyingCustomSystem() +{ + #${BOOT} defined to the path to the mounted boot partition. +# /usr/bin/cp --preserve=mode "${CONFIG_PATH}/vmlinuz-5.3.1-desktop-2.mga7" "${BOOT}" +# /usr/bin/cp --preserve=mode "${CONFIG_PATH}/sun7i-a20-bananapro.dtb" "${BOOT}" +# /usr/bin/cp --preserve=mode "${CONFIG_PATH}/boot.scr" "${BOOT}/" +# /usr/bin/cp --preserve=mode "${CONFIG_PATH}/uboot.env" "${BOOT}/" +# /usr/bin/cp --preserve=mode "${CONFIG_PATH}/uEnv.txt" "${BOOT}/" +# /usr/bin/cp --preserve=mode -d "${CONFIG_PATH}/vmlinuz" "${BOOT}/" +# cp --preserve=mode -R "${BUILD_PATH}/boot/extlinux" "${BOOT}/" + return 0 +} diff --git a/platforms/bananaPro/specialFunctions.sh~ b/platforms/bananaPro/specialFunctions.sh~ deleted file mode 100755 index dfa67c9..0000000 --- a/platforms/bananaPro/specialFunctions.sh~ +++ /dev/null @@ -1,70 +0,0 @@ -#!/bin/bash - -#Fdisk partitionment commands : -DEFAULT="" -NEW_DOSTAB="o" -NEW_PART="n" -PRIMARY="p" -CHANGE_TYPE="t" -TYPE_FAT32LBA="c" -CHANGE_BOOTFLAG="a" -APPLY="w" - -# PART_BOOT=1 -# PART_BOOT_FIRST_SECTOR=${DEFAULT} -# PART_BOOT_SIZE="+128M" -# -# PART_ROOT=2 -# PART_ROOT_FIRST_SECTOR=${DEFAULT} -# PART_ROOT_SIZE=${DEFAULT} - -PART_BOOTandROOT="1" -PART_BOOTandROOT_FIRST_SECTOR="${DEFAULT}" -PART_BOOTandROOT_SIZE="${DEFAULT}" - - -FDISK_SCRIPT="${NEW_PART}\n${PRIMARY}\n${PART_BOOTandROOT}\n${PART_BOOT_FIRST_SECTOR}\n${PART_BOOTandROOT_SIZE}\n${CHANGE_BOOTFLAG}\n${APPLY}\n" -# FDISK_SCRIPT="${NEW_PART}\n${PRIMARY}\n${PART_BOOT}\n${PART_BOOT_FIRST_SECTOR}\n${PART_BOOT_SIZE}\n${CHANGE_TYPE}\n${TYPE_FAT32LBA}\n${NEW_PART}\n${PRIMARY}\n${PART_ROOT}\n${PART_ROOT_FIRST_SECTOR}\n${PART_ROOT_SIZE}\n${CHANGE_BOOTFLAG}\n${PART_BOOT}\n${CHANGE_BOOTFLAG}\n${PART_ROOT}\n${APPLY}\n" - - -function preImgCreation() -{ - title "Creating Banana Pro image" - #Nothing to download. - return 0 -} - - -function postPrepareChroot() -{ -# info "copying kernel-desktop, dtb, boot.scr and vmlinuz symlink in ${BUILD_PATH}/boot" - info "copying dtb and boot.scr in ${BUILD_PATH}/boot" - #Generating uboot autoboot script : - mkimage -C none -A arm -T script -d "${CONFIG_PATH}/boot.cmd" "${BUILD_PATH}/boot/boot.scr" - /usr/bin/cp --preserve=mode "${CONFIG_PATH}/u-boot.dtb" "${BUILD_PATH}/boot/" -# /usr/bin/cp --preserve=mode "${CONFIG_PATH}/sun7i-a20-bananapro.dtb" "${BUILD_PATH}/boot/" -# /usr/bin/cp --preserve=mode -d "${CONFIG_PATH}/vmlinuz" "${BUILD_PATH}/boot/" -# /usr/bin/cp --preserve=mode -r "${CONFIG_PATH}/lib" "${BUILD_PATH}/" - return 0 -} - -function bunrningBootloader() -{ - # DEVICE is set just before this function and looped. - title "Burning the bootloader..." - dd if=${CONFIG_PATH}/u-boot-sunxi-with-spl.bin of=${DEVICE} bs=1024 seek=8 - return 0 -} - -function copyingCustomSystem() -{ - #${BOOT} defined to the path to the mounted boot partition. -# /usr/bin/cp --preserve=mode "${CONFIG_PATH}/vmlinuz-5.3.1-desktop-2.mga7" "${BOOT}" -# /usr/bin/cp --preserve=mode "${CONFIG_PATH}/sun7i-a20-bananapro.dtb" "${BOOT}" -# /usr/bin/cp --preserve=mode "${CONFIG_PATH}/boot.scr" "${BOOT}/" -# /usr/bin/cp --preserve=mode "${CONFIG_PATH}/uboot.env" "${BOOT}/" -# /usr/bin/cp --preserve=mode "${CONFIG_PATH}/uEnv.txt" "${BOOT}/" -# /usr/bin/cp --preserve=mode -d "${CONFIG_PATH}/vmlinuz" "${BOOT}/" -# cp --preserve=mode -R "${BUILD_PATH}/boot/extlinux" "${BOOT}/" - return 0 -} diff --git a/platforms/rpi1/specialFunctions.sh b/platforms/rpi1/specialFunctions.sh new file mode 100755 index 0000000..71d75b0 --- /dev/null +++ b/platforms/rpi1/specialFunctions.sh @@ -0,0 +1,130 @@ +#!/bin/bash + +#RPI partitionning : +DEFAULT="" +NEW_PART=n +PRIMARY=p +CHANGE_TYPE=t +CHANGE_BOOTFLAG=a +APPLY=w + +PART_BOOT=1 +PART_BOOT_FIRST_SECTOR=${DEFAULT} +PART_BOOT_SIZE="+128M" + +PART_ROOT=2 +PART_ROOT_FIRST_SECTOR=${DEFAULT} +PART_ROOT_SIZE=${DEFAULT} + +TYPE_FAT32LBA=c + +FDISK_SCRIPT="${NEW_PART}\n${PRIMARY}\n${PART_BOOT}\n${PART_BOOT_FIRST_SECTOR}\n${PART_BOOT_SIZE}\n${CHANGE_TYPE}\n${TYPE_FAT32LBA}\n${NEW_PART}\n${PRIMARY}\n${PART_ROOT}\n${PART_ROOT_FIRST_SECTOR}\n${PART_ROOT_SIZE}\n${CHANGE_BOOTFLAG}\n${PART_BOOT}\n${CHANGE_BOOTFLAG}\n${PART_ROOT}\n${APPLY}\n" + + +function preImgCreation() +{ + title "Creating Pi image" + + if ! [ -d "${FIRMWARE_PATH}/${FIRMWARE_DIR}" ]; then # the firmware directory does not exists + echo "$(ls *.zip| wc -l)" + if [ "$(ls *.zip| wc -l)" -eq 0 ]; then # the firmware archive does not exists + warning "The raspberry pi firmware need to be downloaded" + info "Downloading FIRMWARE_FILENAME" + wget ${FIRMWARE_DOWNLOAD_URL} + if [ ${?} -ne 0 ]; then + error "line ${LINENO} error downloading raspberry firmware at ${FIRMWARE_DOWNLOAD_URL}: exiting" + exit 1 + fi + fi + info "extracting firmware" + unzip -d "${FIRMWARE_PATH}" *.zip + if [ ${?} -ne 0 ]; then + error "line ${LINENO} error unzipping ${FIRMWARE_PATH} : exiting" + exit 1 + fi + fi + + title "Making raspberry pi image" + return 0 +} + + +function postPrepareChroot() +{ + #Nothing to do. (Except replacing default function.) + return 0 +} + +function bunrningBootloader() +{ + #Nothing to do. (Except replacing default function.) + return 0 +} + + +function copyingCustomSystem() +{ + info "copying 10-vchiq-permissions.rules" + cp --preserve=mode "${CONFIG_PATH}/10-vchiq-permissions.rules" "${BUILD_PATH}/etc/udev/rules.d/" + info "Making /etc/modules" + echo -e "vchiq\nsnd_bcm2835\nvc4\nbrcmfmac" >> "${BUILD_PATH}"/etc/modules + + ARM_BOOT="${BUILD_PATH}/mnt/arm_boot" + if ! [ -d "${ARM_BOOT}" ]; then + mkdir -p "${ARM_BOOT}" + fi + info "copying modprobe.conf" + /usr/bin/cp -v --preserve=mode "${CONFIG_PATH}/modprobe.conf" "${BUILD_PATH}/etc/" + chown root:root "${BUILD_PATH}/etc/modprobe.conf" + + info "copying firmware, overlays in rpi boot partition" +# cp -v --preserve=mode "${BUILD_PATH}/usr/lib/linux-"* "${BOOT}/dtb" + cp -v --preserve=mode "${FIRMWARE_PATH}/${FIRMWARE_DIR}/boot/start"* "${ARM_BOOT}/" + cp -v --preserve=mode "${FIRMWARE_PATH}/${FIRMWARE_DIR}/boot/fixup"* "${ARM_BOOT}/" + cp -v --preserve=mode "${FIRMWARE_PATH}/${FIRMWARE_DIR}/boot/bootcode.bin"* "${ARM_BOOT}/" + cp -vR --preserve=mode "${FIRMWARE_PATH}/${FIRMWARE_DIR}/boot/overlays" "${ARM_BOOT}/" + + info "copying u-boot binary to ${ARM_BOOT}" + case ${TARGET_VERSION} in + "0") + info "copying u-boot for ${TARGET} 0" + cp --preserve=mode "${BUILD_PATH}/usr/lib/u-boot/rpi_0_w/u-boot.bin" "${ARM_BOOT}/kernel.img" + ;; + "1") + info "copying u-boot for ${TARGET} 1" + cp --preserve=mode "${BUILD_PATH}/usr/lib/u-boot/rpi/u-boot.bin" "${ARM_BOOT}/kernel.img" + ;; + "2") + info "copying u-boot for ${TARGET} 2" + cp --preserve=mode "${BUILD_PATH}/usr/lib/u-boot/rpi_2/u-boot.bin" "${ARM_BOOT}/kernel.img" + ;; + "3_32") + info "copying u-boot for ${TARGET} 3 32 bits" + cp --preserve=mode "${BUILD_PATH}/usr/lib/u-boot/rpi_3_32b/u-boot.bin" "${ARM_BOOT}/kernel.img" + ;; + "3+") + info "copying u-boot for ${TARGET} 3b+ 32 bits" + cp --preserve=mode "${BUILD_PATH}/usr/lib/u-boot/rpi_3_32b/u-boot.bin" "${ARM_BOOT}/kernel.img" + ;; + esac + +# info "copying raspberry optionals files in opt" +# /bin/rsync -rlptDH "${FIRMWARE_PATH}/${FIRMWARE_DIR}/opt/" "${BUILD_PATH}/opt/" + + info "copying wifi firmware file missing in kernel-firmware-nonfree" + if ! [ -d "${ROOT}/usr/lib/firmware/brcm/" ]; then + /bin/mkdir -p "${ROOT}/usr/lib/firmware/brcm/" + fi + if ! [ -f "${ROOT}/usr/lib/firmware/brcm/brcmfmac434"* ]; then + /bin/cp --preserve=mode "${CONFIG_PATH}/brcmfmac434"* "${ROOT}/usr/lib/firmware/brcm/" + if [ ${?} -ne 0 ]; then + error "line ${LINENO} error copying wifi firmware in ${ROOTP}/usr/lib/firmware/brcm/ : exiting" + exit ${ERR_1} + fi + 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}/" + return 0 +} diff --git a/platforms/rpi1/specialFunctions.sh~ b/platforms/rpi1/specialFunctions.sh~ deleted file mode 100755 index 71d75b0..0000000 --- a/platforms/rpi1/specialFunctions.sh~ +++ /dev/null @@ -1,130 +0,0 @@ -#!/bin/bash - -#RPI partitionning : -DEFAULT="" -NEW_PART=n -PRIMARY=p -CHANGE_TYPE=t -CHANGE_BOOTFLAG=a -APPLY=w - -PART_BOOT=1 -PART_BOOT_FIRST_SECTOR=${DEFAULT} -PART_BOOT_SIZE="+128M" - -PART_ROOT=2 -PART_ROOT_FIRST_SECTOR=${DEFAULT} -PART_ROOT_SIZE=${DEFAULT} - -TYPE_FAT32LBA=c - -FDISK_SCRIPT="${NEW_PART}\n${PRIMARY}\n${PART_BOOT}\n${PART_BOOT_FIRST_SECTOR}\n${PART_BOOT_SIZE}\n${CHANGE_TYPE}\n${TYPE_FAT32LBA}\n${NEW_PART}\n${PRIMARY}\n${PART_ROOT}\n${PART_ROOT_FIRST_SECTOR}\n${PART_ROOT_SIZE}\n${CHANGE_BOOTFLAG}\n${PART_BOOT}\n${CHANGE_BOOTFLAG}\n${PART_ROOT}\n${APPLY}\n" - - -function preImgCreation() -{ - title "Creating Pi image" - - if ! [ -d "${FIRMWARE_PATH}/${FIRMWARE_DIR}" ]; then # the firmware directory does not exists - echo "$(ls *.zip| wc -l)" - if [ "$(ls *.zip| wc -l)" -eq 0 ]; then # the firmware archive does not exists - warning "The raspberry pi firmware need to be downloaded" - info "Downloading FIRMWARE_FILENAME" - wget ${FIRMWARE_DOWNLOAD_URL} - if [ ${?} -ne 0 ]; then - error "line ${LINENO} error downloading raspberry firmware at ${FIRMWARE_DOWNLOAD_URL}: exiting" - exit 1 - fi - fi - info "extracting firmware" - unzip -d "${FIRMWARE_PATH}" *.zip - if [ ${?} -ne 0 ]; then - error "line ${LINENO} error unzipping ${FIRMWARE_PATH} : exiting" - exit 1 - fi - fi - - title "Making raspberry pi image" - return 0 -} - - -function postPrepareChroot() -{ - #Nothing to do. (Except replacing default function.) - return 0 -} - -function bunrningBootloader() -{ - #Nothing to do. (Except replacing default function.) - return 0 -} - - -function copyingCustomSystem() -{ - info "copying 10-vchiq-permissions.rules" - cp --preserve=mode "${CONFIG_PATH}/10-vchiq-permissions.rules" "${BUILD_PATH}/etc/udev/rules.d/" - info "Making /etc/modules" - echo -e "vchiq\nsnd_bcm2835\nvc4\nbrcmfmac" >> "${BUILD_PATH}"/etc/modules - - ARM_BOOT="${BUILD_PATH}/mnt/arm_boot" - if ! [ -d "${ARM_BOOT}" ]; then - mkdir -p "${ARM_BOOT}" - fi - info "copying modprobe.conf" - /usr/bin/cp -v --preserve=mode "${CONFIG_PATH}/modprobe.conf" "${BUILD_PATH}/etc/" - chown root:root "${BUILD_PATH}/etc/modprobe.conf" - - info "copying firmware, overlays in rpi boot partition" -# cp -v --preserve=mode "${BUILD_PATH}/usr/lib/linux-"* "${BOOT}/dtb" - cp -v --preserve=mode "${FIRMWARE_PATH}/${FIRMWARE_DIR}/boot/start"* "${ARM_BOOT}/" - cp -v --preserve=mode "${FIRMWARE_PATH}/${FIRMWARE_DIR}/boot/fixup"* "${ARM_BOOT}/" - cp -v --preserve=mode "${FIRMWARE_PATH}/${FIRMWARE_DIR}/boot/bootcode.bin"* "${ARM_BOOT}/" - cp -vR --preserve=mode "${FIRMWARE_PATH}/${FIRMWARE_DIR}/boot/overlays" "${ARM_BOOT}/" - - info "copying u-boot binary to ${ARM_BOOT}" - case ${TARGET_VERSION} in - "0") - info "copying u-boot for ${TARGET} 0" - cp --preserve=mode "${BUILD_PATH}/usr/lib/u-boot/rpi_0_w/u-boot.bin" "${ARM_BOOT}/kernel.img" - ;; - "1") - info "copying u-boot for ${TARGET} 1" - cp --preserve=mode "${BUILD_PATH}/usr/lib/u-boot/rpi/u-boot.bin" "${ARM_BOOT}/kernel.img" - ;; - "2") - info "copying u-boot for ${TARGET} 2" - cp --preserve=mode "${BUILD_PATH}/usr/lib/u-boot/rpi_2/u-boot.bin" "${ARM_BOOT}/kernel.img" - ;; - "3_32") - info "copying u-boot for ${TARGET} 3 32 bits" - cp --preserve=mode "${BUILD_PATH}/usr/lib/u-boot/rpi_3_32b/u-boot.bin" "${ARM_BOOT}/kernel.img" - ;; - "3+") - info "copying u-boot for ${TARGET} 3b+ 32 bits" - cp --preserve=mode "${BUILD_PATH}/usr/lib/u-boot/rpi_3_32b/u-boot.bin" "${ARM_BOOT}/kernel.img" - ;; - esac - -# info "copying raspberry optionals files in opt" -# /bin/rsync -rlptDH "${FIRMWARE_PATH}/${FIRMWARE_DIR}/opt/" "${BUILD_PATH}/opt/" - - info "copying wifi firmware file missing in kernel-firmware-nonfree" - if ! [ -d "${ROOT}/usr/lib/firmware/brcm/" ]; then - /bin/mkdir -p "${ROOT}/usr/lib/firmware/brcm/" - fi - if ! [ -f "${ROOT}/usr/lib/firmware/brcm/brcmfmac434"* ]; then - /bin/cp --preserve=mode "${CONFIG_PATH}/brcmfmac434"* "${ROOT}/usr/lib/firmware/brcm/" - if [ ${?} -ne 0 ]; then - error "line ${LINENO} error copying wifi firmware in ${ROOTP}/usr/lib/firmware/brcm/ : exiting" - exit ${ERR_1} - fi - 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}/" - return 0 -} diff --git a/platforms/rpi2/specialFunctions.sh b/platforms/rpi2/specialFunctions.sh new file mode 100755 index 0000000..97e25d4 --- /dev/null +++ b/platforms/rpi2/specialFunctions.sh @@ -0,0 +1,129 @@ +#!/bin/bash + +#RPI partitionning : +DEFAULT="" +NEW_PART=n +PRIMARY=p +CHANGE_TYPE=t +CHANGE_BOOTFLAG=a +APPLY=w + +PART_BOOT=1 +PART_BOOT_FIRST_SECTOR=${DEFAULT} +PART_BOOT_SIZE="+128M" + +PART_ROOT=2 +PART_ROOT_FIRST_SECTOR=${DEFAULT} +PART_ROOT_SIZE=${DEFAULT} + +TYPE_FAT32LBA=c + +FDISK_SCRIPT="${NEW_PART}\n${PRIMARY}\n${PART_BOOT}\n${PART_BOOT_FIRST_SECTOR}\n${PART_BOOT_SIZE}\n${CHANGE_TYPE}\n${TYPE_FAT32LBA}\n${NEW_PART}\n${PRIMARY}\n${PART_ROOT}\n${PART_ROOT_FIRST_SECTOR}\n${PART_ROOT_SIZE}\n${CHANGE_BOOTFLAG}\n${PART_BOOT}\n${CHANGE_BOOTFLAG}\n${PART_ROOT}\n${APPLY}\n" + + +function preImgCreation() +{ + title "Creating Pi image" + + if ! [ -d "${FIRMWARE_PATH}/${FIRMWARE_DIR}" ]; then # the firmware directory does not exists + echo "$(ls *.zip| wc -l)" + if [ "$(ls *.zip| wc -l)" -eq 0 ]; then # the firmware archive does not exists + warning "The raspberry pi firmware need to be downloaded" + info "Downloading FIRMWARE_FILENAME" + wget ${FIRMWARE_DOWNLOAD_URL} + if [ ${?} -ne 0 ]; then + error "line ${LINENO} error downloading raspberry firmware at ${FIRMWARE_DOWNLOAD_URL}: exiting" + exit 1 + fi + fi + info "extracting firmware" + unzip -d "${FIRMWARE_PATH}" *.zip + if [ ${?} -ne 0 ]; then + error "line ${LINENO} error unzipping ${FIRMWARE_PATH} : exiting" + exit 1 + fi + fi + + title "Making raspberry pi image" + return 0 +} + +function postPrepareChroot() +{ + #Nothing to do. (Except replacing default function.) + return 0 +} + +function bunrningBootloader() +{ + #Nothing to do. (Except replacing default function.) + return 0 +} + + +function copyingCustomSystem() +{ + info "copying 10-vchiq-permissions.rules" + cp --preserve=mode "${CONFIG_PATH}/10-vchiq-permissions.rules" "${BUILD_PATH}/etc/udev/rules.d/" + info "Making /etc/modules" + echo -e "vchiq\nsnd_bcm2835\nvc4\nbrcmfmac" >> "${BUILD_PATH}"/etc/modules + + ARM_BOOT="${BUILD_PATH}/mnt/arm_boot" + if ! [ -d "${ARM_BOOT}" ]; then + mkdir -p "${ARM_BOOT}" + fi + info "copying modprobe.conf" + /usr/bin/cp -v --preserve=mode "${CONFIG_PATH}/modprobe.conf" "${BUILD_PATH}/etc/" + chown root:root "${BUILD_PATH}/etc/modprobe.conf" + + info "copying firmware, overlays in rpi boot partition" +# cp -v --preserve=mode "${BUILD_PATH}/usr/lib/linux-"* "${BOOT}/dtb" + cp -v --preserve=mode "${FIRMWARE_PATH}/${FIRMWARE_DIR}/boot/start"* "${ARM_BOOT}/" + cp -v --preserve=mode "${FIRMWARE_PATH}/${FIRMWARE_DIR}/boot/fixup"* "${ARM_BOOT}/" + cp -v --preserve=mode "${FIRMWARE_PATH}/${FIRMWARE_DIR}/boot/bootcode.bin"* "${ARM_BOOT}/" + cp -vR --preserve=mode "${FIRMWARE_PATH}/${FIRMWARE_DIR}/boot/overlays" "${ARM_BOOT}/" + + info "copying u-boot binary to ${ARM_BOOT}" + case ${TARGET_VERSION} in + "0") + info "copying u-boot for ${TARGET} 0" + cp --preserve=mode "${BUILD_PATH}/usr/lib/u-boot/rpi_0_w/u-boot.bin" "${ARM_BOOT}/kernel.img" + ;; + "1") + info "copying u-boot for ${TARGET} 1" + cp --preserve=mode "${BUILD_PATH}/usr/lib/u-boot/rpi/u-boot.bin" "${ARM_BOOT}/kernel.img" + ;; + "2") + info "copying u-boot for ${TARGET} 2" + cp --preserve=mode "${BUILD_PATH}/usr/lib/u-boot/rpi_2/u-boot.bin" "${ARM_BOOT}/kernel.img" + ;; + "3_32") + info "copying u-boot for ${TARGET} 3 32 bits" + cp --preserve=mode "${BUILD_PATH}/usr/lib/u-boot/rpi_3_32b/u-boot.bin" "${ARM_BOOT}/kernel.img" + ;; + "3+") + info "copying u-boot for ${TARGET} 3b+ 32 bits" + cp --preserve=mode "${BUILD_PATH}/usr/lib/u-boot/rpi_3_32b/u-boot.bin" "${ARM_BOOT}/kernel.img" + ;; + esac + +# info "copying raspberry optionals files in opt" +# /bin/rsync -rlptDH "${FIRMWARE_PATH}/${FIRMWARE_DIR}/opt/" "${BUILD_PATH}/opt/" + + info "copying wifi firmware file missing in kernel-firmware-nonfree" + if ! [ -d "${ROOT}/usr/lib/firmware/brcm/" ]; then + /bin/mkdir -p "${ROOT}/usr/lib/firmware/brcm/" + fi + if ! [ -f "${ROOT}/usr/lib/firmware/brcm/brcmfmac434"* ]; then + /bin/cp --preserve=mode "${CONFIG_PATH}/brcmfmac434"* "${ROOT}/usr/lib/firmware/brcm/" + if [ ${?} -ne 0 ]; then + error "line ${LINENO} error copying wifi firmware in ${ROOTP}/usr/lib/firmware/brcm/ : exiting" + exit ${ERR_1} + fi + 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}/" + return 0 +} diff --git a/platforms/rpi2/specialFunctions.sh~ b/platforms/rpi2/specialFunctions.sh~ deleted file mode 100755 index 97e25d4..0000000 --- a/platforms/rpi2/specialFunctions.sh~ +++ /dev/null @@ -1,129 +0,0 @@ -#!/bin/bash - -#RPI partitionning : -DEFAULT="" -NEW_PART=n -PRIMARY=p -CHANGE_TYPE=t -CHANGE_BOOTFLAG=a -APPLY=w - -PART_BOOT=1 -PART_BOOT_FIRST_SECTOR=${DEFAULT} -PART_BOOT_SIZE="+128M" - -PART_ROOT=2 -PART_ROOT_FIRST_SECTOR=${DEFAULT} -PART_ROOT_SIZE=${DEFAULT} - -TYPE_FAT32LBA=c - -FDISK_SCRIPT="${NEW_PART}\n${PRIMARY}\n${PART_BOOT}\n${PART_BOOT_FIRST_SECTOR}\n${PART_BOOT_SIZE}\n${CHANGE_TYPE}\n${TYPE_FAT32LBA}\n${NEW_PART}\n${PRIMARY}\n${PART_ROOT}\n${PART_ROOT_FIRST_SECTOR}\n${PART_ROOT_SIZE}\n${CHANGE_BOOTFLAG}\n${PART_BOOT}\n${CHANGE_BOOTFLAG}\n${PART_ROOT}\n${APPLY}\n" - - -function preImgCreation() -{ - title "Creating Pi image" - - if ! [ -d "${FIRMWARE_PATH}/${FIRMWARE_DIR}" ]; then # the firmware directory does not exists - echo "$(ls *.zip| wc -l)" - if [ "$(ls *.zip| wc -l)" -eq 0 ]; then # the firmware archive does not exists - warning "The raspberry pi firmware need to be downloaded" - info "Downloading FIRMWARE_FILENAME" - wget ${FIRMWARE_DOWNLOAD_URL} - if [ ${?} -ne 0 ]; then - error "line ${LINENO} error downloading raspberry firmware at ${FIRMWARE_DOWNLOAD_URL}: exiting" - exit 1 - fi - fi - info "extracting firmware" - unzip -d "${FIRMWARE_PATH}" *.zip - if [ ${?} -ne 0 ]; then - error "line ${LINENO} error unzipping ${FIRMWARE_PATH} : exiting" - exit 1 - fi - fi - - title "Making raspberry pi image" - return 0 -} - -function postPrepareChroot() -{ - #Nothing to do. (Except replacing default function.) - return 0 -} - -function bunrningBootloader() -{ - #Nothing to do. (Except replacing default function.) - return 0 -} - - -function copyingCustomSystem() -{ - info "copying 10-vchiq-permissions.rules" - cp --preserve=mode "${CONFIG_PATH}/10-vchiq-permissions.rules" "${BUILD_PATH}/etc/udev/rules.d/" - info "Making /etc/modules" - echo -e "vchiq\nsnd_bcm2835\nvc4\nbrcmfmac" >> "${BUILD_PATH}"/etc/modules - - ARM_BOOT="${BUILD_PATH}/mnt/arm_boot" - if ! [ -d "${ARM_BOOT}" ]; then - mkdir -p "${ARM_BOOT}" - fi - info "copying modprobe.conf" - /usr/bin/cp -v --preserve=mode "${CONFIG_PATH}/modprobe.conf" "${BUILD_PATH}/etc/" - chown root:root "${BUILD_PATH}/etc/modprobe.conf" - - info "copying firmware, overlays in rpi boot partition" -# cp -v --preserve=mode "${BUILD_PATH}/usr/lib/linux-"* "${BOOT}/dtb" - cp -v --preserve=mode "${FIRMWARE_PATH}/${FIRMWARE_DIR}/boot/start"* "${ARM_BOOT}/" - cp -v --preserve=mode "${FIRMWARE_PATH}/${FIRMWARE_DIR}/boot/fixup"* "${ARM_BOOT}/" - cp -v --preserve=mode "${FIRMWARE_PATH}/${FIRMWARE_DIR}/boot/bootcode.bin"* "${ARM_BOOT}/" - cp -vR --preserve=mode "${FIRMWARE_PATH}/${FIRMWARE_DIR}/boot/overlays" "${ARM_BOOT}/" - - info "copying u-boot binary to ${ARM_BOOT}" - case ${TARGET_VERSION} in - "0") - info "copying u-boot for ${TARGET} 0" - cp --preserve=mode "${BUILD_PATH}/usr/lib/u-boot/rpi_0_w/u-boot.bin" "${ARM_BOOT}/kernel.img" - ;; - "1") - info "copying u-boot for ${TARGET} 1" - cp --preserve=mode "${BUILD_PATH}/usr/lib/u-boot/rpi/u-boot.bin" "${ARM_BOOT}/kernel.img" - ;; - "2") - info "copying u-boot for ${TARGET} 2" - cp --preserve=mode "${BUILD_PATH}/usr/lib/u-boot/rpi_2/u-boot.bin" "${ARM_BOOT}/kernel.img" - ;; - "3_32") - info "copying u-boot for ${TARGET} 3 32 bits" - cp --preserve=mode "${BUILD_PATH}/usr/lib/u-boot/rpi_3_32b/u-boot.bin" "${ARM_BOOT}/kernel.img" - ;; - "3+") - info "copying u-boot for ${TARGET} 3b+ 32 bits" - cp --preserve=mode "${BUILD_PATH}/usr/lib/u-boot/rpi_3_32b/u-boot.bin" "${ARM_BOOT}/kernel.img" - ;; - esac - -# info "copying raspberry optionals files in opt" -# /bin/rsync -rlptDH "${FIRMWARE_PATH}/${FIRMWARE_DIR}/opt/" "${BUILD_PATH}/opt/" - - info "copying wifi firmware file missing in kernel-firmware-nonfree" - if ! [ -d "${ROOT}/usr/lib/firmware/brcm/" ]; then - /bin/mkdir -p "${ROOT}/usr/lib/firmware/brcm/" - fi - if ! [ -f "${ROOT}/usr/lib/firmware/brcm/brcmfmac434"* ]; then - /bin/cp --preserve=mode "${CONFIG_PATH}/brcmfmac434"* "${ROOT}/usr/lib/firmware/brcm/" - if [ ${?} -ne 0 ]; then - error "line ${LINENO} error copying wifi firmware in ${ROOTP}/usr/lib/firmware/brcm/ : exiting" - exit ${ERR_1} - fi - 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}/" - return 0 -} diff --git a/platforms/rpi3/specialFunctions.sh b/platforms/rpi3/specialFunctions.sh new file mode 100755 index 0000000..97e25d4 --- /dev/null +++ b/platforms/rpi3/specialFunctions.sh @@ -0,0 +1,129 @@ +#!/bin/bash + +#RPI partitionning : +DEFAULT="" +NEW_PART=n +PRIMARY=p +CHANGE_TYPE=t +CHANGE_BOOTFLAG=a +APPLY=w + +PART_BOOT=1 +PART_BOOT_FIRST_SECTOR=${DEFAULT} +PART_BOOT_SIZE="+128M" + +PART_ROOT=2 +PART_ROOT_FIRST_SECTOR=${DEFAULT} +PART_ROOT_SIZE=${DEFAULT} + +TYPE_FAT32LBA=c + +FDISK_SCRIPT="${NEW_PART}\n${PRIMARY}\n${PART_BOOT}\n${PART_BOOT_FIRST_SECTOR}\n${PART_BOOT_SIZE}\n${CHANGE_TYPE}\n${TYPE_FAT32LBA}\n${NEW_PART}\n${PRIMARY}\n${PART_ROOT}\n${PART_ROOT_FIRST_SECTOR}\n${PART_ROOT_SIZE}\n${CHANGE_BOOTFLAG}\n${PART_BOOT}\n${CHANGE_BOOTFLAG}\n${PART_ROOT}\n${APPLY}\n" + + +function preImgCreation() +{ + title "Creating Pi image" + + if ! [ -d "${FIRMWARE_PATH}/${FIRMWARE_DIR}" ]; then # the firmware directory does not exists + echo "$(ls *.zip| wc -l)" + if [ "$(ls *.zip| wc -l)" -eq 0 ]; then # the firmware archive does not exists + warning "The raspberry pi firmware need to be downloaded" + info "Downloading FIRMWARE_FILENAME" + wget ${FIRMWARE_DOWNLOAD_URL} + if [ ${?} -ne 0 ]; then + error "line ${LINENO} error downloading raspberry firmware at ${FIRMWARE_DOWNLOAD_URL}: exiting" + exit 1 + fi + fi + info "extracting firmware" + unzip -d "${FIRMWARE_PATH}" *.zip + if [ ${?} -ne 0 ]; then + error "line ${LINENO} error unzipping ${FIRMWARE_PATH} : exiting" + exit 1 + fi + fi + + title "Making raspberry pi image" + return 0 +} + +function postPrepareChroot() +{ + #Nothing to do. (Except replacing default function.) + return 0 +} + +function bunrningBootloader() +{ + #Nothing to do. (Except replacing default function.) + return 0 +} + + +function copyingCustomSystem() +{ + info "copying 10-vchiq-permissions.rules" + cp --preserve=mode "${CONFIG_PATH}/10-vchiq-permissions.rules" "${BUILD_PATH}/etc/udev/rules.d/" + info "Making /etc/modules" + echo -e "vchiq\nsnd_bcm2835\nvc4\nbrcmfmac" >> "${BUILD_PATH}"/etc/modules + + ARM_BOOT="${BUILD_PATH}/mnt/arm_boot" + if ! [ -d "${ARM_BOOT}" ]; then + mkdir -p "${ARM_BOOT}" + fi + info "copying modprobe.conf" + /usr/bin/cp -v --preserve=mode "${CONFIG_PATH}/modprobe.conf" "${BUILD_PATH}/etc/" + chown root:root "${BUILD_PATH}/etc/modprobe.conf" + + info "copying firmware, overlays in rpi boot partition" +# cp -v --preserve=mode "${BUILD_PATH}/usr/lib/linux-"* "${BOOT}/dtb" + cp -v --preserve=mode "${FIRMWARE_PATH}/${FIRMWARE_DIR}/boot/start"* "${ARM_BOOT}/" + cp -v --preserve=mode "${FIRMWARE_PATH}/${FIRMWARE_DIR}/boot/fixup"* "${ARM_BOOT}/" + cp -v --preserve=mode "${FIRMWARE_PATH}/${FIRMWARE_DIR}/boot/bootcode.bin"* "${ARM_BOOT}/" + cp -vR --preserve=mode "${FIRMWARE_PATH}/${FIRMWARE_DIR}/boot/overlays" "${ARM_BOOT}/" + + info "copying u-boot binary to ${ARM_BOOT}" + case ${TARGET_VERSION} in + "0") + info "copying u-boot for ${TARGET} 0" + cp --preserve=mode "${BUILD_PATH}/usr/lib/u-boot/rpi_0_w/u-boot.bin" "${ARM_BOOT}/kernel.img" + ;; + "1") + info "copying u-boot for ${TARGET} 1" + cp --preserve=mode "${BUILD_PATH}/usr/lib/u-boot/rpi/u-boot.bin" "${ARM_BOOT}/kernel.img" + ;; + "2") + info "copying u-boot for ${TARGET} 2" + cp --preserve=mode "${BUILD_PATH}/usr/lib/u-boot/rpi_2/u-boot.bin" "${ARM_BOOT}/kernel.img" + ;; + "3_32") + info "copying u-boot for ${TARGET} 3 32 bits" + cp --preserve=mode "${BUILD_PATH}/usr/lib/u-boot/rpi_3_32b/u-boot.bin" "${ARM_BOOT}/kernel.img" + ;; + "3+") + info "copying u-boot for ${TARGET} 3b+ 32 bits" + cp --preserve=mode "${BUILD_PATH}/usr/lib/u-boot/rpi_3_32b/u-boot.bin" "${ARM_BOOT}/kernel.img" + ;; + esac + +# info "copying raspberry optionals files in opt" +# /bin/rsync -rlptDH "${FIRMWARE_PATH}/${FIRMWARE_DIR}/opt/" "${BUILD_PATH}/opt/" + + info "copying wifi firmware file missing in kernel-firmware-nonfree" + if ! [ -d "${ROOT}/usr/lib/firmware/brcm/" ]; then + /bin/mkdir -p "${ROOT}/usr/lib/firmware/brcm/" + fi + if ! [ -f "${ROOT}/usr/lib/firmware/brcm/brcmfmac434"* ]; then + /bin/cp --preserve=mode "${CONFIG_PATH}/brcmfmac434"* "${ROOT}/usr/lib/firmware/brcm/" + if [ ${?} -ne 0 ]; then + error "line ${LINENO} error copying wifi firmware in ${ROOTP}/usr/lib/firmware/brcm/ : exiting" + exit ${ERR_1} + fi + 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}/" + return 0 +} diff --git a/platforms/rpi3/specialFunctions.sh~ b/platforms/rpi3/specialFunctions.sh~ deleted file mode 100755 index 97e25d4..0000000 --- a/platforms/rpi3/specialFunctions.sh~ +++ /dev/null @@ -1,129 +0,0 @@ -#!/bin/bash - -#RPI partitionning : -DEFAULT="" -NEW_PART=n -PRIMARY=p -CHANGE_TYPE=t -CHANGE_BOOTFLAG=a -APPLY=w - -PART_BOOT=1 -PART_BOOT_FIRST_SECTOR=${DEFAULT} -PART_BOOT_SIZE="+128M" - -PART_ROOT=2 -PART_ROOT_FIRST_SECTOR=${DEFAULT} -PART_ROOT_SIZE=${DEFAULT} - -TYPE_FAT32LBA=c - -FDISK_SCRIPT="${NEW_PART}\n${PRIMARY}\n${PART_BOOT}\n${PART_BOOT_FIRST_SECTOR}\n${PART_BOOT_SIZE}\n${CHANGE_TYPE}\n${TYPE_FAT32LBA}\n${NEW_PART}\n${PRIMARY}\n${PART_ROOT}\n${PART_ROOT_FIRST_SECTOR}\n${PART_ROOT_SIZE}\n${CHANGE_BOOTFLAG}\n${PART_BOOT}\n${CHANGE_BOOTFLAG}\n${PART_ROOT}\n${APPLY}\n" - - -function preImgCreation() -{ - title "Creating Pi image" - - if ! [ -d "${FIRMWARE_PATH}/${FIRMWARE_DIR}" ]; then # the firmware directory does not exists - echo "$(ls *.zip| wc -l)" - if [ "$(ls *.zip| wc -l)" -eq 0 ]; then # the firmware archive does not exists - warning "The raspberry pi firmware need to be downloaded" - info "Downloading FIRMWARE_FILENAME" - wget ${FIRMWARE_DOWNLOAD_URL} - if [ ${?} -ne 0 ]; then - error "line ${LINENO} error downloading raspberry firmware at ${FIRMWARE_DOWNLOAD_URL}: exiting" - exit 1 - fi - fi - info "extracting firmware" - unzip -d "${FIRMWARE_PATH}" *.zip - if [ ${?} -ne 0 ]; then - error "line ${LINENO} error unzipping ${FIRMWARE_PATH} : exiting" - exit 1 - fi - fi - - title "Making raspberry pi image" - return 0 -} - -function postPrepareChroot() -{ - #Nothing to do. (Except replacing default function.) - return 0 -} - -function bunrningBootloader() -{ - #Nothing to do. (Except replacing default function.) - return 0 -} - - -function copyingCustomSystem() -{ - info "copying 10-vchiq-permissions.rules" - cp --preserve=mode "${CONFIG_PATH}/10-vchiq-permissions.rules" "${BUILD_PATH}/etc/udev/rules.d/" - info "Making /etc/modules" - echo -e "vchiq\nsnd_bcm2835\nvc4\nbrcmfmac" >> "${BUILD_PATH}"/etc/modules - - ARM_BOOT="${BUILD_PATH}/mnt/arm_boot" - if ! [ -d "${ARM_BOOT}" ]; then - mkdir -p "${ARM_BOOT}" - fi - info "copying modprobe.conf" - /usr/bin/cp -v --preserve=mode "${CONFIG_PATH}/modprobe.conf" "${BUILD_PATH}/etc/" - chown root:root "${BUILD_PATH}/etc/modprobe.conf" - - info "copying firmware, overlays in rpi boot partition" -# cp -v --preserve=mode "${BUILD_PATH}/usr/lib/linux-"* "${BOOT}/dtb" - cp -v --preserve=mode "${FIRMWARE_PATH}/${FIRMWARE_DIR}/boot/start"* "${ARM_BOOT}/" - cp -v --preserve=mode "${FIRMWARE_PATH}/${FIRMWARE_DIR}/boot/fixup"* "${ARM_BOOT}/" - cp -v --preserve=mode "${FIRMWARE_PATH}/${FIRMWARE_DIR}/boot/bootcode.bin"* "${ARM_BOOT}/" - cp -vR --preserve=mode "${FIRMWARE_PATH}/${FIRMWARE_DIR}/boot/overlays" "${ARM_BOOT}/" - - info "copying u-boot binary to ${ARM_BOOT}" - case ${TARGET_VERSION} in - "0") - info "copying u-boot for ${TARGET} 0" - cp --preserve=mode "${BUILD_PATH}/usr/lib/u-boot/rpi_0_w/u-boot.bin" "${ARM_BOOT}/kernel.img" - ;; - "1") - info "copying u-boot for ${TARGET} 1" - cp --preserve=mode "${BUILD_PATH}/usr/lib/u-boot/rpi/u-boot.bin" "${ARM_BOOT}/kernel.img" - ;; - "2") - info "copying u-boot for ${TARGET} 2" - cp --preserve=mode "${BUILD_PATH}/usr/lib/u-boot/rpi_2/u-boot.bin" "${ARM_BOOT}/kernel.img" - ;; - "3_32") - info "copying u-boot for ${TARGET} 3 32 bits" - cp --preserve=mode "${BUILD_PATH}/usr/lib/u-boot/rpi_3_32b/u-boot.bin" "${ARM_BOOT}/kernel.img" - ;; - "3+") - info "copying u-boot for ${TARGET} 3b+ 32 bits" - cp --preserve=mode "${BUILD_PATH}/usr/lib/u-boot/rpi_3_32b/u-boot.bin" "${ARM_BOOT}/kernel.img" - ;; - esac - -# info "copying raspberry optionals files in opt" -# /bin/rsync -rlptDH "${FIRMWARE_PATH}/${FIRMWARE_DIR}/opt/" "${BUILD_PATH}/opt/" - - info "copying wifi firmware file missing in kernel-firmware-nonfree" - if ! [ -d "${ROOT}/usr/lib/firmware/brcm/" ]; then - /bin/mkdir -p "${ROOT}/usr/lib/firmware/brcm/" - fi - if ! [ -f "${ROOT}/usr/lib/firmware/brcm/brcmfmac434"* ]; then - /bin/cp --preserve=mode "${CONFIG_PATH}/brcmfmac434"* "${ROOT}/usr/lib/firmware/brcm/" - if [ ${?} -ne 0 ]; then - error "line ${LINENO} error copying wifi firmware in ${ROOTP}/usr/lib/firmware/brcm/ : exiting" - exit ${ERR_1} - fi - 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}/" - return 0 -} diff --git a/tools/resize_root.sh b/tools/resize_root.sh new file mode 100755 index 0000000..99aee12 --- /dev/null +++ b/tools/resize_root.sh @@ -0,0 +1,32 @@ +#!/bin/sh + +DEVICE="/dev/mmcblk0" +ROOT_PARTITION="${DEVICE}p1" +ROOT_PARTITION="1" + +echo "Warning : this an early version to resize the root partition. Check the source code to ensure what you are doing." +if [ ${1} = "force" ]; then + #Check dependency + hash growpart + if [ ${?} -ne 0 ]; then + echo "install cloud-utils-growpart first. Hint : urpmi cloud-utils-growpart" + exit 1 + fi + + #Check the partition : + e2fsck -f ${ROOT_PARTITION} + + #Change the size : BUG: app doesn't support "octet". + LC_ALL=C growpart ${DEVICE} ${ROOT_PARTITION} + + #Resize the partition with the new size : + resize2fs ${ROOT_PARTITION} + + #Sync (just to be sure) + sync +else + echo "If you read the source code, you should not have read that message... Exiting with out touching the partition." +fi + +#Quit +exit 0 diff --git a/tools/resize_root.sh~ b/tools/resize_root.sh~ deleted file mode 100755 index 99aee12..0000000 --- a/tools/resize_root.sh~ +++ /dev/null @@ -1,32 +0,0 @@ -#!/bin/sh - -DEVICE="/dev/mmcblk0" -ROOT_PARTITION="${DEVICE}p1" -ROOT_PARTITION="1" - -echo "Warning : this an early version to resize the root partition. Check the source code to ensure what you are doing." -if [ ${1} = "force" ]; then - #Check dependency - hash growpart - if [ ${?} -ne 0 ]; then - echo "install cloud-utils-growpart first. Hint : urpmi cloud-utils-growpart" - exit 1 - fi - - #Check the partition : - e2fsck -f ${ROOT_PARTITION} - - #Change the size : BUG: app doesn't support "octet". - LC_ALL=C growpart ${DEVICE} ${ROOT_PARTITION} - - #Resize the partition with the new size : - resize2fs ${ROOT_PARTITION} - - #Sync (just to be sure) - sync -else - echo "If you read the source code, you should not have read that message... Exiting with out touching the partition." -fi - -#Quit -exit 0 -- cgit v1.2.1