-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuildiso2.sh
executable file
·103 lines (91 loc) · 3.13 KB
/
buildiso2.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
#!/bin/sh
#
NO_OOM_KILLER="$$"
echo $NO_OOM_KILLER | xargs -n1 sudo choom -n -1000 -p
# 参照するiso-profilesはカレントディレクトリが優先される。
pkgs=`pwd`/Japanese-pkgs.txt
pkgs2=`pwd`/Japanese-pkgs-root.txt
pkgdir=`pwd`/iso-profiles
usb=/run/media/phoepsilonix/Ventoy
gkey="-g $(cat ~/.gnupg/sign.txt)"
#gkey=""
kernel=linux62
# 保存先フォルダ
artifacts=`pwd`/artifacts
# 日本語パッケージを加えるファイル
#pkg1=Packages-Live
pkg2=Packages-Desktop
pkg3=Packages-Root
# エディション指定
editions=(
# "manjaro gnome"
"manjaro kde"
# "manjaro xfce"
# "community cinnamon"
# "community mate"
# "community openbox"
# "manjaro architect"
# "community lxqt"
# "community lxqt-kwin"
# "community sway"
)
# 初期化
#rm -rf $artifacts
#mkdir -p $artifacts
#rm -rf $pkgdir
#mkdir -p $pkgdir
#cp -r iso-profiles-orig/* $pkgdir/
#sync
# profiles.confを微修正
# user-repos.confを追加したiso-profilesを用意する
# add Japanese pkgs and vivaldi
for edition in "${editions[@]}"
do
data=(${edition[@]})
path=${data[0]}/${data[1]}
mkdir -p $pkgdir/$path/
echo cp -r iso-profiles-orig/$path $pkgdir/${data[0]}/
cp -r iso-profiles-orig/$path $pkgdir/${data[0]}/
#cat $pkgs >> $pkgdir/$edition[0]/$edition[1]/$pkg1
# Desktopパッケージに加える。ライブは不要みたい。
if [[ "${data[1]}" != "architect" ]] ;then
cat $pkgs >> $pkgdir/$path/$pkg2
# Packages-Rootに追加
cat $pkgs2 >> $pkgdir/$path/$pkg3
fi
sync
done
# buildiso prepare image
echo "build image"
for edition in "${editions[@]}"
do
data=(${edition[@]})
ed=${data[1]}
# echo "build pre-image"
# echo "buildiso -d xz -f -k $kernel -p $ed -x $gkey -t $usb/tmp/iso -r $usb/tmp/build"
# buildiso -d xz -f -k $kernel -p $ed -x $gkey -t $usb/tmp/iso
# buildiso -d xz -f -k $kernel -p $ed -x $gkey -t $usb/tmp/iso -r $usb/tmp/build
echo "build iso"
echo "buildiso -d xz -k $kernel -p $ed $gkey"
sync
gpg -dq ~/.ssh/pass.gpg|sudo -S pwd >/dev/null 2>&1
sync
touch INFO.sig && rm -f INFO.sig && gpg --passphrase-file ~/.ssh/gpg-passphrase --batch --pinentry-mode=loopback -b INFO
buildiso -d xz -f -k $kernel -p $ed $gkey && ./line-notify.sh "$ed done" || ./line-notify.sh "$ed error"
#buildiso -zc -d xz -f -k $kernel -p $ed $gkey && ./line-notify.sh "$ed done" || ./line-notify.sh "$ed error"
sync
find /var/cache/manjaro-tools/iso -type f -name "*.iso" | xargs -I{} mv {} $artifacts && sync
. artifacts/rename.sh
# buildiso -x -d xz -f -k $kernel -p $ed $gkey -t $usb/tmp/iso
# buildiso -zc -d xz -f -k $kernel -p $ed $gkey
#buildiso -d xz -f -k $kernel -p $ed -zc $gkey -t $usb/tmp/iso -r $usb/tmp/build
done
echo "Move iso files to Artifacts folder"
#sudo chown -R phoepsilonix:phoepsilonix $usb/tmp/iso/
sync
find /var/cache/manjaro-tools/iso -type f -name "*.iso" | xargs -I{} mv {} $artifacts && sync
#rsync -avn $usb/artifacts/*.iso $artifacts/ && sync
sync
# 終了
echo "Done"
exit 0