1
0

added platform dir

This commit is contained in:
Daniel Tartavel 2019-09-29 06:50:44 +02:00
parent 22115e7251
commit 2a82e889e8
59 changed files with 375 additions and 7965 deletions

View File

@ -36,10 +36,13 @@ function error()
echo -e "\e[1;31m$1\e[0m" echo -e "\e[1;31m$1\e[0m"
} }
info $0
SOURCE_PATH="$(/bin/dirname "$(readlink -f "$0")")" SOURCE_PATH="$(/bin/dirname "$(readlink -f "$0")")"
INSTALL_PATH="$SOURCE_PATH/arm" INSTALL_PATH="$SOURCE_PATH/arm"
FILES_PATH="$SOURCE_PATH/files" FILES_PATH="$SOURCE_PATH/files"
info $0 PLATFORMS_PATH="$SOURCE_PATH/platforms"
CMDNAME=$(/bin/basename "$0") CMDNAME=$(/bin/basename "$0")
#while read -r;do #while read -r;do
@ -277,10 +280,10 @@ function preparechroot()
echo "$HOSTNAME" > "$BUILD_PATH/etc/hostname" echo "$HOSTNAME" > "$BUILD_PATH/etc/hostname"
info "copying second stage script in $BUILD_PATH" info "copying second stage script in $BUILD_PATH"
echo "/bin/cp $SOURCE_PATH/$CONFIG_PATH/second_stage_install.sh $BUILD_PATH/" echo "/bin/cp $CONFIG_PATH/second_stage_install.sh $BUILD_PATH/"
cp --preserve=mode "$SOURCE_PATH/$CONFIG_PATH/second_stage_install.sh" "$BUILD_PATH/second_stage_install.sh" cp --preserve=mode "$CONFIG_PATH/second_stage_install.sh" "$BUILD_PATH/second_stage_install.sh"
if [ $? -ne 0 ];then if [ $? -ne 0 ];then
error "line $LINENO error copying $SOURCE_PATH/$CONFIG_PATH/second_stage_install.sh : exiting" error "line $LINENO error copying $CONFIG_PATH/second_stage_install.sh : exiting"
exit 1 exit 1
fi fi
@ -306,12 +309,12 @@ EOF" >>"$BUILD_PATH/second_stage_install.sh"
#TEMPORARY CODE #TEMPORARY CODE
#copying kernel odroid not existing in mageia repos #copying kernel odroid not existing in mageia repos
info "copying kernel-odroid and u-boot rpms in $BUILD_PATH/root" info "copying kernel-odroid and u-boot rpms in $BUILD_PATH/root"
echo "/bin/cp $SOURCE_PATH/$CONFIG_PATH/kernel-odroid-4.14.y-1.armv7hl.rpm $BUILD_PATH/root/" echo "/bin/cp $CONFIG_PATH/kernel-odroid-4.14.y-1.armv7hl.rpm $BUILD_PATH/root/"
/usr/bin/cp --preserve=mode "$SOURCE_PATH/$CONFIG_PATH/kernel-odroid-4.14.y-1.armv7hl.rpm" "$BUILD_PATH/root/" /usr/bin/cp --preserve=mode "$CONFIG_PATH/kernel-odroid-4.14.y-1.armv7hl.rpm" "$BUILD_PATH/root/"
echo "/bin/cp $SOURCE_PATH/$CONFIG_PATH/u-boot-20180507-3.mga7.armv7hl.rpm $BUILD_PATH/root/" echo "/bin/cp $CONFIG_PATH/u-boot-20180507-3.mga7.armv7hl.rpm $BUILD_PATH/root/"
/usr/bin/cp --preserve=mode "$SOURCE_PATH/$CONFIG_PATH/u-boot-20180507-3.mga7.armv7hl.rpm" "$BUILD_PATH/root/" /usr/bin/cp --preserve=mode "$CONFIG_PATH/u-boot-20180507-3.mga7.armv7hl.rpm" "$BUILD_PATH/root/"
if [ $? -ne 0 ];then if [ $? -ne 0 ];then
error "line $LINENO error copying $SOURCE_PATH/$CONFIG_PATH/kernel-odroid-4.14.y-1.armv7hl.rpm : exiting" error "line $LINENO error copying $CONFIG_PATH/kernel-odroid-4.14.y-1.armv7hl.rpm : exiting"
exit 1 exit 1
fi fi
;; ;;
@ -454,9 +457,9 @@ createimage()
DEVICE=$(/sbin/losetup -f --show "$INSTALL_PATH/$IMAGE") DEVICE=$(/sbin/losetup -f --show "$INSTALL_PATH/$IMAGE")
if [ $TARGET = "odroid" ];then if [ $TARGET = "odroid" ];then
info "installing blobs" info "installing blobs"
pushd "$SOURCE_PATH/$CONFIG_PATH/sd_fuse" pushd "$CONFIG_PATH/sd_fuse"
if [ $? -ne 0 ];then if [ $? -ne 0 ];then
error "line $LINENO error directory $SOURCE_PATH/$CONFIG_PATH/sd_fuse does not exists : exiting" error "line $LINENO error directory $CONFIG_PATH/sd_fuse does not exists : exiting"
exit 1 exit 1
else else
./sd_fusing.sh "$DEVICE" ./sd_fusing.sh "$DEVICE"
@ -556,7 +559,7 @@ UUID=$ROOT_UUID / ext4 defaults 0 0" > "$BUILD_PA
mkdir -p "$BUILD_PATH/boot/extlinux" mkdir -p "$BUILD_PATH/boot/extlinux"
fi fi
if [ ! -f "$BUILD_PATH/boot/extlinux/extlinux.conf" ];then if [ ! -f "$BUILD_PATH/boot/extlinux/extlinux.conf" ];then
sed -e s/\<UUID\>/$ROOT_UUID/g $SOURCE_PATH/$CONFIG_PATH/extlinux.conf >"$BUILD_PATH/boot/extlinux/extlinux.conf" sed -e s/\<UUID\>/$ROOT_UUID/g $CONFIG_PATH/extlinux.conf >"$BUILD_PATH/boot/extlinux/extlinux.conf"
KERNEL_ID=`basename $BUILD_PATH/usr/lib/linux-*` KERNEL_ID=`basename $BUILD_PATH/usr/lib/linux-*`
sed -i -e s/\<FDTDIR\>/$KERNEL_ID/g "$BUILD_PATH/boot/extlinux/extlinux.conf" sed -i -e s/\<FDTDIR\>/$KERNEL_ID/g "$BUILD_PATH/boot/extlinux/extlinux.conf"
fi fi
@ -564,7 +567,7 @@ UUID=$ROOT_UUID / ext4 defaults 0 0" > "$BUILD_PA
rpi) rpi)
info "copying 10-vchiq-permissions.rules" info "copying 10-vchiq-permissions.rules"
cp --preserve=mode "$SOURCE_PATH/$CONFIG_PATH/10-vchiq-permissions.rules" "$BUILD_PATH/etc/udev/rules.d/" cp --preserve=mode "$CONFIG_PATH/10-vchiq-permissions.rules" "$BUILD_PATH/etc/udev/rules.d/"
info "Making /etc/modules" info "Making /etc/modules"
echo "vchiq echo "vchiq
snd_bcm2835 snd_bcm2835
@ -576,7 +579,7 @@ brcmfmac" >> "$BUILD_PATH"/etc/modules
mkdir -p "$ARM_BOOT" mkdir -p "$ARM_BOOT"
fi fi
info "copying modprobe.conf" info "copying modprobe.conf"
/usr/bin/cp -v --preserve=mode "$SOURCE_PATH/$CONFIG_PATH/modprobe.conf" "$BUILD_PATH/etc/" /usr/bin/cp -v --preserve=mode "$CONFIG_PATH/modprobe.conf" "$BUILD_PATH/etc/"
chown root:root "$BUILD_PATH/etc/modprobe.conf" chown root:root "$BUILD_PATH/etc/modprobe.conf"
info "copying firmware, overlays in rpi boot partition" info "copying firmware, overlays in rpi boot partition"
@ -618,7 +621,7 @@ brcmfmac" >> "$BUILD_PATH"/etc/modules
/bin/mkdir -p "$ROOT/usr/lib/firmware/brcm/" /bin/mkdir -p "$ROOT/usr/lib/firmware/brcm/"
fi fi
if ! [ -f "$ROOT/usr/lib/firmware/brcm/brcmfmac434"* ];then if ! [ -f "$ROOT/usr/lib/firmware/brcm/brcmfmac434"* ];then
/bin/cp --preserve=mode "$SOURCE_PATH/$CONFIG_PATH/brcmfmac434"* "$ROOT/usr/lib/firmware/brcm/" /bin/cp --preserve=mode "$CONFIG_PATH/brcmfmac434"* "$ROOT/usr/lib/firmware/brcm/"
if [ $? -ne 0 ];then if [ $? -ne 0 ];then
error "line $LINENO error copying wifi firmware in $ROOTP/usr/lib/firmware/brcm/ : exiting" error "line $LINENO error copying wifi firmware in $ROOTP/usr/lib/firmware/brcm/ : exiting"
exit 1 exit 1
@ -626,8 +629,8 @@ brcmfmac" >> "$BUILD_PATH"/etc/modules
fi fi
info "copying Mageia image to root partition" info "copying Mageia image to root partition"
/bin/rsync -rlptDH --exclude "$ARM_BOOT/" --exclude "qemu-arm-static*" "$BUILD_PATH/" "$ROOT/" /bin/rsync -rlptogDH --exclude "$ARM_BOOT/" --exclude "qemu-arm-static*" "$BUILD_PATH/" "$ROOT/"
/bin/rsync -rlptDH "$ARM_BOOT/" "$BOOT/" /bin/rsync -rlptogDH "$ARM_BOOT/" "$BOOT/"
;; ;;
odroid) odroid)
ODROID_BOOT="$BUILD_PATH/mnt/odroid_boot" ODROID_BOOT="$BUILD_PATH/mnt/odroid_boot"
@ -645,8 +648,8 @@ brcmfmac" >> "$BUILD_PATH"/etc/modules
info "Copying extlinux.conf on $ODROID_BOOT" info "Copying extlinux.conf on $ODROID_BOOT"
cp --preserve=mode -R "$BUILD_PATH/boot/extlinux" "$ODROID_BOOT/" cp --preserve=mode -R "$BUILD_PATH/boot/extlinux" "$ODROID_BOOT/"
info "copying Mageia image to root partition" info "copying Mageia image to root partition"
/bin/rsync -rlptDH --exclude "$ODROID_BOOT/" --exclude "qemu-arm-static*" "$BUILD_PATH/" "$ROOT/" /bin/rsync -rlptogDH --exclude "$ODROID_BOOT/" --exclude "qemu-arm-static*" "$BUILD_PATH/" "$ROOT/"
/bin/rsync -rlptDH "$ODROID_BOOT/" "$BOOT/" /bin/rsync -rlptogDH "$ODROID_BOOT/" "$BOOT/"
;; ;;
esac esac
@ -768,7 +771,7 @@ do
shift 2 shift 2
;; ;;
--config) --config)
CONFIG_PATH="$2" CONFIG_PATH="$PLATFORMS_PATH/$2"
shift 2 shift 2
;; ;;
--bootfs) --bootfs)
@ -792,33 +795,36 @@ done
# path of config file # path of config file
if ! [ -d "$SOURCE_PATH/$CONFIG_PATH" ];then if ! [ -d "$CONFIG_PATH" ];then
info " Config path does not exists, defaulting to ./$TARGET" info " Config path does not exists, defaulting to ./platforms/$TARGET"
CONFIG_PATH="$TARGET" CONFIG_PATH="$PLATFORMS_PATH/$TARGET"
warning "Do you want i make it and copy the template file in? [Y|n] "
read yn
if [ -z $yn ] || [ $yn = "Y" ] || [ $yn = "y" ];then
/usr/bin/mkdir "$CONFIG_PATH/"
/usr/bin/cp --preserve=mode "$SOURCE_PATH/config.template" "$CONFIG_PATH/mageia4arm.cfg"
warning "You need now to modify the config file ($CONFIG_PATH/mageia4arm.cfg) and relaunch the script"
exit 2
else
error( "Error: Can't continue without config file, exiting" )
exit 3
fi
fi fi
if [ -d "$SOURCE_PATH/$CONFIG_PATH" ];then if [ -e "$CONFIG_PATH/mageia4arm.cfg" ];then
if [ -e "$SOURCE_PATH/$CONFIG_PATH/mageia4arm.cfg" ];then info "using $CONFIG_PATH/mageia4arm.cfg as config"
info "using $SOURCE_PATH/$CONFIG_PATH/mageia4arm.cfg as config" . "$CONFIG_PATH/mageia4arm.cfg"
. "$SOURCE_PATH/$CONFIG_PATH/mageia4arm.cfg"
else else
warning "Config file does not exists, do you want i copy template ? [Y|n] " warning "Config file does not exists, do you want i copy template ? [Y|n] "
read yn read yn
if [ -z $yn ] || [ $yn = "Y" ] || [ $yn = "y" ];then if [ -z $yn ] || [ $yn = "Y" ] || [ $yn = "y" ];then
/usr/bin/cp --preserve=mode "$SOURCE_PATH/mageia4arm.cfg.template" "$SOURCE_PATH/$CONFIG_PATH/mageia4arm.cfg" /usr/bin/cp --preserve=mode "$SOURCE_PATH/mageia4arm.cfg.template" "$CONFIG_PATH/mageia4arm.cfg"
warning "You need now to modify the config file ($SOURCE_PATH/$CONFIG_PATH/mageia4arm.cfg) and relaunch the script" warning "You need now to modify the config file ($CONFIG_PATH/mageia4arm.cfg) and relaunch the script"
exit 2 exit 2
fi fi
fi fi
else else
warning "Config directory does not exists, do you want i make it and copy the template file in? [Y|n] "
read yn
if [ -z $yn ] || [ $yn = "Y" ] || [ $yn = "y" ];then
/usr/bin/mkdir "$SOURCE_PATH/$CONFIG_PATH/"
/usr/bin/cp --preserve=mode "$SOURCE_PATH/config.template" "$SOURCE_PATH/$CONFIG_PATH/mageia4arm.cfg"
warning "You need now to modify the config file ($SOURCE_PATH/$CONFIG_PATH/mageia4arm.cfg) and relaunch the script"
exit 2
fi
fi fi
if ! [ -z "$IMAGE_SIZE_P" ];then if ! [ -z "$IMAGE_SIZE_P" ];then

View File

@ -15,27 +15,27 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>. # along with this program. If not, see <http://www.gnu.org/licenses/>.
MAGEIA_VERSION="7" MAGEIA_VERSION="6"
ARM_VERSION="armv7hl" ARM_VERSION="armv5tl"
#target plateform (xu3-4 or rpi) #target plateform (xu3-4 or rpi)
TARGET="rpi" TARGET="rpi"
#version of the target #version of the target
# 0, 1, 2 ,3_32 for rpi and 3 or 4 for odroid # 0, 1, 2 ,3_32 for rpi and 3 or 4 for odroid
TARGET_VERSION="3_32" TARGET_VERSION="1"
# URL of the Mageia mirror used to install ( see mirrors.mageia.org ) # 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" MIRROR="http://ftp.free.fr/mirrors/mageia.org/distrib/$MAGEIA_VERSION/$ARM_VERSION"
#MIRROR="/mnt/STOCK/mageia/distrib/$MAGEIA_VERSION/$ARM_VERSION" #MIRROR="/mnt/STOCK/mageia/distrib/$MAGEIA_VERSION/$ARM_VERSION"
# image will be created here # image will be created here
INSTALL_PATH="/mnt/perso/raspi-test" INSTALL_PATH="/mnt/perso/raspi1"
# Build directory will be created here # Build directory will be created here
BUILD_PATH="$INSTALL_PATH/build" BUILD_PATH="$INSTALL_PATH/build"
#name of the image #name of the image
IMAGE="Mageia-${MAGEIA_VERSION}-$TARGET.img" IMAGE="Mageia-${MAGEIA_VERSION}-$TARGET$TARGET_VERSION.img"
#Mount point of image's partitions #Mount point of image's partitions
BOOT="/mnt/boot" BOOT="/mnt/boot"
@ -58,4 +58,3 @@ BOOTFS="vfat"
FIRMWARE_PATH="$INSTALL_PATH" FIRMWARE_PATH="$INSTALL_PATH"
FIRMWARE_DIR="firmware-stable" FIRMWARE_DIR="firmware-stable"
FIRMWARE_DOWNLOAD_URL="https://github.com/raspberrypi/firmware/archive/stable.zip" FIRMWARE_DOWNLOAD_URL="https://github.com/raspberrypi/firmware/archive/stable.zip"

View File

@ -15,11 +15,12 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>. # along with this program. If not, see <http://www.gnu.org/licenses/>.
MAGEIA_VERSION="cauldron" MAGEIA_VERSION="7"
ARM_VERSION="armv7hl" ARM_VERSION="armv7hl"
#target plateform (xu3-4 or rpi) #target plateform (xu3-4 or rpi)
TARGET="rpi" TARGET="rpi"
TARGET_VERSION="3"
# URL of the Mageia mirror used to install ( see mirrors.mageia.org ) # 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" MIRROR="http://ftp.free.fr/mirrors/mageia.org/distrib/$MAGEIA_VERSION/$ARM_VERSION"
@ -51,9 +52,6 @@ HOSTNAME="$TARGET.$ID_USER"
#Filesystem of boot partitions (default ext4 raspberry pi need vfat) #Filesystem of boot partitions (default ext4 raspberry pi need vfat)
BOOTFS="vfat" BOOTFS="vfat"
#kernel package to install (just needed for odroid)
KERNEL=""
#Path where the raspberry pi firmware is/will be installed #Path where the raspberry pi firmware is/will be installed
FIRMWARE_PATH="$INSTALL_PATH" FIRMWARE_PATH="$INSTALL_PATH"
FIRMWARE_DIR="firmware-stable" FIRMWARE_DIR="firmware-stable"

View File

@ -0,0 +1,57 @@
# 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/>.
MAGEIA_VERSION="7"
ARM_VERSION="armv7hl"
#target plateform (xu3-4 or rpi)
TARGET="rpi"
TARGET_VERSION="3"
# 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"
#MIRROR="/mnt/STOCK/mageia/distrib/$MAGEIA_VERSION/$ARM_VERSION"
# image will be created here
INSTALL_PATH="/mnt/perso/raspi-test"
# 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
ID_USER="pi"
PASSWORD="raspberry"
#root password
ROOT_PWD="piroot"
#Hostname
HOSTNAME="$TARGET.$ID_USER"
#Filesystem of boot partitions (default ext4 raspberry pi need vfat)
BOOTFS="vfat"
#Path where the raspberry pi firmware is/will be installed
FIRMWARE_PATH="$INSTALL_PATH"
FIRMWARE_DIR="firmware-stable"

View File

@ -0,0 +1,57 @@
# 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/>.
MAGEIA_VERSION="7"
ARM_VERSION="armv7hl"
#target plateform (xu3-4 or rpi)
TARGET="rpi"
TARGET_VERSION="3"
# 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"
#MIRROR="/mnt/STOCK/mageia/distrib/$MAGEIA_VERSION/$ARM_VERSION"
# image will be created here
INSTALL_PATH="/mnt/perso/raspi-test"
# 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
ID_USER="pi"
PASSWORD="raspberry"
#root password
ROOT_PWD="piroot"
#Hostname
HOSTNAME="$TARGET.$ID_USER"
#Filesystem of boot partitions (default ext4 raspberry pi need vfat)
BOOTFS="vfat"
#Path where the raspberry pi firmware is/will be installed
FIRMWARE_PATH="$INSTALL_PATH"
FIRMWARE_DIR="firmware-stable"

View File

@ -13,7 +13,7 @@ setenv macaddr "00:1e:06:61:7a:87
setenv bootrootfs "console=tty1 console=ttySAC2,115200n8 root=UUID=e139ce78-9841-40fe-8823-96a304a09859 rootwait ro fsck.repair=yes net.ifnames=0" setenv bootrootfs "console=tty1 console=ttySAC2,115200n8 root=UUID=<UUID> rootwait ro fsck.repair=yes net.ifnames=0"
@ -209,7 +209,7 @@ setenv hdmi_phy_control "hdmi_tx_amp_lvl=${hdmi_tx_amp_lvl} hdmi_tx_lvl_ch0=${hd
# Load kernel, initrd and dtb in that sequence # Load kernel, initrd and dtb in that sequence
fatload mmc 0:1 0x40008000 zImage fatload mmc 0:1 0x40008000 zImage
fatload mmc 0:1 0x42000000 uInitrd fatload mmc 0:1 0x42000000 uInitrd
fatload mmc 0:1 0x44000000 exynos5422-odroidxu3.dtb fatload mmc 0:1 0x44000000 <DTB>
# set FDT address # set FDT address
fdt addr 0x44000000 fdt addr 0x44000000

BIN
platforms/xu4/boot.tar.gz Normal file

Binary file not shown.

View File

@ -0,0 +1,10 @@
menu Welcome to Mageia-Minimal.
timeout 20
default Mageia
label Mageia
kernel /boot/vmlinuz
append root=UUID=<UUID> dwc_otg.lpm_enable=0 console=ttyS0,115200 kgdboc=ttyS0,115200 console=tty1 rootwait fsck.repair=1 8250.nr_uarts=1 elevator=deadline cma=256M\@512M audit=0
fdtdir /usr/lib/<FDTDIR>
initrd /boot/initrd

View File

@ -0,0 +1,10 @@
menu Welcome to Mageia-Minimal.
timeout 20
default Mageia
label Mageia
kernel /boot/vmlinuz
append root=UUID=<UUID> dwc_otg.lpm_enable=0 console=ttyS0,115200 kgdboc=ttyS0,115200 console=tty1 rootwait fsck.repair=1 8250.nr_uarts=1 elevator=deadline cma=256M\@512M audit=0
fdtdir /usr/lib/<FDTDIR>
initrd /boot/initrd

View File

@ -0,0 +1,52 @@
# 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/>.
MAGEIA_VERSION="cauldron"
ARM_VERSION="armv7hl"
TARGET="xu4"
# 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
INSTALL_PATH="/mnt/perso/xu4-test/"
# 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_xu4"
ROOT="/mnt/root_xu4"
#Default user
ID_USER="odroid"
PASSWORD="xu4"
#root password
ROOT_PWD="odroid"
#Hostname
HOSTNAME="xu4.odroid"
#Filesystem of boot partitions (default ext4)
BOOTFS=ext4
#kernel package to install
KERNEL=kernel-odroid

Binary file not shown.

Binary file not shown.

View File

@ -0,0 +1,91 @@
#
# Copyright (C) 2011 Samsung Electronics Co., Ltd.
# http://www.samsung.com/
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 2 as
# published by the Free Software Foundation.
#
####################################
set -x
if [ -z $1 ]
then
echo "usage: ./sd_fusing.sh <SD Reader's device file>"
exit 0
fi
if [ -b $1 ]
then
echo "$1 reader is identified."
else
echo "$1 is NOT identified."
exit 0
fi
if [ -d /sys/block/${1##*/}boot0 ]; then
echo "$1 is an eMMC card, disabling ${1##*/}boot0 ro"
if ! echo -n 0 | sudo tee /sys/block/${1##*/}boot0/force_ro; then
echo "Enabling r/w for $1boot0 failed"
exit 1
fi
emmc=1
fi
####################################
# fusing images
if [ -n "$emmc" ]; then
signed_bl1_position=0
bl2_position=30
uboot_position=62
tzsw_position=1502
device=$1boot0
else
signed_bl1_position=1
bl2_position=31
uboot_position=63
tzsw_position=1503
device=$1
fi
env_position=2015
# Get the U-Boot blob
if [ -f ./u-boot-dtb.bin ]; then
uboot="./u-boot-dtb.bin"
elif [ -f ./u-boot.bin ]; then
uboot="./u-boot.bin"
elif [ -f ../u-boot-dtb.bin ]; then
uboot="../u-boot-dtb.bin"
elif [ -f ./u-boot.bin.hardkernel ]; then
uboot="./u-boot.bin.hardkernel"
else
echo "U-Boot blob not found."
exit
fi
#<BL1 fusing>
echo "BL1 fusing"
sudo dd iflag=dsync oflag=dsync if=./bl1.bin.hardkernel of=$device seek=$signed_bl1_position
#<BL2 fusing>
echo "BL2 fusing"
sudo dd iflag=dsync oflag=dsync if=./bl2.bin.hardkernel.720k_uboot of=$device seek=$bl2_position
#<u-boot fusing>
echo "u-boot fusing"
sudo dd iflag=dsync oflag=dsync if=$uboot of=$device seek=$uboot_position
#<TrustZone S/W fusing>
echo "TrustZone S/W fusing"
sudo dd iflag=dsync oflag=dsync if=./tzsw.bin.hardkernel of=$device seek=$tzsw_position
#<u-boot env erase>
echo "u-boot env erase..."
sudo dd iflag=dsync oflag=dsync if=/dev/zero of=$device seek=$env_position bs=512 count=32
####################################
#<Message Display>
echo "U-boot image is fused successfully."
echo "Eject $1 and insert it again."

Binary file not shown.

Binary file not shown.

View File

@ -0,0 +1,34 @@
#!/bin/bash
# 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 /root/kernel-odroid-4.14.y-1.armv7hl.rpm basesystem chrony rng-tools man openssh-server rfkill wireless-tools bluez wpa_supplicant make dracut u-boot-tools rsync
#/usr/sbin/urpmi --urpmi-root "$BUILD_PATH" --ignorearch --no-verify-rpm --auto --split-level 200 --split-length 200
/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

File diff suppressed because it is too large Load Diff

View File

@ -1,6 +0,0 @@
#!/bin/sh
cd /boot/extlinux
sed -i.old -e s,/boot,,g extlinux.conf
sed -i -e s,/usr/lib/.*,/fdt/,g extlinux.conf
sed -i -e 's/append.*$/& audit=0 fsck.repair=1/' extlinux.conf