Skip to content

vhtq18w/ukarmimg

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

28 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ukarmimg

This project collect some UbuntuKylin image generate script for ARM platform.

Supported platform in plan:

  • Kunpeng (aarch64 & armhf)
  • Feiteng (aarch64 & armhf)
  • Raspberry Pi 4 (aarch64 & armhf)

Dependencies

All images will create from scratch by debootstrap, then generate to images or isos, so you need install some Ubuntu(Debian) tools. This is a necessary dependencies list: debootstrap qemu-user-static qemu-debootstrap squashfs-tools genisoimage.

Document

This script provide some convenient parameters for uses who are not good at the network. Include support proxy, mirrors or local rootfs.

You cant get all parameters usage infomation through bin/ukarmimg.sh -h

Required arguments

No matter how you run this script, you must specify three parameters, it about archtecture, platform, and Ubunut release.

You can set archtecture through --arch(-a), the architectures that are now supported are arm64(aarch64), the plan also provides armhf, amd64.

As mentioned earlier, the main purpose of this repository is to provide images generate tool for Phytium, Kunpeng and Raspberry Pi4. You can specify --platfrom(-p) and set its value to kunpeng, feiteng or raspi4.

The first image generated by this repository is for Ubuntu focal(20.04) alpha, for raspi4 alone, the Ubuntu release can be generated after testing include eoan and focal, welcome to test other version.

An example of all required parameters: bin/ukarmimg.sh --arch arm64 --platform raspi4 --release focal.

Or shorter: bin/ukarmimg.sh -a arm64 -p raspi4 -r focal

Optional arguments

You can use rootfs that you already have, through specify --rootfs-dir(-d) to the path of your local rootfs. An example: bin/ukarmimg.sh -a arm64 -p raspi4 -r focal --rootfs-dir ~/base-rootfs.

If your arm device does not have system installed now, you can across-platform generate image by specifying --cross-platform(-c).

When you have a slow connections to the offical repository, recommend set --mirror(-m) to use closer mirror site. Example: bin/ukarmimg.sh -a arm64 -p raspi4 -r focal -m http://mirrors.tuna.tsinghua.edu.cn/ubuntu-ports.

NOTE: DONT end with a slash when you use --mirror.

You can choose another way when you have not good network, set http proxy for apt and debootstrap. Sometimes, the synchronization of the mirror site is not good, use a proxy may be batter. Only support http proxy now. Example: bin/ukarmimg.sh -a arm64 -p raspi4 -r focal -P http://127.0.0.1:8080.

The script will generate such a file name: ubuntukylin-focal-arm64+raspi4-2020-03-14.img, you may prefer to specify your own image name, juse use --out(-o).

When you build a patch version, simply use a suffix by specifying --export-suffix.

There is a list of all parameters:

ukarmimg --- UubuntuKylin ARM Image generate helper

Usage:
	./ukarmimg.sh -a ARCH -p PLATFORM -r RELEASE
	./ukarmimg.sh --arch ARCH --platform --release RELEASE

Required arguments:

-a, --arch
	Set the target platform architectrue

-d, --rootfs-dir
	Use a local rootfs

-p, --platform
	Select the platform which you want to generate

-r, --target-release
	Choose a valid Ubuntu release version

Optional arguments:

-c, --cross-arch
	Enable cross platform build

-h, --help
	Show usage infomation

-m, --mirror
	Set a repository mirror

-o, --out
	Place the image will export

-P, --proxy
	Set HTTP_RPOXY and make apt use proxy, Only support http. DONT end with a slash

-s, --export-suffix
	Set exported image name suffix

Tips: If you abort build when script run, you need manually umount $TARGET_ROOTFS_DIR/{proc,sys}.

Project structure

The auto build rootfs or mount dir will be stored in the build/ directory.

The initialized configuration of rootfs are placed in the config/ directory by platform.

The exported image is located in export/ directory.

The lib/ directory have the all library function file of generate script.

packages/ and repos store some list of packages and ppas that you want to install when you building.

If you want to modifed packages that will be installed on build, you can just edit the package list file in packages/$YOUR_PLATFORM/. different files should store package names for different purposes. *.install is the packages list will be installed, *.remove is that will be uninstalled.

The uboot boot binaries and configuration files required by different platforms are different, so they all put uboot/.

TODO

  • Support export Phytium live iso.
  • Support export Kunpeng live iso.
  • Support export general amd64 live iso.