Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
Calamares
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
osak
Calamares
Commits
fe96369e
Commit
fe96369e
authored
3 years ago
by
Philip Müller
Browse files
Options
Downloads
Patches
Plain Diff
[postcfg] deal with symlinks
parent
494b61e7
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/modules/postcfg/main.py
+15
-4
15 additions, 4 deletions
src/modules/postcfg/main.py
with
15 additions
and
4 deletions
src/modules/postcfg/main.py
+
15
−
4
View file @
fe96369e
...
@@ -3,7 +3,7 @@
...
@@ -3,7 +3,7 @@
#
#
# === This file is part of Calamares - <http://github.com/calamares> ===
# === This file is part of Calamares - <http://github.com/calamares> ===
#
#
# Copyright 2014 - 201
9
, Philip Müller <philm@manjaro.org>
# Copyright 2014 - 20
2
1, Philip Müller <philm@manjaro.org>
# Copyright 2016, Artoo <artoo@manjaro.org>
# Copyright 2016, Artoo <artoo@manjaro.org>
#
#
# Calamares is free software: you can redistribute it and/or modify
# Calamares is free software: you can redistribute it and/or modify
...
@@ -21,6 +21,7 @@
...
@@ -21,6 +21,7 @@
import
libcalamares
import
libcalamares
import
subprocess
import
subprocess
import
os
from
shutil
import
copy2
from
shutil
import
copy2
from
distutils.dir_util
import
copy_tree
from
distutils.dir_util
import
copy_tree
...
@@ -50,6 +51,13 @@ class ConfigController:
...
@@ -50,6 +51,13 @@ class ConfigController:
def
terminate
(
self
,
proc
):
def
terminate
(
self
,
proc
):
target_env_call
([
'
killall
'
,
'
-9
'
,
proc
])
target_env_call
([
'
killall
'
,
'
-9
'
,
proc
])
def
remove_symlink
(
self
,
target
):
for
root
,
dirs
,
files
in
os
.
walk
(
"
/
"
+
target
):
for
filename
in
files
:
path
=
os
.
path
.
join
(
root
,
filename
)
if
os
.
path
.
islink
(
path
):
os
.
unlink
(
path
)
def
copy_file
(
self
,
file
):
def
copy_file
(
self
,
file
):
if
exists
(
"
/
"
+
file
):
if
exists
(
"
/
"
+
file
):
copy2
(
"
/
"
+
file
,
join
(
self
.
root
,
file
))
copy2
(
"
/
"
+
file
,
join
(
self
.
root
,
file
))
...
@@ -96,9 +104,8 @@ class ConfigController:
...
@@ -96,9 +104,8 @@ class ConfigController:
elif
cpu_ucode
==
"
GenuineIntel
"
:
elif
cpu_ucode
==
"
GenuineIntel
"
:
self
.
remove_pkg
(
"
amd-ucode
"
,
"
boot/amd-ucode.img
"
)
self
.
remove_pkg
(
"
amd-ucode
"
,
"
boot/amd-ucode.img
"
)
# Remove calamares
# Remove symlinks before copying
self
.
remove_pkg
(
"
calamares
"
,
"
usr/bin/calamares
"
)
self
.
remove_symlink
(
'
root
'
)
self
.
remove_pkg
(
"
calamares-git
"
,
"
usr/bin/calamares
"
)
# Copy skel to root
# Copy skel to root
self
.
copy_folder
(
'
etc/skel
'
,
'
root
'
)
self
.
copy_folder
(
'
etc/skel
'
,
'
root
'
)
...
@@ -133,6 +140,10 @@ class ConfigController:
...
@@ -133,6 +140,10 @@ class ConfigController:
self
.
rmdir
(
"
opt/mhwd
"
)
self
.
rmdir
(
"
opt/mhwd
"
)
self
.
umount
(
"
etc/resolv.conf
"
)
self
.
umount
(
"
etc/resolv.conf
"
)
# Remove calamares
self
.
remove_pkg
(
"
calamares
"
,
"
usr/bin/calamares
"
)
self
.
remove_pkg
(
"
calamares-git
"
,
"
usr/bin/calamares
"
)
return
None
return
None
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment