From 8447c47abaaddc14abf3176713f85612aeda1b11 Mon Sep 17 00:00:00 2001 From: Fierelier Date: Tue, 10 May 2022 12:50:10 +0200 Subject: [PATCH] First commit --- LICENSE | 2 +- input/stage01/setup | 9 ++ input/stage02/etc/skel/.bash_profile | 3 + input/stage02/setup | 4 + input/stage98/bin/login | 123 ++++++++++++++ .../etc/skel/.config/Mousepad/accels.scm | 100 ++++++++++++ .../etc/skel/.config/Thunar/accels.scm | 92 +++++++++++ input/stage98/etc/skel/.config/Thunar/uca.xml | 13 ++ input/stage98/etc/skel/.config/dconf/user | Bin 0 -> 1307 bytes input/stage98/etc/skel/.config/user-dirs.dirs | 15 ++ .../xfce4/desktop/icons.screen.latest.rc | 1 + .../xfce4/desktop/icons.screen0-1008x724.rc | 11 ++ .../xfce4/desktop/icons.screen0-1008x725.rc | 15 ++ .../skel/.config/xfce4/panel/whiskermenu-7.rc | 81 ++++++++++ .../skel/.config/xfce4/terminal/accels.scm | 58 +++++++ .../skel/.config/xfce4/terminal/terminalrc | 30 ++++ .../xfconf/xfce-perchannel-xml/displays.xml | 43 +++++ .../xfce-perchannel-xml/keyboard-layout.xml | 9 ++ .../xfconf/xfce-perchannel-xml/keyboards.xml | 7 + .../xfconf/xfce-perchannel-xml/thunar.xml | 10 ++ .../xfce-perchannel-xml/xfce4-desktop.xml | 68 ++++++++ .../xfce4-keyboard-shortcuts.xml | 152 ++++++++++++++++++ .../xfce-perchannel-xml/xfce4-panel.xml | 52 ++++++ .../xfce4-power-manager.xml | 11 ++ .../xfce-perchannel-xml/xfce4-session.xml | 31 ++++ .../xfconf/xfce-perchannel-xml/xfwm4.xml | 86 ++++++++++ .../xfconf/xfce-perchannel-xml/xsettings.xml | 39 +++++ input/stage99/isRawImage | 0 input/stage99/setupdisk | 7 + make-os | 10 ++ path/apply-stage | 16 ++ path/dupe | 2 + path/env-amd64 | 3 + path/env-i386 | 3 + path/fchroot | 10 ++ path/make-base | 8 + path/make-image | 62 +++++++ shell | 22 +++ 38 files changed, 1207 insertions(+), 1 deletion(-) create mode 100755 input/stage01/setup create mode 100755 input/stage02/etc/skel/.bash_profile create mode 100755 input/stage02/setup create mode 100755 input/stage98/bin/login create mode 100644 input/stage98/etc/skel/.config/Mousepad/accels.scm create mode 100644 input/stage98/etc/skel/.config/Thunar/accels.scm create mode 100644 input/stage98/etc/skel/.config/Thunar/uca.xml create mode 100644 input/stage98/etc/skel/.config/dconf/user create mode 100644 input/stage98/etc/skel/.config/user-dirs.dirs create mode 120000 input/stage98/etc/skel/.config/xfce4/desktop/icons.screen.latest.rc create mode 100644 input/stage98/etc/skel/.config/xfce4/desktop/icons.screen0-1008x724.rc create mode 100644 input/stage98/etc/skel/.config/xfce4/desktop/icons.screen0-1008x725.rc create mode 100644 input/stage98/etc/skel/.config/xfce4/panel/whiskermenu-7.rc create mode 100644 input/stage98/etc/skel/.config/xfce4/terminal/accels.scm create mode 100644 input/stage98/etc/skel/.config/xfce4/terminal/terminalrc create mode 100644 input/stage98/etc/skel/.config/xfce4/xfconf/xfce-perchannel-xml/displays.xml create mode 100644 input/stage98/etc/skel/.config/xfce4/xfconf/xfce-perchannel-xml/keyboard-layout.xml create mode 100644 input/stage98/etc/skel/.config/xfce4/xfconf/xfce-perchannel-xml/keyboards.xml create mode 100644 input/stage98/etc/skel/.config/xfce4/xfconf/xfce-perchannel-xml/thunar.xml create mode 100644 input/stage98/etc/skel/.config/xfce4/xfconf/xfce-perchannel-xml/xfce4-desktop.xml create mode 100644 input/stage98/etc/skel/.config/xfce4/xfconf/xfce-perchannel-xml/xfce4-keyboard-shortcuts.xml create mode 100644 input/stage98/etc/skel/.config/xfce4/xfconf/xfce-perchannel-xml/xfce4-panel.xml create mode 100644 input/stage98/etc/skel/.config/xfce4/xfconf/xfce-perchannel-xml/xfce4-power-manager.xml create mode 100644 input/stage98/etc/skel/.config/xfce4/xfconf/xfce-perchannel-xml/xfce4-session.xml create mode 100644 input/stage98/etc/skel/.config/xfce4/xfconf/xfce-perchannel-xml/xfwm4.xml create mode 100644 input/stage98/etc/skel/.config/xfce4/xfconf/xfce-perchannel-xml/xsettings.xml create mode 100644 input/stage99/isRawImage create mode 100755 input/stage99/setupdisk create mode 100755 make-os create mode 100755 path/apply-stage create mode 100755 path/dupe create mode 100755 path/env-amd64 create mode 100755 path/env-i386 create mode 100755 path/fchroot create mode 100755 path/make-base create mode 100755 path/make-image create mode 100644 shell diff --git a/LICENSE b/LICENSE index 2071b23..9173a77 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ MIT License -Copyright (c) +Copyright (c) 2022 Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: diff --git a/input/stage01/setup b/input/stage01/setup new file mode 100755 index 0000000..73c07ae --- /dev/null +++ b/input/stage01/setup @@ -0,0 +1,9 @@ +#!/usr/bin/env bash +echo $(head -c4 "/etc/hostname" +apt -y update +apt -y upgrade +apt -y install keyboard-configuration +apt -y install "$OPUS_LINUX" grub2 sudo network-manager python3 +apt -y install --download-only console-setup locales tzdata +apt -y autoclean +rm /setup \ No newline at end of file diff --git a/input/stage02/etc/skel/.bash_profile b/input/stage02/etc/skel/.bash_profile new file mode 100755 index 0000000..357bf35 --- /dev/null +++ b/input/stage02/etc/skel/.bash_profile @@ -0,0 +1,3 @@ +#!/usr/bin/env bash +echo +echo Welcome. Use \"startx\" to start the graphical desktop environment. diff --git a/input/stage02/setup b/input/stage02/setup new file mode 100755 index 0000000..b73803f --- /dev/null +++ b/input/stage02/setup @@ -0,0 +1,4 @@ +#!/usr/bin/env bash +apt -y install xorg xfce4 xfce4-*-plugin xfce4-power-manager mousepad +apt -y autoclean +rm /setup \ No newline at end of file diff --git a/input/stage98/bin/login b/input/stage98/bin/login new file mode 100755 index 0000000..0f59289 --- /dev/null +++ b/input/stage98/bin/login @@ -0,0 +1,123 @@ +#!/usr/bin/env python3 +# This script is ran when booting into the OS, and the setup isn't finished +import os +import traceback +import subprocess +debug = False +os.environ["PATH"] = "/sbin:/usr/sbin:/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games" + +def procWait(proc): + rtn = proc.wait() + if debug: print(rtn) + if rtn != 0: raise processError + +def call(*args,**kwargs): + if debug: print(str(args[0])) + proc = subprocess.Popen(*args,**kwargs) + procWait(proc) + +def callo(*args,**kwargs): + data = b"" + proc = subprocess.Popen(*args,**kwargs,stdout=subprocess.PIPE) + while True: + b = proc.stdout.read() + if b == b"": break + data += b + procWait(proc) + return data.decode("utf-8") + +def mchoice(choices): + while True: + choice = input("Choice: ").lower() + if not choice in choices: continue + return choice + +def main(): + while True: + print("Welcome to opus-dvn.") + print("1: Finish installation") + print("2: Clone to other device") + print("3: Open bash") + print("4: Shut down") + choice = mchoice(["1","2","3","4"]) + if choice == "1": + if os.path.isfile("/isRawImage"): + print("Resizing / to fill disk...") + dev = callo(["findmnt","-n","-o","SOURCE","/"]).strip("\t\r\n") + disk = dev[:-1] + part = dev[-1] + call(["growpart",disk,part]) + call(["resize2fs",dev]) + os.remove("/isRawImage") + call(["dpkg-reconfigure","keyboard-configuration"]) + call(["apt","install","console-setup","locales","tzdata","--yes"]) + call(["dpkg-reconfigure","locales"]) + call(["dpkg-reconfigure","tzdata"]) + + print("") + hostname = input("Hostname: ") + with open("/etc/hosts","w",encoding="utf-8") as fh: + fh.write("""\ +127.0.0.1 localhost +127.0.1.1 $HOSTNAME + +# The following lines are desirable for IPv6 capable hosts +::1 localhost ip6-localhost ip6-loopback +ff02::1 ip6-allnodes +ff02::2 ip6-allrouters\ +""".replace("$HOSTNAME",hostname) + ) + with open("/etc/hostname","w",encoding="utf-8") as fh: + fh.write(hostname) + os.environ["HOSTNAME"] = hostname + + print("") + print("Configure your network now, using nmtui? (y/n)") + if mchoice(["y","n"]) == "y": call(["nmtui"]) + + print("") + call(["groupadd","-f","sudo"]) + username = False + while True: + username = input("First user (Administrator): ").lower().strip(" ") + if username == "root": continue + try: + call(["id","-u",username]) + except: + try: + call(["adduser",username]) + except: + try: + call(["deluser","--remove-home",username]) + except: + continue + + try: + call(["usermod","-a","-G","sudo",username]) + except: + print("Warning: Couldn't add user to sudo group!") + break + + print("") + print("Booting into new environment ...") + os.remove("/bin/login") + os.rename("/bin/login.bak","/bin/login") + return + + if choice == "2": + print("Not implemented.") + continue + + if choice == "3": + call(["bash"]) + return + + if choice == "4": + call(["poweroff"]) + return + +try: + main() +except: + print(traceback.format_exc()) + input("Press RETURN to quit.") diff --git a/input/stage98/etc/skel/.config/Mousepad/accels.scm b/input/stage98/etc/skel/.config/Mousepad/accels.scm new file mode 100644 index 0000000..3d6b9e0 --- /dev/null +++ b/input/stage98/etc/skel/.config/Mousepad/accels.scm @@ -0,0 +1,100 @@ +; mousepad GtkAccelMap rc-file -*- scheme -*- +; this file is an automated accelerator map dump +; +; (gtk_accel_path "/win.document.tab.tab-size" "") +; (gtk_accel_path "/win.edit.convert.spaces-to-tabs" "") +; (gtk_accel_path "/win.edit.move-selection.line-up" "Page_Up") +; (gtk_accel_path "/app.preferences.view.highlight-current-line" "") +; (gtk_accel_path "/win.preferences.window.statusbar-visible" "") +; (gtk_accel_path "/win.search.find-and-replace" "r") +; (gtk_accel_path "/win.textview.menubar" "") +; (gtk_accel_path "/win.edit.preferences" "") +; (gtk_accel_path "/win.edit.convert.to-lowercase" "") +; (gtk_accel_path "/win.edit.convert.transpose" "t") +; (gtk_accel_path "/win.document.go-to-tab(4)" "5") +; (gtk_accel_path "/win.edit.undo" "z") +; (gtk_accel_path "/win.file.save-as" "s") +; (gtk_accel_path "/win.edit.convert.tabs-to-spaces" "") +; (gtk_accel_path "/win.file.save-all" "") +; (gtk_accel_path "/app.preferences.view.show-whitespace.inside" "") +; (gtk_accel_path "/win.edit.duplicate-line-selection" "") +; (gtk_accel_path "/win.preferences.window.toolbar-visible" "") +; (gtk_accel_path "/win.view.fullscreen" "F11") +; (gtk_accel_path "/win.document.previous-tab" "Page_Up") +; (gtk_accel_path "/app.preferences.window.path-in-title" "") +; (gtk_accel_path "/win.file.new-window" "n") +; (gtk_accel_path "/win.view.select-font" "") +; (gtk_accel_path "/app.preferences.view.show-whitespace" "") +; (gtk_accel_path "/win.help.about" "") +; (gtk_accel_path "/app.preferences.view.use-default-monospace-font" "") +; (gtk_accel_path "/win.document.go-to-tab(5)" "6") +; (gtk_accel_path "/win.file.new" "n") +; (gtk_accel_path "/win.file.save" "s") +; (gtk_accel_path "/app.preferences.window.statusbar-visible" "") +; (gtk_accel_path "/win.search.find-previous" "g") +; (gtk_accel_path "/app.preferences.window.remember-state" "") +; (gtk_accel_path "/win.preferences.window.menubar-visible" "m") +; (gtk_accel_path "/app.preferences.window.remember-size" "") +; (gtk_accel_path "/win.file.detach-tab" "d") +; (gtk_accel_path "/app.state.search.highlight-all" "") +; (gtk_accel_path "/win.edit.paste" "v") +; (gtk_accel_path "/app.preferences.view.show-whitespace.leading" "") +; (gtk_accel_path "/win.edit.copy" "c") +; (gtk_accel_path "/win.document.go-to-tab(6)" "7") +; (gtk_accel_path "/win.edit.move-selection.line-down" "Page_Down") +; (gtk_accel_path "/win.file.open-recent.new" "") +; (gtk_accel_path "/win.file.close-window" "w") +; (gtk_accel_path "/win.file.new-from-template.new" "") +; (gtk_accel_path "/win.edit.convert.strip-trailing-spaces" "") +; (gtk_accel_path "/win.edit.paste-special.paste-from-history" "") +; (gtk_accel_path "/win.edit.convert.to-title-case" "") +; (gtk_accel_path "/app.preferences.window.always-show-tabs" "") +; (gtk_accel_path "/win.document.go-to-tab(0)" "1") +; (gtk_accel_path "/win.search.find" "f") +; (gtk_accel_path "/win.document.go-to-tab(7)" "8") +; (gtk_accel_path "/app.quit" "q") +; (gtk_accel_path "/win.file.close-tab" "w") +; (gtk_accel_path "/win.edit.increase-indent" "i") +; (gtk_accel_path "/app.preferences.view.show-line-endings" "") +; (gtk_accel_path "/win.edit.delete-selection" "Delete") +; (gtk_accel_path "/win.document.filetype" "") +; (gtk_accel_path "/win.edit.delete-line" "Delete") +; (gtk_accel_path "/win.document.viewer-mode" "") +; (gtk_accel_path "/app.preferences.view.show-whitespace.trailing" "") +; (gtk_accel_path "/win.file.reload" "") +; (gtk_accel_path "/win.document.go-to-tab(8)" "9") +; (gtk_accel_path "/win.document.go-to-tab(1)" "2") +; (gtk_accel_path "/win.document.line-ending" "") +; (gtk_accel_path "/win.search.go-to" "l") +; (gtk_accel_path "/win.file.new-from-template" "") +; (gtk_accel_path "/app.preferences.view.color-scheme" "") +; (gtk_accel_path "/win.file.open-recent" "") +; (gtk_accel_path "/win.edit.paste-special.paste-as-column" "") +; (gtk_accel_path "/app.preferences.window.remember-position" "") +; (gtk_accel_path "/app.preferences.view.show-right-margin" "") +; (gtk_accel_path "/win.edit.cut" "x") +; (gtk_accel_path "/win.search.find-next" "g") +; (gtk_accel_path "/app.preferences.view.insert-spaces" "") +; (gtk_accel_path "/app.preferences.view.word-wrap" "") +; (gtk_accel_path "/win.edit.decrease-indent" "u") +; (gtk_accel_path "/win.increase-font-size" "plus") +; (gtk_accel_path "/app.preferences.view.match-braces" "") +; (gtk_accel_path "/win.document.go-to-tab(2)" "3") +; (gtk_accel_path "/app.preferences.view.show-line-numbers" "") +; (gtk_accel_path "/app.preferences.view.auto-indent" "") +; (gtk_accel_path "/win.file.open" "o") +; (gtk_accel_path "/win.decrease-font-size" "minus") +; (gtk_accel_path "/win.file.print" "p") +; (gtk_accel_path "/win.document.next-tab" "Page_Down") +; (gtk_accel_path "/win.edit.select-all" "a") +; (gtk_accel_path "/win.edit.convert.to-uppercase" "") +; (gtk_accel_path "/win.document.go-to-tab" "") +; (gtk_accel_path "/win.file.open-recent.clear-history" "") +; (gtk_accel_path "/win.edit.convert.to-opposite-case" "u") +; (gtk_accel_path "/win.document" "") +; (gtk_accel_path "/app.preferences.window.cycle-tabs" "") +; (gtk_accel_path "/win.help.contents" "F1") +; (gtk_accel_path "/win.document.go-to-tab(3)" "4") +; (gtk_accel_path "/win.edit.redo" "y") +; (gtk_accel_path "/win.document.write-unicode-bom" "") +; (gtk_accel_path "/app.preferences.window.toolbar-visible" "") diff --git a/input/stage98/etc/skel/.config/Thunar/accels.scm b/input/stage98/etc/skel/.config/Thunar/accels.scm new file mode 100644 index 0000000..c31e3bc --- /dev/null +++ b/input/stage98/etc/skel/.config/Thunar/accels.scm @@ -0,0 +1,92 @@ +; Thunar GtkAccelMap rc-file -*- scheme -*- +; this file is an automated accelerator map dump +; +; (gtk_accel_path "/ThunarLauncher/delete-3" "KP_Delete") +; (gtk_accel_path "/ThunarLauncher/delete" "") +; (gtk_accel_path "/ThunarStandardView/invert-selection" "") +; (gtk_accel_path "/ThunarLauncher/open-in-new-tab" "p") +; (gtk_accel_path "/ThunarLauncher/delete-2" "Delete") +; (gtk_accel_path "/ThunarWindow/zoom-in" "KP_Add") +; (gtk_accel_path "/ThunarWindow/empty-trash" "") +; (gtk_accel_path "/ThunarLauncher/open" "o") +; (gtk_accel_path "/ThunarWindow/reload" "r") +; (gtk_accel_path "/ThunarWindow/view-side-pane-menu" "") +; (gtk_accel_path "/ThunarStandardView/sort-ascending" "") +; (gtk_accel_path "/ThunarWindow/open-network" "") +; (gtk_accel_path "/ThunarWindow/contents/help-menu" "") +; (gtk_accel_path "/ThunarLauncher/move-to-trash" "") +; (gtk_accel_path "/ThunarStandardView/back-alt" "BackSpace") +; (gtk_accel_path "/ThunarLauncher/paste" "v") +; (gtk_accel_path "/ThunarWindow/switch-next-tab" "Page_Down") +; (gtk_accel_path "/ThunarWindow/open-file-menu" "F10") +; (gtk_accel_path "/ThunarWindow/view-as-compact-list" "3") +; (gtk_accel_path "/ThunarWindow/about" "") +; (gtk_accel_path "/ThunarWindow/open-computer" "") +; (gtk_accel_path "/ThunarWindow/clear-directory-specific-settings" "") +; (gtk_accel_path "/ThunarWindow/open-file-system" "") +; (gtk_accel_path "/ThunarWindow/open-parent" "Up") +; (gtk_accel_path "/ThunarWindow/view-menu" "") +; (gtk_accel_path "/ThunarStandardView/properties" "Return") +; (gtk_accel_path "/ThunarLauncher/open-in-new-window" "o") +; (gtk_accel_path "/ThunarStandardView/back" "Left") +; (gtk_accel_path "/ThunarLauncher/trash-delete" "Delete") +; (gtk_accel_path "/ThunarWindow/sendto-menu" "") +; (gtk_accel_path "/ThunarWindow/reload-alt" "F5") +; (gtk_accel_path "/ThunarWindow/zoom-out-alt" "minus") +; (gtk_accel_path "/ThunarStandardView/select-by-pattern" "s") +; (gtk_accel_path "/ThunarStandardView/configure-columns" "") +; (gtk_accel_path "/ThunarStandardView/create-document" "") +; (gtk_accel_path "/ThunarWindow/close-tab" "w") +; (gtk_accel_path "/ThunarWindow/view-side-pane-tree" "e") +; (gtk_accel_path "/ThunarShortcutsPane/sendto-shortcuts" "") +; (gtk_accel_path "/ThunarStandardView/rename" "F2") +; (gtk_accel_path "/ThunarWindow/toggle-side-pane" "F9") +; (gtk_accel_path "/ThunarWindow/open-home" "Home") +; (gtk_accel_path "/ThunarWindow/open-location-alt" "d") +; (gtk_accel_path "/ThunarWindow/open-templates" "") +; (gtk_accel_path "/ThunarLauncher/execute" "") +; (gtk_accel_path "/ThunarWindow/close-window" "q") +; (gtk_accel_path "/ThunarLauncher/cut" "x") +; (gtk_accel_path "/ThunarLauncher/sendto-desktop" "") +; (gtk_accel_path "/ThunarWindow/zoom-in-alt2" "equal") +; (gtk_accel_path "/ThunarWindow/view-location-selector-toolbar" "") +; (gtk_accel_path "/ThunarStandardView/select-all-files" "a") +; (gtk_accel_path "/ThunarLauncher/open-with-other" "") +; (gtk_accel_path "/ThunarWindow/zoom-out" "KP_Subtract") +; (gtk_accel_path "/ThunarStandardView/duplicate" "") +; (gtk_accel_path "/ThunarWindow/view-side-pane-shortcuts" "b") +; (gtk_accel_path "/ThunarWindow/edit-menu" "") +; (gtk_accel_path "/ThunarWindow/contents" "F1") +; (gtk_accel_path "/ThunarWindow/preferences" "") +; (gtk_accel_path "/ThunarWindow/zoom-in-alt1" "plus") +; (gtk_accel_path "/ThunarWindow/switch-previous-tab" "Page_Up") +; (gtk_accel_path "/ThunarStandardView/sort-by-type" "") +; (gtk_accel_path "/ThunarWindow/view-location-selector-menu" "") +; (gtk_accel_path "/ThunarWindow/view-statusbar" "") +; (gtk_accel_path "/ThunarWindow/close-all-windows" "w") +; (gtk_accel_path "/ThunarWindow/open-trash" "") +; (gtk_accel_path "/ThunarLauncher/restore" "") +; (gtk_accel_path "/ThunarWindow/open-desktop" "") +; (gtk_accel_path "/ThunarStandardView/arrange-items-menu" "") +; (gtk_accel_path "/ThunarStandardView/create-folder" "n") +; (gtk_accel_path "/ThunarWindow/open-location" "l") +; (gtk_accel_path "/ThunarWindow/view-menubar" "m") +; (gtk_accel_path "/ThunarWindow/zoom-reset-alt" "0") +; (gtk_accel_path "/ThunarWindow/view-as-detailed-list" "2") +; (gtk_accel_path "/ThunarWindow/view-as-icons" "1") +; (gtk_accel_path "/ThunarWindow/new-window" "n") +; (gtk_accel_path "/ThunarStandardView/forward" "Right") +; (gtk_accel_path "/ThunarLauncher/copy" "c") +; (gtk_accel_path "/ThunarWindow/file-menu" "") +; (gtk_accel_path "/ThunarStandardView/make-link" "") +; (gtk_accel_path "/ThunarStandardView/sort-descending" "") +; (gtk_accel_path "/ThunarWindow/new-tab" "t") +; (gtk_accel_path "/ThunarWindow/go-menu" "") +; (gtk_accel_path "/ThunarStandardView/sort-by-size" "") +; (gtk_accel_path "/ThunarStandardView/sort-by-mtime" "") +; (gtk_accel_path "/ThunarWindow/view-location-selector-pathbar" "") +; (gtk_accel_path "/ThunarWindow/show-hidden" "h") +; (gtk_accel_path "/ThunarStandardView/sort-by-name" "") +; (gtk_accel_path "/ThunarWindow/zoom-reset" "KP_0") +; (gtk_accel_path "/ThunarLauncher/trash-delete-2" "KP_Delete") +; (gtk_accel_path "/ThunarWindow/detach-tab" "") diff --git a/input/stage98/etc/skel/.config/Thunar/uca.xml b/input/stage98/etc/skel/.config/Thunar/uca.xml new file mode 100644 index 0000000..93d4cbc --- /dev/null +++ b/input/stage98/etc/skel/.config/Thunar/uca.xml @@ -0,0 +1,13 @@ + + + + utilities-terminal + Open Terminal Here + 1651766956100690-1 + exo-open --working-directory %f --launch TerminalEmulator + Example for a custom action + * + + + + diff --git a/input/stage98/etc/skel/.config/dconf/user b/input/stage98/etc/skel/.config/dconf/user new file mode 100644 index 0000000000000000000000000000000000000000..53174a5ac92b9a5391bc2e332e4ee8040b0ec33e GIT binary patch literal 1307 zcmYk5O-K}B7{^D`^=tE6(>6gUDAZv+1X^7Lg@UZ4ERgIlJM-?&i#zi!Gqdhe5z)ym zVJGWQ1a+`Z7Q_~GFfa(};6cKoLx;ZTi%5eYqW=GBMPK;w|G&>Z`@A3XKKoA?o;2J* zD~>j3^QLgJD^`q^LP>d%2y`Qrn3HNyQzQzl1NEQ*G=Ub-3bt&Z9e!((`IVz1tjqOl zv`MWKx*Z&U7rVq-^cC8$)&uPYg_F1LKtf-Q`~ge`!B9(oH_t)O{9))g_*wYzjrHkU zk)Ma20oRv@Z*NANz6$Xv=w*<9*&X4!^yR2?1^NKo82!}Fv(Pg>4_yF@d!5IuL*Ilt z%h2~AIux0Jgr4=kW3mFq?mg||e(0l!Yh^e$xX^d8k#Ty)+n_P9biY*li$Pz4b+}+Bk`dY+ip?AT)4u5m;bIbw z_21beeCt(!@7k6rI}HNe%z7TG>1pW-{D6VFNri}OIAP?N;rgBZn&wYR!L>NpPuPCg zQ|uA;5c`S!lTVt0X*{o^T;*pBQ|Rj@53R+*qK=W5jyx?aWG76OR-W#gw!qRVk(QHE z;WWNu1g5PgJQVV|zc}w+x`FVL2w^c?P1xs-%K9Q>SX{pju-7u4ND7=0|Bdrb`7Qz@ zq35I(*zi1uCT+p%pnbyxsWQTqZc2BQRlJw~myO+EJ6@pM$`QJ7EiECE%0rHC34bC` z8LrJT6*b6!3S$fVhGVmNYj~^I8cxQYIYx_FSk0yOv<-(7nyICh8 Iyzu=00Qtk~!vFvP literal 0 HcmV?d00001 diff --git a/input/stage98/etc/skel/.config/user-dirs.dirs b/input/stage98/etc/skel/.config/user-dirs.dirs new file mode 100644 index 0000000..7f9a959 --- /dev/null +++ b/input/stage98/etc/skel/.config/user-dirs.dirs @@ -0,0 +1,15 @@ +# This file is written by xdg-user-dirs-update +# If you want to change or add directories, just edit the line you're +# interested in. All local changes will be retained on the next run. +# Format is XDG_xxx_DIR="$HOME/yyy", where yyy is a shell-escaped +# homedir-relative path, or XDG_xxx_DIR="/yyy", where /yyy is an +# absolute path. No other format is supported. +# +XDG_DESKTOP_DIR="$HOME/Desktop" +XDG_DOWNLOAD_DIR="$HOME/Downloads" +XDG_TEMPLATES_DIR="$HOME/Templates" +XDG_PUBLICSHARE_DIR="$HOME/Public" +XDG_DOCUMENTS_DIR="$HOME/Documents" +XDG_MUSIC_DIR="$HOME/Music" +XDG_PICTURES_DIR="$HOME/Pictures" +XDG_VIDEOS_DIR="$HOME/Videos" diff --git a/input/stage98/etc/skel/.config/xfce4/desktop/icons.screen.latest.rc b/input/stage98/etc/skel/.config/xfce4/desktop/icons.screen.latest.rc new file mode 120000 index 0000000..d1d50da --- /dev/null +++ b/input/stage98/etc/skel/.config/xfce4/desktop/icons.screen.latest.rc @@ -0,0 +1 @@ +/home/default/.config/xfce4/desktop/icons.screen0-1008x725.rc \ No newline at end of file diff --git a/input/stage98/etc/skel/.config/xfce4/desktop/icons.screen0-1008x724.rc b/input/stage98/etc/skel/.config/xfce4/desktop/icons.screen0-1008x724.rc new file mode 100644 index 0000000..32d61c3 --- /dev/null +++ b/input/stage98/etc/skel/.config/xfce4/desktop/icons.screen0-1008x724.rc @@ -0,0 +1,11 @@ +[xfdesktop-version-4.10.3+-rcfile_format] +4.10.3+=true + +[Trash] +row=0 +col=0 + +[/home/default] +row=1 +col=0 + diff --git a/input/stage98/etc/skel/.config/xfce4/desktop/icons.screen0-1008x725.rc b/input/stage98/etc/skel/.config/xfce4/desktop/icons.screen0-1008x725.rc new file mode 100644 index 0000000..7dbe616 --- /dev/null +++ b/input/stage98/etc/skel/.config/xfce4/desktop/icons.screen0-1008x725.rc @@ -0,0 +1,15 @@ +[xfdesktop-version-4.10.3+-rcfile_format] +4.10.3+=true + +[Trash] +row=0 +col=0 + +[/home/default] +row=1 +col=0 + +[/] +row=2 +col=0 + diff --git a/input/stage98/etc/skel/.config/xfce4/panel/whiskermenu-7.rc b/input/stage98/etc/skel/.config/xfce4/panel/whiskermenu-7.rc new file mode 100644 index 0000000..664e226 --- /dev/null +++ b/input/stage98/etc/skel/.config/xfce4/panel/whiskermenu-7.rc @@ -0,0 +1,81 @@ +favorites=xfce4-web-browser.desktop,xfce4-mail-reader.desktop,xfce4-file-manager.desktop,xfce4-terminal-emulator.desktop +recent= +button-title=Start +button-icon=xfce4-whiskermenu +button-single-row=false +show-button-title=true +show-button-icon=true +launcher-show-name=true +launcher-show-description=true +launcher-show-tooltip=true +item-icon-size=1 +hover-switch-category=false +category-show-name=true +category-icon-size=1 +load-hierarchy=false +view-as-icons=false +default-category=0 +recent-items-max=0 +favorites-in-recent=true +position-search-alternate=true +position-commands-alternate=false +position-categories-alternate=true +stay-on-focus-out=false +confirm-session-command=true +menu-width=399 +menu-height=500 +menu-opacity=100 +command-settings=xfce4-settings-manager +show-command-settings=true +command-lockscreen=xflock4 +show-command-lockscreen=true +command-switchuser=dm-tool switch-to-greeter +show-command-switchuser=false +command-logoutuser=xfce4-session-logout --logout --fast +show-command-logoutuser=false +command-restart=xfce4-session-logout --reboot --fast +show-command-restart=false +command-shutdown=xfce4-session-logout --halt --fast +show-command-shutdown=false +command-suspend=xfce4-session-logout --suspend +show-command-suspend=false +command-hibernate=xfce4-session-logout --hibernate +show-command-hibernate=false +command-logout=xfce4-session-logout +show-command-logout=true +command-menueditor=menulibre +show-command-menueditor=true +command-profile=mugshot +show-command-profile=true +search-actions=5 + +[action0] +name=Man Pages +pattern=# +command=exo-open --launch TerminalEmulator man %s +regex=false + +[action1] +name=Web Search +pattern=? +command=exo-open --launch WebBrowser https://duckduckgo.com/?q=%u +regex=false + +[action2] +name=Wikipedia +pattern=!w +command=exo-open --launch WebBrowser https://en.wikipedia.org/wiki/%u +regex=false + +[action3] +name=Run in Terminal +pattern=! +command=exo-open --launch TerminalEmulator %s +regex=false + +[action4] +name=Open URI +pattern=^(file|http|https):\\/\\/(.*)$ +command=exo-open \\0 +regex=true + diff --git a/input/stage98/etc/skel/.config/xfce4/terminal/accels.scm b/input/stage98/etc/skel/.config/xfce4/terminal/accels.scm new file mode 100644 index 0000000..673bbea --- /dev/null +++ b/input/stage98/etc/skel/.config/xfce4/terminal/accels.scm @@ -0,0 +1,58 @@ +; xfce4-terminal GtkAccelMap rc-file -*- scheme -*- +; this file is an automated accelerator map dump +; +(gtk_accel_path "/terminal-window/goto-tab-2" "2") +(gtk_accel_path "/terminal-window/goto-tab-6" "6") +; (gtk_accel_path "/terminal-window/copy-input" "") +; (gtk_accel_path "/terminal-window/close-other-tabs" "") +; (gtk_accel_path "/terminal-window/move-tab-right" "Page_Down") +(gtk_accel_path "/terminal-window/goto-tab-7" "7") +; (gtk_accel_path "/terminal-window/set-title-color" "") +; (gtk_accel_path "/terminal-window/edit-menu" "") +; (gtk_accel_path "/terminal-window/zoom-menu" "") +(gtk_accel_path "/terminal-window/goto-tab-1" "1") +; (gtk_accel_path "/terminal-window/fullscreen" "F11") +; (gtk_accel_path "/terminal-window/read-only" "") +(gtk_accel_path "/terminal-window/goto-tab-5" "5") +; (gtk_accel_path "/terminal-window/preferences" "") +; (gtk_accel_path "/terminal-window/reset-and-clear" "") +; (gtk_accel_path "/terminal-window/about" "") +(gtk_accel_path "/terminal-window/goto-tab-4" "4") +; (gtk_accel_path "/terminal-window/close-window" "q") +; (gtk_accel_path "/terminal-window/reset" "") +; (gtk_accel_path "/terminal-window/save-contents" "") +(gtk_accel_path "/terminal-window/toggle-menubar" "F10") +; (gtk_accel_path "/terminal-window/copy" "c") +; (gtk_accel_path "/terminal-window/copy-html" "") +; (gtk_accel_path "/terminal-window/last-active-tab" "") +; (gtk_accel_path "/terminal-window/show-borders" "") +; (gtk_accel_path "/terminal-window/view-menu" "") +; (gtk_accel_path "/terminal-window/detach-tab" "d") +; (gtk_accel_path "/terminal-window/scroll-on-output" "") +; (gtk_accel_path "/terminal-window/show-toolbar" "") +; (gtk_accel_path "/terminal-window/next-tab" "Page_Down") +; (gtk_accel_path "/terminal-window/tabs-menu" "") +; (gtk_accel_path "/terminal-window/search-next" "") +; (gtk_accel_path "/terminal-window/search-prev" "") +; (gtk_accel_path "/terminal-window/undo-close-tab" "") +; (gtk_accel_path "/terminal-window/set-title" "s") +; (gtk_accel_path "/terminal-window/contents" "F1") +; (gtk_accel_path "/terminal-window/zoom-reset" "0") +; (gtk_accel_path "/terminal-window/close-tab" "w") +; (gtk_accel_path "/terminal-window/new-tab" "t") +; (gtk_accel_path "/terminal-window/new-window" "n") +; (gtk_accel_path "/terminal-window/terminal-menu" "") +; (gtk_accel_path "/terminal-window/show-menubar" "") +; (gtk_accel_path "/terminal-window/select-all" "a") +; (gtk_accel_path "/terminal-window/paste" "v") +(gtk_accel_path "/terminal-window/goto-tab-9" "9") +; (gtk_accel_path "/terminal-window/move-tab-left" "Page_Up") +; (gtk_accel_path "/terminal-window/search" "f") +; (gtk_accel_path "/terminal-window/file-menu" "") +; (gtk_accel_path "/terminal-window/prev-tab" "Page_Up") +; (gtk_accel_path "/terminal-window/paste-selection" "") +; (gtk_accel_path "/terminal-window/zoom-in" "plus") +; (gtk_accel_path "/terminal-window/zoom-out" "minus") +(gtk_accel_path "/terminal-window/goto-tab-8" "8") +; (gtk_accel_path "/terminal-window/help-menu" "") +(gtk_accel_path "/terminal-window/goto-tab-3" "3") diff --git a/input/stage98/etc/skel/.config/xfce4/terminal/terminalrc b/input/stage98/etc/skel/.config/xfce4/terminal/terminalrc new file mode 100644 index 0000000..179a9ee --- /dev/null +++ b/input/stage98/etc/skel/.config/xfce4/terminal/terminalrc @@ -0,0 +1,30 @@ +[Configuration] +FontUseSystem=TRUE +MiscAlwaysShowTabs=FALSE +MiscBell=FALSE +MiscBellUrgent=FALSE +MiscBordersDefault=TRUE +MiscCursorBlinks=FALSE +MiscCursorShape=TERMINAL_CURSOR_SHAPE_BLOCK +MiscDefaultGeometry=80x24 +MiscInheritGeometry=FALSE +MiscMenubarDefault=FALSE +MiscMouseAutohide=FALSE +MiscMouseWheelZoom=TRUE +MiscToolbarDefault=FALSE +MiscConfirmClose=TRUE +MiscCycleTabs=TRUE +MiscTabCloseButtons=TRUE +MiscTabCloseMiddleClick=TRUE +MiscTabPosition=GTK_POS_TOP +MiscHighlightUrls=TRUE +MiscMiddleClickOpensUri=FALSE +MiscCopyOnSelect=FALSE +MiscShowRelaunchDialog=TRUE +MiscRewrapOnResize=TRUE +MiscUseShiftArrowsToScroll=FALSE +MiscSlimTabs=FALSE +MiscNewTabAdjacent=FALSE +MiscSearchDialogOpacity=100 +MiscShowUnsafePasteDialog=TRUE + diff --git a/input/stage98/etc/skel/.config/xfce4/xfconf/xfce-perchannel-xml/displays.xml b/input/stage98/etc/skel/.config/xfce4/xfconf/xfce-perchannel-xml/displays.xml new file mode 100644 index 0000000..0756ede --- /dev/null +++ b/input/stage98/etc/skel/.config/xfce4/xfconf/xfce-perchannel-xml/displays.xml @@ -0,0 +1,43 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/input/stage98/etc/skel/.config/xfce4/xfconf/xfce-perchannel-xml/keyboard-layout.xml b/input/stage98/etc/skel/.config/xfce4/xfconf/xfce-perchannel-xml/keyboard-layout.xml new file mode 100644 index 0000000..4fc076e --- /dev/null +++ b/input/stage98/etc/skel/.config/xfce4/xfconf/xfce-perchannel-xml/keyboard-layout.xml @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/input/stage98/etc/skel/.config/xfce4/xfconf/xfce-perchannel-xml/keyboards.xml b/input/stage98/etc/skel/.config/xfce4/xfconf/xfce-perchannel-xml/keyboards.xml new file mode 100644 index 0000000..9ddc443 --- /dev/null +++ b/input/stage98/etc/skel/.config/xfce4/xfconf/xfce-perchannel-xml/keyboards.xml @@ -0,0 +1,7 @@ + + + + + + + diff --git a/input/stage98/etc/skel/.config/xfce4/xfconf/xfce-perchannel-xml/thunar.xml b/input/stage98/etc/skel/.config/xfce4/xfconf/xfce-perchannel-xml/thunar.xml new file mode 100644 index 0000000..ade2c3f --- /dev/null +++ b/input/stage98/etc/skel/.config/xfce4/xfconf/xfce-perchannel-xml/thunar.xml @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/input/stage98/etc/skel/.config/xfce4/xfconf/xfce-perchannel-xml/xfce4-desktop.xml b/input/stage98/etc/skel/.config/xfce4/xfconf/xfce-perchannel-xml/xfce4-desktop.xml new file mode 100644 index 0000000..ba6d1d6 --- /dev/null +++ b/input/stage98/etc/skel/.config/xfce4/xfconf/xfce-perchannel-xml/xfce4-desktop.xml @@ -0,0 +1,68 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/input/stage98/etc/skel/.config/xfce4/xfconf/xfce-perchannel-xml/xfce4-keyboard-shortcuts.xml b/input/stage98/etc/skel/.config/xfce4/xfconf/xfce-perchannel-xml/xfce4-keyboard-shortcuts.xml new file mode 100644 index 0000000..89465f1 --- /dev/null +++ b/input/stage98/etc/skel/.config/xfce4/xfconf/xfce-perchannel-xml/xfce4-keyboard-shortcuts.xml @@ -0,0 +1,152 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/input/stage98/etc/skel/.config/xfce4/xfconf/xfce-perchannel-xml/xfce4-panel.xml b/input/stage98/etc/skel/.config/xfce4/xfconf/xfce-perchannel-xml/xfce4-panel.xml new file mode 100644 index 0000000..65c42dd --- /dev/null +++ b/input/stage98/etc/skel/.config/xfce4/xfconf/xfce-perchannel-xml/xfce4-panel.xml @@ -0,0 +1,52 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/input/stage98/etc/skel/.config/xfce4/xfconf/xfce-perchannel-xml/xfce4-power-manager.xml b/input/stage98/etc/skel/.config/xfce4/xfconf/xfce-perchannel-xml/xfce4-power-manager.xml new file mode 100644 index 0000000..2757117 --- /dev/null +++ b/input/stage98/etc/skel/.config/xfce4/xfconf/xfce-perchannel-xml/xfce4-power-manager.xml @@ -0,0 +1,11 @@ + + + + + + + + + + + diff --git a/input/stage98/etc/skel/.config/xfce4/xfconf/xfce-perchannel-xml/xfce4-session.xml b/input/stage98/etc/skel/.config/xfce4/xfconf/xfce-perchannel-xml/xfce4-session.xml new file mode 100644 index 0000000..f3eaf08 --- /dev/null +++ b/input/stage98/etc/skel/.config/xfce4/xfconf/xfce-perchannel-xml/xfce4-session.xml @@ -0,0 +1,31 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/input/stage98/etc/skel/.config/xfce4/xfconf/xfce-perchannel-xml/xfwm4.xml b/input/stage98/etc/skel/.config/xfce4/xfconf/xfce-perchannel-xml/xfwm4.xml new file mode 100644 index 0000000..3d98867 --- /dev/null +++ b/input/stage98/etc/skel/.config/xfce4/xfconf/xfce-perchannel-xml/xfwm4.xml @@ -0,0 +1,86 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/input/stage98/etc/skel/.config/xfce4/xfconf/xfce-perchannel-xml/xsettings.xml b/input/stage98/etc/skel/.config/xfce4/xfconf/xfce-perchannel-xml/xsettings.xml new file mode 100644 index 0000000..897512c --- /dev/null +++ b/input/stage98/etc/skel/.config/xfce4/xfconf/xfce-perchannel-xml/xsettings.xml @@ -0,0 +1,39 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/input/stage99/isRawImage b/input/stage99/isRawImage new file mode 100644 index 0000000..e69de29 diff --git a/input/stage99/setupdisk b/input/stage99/setupdisk new file mode 100755 index 0000000..a2ceb1e --- /dev/null +++ b/input/stage99/setupdisk @@ -0,0 +1,7 @@ +#!/usr/bin/env bash +apt -y install cloud-utils +apt -y autoclean +grub-install --boot-directory="/boot" --modules=part_msdos "${DISK_LOOP}" +update-grub +update-initramfs -u -k all +rm /setupdisk \ No newline at end of file diff --git a/make-os b/make-os new file mode 100755 index 0000000..e48c031 --- /dev/null +++ b/make-os @@ -0,0 +1,10 @@ +#!/usr/bin/env bash +cd "$(dirname "$(realpath -s "$BASH_SOURCE")")" +source shell +source "env-$1" +make-base # Base image +apply-stage "$OPUS_HOME/input/stage01" "$OPUS_OUTPUT/base" # Packages (non-graphical) +apply-stage "$OPUS_HOME/input/stage02" "$OPUS_OUTPUT/base" # Packages (graphical) +apply-stage "$OPUS_HOME/input/stage98" "$OPUS_OUTPUT/base" # Default configs, etc. +apply-stage "$OPUS_HOME/input/stage99" "$OPUS_OUTPUT/base" # Disk image preparation +make-image "$OPUS_OUTPUT/base" # Disk image \ No newline at end of file diff --git a/path/apply-stage b/path/apply-stage new file mode 100755 index 0000000..4d08b28 --- /dev/null +++ b/path/apply-stage @@ -0,0 +1,16 @@ +#!/usr/bin/env bash +alias cp="cp --reflink=auto" +export STAGE_INPUT="$1" +export STAGE_OUTPUT="$2" +if [ -f "$STAGE_INPUT/bin/login" ]; then + if [ -f "$STAGE_OUTPUT/bin/login.bak" ]; then + rm "$STAGE_OUTPUT/bin/login" + else + mv "$STAGE_OUTPUT/bin/login" "$STAGE_OUTPUT/bin/login.bak" + fi +fi +cp -rf "$STAGE_INPUT/." "$STAGE_OUTPUT" +if [ -f "$STAGE_OUTPUT/setup" ]; then + fchroot "$STAGE_OUTPUT" "/setup" + find "$STAGE_OUTPUT/var/log" -type f -delete +fi \ No newline at end of file diff --git a/path/dupe b/path/dupe new file mode 100755 index 0000000..02b93b1 --- /dev/null +++ b/path/dupe @@ -0,0 +1,2 @@ +#!/usr/bin/env bash +cp --reflink=auto -a "$1" "$2" \ No newline at end of file diff --git a/path/env-amd64 b/path/env-amd64 new file mode 100755 index 0000000..6f97a7d --- /dev/null +++ b/path/env-amd64 @@ -0,0 +1,3 @@ +#!/usr/bin/env bash +export OPUS_ARCH=amd64 +export OPUS_LINUX=linux-image-amd64 \ No newline at end of file diff --git a/path/env-i386 b/path/env-i386 new file mode 100755 index 0000000..fcc59fd --- /dev/null +++ b/path/env-i386 @@ -0,0 +1,3 @@ +#!/usr/bin/env bash +export OPUS_ARCH=i386 +export OPUS_LINUX=linux-image-686 \ No newline at end of file diff --git a/path/fchroot b/path/fchroot new file mode 100755 index 0000000..ff96a79 --- /dev/null +++ b/path/fchroot @@ -0,0 +1,10 @@ +#!/usr/bin/env bash +mount -o bind "/dev" "$1/dev" +mount -o bind "/dev/pts" "$1/dev/pts" +mount -o bind "/sys" "$1/sys" +mount -o bind "/proc" "$1/proc" +chroot "$1" ${@:2} +umount -l "$1/proc" +umount -l "$1/sys" +umount -l "$1/dev/pts" +umount -l "$1/dev" \ No newline at end of file diff --git a/path/make-base b/path/make-base new file mode 100755 index 0000000..3474220 --- /dev/null +++ b/path/make-base @@ -0,0 +1,8 @@ +#!/usr/bin/env bash +if [ -d "$OPUS_OUTPUT/base" ]; then + rm -rf "$OPUS_OUTPUT/base" +fi +mkdir "$OPUS_OUTPUT/base" +debootstrap --arch="$OPUS_ARCH" "$OPUS_DIST" "$OPUS_OUTPUT/base" "$OPUS_URL" +fchroot "$OPUS_OUTPUT/base" apt -y autoclean +find "$OPUS_OUTPUT/base/var/log" -type f -delete \ No newline at end of file diff --git a/path/make-image b/path/make-image new file mode 100755 index 0000000..8c36bef --- /dev/null +++ b/path/make-image @@ -0,0 +1,62 @@ +#!/usr/bin/env bash +export DISK_IMAGE="$OPUS_OUTPUT/${OPUS_NAME}-${OPUS_DIST}-${OPUS_ARCH}_$(date "+%Y.%m.%d-%H.%M.%S").img" +export ROOT_MOUNT="$OPUS_OUTPUT/mount" + +# Get the approximate size required for the image +export DISK_SIZE=$(du -sb "$1" | cut -f1) +# Add 256MB for SWAP, and 700MB for overhead +export DISK_SIZE=$(( $DISK_SIZE + ( 256 * 1000000 ) + ( 700 * 1000000 ) )) +# Add size of additional files +export DISK_SIZE=$(( $DISK_SIZE + $(du -sb "$OPUS_HOME/input/root-image" | cut -f1) )) + +# Create and mount disk +fallocate -l $DISK_SIZE "$DISK_IMAGE" +export DISK_LOOP="$(losetup --show -f -P "$DISK_IMAGE")" + +# Partition disk +( +echo n +echo e +echo +echo +echo +256M +echo t +echo swap +echo n +echo p +echo +echo +echo +echo t +echo +echo linux +echo w +echo +echo +) | fdisk "$DISK_LOOP" + +# Format partions +mkswap "${DISK_LOOP}p1" +mkfs.ext4 "${DISK_LOOP}p2" + +# Mount root +mkdir "$ROOT_MOUNT" +mount "${DISK_LOOP}p2" "$ROOT_MOUNT" + +# Add files +dupe "$1/." "$ROOT_MOUNT" + +# Make fstab +echo "UUID=$(blkid -o value -s UUID "${DISK_LOOP}p1") none swap sw 0 0" >"$ROOT_MOUNT/etc/fstab" +echo "UUID=$(blkid -o value -s UUID "${DISK_LOOP}p2") / ext4 errors=remount-ro 0 1" >>"$ROOT_MOUNT/etc/fstab" + +# Set up GRUB and misc +fchroot "$ROOT_MOUNT" "/setupdisk" + +# Clear logs +find "$ROOT_MOUNT/var/log" -type f -delete + +# Unmount root +umount -l "$ROOT_MOUNT" +rmdir "$ROOT_MOUNT" +losetup -d "$DISK_LOOP" \ No newline at end of file diff --git a/shell b/shell new file mode 100644 index 0000000..8205e60 --- /dev/null +++ b/shell @@ -0,0 +1,22 @@ +#!/usr/bin/env bash +export OPUS_NAME="opus-dvn" +export OPUS_HOME="$(dirname "$(realpath -s "$BASH_SOURCE")")" +export PATH="$OPUS_HOME/path:$PATH" +export OPUS_PID="$BASHPID" +export OPUS_OUTPUT="$OPUS_HOME/output" +export OPUS_URL="http://deb.devuan.org/merged" +export OPUS_DIST="chimaera" +export OPUS_SOURCES="deb http://deb.devuan.org/merged $OPUS_DIST main +# deb-src http://deb.devuan.org/merged $OPUS_DIST main + +deb http://pkgmaster.devuan.org/merged $OPUS_DIST-security main +# deb-src http://pkgmaster.devuan.org/merged $OPUS_DIST-security main + +# chimaera-updates, to get updates before a point release is made; +# see https://www.debian.org/doc/manuals/debian-reference/ch02.en.html#_updates> +# deb http://deb.devuan.org/merged $OPUS_DIST-updates main +# deb-src http://deb.devuan.org/merged $OPUS_DIST-updates main +" +env +echo "" +echo "Environment expanded." \ No newline at end of file