Skip to content

Commit

Permalink
disable selinux, make cp verbose, show commit hash in version name
Browse files Browse the repository at this point in the history
  • Loading branch information
ading2210 committed Aug 30, 2024
1 parent 62d9244 commit 7d76fce
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 7 deletions.
8 changes: 4 additions & 4 deletions bootloader/bin/bootstrap.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@
#set -x
set +x

SHIMBOOT_VERSION="v1.2.0"

invoke_terminal() {
local tty="$1"
local title="$2"
Expand Down Expand Up @@ -95,11 +93,13 @@ move_mounts() {
}

print_license() {
local shimboot_version="$(cat /opt/.shimboot_version)"
if [ -f "/opt/.shimboot_version_dev" ]; then
suffix="-dev"
local git_hash="$(cat /opt/.shimboot_version_dev)"
local suffix="-dev-$git_hash"
fi
cat << EOF
Shimboot ${SHIMBOOT_VERSION}${suffix}
Shimboot ${shimboot_version}${suffix}
ading2210/shimboot: Boot desktop Linux from a Chrome OS RMA shim.
Copyright (C) 2023 ading2210
Expand Down
1 change: 1 addition & 0 deletions bootloader/opt/.shimboot_version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
v1.2.1
2 changes: 1 addition & 1 deletion build_rootfs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ else
fi

print_info "copying rootfs setup scripts"
cp -ar rootfs/* "$rootfs_dir"
cp -arv rootfs/* "$rootfs_dir"
cp /etc/resolv.conf "$rootfs_dir/etc/resolv.conf"

print_info "creating bind mounts for chroot"
Expand Down
5 changes: 3 additions & 2 deletions image_utils.sh
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@ populate_partitions() {

#figure out if we are on a stable release
local git_tag="$(git tag -l --contains HEAD)"
local git_hash="$(git rev-parse --short HEAD)"

#mount and write empty file to stateful
local stateful_mount=/tmp/shim_stateful
Expand All @@ -116,9 +117,9 @@ populate_partitions() {
#mount and write to bootloader rootfs
local bootloader_mount="/tmp/shim_bootloader"
safe_mount "${image_loop}p3" "$bootloader_mount"
cp -r $bootloader_dir/* "$bootloader_mount"
cp -arv $bootloader_dir/* "$bootloader_mount"
if [ ! "$git_tag" ]; then #mark it as a dev version if needed
touch "$bootloader_mount/opt/.shimboot_version_dev"
printf "$git_hash" > "$bootloader_mount/opt/.shimboot_version_dev"
fi
umount "$bootloader_mount"

Expand Down
3 changes: 3 additions & 0 deletions rootfs/opt/setup_rootfs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,9 @@ END
#install desktop and other custom packages
apt-get install -y $packages

#disable selinux to prevent a harmless error from showing up during the boot
echo "SELINUX=disabled" | tee -a /etc/selinux/config

if [ ! $username ]; then
read -p "Enter the username for the user account: " username
fi
Expand Down

0 comments on commit 7d76fce

Please sign in to comment.