Compare commits
5 Commits
Author | SHA1 | Date | |
---|---|---|---|
|
d77e1cd11d | ||
|
2ec78bfcfc | ||
|
fedf55b573 | ||
|
30681d2f0a | ||
|
74de5f9798 |
@@ -80,8 +80,8 @@ func main() {
|
|||||||
defer func() {
|
defer func() {
|
||||||
e := os.RemoveAll(workDir)
|
e := os.RemoveAll(workDir)
|
||||||
if e != nil && err == nil {
|
if e != nil && err == nil {
|
||||||
err = e
|
log.Println(e)
|
||||||
retCode = 1
|
log.Println("unable to remove temporary work directory")
|
||||||
}
|
}
|
||||||
}()
|
}()
|
||||||
|
|
||||||
@@ -108,7 +108,12 @@ func main() {
|
|||||||
modules.New(strings.Fields(devinfo.ModulesInitfs), "/usr/share/mkinitfs/modules"),
|
modules.New(strings.Fields(devinfo.ModulesInitfs), "/usr/share/mkinitfs/modules"),
|
||||||
modules.New([]string{}, "/etc/mkinitfs/modules"),
|
modules.New([]string{}, "/etc/mkinitfs/modules"),
|
||||||
})
|
})
|
||||||
initramfsAr.AddItems(initfs)
|
if err := initramfsAr.AddItems(initfs); err != nil {
|
||||||
|
log.Println(err)
|
||||||
|
log.Println("failed to generate: ", "initramfs")
|
||||||
|
retCode = 1
|
||||||
|
return
|
||||||
|
}
|
||||||
if err := initramfsAr.Write(filepath.Join(workDir, "initramfs"), os.FileMode(0644)); err != nil {
|
if err := initramfsAr.Write(filepath.Join(workDir, "initramfs"), os.FileMode(0644)); err != nil {
|
||||||
log.Println(err)
|
log.Println(err)
|
||||||
log.Println("failed to generate: ", "initramfs")
|
log.Println("failed to generate: ", "initramfs")
|
||||||
@@ -136,7 +141,12 @@ func main() {
|
|||||||
modules.New([]string{}, "/etc/mkinitfs/modules-extra"),
|
modules.New([]string{}, "/etc/mkinitfs/modules-extra"),
|
||||||
osksdl.New(devinfo.MesaDriver),
|
osksdl.New(devinfo.MesaDriver),
|
||||||
})
|
})
|
||||||
initramfsExtraAr.AddItemsExclude(initfsExtra, initfs)
|
if err := initramfsExtraAr.AddItemsExclude(initfsExtra, initfs); err != nil {
|
||||||
|
log.Println(err)
|
||||||
|
log.Println("failed to generate: ", "initramfs-extra")
|
||||||
|
retCode = 1
|
||||||
|
return
|
||||||
|
}
|
||||||
if err := initramfsExtraAr.Write(filepath.Join(workDir, "initramfs-extra"), os.FileMode(0644)); err != nil {
|
if err := initramfsExtraAr.Write(filepath.Join(workDir, "initramfs-extra"), os.FileMode(0644)); err != nil {
|
||||||
log.Println(err)
|
log.Println(err)
|
||||||
log.Println("failed to generate: ", "initramfs-extra")
|
log.Println("failed to generate: ", "initramfs-extra")
|
||||||
|
@@ -100,6 +100,9 @@ create/manage. mkinitfs reads configuration from */usr/share/mkinitfs* first, an
|
|||||||
path(s) under the relevant directory in */etc/mkinitfs*, and changing
|
path(s) under the relevant directory in */etc/mkinitfs*, and changing
|
||||||
the destination path.
|
the destination path.
|
||||||
|
|
||||||
|
Any lines in these files that start with *#* are considered comments, and
|
||||||
|
skipped.
|
||||||
|
|
||||||
## /usr/share/mkinitfs/hooks, /etc/mkinitfs/hooks
|
## /usr/share/mkinitfs/hooks, /etc/mkinitfs/hooks
|
||||||
## /usr/share/mkinitfs/hooks-extra*, /etc/mkinitfs/hooks-extra
|
## /usr/share/mkinitfs/hooks-extra*, /etc/mkinitfs/hooks-extra
|
||||||
|
|
||||||
@@ -121,12 +124,18 @@ create/manage. mkinitfs reads configuration from */usr/share/mkinitfs* first, an
|
|||||||
Modules are installed in the initramfs archive under the same path they
|
Modules are installed in the initramfs archive under the same path they
|
||||||
exist on the system where mkinitfs is executed.
|
exist on the system where mkinitfs is executed.
|
||||||
|
|
||||||
|
Any lines in these files that start with *#* are considered comments, and
|
||||||
|
skipped.
|
||||||
|
|
||||||
## /usr/share/mkinitfs/dirs, /etc/mkinitfs/dirs
|
## /usr/share/mkinitfs/dirs, /etc/mkinitfs/dirs
|
||||||
|
|
||||||
Files with the *.dirs* extension in these directories are lists of
|
Files with the *.dirs* extension in these directories are lists of
|
||||||
directories to create within the initramfs. There is no *-extra* variant,
|
directories to create within the initramfs. There is no *-extra* variant,
|
||||||
since directories are of negligible size.
|
since directories are of negligible size.
|
||||||
|
|
||||||
|
Any lines in these files that start with *#* are considered comments, and
|
||||||
|
skipped.
|
||||||
|
|
||||||
# BOOT-DEPLOY
|
# BOOT-DEPLOY
|
||||||
|
|
||||||
After generating archives, mkinitfs will execute *boot-deploy*, using *$PATH* to
|
After generating archives, mkinitfs will execute *boot-deploy*, using *$PATH* to
|
||||||
|
@@ -6,6 +6,7 @@ import (
|
|||||||
"log"
|
"log"
|
||||||
"os"
|
"os"
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
|
"strings"
|
||||||
|
|
||||||
"gitlab.com/postmarketOS/postmarketos-mkinitfs/internal/filelist"
|
"gitlab.com/postmarketOS/postmarketos-mkinitfs/internal/filelist"
|
||||||
)
|
)
|
||||||
@@ -44,6 +45,10 @@ func (h *HookDirs) List() (*filelist.FileList, error) {
|
|||||||
s := bufio.NewScanner(f)
|
s := bufio.NewScanner(f)
|
||||||
for s.Scan() {
|
for s.Scan() {
|
||||||
dir := s.Text()
|
dir := s.Text()
|
||||||
|
if len(dir) == 0 || strings.HasPrefix(dir, "#") {
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
|
||||||
files.Add(dir, dir)
|
files.Add(dir, dir)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -58,7 +58,12 @@ func slurpFiles(fd io.Reader) (*filelist.FileList, error) {
|
|||||||
|
|
||||||
s := bufio.NewScanner(fd)
|
s := bufio.NewScanner(fd)
|
||||||
for s.Scan() {
|
for s.Scan() {
|
||||||
src, dest, has_dest := strings.Cut(s.Text(), ":")
|
line := s.Text()
|
||||||
|
if len(line) == 0 || strings.HasPrefix(line, "#") {
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
|
||||||
|
src, dest, has_dest := strings.Cut(line, ":")
|
||||||
|
|
||||||
fFiles, err := misc.GetFiles([]string{src}, true)
|
fFiles, err := misc.GetFiles([]string{src}, true)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
@@ -95,6 +95,9 @@ func slurpModules(fd io.Reader, modDir string) (*filelist.FileList, error) {
|
|||||||
s := bufio.NewScanner(fd)
|
s := bufio.NewScanner(fd)
|
||||||
for s.Scan() {
|
for s.Scan() {
|
||||||
line := s.Text()
|
line := s.Text()
|
||||||
|
if len(line) == 0 || strings.HasPrefix(line, "#") {
|
||||||
|
continue
|
||||||
|
}
|
||||||
dir, file := filepath.Split(line)
|
dir, file := filepath.Split(line)
|
||||||
if file == "" {
|
if file == "" {
|
||||||
// item is a directory
|
// item is a directory
|
||||||
@@ -194,7 +197,12 @@ func getModuleDeps(modName string, modulesDep io.Reader) ([]string, error) {
|
|||||||
|
|
||||||
s := bufio.NewScanner(modulesDep)
|
s := bufio.NewScanner(modulesDep)
|
||||||
for s.Scan() {
|
for s.Scan() {
|
||||||
fields := strings.Fields(s.Text())
|
line := s.Text()
|
||||||
|
if len(line) == 0 || strings.HasPrefix(line, "#") {
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
|
||||||
|
fields := strings.Fields(line)
|
||||||
if len(fields) == 0 {
|
if len(fields) == 0 {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
@@ -37,6 +37,12 @@ func (s *OskSdl) List() (*filelist.FileList, error) {
|
|||||||
|
|
||||||
log.Println("- Including osk-sdl support")
|
log.Println("- Including osk-sdl support")
|
||||||
|
|
||||||
|
log.Println("******************* DEPRECATION WARNING *******************")
|
||||||
|
log.Println("Using osk-sdl is deprecated in postmarketOS!")
|
||||||
|
log.Println("Consider switching to unl0kr:")
|
||||||
|
log.Println("https://postmarketos.org/edge/2023/10/04/osk-sdl-deprecated/")
|
||||||
|
log.Println("******************* DEPRECATION WARNING *******************")
|
||||||
|
|
||||||
confFiles := []string{
|
confFiles := []string{
|
||||||
"/etc/osk.conf",
|
"/etc/osk.conf",
|
||||||
"/etc/ts.conf",
|
"/etc/ts.conf",
|
||||||
|
Reference in New Issue
Block a user