Skip to content

Commit 50544f6

Browse files
committed
Add nuc10i5fnh
1 parent 5cdeba3 commit 50544f6

File tree

5 files changed

+342
-0
lines changed

5 files changed

+342
-0
lines changed
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
```
2+
$ curl -LO https://releases.ubuntu.com/24.04.3/ubuntu-24.04.3-desktop-amd64.iso
3+
$ shasum -a 256 ubuntu-24.04.3-desktop-amd64.iso
4+
faabcf33ae53976d2b8207a001ff32f4e5daae013505ac7188c9ea63988f8328 ubuntu-24.04.3-desktop-amd64.iso
5+
6+
docker run -it --rm \
7+
--mount type=bind,source="$(pwd)",target=/data \
8+
docker.io/boxcutter/ubuntu-autoinstall \
9+
--source ubuntu-24.04.3-desktop-amd64.iso \
10+
--autoinstall autoinstall.yaml \
11+
--destination ubuntu-24.04.3-desktop-amd64-autoinstall.iso \
12+
--grub grub.cfg \
13+
--loopback loopback.cfg \
14+
--config-root
15+
```
16+
17+
```
18+
docker container run --rm --interactive --tty \
19+
--mount type=bind,source="$(pwd)/test",target=/share \
20+
docker.io/boxcutter/cinc-auditor exec example \
21+
--key-files /Users/taylor/.ssh/id_ed25519 \
22+
--target ssh://autobot@10.63.33.125
23+
24+
docker container run --rm --interactive --tty \
25+
--mount type=bind,source="$(pwd)",target=/share \
26+
docker.io/boxcutter/cinc-auditor exec /share/test \
27+
--no-create-lockfile \
28+
--no-distinct-exit \
29+
--password superseekret \
30+
--target ssh://autobot@10.63.33.171
31+
```
Lines changed: 217 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,217 @@
1+
#cloud-config
2+
autoinstall:
3+
version: 1
4+
source:
5+
search_drivers: true
6+
id: ubuntu-desktop-minimal
7+
# https://bugs.launchpad.net/ubuntu/+source/systemd/+bug/2097769
8+
network:
9+
version: 2
10+
ethernets:
11+
eno1:
12+
dhcp4: false
13+
dhcp6: false
14+
optional: true
15+
wlp0s20f3:
16+
dhcp4: true
17+
dhcp6: false
18+
optional: true
19+
bridges:
20+
br0:
21+
interfaces:
22+
- eno1
23+
dhcp4: true
24+
dhcp6: false
25+
accept-ra: false
26+
link-local: []
27+
parameters:
28+
stp: false
29+
forward-delay: 0
30+
storage:
31+
config:
32+
- ptable: gpt
33+
serial: WDC_WDS200T2B0B-00YS70_21044J800564
34+
wwn: '0x5001b448be743398'
35+
path: /dev/sda
36+
preserve: true
37+
name: ''
38+
grub_device: false
39+
id: disk-sda
40+
type: disk
41+
- device: disk-sda
42+
size: 104857600
43+
flag: boot
44+
number: 1
45+
preserve: true
46+
grub_device: true
47+
offset: 1048576
48+
partition_type: c12a7328-f81f-11d2-ba4b-00a0c93ec93b
49+
path: /dev/sda1
50+
uuid: 78fa767e-7d35-4893-b5ed-4341d691e18a
51+
id: partition-sda1
52+
type: partition
53+
- device: disk-sda
54+
size: 16777216
55+
flag: msftres
56+
number: 2
57+
preserve: true
58+
grub_device: false
59+
offset: 105906176
60+
partition_type: e3c9e316-0b5c-4db8-817d-f92df00215ae
61+
path: /dev/sda2
62+
uuid: 6d2cd641-68da-4a93-9c8d-8eb634887988
63+
id: partition-sda2
64+
type: partition
65+
- device: disk-sda
66+
size: 949364981760
67+
number: 3
68+
preserve: true
69+
grub_device: false
70+
offset: 122683392
71+
partition_type: ebd0a0a2-b9e5-4433-87c0-68b6b72699c7
72+
path: /dev/sda3
73+
uuid: 033b2f8e-ccce-4502-849b-e2148d30b3eb
74+
id: partition-sda3
75+
type: partition
76+
- device: disk-sda
77+
size: 781189120
78+
number: 4
79+
preserve: true
80+
grub_device: false
81+
offset: 949487665152
82+
partition_type: de94bba4-06d1-4d40-a16a-bfd50179d6ac
83+
path: /dev/sda4
84+
uuid: 2943b597-e9f3-4c24-a346-9c1e805060e7
85+
id: partition-sda4
86+
type: partition
87+
- device: disk-sda
88+
size: 1017118720
89+
number: 5
90+
preserve: true
91+
grub_device: false
92+
offset: 950269902848
93+
partition_type: de94bba4-06d1-4d40-a16a-bfd50179d6ac
94+
path: /dev/sda5
95+
uuid: 6b313691-6b88-4623-a156-537604c63719
96+
id: partition-sda5
97+
type: partition
98+
- device: disk-sda
99+
size: 1049110773760
100+
wipe: superblock
101+
number: 6
102+
preserve: false
103+
offset: 951287021568
104+
path: /dev/sda6
105+
id: partition-0
106+
type: partition
107+
- fstype: ext4
108+
volume: partition-0
109+
preserve: false
110+
id: format-0
111+
type: format
112+
- path: /
113+
device: format-0
114+
id: mount-1
115+
type: mount
116+
- fstype: vfat
117+
volume: partition-sda1
118+
preserve: true
119+
id: format-partition-sda1
120+
type: format
121+
- path: /boot/efi
122+
device: format-partition-sda1
123+
id: mount-0
124+
type: mount
125+
timezone: UTC
126+
locale: en_US.UTF-8
127+
keyboard:
128+
layout: us
129+
kernel:
130+
flavor: hwe
131+
updates: all
132+
ssh:
133+
install-server: true
134+
allow-pw: true
135+
apt:
136+
preserve_sources_list: false
137+
mirror-selection:
138+
primary:
139+
# http://archive.ubuntu.com/ubntu
140+
- uri: "https://crake-nexus.org.boxcutter.net/repository/ubuntu-archive-apt-proxy/ubuntu"
141+
arches: [i386, amd64]
142+
# http://ports.ubuntu.com/ubuntu-ports
143+
- uri: "https://crake-nexus.org.boxcutter.net/repository/ubuntu-ports-proxy/ubuntu-ports"
144+
arches: [s390x, arm64, armhf, powerpc, ppc64el, riscv64]
145+
late-commands:
146+
# Because we're using preserve_hostname to allow manual setting of the
147+
# hostname, set an initial hostname manually - the identity block requires
148+
# a username and it doesn't support flexible enough configuration
149+
# NOTE: 'curtin in-target' doesn't invoke a shell, so you need to run
150+
# commands within a shell that need redirection.
151+
- curtin in-target -- sh -c 'echo wendy-NUC10i5FNH > /etc/hostname'
152+
# Seed the already ran marker for gnome-initial-setup so new users inherit
153+
- curtin in-target -- mkdir -p /etc/skel/.config
154+
- curtin in-target -- touch /etc/skel/.config/gnome-initial-setup-done
155+
# Run updates at our own cadence
156+
- curtin in-target -- systemctl disable apt-daily.timer
157+
- curtin in-target -- systemctl disable apt-daily-upgrade.timer
158+
- curtin in-target -- systemctl mask apt-daily.service
159+
- curtin in-target -- systemctl mask apt-daily-upgrade.service
160+
- curtin in-target -- sh -c 'sed -i "s/^APT::Periodic::Update-Package-Lists.*/APT::Periodic::Update-Package-Lists \"0\";/g" /etc/apt/apt.conf.d/20auto-upgrades'
161+
- curtin in-target -- sh -c 'sed -i "s/^APT::Periodic::Unattended-Upgrade.*/APT::Periodic::Unattended-Upgrade \"0\";/g" /etc/apt/apt.conf.d/20auto-upgrades'
162+
- curtin in-target -- sh -c 'sed -i "s/^APT::Periodic::.Download-Upgradeable-Packages */APT::Periodic::Download-Upgradeable-Packages \"0\";/g" /etc/apt/apt.conf.d/20auto-upgrades'
163+
- curtin in-target -- sh -c 'sed -i "s/^APT::Periodic::.AutocleanInterval */APT::Periodic::AutocleanInterval \"0\";/g" /etc/apt/apt.conf.d/20auto-upgrades'
164+
- curtin in-target -- sh -c 'snap refresh --hold || true'
165+
- curtin in-target -- sh -c 'echo "Hidden=true" >> /etc/xdg/autostart/update-notifier.desktop'
166+
- curtin in-target -- systemctl disable update-notifier-download.timer || true
167+
- curtin in-target -- systemctl disable update-notifier-motd.timer || true
168+
user-data: # cloud-init starts here
169+
preserve_hostname: true
170+
users:
171+
# Temporary user used for initial bootstrapping with CM tool
172+
- name: autobot
173+
uid: 63112
174+
primary_group: users
175+
groups: users
176+
shell: /bin/bash
177+
# Testing with a plaintext password
178+
plain_text_passwd: superseekret
179+
# Replace with your generated salted SHA-512 hash using 'openssl passwd -6'
180+
# passwd: "$6$W32sh2s3EDp01J$ajF/6iHYX1Ef2pF5mPi..zBFiU4Qzvnif.hT2MB.dZ9mSx6txdPiz..."
181+
sudo: ALL=(ALL) NOPASSWD:ALL
182+
lock_passwd: false
183+
ssh_authorized_keys:
184+
# taylor
185+
- ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIEWerEkujoB7ipGnWJwnPGFu3DuUQJtc1zB6YqjGRziE sheila
186+
- ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAINRK4hkcpUiaSkiLEytgwMYcKylBioXPLx1TnwJFrLPl mahowald
187+
chpasswd: {expire: false}
188+
ssh_pwauth: true
189+
# DBus doesn't appear to be active in late-commands, so wait to configure
190+
# power saving defaults until cloud-init time, plus cloud-init has
191+
# a nice module to write out files
192+
write_files:
193+
# Configure system-wide defaults to disable screen blanking
194+
- path: /etc/dconf/db/local.d/00-screensaver
195+
content: |
196+
[org/gnome/desktop/session]
197+
idle-delay=uint32 0
198+
199+
[org/gnome/desktop/screensaver]
200+
lock-enabled=false
201+
idle-activation-enabled=false
202+
203+
[org/gnome/settings-daemon/plugins/power]
204+
sleep-inactive-ac-type="nothing"
205+
sleep-inactive-battery-type="nothing"
206+
idle-dim=false
207+
# Configure system to refer to user settings in ~/.config/dconf/user
208+
# database first, then look for system-wide defaults in
209+
# /etc/dconf/db/local
210+
- path: /etc/dconf/profile/user
211+
content: |
212+
user-db:user
213+
system-db:local
214+
runcmd:
215+
# Update the GNOME system database with the changes to /etc/dconf
216+
# above
217+
- dconf update
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
set timeout=30
2+
3+
loadfont unicode
4+
5+
set menu_color_normal=white/black
6+
set menu_color_highlight=black/light-gray
7+
8+
menuentry "Ubuntu Desktop Autoinstalll" {
9+
set gfxpayload=keep
10+
linux /casper/vmlinuz autoinstall --- quiet splash
11+
initrd /casper/initrd
12+
}
13+
menuentry "Ubuntu (safe graphics)" {
14+
set gfxpayload=keep
15+
linux /casper/vmlinuz nomodeset --- quiet splash
16+
initrd /casper/initrd
17+
}
18+
grub_platform
19+
if [ "$grub_platform" = "efi" ]; then
20+
menuentry 'Boot from next volume' {
21+
exit 1
22+
}
23+
menuentry 'UEFI Firmware Settings' {
24+
fwsetup
25+
}
26+
else
27+
menuentry 'Test memory' {
28+
linux16 /boot/memtest86+x64.bin
29+
}
30+
fi
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
2+
menuentry "Try or Install Ubuntu" {
3+
set gfxpayload=keep
4+
linux /casper/vmlinuz iso-scan/filename=${iso_path} --- quiet splash
5+
initrd /casper/initrd
6+
}
7+
menuentry "Ubuntu (safe graphics)" {
8+
set gfxpayload=keep
9+
linux /casper/vmlinuz nomodeset iso-scan/filename=${iso_path} --- quiet splash
10+
initrd /casper/initrd
11+
}
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
describe package('openssh-server') do
2+
it { should be_installed }
3+
end
4+
5+
target_user = input('target_user', value: 'autobot')
6+
7+
control 'gsettings-available' do
8+
impact 1.0
9+
title 'gsettings binary and required schemas exist'
10+
desc 'Ensure gsettings is present and the GNOME schemas we query are available'
11+
12+
describe command('which gsettings') do
13+
its('exit_status') { should eq 0 }
14+
end
15+
16+
# Check schemas exist (skip tests if not)
17+
%w[
18+
org.gnome.desktop.session
19+
org.gnome.desktop.screensaver
20+
org.gnome.settings-daemon.plugins.power
21+
].each do |schema|
22+
describe command("sudo -iu #{target_user} gsettings list-schemas | grep -Fx '#{schema}'") do
23+
its('exit_status') { should eq 0 }
24+
end
25+
end
26+
end
27+
28+
control 'gnome-screensaver-and-power-settings' do
29+
impact 1.0
30+
title 'Verify GNOME idle/screensaver/power settings via gsettings'
31+
only_if('gsettings not found') { command('which gsettings').exit_status == 0 }
32+
33+
checks = [
34+
# schema, key, expected stdout (exactly as gsettings prints it)
35+
['org.gnome.desktop.session', 'idle-delay', 'uint32 0'],
36+
['org.gnome.desktop.screensaver', 'lock-enabled', 'false'],
37+
['org.gnome.desktop.screensaver', 'idle-activation-enabled', 'false'],
38+
['org.gnome.settings-daemon.plugins.power', 'sleep-inactive-ac-type', "'nothing'"],
39+
['org.gnome.settings-daemon.plugins.power', 'sleep-inactive-battery-type',"'nothing'"],
40+
['org.gnome.settings-daemon.plugins.power', 'idle-dim', 'false'],
41+
]
42+
43+
checks.each do |schema, key, expected|
44+
desc_str = "#{schema} #{key} should be #{expected}"
45+
describe(desc_str) do
46+
cmd = command("sudo -iu #{target_user} gsettings get #{schema} #{key}")
47+
it "has expected value (#{expected})" do
48+
expect(cmd.exit_status).to eq(0)
49+
expect(cmd.stdout.strip).to eq(expected)
50+
end
51+
end
52+
end
53+
end

0 commit comments

Comments
 (0)