1 Commits
Author SHA1 Message Date
zzSunil 0934092871 receipe: Add spacemit-K1 extlinux_mcs bsp targets 2025-12-10 14:45:47 +08:00
284 changed files with 232 additions and 2790 deletions
+10 -65
View File
@@ -1,73 +1,18 @@
# Build img2simg
FROM docker.io/debian:stable AS img2simg-builder
FROM docker.io/openeuler/openeuler:24.03-lts
RUN sed -i 's/deb.debian.org/mirrors.ustc.edu.cn/g' /etc/apt/sources.list.d/debian.sources && \
sed -i 's/https/http/' /etc/apt/sources.list.d/debian.sources
RUN sed -i 's/metalink=/# metalink=/g' /etc/yum.repos.d/openEuler.repo && \
sed -i 's/repo.openeuler.org/mirror.isrc.ac.cn\/openeuler/g' /etc/yum.repos.d/openEuler.repo
RUN apt-get update && apt-get install -y \
gcc g++ \
git \
zlib1g-dev
RUN git clone -b platform-tools-34.0.5 https://mirrors.ustc.edu.cn/aosp/platform/system/core.git /root/core
RUN git clone -b platform-tools-34.0.5 https://mirrors.ustc.edu.cn/aosp/platform/system/libbase.git /root/libbase
RUN cd /root && gcc -I libbase/include -I core/libsparse/include libbase/stringprintf.cpp libbase/mapped_file.cpp core/libsparse/backed_block.cpp core/libsparse/output_file.cpp core/libsparse/sparse.cpp core/libsparse/sparse_crc32.cpp core/libsparse/sparse_err.cpp core/libsparse/sparse_read.cpp core/libsparse/img2simg.cpp -lstdc++ -lz -o img2simg
# Build pseudo
FROM docker.io/debian:stable AS pseudo-builder
RUN sed -i 's/deb.debian.org/mirrors.ustc.edu.cn/g' /etc/apt/sources.list.d/debian.sources && \
sed -i 's/https/http/' /etc/apt/sources.list.d/debian.sources
RUN apt-get update && apt-get install -y \
attr \
gcc \
git \
libsqlite3-dev \
make \
python3 \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*
RUN git clone --depth 1 https://git.yoctoproject.org/pseudo /root/pseudo && \
cd /root/pseudo && \
./configure --prefix=/usr --libdir=/usr/lib --bits=64 && \
make && \
make DESTDIR=/root/pseudo-install install
# Build final image
FROM docker.io/debian:stable
RUN sed -i 's/deb.debian.org/mirrors.ustc.edu.cn/g' /etc/apt/sources.list.d/debian.sources && \
sed -i 's/https/http/' /etc/apt/sources.list.d/debian.sources
RUN apt-get update && apt-get install -y \
attr \
bsdextrautils \
coreutils \
RUN yum install -y \
bzip2 \
dosfstools \
e2fsprogs \
fdisk \
findutils \
libsqlite3-0 \
gdisk \
gzip \
mtools \
rsync \
tar \
util-linux \
uuid-runtime \
xz \
zstd \
zlib1g \
policycoreutils \
rpm dnf \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*
RUN ln -s /usr/bin/dnf /usr/bin/yum
COPY --from=img2simg-builder /root/img2simg /usr/bin/img2simg
COPY --from=pseudo-builder /root/pseudo-install/usr/bin/pseudo /usr/bin/pseudo
COPY --from=pseudo-builder /root/pseudo-install/usr/bin/pseudodb /usr/bin/pseudodb
COPY --from=pseudo-builder /root/pseudo-install/usr/bin/pseudolog /usr/bin/pseudolog
COPY --from=pseudo-builder /root/pseudo-install/usr/lib/libpseudo.so /usr/lib/libpseudo.so
RUN mkdir -p /var/pseudo
# TODO: make it configurable
RUN mkdir -p /etc/rpm/ && echo "%_db_backend ndb" > /etc/rpm/macros.db
&& yum clean all
-5
View File
@@ -38,7 +38,6 @@ WORK_DIR := $(realpath $(O))
else
WORK_DIR := $(ROOT_DIR)/build
endif
POOL_DIR := $(WORK_DIR)/pool
STAGING_DIR := $(WORK_DIR)/staging
DIST_DIR := $(WORK_DIR)/dist
@@ -82,10 +81,6 @@ clean:
clean_staging:
rm -rf "$(STAGING_DIR)"
.PHONY: clean_pool
clean_pool:
rm -rf "$(POOL_DIR)"
.PHONY: container
container:
$(CONTAINER_CMD) build -t $(CONTAINER_IMAGE_TAG) $(ROOT_DIR)
+6 -89
View File
@@ -34,79 +34,11 @@ It can be interrupted at any time, without harming your host OS.
## Prerequirements
- GNU Make 4 or newer
- `rsync`, `curl`, and `unzip` for staging recipes and downloading blobs
- RISC-V user-mode emulation and binfmt registration: `qemu-riscv64-static`
and `binfmt`; registration is a one-time system setup step
- Docker or Podman; rootless operation is supported
### Dependencies
The Makefile uses these host commands before a build script runs:
| Command | Debian package | Fedora package | Used for |
| --- | --- | --- | --- |
| `make` | `make` | `make` | Makefile target management |
| `rsync` | `rsync` | `rsync` | Recipe staging |
| `curl` | `curl` | `curl` | Remote blob downloads |
| `unzip` | `unzip` | `unzip` | Extracting blob archives |
| `qemu-riscv64-static` | `qemu-user-static` | `qemu-user-static` | Running RISC-V binaries on the build host |
| `binfmt` registration | `binfmt-support` | `systemd` (`systemd-binfmt`) | Dispatching RISC-V binaries to QEMU |
The build scripts and the recipe post-processing scripts use the following
commands. The package names are the packages to install on the build host;
some commands are also supplied by the default base image in Docker.
| Command or tool | Debian package | Fedora package | Used for |
| --- | --- | --- | --- |
| `setfattr` | `attr` | `attr` | Removing the SELinux attribute from `/boot` |
| `bash` | `bash` | `bash` | Running recipe scripts |
| `column` | `bsdextrautils` | `util-linux` | Formatting generated `fstab` |
| `coreutils` (`basename`, `cat`, `chmod`, `cp`, `cut`, `dd`, `du`, `head`, `ln`, `mkdir`, `mktemp`, `mv`, `readlink`, `rm`, `sha256sum`, `sort`, `stat`, `tee`, `tr`, `truncate`) | `coreutils` | `coreutils` | File, stream, and image operations |
| `dosfstools` (`mkfs.vfat`) | `dosfstools` | `dosfstools` | Creating VFAT filesystems |
| `e2fsprogs` (`mkfs.ext4`, `tune2fs`, `e2fsck`, `resize2fs`) | `e2fsprogs` | `e2fsprogs` | Creating and shrinking ext4 filesystems |
| `find` | `findutils` | `findutils` | Finding and copying filesystem contents |
| `grep` | `grep` | `grep` | Validation and command detection |
| `hexdump` | `bsdextrautils` | `util-linux` | Generating VFAT UUIDs |
| `mcopy`, `mlabel` | `mtools` | `mtools` | Writing and labeling VFAT images |
| `blockdev`, `mount`, `umount`, `rev`, `seq`, `uuidgen` | `fdisk`, `util-linux`, `uuid-runtime` | `util-linux` | Mounting, partitioning, iteration, and UUIDs |
| `policycoreutils` (`setfiles`) | `policycoreutils` | `policycoreutils` | Applying SELinux labels |
| `rpm`/`dnf` (`yum`) | `rpm`, `dnf` | `rpm`, `dnf` | Installing packages into the rootfs |
| `sed` | `sed` | `sed` | Parsing configuration and command output |
| `tar` | `tar` | `tar` | Rootfs archive creation and extraction |
| `zstd` | `zstd` | `zstd` | Rootfs compression |
| `pseudo`, `pseudodb`, `pseudolog` | Build from source | Build from source | Rootfs ownership and metadata emulation |
| `img2simg` | Build from source | Build from source | Optional sparse-image post-processing |
For CI environments that invoke the scripts directly, install the dependencies
with Debian:
```shell
sudo apt-get update
sudo apt-get install --no-install-recommends \
attr bash bsdextrautils coreutils curl dosfstools e2fsprogs fdisk findutils \
grep make mtools policycoreutils qemu-user-static binfmt-support rsync rpm \
sed tar unzip util-linux uuid-runtime zstd
sudo update-binfmts --enable qemu-riscv64
```
The corresponding Fedora setup is:
```shell
sudo dnf install \
attr bash coreutils curl dosfstools e2fsprogs findutils grep make mtools \
policycoreutils qemu-user-static rsync rpm sed tar unzip util-linux zstd
sudo systemctl enable --now systemd-binfmt
```
`pseudo` and `img2simg` are built in the Dockerfile and are not standard
runtime packages on Debian or Fedora. They must also be available in `PATH`
when scripts are invoked directly.
The current Dockerfile does not need `bzip2`, `gzip`, `xz-utils`, `gdisk`, or
`rsync`: the scripts use Zstandard only, partitioning is done by `sfdisk`, and
recipe staging, downloading, and extraction happen on the host. `zlib1g`
remains required by the custom `img2simg` binary.
- Root-mode docker with `--priviledged` option available
- May not be necessary in the future
- rsync
- GNU Makefile
- ~~And other basic shell utils~~
## Usage
@@ -120,7 +52,7 @@ Firstly, let it build a container image for later use:
make container
```
It will be tagged and managed by the configured container runtime.
It will be tagged and managed by docker.
Listing all available targets:
@@ -146,21 +78,6 @@ Build all available BSP targets, parallelly:
make -j$(nproc) all_bsp
```
For CI jobs that invoke `build_rootfs.sh` and `build_bsp.sh` directly instead
of through a container, clear `CONTAINER_CMD`:
```shell
make CONTAINER_CMD= openEuler-24.03-LTS-SP4-RVA23-base-OLK-generic
```
Normal builds use the configured container runtime. Set `CONTAINER_CMD=podman`
to use Podman instead of Docker:
```shell
make CONTAINER_CMD=podman container
make CONTAINER_CMD=podman openEuler-24.03-LTS-SP4-RVA23-base-OLK-generic
```
> BSP target will be rebuilt each time even if no configuration is changed
Cleanup:
+14 -74
View File
@@ -67,6 +67,7 @@ endif
# Check compression method
ifeq ($$(COMPRESSION),zstd)
COMPRESSION_SUFFIX := tar.zst
COMPRESSION_CMD := tar --use-compress-program=zstd -cf "$$$$$$$${OUTPUT_ARCHIVE}" -C "$$$$$$$${ROOTFS_DIR}" .
else
$$(error Unsupported compression mode)
endif
@@ -96,9 +97,7 @@ $(STAGING_DIR)/$$(DISTRO_NAME)/$$(RELEASE_NAME)/receipes/$$(RECEIPE_NAME): $$$$(
$$$$(dir_guard)
$(ECHOCTL)rm -rf "$$$$@"
@# Not preserving modification time, aka -t
$(ECHOCTL)for dep in $$($$(DISTRO_NAME)_$$(RELEASE_NAME)_$$(RECEIPE_NAME)_DEPS_FULL); do \
rsync -rLpgoD --exclude receipe.mk "$$$$$$$${dep}/" "$$$$@" || exit 1; \
done
$(ECHOCTL)rsync -rLpgoD --exclude receipe.mk $$($$(DISTRO_NAME)_$$(RELEASE_NAME)_$$(RECEIPE_NAME)_DEPS_FULL) $$$$@
endef
# Introduce one level of indirection to evaluate receipes ahead of time
$$(eval $$(GENERATE_SYNC_TARGET))
@@ -109,26 +108,18 @@ $$(DISTRO_NAME)-$$(RELEASE_NAME)-$$(RECEIPE_NAME)-rootfs: $$($$(DISTRO_NAME)_$$(
define GENERATE_TAR_TARGET
$$($$(DISTRO_NAME)_$$(RELEASE_NAME)_$$(RECEIPE_NAME)_ARTIFACT): $(STAGING_DIR)/$$(DISTRO_NAME)/$$(RELEASE_NAME)/receipes/$$(RECEIPE_NAME)
$$$$(dir_guard)
ifeq ($(strip $(CONTAINER_CMD)),)
$(ECHOCTL)cd "$(ROOT_DIR)/tools" && LOG_LEVEL=$(LOG_LEVEL) ./build_rootfs.sh \
-i "$$$$<" \
-o "$$$$@" \
-p $$(PACKAGE_MANAGER) \
-c $$(COMPRESSION)
else
$(ECHOCTL)$(CONTAINER_CMD) run --cap-add SYS_ADMIN --security-opt apparmor=unconfined --rm \
$(ECHOCTL)$(CONTAINER_CMD) run --rm \
-v $(ROOT_DIR)/tools:/image-builder/tools:ro \
-v $$$$<:/image-builder/receipe:ro \
-v $$$$(dir $$$$@):/image-builder/output \
$(CONTAINER_IMAGE_TAG) \
/bin/sh -c ' \
mkdir /tmp/rootfs && \
cd /image-builder/tools && \
LOG_LEVEL=$(LOG_LEVEL) ./build_rootfs.sh \
-i /image-builder/receipe \
-o /image-builder/output/$$$$(notdir $$$$@) \
-p $$(PACKAGE_MANAGER) \
-c $$(COMPRESSION)'
endif
LOG_LEVEL=$(LOG_LEVEL) ./build_rootfs.sh -i /image-builder/receipe -o /tmp/rootfs -p $$(PACKAGE_MANAGER) && \
export OUTPUT_ARCHIVE=/image-builder/output/$$$$(notdir $$$$@) && \
export ROOTFS_DIR=/tmp/rootfs && \
$$(COMPRESSION_CMD)'
endef
$$(eval $$(GENERATE_TAR_TARGET))
@@ -136,6 +127,7 @@ $$(eval $$(GENERATE_TAR_TARGET))
# Reset registers again
undefine GENERATE_TAR_TARGET
undefine EXTENDS
undefine COMPRESSION_CMD
undefine COMPRESSION_SUFFIX
undefine COMPRESSION
undefine RECEIPE_NAME
@@ -162,6 +154,7 @@ endif
undefine DEVICE_NAME
endef
########
define add_device_profile
ifndef DEVICE_NAME
@@ -186,26 +179,16 @@ BSP_TARGETS += $$(DISTRO_NAME)-$$(RELEASE_NAME)-$$(1)-$$(DEVICE_NAME)-$$(PROFILE
$$(DISTRO_NAME)-$$(RELEASE_NAME)-$$(1)-$$(DEVICE_NAME)_PROFILES += $$(PROFILE_NAME)
.PHONY: $$(DISTRO_NAME)-$$(RELEASE_NAME)-$$(1)-$$(DEVICE_NAME)-$$(PROFILE_NAME)
$$(DISTRO_NAME)-$$(RELEASE_NAME)-$$(1)-$$(DEVICE_NAME)-$$(PROFILE_NAME): $(STAGING_DIR)/$$(DISTRO_NAME)/$$(RELEASE_NAME)/bsp/$$(DEVICE_NAME)/$$(PROFILE_NAME)/$$(1) $$($$(DISTRO_NAME)_$$(RELEASE_NAME)_$$(1)_ARTIFACT) $$($$(DISTRO_NAME)-$$(RELEASE_NAME)-$$(DEVICE_NAME)-$$(PROFILE_NAME)-BLOBS)
$$(DISTRO_NAME)-$$(RELEASE_NAME)-$$(1)-$$(DEVICE_NAME)-$$(PROFILE_NAME): $(STAGING_DIR)/$$(DISTRO_NAME)/$$(RELEASE_NAME)/bsp/$$(DEVICE_NAME)/$$(PROFILE_NAME)/$$(1) $$($$(DISTRO_NAME)_$$(RELEASE_NAME)_$$(1)_ARTIFACT)
@mkdir -p $(DIST_DIR)/$$(DISTRO_NAME)/$$(RELEASE_NAME)/$$(DEVICE_NAME)
ifeq ($(strip $(CONTAINER_CMD)),)
$(ECHOCTL)cd "$(ROOT_DIR)/tools" && LOG_LEVEL=$(LOG_LEVEL) ./build_bsp.sh \
-i "$$$$<" \
-b "$(STAGING_DIR)/$$(DISTRO_NAME)/$$(RELEASE_NAME)/bsp/$$(DEVICE_NAME)/$$(PROFILE_NAME)/blobs" \
-s "$$($$(DISTRO_NAME)_$$(RELEASE_NAME)_$$(1)_ARTIFACT)" \
-o "$(DIST_DIR)/$$(DISTRO_NAME)/$$(RELEASE_NAME)/$$(DEVICE_NAME)/$$(DISTRO_NAME)-$$(RELEASE_NAME)-$$(1)-$$(DEVICE_NAME)-$$(PROFILE_NAME)" \
-p $$(PACKAGE_MANAGER)
else
$(ECHOCTL)$(CONTAINER_CMD) run --cap-add SYS_ADMIN --security-opt apparmor=unconfined --rm \
$(ECHOCTL)$(CONTAINER_CMD) run --privileged --rm \
-v $(ROOT_DIR)/tools:/image-builder/tools:ro \
-v $$$$<:/image-builder/receipe:ro \
-v $(STAGING_DIR)/$$(DISTRO_NAME)/$$(RELEASE_NAME)/bsp/$$(DEVICE_NAME)/$$(PROFILE_NAME)/blobs:/image-builder/blobs \
-v $$($$(DISTRO_NAME)_$$(RELEASE_NAME)_$$(1)_ARTIFACT):/image-builder/$$(notdir $$($$(DISTRO_NAME)_$$(RELEASE_NAME)_$$(1)_ARTIFACT)):ro \
-v $(DIST_DIR)/$$(DISTRO_NAME)/$$(RELEASE_NAME)/$$(DEVICE_NAME):/image-builder/output \
$(CONTAINER_IMAGE_TAG) \
/bin/sh -c 'cd /image-builder/tools && \
LOG_LEVEL=$(LOG_LEVEL) ./build_bsp.sh -i /image-builder/receipe -b /image-builder/blobs -s /image-builder/$$(notdir $$($$(DISTRO_NAME)_$$(RELEASE_NAME)_$$(1)_ARTIFACT)) -o /image-builder/output/$$(DISTRO_NAME)-$$(RELEASE_NAME)-$$(1)-$$(DEVICE_NAME)-$$(PROFILE_NAME) -p $$(PACKAGE_MANAGER)'
endif
LOG_LEVEL=$(LOG_LEVEL) ./build_bsp.sh -i /image-builder/receipe -s /image-builder/$$(notdir $$($$(DISTRO_NAME)_$$(RELEASE_NAME)_$$(1)_ARTIFACT)) -o /image-builder/output/$$(DISTRO_NAME)-$$(RELEASE_NAME)-$$(1)-$$(DEVICE_NAME)-$$(PROFILE_NAME) -p $$(PACKAGE_MANAGER)'
ifneq ($$$$(wildcard $$(BSP_PROFILE_DIR)/extensions/$$(1)/.),)
# corresponding extension exists
@@ -216,11 +199,8 @@ endif
$(STAGING_DIR)/$$(DISTRO_NAME)/$$(RELEASE_NAME)/bsp/$$(DEVICE_NAME)/$$(PROFILE_NAME)/$$(1): $$$$(BSP_PROFILE_DIR) $$$$(BSP_PROFILE_EXTENSION_DIR)
$$$$(dir_guard)
$(ECHOCTL)rm -rf "$$$$@"
@mkdir -p "$(STAGING_DIR)/$$(DISTRO_NAME)/$$(RELEASE_NAME)/bsp/$$(DEVICE_NAME)/$$(PROFILE_NAME)/blobs"
@# Not preserving modification time, aka -t
$(ECHOCTL)for dep in $$$$+; do \
rsync -rLpgoD --exclude profile.mk --exclude extensions "$$$$$$$${dep}/" "$$$$@" || exit 1; \
done
$(ECHOCTL)rsync -rLpgoD --exclude profile.mk --exclude extensions $$$$(foreach dep,$$$$+,$$$$(dep)/) $$$$@
undefine BSP_PROFILE_EXTENSION_DIR
endef
@@ -230,43 +210,3 @@ undefine PROFILE_NAME
undefine BSP_PROFILE_DIR
undefine GENERATE_RECEIPE_PROFILE_MATRIX
endef
########
define fetch_remote_blob
ifndef PROFILE_NAME
$$(error PROFILE_NAME not provided)
endif
$(DISTRO_NAME)-$(RELEASE_NAME)-$(DEVICE_NAME)-$(PROFILE_NAME)-BLOBS += $(STAGING_DIR)/$(DISTRO_NAME)/$(RELEASE_NAME)/bsp/$(DEVICE_NAME)/$(PROFILE_NAME)/blobs/$(1)
$(STAGING_DIR)/$(DISTRO_NAME)/$(RELEASE_NAME)/bsp/$(DEVICE_NAME)/$(PROFILE_NAME)/blobs/$(1): $(POOL_DIR)/$(shell echo "$2" | sha256sum | cut -d " " -f 1)
$$(dir_guard)
$(ECHOCTL)cp $$< $$@
ifndef POOL_$(shell echo "$2" | sha256sum | cut -d " " -f 1)
# Avoid duplicated downloading
# .PHONY: $(POOL_DIR)/$(shell echo "$2" | sha256sum | cut -d " " -f 1)
$(POOL_DIR)/$(shell echo "$2" | sha256sum | cut -d " " -f 1):
$$(dir_guard)
$(ECHOCTL)curl -sL -o "$$@" -z "$$@" "$2"
POOL_$(shell echo "$2" | sha256sum | cut -d " " -f 1) := $1
endif
endef
########
define extract_blob_from_zip
ifndef PROFILE_NAME
$$(error PROFILE_NAME not provided)
endif
$(STAGING_DIR)/$(DISTRO_NAME)/$(RELEASE_NAME)/bsp/$(DEVICE_NAME)/$(PROFILE_NAME)/blobs/$(1): $(STAGING_DIR)/$(DISTRO_NAME)/$(RELEASE_NAME)/bsp/$(DEVICE_NAME)/$(PROFILE_NAME)/blobs/$(2)
$$(dir_guard)
$(ECHOCTL)unzip -q -DD -o -j "$$<" "$(1)" -d $(STAGING_DIR)/$(DISTRO_NAME)/$(RELEASE_NAME)/bsp/$(DEVICE_NAME)/$(PROFILE_NAME)/blobs/
$(DISTRO_NAME)-$(RELEASE_NAME)-$(DEVICE_NAME)-$(PROFILE_NAME)-BLOBS += $(STAGING_DIR)/$(DISTRO_NAME)/$(RELEASE_NAME)/bsp/$(DEVICE_NAME)/$(PROFILE_NAME)/blobs/$(1)
endef
aaaa:
echo $(openEuler-25.09-SpacemiT-K1-sdmmc-BLOBS)
@@ -1,8 +1,8 @@
OUTPUT_FORMAT=partitioned_disk
PARTITION_TABLE_TYPE=GUID
PARTITION_1_OFFSET=1MiB
PARTITION_1_SIZE=499MiB
PARTITION_1_OFFSET=1MB
PARTITION_1_SIZE=499M
PARTITION_1_NAME="oerv-boot"
PARTITION_1_UUID=
PARTITION_1_TYPE=bls_boot
@@ -1,3 +0,0 @@
DEVICE_NAME := OLK
$(foreach profile_dir,$(filter-out %.mk,$(wildcard $(CURRENT_DIR)*)),$(eval $(call add_device_profile,$(profile_dir))))
@@ -1,24 +0,0 @@
OUTPUT_FORMAT=partitioned_disk
PARTITION_TABLE_TYPE=GUID
PARTITION_1_OFFSET=1MB
PARTITION_1_SIZE=499M
PARTITION_1_NAME="boot"
PARTITION_1_UUID=
PARTITION_1_TYPE=bls_boot
PARTITION_1_ATTRS=legacy_boot
PARTITION_1_USAGE=MOUNTPOINT
PARTITION_1_MOUNTPOINT="/boot"
PARTITION_1_FS=vfat
PARTITION_1_FS_UUID=
PARTITION_2_OFFSET=
PARTITION_2_SIZE=
PARTITION_2_NAME="root"
PARTITION_2_UUID=
PARTITION_2_TYPE=linux_root_riscv64
PARTITION_2_ATTRS=
PARTITION_2_USAGE=MOUNTPOINT
PARTITION_2_MOUNTPOINT="/"
PARTITION_2_FS=ext4
PARTITION_2_FS_UUID=
@@ -1,2 +0,0 @@
dracut
linux-firmware
@@ -1,8 +0,0 @@
#!/usr/bin/env sh
mkdir -p "${ROOTFS_DIR}/etc/systemd/system"
cp "oerv-firstboot.service" "${ROOTFS_DIR}/etc/systemd/system/oerv-firstboot.service"
cp "oerv-firstboot.sh" "${ROOTFS_DIR}/usr/sbin/oerv-firstboot.sh"
chmod +x "${ROOTFS_DIR}/usr/sbin/oerv-firstboot.sh"
mkdir -p "${ROOTFS_DIR}/etc/systemd/system/multi-user.target.wants"
ln -s "/etc/systemd/system/oerv-firstboot.service" "${ROOTFS_DIR}/etc/systemd/system/multi-user.target.wants/oerv-firstboot.service"
@@ -1,13 +0,0 @@
[Unit]
Before=systemd-user-sessions.service
ConditionPathExists=/etc/systemd/system/multi-user.target.wants/oerv-firstboot.service
Requires=-.mount
[Service]
Type=oneshot
ExecStart=/usr/sbin/oerv-firstboot.sh
ExecStartPost=/usr/bin/rm /etc/systemd/system/multi-user.target.wants/oerv-firstboot.service
RemainAfterExit=yes
[Install]
WantedBy=multi-user.target
@@ -1,11 +0,0 @@
#!/usr/bin/env sh
echo "$0: Expanding root partition..."
ROOT_PART="$(findmnt -no SOURCE /)"
ROOT_PARTNUM="$(lsblk -pr -no partn "${ROOT_PART}")"
ROOT_DISK="$(lsblk -p -no pkname "${ROOT_PART}")"
sgdisk -e "${ROOT_DISK}"
echo "Yes" | parted ---pretend-input-tty "${ROOT_DISK}" resizepart "${ROOT_PARTNUM}" 100%
partprobe
resize2fs "${ROOT_PART}"
echo "$0: Done."
@@ -1,24 +0,0 @@
#!/usr/bin/env sh
. "${ROOTFS_DIR}/etc/os-release"
KERNEL_FILE="$(find ${ROOTFS_DIR}/boot -name "vmlinuz*" -exec basename {} \; | head -n 1)"
INITRD_FILE="$(find ${ROOTFS_DIR}/boot -name "initramfs*" -exec basename {} \; | head -n 1)"
DTB_DIR="$(find ${ROOTFS_DIR}/boot -name "dtb-*" -exec basename {} \; | head -n 1)"
mkdir "${ROOTFS_DIR}/boot/extlinux"
cat << EOF | tee "${ROOTFS_DIR}/boot/extlinux/extlinux.conf"
default l0
menu title U-Boot menu
prompt 2
timeout 50
label l0
menu label ${PRETTY_NAME} - ${KERNEL_FILE#vmlinuz-}
linux /${KERNEL_FILE}
initrd /${INITRD_FILE}
fdtdir /${DTB_DIR}/
append root=UUID=$($get_fs_uuid_by_mountpoint /) rootwait rw earlycon=sbi console=ttyS0,115200n8
EOF
@@ -1,8 +0,0 @@
#!/usr/bin/env sh
DTB_DIR="$(find ${ROOTFS_DIR}/boot -name "dtb-*" -exec basename {} \; | head -n 1)"
DTB_DIR="${ROOTFS_DIR}/boot/${DTB_DIR}"
mv "${DTB_DIR}/spacemit/k1-bananapi-f3.dtb" "${DTB_DIR}/spacemit/k1-x_deb1.dtb"
mv "${DTB_DIR}/spacemit/k3-com260.dtb" "${DTB_DIR}/spacemit/k3_com260.dtb"
mv "${DTB_DIR}/spacemit/k3-pico.dtb" "${DTB_DIR}/spacemit/k3_pico.dtb"
@@ -1,5 +0,0 @@
#!/usr/bin/env sh
# Re-labelling all files except /boot which is stored in vfat
pseudo setfiles -r "${ROOTFS_DIR}" -e "${ROOTFS_DIR}/boot" "${ROOTFS_DIR}/etc/selinux/targeted/contexts/files/file_contexts" "${ROOTFS_DIR}"
pseudo setfattr -h -x security.selinux "${ROOTFS_DIR}/boot"
@@ -1 +0,0 @@
PROFILE_NAME := generic
@@ -1,3 +0,0 @@
DEVICE_NAME := SOPHGO-SG2044
$(foreach profile_dir,$(filter-out %.mk,$(wildcard $(CURRENT_DIR)*)),$(eval $(call add_device_profile,$(profile_dir))))
@@ -1,24 +0,0 @@
OUTPUT_FORMAT=partitioned_disk
PARTITION_TABLE_TYPE=GUID
PARTITION_1_OFFSET=1MiB
PARTITION_1_SIZE=499MiB
PARTITION_1_NAME="oerv-boot"
PARTITION_1_UUID=
PARTITION_1_TYPE=bls_boot
PARTITION_1_ATTRS=legacy_boot
PARTITION_1_USAGE=MOUNTPOINT
PARTITION_1_MOUNTPOINT="/boot"
PARTITION_1_FS=vfat
PARTITION_1_FS_UUID=
PARTITION_2_OFFSET=
PARTITION_2_SIZE=
PARTITION_2_NAME="oerv-root"
PARTITION_2_UUID=
PARTITION_2_TYPE=linux_root_riscv64
PARTITION_2_ATTRS=
PARTITION_2_USAGE=MOUNTPOINT
PARTITION_2_MOUNTPOINT="/"
PARTITION_2_FS=ext4
PARTITION_2_FS_UUID=
@@ -1,12 +0,0 @@
#!/usr/bin/env sh
# Override /usr/lib/dracut/dracut.conf.d/99-initramfs.conf
touch "${ROOTFS_DIR}/etc/dracut.conf.d/99-initramfs.conf"
cat << EOF | tee "${ROOTFS_DIR}/etc/dracut.conf.d/10-base.conf"
show_modules="yes"
dracutmodules+=" base shutdown "
add_dracutmodules+=" dracut-systemd rootfs-block "
add_dracutmodules+=" kernel-modules udev-rules "
filesystems+=" ext4 fat exfat "
EOF
@@ -1,6 +0,0 @@
#!/usr/bin/env sh
cat << EOF | column -t | tee "${ROOTFS_DIR}/etc/fstab"
UUID=$($get_fs_uuid_by_mountpoint /) / ext4 errors=remount-ro 0 1
UUID=$($get_fs_uuid_by_mountpoint /boot) /boot vfat defaults 0 2
EOF
@@ -1,13 +0,0 @@
#!/usr/bin/env sh
. "${ROOTFS_DIR}/etc/os-release"
cat << EOF | tee "${ROOTFS_DIR}/etc/default/u-boot"
U_BOOT_PROMPT="2"
U_BOOT_MENU_LABEL="${PRETTY_NAME}"
U_BOOT_PARAMETERS="rootwait rw rd.multipath=0"
U_BOOT_ROOT=root=UUID="$($get_fs_uuid_by_mountpoint /)"
U_BOOT_SEPARATE_BOOT="true"
U_BOOT_FDT_DIR="/dtb-"
U_BOOT_FDT=sophgo/sg2044-sophgo-srd3-10.dtb
EOF
@@ -1,5 +0,0 @@
#!/usr/bin/env sh
# Re-labelling all files except /boot which is stored in vfat
pseudo setfiles -r "${ROOTFS_DIR}" -e "${ROOTFS_DIR}/boot" "${ROOTFS_DIR}/etc/selinux/targeted/contexts/files/file_contexts" "${ROOTFS_DIR}"
pseudo setfattr -h -x security.selinux "${ROOTFS_DIR}/boot"
@@ -1 +0,0 @@
PROFILE_NAME := generic
@@ -1,13 +0,0 @@
[bsp-common]
name=BSP-Common
type=rpm-md
baseurl=https://diamond.oerv.ac.cn//OERV:/BSP/oe-multi/
enabled=1
gpgcheck=0
[bsp-sophgo-sg2044]
name=BSP-SG2044
type=rpm-md
baseurl=https://diamond.oerv.ac.cn//OERV:/BSP:/SOPHGO:/SG2044/oe-multi/
enabled=1
gpgcheck=0
@@ -1,3 +0,0 @@
DEVICE_NAME := SpacemiT-K1
$(foreach profile_dir,$(filter-out %.mk,$(wildcard $(CURRENT_DIR)*)),$(eval $(call add_device_profile,$(profile_dir))))
@@ -1,48 +0,0 @@
OUTPUT_FORMAT=partitioned_disk
# Targetting SD/eMMC, with 512B read block, 512K erase block
# But ext4 suggests a minimum of 4K block
DISK_PARTITION_ALIGNMENT=4096
PARTITION_TABLE_TYPE=GUID
MBR_CODE_AREA_USAGE=BLOB
MBR_CODE_AREA_BLOB="bootinfo_sd.bin"
PARTITION_1_OFFSET=128KiB
PARTITION_1_SIZE=256KiB
PARTITION_1_NAME="fsbl"
PARTITION_1_USAGE=BLOB
PARTITION_1_BLOB="FSBL.bin"
PARTITION_2_OFFSET=384KiB
PARTITION_2_SIZE=64KiB
PARTITION_2_NAME="env"
PARTITION_2_USAGE=BLOB
PARTITION_2_BLOB="u-boot-env-default.bin"
PARTITION_3_OFFSET=1MiB
PARTITION_3_SIZE=1MiB
PARTITION_3_NAME="opensbi"
PARTITION_3_USAGE=BLOB
PARTITION_3_BLOB="fw_dynamic.itb"
PARTITION_4_OFFSET=2MiB
PARTITION_4_SIZE=2MiB
PARTITION_4_NAME="uboot"
PARTITION_4_USAGE=BLOB
PARTITION_4_BLOB="u-boot.itb"
PARTITION_5_OFFSET=8MB
PARTITION_5_SIZE=492MB
PARTITION_5_NAME="oerv-boot"
PARTITION_5_TYPE=bls_boot
PARTITION_5_ATTRS=legacy_boot
PARTITION_5_USAGE=MOUNTPOINT
PARTITION_5_MOUNTPOINT="/boot"
PARTITION_5_FS=vfat
PARTITION_6_NAME="oerv-root"
PARTITION_6_TYPE=linux_root_riscv64
PARTITION_6_USAGE=MOUNTPOINT
PARTITION_6_MOUNTPOINT="/"
PARTITION_6_FS=ext4
@@ -1,6 +0,0 @@
#!/usr/bin/env sh
cat << EOF | column -t | tee "${ROOTFS_DIR}/etc/fstab"
UUID=$($get_fs_uuid_by_mountpoint /) / ext4 errors=remount-ro 0 1
UUID=$($get_fs_uuid_by_mountpoint /boot) /boot vfat defaults 0 2
EOF
@@ -1,24 +0,0 @@
#!/usr/bin/env sh
. "${ROOTFS_DIR}/etc/os-release"
KERNEL_FILE="$(find ${ROOTFS_DIR}/boot -name "vmlinuz*" -exec basename {} \; | head -n 1)"
INITRD_FILE="$(find ${ROOTFS_DIR}/boot -name "initramfs*" -exec basename {} \; | head -n 1)"
DTB_DIR="$(find ${ROOTFS_DIR}/boot -name "dtb-*" -exec basename {} \; | head -n 1)"
mkdir "${ROOTFS_DIR}/boot/extlinux"
cat << EOF | tee "${ROOTFS_DIR}/boot/extlinux/extlinux.conf"
default l0
menu title U-Boot menu
prompt 2
timeout 50
label l0
menu label ${PRETTY_NAME} - ${KERNEL_FILE#vmlinuz-}
linux /${KERNEL_FILE}
initrd /${INITRD_FILE}
fdtdir /${DTB_DIR}/
append root=UUID=$($get_fs_uuid_by_mountpoint /) rootwait rw earlycon=sbi console=ttyS0,115200n8 selinux=0 no4lvl
EOF
@@ -1,8 +0,0 @@
#!/usr/bin/env sh
DTB_DIR="$(find ${ROOTFS_DIR}/boot -name "dtb-*" -exec basename {} \; | head -n 1)"
DTB_DIR="${ROOTFS_DIR}/boot/${DTB_DIR}"
mv "${DTB_DIR}/spacemit/k1-bananapi-f3.dtb" "${DTB_DIR}/spacemit/k1-x_deb1.dtb"
mv "${DTB_DIR}/spacemit/k3-com260.dtb" "${DTB_DIR}/spacemit/k3_com260.dtb"
mv "${DTB_DIR}/spacemit/k3-pico.dtb" "${DTB_DIR}/spacemit/k3_pico.dtb"
@@ -1,5 +0,0 @@
#!/usr/bin/env sh
# Re-labelling all files except /boot which is stored in vfat
pseudo setfiles -r "${ROOTFS_DIR}" -e "${ROOTFS_DIR}/boot" "${ROOTFS_DIR}/etc/selinux/targeted/contexts/files/file_contexts" "${ROOTFS_DIR}"
pseudo setfattr -h -x security.selinux "${ROOTFS_DIR}/boot"
@@ -1,9 +0,0 @@
PROFILE_NAME := olk-sdmmc
$(eval $(call fetch_remote_blob,bl-spacemit-k1.zip,https://github.com/openeuler-riscv/u-boot-build/releases/download/release-spacemit-k1/bl-spacemit-k1-rva23.zip))
$(eval $(call extract_blob_from_zip,bootinfo_sd.bin,bl-spacemit-k1.zip))
$(eval $(call extract_blob_from_zip,FSBL.bin,bl-spacemit-k1.zip))
$(eval $(call extract_blob_from_zip,u-boot-env-default.bin,bl-spacemit-k1.zip))
$(eval $(call extract_blob_from_zip,fw_dynamic.itb,bl-spacemit-k1.zip))
$(eval $(call extract_blob_from_zip,u-boot.itb,bl-spacemit-k1.zip))
@@ -1,3 +0,0 @@
DEVICE_NAME := SpacemiT-K3
$(foreach profile_dir,$(filter-out %.mk,$(wildcard $(CURRENT_DIR)*)),$(eval $(call add_device_profile,$(profile_dir))))
@@ -1,25 +0,0 @@
OUTPUT_FORMAT=partitioned_disk
PARTITION_TABLE_TYPE=GUID
DISK_SECTOR_SIZE=4096
PARTITION_1_OFFSET=1MB
PARTITION_1_SIZE=499M
PARTITION_1_NAME="boot"
PARTITION_1_UUID=
PARTITION_1_TYPE=bls_boot
PARTITION_1_ATTRS=legacy_boot
PARTITION_1_USAGE=MOUNTPOINT
PARTITION_1_MOUNTPOINT="/boot"
PARTITION_1_FS=vfat
PARTITION_1_FS_UUID=
PARTITION_2_OFFSET=
PARTITION_2_SIZE=
PARTITION_2_NAME="root"
PARTITION_2_UUID=
PARTITION_2_TYPE=linux_root_riscv64
PARTITION_2_ATTRS=
PARTITION_2_USAGE=MOUNTPOINT
PARTITION_2_MOUNTPOINT="/"
PARTITION_2_FS=ext4
PARTITION_2_FS_UUID=
@@ -1 +0,0 @@
../generic/packages.d
@@ -1 +0,0 @@
../generic/post.d
@@ -1 +0,0 @@
PROFILE_NAME := generic-4kn
@@ -1 +0,0 @@
../generic/repos.d
@@ -1,24 +0,0 @@
OUTPUT_FORMAT=partitioned_disk
PARTITION_TABLE_TYPE=GUID
PARTITION_1_OFFSET=1MB
PARTITION_1_SIZE=499M
PARTITION_1_NAME="boot"
PARTITION_1_UUID=
PARTITION_1_TYPE=bls_boot
PARTITION_1_ATTRS=legacy_boot
PARTITION_1_USAGE=MOUNTPOINT
PARTITION_1_MOUNTPOINT="/boot"
PARTITION_1_FS=vfat
PARTITION_1_FS_UUID=
PARTITION_2_OFFSET=
PARTITION_2_SIZE=
PARTITION_2_NAME="root"
PARTITION_2_UUID=
PARTITION_2_TYPE=linux_root_riscv64
PARTITION_2_ATTRS=
PARTITION_2_USAGE=MOUNTPOINT
PARTITION_2_MOUNTPOINT="/"
PARTITION_2_FS=ext4
PARTITION_2_FS_UUID=
@@ -1,3 +0,0 @@
dracut
u-boot-menu
oerv-firstboot
@@ -1,6 +0,0 @@
#!/usr/bin/env sh
cat << EOF | column -t | tee "${ROOTFS_DIR}/etc/fstab"
UUID=$($get_fs_uuid_by_mountpoint /) / ext4 errors=remount-ro 0 1
UUID=$($get_fs_uuid_by_mountpoint /boot) /boot vfat defaults 0 2
EOF
@@ -1,12 +0,0 @@
#!/usr/bin/env sh
. "${ROOTFS_DIR}/etc/os-release"
cat << EOF | tee "${ROOTFS_DIR}/etc/default/u-boot"
U_BOOT_PROMPT="2"
U_BOOT_MENU_LABEL="${PRETTY_NAME}"
U_BOOT_PARAMETERS="rootwait rw earlycon=sbi console=tty0 console=ttyS0,115200 rd.multipath=0"
U_BOOT_ROOT=root=UUID="$($get_fs_uuid_by_mountpoint /)"
U_BOOT_SEPARATE_BOOT="true"
U_BOOT_FDT_DIR="/dtb-"
EOF
@@ -1,2 +0,0 @@
kernel-spacemit-k3
kernel-spacemit-k3-headers
@@ -1,3 +0,0 @@
#!/usr/bin/env sh
rm "${ROOTFS_DIR}/etc/systemd/system/multi-user.target.wants/irqbalance.service"
@@ -1,5 +0,0 @@
#!/usr/bin/env sh
# Re-labelling all files except /boot which is stored in vfat
pseudo setfiles -r "${ROOTFS_DIR}" -e "${ROOTFS_DIR}/boot" "${ROOTFS_DIR}/etc/selinux/targeted/contexts/files/file_contexts" "${ROOTFS_DIR}"
pseudo setfattr -h -x security.selinux "${ROOTFS_DIR}/boot"
@@ -1 +0,0 @@
PROFILE_NAME := generic
@@ -1,13 +0,0 @@
[bsp-common]
name=BSP-Common
type=rpm-md
baseurl=https://diamond.oerv.ac.cn//OERV:/BSP/oe-multi/
enabled=1
gpgcheck=0
[bsp-spacemit-k3]
name=BSP-K1
type=rpm-md
baseurl=https://diamond.oerv.ac.cn//OERV:/BSP:/SpacemiT:/K3/oe-multi/
enabled=1
gpgcheck=0
@@ -1,4 +0,0 @@
RELEASE_NAME := 24.03-LTS-SP3-RVA23
$(foreach receipe_dir,$(filter-out %.mk,$(wildcard $(CURRENT_DIR)userspace/*)),$(eval $(call add_receipe,$(receipe_dir))))
$(foreach device_dir,$(filter-out %.mk,$(wildcard $(CURRENT_DIR)bsp/*)),$(eval $(call add_device,$(device_dir))))
@@ -1,3 +0,0 @@
#!/usr/bin/env sh
rm "${ROOTFS_DIR}/etc/yum.repos.d/bootstrap.repo"
@@ -1,4 +0,0 @@
#!/usr/bin/env sh
sed -i 's/metalink=/# metalink=/g' "${ROOTFS_DIR}/etc/yum.repos.d/openEuler.repo"
sed -i 's/repo.openeuler.org/mirror.iscas.ac.cn\/openeuler/g' "${ROOTFS_DIR}/etc/yum.repos.d/openEuler.repo"
@@ -1,119 +0,0 @@
NetworkManager
NetworkManager-wifi
acl
at
attr
audit
authselect
basesystem
bash
bash-completion
bc
bpftool
bzip2
chrony
cifs-utils
coreutils
cpio
cronie
crontabs
cryptsetup
curl
dbus
dnf
dnf-plugins-core
dos2unix
dosfstools
e2fsprogs
ed
ethtool
file
filesystem
firewalld
glibc
gnupg2
grubby
hostname
ima-evm-utils
initscripts
iproute
iprutils
iptstate
iputils
irqbalance
kbd
less
libstoragemgmt
libteam
logrotate
lshw
lsof
lsscsi
lvm2
mailcap
man-db
man-pages
mdadm
mlocate
mtr
nano
ncurses
net-tools
nfs-utils
nmap
openEuler-latest-release
openEuler-release
openssh
openssh-clients
openssh-server
parted
passwd
pciutils
pinfo
plymouth
policycoreutils
procps-ng
psacct
quota
rdma-core
realmd
rng-tools
rootfiles
rpm
rsync
rsyslog
rsyslog-relp
security-tool
selinux-policy-mls
selinux-policy-targeted
setup
sg3_utils
shadow
smartmontools
strace
sudo
symlinks
sysfsutils
systemd
systemd-udev
tar
tcpdump
time
traceroute
tree
tuned
unzip
usbutils
util-linux
util-linux-user
vim-enhanced
vim-minimal
virt-what
wget
which
words
xfsdump
xfsprogs
yum
zip
zsh
@@ -1,6 +0,0 @@
#!/usr/bin/env sh
cat << EOF | chroot "${ROOTFS_DIR}" passwd root
openEuler12#$
openEuler12#$
EOF
@@ -1,4 +0,0 @@
#!/usr/bin/env sh
echo openeuler-riscv64 >> "${ROOTFS_DIR}/etc/hostname"
echo "127.0.0.1 openeuler-riscv64" >> "${ROOTFS_DIR}/etc/hosts"
@@ -1,3 +0,0 @@
#!/usr/bin/env sh
cat "${ROOTFS_DIR}/usr/share/zoneinfo/Asia/Shanghai" > "${ROOTFS_DIR}/etc/localtime"
@@ -1,3 +0,0 @@
#!/usr/bin/env sh
touch "${ROOTFS_DIR}/etc/fstab"
@@ -1,3 +0,0 @@
#!/usr/bin/env sh
pseudo setfiles -r "${ROOTFS_DIR}" "${ROOTFS_DIR}/etc/selinux/targeted/contexts/files/file_contexts" "${ROOTFS_DIR}"
@@ -1,2 +0,0 @@
RECEIPE_NAME := base
COMPRESSION := zstd
@@ -1,8 +0,0 @@
[everything]
name=everything
baseurl=https://repo.openeuler.org/openEuler-24.03-LTS-SP3/everything/riscv64/rva23/$basearch/
metalink=https://mirrors.openeuler.org/metalink?repo=$releasever/everything/riscv64/rva23&arch=$basearch
metadata_expire=1h
enabled=1
gpgcheck=1
gpgkey=http://repo.openeuler.org/openEuler-24.03-LTS-SP3/everything/riscv64/rva23/$basearch/RPM-GPG-KEY-openEuler
-1
View File
@@ -1 +0,0 @@
../../24.03-lts-sp3-rva23/bsp/OLK/
@@ -1 +0,0 @@
../../24.03-lts-sp3-rva23/bsp/sophgo-sg2044
@@ -1,3 +0,0 @@
DEVICE_NAME := SpacemiT-K1
$(foreach profile_dir,$(filter-out %.mk,$(wildcard $(CURRENT_DIR)*)),$(eval $(call add_device_profile,$(profile_dir))))
@@ -1,3 +0,0 @@
firmware-spacemit-k1
dracut
u-boot-menu
@@ -1,3 +0,0 @@
# Provide esos.elf for early kernel direct filesystem lookup
install_items+=" /lib/firmware/esos.elf "
@@ -1,3 +0,0 @@
#!/usr/bin/env sh
cp 50-spacemit_k1_fw.conf "${ROOTFS_DIR}/etc/dracut.conf.d/"
@@ -1,6 +0,0 @@
#!/usr/bin/env sh
cat << EOF | column -t | tee "${ROOTFS_DIR}/etc/fstab"
UUID=$($get_fs_uuid_by_mountpoint /) / ext4 errors=remount-ro 0 1
UUID=$($get_fs_uuid_by_mountpoint /boot) /boot vfat defaults 0 2
EOF
@@ -1,2 +0,0 @@
kernel
kernel-headers
@@ -1,5 +0,0 @@
#!/usr/bin/env sh
# Re-labelling all files except /boot which is stored in vfat
pseudo setfiles -r "${ROOTFS_DIR}" -e "${ROOTFS_DIR}/boot" "${ROOTFS_DIR}/etc/selinux/targeted/contexts/files/file_contexts" "${ROOTFS_DIR}"
pseudo setfattr -h -x security.selinux "${ROOTFS_DIR}/boot"
@@ -1 +0,0 @@
PROFILE_NAME := generic
@@ -1,13 +0,0 @@
[bsp-common]
name=BSP-Common
type=rpm-md
baseurl=https://diamond.oerv.ac.cn//OERV:/BSP/oe-multi/
enabled=1
gpgcheck=0
[bsp-spacemit-k1]
name=BSP-K1
type=rpm-md
baseurl=https://diamond.oerv.ac.cn//OERV:/BSP:/SpacemiT:/K1/oe-multi/
enabled=1
gpgcheck=0
@@ -1,48 +0,0 @@
OUTPUT_FORMAT=partitioned_disk
# Targetting SD/eMMC, with 512B read block, 512K erase block
# But ext4 suggests a minimum of 4K block
DISK_PARTITION_ALIGNMENT=4096
PARTITION_TABLE_TYPE=GUID
MBR_CODE_AREA_USAGE=BLOB
MBR_CODE_AREA_BLOB="bootinfo_sd.bin"
PARTITION_1_OFFSET=128KiB
PARTITION_1_SIZE=256KiB
PARTITION_1_NAME="fsbl"
PARTITION_1_USAGE=BLOB
PARTITION_1_BLOB="FSBL.bin"
PARTITION_2_OFFSET=384KiB
PARTITION_2_SIZE=64KiB
PARTITION_2_NAME="env"
PARTITION_2_USAGE=BLOB
PARTITION_2_BLOB="u-boot-env-default.bin"
PARTITION_3_OFFSET=1MiB
PARTITION_3_SIZE=1MiB
PARTITION_3_NAME="opensbi"
PARTITION_3_USAGE=BLOB
PARTITION_3_BLOB="fw_dynamic.itb"
PARTITION_4_OFFSET=2MiB
PARTITION_4_SIZE=2MiB
PARTITION_4_NAME="uboot"
PARTITION_4_USAGE=BLOB
PARTITION_4_BLOB="u-boot.itb"
PARTITION_5_OFFSET=8MB
PARTITION_5_SIZE=492MB
PARTITION_5_NAME="oerv-boot"
PARTITION_5_TYPE=bls_boot
PARTITION_5_ATTRS=legacy_boot
PARTITION_5_USAGE=MOUNTPOINT
PARTITION_5_MOUNTPOINT="/boot"
PARTITION_5_FS=vfat
PARTITION_6_NAME="oerv-root"
PARTITION_6_TYPE=linux_root_riscv64
PARTITION_6_USAGE=MOUNTPOINT
PARTITION_6_MOUNTPOINT="/"
PARTITION_6_FS=ext4
@@ -1,6 +0,0 @@
#!/usr/bin/env sh
cat << EOF | column -t | tee "${ROOTFS_DIR}/etc/fstab"
UUID=$($get_fs_uuid_by_mountpoint /) / ext4 errors=remount-ro 0 1
UUID=$($get_fs_uuid_by_mountpoint /boot) /boot vfat defaults 0 2
EOF
@@ -1,8 +0,0 @@
#!/usr/bin/env sh
mkdir -p "${ROOTFS_DIR}/etc/systemd/system"
cp "oerv-firstboot.service" "${ROOTFS_DIR}/etc/systemd/system/oerv-firstboot.service"
cp "oerv-firstboot.sh" "${ROOTFS_DIR}/usr/sbin/oerv-firstboot.sh"
chmod +x "${ROOTFS_DIR}/usr/sbin/oerv-firstboot.sh"
mkdir -p "${ROOTFS_DIR}/etc/systemd/system/multi-user.target.wants"
ln -s "/etc/systemd/system/oerv-firstboot.service" "${ROOTFS_DIR}/etc/systemd/system/multi-user.target.wants/oerv-firstboot.service"
@@ -1,13 +0,0 @@
[Unit]
Before=systemd-user-sessions.service
ConditionPathExists=/etc/systemd/system/multi-user.target.wants/oerv-firstboot.service
Requires=-.mount
[Service]
Type=oneshot
ExecStart=/usr/sbin/oerv-firstboot.sh
ExecStartPost=/usr/bin/rm /etc/systemd/system/multi-user.target.wants/oerv-firstboot.service
RemainAfterExit=yes
[Install]
WantedBy=multi-user.target
@@ -1,11 +0,0 @@
#!/usr/bin/env sh
echo "$0: Expanding root partition..."
ROOT_PART="$(findmnt -no SOURCE /)"
ROOT_PARTNUM="$(lsblk -pr -no partn "${ROOT_PART}")"
ROOT_DISK="$(lsblk -p -no pkname "${ROOT_PART}")"
sgdisk -e "${ROOT_DISK}"
echo "Yes" | parted ---pretend-input-tty "${ROOT_DISK}" resizepart "${ROOT_PARTNUM}" 100%
partprobe
resize2fs "${ROOT_PART}"
echo "$0: Done."
@@ -1,2 +0,0 @@
kernel
kernel-headers
@@ -1,24 +0,0 @@
#!/usr/bin/env sh
. "${ROOTFS_DIR}/etc/os-release"
KERNEL_FILE="$(find ${ROOTFS_DIR}/boot -name "vmlinuz*" -exec basename {} \; | head -n 1)"
INITRD_FILE="$(find ${ROOTFS_DIR}/boot -name "initramfs*" -exec basename {} \; | head -n 1)"
DTB_DIR="$(find ${ROOTFS_DIR}/boot -name "dtb-*" -exec basename {} \; | head -n 1)"
mkdir "${ROOTFS_DIR}/boot/extlinux"
cat << EOF | tee "${ROOTFS_DIR}/boot/extlinux/extlinux.conf"
default l0
menu title U-Boot menu
prompt 2
timeout 50
label l0
menu label ${PRETTY_NAME} - ${KERNEL_FILE#vmlinuz-}
linux /${KERNEL_FILE}
initrd /${INITRD_FILE}
fdtdir /${DTB_DIR}/
append root=UUID=$($get_fs_uuid_by_mountpoint /) rootwait rw earlycon=sbi console=ttyS0,115200n8
EOF
@@ -1,8 +0,0 @@
#!/usr/bin/env sh
DTB_DIR="$(find ${ROOTFS_DIR}/boot -name "dtb-*" -exec basename {} \; | head -n 1)"
DTB_DIR="${ROOTFS_DIR}/boot/${DTB_DIR}"
mv "${DTB_DIR}/spacemit/k1-bananapi-f3.dtb" "${DTB_DIR}/spacemit/k1-x_deb1.dtb"
mv "${DTB_DIR}/spacemit/k3-com260.dtb" "${DTB_DIR}/spacemit/k3_com260.dtb"
mv "${DTB_DIR}/spacemit/k3-pico.dtb" "${DTB_DIR}/spacemit/k3_pico.dtb"
@@ -1,5 +0,0 @@
#!/usr/bin/env sh
# Re-labelling all files except /boot which is stored in vfat
pseudo setfiles -r "${ROOTFS_DIR}" -e "${ROOTFS_DIR}/boot" "${ROOTFS_DIR}/etc/selinux/targeted/contexts/files/file_contexts" "${ROOTFS_DIR}"
pseudo setfattr -h -x security.selinux "${ROOTFS_DIR}/boot"
@@ -1,9 +0,0 @@
PROFILE_NAME := olk-sdmmc
$(eval $(call fetch_remote_blob,bl-spacemit-k1.zip,https://github.com/openeuler-riscv/u-boot-build/releases/download/release-spacemit-k1/bl-spacemit-k1.zip))
$(eval $(call extract_blob_from_zip,bootinfo_sd.bin,bl-spacemit-k1.zip))
$(eval $(call extract_blob_from_zip,FSBL.bin,bl-spacemit-k1.zip))
$(eval $(call extract_blob_from_zip,u-boot-env-default.bin,bl-spacemit-k1.zip))
$(eval $(call extract_blob_from_zip,fw_dynamic.itb,bl-spacemit-k1.zip))
$(eval $(call extract_blob_from_zip,u-boot.itb,bl-spacemit-k1.zip))
@@ -1,49 +0,0 @@
OUTPUT_FORMAT=partitioned_disk
IMAGE_POST_PROCESS=
# Targetting SD/eMMC, with 512B read block, 512K erase block
# But ext4 suggests a minimum of 4K block
DISK_PARTITION_ALIGNMENT=4096
PARTITION_TABLE_TYPE=GUID
MBR_CODE_AREA_USAGE=BLOB
MBR_CODE_AREA_BLOB="bootinfo_sd.bin"
PARTITION_1_OFFSET=128KiB
PARTITION_1_SIZE=256KiB
PARTITION_1_NAME="fsbl"
PARTITION_1_USAGE=BLOB
PARTITION_1_BLOB="FSBL.bin"
PARTITION_2_OFFSET=384KiB
PARTITION_2_SIZE=64KiB
PARTITION_2_NAME="env"
PARTITION_2_USAGE=BLOB
PARTITION_2_BLOB="u-boot-env-default.bin"
PARTITION_3_OFFSET=1MiB
PARTITION_3_SIZE=1MiB
PARTITION_3_NAME="opensbi"
PARTITION_3_USAGE=BLOB
PARTITION_3_BLOB="fw_dynamic.itb"
PARTITION_4_OFFSET=2MiB
PARTITION_4_SIZE=2MiB
PARTITION_4_NAME="uboot"
PARTITION_4_USAGE=BLOB
PARTITION_4_BLOB="u-boot.itb"
PARTITION_5_OFFSET=8MB
PARTITION_5_SIZE=492MB
PARTITION_5_NAME="oerv-boot"
PARTITION_5_TYPE=bls_boot
PARTITION_5_ATTRS=legacy_boot
PARTITION_5_USAGE=MOUNTPOINT
PARTITION_5_MOUNTPOINT="/boot"
PARTITION_5_FS=vfat
PARTITION_6_NAME="oerv-root"
PARTITION_6_TYPE=linux_root_riscv64
PARTITION_6_USAGE=MOUNTPOINT
PARTITION_6_MOUNTPOINT="/"
PARTITION_6_FS=ext4
@@ -1,3 +0,0 @@
firmware-spacemit-k1
dracut
u-boot-menu
@@ -1,3 +0,0 @@
# Provide esos.elf for early kernel direct filesystem lookup
install_items+=" /lib/firmware/esos.elf "
@@ -1,3 +0,0 @@
#!/usr/bin/env sh
cp 50-spacemit_k1_fw.conf "${ROOTFS_DIR}/etc/dracut.conf.d/"
@@ -1,6 +0,0 @@
#!/usr/bin/env sh
cat << EOF | column -t | tee "${ROOTFS_DIR}/etc/fstab"
UUID=$($get_fs_uuid_by_mountpoint /) / ext4 errors=remount-ro 0 1
UUID=$($get_fs_uuid_by_mountpoint /boot) /boot vfat defaults 0 2
EOF
@@ -1,12 +0,0 @@
#!/usr/bin/env sh
. "${ROOTFS_DIR}/etc/os-release"
cat << EOF | tee "${ROOTFS_DIR}/etc/default/u-boot"
U_BOOT_PROMPT="2"
U_BOOT_MENU_LABEL="${PRETTY_NAME}"
U_BOOT_PARAMETERS="rootwait rw earlycon=sbi console=tty0 console=ttyS0,115200 rd.multipath=0"
U_BOOT_ROOT=root=UUID="$($get_fs_uuid_by_mountpoint /)"
U_BOOT_SEPARATE_BOOT="true"
U_BOOT_FDT_DIR="/dtb-"
EOF
@@ -1,2 +0,0 @@
kernel
kernel-headers
@@ -1,5 +0,0 @@
#!/usr/bin/env sh
# Re-labelling all files except /boot which is stored in vfat
pseudo setfiles -r "${ROOTFS_DIR}" -e "${ROOTFS_DIR}/boot" "${ROOTFS_DIR}/etc/selinux/targeted/contexts/files/file_contexts" "${ROOTFS_DIR}"
pseudo setfattr -h -x security.selinux "${ROOTFS_DIR}/boot"
@@ -1,9 +0,0 @@
PROFILE_NAME := sdmmc
$(eval $(call fetch_remote_blob,bl-spacemit-k1.zip,https://github.com/openeuler-riscv/u-boot-build/releases/download/release-spacemit-k1/bl-spacemit-k1.zip))
$(eval $(call extract_blob_from_zip,bootinfo_sd.bin,bl-spacemit-k1.zip))
$(eval $(call extract_blob_from_zip,FSBL.bin,bl-spacemit-k1.zip))
$(eval $(call extract_blob_from_zip,u-boot-env-default.bin,bl-spacemit-k1.zip))
$(eval $(call extract_blob_from_zip,fw_dynamic.itb,bl-spacemit-k1.zip))
$(eval $(call extract_blob_from_zip,u-boot.itb,bl-spacemit-k1.zip))
@@ -1,13 +0,0 @@
[bsp-common]
name=BSP-Common
type=rpm-md
baseurl=https://diamond.oerv.ac.cn//OERV:/BSP/oe-multi/
enabled=1
gpgcheck=0
[bsp-spacemit-k1]
name=BSP-K1
type=rpm-md
baseurl=https://diamond.oerv.ac.cn//OERV:/BSP:/SpacemiT:/K1/oe-multi/
enabled=1
gpgcheck=0
@@ -1 +0,0 @@
../../24.03-lts-sp3-rva23/bsp/spacemit-k3/
@@ -1,3 +0,0 @@
DEVICE_NAME := Zhihe-A210
$(foreach profile_dir,$(filter-out %.mk,$(wildcard $(CURRENT_DIR)*)),$(eval $(call add_device_profile,$(profile_dir))))
@@ -1,10 +0,0 @@
#!/usr/bin/env sh
echo "Enabling fbdev as default display"
cat << EOF > "${ROOTFS_DIR}/etc/X11/xorg.conf.d/fbdev.conf"
Section "Device"
Identifier "fbdev"
Driver "fbdev"
EndSection
EOF
@@ -1,24 +0,0 @@
OUTPUT_FORMAT=partitioned_disk
PARTITION_TABLE_TYPE=GUID
PARTITION_1_OFFSET=1MB
PARTITION_1_SIZE=499M
PARTITION_1_NAME="oerv-boot"
PARTITION_1_UUID=
PARTITION_1_TYPE=bls_boot
PARTITION_1_ATTRS=legacy_boot
PARTITION_1_USAGE=MOUNTPOINT
PARTITION_1_MOUNTPOINT="/boot"
PARTITION_1_FS=vfat
PARTITION_1_FS_UUID=
PARTITION_2_OFFSET=
PARTITION_2_SIZE=
PARTITION_2_NAME="oerv-root"
PARTITION_2_UUID=
PARTITION_2_TYPE=linux_root_riscv64
PARTITION_2_ATTRS=
PARTITION_2_USAGE=MOUNTPOINT
PARTITION_2_MOUNTPOINT="/"
PARTITION_2_FS=ext4
PARTITION_2_FS_UUID=

Some files were not shown because too many files have changed in this diff Show More