aboutsummaryrefslogtreecommitdiffstats
path: root/platforms/bananaPro/second_stage_install.sh
diff options
context:
space:
mode:
Diffstat (limited to 'platforms/bananaPro/second_stage_install.sh')
-rw-r--r--platforms/bananaPro/second_stage_install.sh69
1 files changed, 44 insertions, 25 deletions
diff --git a/platforms/bananaPro/second_stage_install.sh b/platforms/bananaPro/second_stage_install.sh
index 2143364..ab7f8aa 100644
--- a/platforms/bananaPro/second_stage_install.sh
+++ b/platforms/bananaPro/second_stage_install.sh
@@ -23,12 +23,39 @@ export ARCH=arm
/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="8250_dw"
+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} \"\n\n# Driver to add for banana Pro (serial) :\nadd_drivers+=\" ${DRIVER_ADD_LIST} \"\n" > /etc/dracut.conf.d/30-bananapro.conf
+
+
#Install all packages you need
<INSTALL_EXEC> basesystem u-boot 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=arm-efi --efi-directory=/boot/EFI
+
#For dracut :
<INSTALL_EXEC> u-boot-tools mindi-busybox plymouth-scripts #systemd-bootchart libcap-utils keyutils lvm2 #dmsetup
+
# ############################
# ## For compiling a module ##
# ############################
@@ -53,28 +80,13 @@ export ARCH=arm
# ## Impossible to build any module there.
-# ####################################################
-# ## To embed a module inside the early boot initrd ##
-# ####################################################
-# #Set the kernel name :
-# KERNELVERSION="5.3.7-desktop-4.mga7"
-K_INST_VERSION=$(rpm -q kernel-desktop-latest | sed -e 's/kernel-\([[:alnum:]]*\)-latest-\([\.[:digit:]]*\)-\([\.[:alnum:]]*\).*$/\2-\1-\3/')
-# #Set the list of added modules and omitted modules :
-# DRIVER_ADD_LIST="8250_dw"
-# DRIVER_OMI_LIST="drm"
-# #Create a configuration file inside the FS, it will be used by dracut for all kernel update
-# echo -e "# Omiting drm as it failed for arm :\nomit_dracutmodules+=\" ${DRIVER_OMI_LIST} \"\n\n# Driver to add for banana Pro (serial) :\nadd_drivers+=\" ${DRIVER_ADD_LIST} \"\n" > /etc/dracut.conf.d/30-bananapro.conf
+# ###########################
+# ## 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}
-ln -r -s /boot/initrd-${K_INST_VERSION}.img /boot/initrd.img
-# #Add the uboot header to the initrd file, first, find the file :
-# INITRD_FILE="$(echo "${OUTPUT}" | grep "Creating initramfs image file" | sed -e "s/^[*:[:space:][:alnum:]]*'//" -e "s/'.*$//" )"
-# #Add the uboot header, the result file will contain a 'u' as prefix-name.
-# mkimage -A arm -T ramdisk -C lzma -n initrd -d ${INITRD_FILE} "$(dirname "${INITRD_FILE}")/u$(basename "${INITRD_FILE}")"
-# #generate a symlink relative r and symbolic s :
-# rm -f /boot/initrd
-# ln -r -s "$(dirname "${INITRD_FILE}")/u$(basename "${INITRD_FILE}")" /boot/initrd
+# 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 : ##
@@ -83,12 +95,14 @@ ln -r -s /boot/initrd-${K_INST_VERSION}.img /boot/initrd.img
# 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 : ##
###############################################
@@ -98,11 +112,13 @@ ln -r -s /boot/initrd-${K_INST_VERSION}.img /boot/initrd.img
# #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
+# 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.
-ln -r -s "${VMLINUZ}" /boot/vmlinuz #For extlinux.conf
+# rm -f /boot/vmlinuz
+# ln -r -s "${VMLINUZ}" /boot/vmlinuz #For extlinux.conf
+
################################
## Create the extlinux script ##
@@ -115,6 +131,9 @@ ln -r -s "${VMLINUZ}" /boot/vmlinuz #For extlinux.conf
# 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
@@ -125,4 +144,4 @@ ln -r -s "${VMLINUZ}" /boot/vmlinuz #For extlinux.conf
/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.
+## 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.