Skip to content

Commit

Permalink
restore old boot layout
Browse files Browse the repository at this point in the history
  • Loading branch information
korewaChino committed Oct 3, 2023
1 parent 9a59187 commit bc52732
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 9 deletions.
9 changes: 6 additions & 3 deletions src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ use serde_derive::{Deserialize, Serialize};
use std::{collections::BTreeMap, fs, io::Write, path::PathBuf, str::FromStr};
use tracing::{debug, info, trace};

use crate::{util::run_with_chroot, chroot_run_cmd};

#[derive(Deserialize, Debug, Clone, Serialize)]
pub struct Manifest {
pub builder: String,
Expand Down Expand Up @@ -567,8 +569,7 @@ impl Auth {
pub fn add_to_chroot(&self, chroot: &PathBuf) -> Result<()> {
// add user to chroot

let binding = chroot.to_string_lossy();
let mut args = vec!["-R".to_string(), binding.as_ref().to_string()];
let mut args = vec![];

if let Some(uid) = self.uid {
args.push("-u".to_string());
Expand Down Expand Up @@ -606,7 +607,9 @@ impl Auth {

trace!(args = ?args, "useradd args");

cmd_lib::run_cmd!(useradd $[args] 2>&1)?;

chroot_run_cmd!(chroot, unshare -R ${chroot} useradd $[args] 2>&1)?;
// cmd_lib::run_cmd!(useradd $[args] 2>&1)?;

// add ssh keys
if !self.ssh_keys.is_empty() {
Expand Down
16 changes: 12 additions & 4 deletions tests/ng/grub-install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,18 @@ grub2-mkconfig > /boot/grub2/grub.cfg
rm /etc/default/grub



# get /dev/ of /boot
bootdev=$(findmnt -n -o SOURCE /boot)

# get /dev/ of /boot, or / if /boot is not a separate partition
function find_bootdev {
# try findmnt /boot
if findmnt -n -o SOURCE /boot; then
bootdev=$(findmnt -n -o SOURCE /boot)
else
bootdev=$(findmnt -n -o SOURCE /)
fi
}


find_bootdev
# get blkid of /boot
bootid=$(blkid -s UUID -o value $bootdev)

Expand Down
9 changes: 7 additions & 2 deletions tests/ng/katsu.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,11 @@ disk:
filesystem: efi
mountpoint: /boot/efi

- label: boot
size: 1GiB
filesystem: ext4
mountpoint: /boot

- label: root
# size: 2.5MiB
filesystem: ext4
Expand All @@ -55,8 +60,8 @@ users:
dnf:
releasever: 39
repodir: repodir/
# options:
# - --setopt=cachedir=/var/cache/dnf
options:
- --setopt=cachedir=/var/cache/dnf
# exclude:
# - flatpak
# - pkgconf
Expand Down

0 comments on commit bc52732

Please sign in to comment.