Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
alpine
alpine-conf
Commits
cb474e20
Commit
cb474e20
authored
Nov 02, 2016
by
Jakub Jirutka
🇺🇦
Browse files
fix mixed tabs & spaces and surplus empty lines at EOF
parent
9f65b05b
Changes
24
Hide whitespace changes
Inline
Side-by-side
Makefile
View file @
cb474e20
VERSION
:=
3.4.1
sysconfdir
?=
/etc/lbu
sysconfdir
?=
/etc/lbu
PREFIX
?=
...
...
@@ -36,10 +36,10 @@ ETC_LBU_FILES := lbu.conf
GIT_REV
:=
$(
shell
test
-d
.git
&&
git describe
||
echo
exported
)
ifneq
($(GIT_REV), exported)
FULL_VERSION
:=
$(
patsubst
$(PACKAGE)
-%,%,
$(GIT_REV)
)
FULL_VERSION
:=
$(
patsubst
v%,%,
$(FULL_VERSION)
)
FULL_VERSION
:=
$(
patsubst
$(PACKAGE)
-%,%,
$(GIT_REV)
)
FULL_VERSION
:=
$(
patsubst
v%,%,
$(FULL_VERSION)
)
else
FULL_VERSION
:=
$(VERSION)
FULL_VERSION
:=
$(VERSION)
endif
...
...
@@ -88,4 +88,3 @@ uninstall:
clean
:
rm
-rf
$(SCRIPTS)
$(BIN_FILES)
lbu.in
View file @
cb474e20
...
...
@@ -206,7 +206,7 @@ unpack_apkovl() {
return
fi
check_openssl
while
[
$
count
-
lt
3
];
do
while
[
$
count
-
lt
3
];
do
$
OPENSSL
enc
-
d
-$
ENCRYPTION
-
in
"$mnt/$f"
|
tar
\
-
C
"$dest"
-
zx
2
>/
dev
/
null
&&
return
0
count
=$((
$
count
+
1
))
...
...
libalpine.sh.in
View file @
cb474e20
...
...
@@ -98,26 +98,26 @@ is_xen_dom0() {
# list of available network interfaces that aren't part of any bridge or bond
available_ifaces() {
local iflist= ifpath= iface= i=
local iflist= ifpath= iface= i=
if ! [ -d /sys/class/net ]; then
ip link | awk -F: '
$1
~ /^[0-9]+
$/
{printf "
%s
",
$2
}'
return
fi
sorted_ifindexes=
$(
for
i
in
/sys/class/net/
*
/ifindex
;
do
[
-e
"
$i
"
]
||
continue
echo
-e
"
$(
cat
$i
)
\t
$i
"
;
done
|
sort
-n
|
awk
'{print $2}'
)
for i in
$sorted_ifindexes
; do
ifpath=
${
i
%/*
}
iface=
${
ifpath
##*/
}
# skip interfaces that are part of a bond or bridge
if [ -d "
$ifpath
"/master/bonding ] || [ -d "
$ifpath
"/brport ]; then
continue
fi
iflist="
${
iflist
}${
iflist
:+
}
$iface
"
done
echo
$iflist
sorted_ifindexes=
$(
for
i
in
/sys/class/net/
*
/ifindex
;
do
[
-e
"
$i
"
]
||
continue
echo
-e
"
$(
cat
$i
)
\t
$i
"
;
done
|
sort
-n
|
awk
'{print $2}'
)
for i in
$sorted_ifindexes
; do
ifpath=
${
i
%/*
}
iface=
${
ifpath
##*/
}
# skip interfaces that are part of a bond or bridge
if [ -d "
$ifpath
"/master/bonding ] || [ -d "
$ifpath
"/brport ]; then
continue
fi
iflist="
${
iflist
}${
iflist
:+
}
$iface
"
done
echo
$iflist
}
# from OpenBSD installer
...
...
@@ -168,7 +168,7 @@ isin() {
# remove all occurrences of first argument from list formed by
# the remaining arguments
rmel
()
{
local
_a
=
$1
_b
local
_a
=
$1
_b
shift
for
_b
;
do
...
...
@@ -176,17 +176,17 @@ rmel() {
done
}
# Issue a read into the global variable $resp.
# Issue a read into the global variable $resp.
_ask
()
{
local
_redo
=
0
read
resp
case
"
$resp
"
in
!
)
echo
"Type 'exit' to return to setup."
!
)
echo
"Type 'exit' to return to setup."
sh
_redo
=
1
;;
!
*
)
eval
"
${
resp
#?
}
"
!
*
)
eval
"
${
resp
#?
}
"
_redo
=
1
;;
esac
...
...
@@ -266,4 +266,3 @@ ask_which() {
echo
"'
$resp
' is not a valid choice."
done
}
setup-alpine.in
View file @
cb474e20
...
...
@@ -33,7 +33,7 @@ options:
-h Show this help
-q Quick mode. Ask fewer questions.
__EOF__
exit
1
exit
1
}
while
getopts
"af:c:hq"
opt
;
do
...
...
@@ -211,4 +211,3 @@ if [ "$diskmode" != "sys" ]; then
apk cache
sync
fi
fi
setup-apkcache.in
View file @
cb474e20
...
...
@@ -5,7 +5,7 @@ PREFIX=
.
"
$PREFIX
/lib/libalpine.sh"
usage
()
{
cat
<<
__EOF__
cat
<<
__EOF__
usage: setup-apkcache [-h] [DIR]
Setup apk caching.
...
...
@@ -15,7 +15,7 @@ If DIR is not specified user will be asked for location.
options:
-h Show this help
__EOF__
exit
1
exit
1
}
is_mounted
()
{
...
...
@@ -97,9 +97,9 @@ __EOF__
}
while
getopts
"h"
opt
;
do
case
$opt
in
case
$opt
in
h
)
usage
;;
esac
esac
done
shift
$((
$OPTIND
-
1
))
...
...
@@ -165,4 +165,3 @@ case "$cleanup" in
umount
)
umount
$mount
;;
remount
)
mount
-o
remount,ro
$mount
;;
esac
setup-apkrepos.in
View file @
cb474e20
...
...
@@ -158,11 +158,11 @@ __EOF__
}
while
getopts
"fhr"
opt
;
do
case
$opt
in
f
)
JUSTADDFASTEST
=
1
;;
h
)
usage
;;
r
)
JUSTADDRANDOM
=
1
;;
esac
case
$opt
in
f
)
JUSTADDFASTEST
=
1
;;
h
)
usage
;;
r
)
JUSTADDRANDOM
=
1
;;
esac
done
shift
$((
$OPTIND
-
1
))
...
...
setup-bootable.in
View file @
cb474e20
...
...
@@ -98,14 +98,14 @@ find_syslinux_cfg() {
fix_syslinux_kernel
()
{
echo
"Fixing
$syslinux_cfg
: kernel
$1
->
$2
"
sed
-i
-e
"/^
\s
*[Kk][Ee][Rr][Nn][Ee][Ll]
\s
/s|
$1
|
$2
|"
\
"
$destdir
/
$syslinux_cfg
"
"
$destdir
/
$syslinux_cfg
"
}
fix_syslinux_initrd
()
{
echo
"Fixing
$syslinux_cfg
: initrd
$1
->
$2
"
sed
-i
-e
"/^
\s
*[Ii][Nn][Ii][Tt][Rr][Dd]
\s
/s|
$1
|
$2
|"
\
-e
"/^
\s
*[Aa][Pp][Pp][Ee][Nn][Dd]
\s
/s|initrd=
$1
|initrd=
$2
|"
\
"
$destdir
/
$syslinux_cfg
"
"
$destdir
/
$syslinux_cfg
"
}
check_syslinux
()
{
...
...
@@ -408,4 +408,3 @@ else
echo
"Warning: Could not find the parent device for
$dest
"
fi
cleanup_installs
setup-disk.in
View file @
cb474e20
...
...
@@ -903,7 +903,7 @@ ask_disk() {
if
!
[
-b
"/dev/
$i
"
]
;
then
echo
"/dev/
$i
is not a block device"
>
&2
answer
=
fi
fi
done
;;
esac
done
...
...
@@ -912,7 +912,7 @@ ask_disk() {
usage
()
{
cat
<<
__EOF__
usage: setup-disk [-hLqrv] [-k kernelflavor] [-m MODE] [-o apkovl] [-s SWAPSIZE]
[MOUNTPOINT | DISKDEV...]
[MOUNTPOINT | DISKDEV...]
Install alpine on harddisk.
...
...
@@ -946,9 +946,9 @@ __EOF__
kver
=
$(
uname
-r
)
case
$kver
in
*
-rc
[
0-9]
*
)
KERNEL_FLAVOR
=
vanilla
;;
*
-[a-z]
*
)
KERNEL_FLAVOR
=
${
kver
##*-
}
;;
*
)
KERNEL_FLAVOR
=
vanilla
;;
*
-rc
[
0-9]
*
)
KERNEL_FLAVOR
=
vanilla
;;
*
-[a-z]
*
)
KERNEL_FLAVOR
=
${
kver
##*-
}
;;
*
)
KERNEL_FLAVOR
=
vanilla
;;
esac
DISK_MODE
=
...
...
setup-dns.in
View file @
cb474e20
...
...
@@ -4,7 +4,7 @@ PREFIX=
.
"
$PREFIX
/lib/libalpine.sh"
usage
()
{
cat
<<
__EOF__
cat
<<
__EOF__
usage: setup-dns [-h] [-d domain name] [IPADDR...]
Setup
${
ROOT
}
etc/resolv.conf DNS settings
...
...
@@ -15,15 +15,15 @@ options:
The optional IPADDR are a list of DNS servers to use.
__EOF__
exit
1
exit
1
}
while
getopts
"d:n:h"
opt
;
do
case
$opt
in
d
)
DOMAINNAME
=
"
$OPTARG
"
;;
h
)
usage
;;
n
)
NAMESERVERS
=
"
$OPTARG
"
;;
esac
case
$opt
in
d
)
DOMAINNAME
=
"
$OPTARG
"
;;
h
)
usage
;;
n
)
NAMESERVERS
=
"
$OPTARG
"
;;
esac
done
shift
$((
$OPTIND
-
1
))
...
...
@@ -65,4 +65,3 @@ for i in $dns $@; do
mkdir
-p
"
${
conf
%/*
}
"
echo
"nameserver
$i
"
>>
$conf
done
setup-gparted-desktop.in
View file @
cb474e20
...
...
@@ -39,4 +39,3 @@ EOF
echo
""
echo
" To start GParted run: startx"
echo
""
setup-hostname.in
View file @
cb474e20
...
...
@@ -6,7 +6,7 @@ PREFIX=
.
$PREFIX
/lib/libalpine.sh
usage
()
{
cat
<<
__EOF__
cat
<<
__EOF__
usage: setup-hostname [-h] [HOSTNAME]
Sets the system hostname.
...
...
@@ -16,7 +16,7 @@ options:
Sets hostname to HOSTNAME or prompt if unspecified.
__EOF__
exit
1
exit
1
}
...
...
@@ -40,10 +40,10 @@ valid_hostname() {
}
while
getopts
"hn:"
opt
;
do
case
$opt
in
case
$opt
in
h
)
usage
;;
n
)
name
=
"
$OPTARG
"
;;
esac
esac
done
shift
$((
$OPTIND
-
1
))
if
[
-z
"
$name
"
]
&&
[
$#
-eq
1
]
;
then
...
...
@@ -67,4 +67,3 @@ done
mkdir
-p
"
$ROOT
/etc"
echo
"
$HOST
"
>
"
$ROOT
/etc/hostname"
setup-interfaces.in
View file @
cb474e20
...
...
@@ -208,7 +208,7 @@ config_iface() {
raw_device
=
$(
cat
$iface
.raw_device
)
echo
"raw_device=
\"
$raw_device
\"
"
>>
$conf
fi
if
is_wifi
$iface
;
then
if
is_wifi
$iface
;
then
apk add
--quiet
--no-progress
wireless-tools wpa_supplicant
||
prompt_for_interfaces
echo
"Available wireless networks (scanning):"
if
find_essids
$iface
;
then
...
...
@@ -223,7 +223,7 @@ config_iface() {
echo
-e
"
\n
No available wireless networks
\n
"
prompt_for_interfaces
fi
fi
fi
# use ipcalc to validate the address. we do accept /mask
# we are no interested in the result, only error code, so
# we send result to /dev/null
...
...
@@ -407,7 +407,7 @@ config_vlan() {
}
usage
()
{
cat
<<
__EOF__
cat
<<
__EOF__
usage: setup-interfaces [-bhi]
Setup network interfaces
...
...
@@ -417,7 +417,7 @@ options:
-h Show this help
-i Read new contents of
${
ROOT
}
etc/network/interfaces from stdin
__EOF__
exit
1
exit
1
}
iface_help
()
{
...
...
@@ -553,12 +553,12 @@ ask_bridge=
is_xen_dom0
&&
ask_bridge
=
1
while
getopts
"bhip:"
opt
;
do
case
$opt
in
case
$opt
in
b
)
ask_bridge
=
1
;;
h
)
usage
;;
h
)
usage
;;
i
)
STDINPUT
=
1
;;
p
)
ROOT
=
$OPTARG
;;
esac
esac
done
mkdir
-p
$ROOT
/etc/network
...
...
setup-lbu.in
View file @
cb474e20
...
...
@@ -5,7 +5,7 @@ PREFIX=
.
"
$PREFIX
/lib/libalpine.sh"
usage
()
{
cat
<<
__EOF__
cat
<<
__EOF__
usage: setup-lbu [-hq] [MEDIA]
Setup lbu media settings.
...
...
@@ -17,7 +17,7 @@ options:
-q Quietly pick best suggestion. Only prompts user if unsure.
__EOF__
exit
1
exit
1
}
get_mnt_line
()
{
...
...
@@ -94,10 +94,10 @@ set_media() {
}
while
getopts
"hq"
opt
;
do
case
$opt
in
case
$opt
in
h
)
usage
;;
q
)
quiet
=
1
;;
esac
esac
done
shift
$((
$OPTIND
-
1
))
...
...
@@ -146,5 +146,3 @@ if [ "$media" = "none" ]; then
fi
set_media
"
$media
"
setup-mta.in
View file @
cb474e20
...
...
@@ -48,4 +48,3 @@ apk add ssmtp
setcfg mailhub
$mailhub
setcfg FromLineOverride YES
setup-ntp.in
View file @
cb474e20
...
...
@@ -5,7 +5,7 @@ PREFIX=
.
"
$PREFIX
/lib/libalpine.sh"
usage
()
{
cat
<<
__EOF__
cat
<<
__EOF__
usage: setup-ntp [-h] [-c choice of NTP daemon]
Setup NTP time synchronization
...
...
@@ -14,19 +14,19 @@ options:
-h Show this help
-c Choice of NTP daemon: busybox openntpd chrony none
__EOF__
exit
1
exit
1
}
while
getopts
"hc:"
opt
;
do
case
$opt
in
c
)
ntpchoice
=
"
$OPTARG
"
;;
case
$opt
in
c
)
ntpchoice
=
"
$OPTARG
"
;;
h
)
usage
;;
esac
esac
done
if
[
-z
"
$ntpchoice
"
]
;
then
echo
-n
"Which NTP client to run? ('busybox', 'openntpd', 'chrony' or 'none') [chrony] "
default_read ntpchoice
"chrony"
echo
-n
"Which NTP client to run? ('busybox', 'openntpd', 'chrony' or 'none') [chrony] "
default_read ntpchoice
"chrony"
fi
pkgs
=
"
$ntpchoice
"
...
...
@@ -53,4 +53,3 @@ esac
[
-z
"
$pkgs
"
]
||
apk add
--quiet
$pkgs
rc-update add
$svc
default
rc-service
$svc
start
setup-proxy.in
View file @
cb474e20
...
...
@@ -17,7 +17,7 @@ options:
If PROXYURL is not specified user will be prompted.
__EOF__
exit
1
exit
1
}
...
...
@@ -68,4 +68,3 @@ fi
if
[
-z
"
$quiet
"
]
;
then
echo
-e
"
\n
To make changes active please do login again or source
$PROFILE
\n
with
\"
.
$PROFILE
\"
"
fi
setup-sshd.in
View file @
cb474e20
...
...
@@ -5,7 +5,7 @@ PREFIX=
.
"
$PREFIX
/lib/libalpine.sh"
usage
()
{
cat
<<
__EOF__
cat
<<
__EOF__
usage: setup-sshd [-h] [-c choice of SSH daemon]
Setup sshd daemon
...
...
@@ -14,14 +14,14 @@ options:
-h Show this help
-c Choice of SSH daemon: openssh dropbear none
__EOF__
exit
1
exit
1
}
while
getopts
"hc:"
opt
;
do
case
$opt
in
case
$opt
in
h
)
usage
;;
c
)
sshdchoice
=
"
$OPTARG
"
;;
esac
esac
done
if
[
"
$sshdchoice
"
=
""
]
;
then
...
...
@@ -29,7 +29,7 @@ if [ "$sshdchoice" = "" ]; then
default_read sshdchoice
"openssh"
fi
if
[
"
$sshdchoice
"
=
"none"
]
;
then
if
[
"
$sshdchoice
"
=
"none"
]
;
then
exit
0
fi
...
...
@@ -50,4 +50,3 @@ if [ -n "$svc" ]; then
rc-update add
$svc
default
rc-service
$svc
start
fi
setup-timezone.in
View file @
cb474e20
...
...
@@ -7,7 +7,7 @@ PREFIX=
zroot
=
/usr/share/zoneinfo
usage
()
{
cat
<<
__EOF__
cat
<<
__EOF__
usage: setup-timezone [-h] [-k|-i] [-z TIMEZONE]
Sets the timezone for the system.
...
...
@@ -18,7 +18,7 @@ options:
-k Keep previous copies of tzdata
-z Set given timezone. (relative
$zroot
)
__EOF__
exit
1
exit
1
}
show_tz_list
()
{
...
...
@@ -60,12 +60,12 @@ setup_tz() {
INSTALL_TZDATA
=
false
KEEP_TZDATA
=
false
while
getopts
"hikz:"
opt
;
do
case
$opt
in
h
)
usage
;;
case
$opt
in
h
)
usage
;;
i
)
INSTALL_TZDATA
=
true
;;
k
)
KEEP_TZDATA
=
true
;;
z
)
ZONE
=
"
$OPTARG
"
;;
esac
esac
done
if
$INSTALL_TZDATA
;
then
...
...
@@ -119,4 +119,3 @@ done
if
[
-n
"
$apkdel
"
]
;
then
apk del
--quiet
$apkdel
fi
setup-xfce-desktop
View file @
cb474e20
...
...
@@ -3,4 +3,3 @@
videodrivers
=
$(
apk search
--quiet
--exact
xf86-video
*
|
grep
-v
--
'-doc$'
)
setup-xorg-base
$videodrivers
xfce4 firefox slim
setup-xfce-desktop.in
View file @
cb474e20
...
...
@@ -3,4 +3,3 @@
videodrivers
=
$(
apk search
--quiet
--exact
xf86-video
*
|
grep
-v
--
'-doc$'
)
setup-xorg-base
$videodrivers
xfce4 firefox slim
Prev
1
2
Next
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment