New buildsystem and splash

This commit is contained in:
Martijn Braam 2020-03-16 15:49:12 +01:00
parent a94a536815
commit 2b74ba81c2
No known key found for this signature in database
GPG Key ID: C4280ACB000B060F
7 changed files with 103 additions and 16 deletions

13
.gitignore vendored Normal file
View File

@ -0,0 +1,13 @@
/Image.gz
/fat.img
/jumpdrive.img
/jumpdrive.img.xz
/u-boot-sunxi-with-spl.bin
/*.apk
/initramfs.gz
/initramfs.cpio
/initramfs/bin/busybox
/initramfs/splash.ppm.gz
/build
/boot.scr
/*.dtb

74
Makefile Normal file
View File

@ -0,0 +1,74 @@
CROSS_FLAGS = ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu-
all: jumpdrive.img.xz
jumpdrive.img.xz: jumpdrive.img
xz -c jumpdrive.img > jumpdrive.img.xz
initramfs/bin/busybox: src/busybox src/busybox_config
mkdir -p build/busybox
cp src/busybox_config build/busybox/.config
make -C src/busybox O=../../build/busybox $(CROSS_FLAGS)
cp build/busybox/busybox initramfs/bin/busybox
initramfs/splash.ppm.gz: splash/jumpdrive.ppm
gzip < splash/jumpdrive.ppm > initramfs/splash.ppm.gz
initramfs.cpio: initramfs/bin/busybox initramfs/init initramfs/init_functions.sh initramfs/splash.ppm.gz
cd initramfs; find . | cpio -H newc -o > ../initramfs.cpio
initramfs.gz: initramfs.cpio
gzip < initramfs.cpio > initramfs.gz
Image.gz: src/linux_config
mkdir -p build/linux
cp src/linux_config build/linux/.config
make -C src/linux O=../../build/linux $(CROSS_FLAGS) olddefconfig
make -C src/linux O=../../build/linux $(CROSS_FLAGS)
cp build/linux/arch/arm64/boot/Image.gz Image.gz
cp build/linux/arch/arm64/boot/dts/allwinner/sun50i-a64-pinephone.dtb sun50i-a64-pinephone.dtb
jumpdrive.img: fat.img u-boot-sunxi-with-spl.bin
rm -f jumpdrive.img
truncate --size 50M jumpdrive.img
parted -s jumpdrive.img mktable msdos
parted -s jumpdrive.img mkpart primary fat32 2048s 100%
parted -s jumpdrive.img set 1 boot on
dd if=u-boot-sunxi-with-spl.bin of=jumpdrive.img bs=8k seek=1
dd if=fat.img of=jumpdrive.img seek=1024 bs=1k
boot.scr: src/boot.txt
mkimage -A arm -O linux -T script -C none -n "U-Boot boot script" -d src/boot.txt boot.scr
u-boot-sunxi-with-spl.bin:
wget http://dl-cdn.alpinelinux.org/alpine/edge/main/aarch64/u-boot-pine64-2020.01-r0.apk
tar -xvf u-boot-pine64-2020.01-r0.apk usr/share/u-boot/pine64-lts/u-boot-sunxi-with-spl.bin --strip-components 4
fat.img: initramfs.gz Image.gz boot.scr
rm -f fat.img
truncate --size 40M fat.img
mkfs.fat -F32 fat.img
mcopy -i fat.img Image.gz ::Image.gz
mcopy -i fat.img sun50i-a64-pinephone.dtb ::sun50i-a64-pinephone.dtb
mcopy -i fat.img initramfs.gz ::initramfs.gz
mcopy -i fat.img boot.scr ::boot.scr
.PHONY: clean
clean:
rm -rf build
rm -f initramfs/bin/busybox
rm -f fat.img
rm -f jumpdrive.img
rm -f jumpdrive.img.xz
rm -f *.dtb
rm -f u-boot-pine64-2020.01-r0.apk
rm -f u-boot-sunxi-with-spl.bin
rm -f initramfs/splash.ppm.gz
rm -f initramfs/bin/busybox
rm -f initramfs.cpio
rm -f initramfs.gz
rm -f Image.gz
rm -f boot.scr

View File

@ -3,12 +3,23 @@
## Copyright (C) 2020 - postmarketOS
## Copyright (C) 2020 - Danctl12 <danct12@disroot.org>
echo "Welcome to JumpDrive"
. /init_functions.sh
# Environment variables that we want:
IP=172.16.42.1
# Create all the symlinks to /bin/busybox
mkdir -p /usr/bin
mkdir -p /sbin
mkdir -p /usr/sbin
echo "Installing Busybox..." && /bin/busybox --install -s
# Mount things needed by this script
mkdir /proc
mkdir /sys
mkdir /etc
mount -t proc proc /proc
mount -t sysfs sysfs /sys
@ -22,8 +33,6 @@ mount -t devpts devpts /dev/pts
# LED indicator for MMC r/w access
echo mmc2 > /sys/class/leds/pinephone\:green\:user/trigger
# Create all the symlinks to /bin/busybox
echo "Installing Busybox..." && /bin/busybox --install -s
# Create device nodes
echo "Creating device nodes..."
@ -36,6 +45,7 @@ setup_usb_configfs
start_udhcpd
setup_telnetd
# ToDo: splash
gzip -c -d splash.ppm.gz > /splash.ppm
fbsplash -s /splash.ppm
loop_forever

BIN
splash/jumpdrive.ppm Normal file

Binary file not shown.

BIN
splash/jumpdrive.xcf Normal file

Binary file not shown.

View File

@ -2,10 +2,12 @@ setenv kernel_addr_z 0x44080000
setenv bootargs loglevel=0 silent console=tty0
gpio set 114
if load ${devtype} ${devnum}:${distro_bootpart} ${kernel_addr_z} /Image.gz; then
unzip ${kernel_addr_z} ${kernel_addr_r}
if load ${devtype} ${devnum}:${distro_bootpart} ${fdt_addr_r} /sun50i-a64-pinephone.dtb; then
if load ${devtype} ${devnum}:${distro_bootpart} ${ramdisk_addr_r} /recovery.gz; then
if load ${devtype} ${devnum}:${distro_bootpart} ${ramdisk_addr_r} /initramfs.gz; then
booti ${kernel_addr_r} ${ramdisk_addr_r}:${filesize} ${fdt_addr_r};
else
booti ${kernel_addr_r} - ${fdt_addr_r};

View File

@ -1,12 +0,0 @@
diff --git a/drivers/tty/sysrq.c b/drivers/tty/sysrq.c
index 573b20551..42b040d16 100644
--- a/drivers/tty/sysrq.c
+++ b/drivers/tty/sysrq.c
@@ -551,7 +551,6 @@ void __handle_sysrq(int key, bool check_mask)
* should not) and is the invoked operation enabled?
*/
if (!check_mask || sysrq_on_mask(op_p->enable_mask)) {
- pr_info("%s\n", op_p->action_msg);
console_loglevel = orig_log_level;
op_p->handler(key);
} else {