diff --git a/board/phytium/common/debian-package-installer b/board/phytium/common/debian-package-installer index 81faa92e..916b7d11 100755 --- a/board/phytium/common/debian-package-installer +++ b/board/phytium/common/debian-package-installer @@ -86,7 +86,6 @@ do_distrorfs_second_stage() { [ -f /usr/bin/sudo -a ! -u /usr/bin/sudo ] && chmod +s /usr/bin/sudo [ -d /var/cache/man ] && chown -R man:root /var/cache/man [ -d /var/lib/sddm ] && chown -R sddm:sddm /var/lib/sddm - [ -L /lib/lib ] && rm -rf /lib/lib # some shared libraries locate in /lib/aarch64-linux-gnu(or /lib/arm-linux-gnueabihf) and /usr/local/lib echo export LD_LIBRARY_PATH=/usr/local/lib:/usr/lib/$sysarch:/lib/$sysarch >> /etc/profile diff --git a/board/phytium/common/post-custom-skeleton-debian-base-11.sh b/board/phytium/common/post-custom-skeleton-debian-base-11.sh index b02c1000..8dab7013 100755 --- a/board/phytium/common/post-custom-skeleton-debian-base-11.sh +++ b/board/phytium/common/post-custom-skeleton-debian-base-11.sh @@ -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} diff --git a/board/phytium/common/post-custom-skeleton-ubuntu-base-20.04.sh b/board/phytium/common/post-custom-skeleton-ubuntu-base-20.04.sh index c9994be8..c1ec1bfb 100755 --- a/board/phytium/common/post-custom-skeleton-ubuntu-base-20.04.sh +++ b/board/phytium/common/post-custom-skeleton-ubuntu-base-20.04.sh @@ -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 @@ -58,11 +57,6 @@ do_distrorfs_first_stage() { mkdir -p $2/usr/local/bin cp -f board/phytium/common/ubuntu-package-installer $RFSDIR/usr/local/bin/ - mv ${BUILD_DIR}/modules $RFSDIR/lib - if [ -d ${BUILD_DIR}/linux-headers-${KERNELVERSION} ]; then - mkdir -p $RFSDIR/usr/src/ - 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 @@ -283,34 +277,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 focal ubuntu $(plat_name) $(full_rtf) + + # change the hostname to "platforms-Ubuntu" + echo $(plat_name)-Ubuntu > ${1}/etc/hostname + + if [ $distro = focal ]; then + sed -i "s/float(n\[0\])/float(n[0].split()[0])/" ${1}/usr/share/pyshared/lsb_release.py + 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 focal ubuntu $(plat_name) $(full_rtf) - - # change the hostname to "platforms-Ubuntu" - echo $(plat_name)-Ubuntu > ${1}/etc/hostname - - if [ $distro = focal ]; then - sed -i "s/float(n\[0\])/float(n[0].split()[0])/" ${1}/usr/share/pyshared/lsb_release.py - fi if grep -Eq "^BR2_PACKAGE_XORG_ROGUE_UMLIBS=y$" ${BR2_CONFIG}; then make xorg-rogue-umlibs-rebuild ${O:+O=$O}