Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

user/pmbootstrap: new package #3008

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

tulilirockz
Copy link
Contributor

works fine! although some shelling out does not work due to them testing on other userspaces

@tulilirockz
Copy link
Contributor Author

still needs some patching, though

@tulilirockz tulilirockz marked this pull request as draft September 25, 2024 15:24
@tulilirockz tulilirockz force-pushed the user/pmbootstrap branch 2 times, most recently from 45307be to 42dee2b Compare September 25, 2024 16:57
@tulilirockz
Copy link
Contributor Author

last thing is just that im running into an issue that aports cant find the current CBUILD thing, idk how to fix it but idk if this is even related to this PR

@nekopsykose
Copy link
Member

i don't understand what error you're describing

@tulilirockz
Copy link
Contributor Author

sorry yeah my description was bad but check these logs out:

Unable to deduce build architecture. Install apk-tools, or set CBUILD.
(011134) [20:47:42] ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
(011134) [20:47:42] NOTE: The failed command's output is above the ^^^ line in the log file: /home/tulili/.local/var/pmbootstrap/log.txt
(011134) [20:47:42] ERROR: Command failed (exit code 1): (native) % busybox su pmos -c PACKAGER='pmos <pmos@local>' HOME=/home/pmos abuild-keygen -n -q -a
(011134) [20:47:42] See also: <https://postmarketos.org/troubleshooting>
(011134) [20:47:42] Traceback (most recent call last):
...

@nekopsykose
Copy link
Member

nekopsykose commented Sep 25, 2024

well it tries to run that failing command (ERROR: Command failed), and neither busybox nor abuild-keygen exist because this isn't alpine

you're either missing some other setup, or it can't work outside an alpine system- i don't know which as i don't use it :)

@tulilirockz
Copy link
Contributor Author

tulilirockz commented Sep 25, 2024

well it tries to run that failing command (ERROR: Command failed), and neither busybox nor abuild-keygen exist because this isn't alpine

you're either missing some other setup, or it can't work outside an alpine system- i don't know which as i don't use it :)

the funny part is that its supposed to make an alpine chroot, theres probably something wrong going on with the chroot generation, i dont exactly know how to differentiate this from a packaging issue... although it should totally work fine on non alpine systems, too

@tulilirockz
Copy link
Contributor Author

ill be testing this out, if i really cant make this work ill just close this pr

@nekopsykose
Copy link
Member

you'll just have to figure it out, upstream can probably help you figure it out with a full log and steps to reproduce :)

the chimeralinux/chimera container should make it easy to test stuff in a few seconds

@tulilirockz tulilirockz marked this pull request as ready for review September 26, 2024 01:03
@tulilirockz
Copy link
Contributor Author

it ended up working after applying (a slightly modified version of) that patch you send me 👍 im dum

@valpackett
Copy link
Contributor

The included patch looks almost identical to what I've been using in my local checkout of pmbootstrap 👍

Though I also have one for the envkernel scripts that's mostly just for doas instead of sudo, but also for sh not being bash
diff --git i/helpers/envkernel.fish w/helpers/envkernel.fish
index 4200a7be..2e9db9be 100644
--- i/helpers/envkernel.fish
+++ w/helpers/envkernel.fish
@@ -17,7 +17,7 @@ end
 # Fish compatibility code from envkernel.sh
 set envkernel_fish (status filename)
 set script_dir (dirname "$envkernel_fish")
-sh "$script_dir/envkernel.sh" $argv --fish 1>| read -z fishcode
+bash "$script_dir/envkernel.sh" $argv --fish 1>| read -z fishcode
 set pmbootstrap_dir (realpath "$script_dir/..")
 if not test -e "$pmbootstrap_dir/pmbootstrap.py"
 	set -e pmbootstrap_dir
diff --git i/helpers/envkernel.sh w/helpers/envkernel.sh
index 5f4a268e..569db075 100644
--- i/helpers/envkernel.sh
+++ w/helpers/envkernel.sh
@@ -1,4 +1,4 @@
-#!/bin/sh
+#!/usr/bin/bash
 # Copyright 2019 Oliver Smith
 # SPDX-License-Identifier: GPL-3.0-or-later
 #
@@ -25,7 +25,7 @@ clean_kernel_src_dir() {
 		if [ -d ".output" ]; then
 			echo " * Preserving existing build output."
 			tmp_dir=$(mktemp -d)
-			sudo mv ".output" "$tmp_dir"
+			doas mv ".output" "$tmp_dir"
 		fi;
 
 		# backslash is prefixed to disable the alias
@@ -33,8 +33,8 @@ clean_kernel_src_dir() {
 		\make mrproper
 
 		if [ -n "$tmp_dir" ]; then
-			sudo mv "$tmp_dir/.output" ".output"
-			sudo rmdir "$tmp_dir"
+			doas mv "$tmp_dir/.output" ".output"
+			doas rmdir "$tmp_dir"
 		fi;
 	fi;
 }
@@ -190,7 +190,7 @@ initialize_chroot() {
 		xz || return 1
 
 	# Create /mnt/linux
-	sudo mkdir -p "$chroot/mnt/linux"
+	doas mkdir -p "$chroot/mnt/linux"
 
 	# Mark as initialized
 	"$pmbootstrap" -q chroot -- su pmos -c \
@@ -200,9 +200,9 @@ initialize_chroot() {
 
 mount_kernel_source() {
 	if [ -e "$chroot/mnt/linux/Kbuild" ]; then
-		sudo umount "$chroot/mnt/linux"
+		doas umount "$chroot/mnt/linux"
 	fi
-	sudo mount --bind "$PWD" "$chroot/mnt/linux"
+	doas mount --bind "$PWD" "$chroot/mnt/linux"
 }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants