Commit 7a3f64e4 authored by Lubomir Rintel's avatar Lubomir Rintel
Browse files

Add OLPC XO-1.75 laptop support

This is a Marvell MMP2-based ARM laptop powered by OpenFirwmare. The
firmware loads \boot\olpc.fth on a first active partition. It has to be
a FAT or Ext* filesystem, with more recent features, such as extents,
not being supported.

This works well with the default layout with /boot being a separate ext2
partition, with a minor uglyness of olpc.fth being in /boot/boot/.
parent 3422d2f3
......@@ -183,7 +183,7 @@ The supported fields are:
* Method: (optional) indicates how to support this particular machine;
the default is "generic"; other available methods are: android, bootspec,
multi, redboot, slug, symlink
multi, redboot, slug, symlink and olpc
* Boot-Device: (optional) block device to mount before installing
kernel, initrd and U-Boot script; Boot-Kernel-Path, Boot-Initrd-Path and
......
\ OLPC XO boot script
: check-ofw-version ( -- )
" /" find-device
" compatible" get-property abort" No compatible property on /" ( -- compatible$ )
" mrvl,mmp2" 2swap substring? not if
cr
." Firmware Q4E00 or newer is needed to boot a Devicetree enabled kernel." cr
cr
." One way to update is to copy http://dev.laptop.org/~quozl/q4e00ja.rom" cr
." to a FAT partition on a USB flash stick and run ""flash u:\q4e00ja.rom""" cr
cr
." Aborting boot." cr
show-sad
abort
then
\ Make sure the model is sensible -- flash-kernel relies on this.
" model" delete-property
" OLPC XO-1.75" " model" string-property
;
visible unfreeze
check-ofw-version
" last:\@@KERNEL@@" to boot-device
" last:\@@INITRD@@" to ramdisk
" @@LINUX_KERNEL_CMDLINE_DEFAULTS@@ @@LINUX_KERNEL_CMDLINE@@" to boot-file
boot
......@@ -1864,3 +1864,7 @@ Boot-Script-Path: /boot/boot.scr
DTB-Id: sun6i-a31s-yones-toptech-bs1078-v2.dtb
U-Boot-Script-Name: bootscr.sunxi
Required-Packages: u-boot-tools
Machine: OLPC XO-1.75
Kernel-Flavors: armmp
Method: olpc
......@@ -7,6 +7,9 @@ flash-kernel (3.100) UNRELEASED; urgency=medium
[ Guido Günther ]
* Add support for Librem 5 devkit (Closes: #927700)
[ Lubomir Rintel]
* Add support for OLPC XO-1.75 laptops.
-- Uwe Kleine-König <ukleinek@debian.org> Fri, 12 Jul 2019 22:36:52 +0200
flash-kernel (3.99) unstable; urgency=medium
......
......@@ -22,6 +22,10 @@ override_dh_auto_install:
install -m0644 bootscript/$${arch}/bootscr.* \
debian/flash-kernel/etc/flash-kernel/bootscript/ ; \
done
ifeq (armhf,$(DEB_HOST_ARCH))
install -m0644 bootscript/$(DEB_HOST_ARCH)/olpc.fth \
debian/flash-kernel/etc/flash-kernel/bootscript/
endif
dh_auto_install
......
......@@ -1108,6 +1108,24 @@ case "$method" in
} > "$imtd" || error "failed."
echo "done." >&2
;;
"olpc")
[ -n "$ifile" ] || error "Initrd required for olpc method"
local olpcfth="$(mktemp --tmpdir=$tmpdir)"
local olpc_boot_dir="$(findmnt -n --output target --target /boot)"
local kernel="$(realpath --relative-to=$olpc_boot_dir $kfile |sed 's!/!\\\\!')"
local initrd="$(realpath --relative-to=$olpc_boot_dir $ifile |sed 's!/!\\\\!')"
printf "Generating olpc.fth... " >&2
sed -e "s!@@KERNEL@@!$kernel!g" \
-e "s!@@INITRD@@!$initrd!g" \
-e "s!@@LINUX_KERNEL_CMDLINE@@!$(get_kernel_cmdline)!g" \
-e "s!@@LINUX_KERNEL_CMDLINE_DEFAULTS@@!$(get_kernel_cmdline_defaults)!g" \
< "$BOOTSCRIPTS_DIR/olpc.fth" > $olpcfth
mkdir -p "$olpc_boot_dir/boot"
echo "done." >&2
backup_and_install "$olpcfth" "$olpc_boot_dir/boot/olpc.fth"
;;
esac
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment