diff options
-rwxr-xr-x | create_arm_image.sh | 3 | ||||
-rwxr-xr-x | functions.sh | 16 | ||||
-rw-r--r-- | mageia4arm.conf.json | 3 | ||||
-rwxr-xr-x | platforms/bananaPro/specialFunctions.sh | 2 | ||||
-rw-r--r-- | platforms/freebox-delta/.specialFunctions.sh.kate-swp | bin | 77 -> 0 bytes | |||
-rw-r--r-- | platforms/freebox-delta/mageia4arm.cfg | 16 | ||||
-rw-r--r-- | platforms/freebox-delta/second_stage_install.sh | 80 | ||||
-rwxr-xr-x | platforms/freebox-delta/specialFunctions.sh | 50 | ||||
-rwxr-xr-x | platforms/generic_aarch64/specialFunctions.sh | 2 | ||||
-rwxr-xr-x | platforms/rpi-aarch64/specialFunctions.sh | 2 | ||||
-rwxr-xr-x | platforms/rpi1/specialFunctions.sh | 2 | ||||
-rwxr-xr-x | platforms/rpi2/specialFunctions.sh | 2 | ||||
-rwxr-xr-x | platforms/rpi3+/specialFunctions.sh | 2 | ||||
-rwxr-xr-x | platforms/rpi3+64/specialFunctions.sh | 2 | ||||
-rwxr-xr-x | platforms/rpi3/specialFunctions.sh | 2 | ||||
-rwxr-xr-x | platforms/rpi4/specialFunctions.sh | 2 | ||||
-rwxr-xr-x | platforms/xu4/specialFunctions.sh | 2 |
17 files changed, 90 insertions, 98 deletions
diff --git a/create_arm_image.sh b/create_arm_image.sh index c646850..aea4ed0 100755 --- a/create_arm_image.sh +++ b/create_arm_image.sh @@ -374,9 +374,10 @@ case ${OPT} in jumpchroot extrapackage copyingsystem - bunrningBootloader + burningBootloader unmountingPartitions unloopingImage + imageConversion warning "You can now burn the image ( ${INSTALL_PATH}/${IMAGE} ) on SD card" print_info "pv \"${INSTALL_PATH}/${IMAGE}\" | dd of=/dev/mmcblk#" diff --git a/functions.sh b/functions.sh index 76fd278..7df8d67 100755 --- a/functions.sh +++ b/functions.sh @@ -63,13 +63,20 @@ function check_environment() { if [ 0 -ne ${?} ]; then error "urpmi is missing." fi - elif [ "x${INSTALL_METHOD}" == "xurpmi" ]; then + elif [ "x${INSTALL_METHOD}" == "xdnf" ]; then hash /usr/bin/dnf if [ 0 -ne ${?} ]; then error "dnf is missing." fi fi + list_of_tools="/usr/bin/qemu-arm-static /usr/bin/qemu-img" ### TODO add other environmnet things, like : from function createchroot() + for tool in ${list_of_tools} ; do + hash ${tool} + if [ 0 -ne ${?} ]; then + error "${tool} is missing." + fi + done } function verify_disk_space() { @@ -99,7 +106,7 @@ function createchroot() { fi fi - if [ `arch` != "${ARM_VERSION}" ]; then + if [ $(arch) != "${ARM_VERSION}" ]; then if ! [ -f /usr/bin/qemu-arm-static ]; then title "Qemu package not present : installing qemu packages" #/usr/bin/dnf --assumeyes --setopt=install_weak_deps=False install qemu-user-static @@ -921,6 +928,11 @@ function copyingCustomSystem() { return 1 } +function imageConversion() { + # reimplement this function in your platforms/yourplatform/specialFunctions.sh file. + return 0 +} + ERRORN=0 diff --git a/mageia4arm.conf.json b/mageia4arm.conf.json index 63478c5..2196bda 100644 --- a/mageia4arm.conf.json +++ b/mageia4arm.conf.json @@ -19,6 +19,7 @@ { "board":"rpi-aarch64", "desktop":"plasma5-minimal", "extra_packages":null, "nonfree":true, "size":6 }, { "board":"generic_aarch64", "desktop":null, "extra_packages":null, "nonfree":false, "size":2 }, { "board":"rpi2", "desktop":null, "extra_packages":null, "nonfree":false, "size":2 }, - { "board":"rpi3+64", "desktop":"lxde", "extra_packages":null, "nonfree":false, "size":2 } + { "board":"rpi3+64", "desktop":"lxde", "extra_packages":null, "nonfree":false, "size":2 }, + { "board":"freebox-delta", "desktop":null, "extra_packages":null, "nonfree":false, "size":2 } ] } diff --git a/platforms/bananaPro/specialFunctions.sh b/platforms/bananaPro/specialFunctions.sh index 2340356..c19d3b0 100755 --- a/platforms/bananaPro/specialFunctions.sh +++ b/platforms/bananaPro/specialFunctions.sh @@ -39,7 +39,7 @@ EOT return 0 } -function bunrningBootloader() +function burningBootloader() { # DEVICE is set just before this function and looped. title "Burning the bootloader..." diff --git a/platforms/freebox-delta/.specialFunctions.sh.kate-swp b/platforms/freebox-delta/.specialFunctions.sh.kate-swp Binary files differdeleted file mode 100644 index f185d8c..0000000 --- a/platforms/freebox-delta/.specialFunctions.sh.kate-swp +++ /dev/null diff --git a/platforms/freebox-delta/mageia4arm.cfg b/platforms/freebox-delta/mageia4arm.cfg index b62e366..0958f25 100644 --- a/platforms/freebox-delta/mageia4arm.cfg +++ b/platforms/freebox-delta/mageia4arm.cfg @@ -1,6 +1,6 @@ # Copyright (C) 2017-2018 Daniel Tartavel-jeannot <contact@librepc.com> -# Copyright (C) 2019-2022 Jean-Baptiste Biernacki <j.biernacki@free.fr> +# Copyright (C) 2019-2020 Jean-Baptiste Biernacki <j.biernacki@free.fr> # # This program is free software; you can redistribute it and/or modify @@ -23,15 +23,12 @@ MAGEIA_VERSION=${MAGEIA_VERSION:="8"} ARM_VERSION="aarch64" # Target plateform (odroid or rpi) -TARGET="Delta" +TARGET="freebox-delta" # Target version (0,2,3 for raspi, 3 or 4 for odroid) TARGET_VERSION="1" # URL of the Mageia mirror used to install ( see mirrors.mageia.org ) -# MIRROR=${MIRROR:="http://ftp.free.fr/mirrors/mageia.org/distrib/${MAGEIA_VERSION}/${ARM_VERSION}"} -MIRROR_ROOT=http://ftp.free.fr/mirrors/mageia.org/distrib -MIRROR_REPO="${MIRROR_ROOT}/${MAGEIA_VERSION}/${ARM_VERSION}" -MIRROR=${MIRROR:="${MIRROR_REPO}"} +# MIRROR="http://ftp.free.fr/mirrors/mageia.org/distrib/${MAGEIA_VERSION}/${ARM_VERSION}" # Default user # If not set, no user will be defined. @@ -51,10 +48,7 @@ SEPARATE_BOOT_PARTITION=1 BOOTFS="vfat" #kernel package to install -KERNEL="kernel-desktop" - -#Size of the image by default -IMAGE_SIZE=1 +KERNEL="kernel-server" #The arguments for the Kernel -BOOT_ARGS='' +BOOT_ARGS='audit=0' diff --git a/platforms/freebox-delta/second_stage_install.sh b/platforms/freebox-delta/second_stage_install.sh index 27339bf..00ca822 100644 --- a/platforms/freebox-delta/second_stage_install.sh +++ b/platforms/freebox-delta/second_stage_install.sh @@ -17,9 +17,7 @@ # 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=arm - -source /to_source.sh +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 @@ -29,56 +27,33 @@ source /to_source.sh # ## To embed a module inside the early boot initrd ## # #################################################### # #Set the list space separated of added modules and omitted modules : -# DRIVER_ADD_LIST="8250_dw" -DRIVER_ADD_LIST="sunxi-mmc mmcblk 8250_dw" -DRIVER_OMI_LIST="drm" +# 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/ - -cat <<EOT >/etc/dracut.conf.d/30-bananapro.conf -# Omiting drm as it failed for arm : -omit_dracutmodules+=" ${DRIVER_OMI_LIST} " - -# Driver to add for banana Pro (serial) : -add_drivers+=" ${DRIVER_ADD_LIST} " -EOT +# 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 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 +<INSTALL_EXEC> basesystem grub2-efi efibootmgr chrony polkit lockdev rng-tools man openssh-server rfkill wireless-tools make rsync binutils ldetect usbutils cloud-init #For the wifi : -/sbin/urpmi.update "Nonfree Release" "Nonfree Updates" -<INSTALL_EXEC> --media "Nonfree Release,Nonfree Updates" iwlwifi-firmware -# kernel-firmware-nonfree - -<INSTALL_EXEC> --noscripts u-boot grub2-common grub2-efi grub2-mageia-theme u-boot-tools - +# /sbin/urpmi.update "Nonfree Release" +# /sbin/urpmi.update "Nonfree Updates" +# <INSTALL_EXEC> --media "Nonfree Release" --media "Nonfree Updates" kernel-firmware-nonfree -echo \ -"# Configuration file for fw_(printenv/setenv) utility. -# Up to two entries are valid, in this case the redundant -# environment sector is assumed present. -# MTD device name Device offset Env. size Flash sector size -/boot/EFI/uboot.env 0x0000 0x20000" > /etc/fw_env.config +# <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 -cp /usr/lib/u-boot/Bananapro/default_env.txt /boot/EFI/uboot.env.txt -sed -i -e 's|preboot=.*$|preboot=|' \ - -e 's|boot\/bootarm\.efi|mageia\/grubarm\.efi|g' \ - -e "s|uuid_gpt_esp=.*$|uuid_gpt_esp=${BOOT_UUID}|" \ - -e "s|uuid_gpt_system=.*$|uuid_gpt_system=${ROOT_UUID}|" \ - /boot/EFI/uboot.env.txt -cat /boot/EFI/uboot.env.txt | mkenvimage -s $((0x20000)) -o /boot/EFI/uboot.env - -rm /boot/EFI/uboot.env.txt - - -mv /etc/grub.d/30_os-prober /tmp -/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=arm-efi --efi-directory=/boot/EFI --force --force-file-id -mv /tmp/30_os-prober /etc/grub.d/ +/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 # ############################ @@ -145,22 +120,6 @@ mv /tmp/30_os-prober /etc/grub.d/ # ln -r -s "${VMLINUZ}" /boot/vmlinuz #For extlinux.conf -################################ -## Create the extlinux script ## -################################ -# BUG : installkernel call bootloader-config which doesn't process inside a chroot. -# echo -e "\nTrying to generate extlinux script\n" -# K_INST_VERSION=$(rpm -q kernel-desktop-latest | sed -e 's/kernel-\([[:alnum:]]*\)-latest-\([\.[:digit:]]*\)-\([\.[:alnum:]]*\).*$/\2-\1-\3/') -# /sbin/installkernel %{kversion}-$kernel_flavour-%{buildrpmrel} -# bash -x /sbin/installkernel ${K_INST_VERSION} -# perl -d /usr/sbin/bootloader-config --kernel-version ${K_INST_VERSION} --initrd-options '' --action add-kernel -# /usr/sbin/bootloader-config --kernel-version ${K_INST_VERSION} --initrd-options '' --action add-kernel -# echo -e "\nEnd trying to generate extlinux script with errcode ${?}\n" -# In a x86_64 chroot for armv7, the bootloader-config script fails to find the /etc/fstab and add an empty entry. See BUG 25879 -#Removing empty entries : -# sed -e '/label[[:space:]]*$/d' -e '/[[:space:]]*kernel[[:space:]]*$/d' -i /boot/extlinux/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 @@ -168,6 +127,5 @@ mv /tmp/30_os-prober /etc/grub.d/ /usr/bin/chown :bin /sbin/traceroute /usr/bin/chown polkitd /etc/polkit-1/rules.d -df -h ## 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/freebox-delta/specialFunctions.sh b/platforms/freebox-delta/specialFunctions.sh index 2340356..2cd8725 100755 --- a/platforms/freebox-delta/specialFunctions.sh +++ b/platforms/freebox-delta/specialFunctions.sh @@ -18,38 +18,64 @@ # along with this program. If not, see <http://www.gnu.org/licenses/>. -# SFdisk partitionment commands : +#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 imageConversion() +{ + title "Converting image into a qcow2 file" + + qemu-img convert -O qcow2 ${INSTALL_PATH}/${IMAGE} ${INSTALL_PATH}/${IMAGE}.qcow2 + return 0 +} + function preImgCreation() { - # Nothing to do. +# title "Creating Banana Pro image" + #Nothing to download. return 0 } function postPrepareChroot() { - # Provide to chroot environment some variables via a file - cat <<EOT >${BUILD_PATH}/to_source.sh -ROOT_UUID=${ROOT_UUID} -BOOT_UUID=${BOOT_UUID} -EOT + #Nothing to do. return 0 } -function bunrningBootloader() +function burningBootloader() { # DEVICE is set just before this function and looped. - title "Burning the bootloader..." - dd if=${BUILD_PATH}/usr/lib/u-boot/Bananapro/u-boot-sunxi-with-spl.bin of=${DEVICE} bs=1024 seek=8 return 0 } function copyingCustomSystem() { - # Remove the file given environment variable in the chroot. - rm -f ${BUILD_PATH}/to_source.sh +# installpkg ${CONFIG_PATH}/package.mga7.aarch64.rpm +# installpkg package return 0 } diff --git a/platforms/generic_aarch64/specialFunctions.sh b/platforms/generic_aarch64/specialFunctions.sh index ccbc9d2..4484c54 100755 --- a/platforms/generic_aarch64/specialFunctions.sh +++ b/platforms/generic_aarch64/specialFunctions.sh @@ -59,7 +59,7 @@ function postPrepareChroot() return 0 } -function bunrningBootloader() +function burningBootloader() { # DEVICE is set just before this function and looped. return 0 diff --git a/platforms/rpi-aarch64/specialFunctions.sh b/platforms/rpi-aarch64/specialFunctions.sh index 8209db3..f36f824 100755 --- a/platforms/rpi-aarch64/specialFunctions.sh +++ b/platforms/rpi-aarch64/specialFunctions.sh @@ -40,7 +40,7 @@ function postPrepareChroot() } -function bunrningBootloader() +function burningBootloader() { #Nothing to do. (Except replacing default function.) return 0 diff --git a/platforms/rpi1/specialFunctions.sh b/platforms/rpi1/specialFunctions.sh index 40e7124..f5f27e7 100755 --- a/platforms/rpi1/specialFunctions.sh +++ b/platforms/rpi1/specialFunctions.sh @@ -72,7 +72,7 @@ function postPrepareChroot() return 0 } -function bunrningBootloader() +function burningBootloader() { #Nothing to do. (Except replacing default function.) return 0 diff --git a/platforms/rpi2/specialFunctions.sh b/platforms/rpi2/specialFunctions.sh index 472a06f..96a202c 100755 --- a/platforms/rpi2/specialFunctions.sh +++ b/platforms/rpi2/specialFunctions.sh @@ -71,7 +71,7 @@ function postPrepareChroot() return 0 } -function bunrningBootloader() +function burningBootloader() { #Nothing to do. (Except replacing default function.) return 0 diff --git a/platforms/rpi3+/specialFunctions.sh b/platforms/rpi3+/specialFunctions.sh index 83c62ee..16de703 100755 --- a/platforms/rpi3+/specialFunctions.sh +++ b/platforms/rpi3+/specialFunctions.sh @@ -72,7 +72,7 @@ function postPrepareChroot() } -function bunrningBootloader() +function burningBootloader() { #Nothing to do. (Except replacing default function.) return 0 diff --git a/platforms/rpi3+64/specialFunctions.sh b/platforms/rpi3+64/specialFunctions.sh index ba54564..e99c419 100755 --- a/platforms/rpi3+64/specialFunctions.sh +++ b/platforms/rpi3+64/specialFunctions.sh @@ -80,7 +80,7 @@ function postPrepareChroot() } -function bunrningBootloader() +function burningBootloader() { #Nothing to do. (Except replacing default function.) return 0 diff --git a/platforms/rpi3/specialFunctions.sh b/platforms/rpi3/specialFunctions.sh index 472a06f..96a202c 100755 --- a/platforms/rpi3/specialFunctions.sh +++ b/platforms/rpi3/specialFunctions.sh @@ -71,7 +71,7 @@ function postPrepareChroot() return 0 } -function bunrningBootloader() +function burningBootloader() { #Nothing to do. (Except replacing default function.) return 0 diff --git a/platforms/rpi4/specialFunctions.sh b/platforms/rpi4/specialFunctions.sh index 581baa5..ab5a0fc 100755 --- a/platforms/rpi4/specialFunctions.sh +++ b/platforms/rpi4/specialFunctions.sh @@ -80,7 +80,7 @@ function postPrepareChroot() } -function bunrningBootloader() +function burningBootloader() { #Nothing to do. (Except replacing default function.) return 0 diff --git a/platforms/xu4/specialFunctions.sh b/platforms/xu4/specialFunctions.sh index f0e8bbb..afdbf02 100755 --- a/platforms/xu4/specialFunctions.sh +++ b/platforms/xu4/specialFunctions.sh @@ -62,7 +62,7 @@ function postPrepareChroot() } -function bunrningBootloader() +function burningBootloader() { if [ ${TARGET} = "odroid" ]; then info "installing blobs" |