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
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
|
diff --git a/src/backend/c_jail.sh b/src/backend/c_jail.sh
index acdf0db..0a486b4 100644
--- a/src/backend/c_jail.sh
+++ b/src/backend/c_jail.sh
@@ -5,6 +5,7 @@ export local jailsrcmodecmd="vasile --srcmode"
export local jaildkmscmd="vasile --dkms"
export local jailmandbcmd="mandb --create"
export local jailportagecmd="emerge -kav "$jailtarget""
+export local jailupgradecmd="emerge -NuDKv --backtrack=100 --with-bdeps=y @world --exclude linux-image-lts --exclude linux-headers-lts --exclude linux-image-redcore --exclude linux-sources-redcore"
export local jaildracutcmd="dracut -N -a dmsquash-live -a pollcdrom --force --kver="$kernver" /boot/"$jailramfsname""
export local jailmkchainloadercmd="grub2-mkimage -d /usr/lib64/grub/i386-pc -o core.img -O i386-pc biosdisk part_msdos fat -p /boot/grub"
export local jailmkx64eficmd="grub2-mkimage -d /usr/lib64/grub/x86_64-efi -o bootx64.efi -O x86_64-efi ext2 fat udf btrfs ntfs reiserfs xfs hfsplus lvm ata part_msdos part_gpt part_apple bsd search_fs_uuid normal chain iso9660 configfile help loadenv reboot cat search memdisk tar boot linux chain -p /boot/grub"
diff --git a/src/backend/f_makeiso.sh b/src/backend/f_makeiso.sh
index fb85d8a..936a780 100644
--- a/src/backend/f_makeiso.sh
+++ b/src/backend/f_makeiso.sh
@@ -39,7 +39,7 @@ jailisomkchload () {
jailisoenserv () {
chroot "$jailsynctarget" su - "$jailuser" -c "rc-update add redcorelive boot"
- for service in acpid alsasound avahi-daemon bluetooth cronie cupsd ModemManager NetworkManager ntpd openrc-settingsd samba syslog-ng ufw virtualbox-guest-additions xdm ; do
+ for service in acpid alsasound avahi-daemon bluetooth cronie cupsd ModemManager NetworkManager ntpd openrc-settingsd samba syslog-ng ufw xdm ; do
chroot "$jailsynctarget" su - "$jailuser" -c "rc-update add "$service" default"
done
}
diff --git a/src/backend/f_makepkg.sh b/src/backend/f_makepkg.sh
index 1c16d45..0c4d0b8 100644
--- a/src/backend/f_makepkg.sh
+++ b/src/backend/f_makepkg.sh
@@ -48,6 +48,10 @@ jailpkgsrcmode () {
chroot "$overlaypath" su - "$jailuser" -c "$jailsrcmodecmd"
}
+jailpkgupgrade () {
+ chroot "$overlaypath" su - "$jailuser" -c "$jailupgradecmd"
+}
+
jailpkgbuild () {
chroot "$overlaypath" su - "$jailuser" -c "$jailportagecmd"
}
@@ -62,6 +66,7 @@ makepkg () {
checkjailsum
jailpkgprep
jailpkgsrcmode
+ jailpkgupgrade
jailpkgbuild
jailpkgstart
jailpkgdmnt
diff --git a/src/backend/f_modeswitch.sh b/src/backend/f_modeswitch.sh
index 4f6c271..90d6266 100644
--- a/src/backend/f_modeswitch.sh
+++ b/src/backend/f_modeswitch.sh
@@ -15,7 +15,7 @@ rmaddonporttree () {
}
rmportcfgtree () {
- einfo "I am removing ebuild tree configuration"
+ einfo "I am removing portage configuration"
rm ""$jailportcfgtarget"/make.conf" > /dev/null 2>&1
rm ""$jailportcfgtarget"/make.profile" > /dev/null 2>&1
rm "$jailportcfgtarget" > /dev/null 2>&1
@@ -81,7 +81,7 @@ dladdonportmintree () {
dlportcfgtree () {
pushd /opt > /dev/null 2>&1
- einfo "I am injecting ebuild tree configuration"
+ einfo "I am injecting portage configuration"
git clone https://gitlab.com/redcore/redcore-build.git
popd > /dev/null 2>&1
}
@@ -98,44 +98,54 @@ injectportfulltree () {
dlportcfgtree
}
-setbinmodecfg () {
- ln -sf "$jailportcfgsource" "$jailportcfgtarget"
- ln -sf "$jailportcfgtarget"/make.conf.amd64-binmode "$jailportcfgtarget"/make.conf
+setmakeopts () {
+ einfo "I am setting portage to use $(getconf _NPROCESSORS_ONLN) jobs to compile packages"
+ # default MAKEOPTS value is -j64, but that's overkill for lower spec machines
+ # this will adjust MAKEOPTS to a value detected by $(getconf _NPROCESSORS_ONLN)
+ sed -i "s/\-j64/\-j$(getconf _NPROCESSORS_ONLN)/g" "$jailportcfgtarget"/global.conf/makeopts.conf # global makeopts (exclude kernel)
+ sed -i "s/\-j64/\-j$(getconf _NPROCESSORS_ONLN)/g" "$jailportcfgtarget"/env/makenoise.conf # kernel makeopts
+}
+
+setprofile () {
eselect profile set default/linux/amd64/17.0/hardened
env-update
. /etc/profile
}
+setbinmodecfg () {
+ ln -sf "$jailportcfgsource" "$jailportcfgtarget"
+ ln -sf "$jailportcfgtarget"/make.conf.amd64-binmode "$jailportcfgtarget"/make.conf
+}
+
binmode () {
resetmode
injectportmintree
setbinmodecfg
+ setprofile
}
setmixedmodecfg () {
ln -sf "$jailportcfgsource" "$jailportcfgtarget"
ln -sf "$jailportcfgtarget"/make.conf.amd64-mixedmode "$jailportcfgtarget"/make.conf
- eselect profile set default/linux/amd64/17.0/hardened
- env-update
- . /etc/profile
}
mixedmode () {
resetmode
injectportfulltree
setmixedmodecfg
+ setmakeopts
+ setprofile
}
setsrcmodecfg () {
ln -sf "$jailportcfgsource" "$jailportcfgtarget"
ln -sf "$jailportcfgtarget"/make.conf.amd64-srcmode "$jailportcfgtarget"/make.conf
- eselect profile set default/linux/amd64/17.0/hardened
- env-update
- . /etc/profile
}
srcmode() {
resetmode
injectportfulltree
setsrcmodecfg
+ setmakeopts
+ setprofile
}
|