diff options
author | Jybz <j.biernacki@free.fr> | 2019-10-20 10:03:40 +0000 |
---|---|---|
committer | Jybz <j.biernacki@free.fr> | 2019-10-20 10:03:40 +0000 |
commit | 854ce6b5ccea97e0399ba489259d949568d17380 (patch) | |
tree | fcac220888be5412a2eb34b181af9ee90f6cbccf /platforms/bananaPro | |
parent | 55533d518415b660cdbd3217bc4115be99eb2bac (diff) | |
download | mageia4arm-854ce6b5ccea97e0399ba489259d949568d17380.tar mageia4arm-854ce6b5ccea97e0399ba489259d949568d17380.tar.gz mageia4arm-854ce6b5ccea97e0399ba489259d949568d17380.tar.bz2 mageia4arm-854ce6b5ccea97e0399ba489259d949568d17380.tar.xz mageia4arm-854ce6b5ccea97e0399ba489259d949568d17380.zip |
MAJ
Diffstat (limited to 'platforms/bananaPro')
-rw-r--r-- | platforms/bananaPro/boot.cmd | 24 | ||||
-rw-r--r-- | platforms/bananaPro/mageia4arm.cfg | 74 | ||||
-rw-r--r-- | platforms/bananaPro/second_stage_install.sh | 51 | ||||
-rw-r--r-- | platforms/bananaPro/specialFunctions.sh | 70 | ||||
-rw-r--r-- | platforms/bananaPro/sun7i-a20-bananapro.dtb | bin | 0 -> 25166 bytes |
5 files changed, 219 insertions, 0 deletions
diff --git a/platforms/bananaPro/boot.cmd b/platforms/bananaPro/boot.cmd new file mode 100644 index 0000000..75a7c2a --- /dev/null +++ b/platforms/bananaPro/boot.cmd @@ -0,0 +1,24 @@ +setenv KERNEL_FILE /boot/vmlinuz +setenv INIT_FILE /boot/initrd.img +#setenv DTB_FILE /boot/sun7i-a20-bananapro.dtb +setenv DTB_FILE /boot/u-boot.dtb + +setenv KERNEL_ADDR 0x40008000 +#setenv INIT_ADDR 0x45000000 +setenv INIT_ADDR - +setenv DTB_ADDR 0x48000000 + +ext4load mmc 0:1 ${KERNEL_ADDR} ${KERNEL_FILE} +#ext4load mmc 0:1 ${INIT_ADDR} ${INIT_FILE} +ext4load mmc 0:1 ${DTB_ADDR} ${DTB_FILE} + +setenv bootargs console=ttyS0,115200 disp.screen0_output_mode=EDID:1024x768p50 hdmi.audio=EDID:0 root=/dev/mmcblk0p1 rootfstype=ext4 elevator=deadline rootwait + +#printenv +bootz ${KERNEL_ADDR} ${INIT_ADDR} ${DTB_ADDR} + +#Compile boot.scr : mkimage -C none -A arm -T script -d "${CONFIG_PATH}/boot.cmd" "${CONFIG_PATH}/boot.scr" + +# ext4load mmc 0:1 0x40008000 /boot/vmlinuz +# ext4load mmc 0:1 0x48000000 /boot/u-boot.dtb +# bootz 0x40008000 - 0x48000000 diff --git a/platforms/bananaPro/mageia4arm.cfg b/platforms/bananaPro/mageia4arm.cfg new file mode 100644 index 0000000..73e298f --- /dev/null +++ b/platforms/bananaPro/mageia4arm.cfg @@ -0,0 +1,74 @@ + +# Copyright (C) 2017-2018 Daniel Tartavel-jeannot <contact@librepc.com> +# +# 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/>. + +#BananaPro informations : http://wiki.lemaker.org/BananaPro/Pi:Building_u-boot,_script.bin_and_linux-kernel#Installation +#BananaPro sources : https://github.com/LeMaker/lemaker-bsp +# Kernel : https://github.com/LeMaker/linux-sunxi +# FEX (DTS) : https://github.com/LeMaker/sunxi-boards + +# Mageia version 7 or later, cauldron. +# TO MODIFY +MAGEIA_VERSION="7" +# Arm version armv7hl, aarch64 +# TO MODIFY +ARM_VERSION="armv7hl" + +# Target plateform (odroid or rpi) +# TO MODIFY +TARGET="bananaPro" +# Target version (0,2,3 for raspi, 3 or 4 for odroid) +#TO MODIFY +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="./${TARGET}" + +# Build directory will be created here +BUILD_PATH="${INSTALL_PATH}/build" + +#name of the image +IMAGE="Mageia-${MAGEIA_VERSION}-${TARGET}.img" + +#Mount point of image's partitions +BOOT="/mnt/boot" +ROOT="/mnt/root" + +# Default user +# TO MODIFY +ID_USER="banana" +PASSWORD="bananaPro" + +#root password +ROOT_PWD="ProR00t" + +#Hostname +HOSTNAME="${TARGET}.${ID_USER}" + +#Filesystem of boot partitions (default ext4 raspberry pi need vfat) +SEPARATE_BOOT_PARTITION=0 +BOOTFS="ext4" + +#kernel package to install +KERNEL="kernel-desktop" + +#Path where the raspberry pi firmware is/will be installed ( just needed for raspberry pi ) +FIRMWARE_PATH="${INSTALL_PATH}/" +#FIRMWARE_DIR="firmware-stable" +#FIRMWARE_DOWNLOAD_URL="https://github.com/raspberrypi/firmware/archive/stable.zip" diff --git a/platforms/bananaPro/second_stage_install.sh b/platforms/bananaPro/second_stage_install.sh new file mode 100644 index 0000000..48e5308 --- /dev/null +++ b/platforms/bananaPro/second_stage_install.sh @@ -0,0 +1,51 @@ +#!/bin/bash -x + +# Copyright (C) 2017-2018 Daniel Tartavel-jeannot <contact@librepc.com> +# + +# 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/>. + +/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 + +#Install all packages you need +/usr/sbin/urpmi --auto --no-verify-rpm basesystem dracut chrony rng-tools man openssh-server rfkill wireless-tools bluez wpa_supplicant make u-boot-tools rsync kernel-desktop-latest systemd-bootchart libcap-utils keyutils mindi-busybox plymouth-scripts lvm2 binutils #dmsetup +#/usr/sbin/urpmi --urpmi-root "$BUILD_PATH" --ignorearch --no-verify-rpm --auto --split-level 200 --split-length 200 +# /usr/sbin/urpmi --auto --no-verify-rpm /root/kernel-desktop-5.3.1-2.mga7-1-1.mga7.armv7hl.rpm +# echo "Install kernel from testing :" +# /usr/sbin/urpmi.update Testing +# /usr/sbin/urpmi --media Testing kernel-desktop-5.3.2-1.mga7 +# /usr/sbin/urpme kernel-desktop-5.2.13-2.mga7-1-1.mga7.armv7hl +echo "Urpmi finished." +# dracut --no-compress --force +# ls -v1r /boot/vmlinuz* +# echo "--" +# ls -v1r /boot/vmlinuz-[[:digit:]]* +# rm -f /boot/vmlinuz +# ln -r -s $(ls -v1r /boot/vmlinuz-[[:digit:]]* | grep -m 1 "vmlinuz") ./boot/vmlinuz +# ls -v1r /boot/initrd-[[:digit:]]* +# rm -f /boot/initrd.img +# ln -r -s $(ls -v1r /boot/initrd-[[:digit:]]* | grep -m 1 "initrd") ./boot/initrd.img +# echo "--" +# dracut --print-cmdline + +/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/bananaPro/specialFunctions.sh b/platforms/bananaPro/specialFunctions.sh new file mode 100644 index 0000000..8ea8733 --- /dev/null +++ b/platforms/bananaPro/specialFunctions.sh @@ -0,0 +1,70 @@ +#!/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} + +PART_BOOTandROOT=1 +PART_BOOTandROOT_FIRST_SECTOR=${DEFAULT} +PART_BOOTandROOT_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" +FDISK_SCRIPT="${NEW_PART}\n${PRIMARY}\n${PART_BOOTandROOT}\n${PART_BOOT_FIRST_SECTOR}\n${PART_PART_BOOTandROOT_SIZE}\n${CHANGE_BOOTFLAG}\n${PART_PART_BOOTandROOT}\n${APPLY}\n" + + + +function preImgCreation() +{ + title "Creating Banana Pro image" + #Nothing to download. +# mkimage -C none -A arm -T script -d "${CONFIG_PATH}/boot.cmd" "${CONFIG_PATH}/boot.scr" + return 0 +} + + +function postPrepareChroot() +{ + info "copying kernel-desktop, dtb, boot.scr and vmlinuz symlink in ${BUILD_PATH}/boot" +# /usr/bin/cp --preserve=mode "${CONFIG_PATH}/kernel-desktop-5.3.1-2.mga7-1-1.mga7.armv7hl.rpm" "${BUILD_PATH}/root/" + mkimage -C none -A arm -T script -d "${CONFIG_PATH}/boot.cmd" "${BUILD_PATH}/boot/boot.scr" + /usr/bin/cp --preserve=mode "${CONFIG_PATH}/sun7i-a20-bananapro.dtb" "${BUILD_PATH}/boot/" + /usr/bin/cp --preserve=mode "${CONFIG_PATH}/u-boot.dtb" "${BUILD_PATH}/boot/" +# /usr/bin/cp --preserve=mode "${CONFIG_PATH}/uboot.env" "${BUILD_PATH}/boot/" + /usr/bin/cp --preserve=mode -d "${CONFIG_PATH}/vmlinuz" "${BUILD_PATH}/boot/" + 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/sun7i-a20-bananapro.dtb b/platforms/bananaPro/sun7i-a20-bananapro.dtb Binary files differnew file mode 100644 index 0000000..0065a19 --- /dev/null +++ b/platforms/bananaPro/sun7i-a20-bananapro.dtb |