Skip to content

Commit

Permalink
Pull req (#1)
Browse files Browse the repository at this point in the history
* trying out matrix

* Update main.yml

* Update main.yml

* Update main.yml

* Update main.yml

* Update nabu-rootfsKernel_build.sh

* Update nabu-rootfsKernel_build.sh

* Update nabu-rootfs_build.sh

* Delete nabu-rootfs_build.sh

* Rename nabu-rootfsKernel_build.sh to nabu-rootfs_build.sh

* Create nabu-Kernel_build.sh

* Update main.yml

* temporaly disabled desktop for debug

* Update nabu-rootfs_build.sh

* Update main.yml

* Update nabu-rootfs_build.sh

* Update README.md

* Update README.md

* Update README.md

* Built to test ready for contribute

* Update main.yml

* Add files via upload

* Delete nabu.png

* Add files via upload

* Delete nabu.png

* Add files via upload

* Delete nabu.png

* Add files via upload

* Update README.md

* Update README.md

* Update README.md

grammar
  • Loading branch information
jiganomegsdfdf authored Mar 8, 2024
1 parent 7b6d3ff commit 414f479
Show file tree
Hide file tree
Showing 6 changed files with 74 additions and 160 deletions.
50 changes: 36 additions & 14 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,32 +16,54 @@ on:
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "build"
build:
# The type of runner that the job will run on
kernel:
runs-on: ubuntu-latest

strategy:
matrix:
version: [6.4, 6.6, 6.7]
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v3

- uses: actions/checkout@v4
- name: Install Dependencies
run: sudo apt update && sudo apt install build-essential gcc-aarch64-linux-gnu bc flex bison 7zip kmod bash cpio binutils tar git wget dpkg libssl-dev

- name: Build kernel and rootfs.img
run: sudo sh nabu-rootfsKernel_build.sh
- name: Build kernel
run: sudo sh nabu-Kernel_build.sh ${{ matrix.version }}

- name: Upload rootfs.7z
- name: Upload deb packages
uses: actions/upload-artifact@v4.0.0
with:
# Artifact name
name: rootfs
path: rootfs.7z
compression-level: 0
name: xiaomi-nabu-debs_${{ matrix.version }}
path: ${{ github.workspace }}/*.deb

rootfs:
# The type of runner that the job will run on
runs-on: ubuntu-latest
needs: kernel
strategy:
matrix:
desktop: [ubuntu-desktop, lomiri]
kernel: [6.4, 6.6, 6.7]
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v4
- uses: actions/download-artifact@v4
with:
pattern: xiaomi-nabu-debs*
- name: Install Dependencies
run: sudo apt update && sudo apt install unzip build-essential gcc-aarch64-linux-gnu bc flex bison 7zip kmod bash cpio binutils tar git wget dpkg libssl-dev

- name: Upload deb packages
- name: Build rootfs
run: sudo sh nabu-rootfs_build.sh ${{ matrix.desktop }} ${{ matrix.kernel }}

- name: Upload rootfs.7z
uses: actions/upload-artifact@v4.0.0
with:
# Artifact name
name: xiaomi-nabu-debs
path: ${{ github.workspace }}/*.deb
name: rootfs_${{ matrix.desktop }}_${{ matrix.kernel }}
path: rootfs.7z
compression-level: 0
23 changes: 19 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,22 @@
# Ubuntu rootfs for Xiaomi Pad 5
This repo contians scripts for automatic building of ubuntu rootfs for Xiaomi Pad 5
<img align="right" src="https://raw.githubusercontent.com/jiganomegsdfdf/ubuntu-xiaomi-nabu/master/ubnt.png" width="425" alt="Ubuntu 23.04 Running On A Xiaomi Pad 5">

# Ubuntu for Xiaomi Pad 5
This repo contians scripts for automatic building of ubuntu rootfs and kernel for Xiaomi Pad 5

# Where do i get needed files?
Actually, just go to the "Actions" tab, find one of latest builds and download file named **rootfs_(Desktop Environment you want)_(Kernel version you want)**
<br>for update download file named **xiaomi-nabu-debs_(Kernel version you want)**

# Update info
- Unpack .zip you downloaded
- Run dpkg -i *-xiaomi-nabu.deb
- P.S. if you are moving to another kernel version make that after installing .deb's
<br>**First method**: just replace your old kernel version with the new kernel version in /boot/grub/grub.cfg
<br>**Second method**: grub-install and grub-mkconfig -o /boot/grub/grub.cfg

# Install info
- rootfs.img must be flashed to partition named "linux"
- Unpack .zip you downloaded
- Unpack extracted .7z (there you take rootfs.img)
- rootfs.img must be flashed to the partition named "linux"
- Partition for efi boot must be named "esp"
- Install grub using grub-install and grub-mkconfig -o /boot/grub/grub.cfg. If done from android make sure that efs partition mounted at /boot/efi, after generating grub.cfg change all of "/dev/block/" to "/dev/"
- Install grub using grub-install and grub-mkconfig -o /boot/grub/grub.cfg. If done from android make sure that efs partition is mounted at /boot/efi, after generating grub.cfg change all of "/dev/block/" to "/dev/"
17 changes: 17 additions & 0 deletions nabu-Kernel_build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
git clone https://github.com/map220v/sm8150-mainline.git --branch nabu-$1 --depth 1 linux
cd linux
sed -i 'CONFIG_CMDLINE="quiet splash"' ./arch/arm64/configs/sm8150.config
make -j$(nproc) ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- defconfig sm8150.config
make -j$(nproc) ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu-
mkdir ../linux-xiaomi-nabu/boot
cp arch/arm64/boot/Image.gz ../linux-xiaomi-nabu/boot/vmlinuz-$2.0-sm8150
cp arch/arm64/boot/dts/qcom/sm8150-xiaomi-nabu.dtb ../linux-xiaomi-nabu/boot/dtb-$2.0-sm8150
rm -rf ../linux-xiaomi-nabu/lib
make -j$(nproc) ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- INSTALL_MOD_PATH=../linux-xiaomi-nabu modules_install
rm ../linux-xiaomi-nabu/lib/modules/**/build
cd ..
rm -rf linux

dpkg-deb --build --root-owner-group linux-xiaomi-nabu
dpkg-deb --build --root-owner-group firmware-xiaomi-nabu
dpkg-deb --build --root-owner-group alsa-xiaomi-nabu
132 changes: 0 additions & 132 deletions nabu-rootfsKernel_build.sh

This file was deleted.

12 changes: 2 additions & 10 deletions nabu-rootfs_build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,6 @@ fi

VERSION="23.10"

#DEPS dpkg, wget, binfmt support(or arm64 device), 7zip

dpkg-deb --build --root-owner-group linux-xiaomi-nabu
dpkg-deb --build --root-owner-group firmware-xiaomi-nabu
dpkg-deb --build --root-owner-group alsa-xiaomi-nabu



truncate -s 6G rootfs.img
mkfs.ext4 rootfs.img
mkdir rootdir
Expand Down Expand Up @@ -56,7 +48,7 @@ chroot rootdir apt update
chroot rootdir apt upgrade -y

#u-boot-tools breaks grub installation
chroot rootdir apt install -y bash-completion sudo ssh nano u-boot-tools- ubuntu-desktop
chroot rootdir apt install -y bash-completion sudo ssh nano u-boot-tools- $1

#chroot rootdir gsettings set org.gnome.shell.extensions.dash-to-dock show-mounts-only-mounted true

Expand All @@ -68,7 +60,7 @@ chroot rootdir apt install -y rmtfs protection-domain-mapper tqftpserv
#Remove check for "*-laptop"
sed -i '/ConditionKernelVersion/d' rootdir/lib/systemd/system/pd-mapper.service

cp *-xiaomi-nabu.deb rootdir/tmp/
cp /home/runner/work/ubuntu-xiaomi-nabu/ubuntu-xiaomi-nabu/xiaomi-nabu-debs_$2/*-xiaomi-nabu.deb rootdir/tmp/
chroot rootdir dpkg -i /tmp/linux-xiaomi-nabu.deb
chroot rootdir dpkg -i /tmp/firmware-xiaomi-nabu.deb
chroot rootdir dpkg -i /tmp/alsa-xiaomi-nabu.deb
Expand Down
Binary file added ubnt.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 414f479

Please sign in to comment.