Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
112 changes: 112 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,112 @@
# Allrounder .gitignore
#
# General
#
# backup, tmp files
#

*~
*.swp
*.swo
*.bak
*.tmp
*.log

#
# systemfiles
#

.DS_Store
Thumbs.db
ehthumbs.db
desktop.ini

#
# build files /object files
#
# C/C++ / Java / Go / Rust
#

*.o
*.obj
*.so
*.a
*.dll
*.exe
*.out
*.class
*.jar

#
# build direcotries
#

/build/
/bin/
/dist/
/target/
/out/

#
# packagemanager
#
# Python

__pycache__/
*.py[cod]
*.egg-info/
*.egg
*.whl

#
# Node / JavaScript
#

node_modules/
npm-debug.log
yarn-error.log
pnpm-lock.yaml

#
# Ruby
#

*.gem
.bundle/

#
# Java
#

*.war
*.ear

#
# Rust
#

Cargo.lock
target/

#
# IDEs / Editor
#

.vscode/
.idea/
*.iml
*.sublime-workspace
*.sublime-project

#
# Logs / Runtime
#

*.log
*.pid
*.seed
*.pid.lock


archiv/
src/archiv/
28 changes: 28 additions & 0 deletions src/boot/grub/setup-grub.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
#!/bin/bash
# setup-grub.sh TODO: in C
set -e

BOOT=/boot
IMG=/system.img

KERNEL=$(ls $BOOT/vmlinuz-* | sort | tail -1)
INITRD=$(ls $BOOT/initrd.img-* | sort | tail -1)

cat > /etc/grub.d/40_atlantis <<EOF
#!/bin/sh
exec tail -n +3 \$0

menuentry "AtlantisOS (system.img)" {
insmod gzio
insmod part_gpt
insmod ext2

linux $KERNEL root=/dev/ram0 ro quiet splash \
atlantis.system_img=$IMG

initrd $INITRD
}
EOF

chmod +x /etc/grub.d/40_atlantis
update-grub
30 changes: 30 additions & 0 deletions src/boot/init/atl-root.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
#!/bin/sh
#/etc/initramfs-tools/scripts/init-premount/atl-root

PREREQ=""

prereqs() {
echo "$PREREQ"
}

case "$1" in
prereqs)
prereqs
exit 0
;;
esac

. /scripts/functions

SYSTEM_IMG=$(cat /proc/cmdline | sed -n 's/.*atlantis.system_img=\([^ ]*\).*/\1/p')

if [ -z "$SYSTEM_IMG" ]; then
echo "No system.img specified"
panic
fi

mkdir -p /mnt/root
mount -o ro /dev/disk/by-label/ROOT /mnt/root || panic

mkdir -p /newroot
mount -t squashfs -o ro /mnt/root$SYSTEM_IMG /newroot || panic
8 changes: 8 additions & 0 deletions src/boot/init/switch-root.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/bin/sh
#/etc/initramfs-tools/scripts/init-bottom/swicth-root.sh

mount --move /proc /newroot/proc
mount --move /sys /newroot/sys
mount --move /dev /newroot/dev

exec switch_root /newroot /sbin/init
Loading