Skip to content

Commit cefca0d

Browse files
committed
fix issue #103
1 parent 305b477 commit cefca0d

File tree

5 files changed

+42
-27
lines changed

5 files changed

+42
-27
lines changed

data/exclude.list

-5
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,6 @@ boot/syslinux/*
1616
boot/lilo/*
1717
boot/*.bak
1818
boot/*.old-dkms
19-
etc/hostname
20-
etc/hosts
21-
etc/resolv.conf
22-
etc/fstab
23-
etc/mtab
2419
etc/group-
2520
etc/passwd-
2621
etc/gshadow-

src/actions/extract.py

+7-5
Original file line numberDiff line numberDiff line change
@@ -34,11 +34,13 @@ def main():
3434

3535
message.sub_info('Mounting ISO', config.ISO)
3636
try:
37-
# in some cases the modules may not be loaded, if they are builtin
38-
# a warning should be printed but (AFAIK) the command should not fail.
39-
# the "-b" argument is to ensure blacklisted modules are respected,
40-
# I hope it does not cause trouble (it works with buysbox and kmod)
41-
misc.system_command((misc.whereis('modprobe'), '-ba', 'loop', 'iso9660'))
37+
# load the required kernel modules in cases the are not, if they are
38+
# builtin the command fails so ignoring that. the "-b" argument is to
39+
# ensure blacklisted modules are respected
40+
try:
41+
misc.system_command((misc.whereis('modprobe'), '-ba', 'loop', 'iso9660'))
42+
except:
43+
pass
4244
misc.system_command((misc.whereis('mount'), '-t', 'iso9660', '-o', \
4345
'ro,loop', config.ISO, mount_dir))
4446
except:

src/gui.py.in

+5
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,11 @@ import actions.rebuild as rebuild
2121
import actions.clean as clean
2222
import actions.qemu as qemu
2323
misc.CATCH = True
24+
common.misc.CATCH = True
25+
extract.misc.CATCH = True
26+
deb.misc.CATCH = True
27+
hook.misc.CATCH = True
28+
qemu.misc.CATCH = True
2429

2530
# prepare for lift-off
2631
app = QtGui.QApplication(sys.argv)

src/lib/misc.py

+16-3
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,8 @@ def system_command(command, shell=False, cwd=None, env=None):
132132

133133
def chroot_exec(command, prepare=True, mount=True, output=False, xnest=False, shell=False, cwd=None):
134134
out = None
135+
resolv = '%s/etc/resolv.conf' % config.FILESYSTEM_DIR
136+
hosts = '%s/etc/hosts' % config.FILESYSTEM_DIR
135137
mount = whereis('mount')
136138
umount = whereis('umount')
137139
chroot = whereis('chroot')
@@ -142,11 +144,18 @@ def chroot_exec(command, prepare=True, mount=True, output=False, xnest=False, sh
142144
chroot_command.extend(command)
143145
try:
144146
if prepare:
145-
resolv = '%s/etc/resolv.conf' % config.FILESYSTEM_DIR
146-
hosts = '%s/etc/hosts' % config.FILESYSTEM_DIR
147-
if os.path.isfile('/etc/resolv.conf'):
147+
if os.path.isfile('/etc/resolv.conf') and not os.path.islink(resolv):
148+
copy_file('/etc/resolv.conf', resolv)
149+
elif os.path.islink(resolv):
150+
# usually /run/resolvconf/resolv.conf
151+
resolv = os.path.realpath(resolv)
152+
rdir = os.path.dirname(resolv)
153+
if not os.path.isdir(rdir):
154+
os.makedirs(rdir)
148155
copy_file('/etc/resolv.conf', resolv)
149156
if os.path.isfile('/etc/hosts'):
157+
if os.path.isfile(hosts):
158+
copy_file(hosts, '%s.backup' % hosts)
150159
copy_file('/etc/hosts', hosts)
151160

152161
if mount:
@@ -208,6 +217,10 @@ def chroot_exec(command, prepare=True, mount=True, output=False, xnest=False, sh
208217
system_command(chroot_command, shell=shell, \
209218
env=environment, cwd=cwd)
210219
finally:
220+
if prepare:
221+
if os.path.isfile('%s.backup' % hosts):
222+
copy_file('%s.backup' % hosts, hosts)
223+
os.unlink('%s.backup' % hosts)
211224
if mount:
212225
for s in reversed(pseudofs):
213226
sdir = config.FILESYSTEM_DIR + s

tr/customizer_bg_BG.ts

+14-14
Original file line numberDiff line numberDiff line change
@@ -232,72 +232,72 @@ Copyright (C) 2013-2015 Mubiin Kimura</source>
232232
<context>
233233
<name>app</name>
234234
<message>
235-
<location filename="gui.py" line="36"/>
235+
<location filename="gui.py" line="41"/>
236236
<source>Information</source>
237237
<translation>Информация</translation>
238238
</message>
239239
<message>
240-
<location filename="gui.py" line="39"/>
240+
<location filename="gui.py" line="44"/>
241241
<source>Warning</source>
242242
<translation>Предупреждение</translation>
243243
</message>
244244
<message>
245-
<location filename="gui.py" line="42"/>
245+
<location filename="gui.py" line="47"/>
246246
<source>Critical</source>
247247
<translation>Критично</translation>
248248
</message>
249249
<message>
250-
<location filename="gui.py" line="55"/>
250+
<location filename="gui.py" line="60"/>
251251
<source>An instance of Customizer is already running.</source>
252252
<translation>Инстанция на Customizer вече е стартирана.</translation>
253253
</message>
254254
<message>
255-
<location filename="gui.py" line="62"/>
255+
<location filename="gui.py" line="67"/>
256256
<source>You are attempting to run Customizer with Python 3.</source>
257257
<translation>Опитвате се да стартирате Customizer с Python 3.</translation>
258258
</message>
259259
<message>
260-
<location filename="gui.py" line="140"/>
260+
<location filename="gui.py" line="145"/>
261261
<source>The filesystem is not valid or corrupted. Clean is recommended.</source>
262262
<translation>Файловата система не е валидна или е повредена. Изчистване е препоръчително.</translation>
263263
</message>
264264
<message>
265-
<location filename="gui.py" line="161"/>
265+
<location filename="gui.py" line="166"/>
266266
<source>No supported terminal emulator detected.</source>
267267
<translation>Не е намерен терминал, който се поддържа.</translation>
268268
</message>
269269
<message>
270-
<location filename="gui.py" line="223"/>
270+
<location filename="gui.py" line="228"/>
271271
<source>Open</source>
272272
<translation>Отвори</translation>
273273
</message>
274274
<message>
275-
<location filename="gui.py" line="223"/>
275+
<location filename="gui.py" line="228"/>
276276
<source>ISO Files (*.iso);;All Files (*)</source>
277277
<translation>ISO Файлове (*.iso);;Всички Файлове (*)</translation>
278278
</message>
279279
<message>
280-
<location filename="gui.py" line="256"/>
280+
<location filename="gui.py" line="261"/>
281281
<source>No supported text editor detected.</source>
282282
<translation>Не е намерен текстов редактор, който се поддържа.</translation>
283283
</message>
284284
<message>
285-
<location filename="gui.py" line="269"/>
285+
<location filename="gui.py" line="274"/>
286286
<source>Deb Files (*.deb);;All Files (*)</source>
287287
<translation>Deb Файлове (*.deb);;Всички Файлове (*)</translation>
288288
</message>
289289
<message>
290-
<location filename="gui.py" line="285"/>
290+
<location filename="gui.py" line="290"/>
291291
<source>Shell Scripts (*.sh);;All Files (*)</source>
292292
<translation>Скриптове на Обвивката (*.sh);;Всички Файлове (*)</translation>
293293
</message>
294294
<message>
295-
<location filename="gui.py" line="369"/>
295+
<location filename="gui.py" line="374"/>
296296
<source>No supported file manager detected.</source>
297297
<translation>Не е намерен файлов мениджър, който се поддържа.</translation>
298298
</message>
299299
<message>
300-
<location filename="gui.py" line="315"/>
300+
<location filename="gui.py" line="320"/>
301301
<source>Live user can not be empty.</source>
302302
<translation type="unfinished"></translation>
303303
</message>

0 commit comments

Comments
 (0)