diff --git a/DEVELOPERS b/DEVELOPERS index 703f5c345c..2a81272d20 100644 --- a/DEVELOPERS +++ b/DEVELOPERS @@ -3372,10 +3372,12 @@ F: arch/Config.in.hppa F: arch/arch.mk.hppa F: board/arm/foundation-v8/ F: board/bananapi/bananapi-m2-zero/ +F: board/hp/9000/ F: board/qemu/hppa-b160l/ F: boot/palo/ F: configs/arm_foundationv8_defconfig F: configs/bananapi_m2_zero_defconfig +F: configs/hp_9000_defconfig F: configs/qemu_hppa_b160l_defconfig F: configs/uevm5432_defconfig F: package/i7z/ diff --git a/board/hp/9000/genimage.cfg.in b/board/hp/9000/genimage.cfg.in new file mode 100644 index 0000000000..5a59307552 --- /dev/null +++ b/board/hp/9000/genimage.cfg.in @@ -0,0 +1,16 @@ +image disk.img { + hdimage { + partition-table-type = "mbr" + disk-signature = 0x%PARTUUID% + } + + partition boot { + partition-type= 0xF0 + size = 16M + } + + partition root { + partition-type= 0x83 + image = "rootfs.ext2" + } +} diff --git a/board/hp/9000/palo.sh.in b/board/hp/9000/palo.sh.in new file mode 100644 index 0000000000..9743111bc8 --- /dev/null +++ b/board/hp/9000/palo.sh.in @@ -0,0 +1,21 @@ +#!/bin/sh +set -eu + +# Generate lifimage. +palo \ + --bootloader="${BINARIES_DIR}/iplboot" \ + --commandline='0/vmlinux initrd=0/ramdisk' \ + --configfile=/dev/null \ + --init-tape="${BINARIES_DIR}/lifimage" \ + --ramdisk="${BINARIES_DIR}/rootfs.cpio.gz" \ + --recoverykernel="${BINARIES_DIR}/vmlinux" \ + --verbose + +# Install loader to disk image. +palo \ + --bootloader="${BINARIES_DIR}/iplboot" \ + --commandline="1/vmlinux root=PARTUUID=%PARTUUID%-02 rootwait" \ + --configfile=/dev/null \ + --init-partitioned="${BINARIES_DIR}/disk.img" \ + --recoverykernel="${BINARIES_DIR}/vmlinux" \ + --verbose diff --git a/board/hp/9000/patches/linux-headers/linux-headers.hash b/board/hp/9000/patches/linux-headers/linux-headers.hash new file mode 120000 index 0000000000..5808d92afe --- /dev/null +++ b/board/hp/9000/patches/linux-headers/linux-headers.hash @@ -0,0 +1 @@ +../linux/linux.hash \ No newline at end of file diff --git a/board/hp/9000/patches/linux/linux.hash b/board/hp/9000/patches/linux/linux.hash new file mode 100644 index 0000000000..e05e102f0e --- /dev/null +++ b/board/hp/9000/patches/linux/linux.hash @@ -0,0 +1,2 @@ +# From https://cdn.kernel.org/pub/linux/kernel/v6.x/sha256sums.asc +sha256 76bffbae7eab2a1de1ed05692bef709f43b02a52fe95ae655cacf0fa252213f3 linux-6.16.5.tar.xz diff --git a/board/hp/9000/post-image.sh b/board/hp/9000/post-image.sh new file mode 100755 index 0000000000..e489e0bf9e --- /dev/null +++ b/board/hp/9000/post-image.sh @@ -0,0 +1,16 @@ +#!/bin/sh +set -eu + +BOARD_DIR="$(dirname "$0")" + +# Generate a random 32-bit signature for the disk image and +# substitute it in genimage configuration file and palo script. +PARTUUID="$("$HOST_DIR"/bin/uuidgen -r |sed 's/-.*//')" + +sed "s/%PARTUUID%/$PARTUUID/g" "$BOARD_DIR/genimage.cfg.in" \ + > "$BINARIES_DIR/genimage.cfg" + +sed "s/%PARTUUID%/$PARTUUID/g" "$BOARD_DIR/palo.sh.in" \ + > "$BINARIES_DIR/palo.sh" + +chmod +x "$BINARIES_DIR/palo.sh" diff --git a/board/hp/9000/readme.txt b/board/hp/9000/readme.txt new file mode 100644 index 0000000000..9a07c55253 --- /dev/null +++ b/board/hp/9000/readme.txt @@ -0,0 +1,57 @@ +Introduction +============ + +The hp_9000_defconfig is meant to run Linux on a large range of 32-bit +HP PA-RISC 1.1 Workstations, such as the HP 9000 700 and Visualize +workstations. [1] + +Building +======== + + $ make hp_9000_defconfig + $ make + +Generated files under output/images: + +* lifimage: network bootable image comprising Linux kernel and ramdisk. +* disk.img: bootable disk image, with Linux kernel and root filesystem. + +Running +======= + +To run the generated system, one method is to write the disk image directly to +the workstation hard disk drive using a PC and an SCSI adapter. Extract the +disk from the workstation, connect it to the PC, then do: + + # dd if=output/images/disk.img of= ; sync + +Put the disk back into the workstation, connect to the UART console with +baudrate 9600; the firmware should boot Linux from disk and you should obtain a +login prompt. + +Another method is to boot from the network. This necessitates to setup a DHCP +and TFTP server, such as dnsmasq[2], to give the workstation its boot filename +with DHCP and serve the lifimage with TFTP. + +Connect to the UART console with baudrate 9600 and interrupt the boot sequence +of the firmware. + +On an HP 9000 712 workstation, do: + + BOOT_ADMIN> boot lan + +On an HP Visualize J210XC workstation, do: + + Configuration Menu: Enter command > boot lan + Interact with IPL (Y or N)?> n + +The firmware should boot Linux from the network and you should obtain a login +prompt. + +It is possible to download the disk image from the network and write it to the +hard disk drive, for example with TFTP: + + # tftp -g -r /disk.img -l /dev/sda + +[1] https://www.openpa.net/systems/ +[2] https://dnsmasq.org/doc.html diff --git a/configs/hp_9000_defconfig b/configs/hp_9000_defconfig new file mode 100644 index 0000000000..29ad684d74 --- /dev/null +++ b/configs/hp_9000_defconfig @@ -0,0 +1,20 @@ +BR2_hppa=y +BR2_parisc11=y +BR2_PACKAGE_HOST_LINUX_HEADERS_CUSTOM_6_16=y +BR2_GLOBAL_PATCH_DIR="board/hp/9000/patches" +BR2_DOWNLOAD_FORCE_CHECK_HASHES=y +BR2_SYSTEM_DHCP="eth0" +BR2_ROOTFS_POST_IMAGE_SCRIPT=" board/hp/9000/post-image.sh support/scripts/genimage.sh $(BINARIES_DIR)/palo.sh" +BR2_ROOTFS_POST_SCRIPT_ARGS="-c $(BINARIES_DIR)/genimage.cfg" +BR2_LINUX_KERNEL=y +BR2_LINUX_KERNEL_CUSTOM_VERSION=y +BR2_LINUX_KERNEL_CUSTOM_VERSION_VALUE="6.16.5" +BR2_LINUX_KERNEL_USE_ARCH_DEFAULT_CONFIG=y +BR2_LINUX_KERNEL_NEEDS_HOST_OPENSSL=y +BR2_TARGET_ROOTFS_CPIO=y +BR2_TARGET_ROOTFS_CPIO_GZIP=y +BR2_TARGET_ROOTFS_EXT2=y +BR2_TARGET_ROOTFS_EXT2_4=y +# BR2_TARGET_ROOTFS_TAR is not set +BR2_TARGET_PALO=y +BR2_PACKAGE_HOST_GENIMAGE=y