-
Notifications
You must be signed in to change notification settings - Fork 43
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
21 changed files
with
76 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,16 @@ | ||
#!/usr/bin/env python3 | ||
""" | ||
This file contains all code required to generate the boot image for live-bootstrap | ||
""" | ||
# SPDX-License-Identifier: GPL-3.0-or-later | ||
# SPDX-FileCopyrightText: 2022-2023 Dor Askayo <[email protected]> | ||
# SPDX-FileCopyrightText: 2021 Andrius Štikonas <[email protected]> | ||
# SPDX-FileCopyrightText: 2021 Melg Eight <[email protected]> | ||
# SPDX-FileCopyrightText: 2021-23 fosslinux <[email protected]> | ||
|
||
import glob | ||
import hashlib | ||
import os | ||
import shutil | ||
import subprocess | ||
import tarfile | ||
import requests | ||
|
||
|
@@ -30,6 +31,7 @@ def __init__(self, tmpdir, arch, external_sources, | |
self.repo_path = repo_path | ||
self.tmpdir = tmpdir | ||
self.tmp_dir = tmpdir.path | ||
self.external_dir = os.path.join(self.tmp_dir, 'external') | ||
|
||
def prepare(self, using_kernel=False, kernel_bootstrap=False): | ||
""" | ||
|
@@ -38,7 +40,6 @@ def prepare(self, using_kernel=False, kernel_bootstrap=False): | |
/ -- contains seed to allow steps to be built, containing custom | ||
scripts and stage0-posix | ||
""" | ||
self.external_dir = os.path.join(self.tmp_dir, 'external') | ||
# We use ext3 here; ext4 actually has a variety of extensions that | ||
# have been added with varying levels of recency | ||
# Linux 4.9.10 does not support a bunch of them | ||
|
@@ -151,7 +152,8 @@ def distfiles(self): | |
"""Copy in distfiles""" | ||
def copy_no_network_distfiles(out): | ||
# Note that no network == no disk for kernel bootstrap mode | ||
with open(os.path.join(self.git_dir, 'steps', 'pre-network-sources'), 'r') as source_list: | ||
pre_src_path = os.path.join(self.git_dir, 'steps', 'pre-network-sources') | ||
with open(pre_src_path, 'r', encoding="utf-8") as source_list: | ||
for file in source_list.readlines(): | ||
file = file.strip() | ||
shutil.copy2(os.path.join(self.distfiles_dir, file), | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,8 @@ | ||
#!/bin/sh | ||
# | ||
# SPDX-FileCopyrightText: 2023 fosslinux <[email protected]> | ||
# | ||
# SPDX-License-Identifier: GPL-3.0-or-later | ||
|
||
/script-generator /steps/manifest | ||
/usr/bin/kaem --file /preseed-jump.kaem |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
/* | ||
* SPDX-FileCopyrightText: 2023 fosslinux <[email protected]> | ||
* | ||
* SPDX-License-Idnetifier: GPL-3.0-or-later | ||
* SPDX-License-Identifier: GPL-3.0-or-later | ||
*/ | ||
|
||
#define MAX_TOKEN 64 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,7 @@ | ||
# SPDX-FileCopyrightText: 2023 fosslinux <[email protected]> | ||
# | ||
# SPDX-License-Identifier: GPL-3.0-or-later | ||
|
||
DISTFILES=/external/distfiles | ||
PREFIX=/usr | ||
BINDIR=${PREFIX}/bin | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,7 @@ | ||
# SPDX-FileCopyrightText: 2023 fosslinux <[email protected]> | ||
# | ||
# SPDX-License-Identifier: GPL-3.0-or-later | ||
|
||
# Save because linux deletes all distfiles to save space | ||
cp "${DISTFILES}"/musl-1.2.4.tar.gz /tmp | ||
cp "${DISTFILES}"/curl-7.88.1.tar.bz2 /tmp | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,9 @@ | ||
#!/bin/sh | ||
# | ||
# SPDX-FileCopyrightText: 2023 fosslinux <[email protected]> | ||
# | ||
# SPDX-License-Identifier: GPL-3.0-or-later | ||
# | ||
# Add the rest of the FHS that we will use and is not created pre-boot | ||
rm -rf /sbin /usr/sbin | ||
for d in bin lib sbin; do | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,9 @@ | ||
#!/bin/sh | ||
# | ||
# SPDX-FileCopyrightText: 2023 fosslinux <[email protected]> | ||
# | ||
# SPDX-License-Identifier: GPL-3.0-or-later | ||
# | ||
dhcpcd --waitip=4 | ||
# Ensure network accessible | ||
timeout=120 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,9 @@ | ||
#!/bin/sh | ||
|
||
# SPDX-FileCopyrightText: 2023 fosslinux <[email protected]> | ||
# | ||
# SPDX-License-Identifier: GPL-3.0-or-later | ||
|
||
sed -i "/^LIBDIR/d" /steps/env | ||
LIBDIR=${PREFIX}/lib/i386-unknown-linux-musl | ||
echo "LIBDIR=${LIBDIR}" >> /steps/env |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,8 @@ | ||
#!/bin/sh | ||
# | ||
# SPDX-FileCopyrightText: 2023 fosslinux <[email protected]> | ||
# | ||
# SPDX-License-Identifier: GPL-3.0-or-later | ||
|
||
# Set modified dates of all files to be 0 unix time. | ||
# This function needs `touch` that supports --no-dereference | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,8 @@ | ||
#!/bin/sh | ||
# | ||
# SPDX-FileCopyrightText: 2023 fosslinux <[email protected]> | ||
# | ||
# SPDX-License-Identifier: GPL-3.0-or-later | ||
|
||
# http://www.linuxfromscratch.org/lfs/view/6.1/chapter06/devices.html | ||
mkdir -p "/dev" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,7 @@ | ||
#!/bin/sh | ||
# | ||
# SPDX-FileCopyrightText: 2023 fosslinux <[email protected]> | ||
# | ||
# SPDX-License-Identifier: GPL-3.0-or-later | ||
# | ||
mkdir -p /external/repo |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,9 @@ | ||
#!/bin/sh | ||
# | ||
# SPDX-FileCopyrightText: 2023 fosslinux <[email protected]> | ||
# | ||
# SPDX-License-Identifier: GPL-3.0-or-later | ||
|
||
cat > /steps/env <<- EOF | ||
export PATH=${PREFIX}/bin | ||
PREFIX=${PREFIX} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,8 @@ | ||
#!/bin/sh | ||
# | ||
# SPDX-FileCopyrightText: 2023 fosslinux <[email protected]> | ||
# | ||
# SPDX-License-Identifier: GPL-3.0-or-later | ||
|
||
set -ex | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,8 @@ | ||
#!/bin/bash | ||
# | ||
# SPDX-FileCopyrightText: 2023 fosslinux <[email protected]> | ||
# | ||
# SPDX-License-Identifier: GPL-3.0-or-later | ||
|
||
. /steps/bootstrap.cfg | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,8 @@ | ||
#!/bin/sh | ||
# | ||
# SPDX-FileCopyrightText: 2023 fosslinux <[email protected]> | ||
# | ||
# SPDX-License-Identifier: GPL-3.0-or-later | ||
|
||
set -ex | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,7 @@ | ||
# SPDX-FileCopyrightText: 2023 fosslinux <[email protected]> | ||
# | ||
# SPDX-License-Identifier: GPL-3.0-or-later | ||
# | ||
# This file follows a very simple, human readable and machine parseable syntax. | ||
# Each line is in the format: | ||
# <directive>: <arguments> <predicate> | ||
|