Skip to content

yogo1212/arch-linux-image-creator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

67 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Put Arch Linux onto non-X86 devices (targets). Try to do that using software that is typically available and keeping the product as close to upstream as possible.

Run make to create an image file and use dd, Etcher, or so to install it. Supplying a block device as as DEV_OR_IMG (e.g. make "DEV_OR_IMG=/dev/mmcblkX") will cause the image to be written directly to the block device. This allows the root partition to use all available space, the amount of writes is reduced to a minimum because gaps don't have to be filled, and it's quicker.

In principle, it should be possible to create images for other distribution's as well. Maybe it's worth figuring out how to do that from this repo.

requirements

  • util-linux
  • subuid/subgid entries for the user running make
    • only the first one is used
    • range needs to be big enough to hold all files from the base file system
    • 1000 should be enough but best be generous if possible (e.g. 10000) because tar doesn't stop (it only warns)
  • qemu-$ARCH-static and the respective binfmt rules (to allow running native programs in the chroot)
  • enough RAM to hold the rootfs
  • gcc toolchain for the target

customization

The filesystem can be altered by adding customization scripts in rootfs-hook.d/. Nothing stops you from calling sh from there and doing stuff interactively. Remember to add the executable bit.

.env.rootfs-customization can be used to pass environment variables to the hooks. The pre-existing scripts use these:

EDITOR
IMG_HOSTNAME
ROOT_PW
NO_ROOT_PW
ROOT_SSH_KEY
INSTALL_OPENSSH
KEEP_SSH_KBD_PW
PACMAN_UPDATE

targets

Use the TARGET variable to specify a target: make TARGET=aarch64,generic_uefi These are the currently supported targets (boards/$ARCH/$BOARD):

aarch64

generic_uefi

  • EFI partition is filled by (packaged) mkinitcpio hook
    • kernel-install isn't there yet
  • Arch Linux ARM (https://archlinuxarm.org)
  • tested on Radxa ROCK5ITX+ with EDK2

riscv64

star64

  • U-Boot SPL with OpenSBI
  • U-Boot payload (reads extlinux.conf)
  • extlinux.conf generated by (packaged) libalpm hook
  • Felix Yan's Arch Linux port for RISC-V (https://archriscv.felixc.at/)
  • still uses DT and U-Boot for Starfive's VisionFive 2 from when there was no Star64 upstream

other ideas

I'm hesitant to publish a mode that creates an image for the SPI NOR flash for the Star64. Details on how that is be done are in the table Flash Boot Address Allocation from the JH7110 Boot User Guide. The files can be created from here using make uboot.

About

Create a disk image for the Star64

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published