This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bedrock/libexec/busybox sh | |
# | |
# NixOS bootstrap support | |
# | |
# This program is free software; you can redistribute it and/or | |
# modify it under the terms of the GNU General Public License | |
# version 2 as published by the Free Software Foundation. | |
# | |
# Copyright (c) 2016-2018 Daniel Thau <danthau@bedrocklinux.org> | |
# |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* Compile the following against musl-libc's HEAD from git. Run as root. | |
* During the sleep(), look at your process list for zombies (i.e. ps aux | awk | |
* '$8 ~ "Z"') | |
*/ | |
#include <unistd.h> | |
#include <fcntl.h> | |
#include <stdio.h> | |
int main() { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# use vim ex commands in a UNIX pipe | |
# e.g.: | |
# $ printf "foo\nbar\nbaz\n" | vp 'g/^b/d' | |
# foo | |
# | |
vp() { | |
vim - -u NONE -es '+1' "+$*" '+%print' '+:qa!' | tail -n +2 | |
} | |
# use vim normal mode commands in a UNIX pipe |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bedrock/libexec/busybox sh | |
norm_color='\033[2;97m' | |
high_color='\033[0;97m' | |
drawing='__ | |
\ \___ | |
\ _ \ | |
\___/ | |
' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# | |
# Finds redundant Bedrock packages | |
# | |
# Assumes `pmm` is set to mimic apt. Adjust accordingly for other pmm front-ends. | |
pmm-mark showmanual 2>/dev/null | awk '{ | |
if ($2 in pkgs) { | |
redundant[pkgs[$2]] | |
redundant[$0] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/awk -f | |
# | |
# Full Bedrock logo draw in animation | |
# | |
function draw_char(x, y, char, color) { | |
printf(cursor_restore) | |
if (x > 1) { | |
printf("\033["(x-1)"C") | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
norm_color='\033[2;97m' | |
high_color='\033[0;97m' | |
drawing='__ | |
\ \___ | |
\ _ \ | |
\___/ | |
' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
prepare_target() { | |
notice "Setting up ebuild" | |
chroot "$target_dir" emerge-webrsync | |
mkdir -p "$target_dir/etc/portage/repos.conf" | |
cp "$target_dir/usr/share/portage/config/repos.conf" "$target_dir/etc/portage/repos.conf/gentoo.conf" | |
notice "Setting up locale" | |
if [ -n "$LANG" ] && [ "$LANG" != "C" ] | |
then | |
echo "### Added by Bedrock Linux when acquiring this stratum" >> "$target_dir/etc/locale.gen" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ # literal because it's a single-quote string | |
$ echo '$HOME' | |
$HOME | |
$ # interpreted because it's a double-quote string | |
$ echo "$HOME" | |
/home/paradigm | |
$ # interpreted again because it's a double-quote string despite containing single quotes within it | |
$ echo "'$HOME'" | |
'/home/paradigm' | |
$ # to print the literal with the interpreted string, have to escape |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sudo chmod a+rx /bedrock/strata/void-musl/var/db/xbps | |
sudo chmod a+r /bedrock/strata/void-musl/var/db/xbps/pkgdb-0.38.plist |
NewerOlder