[haiku-commits] Change in haiku[master]: build_haiku_image: Support generating sysroot in Linux

  • From: Gerrit <review@xxxxxxxxxxxxxxxxxxx>
  • To: waddlesplash <waddlesplash@xxxxxxxxx>, haiku-commits@xxxxxxxxxxxxx
  • Date: Wed, 2 Dec 2020 20:43:09 +0000

From Alex von Gluck IV <kallisti5@xxxxxxxxxxx>:

Alex von Gluck IV has uploaded this change for review. ( 
https://review.haiku-os.org/c/haiku/+/3450 ;)


Change subject: build_haiku_image: Support generating sysroot in Linux
......................................................................

build_haiku_image: Support generating sysroot in Linux

* This really isn't too useful yet, don't get excited.
* Something similar had to be done for the Rust port with
  zip, scp, and a booted Haiku system
* Usage: HAIKU_INSTALL_DIR=/tmp/haiku-sysroot jam @install

Change-Id: If550277ce3cb017084c219d54be3b09b2416b328
---
M build/scripts/build_haiku_image
1 file changed, 29 insertions(+), 1 deletion(-)



  git pull ssh://git.haiku-os.org:22/haiku refs/changes/50/3450/1

diff --git a/build/scripts/build_haiku_image b/build/scripts/build_haiku_image
index 7c3b13f..eebb2b3 100755
--- a/build/scripts/build_haiku_image
+++ b/build/scripts/build_haiku_image
@@ -45,6 +45,13 @@
        shift
 fi

+# TODO: Better detection here? Maybe a @sysroot profile?
+if [ ! $isCD ] && [ ! $isImage ] && [ ! $(uname -s) == "Haiku" ]; then
+       # If we're doing an @install from Linux, the only goal is likely
+       # getting a "Haiku sysroot" for cross-compiling or something
+       isSysroot=1
+fi
+
 if [ ! $isCD ]; then
        # If the haiku image path is a symlink resolve it now (makebootable 
needs the
        # path of the actual device path under Linux).
@@ -135,6 +142,18 @@
        mkdir="$fsShellCommand mkdir"
        rm="$fsShellCommand rm"
        mkindex="$fsShellCommand mkindex"
+elif [ $isSysroot ]; then
+       # Just build a sysroot, attrs be damned
+       sPrefix=
+       tPrefix="$installDir/"
+       cd=cd
+       scd=:
+       cp="cp"
+       copyAttrs="$cp"
+       ln=ln
+       mkdir=mkdir
+       rm=rm
+       mkindex=""
 else
        sPrefix=
        # TODO: This should come from the environment.
@@ -292,7 +311,7 @@
        $mkdir -p "${tPrefix}system/packages"
 fi

-if [ ! $updateOnly ] && [ ! $isCD ]; then
+if [ ! $updateOnly ] && [ ! $isCD ] && [ ! -z $mkindex ]; then
 echo "Creating filesystem indices..."
        $mkindex -t string Audio:Album
        $mkindex -t string Audio:Artist
@@ -379,6 +398,15 @@
        fi
 done

+if [ $isSysroot ]; then
+       echo "Inflating packages (for sysroot) ..."
+       for packageFile in $systemPackages; do
+               extractFile $packageFile
+       done
+       for packageFile in $otherPackages; do
+               extractFile $packageFile
+       done
+fi

 if [ $isCD ]; then
        # generate the attribute stores

--
To view, visit https://review.haiku-os.org/c/haiku/+/3450
To unsubscribe, or for help writing mail filters, visit 
https://review.haiku-os.org/settings

Gerrit-Project: haiku
Gerrit-Branch: master
Gerrit-Change-Id: If550277ce3cb017084c219d54be3b09b2416b328
Gerrit-Change-Number: 3450
Gerrit-PatchSet: 1
Gerrit-Owner: Alex von Gluck IV <kallisti5@xxxxxxxxxxx>
Gerrit-MessageType: newchange

Other related posts:

  • » [haiku-commits] Change in haiku[master]: build_haiku_image: Support generating sysroot in Linux - Gerrit