Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

possible fix #1

Merged
merged 1 commit into from
Jun 15, 2021
Merged
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
5 changes: 3 additions & 2 deletions data/setssdroot.service
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,10 @@
Description=Change rootfs to SSD in M.2 key M slot (nvme0n1p1)
DefaultDependencies=no
Conflicts=shutdown.target
After=systemd-remount-fs.service
#systemctl list-units --type=mount
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would remove this line if it's not used.

After=systemd-remount-fs.service dev-nvme0n1p1.device
Before=local-fs-pre.target local-fs.target shutdown.target
Wants=local-fs-pre.target
Wants=local-fs-pre.target dev-nvme0n1p1.device
ConditionPathExists=/dev/nvme0n1p1
ConditionPathExists=/etc/setssdroot.conf
ConditionVirtualization=!container
Expand Down
8 changes: 6 additions & 2 deletions data/setssdroot.sh
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
#!/bin/sh
# Runs at startup, switches rootfs to the SSD on nvme0 (M.2 Key M slot)
#Runs at startup, switches rootfs to the SSD on nvme0 (M.2 Key M slot)
NVME_DRIVE="/dev/nvme0n1p1"
CHROOT_PATH="/nvmeroot"

INITBIN=/lib/systemd/systemd
EXT4_OPT="-o defaults -o errors=remount-ro -o discard"
EXT4_OPT="-o defaults -o debug -o errors=continue -o discard"

echo "setssdroot: mount and switch rootfs to nvme0n1p1" | tee /dev/kmsg

modprobe ext4

Expand All @@ -13,3 +15,5 @@ mount -t ext4 ${EXT4_OPT} ${NVME_DRIVE} ${CHROOT_PATH}

cd ${CHROOT_PATH}
/bin/systemctl --no-block switch-root ${CHROOT_PATH}

echo "setssdroot: exit mount and switch rootfs" | tee /dev/kmsg