Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
alpine-conf
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
17
Issues
17
List
Boards
Labels
Service Desk
Milestones
Merge Requests
6
Merge Requests
6
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
alpine
alpine-conf
Commits
2d0772e8
Commit
2d0772e8
authored
May 21, 2009
by
Natanael Copa
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
setup-disk: initial support for specifying a mounted root
nangel helped me with this one
parent
f4499c0b
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
52 additions
and
28 deletions
+52
-28
setup-disk.in
setup-disk.in
+52
-28
No files found.
setup-disk.in
View file @
2d0772e8
...
...
@@ -14,6 +14,51 @@ in_list() {
return
1
}
enumerate_fstab
()
{
[
-z
"
$1
"
]
&&
return
grep
"/
$1
"
/proc/mounts |
\
sed
"s-/
$1
-/-; s-//-/-"
}
install_mounted_root
()
{
local
mnt
=
"
$1
"
rootdev
=
$(
awk
"
\$
1 ==
\"
$mnt
\"
{ print
\$
1 }"
)
if
[
-z
"
$rootdev
"
]
;
then
echo
"
$mnt
does not seem to be a mount point"
>
&2
return
1
fi
rootdisk
=
${
rootdev
%[0-9]*
}
echon
"Installing system on
$rootdev
: "
lbu package - |
tar
-C
"
$mnt
"
-zx
apk add
-q
--progress
--root
"
$mnt
"
$(
cat
"
$mnt
"
/var/lib/apk/world
)
\
linux-grsec linux-grsec-mod acct mkinitfs
echo
""
# make things bootable
kernel
=
$(
ls
"
$mnt
"
/lib/modules
)
chroot
"
$mnt
"
/sbin/mkinitfs
-F
"ata base bootchart cdrom ext3 ide scsi usb"
$kernel
# create an extlinux.conf
sed
'/append initrd/d'
/media/
*
/syslinux.cfg
>
"
$mnt
"
/boot/extlinux.conf
echo
-e
"
\t
append initrd=/boot/grsec.gz root=
$rootdev
modules=ext3 quiet"
>>
"
$mnt
"
/boot/extlinux.conf
# fix the fstab
enumerate_fstab
"
$mnt
"
>>
"
$mnt
"
/etc/fstab
# install extlinux
apk add
-q
syslinux
extlinux
-i
"
$mnt
"
/boot
umount
"
$mnt
"
# fix mbr
dd
if
=
/usr/share/syslinux/mbr.bin
of
=
$rootdisk
echo
""
echo
"Installation is done. Please reboot."
apk del
-q
syslinux
}
useall
()
{
local
i size
echo
"Creating root partition..."
...
...
@@ -36,36 +81,15 @@ useall() {
apk del
-q
parted e2fsprogs
mount
-t
ext3
$rootdev
/mnt
||
return
1
echon
"Installing system on
$rootdev
: "
lbu package - |
tar
-C
/mnt
-zx
apk add
-q
--progress
--root
/mnt
$(
cat
/mnt/var/lib/apk/world
)
\
linux-grsec linux-grsec-mod acct mkinitfs
echo
""
# make things bootable
kernel
=
$(
ls
/mnt/lib/modules
)
chroot
/mnt /sbin/mkinitfs
-F
"ata base bootchart cdrom ext3 ide scsi usb"
$kernel
# create an extlinux.conf
sed
'/append initrd/d'
/media/
*
/syslinux.cfg
>
/mnt/boot/extlinux.conf
echo
-e
"
\t
append initrd=/boot/grsec.gz root=
$rootdev
modules=ext3 quiet"
>>
/mnt/boot/extlinux.conf
# fix the fstab
echo
-e
"
$rootdev
\t
/
\t\t
ext3
\t
defaults
\t
1 1"
>>
/mnt/etc/fstab
# install extlinux
apk add
-q
syslinux
extlinux
-i
/mnt/boot
umount /mnt
# fix mbr
dd
if
=
/usr/share/syslinux/mbr.bin
of
=
/dev/
$rootdisk
echo
""
echo
"Installation is done. Please reboot."
apk del
-q
syslinux
install_mounted_root /mnt
}
if
[
-d
"
$1
"
]
;
then
# install to given mounted root
install_mounted_root
"
$1
"
exit
$?
fi
usbdisk
=
$(
readlink
/dev/usbdisk
)
disks
=
cd
/dev
...
...
Write
Preview
Markdown
is supported
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