|
@@ -32,6 +32,7 @@ export ARCH=arm
|
32
|
32
|
# ############################
|
33
|
33
|
# ## For compiling a module ##
|
34
|
34
|
# ############################
|
|
35
|
+# BUG : Make does not like to build inside chroot. It doesn't find tools. Impossible to build any module there.
|
35
|
36
|
# /usr/sbin/urpmi --ignorearch --no-verify-rpm --auto --split-level 200 --split-length 0 kernel-source-latest
|
36
|
37
|
# #See if it is a Server or Desktop kernel :
|
37
|
38
|
# rpm -q kernel-serveur-latest
|
|
@@ -57,13 +58,16 @@ export ARCH=arm
|
57
|
58
|
# ####################################################
|
58
|
59
|
# #Set the kernel name :
|
59
|
60
|
# KERNELVERSION="5.3.7-desktop-4.mga7"
|
|
61
|
+K_INST_VERSION=$(rpm -q kernel-desktop-latest | sed -e 's/kernel-\([[:alnum:]]*\)-latest-\([\.[:digit:]]*\)-\([\.[:alnum:]]*\).*$/\2-\1-\3/')
|
60
|
62
|
# #Set the list of added modules and omitted modules :
|
61
|
63
|
# DRIVER_ADD_LIST="8250_dw"
|
62
|
64
|
# DRIVER_OMI_LIST="drm"
|
63
|
65
|
# #Create a configuration file inside the FS, it will be used by dracut for all kernel update
|
64
|
66
|
# 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
|
65
|
67
|
# #Generate the initrd :
|
66
|
|
-# 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/${KERNELVERSION}" --xz --printsize --kernel-image /boot/vmlinuz --fstab initrd-${KERNELVERSION}.img ${KERNELVERSION} 2>&1 | tee /dev/tty )
|
|
68
|
+# 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 )
|
|
69
|
+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}
|
|
70
|
+ln -r -s /boot/initrd-${K_INST_VERSION}.img /boot/initrd.img
|
67
|
71
|
# #Add the uboot header to the initrd file, first, find the file :
|
68
|
72
|
# INITRD_FILE="$(echo "${OUTPUT}" | grep "Creating initramfs image file" | sed -e "s/^[*:[:space:][:alnum:]]*'//" -e "s/'.*$//" )"
|
69
|
73
|
# #Add the uboot header, the result file will contain a 'u' as prefix-name.
|
|
@@ -94,17 +98,20 @@ export ARCH=arm
|
94
|
98
|
#Get the vmlinuz file :
|
95
|
99
|
VMLINUZ=$(ls --sort=time -1 /boot/vmlinuz-[[:digit:]]* | head -n 1)
|
96
|
100
|
rm -f /boot/uvmlinuz
|
97
|
|
-ln -r -s "${VMLINUZ}" /boot/uvmlinuz
|
|
101
|
+ln -r -s "${VMLINUZ}" /boot/uvmlinuz #For the uboot script
|
|
102
|
+# Normally, /boot/vmlinuz is generated with the /sbin/installkernel script, but it is not generated with chroot.
|
|
103
|
+ln -r -s "${VMLINUZ}" /boot/vmlinuz #For extlinux.conf
|
98
|
104
|
|
99
|
105
|
################################
|
100
|
106
|
## Create the extlinux script ##
|
101
|
107
|
################################
|
|
108
|
+# BUG : installkernel call bootloader-config which doesn't process inside a chroot.
|
102
|
109
|
# echo -e "\nTrying to generate extlinux script\n"
|
103
|
|
-K_INST_VERSION=$(rpm -q kernel-desktop-latest | sed -e 's/kernel-\([[:alnum:]]*\)-latest-\([\.[:digit:]]*\)-\([\.[:alnum:]]*\).*$/\2-\1-\3/')
|
|
110
|
+# K_INST_VERSION=$(rpm -q kernel-desktop-latest | sed -e 's/kernel-\([[:alnum:]]*\)-latest-\([\.[:digit:]]*\)-\([\.[:alnum:]]*\).*$/\2-\1-\3/')
|
104
|
111
|
# /sbin/installkernel %{kversion}-$kernel_flavour-%{buildrpmrel}
|
105
|
112
|
# bash -x /sbin/installkernel ${K_INST_VERSION}
|
106
|
113
|
# perl -d /usr/sbin/bootloader-config --kernel-version ${K_INST_VERSION} --initrd-options '' --action add-kernel
|
107
|
|
-/usr/sbin/bootloader-config --kernel-version ${K_INST_VERSION} --initrd-options '' --action add-kernel
|
|
114
|
+# /usr/sbin/bootloader-config --kernel-version ${K_INST_VERSION} --initrd-options '' --action add-kernel
|
108
|
115
|
# echo -e "\nEnd trying to generate extlinux script with errcode ${?}\n"
|
109
|
116
|
|
110
|
117
|
|