Skip to content

Commit 9ae4d0b

Browse files
committed
Merge branch 'stable'
2 parents e131b04 + 443b2ff commit 9ae4d0b

File tree

299 files changed

+23116
-932
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

299 files changed

+23116
-932
lines changed

.gitignore

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,14 @@
88
*.log
99
*.log.*
1010
*.sig
11-
11+
.build_option
12+
system/mkalteriso
13+
system/cpp-src/mkalteriso/build/
1214
pkg/
1315
src/
1416
out/
1517
work/
1618
*.ignore*
1719
*.ig*
18-
*.add*
20+
*.add*
21+
temp/

.gitmodules

Whitespace-only changes.

.travis.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
language: shell
2+
script:
3+
- bash -c 'shopt -s globstar nullglob; shellcheck -s bash --exclude=SC2068 -S error **/*.{sh,ksh,bash}'
4+
git:
5+
submodules: false

Dockerfile

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
11
FROM archlinux:latest
2-
RUN echo 'Server = http://ftp.jaist.ac.jp/pub/Linux/ArchLinux/$repo/os/$arch' > /etc/pacman.d/mirrorlist
2+
RUN echo 'Server = http://mirrors.cat.net/archlinux/$repo/os/$arch' > /etc/pacman.d/mirrorlist \
3+
&& echo 'nameserver 1.1.1.1' > /etc/resolv.conf
34
RUN pacman -Syyu --noconfirm
4-
RUN pacman -S git archiso arch-install-scripts sudo --noconfirm
5-
RUN git clone https://github.com/SereneTeam/alterlinux.git alterlinux/
5+
RUN pacman -S archiso git arch-install-scripts sudo qt5-base cmake ninja base-devel --noconfirm
6+
RUN pacman-key --init
7+
COPY . /alterlinux
68
WORKDIR /alterlinux
79
RUN git checkout dev
8-
RUN ./keyring.sh -ca
10+
RUN ./keyring.sh -a
911
CMD ["./build.sh", "-b"]

Makefile

Lines changed: 44 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
12
BUILD_SCRIPT = build.sh
23
KERNEL = zen
34
SHARE_OPTION = -b -c "zstd" -u "alter" -p "alter" -k "${KERNEL}"
@@ -6,41 +7,75 @@ ARCH_x86_64 = -a x86_64
67
ARCH_i686 = -a i686
78

89

9-
full:
10+
full:mkalteriso
1011
@sudo ./fullbuild.sh
1112
@make clean
1213

13-
xfce-64:
14+
xfce-64:mkalteriso
1415
@sudo ./${BUILD_SCRIPT} ${SHARE_OPTION} ${ARCH_x86_64} xfce
1516
@make clean
1617

17-
plasma-64:
18+
plasma-64:mkalteriso
1819
@sudo ./${BUILD_SCRIPT} ${SHARE_OPTION} ${ARCH_x86_64} plasma
1920
@make clean
2021

21-
releng-64:
22+
releng-64:mkalteriso
2223
@sudo ./${BUILD_SCRIPT} ${SHARE_OPTION} ${ARCH_x86_64} releng
2324
@make clean
2425

25-
lxde-64:
26+
lxde-64:mkalteriso
2627
@sudo ./${BUILD_SCRIPT} ${SHARE_OPTION} ${ARCH_x86_64} lxde
2728
@make clean
2829

29-
xfce-32:
30+
xfce-32:mkalteriso
3031
@sudo ./${BUILD_SCRIPT} ${SHARE_OPTION} ${ARCH_i686} xfce
3132
@make clean
3233

33-
plasma-32:
34+
plasma-32::mkalteriso
3435
@sudo ./${BUILD_SCRIPT} ${SHARE_OPTION} ${ARCH_i686} plasma
3536
@make clean
3637

37-
releng-32:
38+
releng-32:mkalteriso
3839
@sudo ./${BUILD_SCRIPT} ${SHARE_OPTION} ${ARCH_i686} releng
3940
@make clean
4041

41-
lxde-32:
42+
lxde-32:mkalteriso
4243
@sudo ./${BUILD_SCRIPT} ${SHARE_OPTION} ${ARCH_i686} lxde
4344
@make clean
4445

46+
menuconfig/build/mconf::
47+
@if [ -d menuconfig/build ];\
48+
then \
49+
:;\
50+
else \
51+
mkdir menuconfig/build ;\
52+
fi
53+
(cd menuconfig/build ; cmake -GNinja .. ; ninja -j4 )
54+
mkalteriso:
55+
@if [ -d system/cpp-src/mkalteriso/build ];\
56+
then \
57+
:;\
58+
else \
59+
mkdir system/cpp-src/mkalteriso/build ;\
60+
fi
61+
(cd system/cpp-src/mkalteriso/build ; cmake -GNinja .. ; ninja -j4 ; cp -f mkalteriso ../../../)
62+
63+
menuconfig:menuconfig/build/mconf menuconfig-script/kernel_choice
64+
menuconfig/build/mconf menuconfig-script/rootconf
65+
menuconfig-script/kernel_choice:system/kernel_list-x86_64 system/kernel_list-i686
66+
./kernel-choice-conf-gen.sh
67+
build_option:
68+
if [ -f .config ];\
69+
then \
70+
:;\
71+
else \
72+
make menuconfig ;\
73+
fi
74+
./menuconf-to-alterconf.sh ./.build_option
4575
clean:
4676
@sudo ./${BUILD_SCRIPT} clean
77+
build:build_option mkalteriso
78+
$(eval BUILD_OPTION := $(shell cat ./.build_option))
79+
sudo ./${BUILD_SCRIPT} ${BUILD_OPTION}
80+
keyring::
81+
sudo ./keyring.sh --alter-add --arch-add

build-wizard.py

Lines changed: 208 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,208 @@
1+
#!/usr/bin/env python3
2+
#== Copyright ==#
3+
# (C) 2019-2020 Fascode Network
4+
5+
#== Import ==#
6+
import gi, subprocess, sys, threading
7+
gi.require_version("Gtk", "3.0")
8+
from gi.repository import GLib, Gtk, GObject
9+
10+
#== Main Window ==#
11+
class MainWindow(Gtk.Window):
12+
#= Fuction =#
13+
def __init__(self):
14+
def yn(name):
15+
y = Gtk.RadioButton.new_with_label_from_widget(None, "Yes")
16+
y.connect("toggled", self.on_button_toggled, name, True)
17+
n = Gtk.RadioButton.new_with_mnemonic_from_widget(y, "No")
18+
n.connect("toggled", self.on_button_toggled, name, False)
19+
return y, n
20+
21+
def combobox(name, list):
22+
list_store = Gtk.ListStore(int, str)
23+
for num in range(len(list)):
24+
list_store.append([num, list[num]])
25+
26+
combo = Gtk.ComboBox.new_with_model_and_entry(list_store)
27+
combo.connect("changed", self.on_combo_changed, name)
28+
combo.set_entry_text_column(1)
29+
combo.set_active(0)
30+
return combo
31+
32+
#-- Create Window --#
33+
Gtk.Window.__init__(self, title="build wizard")
34+
35+
#-- Define --#
36+
self.bool = {"plymouth": True, "japanese": True}
37+
self.selected = {"build": "native"}
38+
39+
#-- Sub Layout 1 --#
40+
#- Create -#
41+
sub_layout1 = Gtk.Box(orientation=Gtk.Orientation.VERTICAL, spacing=5)
42+
43+
#- Labels -#
44+
label1 = Gtk.Label("select desktop environment")
45+
label2 = Gtk.Label("select kernel")
46+
47+
#- Comboboxes -#
48+
de = combobox("de", ["xfce", "plasma", "lxde"])
49+
kernel= combobox("kernel", ["zen", "linux", "lts", "lqx", "ck", "rt", "rt-lts", "xanmod-lts"])
50+
51+
#- Buttons & Add -#
52+
for name in "plymouth", "japanese":
53+
y, n = yn(name)
54+
subs_layout = Gtk.Box(spacing=5)
55+
subs_layout.pack_start(y, True, True, 30)
56+
subs_layout.pack_start(n, True, True, 30)
57+
label = Gtk.Label("Enable" + " " + name + "?")
58+
sub_layout1.pack_start(label, True, True, 5)
59+
sub_layout1.pack_start(subs_layout, True, True, 5)
60+
61+
#- Add -#
62+
for name in label1, de, label2, kernel:
63+
sub_layout1.pack_start(name, True, True, 5)
64+
65+
#-- Sub Layout 2 --#
66+
#- Create -#
67+
sub_layout2 = Gtk.Box(orientation=Gtk.Orientation.VERTICAL, spacing=5)
68+
69+
#- Labels -#
70+
label1 = Gtk.Label("select compression")
71+
label2 = Gtk.Label("user name")
72+
label3 = Gtk.Label("password")
73+
74+
#- Combobox -#
75+
comp = combobox("comp", ["zstd", "lzma", "lzo", "lz4", "xz", "gzip"])
76+
77+
#- Entrys -#
78+
self.usr = Gtk.Entry()
79+
self.usr.set_text("alter")
80+
self.passwd = Gtk.Entry()
81+
self.passwd.set_visibility(False)
82+
self.passwd.set_text("alter")
83+
84+
#- Button -#
85+
showpasswd = Gtk.ToggleButton("Show password")
86+
showpasswd.connect("toggled", self.on_button_toggled, "1")
87+
88+
#- Add -#
89+
for name in label1, comp, label2, self.usr, label3, self.passwd, showpasswd:
90+
sub_layout2.pack_start(name, True, True, 5)
91+
92+
#-- Sub Layout 3 --#
93+
#- Create -#
94+
sub_layout3 = Gtk.Box(orientation=Gtk.Orientation.VERTICAL, spacing=5)
95+
96+
#- Label -#
97+
label = Gtk.Label("select build type")
98+
99+
#- Button -#
100+
button1 = Gtk.RadioButton.new_with_label_from_widget(None, "native")
101+
button1.connect("toggled", self.select_build, "native")
102+
103+
#- Add -#
104+
sub_layout3.pack_start(label, True, True, 5)
105+
sub_layout3.pack_start(button1, True, True, 5)
106+
107+
#- Buttons & Add -#
108+
for name in "docker", "ssh":
109+
button = Gtk.RadioButton.new_with_mnemonic_from_widget(button1, name)
110+
button.connect("toggled", self.select_build, name)
111+
sub_layout3.pack_start(button, True, True, 5)
112+
113+
#-- Grid --#
114+
#- Create -#
115+
grid = Gtk.Grid(column_spacing=10, row_spacing=10)
116+
117+
#- Progressbar -#
118+
self.progressbar = Gtk.ProgressBar()
119+
120+
#- Button -#
121+
build = Gtk.Button("build")
122+
build.connect("clicked", self.on_click_build)
123+
124+
#- Add -#
125+
grid.attach(sub_layout1, 0, 0, 1, 1)
126+
grid.attach(sub_layout2, 1, 0, 1, 1)
127+
grid.attach(sub_layout3, 2, 0, 1, 1)
128+
grid.attach(self.progressbar, 0, 1, 2, 1)
129+
grid.attach(build, 2, 1, 1, 1)
130+
131+
#-- Layout --#
132+
#- Create -#
133+
layout = Gtk.Box(spacing=10)
134+
135+
#- Add -#
136+
layout.pack_start(grid, True, True, 10)
137+
138+
#-- Main Layout --#
139+
#- Create -#
140+
main_layout = Gtk.Box(orientation=Gtk.Orientation.VERTICAL, spacing=10)
141+
142+
#- Add -#
143+
main_layout.pack_start(layout, True, True, 10)
144+
145+
#-- Add Main Window --#
146+
self.add(main_layout)
147+
148+
def on_button_toggled(self, button, name):
149+
if button.get_active():
150+
self.passwd.set_visibility(True)
151+
else:
152+
self.passwd.set_visibility(False)
153+
154+
def on_combo_changed(self, combo, name):
155+
self.selected[name] = combo.get_model()[combo.get_active_iter()][1]
156+
157+
def select_build(self, button, name):
158+
self.selected["build"] = name
159+
160+
def on_click_build(self, button):
161+
cmd = ["sudo", "./build.sh"]
162+
163+
if self.selected["build"] == "native":
164+
if self.bool["plymouth"]:
165+
cmd.append("-b")
166+
167+
if self.bool["japanese"]:
168+
cmd.append("-j")
169+
170+
for name in "-k", self.selected["kernel"], "-c", self.selected["comp"], "-u", self.usr.get_text(), "-p", self.passwd.get_text():
171+
cmd.append(name)
172+
173+
self.run_cmd(cmd)
174+
else:
175+
self.progressbar.set_show_text(1)
176+
self.progressbar.set_text("not supported!")
177+
print("not supported!")
178+
179+
def run_cmd(self, cmd):
180+
def update(line):
181+
self.progressbar.pulse()
182+
self.progressbar.set_show_text(1)
183+
self.progressbar.set_ellipsize(True)
184+
self.progressbar.set_text(line)
185+
return False
186+
187+
def run():
188+
run = subprocess.Popen(cmd, shell=True, stdout=subprocess.PIPE, stderr = subprocess.STDOUT)
189+
while run.poll() is None:
190+
line = run.stdout.readline().decode('utf-8')
191+
if line:
192+
yield line
193+
194+
def echo():
195+
for line in run():
196+
GLib.idle_add(update, line)
197+
sys.stdout.write(line)
198+
199+
thread = threading.Thread(target=echo)
200+
thread.daemon = True
201+
thread.start()
202+
203+
#== Run ==#
204+
if __name__ == "__main__":
205+
win = MainWindow()
206+
win.show_all()
207+
win.connect("destroy", Gtk.main_quit)
208+
Gtk.main()

0 commit comments

Comments
 (0)