Skip to content
This repository has been archived by the owner on Jun 13, 2021. It is now read-only.

Commit

Permalink
Use a compressed kernel to save some space, switch to u-boot boot script
Browse files Browse the repository at this point in the history
  • Loading branch information
nadiaholmquist committed Jun 23, 2020
1 parent 03aa3f3 commit 39130bc
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 13 deletions.
25 changes: 25 additions & 0 deletions boot.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
setenv bootargs console=tty1 archisobasedir=arch archisolabel=<LABEL> video=eDP-1:1920x1080@60

setenv bootpath /arch/boot/aarch64
setenv kernelfile ${bootpath}/Image.xz
setenv fdtfile ${bootpath}/rk3399-pinebook-pro.dtb
setenv initrdfile ${bootpath}/archiso.img

if test "${fdt_addr_r}" -ne ""; then
load ${devtype} ${devnum}:${bootpart} ${fdt_addr_r} ${fdtfile}
fdt addr ${fdt_addr_r}
fdt resize
else
# if we're running in qemu, fdt_addr_r won't be defined
setenv fdt_addr_r 0x40000000
fi

setenv kernel_comp_addr_r 0x46000000
size ${devtype} ${devnum}:${bootpart} ${kernelfile}
setenv kernel_comp_size $filesize
setenv ramdisk_comp_addr_r 0x47000000

load ${devtype} ${devnum}:${bootpart} ${kernel_addr_r} ${kernelfile}
load ${devtype} ${devnum}:${bootpart} ${ramdisk_addr_r} ${initrdfile}

booti ${kernel_addr_r} ${ramdisk_addr_r} ${fdt_addr_r}
29 changes: 16 additions & 13 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -122,19 +122,22 @@ make_customize_airootfs() {
# Prepare kernel/initramfs ${install_dir}/boot/
make_boot() {
mkdir -p ${work_dir}/iso/${install_dir}/boot/aarch64
cp ${work_dir}/aarch64/airootfs/boot/archiso.img ${work_dir}/iso/${install_dir}/boot/aarch64/archiso.img
cp ${work_dir}/aarch64/airootfs/boot/Image ${work_dir}/iso/${install_dir}/boot/aarch64/Image
cp "${work_dir}/aarch64/airootfs/boot/dtbs/rockchip/rk3399-pinebook-pro.dtb" "${work_dir}/iso/"
mkdir -p "${work_dir}/iso/extlinux"
cat - > "${work_dir}/iso/extlinux/extlinux.conf" <<EOF
LABEL Arch Linux ARM
KERNEL /arch/boot/aarch64/Image
FDT /rk3399-pinebook-pro.dtb
APPEND initrd=/arch/boot/aarch64/archiso.img console=tty1 archisobasedir=$install_dir archisolabel=${iso_label} video=eDP-1:1920x1080@60
EOF
mkdir -p "${work_dir}/iso/${install_dir}/boot/aarch64"
lzma -T$(nproc) -c "${work_dir}/aarch64/airootfs/boot/Image" > "${work_dir}/iso/${install_dir}/boot/aarch64/Image.xz"
cp "${work_dir}/aarch64/airootfs/boot/dtbs/rockchip/rk3399-pinebook-pro.dtb" "${work_dir}/iso/${install_dir}/boot/aarch64/"
sed "s/<LABEL>/${iso_label}/" boot.txt > "${work_dir}/boot.txt"
mkimage -A arm -O linux -T script -C none -n "U-Boot boot script" -d "${work_dir}/boot.txt" "${work_dir}/iso/boot.scr"
mkimage -A arm -O linux -T ramdisk -n "initrd" -C lzma -d "${work_dir}/aarch64/airootfs/boot/archiso.img" "${work_dir}/iso/${install_dir}/boot/aarch64/archiso.img"
# mkdir -p "${work_dir}/iso/extlinux"
# cat - > "${work_dir}/iso/extlinux/extlinux.conf" <<EOF
#LABEL Arch Linux ARM
#KERNEL /arch/boot/aarch64/Image
#FDT /arch/boot/aarch64/rk3399-pinebook-pro.dtb
#APPEND initrd=/arch/boot/aarch64/archiso.img console=tty1 archisobasedir=$install_dir archisolabel=${iso_label} video=eDP-1:1920x1080@60
#EOF
}
Expand Down

0 comments on commit 39130bc

Please sign in to comment.