|
|
@ -36,7 +36,6 @@ do_distrorfs_first_stage() { |
|
|
|
[ -z $RFSDIR ] && echo No RootFS exist! && return |
|
|
|
[ -f $RFSDIR/etc/.firststagedone ] && echo $RFSDIR firststage exist! && return |
|
|
|
[ -f /etc/.firststagedone -a ! -f /proc/uptime ] && return |
|
|
|
mkdir -p $RFSDIR/lib/modules |
|
|
|
|
|
|
|
if [ $1 = arm64 ]; then |
|
|
|
tgtarch=aarch64 |
|
|
@ -59,11 +58,6 @@ do_distrorfs_first_stage() { |
|
|
|
sudo chown 0:0 $RFSDIR |
|
|
|
sudo mkdir -p $2/usr/local/bin |
|
|
|
sudo cp -f board/phytium/common/debian-package-installer $RFSDIR/usr/local/bin/ |
|
|
|
mv ${BUILD_DIR}/modules $RFSDIR/lib |
|
|
|
if [ -d ${BUILD_DIR}/linux-headers-${KERNELVERSION} ]; then |
|
|
|
sudo mkdir -p $RFSDIR/usr/src/ |
|
|
|
sudo mv ${BUILD_DIR}/linux-headers-${KERNELVERSION} $RFSDIR/usr/src/ |
|
|
|
fi |
|
|
|
packages_list=board/phytium/common/$3 |
|
|
|
[ ! -f $packages_list ] && echo $packages_list not found! && exit 1 |
|
|
|
|
|
|
@ -281,34 +275,32 @@ deploy_kernel_headers_419 () { |
|
|
|
main() |
|
|
|
{ |
|
|
|
# $1 - the current rootfs directory, skeleton-custom or target |
|
|
|
rm -rf $1/* |
|
|
|
|
|
|
|
# run first stage do_distrorfs_first_stage arm64 ${1} ubuntu-additional_packages_list focal ubuntu |
|
|
|
do_distrorfs_first_stage $(arch_type) ${1} ubuntu-additional_packages_list bullseye debian $(plat_name) $(full_rtf) |
|
|
|
|
|
|
|
# change the hostname to "platforms-Ubuntu" |
|
|
|
echo $(plat_name)-debian > ${1}/etc/hostname |
|
|
|
|
|
|
|
if ! grep -q "$(plat_name)-debian" ${1}/etc/hosts; then |
|
|
|
echo 127.0.0.1 $(plat_name)-debian | sudo tee -a ${1}/etc/hosts 1>/dev/null |
|
|
|
fi |
|
|
|
|
|
|
|
if [ ! -d $1/lib/modules ]; then |
|
|
|
make linux-rebuild |
|
|
|
make linux-rebuild ${O:+O=$O} |
|
|
|
fi |
|
|
|
|
|
|
|
KERNELVERSION=`ls $1/lib/modules` |
|
|
|
if grep -Eq "^BR2_ROOTFS_LINUX_HEADERS=y$" ${BR2_CONFIG}; then |
|
|
|
if [[ ${KERNELVERSION} = 5.10* ]];then |
|
|
|
deploy_kernel_headers_510 $1 ${KERNELVERSION} |
|
|
|
mv $1/usr/src/linux-headers-${KERNELVERSION} ${BUILD_DIR}/ |
|
|
|
elif [[ ${KERNELVERSION} = 4.19* ]];then |
|
|
|
deploy_kernel_headers_419 $1 ${KERNELVERSION} |
|
|
|
mv $1/usr/src/linux-headers-${KERNELVERSION} ${BUILD_DIR}/ |
|
|
|
else |
|
|
|
echo "error: linux kernel version is neither 4.19 nor 5.10." |
|
|
|
fi |
|
|
|
fi |
|
|
|
mv $1/lib/modules ${BUILD_DIR}/ |
|
|
|
rm -rf $1/* |
|
|
|
|
|
|
|
# run first stage do_distrorfs_first_stage arm64 ${1} ubuntu-additional_packages_list focal ubuntu |
|
|
|
do_distrorfs_first_stage $(arch_type) ${1} ubuntu-additional_packages_list bullseye debian $(plat_name) $(full_rtf) |
|
|
|
|
|
|
|
# change the hostname to "platforms-Ubuntu" |
|
|
|
echo $(plat_name)-debian > ${1}/etc/hostname |
|
|
|
|
|
|
|
if ! grep -q "$(plat_name)-debian" ${1}/etc/hosts; then |
|
|
|
echo 127.0.0.1 $(plat_name)-debian | sudo tee -a ${1}/etc/hosts 1>/dev/null |
|
|
|
fi |
|
|
|
|
|
|
|
if grep -Eq "^BR2_PACKAGE_XORG_ROGUE_UMLIBS=y$" ${BR2_CONFIG}; then |
|
|
|
make xorg-rogue-umlibs-rebuild ${O:+O=$O} |
|
|
|