diff options
author | Jybz <j.biernacki+mga@free.fr> | 2020-11-03 11:21:40 +0100 |
---|---|---|
committer | Jybz <j.biernacki+mga@free.fr> | 2020-11-03 11:21:40 +0100 |
commit | f72edb40ed7312a14a02b5fbfc6bd488c2433821 (patch) | |
tree | 107deb0dffad3736d3dd03d82cecc5d9d3712bab | |
parent | 1253b3a7059e24f6aa0021f6ddf17f40087e590a (diff) | |
download | mageia4arm-f72edb40ed7312a14a02b5fbfc6bd488c2433821.tar mageia4arm-f72edb40ed7312a14a02b5fbfc6bd488c2433821.tar.gz mageia4arm-f72edb40ed7312a14a02b5fbfc6bd488c2433821.tar.bz2 mageia4arm-f72edb40ed7312a14a02b5fbfc6bd488c2433821.tar.xz mageia4arm-f72edb40ed7312a14a02b5fbfc6bd488c2433821.zip |
big update...
19 files changed, 618 insertions, 743 deletions
diff --git a/create_arm_image.sh b/create_arm_image.sh index 2649bc0..e56f2aa 100755 --- a/create_arm_image.sh +++ b/create_arm_image.sh @@ -23,31 +23,57 @@ export LC_ALL=C source "$(dirname $(realpath "$0"))/functions.sh" function help() { - echo -e "${CMDNAME} [option] [size of image in Go]" + echo -e "${CMDNAME} [option]" echo -e "Options:" - echo -e "--all create ready to burn image of Mageia ${MAGEIA_VERSION}" - echo -e "--clean Clean all (suppress all) to make a new image" - echo -e "--size size of image default: 7Go" - echo -e "--build-path Path to the build directory of the image of Mageia ${MAGEIA_VERSION}" - echo -e "--target target system (for now rpi, odroid)" - echo -e "--target-version version of the target (0, 1, 2, 3 for rpi, 3 or 4 for odroid)" - echo -e "--config Path to config files" - echo -e "--bootfs filesystem of boot partition (ext4 or vfat) default: ext4" - echo -e "--nonfree activate nonfree repos" - echo -e "--tainted activate tainted repos" - - echo -e "\nBuild levels:" - echo -e "--create-chroot Create the chroot directory" - echo -e "--install-basesystem install base system" - echo -e "--add-urpmimedia add mirrors for urpmi" - echo -e "--chroot chroot to arm directory and launch packages installation" - echo -e "--create-image Create the image of Mageia ${MAGEIA_VERSION}" - echo -e "--config Path to config files (rpi2 rpi3 rpi3+ xu4 bananaPro)" + echo -e "--all create ready to burn image of Mageia ${MAGEIA_VERSION}" + echo -e "--build-path Path to the build directory of the image of Mageia ${MAGEIA_VERSION}" + echo -e "--clean Clean all (suppress all) to make a new image" + echo -e "--log [file] logs the output into mga4arm-YYYY-MM-DD-HH-MM-\${config}.log or specific file." + echo -e "--config [name | path] A name of a default config or a path to a config files" + echo -e "--target target system (for now rpi, odroid)" + echo -e "--target-version version of the target (0, 1, 2, 3 for rpi, 3 or 4 for odroid)" +# echo -e "--bootfs filesystem of boot partition (ext4 or vfat) default: ext4" + echo -e "--nonfree activate nonfree repos" + echo -e "--size size of image default: 7Go" + echo -e "--tainted activate tainted repos" + echo -e "--desktop [xfce|...] add a desktop environment task" + echo -e "--package \"pkg1 pkg2\" One space separated list of package to install" + + echo -e "\nBuild levels:" + echo -e "--create-chroot Create the chroot directory" + echo -e "--install-basesystem install base system" + echo -e "--add-urpmimedia add mirrors for urpmi" + echo -e "--chroot chroot to arm directory and launch packages installation" + echo -e "--create-image Create the image of Mageia ${MAGEIA_VERSION}" echo -e "\nFor image size, make sure it fit on physical support. (Default size is 7 Go)" } +CMD_LINE="${@}" +if [ 0 -ne $(echo "${CMD_LINE}" | grep -c '\-\-log') ]; then + if [ 0 -ne $(echo "${CMD_LINE}" | grep -c '\-\-config') ]; then + CONFIG_NAME="$(echo "${CMD_LINE}" | sed -e 's/^.*--config //' | sed -e 's/[[:space:]]*--.*$//' | sed -e 's/.*\/\([-_+[:alnum:]]*\)$/\1/' | tr ' ' '_')" + if [ "x" = "${CONFIG_NAME}x" ]; then + CONFIG_NAME="noconf" + fi + else + CONFIG_NAME="noconf" + fi + LOGFILE="$(echo "${CMD_LINE}" | sed -e 's/^.*--log //' | sed -e 's/[[:space:]]*--.*$//' )" + if [ "x" = "${LOGFILE}x" ]; then + LOGFILE="./mga4arm-$(date "+%Y-%m-%d-%H:%M:%S")-${CONFIG_NAME}.log" + LOGCMD="--log " + else + LOGCMD="--log ${lOGFILE}" + fi + CMD_LINE="$(echo ${CMD_LINE} | sed -e "s/${LOGCMD}//" )" + touch ${LOGFILE} + /usr/bin/chown ${USER}:${USER} ${LOGFILE} + exec ${0} ${CMD_LINE} 2>&1 | tee ${LOGFILE} + exit +fi + info ${0} #Check dependencies : @@ -55,10 +81,10 @@ info ${0} # error "qemu-user-static package is needed." # exit ${ERR_DEPENDENCY_MISSING} #fi -# if [ 0 -ne $(id -u) ]; then -# error "Script need to be run as root." -# exit ${ERR_NOT_ROOT} -# fi +if [ 0 -ne $(id -u) ]; then + error "Script need to be run as root." + exit ${ERR_NOT_ROOT} +fi SOURCE_PATH="$(/usr/bin/dirname "$(readlink -f "${0}")")" INSTALL_PATH="$(pwd)/build" @@ -120,7 +146,7 @@ while true; do ;; --config) PATH_NOT_NAME=$(echo "${2}" | grep '/' 2>&1 1>/dev/null && echo "true" || echo "false" ) - if [ $PATH_NOT_NAME == true ] ; then + if [ ${PATH_NOT_NAME} == true ] ; then CONFIG_PATH="${2}" else CONFIG_PATH="${PLATFORMS_PATH}/${2}" @@ -139,6 +165,10 @@ while true; do fi shift ;; + --desktop) + DESKTOP="task-${2}" + shift 2 + ;; -h|--help) help exit 0 @@ -159,6 +189,10 @@ while true; do NONFREE_P=1 shift ;; + --package) + PACKAGE="${2}" + shift + ;; --prepare-chroot) if [ -z ${OPT} ]; then OPT="preparechroot" @@ -232,13 +266,13 @@ else fi # VARIABLE_A=${VARIABLE_B_IF_EXISTS:=${VARIABLE_C_IF_B_DOESNT_EXISTS}} -IMAGE_SIZE=${IMAGE_SIZE_P:=${IMAGE_SIZE}} -INSTALL_PATH=${INSTALL_PATH_P:=${INSTALL_PATH}} -TARGET=${TARGET_P:=${TARGET}} -TARGET_VERSION=${TARGET_VERSION_P:=${TARGET_VERSION}} -BOOTFS=${BOOTFS_P:=${BOOTFS}} -NONFREE=${NONFREE_P:=0} -TAINTED=${TAINTED_P:=0} +IMAGE_SIZE="${IMAGE_SIZE_P:=${IMAGE_SIZE}}" +INSTALL_PATH="${INSTALL_PATH_P:=${INSTALL_PATH}}" +TARGET="${TARGET_P:=${TARGET}}" +TARGET_VERSION="${TARGET_VERSION_P:=${TARGET_VERSION}}" +BOOTFS="${BOOTFS_P:=${BOOTFS}}" +NONFREE="${NONFREE_P:=0}" +TAINTED="${TAINTED_P:=0}" info "Option: "${OPT} @@ -263,9 +297,9 @@ info "Firmware dir : ${FIRMWARE_DIR}" info "Installation method : ${INSTALL_METHOD}" # Defining default image size to 7 go -if [[ "${IMAGE_SIZE}" -lt 2 ]] || [[ "${IMAGE_SIZE}" -gt 128 ]]; then - IMAGE_SIZE=7 -fi +# if [[ "${IMAGE_SIZE}" -lt 2 ]] || [[ "${IMAGE_SIZE}" -gt 128 ]]; then +# IMAGE_SIZE=7 +# fi # change dir to install path and create it if not existing if [ "${OPT}" != "clean" ]; then @@ -302,6 +336,7 @@ case ${OPT} in exit ${ERR_NO_SPACE} fi fi + ckeck_extrapackage createImageWrap #Create the empty .img mountPartitions createchroot #Check qemu and activate it @@ -318,6 +353,10 @@ case ${OPT} in bunrningBootloader unmountingPartitions unloopingImage + + warning "You can now burn the image ( ${INSTALL_PATH}/${IMAGE} ) on SD card" + info "pv \"${INSTALL_PATH}/${IMAGE}\" | dd of=/dev/mmcblk#" + generateExtra ;; "createchroot") createchroot @@ -352,4 +391,5 @@ if [ ${ERRORN} -ne 0 ]; then warning "Some errors occurs : ${ERRORN} errors" fi +unset exit exit ${ERRORN} diff --git a/functions.sh b/functions.sh index 677af95..78285bc 100755 --- a/functions.sh +++ b/functions.sh @@ -1,7 +1,7 @@ #!/usr/bin/bash -# Copyright (C) 2017-2018 Daniel Tartavel-jeannot <contact@librepc.com> -# Jean-Baptiste Biernacki <j.biernacki@free.fr> +# Copyright (C) 2017-2020 Daniel Tartavel-jeannot <contact@librepc.com> +# 2019-2020 Jean-Baptiste Biernacki <j.biernacki@free.fr> # Copyright (C) 2020 Neal Gompa <ngompa13@gmail.com> # # This program is free software; you can redistribute it and/or modify @@ -24,6 +24,19 @@ function timestamp() { date "+[%H:%M:%S]" } +function exit(){ + if [ 0 -ne ${#} ]; then + if [ 0 -ne ${1} ]; then + warning "unmounting all mounted files before exit" + unmountdevsysproc + unmountingPartitions + unloopingImage + fi + fi + + unset exit + exit $@ +} function WaitToContinue() { read -p "Break... Press [ENTER] to continue." GARBAGE @@ -46,8 +59,7 @@ function error() { } -function verify_disk_space() -{ +function verify_disk_space() { title "Verifying if there is enough space on disk to make the image" DISK_SPACE=$(/usr/bin/df -BG --output=avail "${INSTALL_PATH}" | sed '1d;s/[^0-9]//g') info "Free disk space: ${DISK_SPACE}G" @@ -62,8 +74,7 @@ function verify_disk_space() # creation of install path and copy of qemu ( installing it if not yet installed ) -function createchroot() -{ +function createchroot() { title "Making chroot" if ! [ -f /usr/share/distribution-gpg-keys/mageia/RPM-GPG-KEY-Mageia ]; then title "distribution-gpg-keys package not present : installing distribution-gpg-keys" @@ -85,6 +96,7 @@ function createchroot() fi fi # Starting qemu service if not started + info "check systemd-binfmt service : " /usr/bin/systemctl is-active systemd-binfmt.service if [ ${?} -ne 0 ]; then title "Starting systemd-binfmt.service" @@ -93,20 +105,19 @@ function createchroot() error "line ${LINENO} can't start qemu-user-static : exiting" exit ${ERR_1} fi - else - title "Restarting systemd-binfmt.service" - /usr/bin/systemctl restart systemd-binfmt.service - if [ ${?} -ne 0 ]; then - error "line ${LINENO} can't start qemu-user-static : exiting" - exit ${ERR_1} - fi +# else +# title "Restarting systemd-binfmt.service" +# /usr/bin/systemctl restart systemd-binfmt.service +# if [ ${?} -ne 0 ]; then +# error "line ${LINENO} can't start qemu-user-static : exiting" +# exit ${ERR_1} +# fi fi return 0 } # enabling extra Mageia repositories -function genusemirroroptions() -{ +function genusemirroroptions() { DNF_MIRROROPTS="--config=${DNF_CONFIGPATH} --forcearch=${ARM_VERSION} --nogpgcheck --releasever=${MAGEIA_VERSION}" if [ ! -z "${MIRROR}" ]; then @@ -133,8 +144,7 @@ function genusemirroroptions() } # enabling extra Mageia repositories -function enableextrarepos() -{ +function enableextrarepos() { extrasect_baseprefix="mageia" # if [ "${MAGEIA_VERSION}" = "cauldron" ]; then # extrasect_baseprefix="cauldron" @@ -173,8 +183,7 @@ function enableextrarepos() } # adding Mageia urpmi repositories -function addurpmimedia() -{ +function addurpmimedia() { title "Creating media ${MIRROR}" info "Removing old media" @@ -214,8 +223,7 @@ function addurpmimedia() return 0 } -function updateurpmmirror() -{ +function updateurpmmirror() { title "updating mirror" /sbin/urpmi.update -a --urpmi-root "${BUILD_PATH}" if [ ${?} -ne 0 ]; then @@ -225,8 +233,7 @@ function updateurpmmirror() return 0 } -function installbasesystem() -{ +function installbasesystem() { # Create Build path if ! [ -d "${BUILD_PATH}" ]; then warning "Build path ( ${BUILD_PATH} ) does not exist, do you want to create it ? [Y|n] " @@ -272,17 +279,16 @@ function installbasesystem() return 0 } -function installpkg() -{ +function installpkg() { if [ ${INSTALL_METHOD} = "urpmi" ]; then - /usr/sbin/urpmi --urpmi-root "$BUILD_PATH" --ignorearch --no-verify-rpm --auto --split-level 200 --split-length 200 $3 $1; + /usr/sbin/urpmi --urpmi-root "${BUILD_PATH}" --root "${BUILD_PATH}" --ignorearch --no-verify-rpm --auto --split-level 200 --split-length 200 $3 $1; else /usr/bin/dnf $2 --installroot="${BUILD_PATH}" ${DNF_MIRROROPTS} --assumeyes install $1; fi } -function preparechroot() -{ + +function preparechroot() { title "Preparing chrooting in ${BUILD_PATH}" info "making /etc/hostname" @@ -297,7 +303,7 @@ function preparechroot() fi info "configuring second_stage_install.sh for ${INSTALL_METHOD}" if [ ${INSTALL_METHOD} = "urpmi" ]; then - sed -i -e "s/<INSTALL_EXEC>/sbin\/urpmi --no-verify-rpm --auto/g" "${BUILD_PATH}/second_stage_install.sh" + sed -i -e "s/<INSTALL_EXEC>/sbin\/urpmi --no-verify-rpm --auto --split-length 0/g" "${BUILD_PATH}/second_stage_install.sh" else sed -i -e "s/<INSTALL_EXEC>/bin\/dnf --nogpgcheck --assumeyes install/g" "${BUILD_PATH}/second_stage_install.sh" fi @@ -329,32 +335,76 @@ function preparechroot() return 0 } - -function jumpchroot() -{ - title "chrooting to ${BUILD_PATH}" +function mountdevsysproc(){ info "mounting dev, sys, proc directories in chroot" /usr/bin/mount -B /dev "${BUILD_PATH}/dev" +# mkdir ${BUILD_PATH}/dev +# ln -s ${DEVICE} ${BUILD_PATH}/dev/loop0 +# if [ 1 -eq ${SEPARATE_BOOT_PARTITION} ]; then +# ln -s ${BOOTP} ${BUILD_PATH}/dev/loop0p1 +# ln -s ${ROOTP} ${BUILD_PATH}/dev/loop0p2 +# else +# ln -s ${ROOTP} ${BUILD_PATH}/dev/loop0p1 +# fi if [ ${?} -ne 0 ]; then error "line ${LINENO} error mounting ${BUILD_PATH}/dev : exiting" exit ${ERR_1} fi + MOUNTED_DEV=true /usr/bin/mount -B /sys "${BUILD_PATH}/sys" if [ ${?} -ne 0 ]; then error "line ${LINENO} error mounting ${BUILD_PATH}/sys : exiting" exit ${ERR_1} fi + MOUNTED_SYS=true /usr/bin/mount -B /proc "${BUILD_PATH}/proc" if [ ${?} -ne 0 ]; then error "line ${LINENO} error mounting ${BUILD_PATH}/proc : exiting" exit ${ERR_1} fi + MOUNTED_PROC=true + return 0 +} + +function unmountdevsysproc(){ + info "unmounting dev, sys, proc" +# LIST_MOUNTED=$(/usr/bin/mount -l | grep mageia4arm) + if [ ${MOUNTED_DEV:=false} = true ]; then + /usr/bin/umount -lf "${BUILD_PATH}/dev" + if [ ${?} -ne 0 ]; then + warning "line ${LINENO} Warning : error unmounting ${BUILD_PATH}/dev, continuing anyway" + ERRORN=$((${ERRORN}+1)) + fi + fi + if [ ${MOUNTED_PROC:=false} = true ]; then + /usr/bin/umount -lf "${BUILD_PATH}/proc" + if [ ${?} -ne 0 ]; then + warning "line ${LINENO} Warning : error unmounting ${BUILD_PATH}/proc, continuing anyway" + ERRORN=$((${ERRORN}+1)) + fi + fi + if [ ${MOUNTED_SYS:=false} = true ]; then + /usr/bin/umount -lf "${BUILD_PATH}/sys" + if [ ${?} -ne 0 ]; then + warning "line ${LINENO} Warning : error unmounting ${BUILD_PATH}/sys, continuing anyway" + ERRORN=$((${ERRORN}+1)) + fi + fi + return 0 +} + +function jumpchroot() { + title "chrooting to ${BUILD_PATH}" + + mountdevsysproc + info "Copying resolv.conf" /usr/bin/cp -v --preserve=mode /etc/resolv.conf "${BUILD_PATH}/etc/" if [ ${?} -ne 0 ]; then error "line ${LINENO} error copying ${BUILD_PATH}/etc/resolv.conf : exiting" exit ${ERR_1} fi + info "chrooting to ${BUILD_PATH}" if [ "$OPT" = "chroot" ]; then info "/sbin/chroot ${BUILD_PATH}" @@ -374,28 +424,13 @@ function jumpchroot() fi fi - info "unmounting dev, sys, proc" - /usr/bin/umount -lf "${BUILD_PATH}/dev" - if [ ${?} -ne 0 ]; then - warning "line ${LINENO} Warning : error unmounting ${BUILD_PATH}/dev, continuing anyway" - ERRORN=$((${ERRORN}+1)) - fi - /usr/bin/umount -lf "${BUILD_PATH}/sys" - if [ ${?} -ne 0 ]; then - warning "line ${LINENO} Warning : error unmounting ${BUILD_PATH}/sys, continuing anyway" - ERRORN=$((${ERRORN}+1)) - fi - /usr/bin/umount -lf "${BUILD_PATH}/proc" - if [ ${?} -ne 0 ]; then - warning "line ${LINENO} Warning : error unmounting ${BUILD_PATH}/proc, continuing anyway" - ERRORN=$((${ERRORN}+1)) - fi + unmountdevsysproc + return 0 } -function createImageWrap() -{ +function createImageWrap() { title "Wrap image creation" preImgCreation if [ ${?} -ne 0 ]; then @@ -403,18 +438,22 @@ function createImageWrap() exit ${ERR_1} fi createimage - if [ -z "${BOOTFS}" ]; then - BOOTFS="ext4" - fi + +# loopingImage + + partitionningimage + + BOOTFS=${BOOTFS:="ext4"} formatpartitions ${BOOTFS} ext4 + + loopingImage return 0 } - -function createimage() -{ - title " in ${IMAGE}" +function createimage() { + title "Createimage" + info "will be the file : ${INSTALL_PATH}/${IMAGE}" if [ -f "${INSTALL_PATH}/${IMAGE}" ]; then warning "Deleting previous image" /usr/bin/rm -f "${INSTALL_PATH}/${IMAGE}" @@ -424,81 +463,139 @@ function createimage() fi fi - warning "please wait until end of image creation" - /usr/bin/dd if=/dev/zero of="${INSTALL_PATH}/${IMAGE}" bs=1MB count=$(( ${IMAGE_SIZE} * 1024 )) status=progress +# warning "please wait until end of image creation" +# /usr/bin/dd if=/dev/zero of="${INSTALL_PATH}/${IMAGE}" bs=1MB count=$(( ${IMAGE_SIZE} * 1024 )) status=progress + /usr/bin/truncate -s ${IMAGE_SIZE}G "${INSTALL_PATH}/${IMAGE}" if [ ${?} -ne 0 ]; then error "line ${LINENO} can't make image at ${INSTALL_PATH}/${IMAGE} : exiting" exit ${ERR_1} fi + /usr/bin/chown ${USER}:${USER} "${INSTALL_PATH}/${IMAGE}" - loopingImage - - if [ ${?} -ne 0 ]; then - error "line ${LINENO} error in the process ${CONFIG_PATH}/specialFunctions.sh ." - exit ${ERR_1} - fi - - info "making partitions" - echo -e "${FDISK_SCRIPT}" | /sbin/fdisk ${DEVICE} + return 0 +} - #Activate 'pY' : /dev/loopXpY - partx -vu "${DEVICE}" - #Previous function give us a list of partition. It is easy to get it and define prior this list the partition. - #But... How to distinguish between the boot p1 and the root p2 if both are empty and ext4 ? ... - if [ 1 -eq ${SEPARATE_BOOT_PARTITION} ]; then - BOOTP="${DEVICE}p1" - ROOTP="${DEVICE}p2" +function partitionningimage() { + title "Partitionning image" + +# if [ "x" != "${FDISK_SCRIPT:="x"}" ]; then +# echo -e "${FDISK_SCRIPT}" | /sbin/fdisk ${DEVICE} +# el + if [ "x" != "${SFDISK_SCRIPT:="x"}" ]; then + HDD_INFO="$(echo -e "${SFDISK_SCRIPT}" | /usr/sbin/sfdisk "${INSTALL_PATH}/${IMAGE}")" + echo "${HDD_INFO}" + SECTOR_SIZE="$(echo "${HDD_INFO}" | grep -m1 "Units: sectors" | sed -e 's/^.* \([[:digit:]]\+\) bytes[[:space:]]*$/\1/')" + if [ 1 -eq ${SEPARATE_BOOT_PARTITION} ]; then + BOOT_P_INFO=$(echo "${HDD_INFO}" | grep -m1 -A3 "^Device" | grep "${IMAGE}1" | tr '*' ' ' | sed -e 's/[[:space:]]\+/ /g') + ROOT_P_INFO=$(echo "${HDD_INFO}" | grep -m1 -A3 "^Device" | grep "${IMAGE}2" | tr '*' ' ' | sed -e 's/[[:space:]]\+/ /g') + BOOT_OFFSET_S="$(echo "${BOOT_P_INFO}" | sed -e "s/^.*${IMAGE}[[:digit:]][[:space:]\*]\+//g" | cut -d ' ' -f 1)" + BOOT_NB_SECTORS=$(echo "${BOOT_P_INFO}" | sed -e "s/^.*${IMAGE}[[:digit:]][[:space:]\*]\+//g" | cut -d ' ' -f 3) + BOOT_SIZE_KB="$((${SECTOR_SIZE}*${BOOT_NB_SECTORS}/1024))" + BOOT_SIZE_B="$((${SECTOR_SIZE}*${BOOT_NB_SECTORS}))" + BOOT_OFFSET_KB="$((${SECTOR_SIZE}*${BOOT_OFFSET_S}/1024))" + info "Boot offset : ${BOOT_OFFSET_S}" + info "Boot offset (kB) : ${BOOT_OFFSET_KB}" + info "Boot sectors : ${BOOT_NB_SECTORS}" + info "Boot size (kB) : ${BOOT_SIZE_KB}" + info "Boot size (B) : ${BOOT_SIZE_B}" + else + ROOT_P_INFO=$(echo "${HDD_INFO}" | grep -m1 -A3 "^Device" | grep "${IMAGE}1") + fi + ROOT_OFFSET_S=$(echo "${ROOT_P_INFO}" | sed -e "s/^.*${IMAGE}[[:digit:]][[:space:]\*]\+//g" | cut -d ' ' -f 1) + ROOT_NB_SECTORS=$(echo "${ROOT_P_INFO}" | sed -e "s/^.*${IMAGE}[[:digit:]][[:space:]\*]\+//g" | cut -d ' ' -f 3) + ROOT_SIZE_KB="$((${SECTOR_SIZE}*${ROOT_NB_SECTORS}/1024))" + ROOT_OFFSET_B="$((${SECTOR_SIZE}*${ROOT_OFFSET_S}))" + + info "Root offset : ${ROOT_OFFSET_S}" + info "Root offset (B) : ${ROOT_OFFSET_B}" + info "Root sectors : ${ROOT_NB_SECTORS}" + info "Root size kB : ${ROOT_SIZE_KB}" else - ROOTP="${DEVICE}p1" + error "Error, no partitionning script found." fi + return 0 } - -function loopingImage() -{ +function loopingImage() { title "Looping image ..." # Mettre en place et contrôler des périphériques boucle. # -f, --find trouver le premier périphérique inutilisé # --show afficher le nom du périphérique après configuration (avec -f) - DEVICE=$(/sbin/losetup -f --show "${INSTALL_PATH}/${IMAGE}") +# DEVICE=$(/usr/sbin/losetup -f --show "${INSTALL_PATH}/${IMAGE}") + DEVICE=$(/usr/bin/udisksctl loop-setup -f ${INSTALL_PATH}/${IMAGE} | sed -e 's/^.*\/dev\//\/dev\//' -e 's/\.$//') + info "Image looped on ${DEVICE}" + + + #Previous function give us a list of partition. It is easy to get it and define prior this list the partition. + #But... How to distinguish between the boot p1 and the root p2 if both are empty and ext4 ? ... + if [ 1 -eq ${SEPARATE_BOOT_PARTITION} ]; then + BOOTP="${DEVICE}p1" + ROOTP="${DEVICE}p2" + +# BOOT_UUID=$(/usr/sbin/blkid -s UUID -o value UUID "${BOOTP}") + BOOT_UUID=$(/usr/bin/lsblk -n -o UUID "${BOOTP}") + info "Boot UUID: ${BOOT_UUID}" + else + ROOTP="${DEVICE}p1" + fi + +# ROOT_UUID=$(/usr/sbin/blkid -s UUID -o value UUID "${ROOTP}") + ROOT_UUID=$(/usr/bin/lsblk -n -o UUID "${ROOTP}") + info "Root UUID: ${ROOT_UUID}" + return 0 } -function formatpartitions() -{ +function formatpartitions() { info "Formatting partitions" if [ 1 -eq ${SEPARATE_BOOT_PARTITION} ]; then info "Boot : ${BOOTP} as ${1}" - "/sbin/mkfs.${1}" "${BOOTP}" + if [ "vfat" = ${1} ]; then + temporary=$(mktemp) + truncate -s ${BOOT_SIZE_B} ${temporary} + FSINFO=$(/usr/sbin/mkfs.vfat -v ${temporary} ) # $((${BOOT_SIZE_KB}))) + /usr/bin/dd seek=${BOOT_OFFSET_S} if=${temporary} of=${INSTALL_PATH}/${IMAGE} + BOOT_UUID=$(echo "${FSINFO}" | grep 'Volume ID is' | sed 's/Volume ID is \([[:alnum:]]*\),.*$/\1/') + info "Boot UUID = ${BOOT_UUID}" + rm -f ${temporary} + else + FSINFO=$(yes | /usr/sbin/mkfs.ext4 -E offset=${BOOT_OFFSET_B} ${INSTALL_PATH}/${IMAGE} $((${BOOT_SIZE_KB}))k) + BOOT_UUID=$(echo "${FSINFO}" | grep 'Filesystem UUID' | sed 's/Filesystem UUID: //') + fi +# "/sbin/mkfs.${1}" "${BOOTP}" if [ ${?} -ne 0 ]; then error "line ${LINENO} error formating ${BOOTP} : exiting" - /sbin/losetup -d "${DEVICE}" +# /usr/sbin/losetup -d "${DEVICE}" + udisksctl unmount -b ${BOOTP} exit ${ERR_1} fi - BOOT_UUID=$(blkid -s UUID -o value UUID "${BOOTP}") - info "Boot UUID: ${BOOT_UUID}" +# BOOT_UUID=$(/usr/sbin/blkid -s UUID -o value UUID "${BOOTP}") +# info "Boot UUID: ${BOOT_UUID}" fi info "Root : ${ROOTP} as ${2}" - "/sbin/mkfs.${2}" "${ROOTP}" +# "/sbin/mkfs.${2}" "${ROOTP}" + echo /usr/sbin/mkfs.ext4 -E offset=${ROOT_OFFSET_B} ${INSTALL_PATH}/${IMAGE} $((${ROOT_SIZE_KB}))k + FSINFO=$(yes | /usr/sbin/mkfs.ext4 -E offset=${ROOT_OFFSET_B} ${INSTALL_PATH}/${IMAGE} $((${ROOT_SIZE_KB}))k) if [ ${?} -ne 0 ]; then error "line ${LINENO} error formating ${ROOTP} : exiting" - /sbin/losetup -d "${DEVICE}" +# /usr/sbin/losetup -d "${DEVICE}" +# udisksctl unmount -b ${ROOTP} exit ${ERR_1} fi - ROOT_UUID=$(blkid -s UUID -o value UUID "${ROOTP}") + ROOT_UUID=$(echo "${FSINFO}" | grep 'Filesystem UUID' | sed 's/Filesystem UUID: //') +# ROOT_UUID=$(/usr/sbin/blkid -s UUID -o value UUID "${ROOTP}") info "Root UUID: ${ROOT_UUID}" return 0 } -function generateExtlinux() -{ +function generateExtlinux() { info "Generate extlinux if extlinux.conf exists." if [ -e "${CONFIG_PATH}/extlinux.conf" ]; then info "\tFound extlinux.conf" @@ -507,7 +604,7 @@ function generateExtlinux() /usr/bin/rm -rf "${BUILD_PATH}/boot/extlinux" mkdir -p "${BUILD_PATH}/boot/extlinux" fi - if [ ! -f "${BUILD_PATH}/boot/extlinux/extlinux.conf" ]; then +# if [ ! -f "${BUILD_PATH}/boot/extlinux/extlinux.conf" ]; then info "\tTuning extlinux.conf" cp "${CONFIG_PATH}/extlinux.conf" "${BUILD_PATH}/boot/extlinux/extlinux.conf" #In order to use the UUID, a initrd file is necessary. @@ -515,12 +612,11 @@ function generateExtlinux() sed -i -e "s/<BOOT_ARGS>/${BOOT_ARGS}/g" "${BUILD_PATH}/boot/extlinux/extlinux.conf" KERNEL_ID=$(basename ${BUILD_PATH}/usr/lib/linux-*) sed -i -e "s/<FDTDIR>/${KERNEL_ID}/g" "${BUILD_PATH}/boot/extlinux/extlinux.conf" - fi +# fi fi } -function copyingsystem() -{ +function copyingsystem() { generateExtlinux info "Remove second_stage_install.sh" @@ -551,47 +647,40 @@ function copyingsystem() copyingcommon sync - warning "You can now burn the image ( ${INSTALL_PATH}/${IMAGE} ) on SD card" - info "pv \"${INSTALL_PATH}/${IMAGE}\" | dd of=/dev/mmcblk#" +# warning "You can now burn the image ( ${INSTALL_PATH}/${IMAGE} ) on SD card" +# info "pv \"${INSTALL_PATH}/${IMAGE}\" | dd of=/dev/mmcblk#" return 0 } -function mountPartitions(){ - info "mounting partitions, making mountpoint if necessary" +function mountPartitions() { + title "mounting partitions, making mountpoint if necessary" + ROOT=$(/usr/bin/udisksctl mount -b ${ROOTP} | sed -e 's/^.* at //' -e 's/\.$//' ) + if [ ${?} -ne 0 ]; then + error "line ${LINENO} error mounting ${ROOTP} : exiting" + exit ${ERR_1} + fi + MOUNTED_ROOT=true + info "Root partition mount in ${ROOT}" + BUILD_PATH=${ROOT} + if [ 1 -eq ${SEPARATE_BOOT_PARTITION} ]; then - if ! [ -d "${BOOT}" ]; then - /usr/bin/mkdir "${BOOT}" - if [ ${?} -ne 0 ]; then - error "line ${LINENO} error making directory ${BOOT} : exiting" - exit ${ERR_1} - fi - fi - /usr/bin/mount "${BOOTP}" "${BOOT}" + BOOT=$(/usr/bin/udisksctl mount -b ${BOOTP} | sed -e 's/^.* at //' -e 's/\.$//' ) if [ ${?} -ne 0 ]; then error "line ${LINENO} error mounting ${BOOTP} : exiting" exit ${ERR_1} fi - fi - - if ! [ -d "${ROOT}" ]; then - /usr/bin/mkdir "${ROOT}" - if [ ${?} -ne 0 ]; then - error "line ${LINENO} error making directory ${ROOT} : exiting" - exit ${ERR_1} - fi - fi - /usr/bin/mount "${ROOTP}" "${ROOT}" - if [ ${?} -ne 0 ]; then - error "line ${LINENO} error mounting ${ROOTP} : exiting" - exit ${ERR_1} + info "boot partition mount in ${BOOT}" + MOUNTED_BOOT=true + + mkdir -p "${BUILD_PATH}/boot/EFI" + /usr/bin/mount -B ${BOOT} "${BUILD_PATH}/boot/EFI" fi } -function unmountingPartitions() -{ +function unmountingPartitions() { title "Unmounting partitions..." # Syncing devices before unmounting @@ -600,79 +689,98 @@ function unmountingPartitions() if [ -z "${BOOTP}" ] && [ -z "${ROOTP}" ] ; then warning "Root partition and Boot partition not defined !" - for LOOP in $(losetup -l -O NAME,BACK-FILE -n | grep "${IMAGE}" | cut -d ' ' -f 1 ) ; do + for LOOP in $(/usr/sbin/losetup -l -O NAME,BACK-FILE -n | grep "${IMAGE}" | cut -d ' ' -f 1 ) ; do IFS=$'\n' - for PARTITION in $(mount -l | grep ${LOOP}); do + for PARTITION in $(/usr/bin/mount -l | grep ${LOOP}); do MOUNTPOINT=$(echo "$PARTITION" | cut -d ' ' -f 3) PARTITION=$(echo "$PARTITION" | cut -d ' ' -f 1) - info "unmount ${PARTITION} and remove ${MOUNTPOINT}" - /usr/bin/umount "${PARTITION}" - if [ ${?} -eq 0 ]; then - /usr/bin/rmdir "${MOUNTPOINT}" - else - error "line ${LINENO} error unmounting ${BOOT}..." + info "unmount ${PARTITION}" # and remove ${MOUNTPOINT}" + udisksctl unmount -b ${PARTITION} +# if [ ${?} -eq 0 ]; then +# /usr/bin/rmdir "${MOUNTPOINT}" +# else +# error "line ${LINENO} error unmounting ${BOOT}..." +# fi + if [ 0 -ne ${?} ]; then + error "line ${LINENO} error unmounting ${PARTITION}..." fi done unset IFS done else - if [ ! -z "${BOOTP}" ]; then - /usr/bin/umount "${BOOTP}" - if [ ${?} -eq 0 ]; then - /usr/bin/rmdir "${BOOT}" - else + if [ ${MOUNTED_BOOT:=false} = true ]; then + udisksctl unmount -b ${BOOTP} + if [ 0 -ne ${?} ]; then error "line ${LINENO} error unmounting ${BOOT}..." fi fi - /usr/bin/umount "${ROOTP}" - if [ ${?} -eq 0 ]; then - /usr/bin/rmdir "${ROOT}" - else - error "line ${LINENO} error unmounting ${ROOT}..." + if [ ${MOUNTED_ROOT:=false} = true ]; then + udisksctl unmount -b ${ROOTP} + if [ 0 -ne ${?} ]; then + error "line ${LINENO} error unmounting ${ROOT}..." + fi fi + +# if [ ! -z "${BOOTP}" ]; then +# udisksctl unmount -b ${BOOTP} +# if [ ${?} -eq 0 ]; then +# /usr/bin/rmdir "${BOOT}" +# else +# error "line ${LINENO} error unmounting ${BOOT}..." +# fi +# fi +# udisksctl unmount -b ${ROOTP} +# if [ ${?} -eq 0 ]; then +# /usr/bin/rmdir "${ROOT}" +# else +# error "line ${LINENO} error unmounting ${ROOT}..." +# fi fi return 0 } -function unloopingImage(){ +function unloopingImage() { title "Unlooping image..." # Syncing devices before unmounting /usr/bin/sync - - # [root@jabztop mageia4arm (master)]# losetup -l -O NAME,BACK-FILE -n - # /dev/loop0 /home/jibz/workspaces/mageia4arm/build/Mageia-7-bananaPro1.img (deleted) - info "Looped devices to unmount : $(losetup -l -O NAME,BACK-FILE -n | grep "${IMAGE}" | cut -d ' ' -f 1 ) " - - for LOOP in $(losetup -l -O NAME,BACK-FILE -n | grep "${IMAGE}" | cut -d ' ' -f 1 ) ; do - info "removing ${LOOP}" - for PARTITION in ${LOOP}p* ; do - partx -dv "${PARTITION}" + + if [ "x" != "${DEVICE:="x"}" ]; then + /usr/bin/udisksctl loop-delete -b ${DEVICE} + else +# if [ 0 -ne ${?} ]; then + warning "Unloop failed, try to unmount all partitions from the image..." + info "Looped devices to unmount : $(/usr/sbin/losetup -l -O NAME,BACK-FILE -n | grep "${IMAGE}" | cut -d ' ' -f 1 ) " + + for LOOP in $(/usr/sbin/losetup -l -O NAME,BACK-FILE -n | grep "${IMAGE}" | cut -d ' ' -f 1 ) ; do + for PARTITION in ${LOOP}p* ; do + info "Unmount ${PARTITION}" + udisksctl unmount -b ${PARTITION} + done + info "Unloop ${LOOP}" + /usr/bin/udisksctl loop-delete -b ${LOOP} done -# losetup -d "${LOOP}" - kpartx -d "${INSTALL_PATH}/${IMAGE}" - done + fi return 0 } # Copying files common to all systems -function copyingcommon() -{ +function copyingcommon() { title "Copying common files and configuration" rsync -rlptDH "${SOURCE_PATH}/common/" "${ROOT}/" - rsync -rlptDH "${SOURCE_PATH}/tools/"*.sh "${ROOT}/usr/local/usr/bin/" - chown root:root "${ROOT}/usr/local/usr/bin/" + rsync -rlptDH "${SOURCE_PATH}/tools/"*.sh "${ROOT}/usr/local/bin/" + chown root:root "${ROOT}/usr/local/bin/" return 0 } -function mkfstab() -{ +function mkfstab() { title "making /etc/fstab" + # BUG : For installing kernel inside a chroot, the UUID of root partition is NOT found, Workaround to try : using ${ROOTP} instead. if [ 1 -eq ${SEPARATE_BOOT_PARTITION} ]; then - 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/boot/EFI\t${BOOTFS}\tdefaults\t0\t0\nUUID=${ROOT_UUID}\t/\text4\tdefaults\t0\t0" > "${BUILD_PATH}/etc/fstab" else echo -e "proc\t/proc\tproc\tdefaults\t0\t0\nUUID=${ROOT_UUID}\t/\text4\tdefaults\t0\t0" > "${BUILD_PATH}/etc/fstab" fi @@ -681,25 +789,26 @@ function mkfstab() # cleaning build space -function clean() -{ +function clean() { title "Cleaning" info "In case script failed or crash inside the chroot, need to unmount dev|sys|proc..." - /bin/umount -lf "${BUILD_PATH}/dev" - /bin/umount -lf "${BUILD_PATH}/sys" - /bin/umount -lf "${BUILD_PATH}/proc" +# udisksctl unmount -b ${PARTITION} +# /bin/umount -lf "${BUILD_PATH}/dev" +# /bin/umount -lf "${BUILD_PATH}/sys" +# /bin/umount -lf "${BUILD_PATH}/proc" + unmountdevsysproc unmountingPartitions unloopingImage # Removing old Build directory - if [ -d "${BUILD_PATH}" ]; then - info "Removing ${BUILD_PATH}" - /usr/bin/rm -Rf "${BUILD_PATH}" - else - warning "${BUILD_PATH} does not exists" - fi +# if [ -d "${BUILD_PATH}" ]; then +# info "Removing ${BUILD_PATH}" +# /usr/bin/rm -Rf "${BUILD_PATH}" +# else +# warning "${BUILD_PATH} does not exists" +# fi # removing old image if [ -e "${INSTALL_PATH}/${IMAGE}" ]; then info "Removing ${IMAGE}" @@ -712,8 +821,26 @@ function clean() } -function generateExtra() -{ +function check_extrapackage() { + for i in ${PACKAGE} ; do + /usr/bin/urpmq --urpmi-root "${BUILD_PATH}" --root "${BUILD_PATH}" --ignorearch --no-verify-rpm ${i} + if [ 0 -ne ${?} ]; then + warning "Package ${i} not found !" + else + PACKAGE_VALID+="${i} " + fi + done + return 0 +} + +function extrapackage() { + for i in ${PACKAGE_VALID} ; do + installpkg ${i} + done + return 0 +} + +function generateExtra() { #Set values by default to false. GEN_CHECKSUM=${GEN_CHECKSUM:="false"} GEN_GZ=${GEN_GZ:="false"} @@ -723,40 +850,46 @@ function generateExtra() md5sum "${INSTALL_PATH}/${IMAGE}" > "${INSTALL_PATH}/${IMAGE}.md5" sha512sum "${INSTALL_PATH}/${IMAGE}" > "${INSTALL_PATH}/${IMAGE}.sha512" sha384sum "${INSTALL_PATH}/${IMAGE}" > "${INSTALL_PATH}/${IMAGE}.sha3" + info "${INSTALL_PATH}/${IMAGE}.md5" + info "${INSTALL_PATH}/${IMAGE}.sha512" + info "${INSTALL_PATH}/${IMAGE}.sha3" fi if ${GEN_GZ} ; then title "Image compression" pv "${INSTALL_PATH}/${IMAGE}" | gzip -9 >"${INSTALL_PATH}/${IMAGE}.gz" fi if ${GEN_SIGN} ; then + title "Signing checksums" pushd "${INSTALL_PATH}" - gpg --sign ${IMAGE}.md5 - gpg --sign ${IMAGE}.sha512 - gpg --sign ${IMAGE}.sha384 + if [ -e "${INSTALL_PATH}/${IMAGE}.md5" ]; then + gpg --sign ${IMAGE}.md5 + fi + if [ -e "${INSTALL_PATH}/${IMAGE}.sha512" ]; then + gpg --sign ${IMAGE}.sha512 + fi + if [ -e "${INSTALL_PATH}/${IMAGE}.sha3" ]; then + gpg --sign ${IMAGE}.sha384 + fi popd fi } -function preImgCreation() -{ +function preImgCreation() { error "This function is called if no sourced file about fdisk was lauched." return 1 } -function postPrepareChroot() -{ +function postPrepareChroot() { error "This function is called if no sourced file is containing postPrepareChroot function." return 1 } -function bunrningBootloader() -{ +function bunrningBootloader() { error "This function is called if no sourced file is containing bunrningBootloader function." return 1 } -function copyingCustomSystem() -{ +function copyingCustomSystem() { error "This function is called if no sourced file is containing copyingCustomSystem function." return 1 } diff --git a/platforms/bananaPro/patch/bananapro_1_Disable_default_distro.patch b/platforms/bananaPro/patch/bananapro_1_Disable_default_distro.patch deleted file mode 100644 index d4ea349..0000000 --- a/platforms/bananaPro/patch/bananapro_1_Disable_default_distro.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- ./.config 2020-09-08 12:42:04.281817323 +0000 -+++ ./.config 2020-09-08 12:46:12.305263098 +0000 -@@ -297,7 +297,7 @@ - CONFIG_LOCALVERSION="" - CONFIG_LOCALVERSION_AUTO=y - CONFIG_CC_OPTIMIZE_FOR_SIZE=y --CONFIG_DISTRO_DEFAULTS=y -+# CONFIG_DISTRO_DEFAULTS is not set - CONFIG_ENV_VARS_UBOOT_CONFIG=y - # CONFIG_SYS_BOOT_GET_CMDLINE is not set - # CONFIG_SYS_BOOT_GET_KBD is not set diff --git a/platforms/bananaPro/patch/bananapro_2_Disable_USB_mass_storage.patch b/platforms/bananaPro/patch/bananapro_2_Disable_USB_mass_storage.patch deleted file mode 100644 index 36164e1..0000000 --- a/platforms/bananaPro/patch/bananapro_2_Disable_USB_mass_storage.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- ./.config 2020-09-08 13:34:57.409722071 +0200 -+++ ./.config 2020-09-08 13:35:04.873391266 +0200 -@@ -1416,7 +1416,7 @@ - # - # USB peripherals - # --CONFIG_USB_STORAGE=y -+# CONFIG_USB_STORAGE is not set - CONFIG_USB_KEYBOARD=y - CONFIG_USB_KEYBOARD_FN_KEYS=y - # CONFIG_SYS_USB_EVENT_POLL is not set diff --git a/platforms/bananaPro/patch/bananapro_3_Reduce_choice_boot_to_1s.patch b/platforms/bananaPro/patch/bananapro_3_Reduce_choice_boot_to_1s.patch deleted file mode 100644 index 835770b..0000000 --- a/platforms/bananaPro/patch/bananapro_3_Reduce_choice_boot_to_1s.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- ./.config 2020-09-08 13:37:29.571109115 +0200 -+++ ./.config 2020-09-08 13:37:45.608244905 +0200 -@@ -377,7 +377,7 @@ - # CONFIG_SATA_BOOT is not set - # CONFIG_SD_BOOT is not set - # CONFIG_SPI_BOOT is not set --CONFIG_BOOTDELAY=2 -+CONFIG_BOOTDELAY=1 - # CONFIG_USE_BOOTARGS is not set - CONFIG_USE_BOOTCOMMAND=y - CONFIG_BOOTCOMMAND="run distro_bootcmd" diff --git a/platforms/bananaPro/patch/bananapro_4_change_default_boot_device_to_mmc.patch b/platforms/bananaPro/patch/bananapro_4_change_default_boot_device_to_mmc.patch deleted file mode 100644 index e7f5c5c..0000000 --- a/platforms/bananaPro/patch/bananapro_4_change_default_boot_device_to_mmc.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- ./.config 2020-09-08 13:38:25.373836843 +0200 -+++ ./.config 2020-09-08 13:38:34.818026499 +0200 -@@ -380,7 +380,7 @@ - CONFIG_BOOTDELAY=1 - # CONFIG_USE_BOOTARGS is not set - CONFIG_USE_BOOTCOMMAND=y --CONFIG_BOOTCOMMAND="run distro_bootcmd" -+CONFIG_BOOTCOMMAND="run bootcmd_mmc0" - CONFIG_USE_PREBOOT=y - CONFIG_PREBOOT="" - diff --git a/platforms/bananaPro/patch/bananapro_5_Switch_ENV_From_Fat_to_Ext4.patch b/platforms/bananaPro/patch/bananapro_5_Switch_ENV_From_Fat_to_Ext4.patch deleted file mode 100644 index eb9af02..0000000 --- a/platforms/bananaPro/patch/bananapro_5_Switch_ENV_From_Fat_to_Ext4.patch +++ /dev/null @@ -1,14 +0,0 @@ ---- ./.config 2020-09-08 13:05:48.256808776 +0000 -+++ ./.config 2020-09-08 13:31:43.994905698 +0000 -@@ -799,2 +799,2 @@ --CONFIG_ENV_IS_IN_FAT=y --# CONFIG_ENV_IS_IN_EXT4 is not set -+# CONFIG_ENV_IS_IN_FAT is not set -+CONFIG_ENV_IS_IN_EXT4=y -@@ -807,3 +807,3 @@ --CONFIG_ENV_FAT_INTERFACE="mmc" --CONFIG_ENV_FAT_DEVICE_AND_PART="0:auto" --CONFIG_ENV_FAT_FILE="uboot.env" -+CONFIG_ENV_EXT4_INTERFACE="mmc" -+CONFIG_ENV_EXT4_DEVICE_AND_PART="0:auto" -+CONFIG_ENV_EXT4_FILE="/boot/u-boot.env" diff --git a/platforms/bananaPro/patch/bananapro_Disable_FAT.patch b/platforms/bananaPro/patch/bananapro_Disable_FAT.patch deleted file mode 100644 index c2b2b99..0000000 --- a/platforms/bananaPro/patch/bananapro_Disable_FAT.patch +++ /dev/null @@ -1,19 +0,0 @@ -*** ./.config 2020-08-25 21:43:01.717034842 +0200 ---- ./.config.old 2020-08-25 21:41:29.247273924 +0200 -*************** CONFIG_CMD_SYSBOOT=y -*** 733,739 **** - CONFIG_CMD_EXT2=y - CONFIG_CMD_EXT4=y - CONFIG_CMD_EXT4_WRITE=y -! # CONFIG_CMD_FAT is not set - # CONFIG_CMD_SQUASHFS is not set - CONFIG_CMD_FS_GENERIC=y - # CONFIG_CMD_FS_UUID is not set ---- 733,739 ---- - CONFIG_CMD_EXT2=y - CONFIG_CMD_EXT4=y - CONFIG_CMD_EXT4_WRITE=y -! CONFIG_CMD_FAT=y - # CONFIG_CMD_SQUASHFS is not set - CONFIG_CMD_FS_GENERIC=y - # CONFIG_CMD_FS_UUID is not set diff --git a/platforms/bananaPro/patch/bananapro_Disable_FAT_support.patch b/platforms/bananaPro/patch/bananapro_Disable_FAT_support.patch deleted file mode 100644 index 948e710..0000000 --- a/platforms/bananaPro/patch/bananapro_Disable_FAT_support.patch +++ /dev/null @@ -1,32 +0,0 @@ -*** ./.config 2020-08-25 21:48:55.496108123 +0200 ---- ./.config.old 2020-08-25 21:47:48.319793817 +0200 -*************** CONFIG_WATCHDOG_TIMEOUT_MSECS=60000 -*** 1327,1333 **** - # CONFIG_SPL_FS_CBFS is not set - CONFIG_FS_EXT4=y - CONFIG_EXT4_WRITE=y -! # CONFIG_FS_FAT is not set - # CONFIG_FS_JFFS2 is not set - # CONFIG_UBIFS_SILENCE_MSG is not set - # CONFIG_FS_CRAMFS is not set ---- 1327,1335 ---- - # CONFIG_SPL_FS_CBFS is not set - CONFIG_FS_EXT4=y - CONFIG_EXT4_WRITE=y -! CONFIG_FS_FAT=y -! CONFIG_FAT_WRITE=y -! CONFIG_FS_FAT_MAX_CLUSTSIZE=65536 - # CONFIG_FS_JFFS2 is not set - # CONFIG_UBIFS_SILENCE_MSG is not set - # CONFIG_FS_CRAMFS is not set -*************** CONFIG_TPL_OF_LIBFDT_ASSUME_MASK=0xff -*** 1417,1422 **** ---- 1419,1426 ---- - CONFIG_GENERATE_SMBIOS_TABLE=y - CONFIG_SMBIOS_MANUFACTURER="" - CONFIG_EFI_LOADER=y -+ CONFIG_EFI_VARIABLE_FILE_STORE=y -+ # CONFIG_EFI_VARIABLES_PRESEED is not set - CONFIG_EFI_DEVICE_PATH_TO_TEXT=y - CONFIG_EFI_LOADER_HII=y - CONFIG_EFI_UNICODE_COLLATION_PROTOCOL2=y diff --git a/platforms/bananaPro/patch/bananapro_Disable_USB.patch b/platforms/bananaPro/patch/bananapro_Disable_USB.patch deleted file mode 100644 index 45e28c4..0000000 --- a/platforms/bananaPro/patch/bananapro_Disable_USB.patch +++ /dev/null @@ -1,101 +0,0 @@ -*** ./.config 2020-08-25 21:47:48.319793817 +0200 ---- ./.config.old 2020-08-25 21:43:01.717034842 +0200 -*************** CONFIG_CLK_SUN4I_A10=y -*** 934,939 **** ---- 934,940 ---- - # - # Fastboot support - # -+ # CONFIG_USB_FUNCTION_FASTBOOT is not set - # CONFIG_FIRMWARE is not set - # CONFIG_ZYNQMP_FIRMWARE is not set - -*************** CONFIG_SYS_NS16550=y -*** 1246,1252 **** - # - # TPM support - # -! # CONFIG_USB is not set - - # - # UFS Host Controller Support ---- 1247,1325 ---- - # - # TPM support - # -! CONFIG_USB=y -! CONFIG_DM_USB=y -! # CONFIG_DM_USB_GADGET is not set -! -! # -! # USB Host Controller Drivers -! # -! CONFIG_USB_HOST=y -! # CONFIG_USB_XHCI_HCD is not set -! CONFIG_USB_EHCI_HCD=y -! # CONFIG_USB_EHCI_MSM is not set -! # CONFIG_USB_EHCI_PCI is not set -! CONFIG_USB_EHCI_GENERIC=y -! # CONFIG_USB_EHCI_FSL is not set -! CONFIG_USB_OHCI_HCD=y -! # CONFIG_USB_OHCI_PCI is not set -! CONFIG_USB_OHCI_GENERIC=y -! # CONFIG_USB_OHCI_DA8XX is not set -! # CONFIG_USB_UHCI_HCD is not set -! # CONFIG_USB_DWC2 is not set -! # CONFIG_USB_R8A66597_HCD is not set -! # CONFIG_USB_CDNS3 is not set -! # CONFIG_USB_DWC3 is not set -! -! # -! # Legacy MUSB Support -! # -! # CONFIG_USB_MUSB_HCD is not set -! # CONFIG_USB_MUSB_UDC is not set -! -! # -! # MUSB Controller Driver -! # -! # CONFIG_USB_MUSB_HOST is not set -! # CONFIG_USB_MUSB_GADGET is not set -! # CONFIG_USB_MUSB_DA8XX is not set -! # CONFIG_USB_MUSB_TI is not set -! # CONFIG_USB_MUSB_AM35X is not set -! # CONFIG_USB_MUSB_DSPS is not set -! # CONFIG_USB_MUSB_PIO_ONLY is not set -! -! # -! # USB Phy -! # -! # CONFIG_TWL4030_USB is not set -! # CONFIG_OMAP_USB_PHY is not set -! # CONFIG_ROCKCHIP_USB2_PHY is not set -! -! # -! # ULPI drivers -! # -! -! # -! # USB peripherals -! # -! CONFIG_USB_STORAGE=y -! CONFIG_USB_KEYBOARD=y -! CONFIG_USB_KEYBOARD_FN_KEYS=y -! # CONFIG_SYS_USB_EVENT_POLL is not set -! CONFIG_SYS_USB_EVENT_POLL_VIA_INT_QUEUE=y -! # CONFIG_SYS_USB_EVENT_POLL_VIA_CONTROL_EP is not set -! CONFIG_USB_GADGET=y -! CONFIG_USB_GADGET_MANUFACTURER="Allwinner Technology" -! CONFIG_USB_GADGET_VENDOR_NUM=0x1f3a -! CONFIG_USB_GADGET_PRODUCT_NUM=0x1010 -! # CONFIG_USB_GADGET_ATMEL_USBA is not set -! # CONFIG_USB_GADGET_BCM_UDC_OTG_PHY is not set -! # CONFIG_USB_GADGET_DWC2_OTG is not set -! # CONFIG_CI_UDC is not set -! CONFIG_USB_GADGET_VBUS_DRAW=2 -! CONFIG_SDP_LOADADDR=0 -! # CONFIG_USB_GADGET_DOWNLOAD is not set -! # CONFIG_USB_HOST_ETHER is not set - - # - # UFS Host Controller Support diff --git a/platforms/bananaPro/patch/bananapro_Disable_USB_CMD.patch b/platforms/bananaPro/patch/bananapro_Disable_USB_CMD.patch deleted file mode 100644 index bfe31e3..0000000 --- a/platforms/bananaPro/patch/bananapro_Disable_USB_CMD.patch +++ /dev/null @@ -1,19 +0,0 @@ -*** ./.config 2020-08-25 21:41:29.247273924 +0200 ---- ./.config.old 2020-08-25 21:33:04.910903793 +0200 -*************** CONFIG_CMD_SCSI=y -*** 668,674 **** - # CONFIG_CMD_SDRAM is not set - # CONFIG_CMD_TSI148 is not set - # CONFIG_CMD_UNIVERSE is not set -! # CONFIG_CMD_USB is not set - # CONFIG_CMD_USB_SDP is not set - # CONFIG_CMD_USB_MASS_STORAGE is not set - ---- 668,674 ---- - # CONFIG_CMD_SDRAM is not set - # CONFIG_CMD_TSI148 is not set - # CONFIG_CMD_UNIVERSE is not set -! CONFIG_CMD_USB=y - # CONFIG_CMD_USB_SDP is not set - # CONFIG_CMD_USB_MASS_STORAGE is not set - diff --git a/platforms/bananaPro/patch/bananapro_Disable_network_commands.patch b/platforms/bananaPro/patch/bananapro_Disable_network_commands.patch deleted file mode 100644 index d8a3f89..0000000 --- a/platforms/bananaPro/patch/bananapro_Disable_network_commands.patch +++ /dev/null @@ -1,46 +0,0 @@ -*** ./.config 2020-08-25 21:15:51.705875615 +0200 ---- ./.config.old 2020-08-25 16:50:23.281984798 +0200 -*************** CONFIG_CMD_SETEXPR=y -*** 683,689 **** - # - # Android support commands - # -! # CONFIG_CMD_NET is not set - # CONFIG_CMD_ETHSW is not set - CONFIG_CMD_PXE=y - # CONFIG_CMD_WOL is not set ---- 683,716 ---- - # - # Android support commands - # -! CONFIG_CMD_NET=y -! CONFIG_CMD_BOOTP=y -! CONFIG_CMD_DHCP=y -! CONFIG_BOOTP_BOOTPATH=y -! CONFIG_BOOTP_DNS=y -! # CONFIG_BOOTP_DNS2 is not set -! CONFIG_BOOTP_GATEWAY=y -! CONFIG_BOOTP_HOSTNAME=y -! # CONFIG_BOOTP_PREFER_SERVERIP is not set -! CONFIG_BOOTP_SUBNETMASK=y -! # CONFIG_BOOTP_NTPSERVER is not set -! # CONFIG_CMD_PCAP is not set -! CONFIG_BOOTP_PXE=y -! CONFIG_BOOTP_PXE_CLIENTARCH=0x15 -! CONFIG_BOOTP_VCI_STRING="U-Boot.armv7" -! CONFIG_CMD_TFTPBOOT=y -! # CONFIG_CMD_TFTPPUT is not set -! # CONFIG_CMD_TFTPSRV is not set -! CONFIG_NET_TFTP_VARS=y -! # CONFIG_CMD_RARP is not set -! CONFIG_CMD_NFS=y -! CONFIG_CMD_MII=y -! CONFIG_CMD_MDIO=y -! CONFIG_CMD_PING=y -! # CONFIG_CMD_CDP is not set -! # CONFIG_CMD_SNTP is not set -! # CONFIG_CMD_DNS is not set -! # CONFIG_CMD_LINK_LOCAL is not set - # CONFIG_CMD_ETHSW is not set - CONFIG_CMD_PXE=y - # CONFIG_CMD_WOL is not set diff --git a/platforms/bananaPro/patch/bananapro_Disable_networking.patch b/platforms/bananaPro/patch/bananapro_Disable_networking.patch deleted file mode 100644 index a2f1ca1..0000000 --- a/platforms/bananaPro/patch/bananapro_Disable_networking.patch +++ /dev/null @@ -1,144 +0,0 @@ -*** ./.config 2020-08-25 21:24:05.614962532 +0200 ---- ./.config.old 2020-08-25 21:22:39.013961045 +0200 -*************** CONFIG_CMD_SETEXPR=y -*** 683,688 **** ---- 683,692 ---- - # - # Android support commands - # -+ # CONFIG_CMD_NET is not set -+ # CONFIG_CMD_ETHSW is not set -+ CONFIG_CMD_PXE=y -+ # CONFIG_CMD_WOL is not set - - # - # Misc commands -*************** CONFIG_SYS_RELOC_GD_ENV_ADDR=y -*** 814,820 **** - # CONFIG_ENV_APPEND is not set - # CONFIG_ENV_WRITEABLE_LIST is not set - # CONFIG_ENV_ACCESS_IGNORE_FORCE is not set -! # CONFIG_NET is not set - - # - # Device Drivers ---- 818,830 ---- - # CONFIG_ENV_APPEND is not set - # CONFIG_ENV_WRITEABLE_LIST is not set - # CONFIG_ENV_ACCESS_IGNORE_FORCE is not set -! CONFIG_NET=y -! # CONFIG_BOOTP_SEND_HOSTNAME is not set -! # CONFIG_NET_RANDOM_ETHADDR is not set -! CONFIG_NETCONSOLE=y -! # CONFIG_IP_DEFRAG is not set -! CONFIG_TFTP_BLOCKSIZE=1468 -! CONFIG_TFTP_WINDOWSIZE=1 - - # - # Device Drivers -*************** CONFIG_CLK_SUN4I_A10=y -*** 935,940 **** ---- 945,951 ---- - # Fastboot support - # - # CONFIG_USB_FUNCTION_FASTBOOT is not set -+ # CONFIG_UDP_FUNCTION_FASTBOOT is not set - # CONFIG_FIRMWARE is not set - # CONFIG_ZYNQMP_FIRMWARE is not set - -*************** CONFIG_MMC_SUNXI=y -*** 1085,1093 **** ---- 1096,1178 ---- - # CONFIG_MTD_UBI is not set - # CONFIG_BITBANGMII is not set - # CONFIG_MV88E6352_SWITCH is not set -+ CONFIG_PHYLIB=y -+ CONFIG_PHY_ADDR_ENABLE=y -+ CONFIG_PHY_ADDR=1 -+ # CONFIG_B53_SWITCH is not set -+ # CONFIG_MV88E61XX_SWITCH is not set -+ # CONFIG_PHYLIB_10G is not set -+ # CONFIG_PHY_AQUANTIA is not set -+ # CONFIG_PHY_ATHEROS is not set -+ # CONFIG_PHY_BROADCOM is not set -+ # CONFIG_PHY_CORTINA is not set -+ # CONFIG_PHY_DAVICOM is not set -+ # CONFIG_PHY_ET1011C is not set -+ # CONFIG_PHY_LXT is not set -+ # CONFIG_PHY_MARVELL is not set -+ # CONFIG_PHY_MESON_GXL is not set -+ # CONFIG_PHY_MICREL is not set -+ # CONFIG_PHY_MSCC is not set -+ # CONFIG_PHY_NATSEMI is not set -+ CONFIG_PHY_REALTEK=y -+ # CONFIG_RTL8211E_PINE64_GIGABIT_FIX is not set -+ # CONFIG_RTL8211X_PHY_FORCE_MASTER is not set -+ # CONFIG_RTL8211F_PHY_FORCE_EEE_RXC_ON is not set -+ # CONFIG_RTL8201F_PHY_S700_RMII_TIMINGS is not set -+ # CONFIG_PHY_SMSC is not set -+ # CONFIG_PHY_TERANETICS is not set -+ # CONFIG_PHY_TI is not set -+ # CONFIG_PHY_TI_DP83867 is not set -+ # CONFIG_PHY_TI_GENERIC is not set -+ # CONFIG_PHY_VITESSE is not set -+ # CONFIG_PHY_XILINX is not set -+ # CONFIG_PHY_XILINX_GMII2RGMII is not set -+ # CONFIG_PHY_FIXED is not set -+ # CONFIG_PHY_NCSI is not set - # CONFIG_FSL_PFE is not set - CONFIG_DM_ETH=y -+ # CONFIG_DM_MDIO is not set - # CONFIG_DM_ETH_PHY is not set -+ CONFIG_NETDEVICES=y -+ # CONFIG_PHY_GIGE is not set -+ # CONFIG_ALTERA_TSE is not set -+ # CONFIG_BCM_SF2_ETH is not set -+ # CONFIG_BCMGENET is not set -+ # CONFIG_DWC_ETH_QOS is not set -+ # CONFIG_EEPRO100 is not set -+ CONFIG_ETH_DESIGNWARE=y -+ # CONFIG_ETH_DESIGNWARE_SOCFPGA is not set -+ # CONFIG_ETH_DESIGNWARE_S700 is not set -+ # CONFIG_ETHOC is not set -+ # CONFIG_FMAN_ENET is not set -+ # CONFIG_FTMAC100 is not set -+ # CONFIG_FTGMAC100 is not set -+ # CONFIG_MCFFEC is not set -+ # CONFIG_FSLDMAFEC is not set -+ # CONFIG_KS8851_MLL is not set -+ # CONFIG_MACB is not set -+ CONFIG_RGMII=y -+ CONFIG_MII=y -+ # CONFIG_PCNET is not set -+ # CONFIG_RTL8139 is not set -+ # CONFIG_RTL8169 is not set -+ # CONFIG_SMC911X is not set -+ CONFIG_SUN7I_GMAC=y -+ # CONFIG_SUN7I_GMAC_FORCE_TXERR is not set -+ # CONFIG_SUN4I_EMAC is not set -+ # CONFIG_SUN8I_EMAC is not set -+ # CONFIG_SH_ETHER is not set -+ # CONFIG_DRIVER_TI_CPSW is not set -+ # CONFIG_DRIVER_TI_EMAC is not set -+ # CONFIG_DRIVER_TI_KEYSTONE_NET is not set -+ # CONFIG_XILINX_AXIEMAC is not set -+ # CONFIG_XILINX_EMACLITE is not set -+ # CONFIG_ZYNQ_GEM is not set -+ # CONFIG_GMAC_ROCKCHIP is not set -+ # CONFIG_SYS_DPAA_QBMAN is not set -+ # CONFIG_TSEC_ENET is not set -+ # CONFIG_MEDIATEK_ETH is not set -+ # CONFIG_HIGMACV300_ETH is not set - # CONFIG_PCI is not set - - # -*************** CONFIG_USB_GADGET_PRODUCT_NUM=0x1010 -*** 1319,1324 **** ---- 1404,1410 ---- - CONFIG_USB_GADGET_VBUS_DRAW=2 - CONFIG_SDP_LOADADDR=0 - # CONFIG_USB_GADGET_DOWNLOAD is not set -+ # CONFIG_USB_ETHER is not set - # CONFIG_USB_HOST_ETHER is not set - - # diff --git a/platforms/bananaPro/patch/bananapro_Enable_bzip2.patch b/platforms/bananaPro/patch/bananapro_Enable_bzip2.patch deleted file mode 100644 index 04bb3d1..0000000 --- a/platforms/bananaPro/patch/bananapro_Enable_bzip2.patch +++ /dev/null @@ -1,19 +0,0 @@ -*** ./.config 2020-08-25 21:50:36.113527612 +0200 ---- ./.config.old 2020-08-25 21:48:55.496108123 +0200 -*************** CONFIG_MD5=y -*** 1393,1399 **** - # CONFIG_LZO is not set - CONFIG_GZIP=y - # CONFIG_ZLIB_UNCOMPRESS is not set -! CONFIG_BZIP2=y - CONFIG_ZLIB=y - # CONFIG_ZSTD is not set - # CONFIG_SPL_LZ4 is not set ---- 1393,1399 ---- - # CONFIG_LZO is not set - CONFIG_GZIP=y - # CONFIG_ZLIB_UNCOMPRESS is not set -! # CONFIG_BZIP2 is not set - CONFIG_ZLIB=y - # CONFIG_ZSTD is not set - # CONFIG_SPL_LZ4 is not set diff --git a/platforms/bananaPro/patch/bananapro_Enable_write_ext4.patch b/platforms/bananaPro/patch/bananapro_Enable_write_ext4.patch deleted file mode 100644 index 2dabc02..0000000 --- a/platforms/bananaPro/patch/bananapro_Enable_write_ext4.patch +++ /dev/null @@ -1,36 +0,0 @@ -*** ./.config 2020-08-25 21:19:11.931937001 +0200 ---- ./.config.old 2020-08-25 21:15:51.705875615 +0200 -*************** CONFIG_CMD_SYSBOOT=y -*** 736,742 **** - # CONFIG_CMD_BTRFS is not set - CONFIG_CMD_EXT2=y - CONFIG_CMD_EXT4=y -! CONFIG_CMD_EXT4_WRITE=y - CONFIG_CMD_FAT=y - # CONFIG_CMD_SQUASHFS is not set - CONFIG_CMD_FS_GENERIC=y ---- 736,742 ---- - # CONFIG_CMD_BTRFS is not set - CONFIG_CMD_EXT2=y - CONFIG_CMD_EXT4=y -! # CONFIG_CMD_EXT4_WRITE is not set - CONFIG_CMD_FAT=y - # CONFIG_CMD_SQUASHFS is not set - CONFIG_CMD_FS_GENERIC=y -*************** CONFIG_WATCHDOG_TIMEOUT_MSECS=60000 -*** 1487,1493 **** - # CONFIG_FS_CBFS is not set - # CONFIG_SPL_FS_CBFS is not set - CONFIG_FS_EXT4=y -! CONFIG_EXT4_WRITE=y - CONFIG_FS_FAT=y - CONFIG_FAT_WRITE=y - CONFIG_FS_FAT_MAX_CLUSTSIZE=65536 ---- 1487,1493 ---- - # CONFIG_FS_CBFS is not set - # CONFIG_SPL_FS_CBFS is not set - CONFIG_FS_EXT4=y -! # CONFIG_EXT4_WRITE is not set - CONFIG_FS_FAT=y - CONFIG_FAT_WRITE=y - CONFIG_FS_FAT_MAX_CLUSTSIZE=65536 diff --git a/platforms/bananaPro/patch/bananapro_disable_composite_output.patch b/platforms/bananaPro/patch/bananapro_disable_composite_output.patch deleted file mode 100644 index b188f7a..0000000 --- a/platforms/bananaPro/patch/bananapro_disable_composite_output.patch +++ /dev/null @@ -1,19 +0,0 @@ -*** ./.config 2020-08-25 16:41:39.209269545 +0200 ---- ./.config.old 2020-08-25 15:41:24.165563741 +0200 -*************** CONFIG_I2C0_ENABLE=y -*** 251,257 **** - CONFIG_VIDEO_SUNXI=y - CONFIG_VIDEO_HDMI=y - # CONFIG_VIDEO_VGA is not set -! # CONFIG_VIDEO_COMPOSITE is not set - CONFIG_VIDEO_LCD_MODE="" - CONFIG_VIDEO_LCD_DCLK_PHASE=1 - CONFIG_VIDEO_LCD_POWER="" ---- 251,257 ---- - CONFIG_VIDEO_SUNXI=y - CONFIG_VIDEO_HDMI=y - # CONFIG_VIDEO_VGA is not set -! CONFIG_VIDEO_COMPOSITE=y - CONFIG_VIDEO_LCD_MODE="" - CONFIG_VIDEO_LCD_DCLK_PHASE=1 - CONFIG_VIDEO_LCD_POWER="" diff --git a/platforms/mageia4arm.cfg b/platforms/generic_aarch64/mageia4arm.cfg index 78e2698..cb80e0e 100644 --- a/platforms/mageia4arm.cfg +++ b/platforms/generic_aarch64/mageia4arm.cfg @@ -1,6 +1,8 @@ # Copyright (C) 2017-2018 Daniel Tartavel-jeannot <contact@librepc.com> +# Copyright (C) 2019-2020 Jean-Baptiste Biernacki <j.biernacki@free.fr> # + # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or @@ -14,53 +16,42 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see <http://www.gnu.org/licenses/>. + # Mageia version 7 or later, cauldron. -# TO MODIFY -MAGEIA_VERSION="" +MAGEIA_VERSION=${MAGEIA_VERSION:="7"} # Arm version armv7hl, aarch64 -# TO MODIFY -ARM_VERSION="" +ARM_VERSION="aarch64" # Target plateform (odroid or rpi) -# TO MODIFY -TARGET="" +TARGET="generic-aarch64" # Target version (0,2,3 for raspi, 3 or 4 for odroid) -#TO MODIFY -TARGET_VERSION="" +TARGET_VERSION="1" # URL of the Mageia mirror used to install ( see mirrors.mageia.org ) -MIRROR="http://ftp.free.fr/mirrors/mageia.org/distrib/$MAGEIA_VERSION/$ARM_VERSION" - -# image will be created here -# TO MODIFY -INSTALL_PATH="/path/to/$TARGET" - -# Build directory will be created here -BUILD_PATH="$INSTALL_PATH/build" +# MIRROR="http://ftp.free.fr/mirrors/mageia.org/distrib/${MAGEIA_VERSION}/${ARM_VERSION}" #name of the image -IMAGE="Mageia-${MAGEIA_VERSION}-$TARGET.img" - -#Mount point of image's partitions -BOOT="/mnt/boot" -ROOT="/mnt/root" +IMAGE="Mageia-${MAGEIA_VERSION}-${TARGET}.img" # Default user -# TO MODIFY -ID_USER="user login" -PASSWORD="user password" +# If not set, no user will be defined. +# ID_USER="user" +# PASSWORD="user" #root password -ROOT_PWD="root password" +#If not set, no root password, at the first login, the system will ask for a password. +# ROOT_PWD="root" #Hostname -HOSTNAME="$TARGET.$ID_USER" +#If not define, the default value will be "localhost.localdomain". +# HOSTNAME="${TARGET}" #Filesystem of boot partitions (default ext4 raspberry pi need vfat) -#BOOTFS=ext4 +SEPARATE_BOOT_PARTITION=1 +BOOTFS="vfat" -#kernel package to install (just needed for odroid) -#KERNEL=kernel-odroid +#kernel package to install +KERNEL="kernel-server" -#Path where the raspberry pi firmware is/will be installed ( just needed for raspberry pi ) -FIRMWARE_PATH="$INSTALL_PATH/" +#The arguments for the Kernel +BOOT_ARGS='audit=0' diff --git a/platforms/generic_aarch64/second_stage_install.sh b/platforms/generic_aarch64/second_stage_install.sh new file mode 100644 index 0000000..cba82e9 --- /dev/null +++ b/platforms/generic_aarch64/second_stage_install.sh @@ -0,0 +1,131 @@ +#!/bin/bash + +# Copyright (C) 2017-2018 Daniel Tartavel-jeannot <contact@librepc.com> +# Copyright (C) 2019-2020 Jean-Baptiste Biernacki <j.biernacki@free.fr> +# + +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see <http://www.gnu.org/licenses/>. + +export ARCH=arm64 + +/usr/bin/chown :shadow /etc/shadow /etc/gshadow /etc/login.defs /etc/pam.d/chage-chfn-chsh /etc/pam.d/chpasswd-newusers /etc/pam.d/system-auth /etc/pam.d/user-group-mod /bin/passwd /bin/chage + +/usr/bin/chown :systemd-journal -R /var/log/journal + +# #################################################### +# ## To embed a module inside the early boot initrd ## +# #################################################### +# #Set the list space separated of added modules and omitted modules : +# DRIVER_ADD_LIST="sunxi-mmc mmcblk" +# DRIVER_OMI_LIST="drm" +# #Create a configuration file inside the FS, it will be used by dracut for all kernel update +# mkdir -p /etc/dracut.conf.d/ +# echo -e "# Omiting drm as it failed for arm :\nomit_dracutmodules+=\" ${DRIVER_OMI_LIST} \"" >> /etc/dracut.conf.d/30-bananapro.conf +# echo -e "\n\n# Driver to add :\nadd_drivers+=\" ${DRIVER_ADD_LIST} \"\n" > /etc/dracut.conf.d/30-bananapro.conf + + +#Install all packages you need +<INSTALL_EXEC> basesystem grub2-efi efibootmgr chrony polkit lockdev rng-tools man openssh-server rfkill wireless-tools bluez wpa_supplicant make rsync binutils ldetect usbutils #kernel-desktop-latest # systemd-bootchart libcap-utils keyutils mindi-busybox plymouth-scripts lvm2 #dmsetup + +#For the wifi : +# /sbin/urpmi.update "Nonfree Release" +# /sbin/urpmi.update "Nonfree Updates" +# <INSTALL_EXEC> --media "Nonfree Release" --media "Nonfree Updates" kernel-firmware-nonfree + +# <INSTALL_EXEC> grub2-uboot +# <INSTALL_EXEC> --noscripts ./grub2-common-2.02.0-16.mga7.armv7hl.rpm ./grub2-efi-2.02.0-16.mga7.armv7hl.rpm ./grub2-mageia-theme-2.02.0-16.mga7.noarch.rpm +# <INSTALL_EXEC> --noscripts efibootmgr util-linux +/usr/bin/sed -i -e 's/GRUB_CMDLINE_LINUX_DEFAULT="\(.*\)"/GRUB_CMDLINE_LINUX_DEFAULT="\1 audit=0"/' /etc/default/grub +# /usr/bin/sed -i -e 's/GRUB_TIMEOUT=.*$/GRUB_TIMEOUT=1/' /etc/default/grub + +/usr/sbin/grub2-mkconfig -o /boot/grub2/grub.cfg +/usr/sbin/grub2-install --skip-fs-probe --target=arm64-efi --efi-directory=/boot/EFI + +#For dracut : +# <INSTALL_EXEC> mindi-busybox plymouth-scripts #systemd-bootchart libcap-utils keyutils lvm2 #dmsetup + + +# ############################ +# ## For compiling a module ## +# ############################ +# BUG : Make does not like to build inside chroot. It doesn't find tools. Impossible to build any module there. +# <INSTALL_EXEC> kernel-source-latest +# #See if it is a Server or Desktop kernel : +# rpm -q kernel-serveur-latest +# if [ 0 -ne ${?} ]; then +# K_INST_VERSION=$(rpm -q kernel-desktop-latest | sed -e 's/kernel-\([[:alnum:]]*\)-latest-\([\.[:digit:]]*\)-\([\.[:alnum:]]*\).*$/\2-\1-\3/' ) +# else +# K_INST_VERSION=$(rpm -q kernel-serveur-latest | sed -e 's/kernel-\([[:alnum:]]*\)-latest-\([\.[:digit:]]*\)-\([\.[:alnum:]]*\).*$/\2-\1-\3/' ) +# fi +# #Recover the kernel module path : +# K_MOD_PATH=$(urpmf "modules/${K_INST_VERSION}$" | cut -d ':' -f 2) +# #Recover the source version : +# K_SRC_VERSION=$(rpm -q kernel-source-latest | sed -e 's/kernel-source-latest-\([\.[:digit:]]*\)-\([\.[:alnum:]]*\).*$/\1-\2/' ) +# #Recover the source path : +# K_SRC_PATH=$(urpmf "src/kernel-${K_SRC_VERSION}$" | cut -d ':' -f 2) +# #Set the default Mageia's configuration file into the source path : +# cp /boot/config-${K_INST_VERSION} ${K_SRC_PATH}/.config +# ## Can't go further... Make does not like to build inside chroot. It doesn't find tools. +# ## Impossible to build any module there. + + +# ########################### +# ## Regenerate the initrd ## +# ########################### +# #Generate the initrd : +# OUTPUT=$(ARCH=arm CROSS_COMPILE=arm-linux-gnu- dracut --no-compress --force --no-hostonly --local --no-early-microcode --confdir "/etc/dracut.conf.d" --kmoddir="/lib/modules/${K_INST_VERSION}" --xz --printsize --kernel-image /boot/vmlinuz --fstab initrd-${K_INST_VERSION}.img ${K_INST_VERSION} 2>&1 | tee /dev/tty ) +# dracut --no-compress --force --no-hostonly --local --no-early-microcode --confdir "/etc/dracut.conf.d" --kmoddir="/lib/modules/${K_INST_VERSION}" --xz --printsize --kernel-image /boot/vmlinuz --fstab /boot/initrd-${K_INST_VERSION}.img ${K_INST_VERSION} + + +########################################### +## Install a package from testing repo : ## +########################################### +# urpmi.update Testing +# urpmi --auto --media Testing kernel-desktop-latest +# dnf --refresh --enablerepo=updates_testing-\* --assumeyes install kernel-desktop-latest + + +############################################ +## Installing the kernel (not on testing) ## +############################################ +# urpmi --auto kernel-desktop-latest +# dnf --refresh --assumeyes install kernel-desktop-latest + + +############################################### +## Create a symlink for the lastest kernel : ## +############################################### + ## As long as the first installed kernel remains installed, the boot.scr script will continue to work, even if the extlinux.conf file is not working with uboot anymore. +# #Last rpm package : +# KERNELRPM=$(rpm -qa --last | grep "^kernel-[sd]e[[:alpha:]]*-[[:digit:]]" | head -n 1 | cut -d ' ' -f 1 | sed -e 's/\(kernel-[[:alnum:]]*-[\.[:digit:]]*-[\.[:alnum:]]*\)-.*/\1/' ) +# #Get the vmlinuz file : +# VMLINUZ=$(urpmf ${KERNELRPM} | grep "boot/vmlinuz" | cut -d ':' -f 2) +#Get the vmlinuz file : +# VMLINUZ=$(ls --sort=time -1 /boot/vmlinuz-[[:digit:]]* | head -n 1) +# rm -f /boot/uvmlinuz +# ln -r -s "${VMLINUZ}" /boot/uvmlinuz #For the uboot script +# Normally, /boot/vmlinuz is generated with the /sbin/installkernel script, but it is not generated with chroot. +# rm -f /boot/vmlinuz +# ln -r -s "${VMLINUZ}" /boot/vmlinuz #For extlinux.conf + + +/usr/bin/chown :chrony -R /etc/chrony.keys /var/log/chrony +/usr/bin/chown :daemon /etc/wpa_supplicant.conf +/usr/bin/chown :tty /bin/write /bin/wall +/usr/bin/chown :lock /sbin/lockdev +/usr/bin/chown :bin /sbin/traceroute +/usr/bin/chown polkitd /etc/polkit-1/rules.d + + +## DO NOT EXIT THE SCRIPT. A second part is automatically added in this script during the process in order to create the default user and set root password. diff --git a/platforms/generic_aarch64/specialFunctions.sh b/platforms/generic_aarch64/specialFunctions.sh new file mode 100755 index 0000000..ccbc9d2 --- /dev/null +++ b/platforms/generic_aarch64/specialFunctions.sh @@ -0,0 +1,73 @@ +#!/bin/bash + +# Copyright (C) 2017-2018 Daniel Tartavel-jeannot <contact@librepc.com> +# Copyright (C) 2019-2020 Jean-Baptiste Biernacki <j.biernacki@free.fr> +# + +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see <http://www.gnu.org/licenses/>. + + +#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_BOOTandROOT_FIRST_SECTOR}\n${PART_BOOTandROOT_SIZE}\n${CHANGE_BOOTFLAG}\n${APPLY}\n" +SFDISK_SCRIPT=",128M,U,*\n,,L,\nwrite\n" + + +function preImgCreation() +{ +# title "Creating Banana Pro image" + #Nothing to download. + return 0 +} + + +function postPrepareChroot() +{ + #Nothing to do. + return 0 +} + +function bunrningBootloader() +{ + # DEVICE is set just before this function and looped. + return 0 +} + +function copyingCustomSystem() +{ +# installpkg ${CONFIG_PATH}/package.mga7.aarch64.rpm +# installpkg package + return 0 +} |