Skip to content

Commit

Permalink
forgot to add /dev
Browse files Browse the repository at this point in the history
  • Loading branch information
Jeff Bezos committed Oct 23, 2024
1 parent 9982b9e commit d230b54
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions src/install.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,14 @@

int execInChroot(const std::string& command) {
std::string fullCommand = "systemd-nspawn -D /mnt --as-pid2 bash -c \"" + command + "\"";
int result = std::system(fullCommand.c_str());

return std::system(fullCommand.c_str());
if (result != 0) {
std::cerr << "Command failed with exit code: " << result << std::endl;
std::exit(result); // Exit with the same error code returned by the command
}

return result;
}

int setRootPassword(const std::string& newPassword) {
Expand All @@ -18,15 +24,15 @@ int setupSystemd() {
}

int partition_drive(const std::string& target_drive) {
return std::system(("sgdisk -n 1:0:+512M -c 1:\"SOVIET-EFI\" -t 1:ef00 -n 2:0:0 -c 2:\"sovietlinux\" -t 2:8304 " + target_drive).c_str());
return std::system(("sgdisk -n 1:0:+512M -c 1:\"SOVIET-EFI\" -t 1:ef00 -n 2:0:0 -c 2:\"sovietlinux\" -t 2:8304 /dev/" + target_drive).c_str());
}

int create_boot(const std::string& target_drive) {
return std::system(("mkfs.vfat -F 32 -n SOVIET-EFI " + target_drive + "1").c_str());
return std::system(("mkfs.vfat -F 32 -n SOVIET-EFI /dev/" + target_drive + "1").c_str());
}

int create_root(const std::string& target_drive) {
return std::system(("mkfs.btrfs -L sovietlinux " + target_drive + "2").c_str());
return std::system(("mkfs.btrfs -L sovietlinux /dev/" + target_drive + "2").c_str());
}

int mount_root() {
Expand Down

0 comments on commit d230b54

Please sign in to comment.