Skip to content

Commit 6455ae9

Browse files
committed
Merge branch 'no-root'
2 parents 5317bc1 + 8abefbd commit 6455ae9

File tree

4 files changed

+32
-9
lines changed

4 files changed

+32
-9
lines changed
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
[Service]
22
ExecStart=
3-
ExecStart=-/sbin/agetty --autologin root --noclear %I 38400 linux
3+
ExecStart=-/sbin/agetty --autologin alter --noclear %I 38400 linux

airootfs/root/customize_airootfs.sh

Lines changed: 25 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,18 @@
22

33
set -e -u
44

5+
# パスワード
6+
password=alter
7+
8+
# オプション解析
9+
while getopts 'p:' arg; do
10+
case "${arg}" in
11+
p) password=${OPTARG};;
12+
esac
13+
done
14+
15+
16+
517
sed -i 's/#\(en_US\.UTF-8\)/\1/' /etc/locale.gen
618
locale-gen
719

@@ -13,14 +25,23 @@ cp -aT /etc/skel/ /root/
1325
chmod 700 /root
1426
LC_ALL=C xdg-user-dirs-update
1527
LANG=C xdg-user-dirs-update
28+
echo -e "${password}\n${password}" | passwd root
29+
1630

17-
<<DISABLED
1831
useradd -m -s /bin/bash alter
1932
groupadd sudo
20-
usermod -G sudo arch
33+
usermod -G sudo alter
2134
sed -i 's/^#\s*\(%sudo\s\+ALL=(ALL)\s\+ALL\)/\1/' /etc/sudoers
22-
cp -aT /etc/skel/ /home/arch/
23-
DISABLED
35+
cp -aT /etc/skel/ /home/alter/
36+
chmod 700 -R /home/alter
37+
chown alter:alter -R /home/alter
38+
echo -e "${password}\n${password}" | passwd alter
39+
40+
cat >> /etc/sudoers << 'EOF'
41+
alter ALL=NOPASSWD: /usr/bin/calamares
42+
alter ALL=NOPASSWD: /usr/bin/calamares_polkit
43+
EOF
44+
2445

2546
[[ -d /usr/share/calamares/branding/manjaro ]] && rm -rf /usr/share/calamares/branding/manjaro
2647
rm /usr/share/backgrounds/xfce/xfce-stripes.png

airootfs/usr/share/applications/calamares.desktop

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ GenericName[da]=Live-installationsprogram
88
Comment=Install the operating system to disk
99
Comment[da]=Installer styresystemet på disk
1010
Comment[de]=Alter Linux installieren
11-
Exec=/usr/bin/calamares_polkit %f
11+
Exec=sudo /usr/bin/calamares_polkit %f
1212
Icon=calamares
1313
Terminal=false
1414
StartupNotify=true

build.sh

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ install_dir=alter
1111
work_dir=work
1212
out_dir=out
1313
gpg_key=
14+
password=alter
1415

1516
verbose=""
1617
script_path=$(readlink -f ${0%/*})
@@ -66,7 +67,7 @@ make_basefs() {
6667

6768
# Additional packages (airootfs)
6869
make_packages() {
69-
mkarchiso ${verbose} -w "${work_dir}/x86_64" -C "${work_dir}/pacman.conf" -D "${install_dir}" -p "$(grep -h -v ^# ${script_path}/packages.x86_64)" install
70+
mkarchiso ${verbose} -w "${work_dir}/x86_64" -C "${work_dir}/pacman.conf" -D "${install_dir}" -p "$(grep -h -v ^'#' ${script_path}/packages.x86_64)" install
7071
}
7172

7273
# Copy mkinitcpio archiso hooks and build initramfs (airootfs)
@@ -103,7 +104,7 @@ make_customize_airootfs() {
103104

104105
# lynx -dump -nolist 'https://wiki.archlinux.org/index.php/Installation_Guide?action=render' >> ${work_dir}/x86_64/airootfs/root/install.txt
105106

106-
mkarchiso ${verbose} -w "${work_dir}/x86_64" -C "${work_dir}/pacman.conf" -D "${install_dir}" -r '/root/customize_airootfs.sh' run
107+
mkarchiso ${verbose} -w "${work_dir}/x86_64" -C "${work_dir}/pacman.conf" -D "${install_dir}" -r "/root/customize_airootfs.sh -p ${password}" run
107108
rm ${work_dir}/x86_64/airootfs/root/customize_airootfs.sh
108109
}
109110

@@ -229,14 +230,15 @@ if [[ ${EUID} -ne 0 ]]; then
229230
_usage 1
230231
fi
231232

232-
while getopts 'N:V:L:P:A:D:w:o:g:vh' arg; do
233+
while getopts 'N:V:L:P:A:D:w:o:g:vhp:' arg; do
233234
case "${arg}" in
234235
N) iso_name="${OPTARG}" ;;
235236
V) iso_version="${OPTARG}" ;;
236237
L) iso_label="${OPTARG}" ;;
237238
P) iso_publisher="${OPTARG}" ;;
238239
A) iso_application="${OPTARG}" ;;
239240
D) install_dir="${OPTARG}" ;;
241+
p) password="${OPTARG}" ;;
240242
w) work_dir="${OPTARG}" ;;
241243
o) out_dir="${OPTARG}" ;;
242244
g) gpg_key="${OPTARG}" ;;

0 commit comments

Comments
 (0)