Skip to content

Commit

Permalink
usystem: Add copy-system
Browse files Browse the repository at this point in the history
Add copy-system, a simple script that copies whatever is system-y in the
current sysroot and sets up a valid sysroot on the destination. Meant to
be used as a quick way to install an Onyx system.

Signed-off-by: Pedro Falcato <[email protected]>
  • Loading branch information
heatd committed May 8, 2024
1 parent 26d2169 commit 5a148e4
Show file tree
Hide file tree
Showing 3 changed files with 44 additions and 10 deletions.
21 changes: 11 additions & 10 deletions usystem/core/BUILD.gn
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
group("core") {
deps = [
"devmgr",
"init",
"toybox",
"utils",
"coredumpd",
"bootstrap-init",
"flamegraph",
"trace"
]
deps = [
"bootstrap-init",
"copy-system",
"coredumpd",
"devmgr",
"flamegraph",
"init",
"toybox",
"trace",
"utils",
]
}
10 changes: 10 additions & 0 deletions usystem/core/copy-system/BUILD.gn
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import("//build/package.gni")

resource("copysys-script") {
sources = [ "copy-system" ]
outputs = [ "sbin/{{source_file_part}}" ]
}

package("copy-system") {
deps = [ ":copysys-script" ]
}
23 changes: 23 additions & 0 deletions usystem/core/copy-system/copy-system
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
#!/bin/sh
set -e
dest=$1
if [ -z $dest ]; then
echo "Please specify the destination."
exit 1
fi

cp -r /usr $dest
cp -r /sbin $dest
cp -r /boot $dest
cp -r /etc $dest
mkdir $dest/root
mkdir $dest/home
mkdir $dest/dev
mkdir $dest/proc
mkdir $dest/var
mkdir $dest/mnt
mkdir $dest/sys
mkdir $dest/tmp
ln -sf usr/lib $dest/lib
ln -sf usr/bin $dest/bin
mount -t devfs none $dest/dev

0 comments on commit 5a148e4

Please sign in to comment.