Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion BUILD.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ The reason for halting and upping is to load any new kernel updates that was ins
### 3. Build patchOS

```sh
$ vagrant ssh -c "sudo /vagrant/vagrant-build"
$ vagrant ssh -c "/vagrant/vagrant-build"
```

This will take about 40 minutes on a half decent laptop.
Expand Down
9 changes: 6 additions & 3 deletions Vagrantfile
Original file line number Diff line number Diff line change
Expand Up @@ -13,17 +13,20 @@ Vagrant.configure("2") do |config|
config.vm.provision "shell", inline: <<-SHELL
sudo echo "Server = http://mirror.archlinux.no/\\$repo/os/\\$arch" > /etc/pacman.d/mirrorlist
sudo pacman -Syu --noconfirm
sudo pacman -S base-devel parted dosfstools gcc-libs wget rsync git python2 --noconfirm
rm -Rf yay-git
sudo pacman -S base-devel xmlto kmod inetutils libelf bc bison flex ncurses parted dosfstools gcc-libs wget rsync git python2 --noconfirm
sudo echo 'MAKEFLAGS="-j$(($(nproc) + 1))"' >> /etc/makepkg.conf
su vagrant -c "git clone https://aur.archlinux.org/yay-git.git"
cd yay-git
su vagrant -c "makepkg -si --skipchecksums --noconfirm"
su vagrant -c "yay -Syu --noconfirm"
su vagrant -c "gpg --recv-key 9766E084FB0F43D8"
su vagrant -c "gpg --keyserver keys.gnupg.net --recv-key 45F68D54BBE23FB3039B46E59766E084FB0F43D8"
su vagrant -c "gpg --keyserver keys.gnupg.net --recv-key CEACC9E15534EBABB82D3FA03353C9CEF108B584"
su vagrant -c "yay -S binfmt-qemu-static-all-arch qemu-user-static --noconfirm"
su vagrant -c "yay -S binfmt-qemu-static-all-arch qemu-user-static --noconfirm"
sudo systemctl restart systemd-binfmt.service
wget https://raw.githubusercontent.com/Drewsif/PiShrink/master/pishrink.sh
chmod +x pishrink.sh
sudo mv pishrink.sh /usr/local/bin
su vagrant -c "git clone --depth=1 https://github.com/raspberrypi/tools ~/tools"
SHELL
end
3 changes: 0 additions & 3 deletions build
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,6 @@ pacman -S --noconfirm \
python-flask-socketio \
python-eventlet

# Enable all cores for building
echo 'MAKEFLAGS="-j$(nproc)"' >> /etc/makepkg.conf

# Rename default user
sed -i "s/alarm/patch/g" /etc/passwd /etc/group /etc/shadow
mv /home/alarm "/home/patch"
Expand Down
19 changes: 19 additions & 0 deletions kernel-build
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#!/bin/bash -xe

git clone --depth=1 https://github.com/raspberrypi/linux.git -b rpi-5.4.y /home/vagrant/linux
cp /vagrant/linux/* /home/vagrant/linux
cd /home/vagrant/linux
mv config .config

# Fix "multiple definition of `yylloc'" lexer error
sed -i 's/^YYLTYPE yylloc;$/extern YYLTYPE yylloc;/' scripts/dtc/dtc-lexer.l

# Apply Preepmt-RT patch
curl http://cdn.kernel.org/pub/linux/kernel/projects/rt/5.4/patch-5.4.40-rt24.patch.gz | gunzip > patch-5.4.40-rt24.patch
git apply patch-5.4.40-rt24.patch

PATH=$PATH:/home/vagrant/tools/arm-bcm2708/arm-linux-gnueabihf/bin
KERNEL=kernel7l
make -j $(($(nproc) + 1)) ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- prepare
make -j $(($(nproc) + 1)) ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- zImage modules dtbs
sudo env PATH=$PATH make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- INSTALL_MOD_PATH=/mnt modules_install
12 changes: 12 additions & 0 deletions linux/60-linux.hook
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
[Trigger]
Type = File
Operation = Install
Operation = Upgrade
Operation = Remove
Target = usr/lib/modules/%KERNVER%/*
Target = usr/lib/modules/%EXTRAMODULES%/*

[Action]
Description = Updating %PKGBASE% module dependencies...
When = PostTransaction
Exec = /usr/bin/depmod %KERNVER%
12 changes: 12 additions & 0 deletions linux/90-linux.hook
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
[Trigger]
Type = File
Operation = Install
Operation = Upgrade
Target = boot/kernel.img
Target = boot/kernel7.img
Target = usr/lib/initcpio/*

[Action]
Description = Updating %PKGBASE% initcpios...
When = PostTransaction
Exec = /usr/bin/mkinitcpio -p %PKGBASE%
1 change: 1 addition & 0 deletions linux/cmdline.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
root=/dev/mmcblk0p2 rw rootwait console=ttyAMA0,115200 console=tty1 selinux=0 plymouth.enable=0 smsc95xx.turbo_mode=N dwc_otg.lpm_enable=0 kgdboc=ttyAMA0,115200 elevator=noop
Loading